| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);let f=require(`obsidian`),p=require(`@codemirror/language`),m=require(`@codemirror/state`),h=require(`@codemirror/view`);var g=typeof globalThis<`u`?globalThis:null,_=(e,t)=>({didTimeout:typeof t==`number`?Date.now()-e>=t:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-e))}),v=(e,t)=>{let n=Date.now();return setTimeout(()=>{e(_(n,t?.timeout))},1)},y=e=>{clearTimeout(e)};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)}),g&&typeof g.requestIdleCallback!=`function`&&(g.requestIdleCallback=v),g&&typeof g.cancelIdleCallback!=`function`&&(g.cancelIdleCallback=y);var b=(e,t)=>{let n=g?.requestIdleCallback;return typeof n==`function`?n.call(g,e,t):v(e,t)},x=e=>{let t=g?.cancelIdleCallback;if(typeof t==`function`){t.call(g,e);return}y(e)},S=s((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=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`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+ee(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+ee(s,l);c+=A(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+ee(s,l++),c+=A(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function te(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var re={current:null},ie={transition:null},ae={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:ie,ReactCurrentOwner:C};function oe(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ae,e.act=oe,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=ie.transition;ie.transition={};try{e()}finally{ie.transition=t}},e.unstable_act=oe,e.useCallback=function(e,t){return re.current.useCallback(e,t)},e.useContext=function(e){return re.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return re.current.useDeferredValue(e)},e.useEffect=function(e,t){return re.current.useEffect(e,t)},e.useId=function(){return re.current.useId()},e.useImperativeHandle=function(e,t,n){return re.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return re.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return re.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return re.current.useMemo(e,t)},e.useReducer=function(e,t,n){return re.current.useReducer(e,t,n)},e.useRef=function(e){return re.current.useRef(e)},e.useState=function(e){return re.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return re.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return re.current.useTransition()},e.version=`18.3.1`})),C=s(((e,t)=>{t.exports=S()})),w=c({DEFAULT_DAILY_NOTE_FORMAT:()=>Se,DEFAULT_MONTHLY_NOTE_FORMAT:()=>we,DEFAULT_QUARTERLY_NOTE_FORMAT:()=>Te,DEFAULT_WEEKLY_NOTE_FORMAT:()=>Ce,DEFAULT_YEARLY_NOTE_FORMAT:()=>Ee,DailyNotesFolderMissingError:()=>Oe,PeriodicNotesFolderMissingError:()=>ke,appHasDailyNotesPluginLoaded:()=>re,appHasPeriodicNotesPluginLoaded:()=>ie,clearThinoPeriodicSettings:()=>E,createDailyNote:()=>be,createPeriodicNote:()=>xe,getAllDailyNotes:()=>ge,getAllPeriodicNotes:()=>_e,getDailyNote:()=>ve,getDailyNoteSettings:()=>O,getDateFromFile:()=>de,getDateFromFilename:()=>ue,getDateFromPath:()=>fe,getDateUID:()=>ae,getMonthlyNoteSettings:()=>ee,getPeriodicNote:()=>ye,getPeriodicNoteSettings:()=>ne,getQuarterlyNoteSettings:()=>A,getWeeklyNoteSettings:()=>k,getYearlyNoteSettings:()=>te,setThinoPeriodicSettings:()=>T});function T(e,t){Ae[e]=t}function E(e){e?delete Ae[e]:Ae={}}function D(e){let t=window.app?.plugins?.getPlugin(`periodic-notes`);return t&&t.settings?.[e]?.enabled}function O(){return ne(`day`)}function k(){return ne(`week`)}function ee(){return ne(`month`)}function A(){return ne(`quarter`)}function te(){return ne(`year`)}function ne(e){let t=Ae[e];if(t)return{format:t.format||De[e],folder:t.folder?.trim()||``,template:t.template?.trim()||``};try{let t=window.app,n={day:`daily`,week:`weekly`,month:`monthly`,quarter:`quarterly`,year:`yearly`};if(D(n[e])){let r=t.plugins.getPlugin(`periodic-notes`),i=r?.calendarSetManager?.getActiveConfig(e);if(i)return{format:i.format||De[e],folder:i.folder?.trim()||``,template:i.template?.trim()||``};let a=r?.settings?.[n[e]];if(a)return{format:a.format||De[e],folder:a.folder?.trim()||``,template:a.template?.trim()||``}}if(e===`day`){let e=t.internalPlugins?.getPluginById(`daily-notes`)?.instance?.options;if(e)return{format:e.format||`YYYY-MM-DD`,folder:e.folder?.trim()||``,template:e.template?.trim()||``}}}catch(e){console.info(`No custom periodic note settings found!`,e)}return{format:De[e],folder:``,template:``}}function re(){let e=window.app,t=e.internalPlugins?.plugins?.[`daily-notes`];if(t&&t.enabled)return!0;let n=e.plugins?.getPlugin(`periodic-notes`);return!!(n&&n.settings?.daily?.enabled)}function ie(e){let t=window.app;if(e===`day`)return re();let n={day:`daily`,week:`weekly`,month:`monthly`,quarter:`quarterly`,year:`yearly`},r=t.plugins?.getPlugin(`periodic-notes`);return!!(r&&r.settings?.[n[e]]?.enabled)}function ae(e,t=`day`){return`${t}-${e.clone().startOf(t).format()}`}function oe(e){return e.replace(/\[[^\]]*\]/g,``)}function se(e,t){if(t===`week`){let t=oe(e);return/w{1,2}/i.test(t)&&(/M{1,4}/.test(t)||/D{1,4}/.test(t))}return!1}function ce(){let e=window.moment?.locale?.(),t=[e,`zh-cn`,`zh-tw`,`en`];return typeof e==`string`&&e.includes(`-`)&&t.push(e.split(`-`)[0]),Array.from(new Set(t.filter(Boolean)))}function le(e,t){let n=window.moment,r=n.locale();for(let i of ce())try{n.locale(i);let r=n(e,t,!0);if(r.isValid())return r.clone()}finally{n.locale(r)}return null}function ue(e,t){let n=(ne(t).format||De[t]).split(`/`).pop(),r=le(e,n);if(!r)return null;if(se(n,t)&&t===`week`){let t=oe(n);if(/w{1,2}/i.test(t))return le(e,n.replace(/M{1,4}/g,``).replace(/D{1,4}/g,``))}return r}function de(e,t){return ue(e.basename,t)}function fe(e,t){return ue(e.split(`/`).pop()?.replace(/\.[^.]+$/,``)||``,t)}async function pe(e){let t=window.app;if(!e?.trim())return[``,null];try{let n=(0,f.normalizePath)(e),r=t.metadataCache.getFirstLinkpathDest(n,``);return r||=t.vault.getAbstractFileByPath(n.endsWith(`.md`)?n:`${n}.md`),r?[await t.vault.cachedRead(r),t.foldManager?.load(r)??null]:(new f.Notice(`Failed to find template file: "${e}"`),[``,null])}catch(t){return console.error(`Failed to read template: "${e}"`,t),new f.Notice(`Failed to read template: "${e}"`),[``,null]}}function me(e,t,n){let r=window.moment(),i=t.format(n);return e.replace(/{{\s*date\s*}}/gi,i).replace(/{{\s*time\s*}}/gi,r.format(`HH:mm`)).replace(/{{\s*title\s*}}/gi,i).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(e,i,a,o,s,c)=>{let l=t.clone().set({hour:r.get(`hour`),minute:r.get(`minute`),second:r.get(`second`)});return a&&l.add(parseInt(o,10),s),c?l.format(c.substring(1).trim()):l.format(n)}).replace(/{{\s*yesterday\s*}}/gi,t.clone().subtract(1,`day`).format(n)).replace(/{{\s*tomorrow\s*}}/gi,t.clone().add(1,`day`).format(n))}async function he(e,t){let{vault:n}=window.app,r=(0,f.normalizePath)(e?`${e}/${t}`:t),i=r.substring(0,r.lastIndexOf(`/`));return i&&!(n.getAbstractFileByPath(i)instanceof f.TFolder)&&await n.createFolder(i),`${r}.md`}function ge(){return _e(`day`)}function _e(e){let{vault:t}=window.app,{folder:n}=ne(e),r=t.getAbstractFileByPath((0,f.normalizePath)(n||`/`));if(!r)throw new ke(`Failed to find ${e} notes folder: "${n}"`);let i={},a=t=>{if(t instanceof f.TFile&&t.extension===`md`){let n=de(t,e);if(n){let r=ae(n,e);i[r]=t}}else if(t instanceof f.TFolder)for(let e of t.children)a(e)};return a(r),i}function ve(e,t){return t[ae(e,`day`)]??null}function ye(e,t,n){return t[ae(e,n)]??null}async function be(e){return xe(e,`day`)}async function xe(e,t){let n=window.app,{vault:r}=n,{template:i,format:a,folder:o}=ne(t),[s,c]=await pe(i),l=await he(o,e.format(a));try{let t=me(s,e,a),i=await r.create(l,t);return c&&n.foldManager?.save(i,c),i}catch(e){throw console.error(`Failed to create file: '${l}'`,e),new f.Notice(`Unable to create new file.`),e}}var Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je=o((()=>{Se=`YYYY-MM-DD`,Ce=`gggg-[W]ww`,we=`YYYY-MM`,Te=`YYYY-[Q]Q`,Ee=`YYYY`,De={day:Se,week:Ce,month:we,quarter:Te,year:Ee},Oe=class extends Error{},ke=class extends Error{},Ae={}})),Me,Ne,Pe=o((()=>{Me=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Ne=(e=>e?Me(e):Me)}));function Fe(e,t=Le){let n=Ie.useSyncExternalStore(e.subscribe,Ie.useCallback(()=>t(e.getState()),[e,t]),Ie.useCallback(()=>t(e.getInitialState()),[e,t]));return Ie.useDebugValue(n),n}var Ie,Le,Re,ze,Be=o((()=>{Ie=u(C(),1),Pe(),Le=e=>e,Re=e=>{let t=Ne(e),n=e=>Fe(t,e);return Object.assign(n,t),n},ze=(e=>e?Re(e):Re)})),Ve=o((()=>{Pe(),Be()}));function He(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt=o((()=>{Ue=new Map,We=e=>{let t=Ue.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},Ge=(e,t,n)=>{if(e===void 0)return{type:`untracked`,connection:t.connect(n)};let r=Ue.get(n.name);if(r)return{type:`tracked`,store:e,...r};let i={connection:t.connect(n),stores:{}};return Ue.set(n.name,i),{type:`tracked`,store:e,...i}},Ke=(e,t)=>{if(t===void 0)return;let n=Ue.get(e);n&&(delete n.stores[t],Object.keys(n.stores).length===0&&Ue.delete(e))},qe=e=>{if(!e)return;let t=e.split(`
- `),n=t.findIndex(e=>e.includes(`api.setState`));if(n<0)return;let r=t[n+1]?.trim()||``;return/.+ (.+) .+/.exec(r)?.[1]},Je=(e,t={})=>(n,r,i)=>{let{enabled:a,anonymousActionType:o,store:s,...c}=t,l;try{l=(a??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return e(n,r,i);let{connection:u,...d}=Ge(s,l,c),f=!0;i.setState=((e,t,a)=>{let l=n(e,t);if(!f)return l;let d=a===void 0?{type:o||qe(Error().stack)||`anonymous`}:typeof a==`string`?{type:a}:a;return s===void 0?(u?.send(d,r()),l):(u?.send({...d,type:`${s}/${d.type}`},{...We(c.name),[s]:i.getState()}),l)}),i.devtools={cleanup:()=>{u&&typeof u.unsubscribe==`function`&&u.unsubscribe(),Ke(c.name,s)}};let p=(...e)=>{let t=f;f=!1,n(...e),f=t},m=e(i.setState,r,i);if(d.type===`untracked`?u?.init(m):(d.stores[d.store]=i,u?.init(Object.fromEntries(Object.entries(d.stores).map(([e,t])=>[e,e===d.store?m:t.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch==`function`){let e=i.dispatch;i.dispatch=(...t)=>{e(...t)}}return u.subscribe(e=>{switch(e.type){case`ACTION`:if(typeof e.payload!=`string`){console.error(`[zustand devtools middleware] Unsupported action format`);return}return Xe(e.payload,e=>{if(e.type===`__setState`){if(s===void 0){p(e.state);return}Object.keys(e.state).length!==1&&console.error(`
- [zustand devtools middleware] Unsupported __setState action format.
- When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
- and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
- `);let t=e.state[s];if(t==null)return;JSON.stringify(i.getState())!==JSON.stringify(t)&&p(t);return}i.dispatchFromDevtools&&typeof i.dispatch==`function`&&i.dispatch(e)});case`DISPATCH`:switch(e.payload.type){case`RESET`:return p(m),s===void 0?u?.init(i.getState()):u?.init(We(c.name));case`COMMIT`:if(s===void 0){u?.init(i.getState());return}return u?.init(We(c.name));case`ROLLBACK`:return Xe(e.state,e=>{if(s===void 0){p(e),u?.init(i.getState());return}p(e[s]),u?.init(We(c.name))});case`JUMP_TO_STATE`:case`JUMP_TO_ACTION`:return Xe(e.state,e=>{if(s===void 0){p(e);return}JSON.stringify(i.getState())!==JSON.stringify(e[s])&&p(e[s])});case`IMPORT_STATE`:{let{nextLiftedState:t}=e.payload,n=t.computedStates.slice(-1)[0]?.state;if(!n)return;p(s===void 0?n:n[s]),u?.send(null,t);return}case`PAUSE_RECORDING`:return f=!f}return}}),m},Ye=Je,Xe=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){console.error(`[zustand devtools middleware] Could not parse the received json`,e)}n!==void 0&&t(n)},Ze=e=>(t,n,r)=>{let i=r.subscribe;return r.subscribe=((e,t,n)=>{let a=e;if(t){let i=n?.equalityFn||Object.is,o=e(r.getState());a=n=>{let r=e(n);if(!i(o,r)){let e=o;t(o=r,e)}},n?.fireImmediately&&t(o,o)}return i(a)}),e(t,n,r)},Qe=Ze,$e=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return $e(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return $e(t)(e)}}}},et=(e,t)=>(n,r,i)=>{let a={storage:He(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=new Set,c=new Set,l=a.storage;if(!l)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let u=()=>{let e=a.partialize({...r()});return l.setItem(a.name,{state:e,version:a.version})},d=i.setState;i.setState=(e,t)=>(d(e,t),u());let f=e((...e)=>(n(...e),u()),r,i);i.getInitialState=()=>f;let p,m=()=>{if(!l)return;o=!1,s.forEach(e=>e(r()??f));let e=a.onRehydrateStorage?.call(a,r()??f)||void 0;return $e(l.getItem.bind(l))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(e=>{let[t,i]=e;if(p=a.merge(i,r()??f),n(p,!0),t)return u()}).then(()=>{e?.(p,void 0),p=r(),o=!0,c.forEach(e=>e(p))}).catch(t=>{e?.(void 0,t)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(l=e.storage)},clearStorage:()=>{l?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},a.skipHydration||m(),p||f},tt=et}));function rt(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}function it(e){return!!e&&!!e[Ht]}function at(e){return e?ot(e)||Array.isArray(e)||!!e[Vt]||!!e.constructor?.[Vt]||ft(e)||pt(e):!1}function ot(e){if(!e||typeof e!=`object`)return!1;let t=Ut(e);if(t===null)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;return n===Object?!0:typeof n==`function`&&Function.toString.call(n)===Wt}function st(e,t){ct(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ct(e){let t=e[Ht];return t?t.type_:Array.isArray(e)?1:ft(e)?2:pt(e)?3:0}function lt(e,t){return ct(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ut(e,t,n){let r=ct(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function dt(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function ft(e){return e instanceof Map}function pt(e){return e instanceof Set}function mt(e){return e.copy_||e.base_}function ht(e,t){if(ft(e))return new Map(e);if(pt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=ot(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[Ht];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Ut(e),t)}else{let t=Ut(e);return t!==null&&n?{...e}:Object.assign(Object.create(t),e)}}function gt(e,t=!1){return vt(e)||it(e)||!at(e)?e:(ct(e)>1&&Object.defineProperties(e,{set:{value:_t},add:{value:_t},clear:{value:_t},delete:{value:_t}}),Object.freeze(e),t&&Object.values(e).forEach(e=>gt(e,!0)),e)}function _t(){rt(2)}function vt(e){return Object.isFrozen(e)}function yt(e){let t=Gt[e];return t||rt(0,e),t}function bt(){return Kt}function xt(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function St(e,t){t&&(yt(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ct(e){wt(e),e.drafts_.forEach(Et),e.drafts_=null}function wt(e){e===Kt&&(Kt=e.parent_)}function Tt(e){return Kt=xt(Kt,e)}function Et(e){let t=e[Ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Dt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ht].modified_&&(Ct(t),rt(4)),at(e)&&(e=Ot(t,e),t.parent_||At(t,e)),t.patches_&&yt(`Patches`).generateReplacementPatches_(n[Ht].base_,e,t.patches_,t.inversePatches_)):e=Ot(t,n,[]),Ct(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Bt?void 0:e}function Ot(e,t,n){if(vt(t))return t;let r=t[Ht];if(!r)return st(t,(i,a)=>kt(e,r,t,i,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return At(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let t=r.copy_,i=t,a=!1;r.type_===3&&(i=new Set(t),t.clear(),a=!0),st(i,(i,o)=>kt(e,r,t,i,o,n,a)),At(e,t,!1),n&&e.patches_&&yt(`Patches`).generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function kt(e,t,n,r,i,a,o){if(it(i)){let o=Ot(e,i,a&&t&&t.type_!==3&&!lt(t.assigned_,r)?a.concat(r):void 0);if(ut(n,r,o),it(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(at(i)&&!vt(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ot(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(ft(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&At(e,i)}}function At(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&>(t,n)}function jt(e,t){let n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:bt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=qt;n&&(i=[r],a=Jt);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}function Mt(e,t){let n=e[Ht];return(n?mt(n):e)[t]}function Nt(e,t,n){let r=Pt(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function Pt(e,t){if(!(t in e))return;let n=Ut(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Ut(n)}}function Ft(e){e.modified_||(e.modified_=!0,e.parent_&&Ft(e.parent_))}function It(e){e.copy_||=ht(e.base_,e.scope_.immer_.useStrictShallowCopy_)}function Lt(e,t){let n=ft(e)?yt(`MapSet`).proxyMap_(e,t):pt(e)?yt(`MapSet`).proxySet_(e,t):jt(e,t);return(t?t.scope_:bt()).drafts_.push(n),n}function Rt(e){return it(e)||rt(10,e),zt(e)}function zt(e){if(!at(e)||vt(e))return e;let t=e[Ht],n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ht(e,t.scope_.immer_.useStrictShallowCopy_)}else n=ht(e,!0);return st(n,(e,t)=>{ut(n,e,zt(t))}),t&&(t.finalized_=!1),n}var Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt=o((()=>{Bt=Symbol.for(`immer-nothing`),Vt=Symbol.for(`immer-draftable`),Ht=Symbol.for(`immer-state`),Ut=Object.getPrototypeOf,Wt=Object.prototype.constructor.toString(),Gt={},qt={get(e,t){if(t===Ht)return e;let n=mt(e);if(!lt(n,t))return Nt(e,n,t);let r=n[t];return e.finalized_||!at(r)?r:r===Mt(e.base_,t)?(It(e),e.copy_[t]=Lt(r,e)):r},has(e,t){return t in mt(e)},ownKeys(e){return Reflect.ownKeys(mt(e))},set(e,t,n){let r=Pt(mt(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Mt(mt(e),t),i=r?.[Ht];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(dt(n,r)&&(n!==void 0||lt(e.base_,t)))return!0;It(e),Ft(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty(e,t){return Mt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,It(e),Ft(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=mt(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){rt(11)},getPrototypeOf(e){return Ut(e.base_)},setPrototypeOf(){rt(12)}},Jt={},st(qt,(e,t)=>{Jt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Jt.deleteProperty=function(e,t){return Jt.set.call(this,e,t,void 0)},Jt.set=function(e,t,n){return qt.set.call(this,e[0],t,n,e[0])},Yt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&rt(6),n!==void 0&&typeof n!=`function`&&rt(7);let r;if(at(e)){let i=Tt(this),a=Lt(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?Ct(i):wt(i)}return St(i,n),Dt(r,i)}else if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===Bt&&(r=void 0),this.autoFreeze_&>(r,!0),n){let t=[],i=[];yt(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}else rt(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){at(e)||rt(8),it(e)&&(e=Rt(e));let t=Tt(this),n=Lt(e,void 0);return n[Ht].isManual_=!0,wt(t),n}finishDraft(e,t){let n=e&&e[Ht];(!n||!n.isManual_)&&rt(9);let{scope_:r}=n;return St(r,t),Dt(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=yt(`Patches`).applyPatches_;return it(e)?r(e,t):this.produce(e,e=>r(e,t))}},Xt=new Yt,Zt=Xt.produce})),$t,en,tn=o((()=>{Qt(),$t=e=>(t,n,r)=>(r.setState=(e,n,...r)=>t(typeof e==`function`?Zt(e):e,n,...r),e(r.setState,n,r)),en=$t}));function nn(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function rn(e,t){let n,r=()=>{if(n)return n;let r=indexedDB.open(e);return r.onupgradeneeded=()=>r.result.createObjectStore(t),n=nn(r),n.then(e=>{e.onclose=()=>n=void 0},()=>{}),n};return(e,n)=>r().then(r=>n(r.transaction(t,e).objectStore(t)))}function an(){return dn||=rn(`keyval-store`,`keyval`),dn}function on(e,t=an()){return t(`readonly`,t=>nn(t.get(e)))}function sn(e,t,n=an()){return n(`readwrite`,n=>(n.put(t,e),nn(n.transaction)))}function cn(e,t=an()){return t(`readwrite`,t=>(t.delete(e),nn(t.transaction)))}function ln(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},nn(e.transaction)}function un(e=an()){return e(`readonly`,e=>{if(e.getAllKeys)return nn(e.getAllKeys());let t=[];return ln(e,e=>t.push(e.key)).then(()=>t)})}var dn,fn=o((()=>{}));function pn(e){let{name:t,storageType:n,version:r=1,migrate:i}=e;switch(n){case`localStorage`:return mn(t,r,i);case`sessionStorage`:return hn(t,r,i);case`indexedDB`:return gn(t,r,i);default:throw Error(`Unsupported storage type: ${n}`)}}function mn(e,t,n){return{getItem:async e=>{try{let r=localStorage.getItem(e);if(r===null)return null;let i=JSON.parse(r),a=i.version||1;if(n&&a!==t){let r=n(i.state,a),o={state:r,version:t};return localStorage.setItem(e,JSON.stringify(o)),r}return i.state||i}catch(t){return console.error(`Failed to get item from localStorage [${e}]:`,t),null}},setItem:async(e,n)=>{try{let r;if(typeof n==`string`)try{r=JSON.parse(n)}catch{r=n}else r=n;let i={state:r,version:t,updatedAt:Date.now()};localStorage.setItem(e,JSON.stringify(i))}catch(t){console.error(`Failed to set item in localStorage [${e}]:`,t)}},removeItem:async e=>{try{localStorage.removeItem(e)}catch(t){console.error(`Failed to remove item from localStorage [${e}]:`,t)}}}}function hn(e,t,n){return{getItem:async e=>{try{let r=sessionStorage.getItem(e);if(r===null)return null;let i=JSON.parse(r),a=i.version||1;if(n&&a!==t){let r=n(i.state,a),o={state:r,version:t};return sessionStorage.setItem(e,JSON.stringify(o)),r}return i.state||i}catch(t){return console.error(`Failed to get item from sessionStorage [${e}]:`,t),null}},setItem:async(e,n)=>{try{let r;if(typeof n==`string`)try{r=JSON.parse(n)}catch{r=n}else r=n;let i={state:r,version:t,updatedAt:Date.now()};sessionStorage.setItem(e,JSON.stringify(i))}catch(t){console.error(`Failed to set item in sessionStorage [${e}]:`,t)}},removeItem:async e=>{try{sessionStorage.removeItem(e)}catch(t){console.error(`Failed to remove item from sessionStorage [${e}]:`,t)}}}}function gn(e,t,n){let r=e.includes(`memo`)?_n:vn;return{getItem:async e=>{try{let i=await on(e,r);if(i===void 0)return null;let a=i.version||1;if(n&&a!==t){let o=n(i.state,a);return await sn(e,{state:o,version:t,updatedAt:Date.now()},r),o}return i.state||i}catch(t){return console.error(`Failed to get item from IndexedDB [${e}]:`,t),null}},setItem:async(e,n)=>{try{let i;if(typeof n==`string`)try{i=JSON.parse(n)}catch{i=n}else i=n;await sn(e,{state:i,version:t,updatedAt:Date.now()},r)}catch(r){if(console.error(`Failed to set item in IndexedDB [${e}]:`,r),(typeof n==`string`?n:JSON.stringify(n)).length<5e4)try{let r;if(typeof n==`string`)try{r=JSON.parse(n)}catch{r=n}else r=n;localStorage.setItem(e,JSON.stringify({state:r,version:t,fallback:!0}))}catch(t){console.error(`Fallback to localStorage also failed [${e}]:`,t)}}},removeItem:async e=>{try{await cn(e,r),localStorage.removeItem(e)}catch(t){console.error(`Failed to remove item from IndexedDB [${e}]:`,t)}}}}var _n,vn,yn,bn=o((()=>{fn(),_n=rn(`thino-memo-db`,`memo-data`),vn=rn(`thino-height-db`,`height-cache`),yn={ui:pn({name:`ui-state`,storageType:`localStorage`,version:1}),memos:pn({name:`memo-data`,storageType:`indexedDB`,version:1,migrate:(e,t)=>{if(t<1&&e.memos){let t=Array.isArray(e.memos)?e.memos:[];return{...e,memos:t.filter(e=>e&&e.id)}}return e}}),heightCache:pn({name:`height-cache`,storageType:`sessionStorage`,version:1}),queries:pn({name:`query-data`,storageType:`localStorage`,version:1})}})),xn,Sn=o((()=>{Ve(),nt(),tn(),bn(),xn=ze()(Ye(tt(en(e=>({user:null,signIn:t=>e(e=>{e.user=t}),signOut:()=>e(e=>{e.user=null}),updateUser:t=>e(e=>{e.user&&Object.assign(e.user,t)})})),{name:`user-store-cache`,storage:yn.ui,partialize:e=>({user:e.user?{id:e.user.id,nickname:e.user.nickname,email:e.user.email,role:e.user.role}:null}),version:1}),{name:`user-store`}))})),Cn,wn=o((()=>{Cn={}})),Tn,En=o((()=>{Tn={}})),Dn,On=o((()=>{Dn={welcome:`Velkommen til Thino`,ribbonIconTitle:`Thino`,to:`til`,months:[`Januar`,`Februar`,`Marts`,`April`,`Maj`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`December`],monthsShort:[`Jan.`,`Feb.`,`Mar.`,`Apr.`,`Maj`,`Jun.`,`Jul.`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dec.`],weekDays:[`Søndag`,`Mandag`,`Tirsdag`,`Onsdag`,`Torsdag`,`Fredag`,`Lørdag`],weekDaysShort:[`Søn`,`Man`,`Tir`,`Ons`,`Tor`,`Fre`,`Lør`],year:null,month:null,"Basic Options":`Grundlæggende indstillinger`,"User name":`Brugernavn`,"Set your user name here. 'Memos 😏' By default":`Indstil dit brugernavn her. 'Thino 😏' som standard`,'You can set target heading like "# Heading" to control data location':`Du kan indstille målrubrik som "# Rubrik" for at kontrollere dataplacering`,"Insert after heading":`Indsæt efter rubrik`,"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.":`Du bør indstille samme rubrik nedenfor, hvis du vil indsætte og behandle thino under samme rubrik.`,"Allows admonitions to be created using ":`Tillader at advarselsbokse oprettes ved hjælp af `,"Process Memos below":`Behandl thino nedenfor`,"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.":`Hvis tomt, vil Thino-grænsefladen vise alt thino-indhold; hvis en titel er angivet, vil Thino-grænsefladen kun vise indholdet under den titel, og indhold skrevet andetsteds vil ikke blive vist.`,"Save Memo button label":`Gem thino-knappens etiket`,"The text shown on the save Memo button in the UI. 'NOTEIT' by default.":`Teksten vist på gem thino-knappen i brugergrænsefladen. 'NOTEIT' som standard.`,"Focus on editor when open memos":`Fokuser på editor når thino åbnes`,"Focus on editor when open memos. Focus by default.":`Fokuser på editor når thino åbnes. Fokus som standard.`,"Open daily memos with open memos":`Åbn daglig thino med åben thino`,"Open daily memos with open memos. Open by default.":`Åbn daglig thino med åben thino. Åben som standard.`,"Open Memos when obsidian opens":`Åbn Thino når obsidian åbnes`,"When enable this, Memos will open when Obsidian opens. False by default.":`Når dette er aktiveret, vil Thino åbne når Obsidian åbnes. Deaktiveret som standard.`,"Hide done tasks in Memo list":`Skjul færdige opgaver i Thino-listen`,"Hide all done tasks in Memo list. Show done tasks by default.":`Skjul alle færdige opgaver i Thino-listen. Vis færdige opgaver som standard.`,"Advanced Options":`Avancerede indstillinger`,"UI language for date":`UI-sprog for dato`,"Translates the date UI language. Only 'en' and 'zh' are available.":`Oversætter dato UI-sproget. Kun 'en' og 'zh' er tilgængelige.`,"Default prefix when save thino":`Standard præfiks ved gem thino`,"Set the default prefix when create memo, 'List' by default.":`Indstil standard præfiks ved oprettelse af thino, 'Liste' som standard.`,"Default insert date format":`Standard indsæt datoformat`,"Set the default date format when insert date by @, 'Tasks' by default.":`Indstil standard datoformat ved indsættelse af dato med @, 'Opgaver' som standard.`,"Default editor position on mobile":`Standard editor position på mobil`,"Set the default editor position on Mobile, 'Top' by default.":`Indstil standard editor position på mobil, 'Top' som standard.`,"Use button to show editor on mobile":`Brug knap til at vise editor på mobil`,"Set a float button to call editor on mobile. Only when editor located at the bottom works.":`Indstil en flydende knap til at kalde editor på mobil. Virker kun når editor er placeret i bunden.`,"Show Time When Copy Results":`Vis tid ved kopiering af resultater`,"Show time when you copy results, like 12:00. Copy time by default.":`Vis tid når du kopierer resultater, som 12:00. Kopier tid som standard.`,"Show Date When Copy Results":`Vis dato ved kopiering af resultater`,"Show date when you copy results, like [[2022-01-01]]. Copy date by default.":`Vis dato når du kopierer resultater, som [[2022-01-01]]. Kopier dato som standard.`,"Add Blank Line Between Different Date":`Tilføj tom linje mellem forskellige datoer`,"Add blank line when copy result with date. No blank line by default.":`Tilføj tom linje når du kopierer resultat med dato. Ingen tom linje som standard.`,"Share Options":`Delingsindstillinger`,"Share Memos Image Footer Start":`Del Thino-billede fodtekst start`,"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":`Indstil hvad du vil her, brug {ThinoNum} for at vise antal thino, {UsedDay} for dage. '{ThinoNum} Thino {UsedDay} Dage' som standard`,"Share Memos Image Footer End":`Del Thino-billede fodtekst slut`,"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":`Indstil hvad du vil her, brug {UserName} som dit brugernavn. '✍️ Af {UserName}' som standard`,"Save Shared Image To Folder For Mobile":`Gem delt billede til mappe for mobil`,"Save image to folder for mobile. False by Default":`Gem billede til mappe for mobil. Deaktiveret som standard`,"Say Thank You":`Sig tak`,Donate:`Donér`,"If you like this plugin, consider donating to support continued development:":`Hvis du kan lide dette plugin, overvej at donere for at støtte fortsat udvikling:`,"File Name of Recycle Bin":`Filnavn på papirkurv`,"Set the filename for recycle bin. 'delete' By default":`Indstil filnavnet for papirkurven. 'slet' som standard`,"File Name of Query File":`Filnavn på forespørgselsfil`,"Set the filename for query file. 'query' By default":`Indstil filnavnet for forespørgselsfilen. 'forespørgsel' som standard`,"Use Tags In Vault":`Brug tags i boks`,"Use tags in vault rather than only in Memos. False by default.":`Brug tags i boks i stedet for kun i Thino. Deaktiveret som standard.`,"Ready to convert image into background":`Klar til at konvertere billede til baggrund`,List:`Liste`,Task:`Opgave`,Top:`Top`,Bottom:`Bund`,TAG:`TAG`,DAY:`DAG`,QUERY:`FORESPØRGSEL`,EDIT:`REDIGER`,PIN:`FASTGØR`,UNPIN:`FRIGØR`,DELETE:`SLET`,"CONFIRM!":`BEKRÆFT!`,"CREATE FILTER":`OPRET FILTER`,"Comment it...":`Kommenter det...`,Settings:`Indstillinger`,"Recycle bin":`Papirkurv`,"About Me":`Om mig`,"Fetching data...":`Henter data...`,"Here is No Memos.":`Her er ingen Thino.`,"Frequently Used Tags":`Hyppigt brugte tags`,"What do you think now...":`Hvad tænker du nu...`,READ:`LÆS`,MARK:`MARKÉR`,SHARE:`DEL`,SOURCE:`KILDE`,RESTORE:`GENDAN`,ARCHIVE:`Arkiv`,"Daily Review":`Daglig gennemgang`,"DELETE AT":`SLETTET DEN`,"Noooop!":`Neeej!`,"All Data is Loaded 🎉":`Alle data er indlæst 🎉`,"Quick filter":`Hurtig filter`,TYPE:`TYPE`,LINKED:`LINKET`,"NO TAGS":`INGEN TAGS`,"HAS LINKS":`HAR LINKS`,"HAS IMAGES":`HAR BILLEDER`,INCLUDE:`INKLUDER`,EXCLUDE:`EKSKLUDER`,TEXT:`TEKST`,IS:`ER`,AND:`OG`,OR:`ELLER`,LIST:`LISTE`,ISNOT:`ER IKKE`,PATH:`STI`,METADATA:`METADATA`,SELECT:`VÆLG`,"ADD FILTER TERMS":`TILFØJ FILTERBETINGELSER`,FILTER:`FILTER`,Filter:`Filter`,TITLE:`TITEL`,"CREATE QUERY":`OPRET FORESPØRGSEL`,"EDIT QUERY":`REDIGER FORESPØRGSEL`,MATCH:`MATCH`,TIMES:`GANGE`,"Share Memo Image":`Del Thino-billede`,"↗Click the button to save":`↗Klik på knappen for at gemme`,"Image is generating...":`Billede genereres...`,"Image is loading...":`Billede indlæses...`,"Loading...":`Indlæser...`,"😟 Cannot load image, image link maybe broken":`😟 Kan ikke indlæse billede, billedlink er måske brudt`,"Daily Memos":`Daglige Thino`,"CANCEL EDIT":`ANNULLER REDIGERING`,"LINK TO THE":`LINK TIL`,"Mobile Options":`Mobilindstillinger`,"Experimental Options":`Eksperimentelle indstillinger`,"Don't support web image yet, please input image path in vault":`Understøtter ikke webbilleder endnu, indtast venligst billedsti i boksen`,"Background Image in Dark Theme":`Baggrundsbillede i mørkt tema`,"Background Image in Light Theme":`Baggrundsbillede i lyst tema`,'Set background image in dark theme. Set something like "Daily/one.png"':`Indstil baggrundsbillede i mørkt tema. Indstil noget som "Daglig/et.png"`,'Set background image in light theme. Set something like "Daily/one.png"':`Indstil baggrundsbillede i lyst tema. Indstil noget som "Daglig/et.png"`,'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':`Indstil standard thino-komposition, du bør bruge {TIME} som "TT:mm" og {CONTENT} som indhold. "{TIME} {CONTENT}" som standard`,"Default Memo Composition":`[Forældet] Standard Thino-komposition`,"Show Tasks Label":`Vis opgaveetiket`,"Show tasks label near the time text. False by default":`Vis opgaveetiket nær tidsteksten. Deaktiveret som standard`,"Please Open Memos First":`Åbn venligst Thino først`,DATE:`DATO`,OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:`OBSIDIAN_NLDATES_PLUGIN_IKKE_AKTIVERET`,BEFORE:`FØR`,AFTER:`EFTER`,"Allow Comments On Memos":`Tillad kommentarer på Thino`,"You can comment on memos. False by default":`Du kan kommentere på thino. Deaktiveret som standard`,Import:`Importer`,"TITLE CANNOT BE NULL!":`TITEL KAN IKKE VÆRE TOM!`,"FILTER CANNOT BE NULL!":`FILTER KAN IKKE VÆRE TOMT!`,"Comments In Original DailyNotes/Notes":`Kommentarer i originale daglige noter/noter`,"You should install Dataview Plugin ver 0.5.9 or later to use this feature.":`Du bør installere Dataview Plugin ver 0.5.9 eller senere for at bruge denne funktion.`,"Open Memos Successfully":`Åbn Thino med succes`,"Fetch Memos Error":`😭 Hentningsfejl`,"Copied to clipboard Successfully":`Kopieret til udklipsholder med succes`,"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":`Kontroller om du har åbnet Daily Notes Plugin eller Periodic Notes Plugin`,"Please finish the last filter setting first":`Afslut venligst den sidste filterindstilling først`,"Close Memos Successfully":`Luk Thino med succes`,"Insert as Memo":`Indsæt som Thino`,"Insert file as memo content":`Indsæt fil som thino-indhold`,"Image load failed":`Billedindlæsning mislykkedes`,"Content cannot be empty":`Indhold kan ikke være tomt`,"Unable to create new file.":`Kan ikke oprette ny fil.`,"Failed to fetch deleted memos: ":`Kunne ikke hente slettede thino: `,"RESTORE SUCCEED":`GENDANNELSE LYKKEDES`,"DELETE SUCCEED":`SLETNING LYKKEDES`,"Save Memo button icon":`Gem Thino-knappens ikon`,"The icon shown on the save Memo button in the UI.":`Ikonet vist på gem Thino-knappen i brugergrænsefladen.`,"Fetch Memos From Particular Notes":`Hent Thino fra bestemte noter`,'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':`Du kan indstille enhver Dataview-forespørgsel for thino for at hente det. Alle thino i disse noter vil blive vist på listen. "#memo" som standard`,"Allow Memos to Fetch Memo from Notes":`Tillad Thino at hente Thino fra noter`,"Use Memos to manage all memos in your notes, not only in daily notes. False by default":`Brug Thino til at administrere alle thino i dine noter, ikke kun i daglige noter. Deaktiveret som standard`,"Always Show Memo Comments":`Vis altid Thino-kommentarer`,"Always show memo comments on memos. False by default":`Vis altid thino-kommentarer på thino. Deaktiveret som standard`,"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":`Du har ikke indstillet mappe til daglige noter i hverken periodic-notes eller daily-notes plugins.`,"Please check your daily note plugin OR periodic notes plugin settings":`Kontroller venligst dine indstillinger for daily note plugin ELLER periodic notes plugin`,"Use which plugin's default configuration":`Brug hvilket plugins standardkonfiguration`,"Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":`Thino bruger pluginets standardkonfiguration til at hente thino fra daglig, 'Daglig' som standard.`,Daily:`Daglig`,"Always Show Leaf Sidebar on PC":`Vis altid blad-sidepanel på PC`,"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":`Vis venstre sidepanel på PC/tablet selv når bladbredden er mindre end 875px. Deaktiveret som standard.`,"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":`Du har ikke indstillet format for daglige noter i hverken periodic-notes eller daily-notes plugins.`,"fetch more":`hent mere`,"Search all settings":`Søg i alle indstillinger`,General:`Generelt`,Theme:`Tema`,Share:`Del`,Advanced:`Avanceret`,Thino:`Thino`,"Random Review":`Tilfældig gennemgang`,"ARCHIVED AT":`ARKIVERET DEN`,"Failed to get memos from daily notes":`Kunne ikke hente thino fra daglige noter`,"Failed to delete memo":`Kunne ikke slette thino`,"CTRL + ENTER to save":`CTRL + ENTER for at gemme`,"Started from":`Startet fra`,"Custom Background Image":`Tilpasset baggrundsbillede`,"Set custom background image.":`Indstil tilpasset baggrundsbillede.`,"Custom Memo Footer":`Tilpasset Thino-fodtekst`,"Set custom memo footer.":`Indstil tilpasset thino-fodtekst.`,"Heatmap Color Scheme":`Varmekort farveskema`,"Set different color scheme for heatmap.":`Indstil forskelligt farveskema for varmekort.`,"Enable Local Http Server":`Aktiver lokal Http-server`,"Memos Http Server Port":`Thino Http-server port`,"Set memos http server port to listen. '43999' by default":`Indstil thino http-server port til at lytte. '43999' som standard`,"Default Editor Mode":`Standard editor-tilstand`,"Live-Preview Mode OR Source Mode.":`Live-forhåndsvisning tilstand/Kildetilstand.`,"Save type for Thino":`Gem type for Thino`,DAILY:`DAGLIG`,MULTI:`MULTI`,CANVAS:`LÆRRED`,ALL:`ALLE`,FILE:`FIL`,TODO:`TODO`,DONE:`FÆRDIG`,JOURNAL:`JOURNAL`,OTHER:`ANDET`,"Failed to create daily note, check if it exists.":`Kunne ikke oprette daglig note, kontroller om den eksisterer.`,"Failed to create daily note. Please check if you created a folder for daily notes.":`Kunne ikke oprette daglig note. Kontroller venligst om du har oprettet en mappe til daglige noter.`,"After you verify your account, please refresh this page.":`Efter du har verificeret din konto, opdater venligst denne side.`,Verify:`Verificer`,"Oops! You forget to verify insider account":`Ups! Du glemte at verificere insider-konto`,"If you have any questions, please contact us.":`Hvis du har spørgsmål, kontakt os venligst.`,"Delete Thino Directly":`Slet Thino direkte`,"When delete thino directly, it will not be moved to trash. False by default.":`Når du sletter thino direkte, vil det ikke blive flyttet til papirkurven. Deaktiveret som standard.`,"Enable opening thino globally":`Aktiver åbning af thino globalt`,"Enable opening thino globally. False by default.":`Aktiver åbning af thino globalt. Deaktiveret som standard.`,"Key for opening thino globally":`Tast for at åbne thino globalt`,"Set key for opening thino globally. CTRL + SHIFT + T by default.":`Indstil tast for at åbne thino globalt. CTRL + SHIFT + T som standard.`,"Key for showing thino globally":`Tast for at vise thino globalt`,"Set key for showing thino globally. CTRL + SHIFT + E by default.":`Indstil tast for at vise thino globalt. CTRL + SHIFT + E som standard.`,"Get activation code":`Få aktiveringskode`,"Input activation code here":`Indtast aktiveringskode her`,"Copy Thino id":`Kopier Thino-id`,"Activate Pro Version":`Aktiver Pro-version`,"Please copy Thino id first":`Kopier venligst Thino-id først`,'You can set folder name with file name like "folder/file"':`Du kan indstille mappenavn med filnavn som "mappe/fil"`,'You can set folder name like "folder1/folder2/folder3" to create sub-folder':`Du kan indstille mappenavn som "mappe1/mappe2/mappe3" for at oprette undermappe`,"Default save type":`Standard gem placering`,'Set the default save type for thino. "DAILY" by default':`Indstil standard gem type for thino. "DAGLIG" som standard`,"Sync Thino via PKMer":`Synkroniser Thino via PKMer`,Unlink:`Fjern link`,Link:`Link`,"Connect to PKMer Sync, you can check it in ":`Forbind til PKMer Sync, du kan tjekke det i `,"PKMer Sync":`PKMer Sync`,"Remove successfully":`Fjernet med succes`,Deactivate:`Deaktiver`,Remove:`Fjern`,"Confirm?":`Bekræft?`,"Sync Status":`Synkroniseringsstatus`,"Start or stop sync":`Start eller stop synkronisering`,"Stop sync successfully":`Stop synkronisering med succes`,"Start sync successfully":`Start synkronisering med succes`,Stop:`Stop`,Start:`Start`,"Show thino near mouse":`Vis thino nær mus`,"Query not found":`Forespørgsel ikke fundet`,"Send to clipboard successfully":`Sendt til udklipsholder med succes`,"Thino - Failed to start HTTP server, please check the port is available.":`Thino - Kunne ikke starte HTTP-server, kontroller venligst om porten er tilgængelig.`,"Thino - Started HTTP server on port":`Thino - Startede HTTP-server på port`,"Thino - Terminated HTTP server":`Thino - Afsluttede HTTP-server`,"File not exist":`Fil eksisterer ikke`,"Thino not found":`Thino ikke fundet`,"File not found for the given thino path, is creating a new file":`Fil ikke fundet for den angivne thino-sti, opretter en ny fil`,"Saved sync token successfully":`Gemte synkroniseringstoken med succes`,"Failed to find daily notes folder":`Kunne ikke finde mappe til daglige noter`,"Please install obsidian-hover-editor plugin first":`Installer venligst obsidian-hover-editor plugin først`,"Copied app id successfully":`Kopierede app-id med succes`,"Please input token first":`Indtast venligst token først`,"Please enable sync first":`Aktiver venligst synkronisering først`,"Init Failed":`Initialisering mislykkedes`,"Verify successfully":`Verificeret med succes`,"Failed to verify":`Kunne ikke verificere`,"Folder not found for the given thino path, is creating a new folder":`Mappe ikke fundet for den angivne thino-sti, opretter en ny mappe`,"File not found for the given thino path":`Fil ikke fundet for den angivne thino-sti`,"Failed to read current daily note, check if it exists.":`Kunne ikke læse aktuel daglig note, kontroller om den eksisterer.`,"Failed to save":`Kunne ikke gemme`,"Failed to login, please login again":`Kunne ikke logge ind, log venligst ind igen`,"COPY FAILED":`KOPIERING MISLYKKEDES`,"COPY SUCCEED":`KOPIERING LYKKEDES`,"Copy selected text":`Kopier valgt tekst`,"Copy thino":`Kopier thino`,COPY:`KOPIER`,"This is a pro feature, please upgrade to pro version to use it.":`Dette er en pro-funktion, opgrader venligst til pro-versionen for at bruge den.`,"You can get pro version from: ":`Du kan få pro-versionen fra: `,Save:`Gem`,Cancel:`Annuller`,"Thino Daily Target":`Thino dagligt mål`,Input:`Input`,"#Tag":`#Tag`,"to create tag":`for at oprette tag`,"You have verified your account. Congrats!":`Du har verificeret din konto. Tillykke!`,"Pro features":`Pro-funktioner`,"Target Thino Count":`Målrettet Thino-antal`,on:`på`,"Switch waterfall view":`Skift vandfald-visning`,"Switch view":`Skift visning`,"Switch list view":`Skift listevisning`,"Set daily target":`Indstil dagligt mål`,"Thino Save To: ":`Thino gem til: `,"Enter fullscreen mode":`Gå til fuldskærmstilstand`,"Exit fullscreen mode":`Afslut fuldskærmstilstand`,words:`ord`,word:`ord`,"Return To Home Page":`Tilbage til hjemmesiden`,"No thinos to review!":`Ingen thinos at gennemgå!`,"Thinos to review":`Thinos til gennemgang`,"Start Review":`Start gennemgang`,Hard:`Svær`,Good:`God`,Easy:`Let`,Again:`Igen`,"Clear all review data":`Ryd alle gennemgangsdata`,"Daily Progress":`Daglig fremgang`,"Show stats":`Vis statistik`,"Hide stats":`Skjul statistik`,Remaining:`Resterende`,"Total Reviews":`Samlede gennemgange`,"Today, you have reviewed all your thinos!":`I dag har du gennemgået alle dine thinos!`,"Daily review limit reached! Come back tomorrow.":`Daglig gennemgangsgrænse nået! Kom tilbage i morgen.`,"Open thino in center window":`Åbn thino i centervindue`,"Open thino in float window":`Åbn thino i flydende vindue`,"Open thino in right sidebar":`Åbn thino i højre sidepanel`,"Open thino in left sidebar":`Åbn thino i venstre sidepanel`,"Show thino editor":`Vis thino-editor`,"Toggle minimal mode":`Skift minimal tilstand`,"Focus on thino editor":`Fokuser på thino-editor`,"ReSync web thinos to local":`Gensynkroniser web-thinos til lokal`,"Sync local thinos to web":`Synkroniser lokale thinos til web`,"Show daily thino":`Vis daglig thino`,"Focus on search bar":`Fokuser på søgefelt`,"Show-thino in popover(Hover editor)":`Vis-thino i popover(Hover editor)`,"Center window":`Centervindue`,"You should set the same heading below if you want to insert and process thino below the same heading.":`Du bør indstille samme rubrik nedenfor, hvis du vil indsætte og behandle thino under samme rubrik.`,"Float window":`Flydende vindue`,"Right sidebar":`Højre sidepanel`,"Left sidebar":`Venstre sidepanel`,"Save thino type when sync local":`Gem thino-type når lokal synkronisering`,"Set the default save thino type when sync local, FILE by default.":`Indstil standard gem type for thino når lokal synkronisering, FILE som standard.`,"Sync service":`Synkroniseringsservice`,"Pro verification status":`Pro-verificering status`,"Live-preview":`Live-preview`,Source:`Kilde`,"Global copy":`Global kopi`,"Set the folder name":`Indstil mappe-navn`,"Set the filename":`Indstil filnavn`,"Set the filename for current location file":`Indstil filnavn for aktuel sti`,"Switch calendar type":`Skift kalender-type`,alphabetical:`alfabetisk`,alphabeticalReverse:`alfabetiskReverse`,byCount:`byCount`,byCountReverse:`byCountReverse`,"Type here":`Type her`,Today:`I dag`,Yesterday:`I går`,"Last 7 days":`Sidste 7 dage`,"Last 30 days":`Sidste 30 dage`,"Last 90 days":`Sidste 90 dage`,"Last 180 days":`Sidste 180 dage`,"Last 365 days":`Sidste 365 dage`,Found:`Fundet`,"Copy filtered thinos":`Kopier filtrerede thinos`,"Bulk delete":`Bulk slet`,"Bulk archive":`Bulk arkiver`,"Bulk tag operation":`Bulk tag operation`,"Bulk restore":`Bulk gendan`,"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.":`Hvis du deaktiverer daglige notesplugin, kan det være, at thino ikke bliver slettet eller repareret korrekt. Aktiver plugin og prøv igen.`,Preview:`Forhåndsvisning`,"Set and save":`Indstil og gem`,"Show day mark in thino list":`Vis dagmarke i thino-liste`,"Show day mark on the top of daily range thino. False by default.":`Vis dagmarke i toppen af daglige thino-rækker. False som standard.`,"Click to expand or fold, Cmd+Click to show all thinos of the day":`Klik for at udvide eller fold, Cmd+Klik for at vise alle thinos af dagen`,"You can buy a license from":`Du kan købe en licens fra`,"No thinos in range":`Ingen thinos i række`,Month:`Måned`,Week:`Uge`,Day:`Dag`,Agenda:`Agenda`,Tomorrow:`I morgen`,Previous:`Forrige`,Next:`Næste`,"Search all columns...":`Søg i alle kolonner...`,"Basic Info":`Grundlæggende info`,"Additional Info":`Yderligere info`,"Created At":`Oprettet den`,Content:`Indhold`,"Thino Type":`Thino-type`,"Source Type":`Kildetype`,"Row status":`Række status`,Path:`Sti`,"Pinned Status":`Fastgjort status`,Table:`Tabel`,Chat:`Chat`,Moments:`Øjeblikke`,Waterfall:`Vandfald`,Calendar:`Kalender`,"Go to page":`Gå til side`,Page:`Side`,Show:`Vis`,rows:`rækker`,"Temp Filter":`Midlertidig filter`,"Open link directly in Thino view":`Åbn link direkte i Thino-visning`,"Day mark range":`Dagmærke-område`,"Set the range of day mark. Day by default.":`Indstil området for dagmærke. Dag som standard.`,"Thino is locked":`Thino er låst`,"Please unlock Thino by input password":`Lås venligst Thino op ved at indtaste adgangskode`,"Auto Download Image":`Auto-download billede`,"Auto download image when save to thino. 'false' by default":`Auto-download billede når der gemmes til thino. 'false' som standard`,"Thino Http IP Type":`Thino Http IP-type`,"Set Thino http server ip to listen. 'localhost' by default":`Indstil Thino http-server IP til at lytte. 'localhost' som standard`,"Password to lock Thino":`Adgangskode til at låse Thino`,Unlock:`Lås op`,Locked:`Låst`,"Password is incorrect":`Adgangskoden er forkert`,Lock:`Lås`,"Need password to unlock Thino":`Adgangskode påkrævet for at låse Thino op`,"You have not set a password or enable this feature yet":`Du har ikke indstillet en adgangskode eller aktiveret denne funktion endnu`,Password:`Adgangskode`,"Password for Thino":`Adgangskode til Thino`,"Please input your password to change password settings":`Indtast venligst din adgangskode for at ændre adgangskodeindstillinger`,"Please input your password":`Indtast venligst din adgangskode`,"Lock thino":`Lås thino`,date:`dato`,time:`tid`,event:`begivenhed`,"Add tag position":`Tilføj tag-position`,"Set the position of the tag when adding tag automatically":`Indstil positionen af tagget når der tilføjes tag automatisk`,"Add tag automatically":`Tilføj tag automatisk`,"Add tag to the end or beginning of the thino content when creating a thino and filtering tags":`Tilføj tag til slutningen eller begyndelsen af thino-indholdet når der oprettes en thino og filtreres tags`,"Add tag with new line":`Tilføj tag med ny linje`,"Add tag with new line when adding tag automatically":`Tilføj tag med ny linje når der tilføjes tag automatisk`,"Input to select more tags":`Indtast for at vælge flere tags`,"Tag Bulk Edit":`Tag masseredigering`,"Tag Bulk Select":`Tag massevalg`,"Exist Tags":`Eksisterende tags`,"Selected Tags":`Valgte tags`,"Click to remove exist tag":`Klik for at fjerne eksisterende tag`,"Click to remove selected tag":`Klik for at fjerne valgt tag`,"Select tags":`Vælg tags`,"Input to select exist tag":`Indtast for at vælge eksisterende tag`,Beginning:`Begyndelse`,End:`Slutning`,"Set the heading for saving thino":`Indstil overskriften for at gemme thino`,"# Heading":`# Overskrift`,"Chat view style":`Chat-visningsstil`,"Set the style of chat view":`Indstil stilen for chat-visning`,"Background image for moments view":`Baggrundsbillede for øjeblikke-visning`,"Set the background image for moments view":`Indstil baggrundsbilledet for øjeblikke-visning`,"Icon for moments/chat view/share image":`Ikon for øjeblikke/chat-visning/delt billede`,"Set the icon for moments/chat view/share image":`Indstil ikonet for øjeblikke/chat-visning/delt billede`,"Quote for moments view/share image":`Citat for øjeblikke-visning/delt billede`,"Set the quote for moments view/share image":`Indstil citatet for øjeblikke-visning/delt billede`,"Theme for Thino":`Tema for Thino`,"Set the theme for Thino":`Indstil temaet for Thino`,"Interface Details":`Grænsefladedetaljer`,"Task amount":`Opgavemængde`,"Thino status":`Thino-status`,"Used tags":`Brugte tags`,"Used days":`Brugte dage`,"Most active day":`Mest aktive dag`,"Most active hour":`Mest aktive time`,"Thino amount":`Thino-mængde`,"No content to generate.":`Intet indhold at generere.`,"Image generated successfully.":`Billede genereret med succes.`,"Failed to generate image.":`Kunne ikke generere billede.`,"Share filtered thinos as image":`Del filtrerede thinos som billede`,"Latest version":`Seneste version`,"Previous version":`Tidligere version`,"Thino update info":`Thino opdateringsinfo`,"Debug info copied to clipboard":`Fejlfindingsinfo kopieret til udklipsholder`,"Copy debug info":`Kopier fejlfindingsinfo`,"Failed to load changelog":`Kunne ikke indlæse ændringslog`,"View online":`Se online`,ChangeLog:`Ændringslog`,"Please open thino first":`Åbn venligst thino først`,"Insert editor":`Indsæt 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.":`Indstil venligst forskellige gemmeplacering for multi-fil-indstillinger i Thino. Dagbogsmappen overlapper med multi-fil-gemmeplaceringen, eller der er risiko for at den bliver læst gentagne gange.`,"Default time prefix for thino in daily notes":`Standard tidspræfiks for thino i daglige noter`,"Set default time prefix for thino in daily notes.":`Indstil standard tidspræfiks for thino i daglige noter.`,"Save image successfully":`Gem billede med succes`,"User quote":`Brugercitat`,"Set user quote for thino":`Indstil brugercitat for thino`,"User icon":`Brugerikon`,"Set user icon for thino. You can input http/https link or file path in vault.":`Indstil brugerikon for thino. Du kan indtaste http/https-link eller filsti i boks.`,"User info":`Brugerinfo`,"Copy filtered results":`Kopier filtrerede resultater`,"Share image":`Del billede`,Default:`Standard`,Gray:`Grå`,Grass:`Græs`,Flame:`Flamme`,Olive:`Oliven`,Ice:`Is`,Magenta:`Magenta`,"Daily notes":`Daglige noter`,Editor:`Editor`,"Append/prepend text when share to Thino":`Tilføj/foranstil tekst når der deles til Thino`,"Append text when share to Thino":`Tilføj tekst når der deles til Thino`,"Prepend text when share to Thino":`Foranstil tekst når der deles til Thino`,"Add newline when append/prepend text":`Tilføj ny linje når der tilføjes/foranstilles tekst`,"Input anything here":`Indtast hvad som helst her`,Prepend:`Foranstil`,Append:`Tilføj`,Both:`Begge`,None:`Ingen`,"Hide pinned group":`Skjul fastgjort gruppe`,"Hide pinned group in thino list. False by default.":`Skjul fastgjort gruppe i thino-liste. Falsk som standard.`,"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.":`Indstil overskriften for opgavetypen af thino, som standard vil det registrerede thino-indhold blive indsat i slutningen af dagbogen; hvis en titel er angivet, vil alt registreret thino-indhold blive ensartet kategoriseret under den titel.`,"Different insert target for different type":`Forskelligt indsætningsmål for forskellige typer`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`Skift dette for at indstille forskellige indsætningsmål for forskellige typer af thino, som opgave- eller listetyper af thino`,"You can set whole diary or only part of it":`Du kan indstille hele dagbogen eller kun en del af den`,"Set process target":`Indstil procesmål`,Custom:`Tilpasset`,"Whole diary":`Hele dagbogen`,"Set thino insert place":`Indstil thino indsætningssted`,"Set where to insert thino content":`Indstil hvor thino-indhold skal indsættes`,"End of the diary":`Slutningen af dagbogen`,"Custom location":`Tilpasset placering`,"Setting guide":`Indstillingsguide`,"Details settings":`Detaljerede indstillinger`,"Start Thino":`Start Thino`,"About Thino Pro":`Om Thino Pro`,Enabled:`Aktiveret`,Enable:`Aktiver`,"Daily notes folder":`Daglige noter-mappe`,"Set daily notes folder":`Indstil daglige noter-mappe`,"Daily note name format":`Daglig note navneformat`,"Set daily note name format":`Indstil daglig note navneformat`,"Daily note plugin":`Daglig note-plugin`,"Enable daily note plugin":`Aktiver daglig note-plugin`,Selected:`Valgt`,Select:`Vælg`,"A classic theme for Thino with a two-column layout":`Et klassisk tema for Thino med et to-kolonne layout`,Classic:`Klassisk`,"A modern theme for Thino with a three-column layout and some unique features.":`Et moderne tema for Thino med et tre-kolonne layout og nogle unikke funktioner.`,Modern:`Moderne`,"Go and enjoy Thino":`Gå og nyd Thino`,"Congrats! All settings done":`Tillykke! Alle indstillinger er færdige`,"Adjust settings that influence your user experience with Thino.":`Juster indstillinger der påvirker din brugeroplevelse med Thino.`,"Set preferences for using Thino":`Indstil præferencer for brug af Thino`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`Hvis du bruger Thino basisversionen, er aktivering af daglig note-plugin påkrævet. Konfigurer dets indstillinger for at arbejde effektivt med det.`,"Go with daily note plugin":`Gå med daglig note-plugin`,"Choose a theme for Thino.":`Vælg et tema til Thino.`,"Set theme for Thino":`Indstil tema for Thino`,"Set up your user info for Thino.":`Opsæt din brugerinfo for Thino.`,"Get started with Thino":`Kom i gang med Thino`,"Skip and start Thino":`Spring over og start Thino`,"Next step":`Næste trin`,"Back to previous step":`Tilbage til forrige trin`,"Click to enable =>":`Klik for at aktivere =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`Dette er Thino's sidepanel. Naviger til forskellige stier eller vælg forespørgselsfilter.`,"Click here and go to settings page.":`Klik her og gå til indstillingssiden.`,"Click here and go to different path.":`Klik her og gå til forskellige stier.`,"Select or create query filter here.":`Vælg eller opret forespørgselsfilter her.`,"See the status of Thinos here.":`Se status for Thinos her.`,"Search your thino quickly here.":`Søg hurtigt efter din thino her.`,"Edit or create your thino here.":`Rediger eller opret din thino her.`,"See your thinos here.":`Se dine thinos her.`,"See your time status of thinos here.":`Se din tidsstatus for thinos her.`,"See your tags here. Tags will be shown when thino contains tags.":`Se dine tags her. Tags vil blive vist når thino indeholder tags.`,Done:`Færdig`,"Thino is ready to use. ":`Thino er klar til brug. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`Du kan begynde at bruge Thino nu. Hvis du vil vide mere om Thino Pro, klik på knappen nedenfor.`,"Default time prefix":`Standard tidspræfiks`,"Append Text Action":`Tilføj tekst-handling`,"Prepend Text Action":`Foranstil tekst-handling`,Preset:`Forudindstilling`,"Select Tags":`Vælg Tags`,"It is not available on small view":`Det er ikke tilgængeligt på lille visning`,"Append text":`Tilføj tekst`,"Prepend text":`Foranstil tekst`,"Your daily note folder is not set correctly, please check your settings":`Din daglige note-mappe er ikke indstillet korrekt, tjek venligst dine indstillinger`,"Default sharing style":`Standard delingsstil`,"Set the default style for sharing thino, 'Modern' by default.":`Indstil standardstilen for deling af thino, "Moderne" som standard.`,Clean:`Ren`,Minimal:`Minimal`,Gradient:`Gradient`,"Thino share":`Thino-deling`,"Copy to clipboard failed":`Kopiering til udklipsholder mislykkedes`,"Copy to clipboard successfully":`Kopieret til udklipsholder med succes`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Dit indhold er blevet kopieret til udklipsholderen og indsat i editoren. Prøv venligst igen`,"Share thino":`Del thino`,"Set file name after create thino":`Indstil filnavn efter oprettelse af thino`,"You can set file name after create thino. A input box will show when you create thino.":`Du kan indstille filnavn efter oprettelse af thino. En inputboks vil blive vist, når du opretter thino.`,SPLIT:`OPDEL`,"Split by Heading 1":`Opdel efter Overskrift 1`,"Split by Heading 2":`Opdel efter Overskrift 2`,"Split by Heading 3":`Opdel efter Overskrift 3`,"Insert task":`Indsæt opgave`,"All settings have been reset to default.":`Alle indstillinger er blevet nulstillet til standard.`,"Reset all Thino settings":`Nulstil alle Thino-indstillinger`,"Reset settings":`Nulstil indstillinger`,"Reset Thino settings to default settings.":`Nulstil Thino-indstillinger til standardindstillinger.`,"Task Management":`Opgavestyring`,"Append completed date when task done in thino":`Tilføj fuldført dato når opgave er udført i thino`,"Append completed date when task done in thino. False by default":`Tilføj fuldført dato når opgave er udført i thino. Falsk som standard`,"Set tag for single file that Thino indexes":`Indstil tag for enkelt fil som Thino indekserer`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"Når du indstiller et tag her, vil Thino indeksere denne fil indeholder dette tag og vise det i listen. Behøver ikke at tilføje `#`.","Set tag for file type file":`Indstil tag for filtype-fil`,"Set tag for multi type file":`Indstil tag for multi-type fil`,"Please input the tag":`Indtast venligst tagget`,"Merge thinos in to thino share image":`Flet thinos ind i thino-delingsbillede`,"Custom height for Thino content":`Tilpasset højde for Thino-indhold`,"Set custom height for Thino content. Like 200px or 20rem":`Indstil tilpasset højde for Thino-indhold. Som 200px eller 20rem`,"Input height":`Indtast højde`,"Submit issue":`Indsend problem`,"Current version":`Nuværende version`,"Bug report":`Fejlrapport`,"Click the button to copy debug info and open the issue page":`Klik på knappen for at kopiere fejlfindingsinfo og åbne problemsiden`,"Copy and go":`Kopier og gå`,"Debug info copied":`Fejlfindingsinfo kopieret`,"Feature request":`Funktionsanmodning`,"Submit your feature request to the issue page":`Indsend din funktionsanmodning til problemsiden`,Go:`Gå`,"Toggle query list visibility":`Skift synlighed for forespørgselsliste`,"Toggle tags visibility":`Skift synlighed for tags`,"Toggle sidebar visibility":`Skift synlighed for sidepanel`,Collapse:`Sammenfold`,Expand:`Udvid`,"Max height for collapse":`Maksimal højde for sammenfoldning`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`Den maksimale højde for thino-sammenfoldning, når indstillet til 0, vil thino ikke folde sammen. 0 som standard. (Dette er ikke linjeantal, det er højde i px.)`,"Render content":`Generer indhold`,"Optimize for Callout":`Optimer for Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`Vil ikke automatisk gengive indhold, der indeholder mere end 3 callouts. Sand som standard`,"The value should be greater than":`Værdien skal være større end`,"Append Text":`Tilføj tekst`,"Prepend Text":`Foranstil tekst`,"Thino height when collapsed":`Thino-højde når sammenfoldet`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`Højden for thino når den er sammenfoldet, når indstillet til 0, vil thino ikke folde sammen. 100 som standard. (Dette er ikke linjeantal, det er højde i px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`Denne mulighed vil tillade dig at bruge andre visninger, når bladbredden ikke er tilstrækkelig. Falsk som standard.`,"Can select other views when leaf width is not enough":`Kan vælge andre visninger, når bladbredden ikke er tilstrækkelig`,"TRASH BOX":`PAPIRKURV`,"Wait templater to finish parse before insert thino":`Vent på at skabelonbehandler færdiggør parsing før indsættelse af thino`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`Denne mulighed vil tillade dig at vente på at skabelonbehandleren færdiggør parsing før indsættelse af thino, hvilket kan medføre at du skal bekræfte to gange mellem indsættelse af thino. Falsk som standard.`,"Get thino capture extension":`Få thino-optagelsesudvidelse`,"You can capture idea/text from chrome now.":`Du kan nu optage idé/tekst fra Chrome.`,"Open File":`Åbn fil`,"Exported CSV file":`Eksporteret CSV-fil`,"Updated At":`Opdateret den`,"Export to CSV":`Eksporter til CSV`,"Quick add button on mobile navbar":`Hurtig tilføj-knap på mobil navigationslinje`,"Always show status text":`Vis altid statustekst`,"Support filter by metadata from file":`Understøt filtrering efter metadata fra fil`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`Når dette aktiveres, kan du filtrere via metadata fra fil, som tags i fil. Men thinos fra lærred understøttes ikke. Falsk som standard.`,"Show source near timestamp in thino":`Vis kilde nær tidsstempel i thino`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`Når dette aktiveres, kan du se kilden nær tidsstemplet i thino. Du kan indstille titel i metadata for at overskrive dette. Falsk som standard.`,"Show Update Message":`Vis opdateringsbesked`,"Show update message when Thino is updated. True by default":`Vis opdateringsbesked når Thino opdateres. Sand som standard`,"Sync manually":`Synkroniser manuelt`,"Show all scrollbars":`Vis alle rullebjælker`,"TIME RANGE":`TIDSINTERVAL`,WITHIN:`INDEN FOR`,"7 days":`7 dage`,"14 days":`14 dage`,"30 days":`30 dage`,"3 months":`3 måneder`,"6 months":`6 måneder`,"1 year":`1 år`,"This week":`Denne uge`,"Last week":`Sidste uge`,"This month":`Denne måned`,"Last month":`Sidste måned`,"This year":`Dette år`,"Last year":`Sidste år`,"No history":`Ingen historik`,"Today Remaining":`Resterende i dag`,"Today Total":`I alt i dag`,"Historical Statistics":`Historisk statistik`,byTime:`Efter tid`,byTimeReverse:`Efter tid omvendt`,Stat:`Statistik`,Statistics:`Statistikker`,"Daily Thino Count":`Daglig Thino-antal`,Total:`Total`,thinos:`thinos`,"Thino Types":`Thino-typer`,"Distribution of thino types":`Fordeling af thino-typer`,"Thino Status":`Thino-status`,"Distribution of thino status":`Fordeling af thino-status`,"Popular Tags":`Populære tags`,"Top 10 most used tags":`Top 10 mest brugte tags`,"Thino Count":`Thino-antal`,"Hourly distribution":`Timefordeling`,"Current month":`Nuværende måned`,"Monthly distribution":`Månedlig fordeling`,"30 Days":`Sidste 30 dage`,Year:`År`,"Time Distribution":`Tidsfordeling`,"When do you write thinos":`Hvornår skriver du thinos`,"Content Length":`Indholdslængde`,"Distribution of thino lengths":`Fordeling af thino-længder`,"Daily Thinos":`Daglige Thinos`,"Show Time Distribution":`Vis tidsfordeling`,"Hide date picker":`Skjul datoværktøj`,"Show date picker":`Vis datoværktøj`,"Clear filter":`Ryd filter`,"Copy link":`Kopier link`,"Copy embed link":`Kopier indlejringslink`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter for at gemme thino`,"Fixed strings for thinos":`Faste strenge for thinos`,"Use fixed strings for thinos":`Brug faste strenge for thinos`,"Enable to add fixed strings at the beginning or end of thinos.":`Aktiver for at tilføje faste strenge i begyndelsen eller slutningen af thinos.`,"Fixed prefix for thinos":`Fast præfiks for thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Tilføj denne streng i begyndelsen af hver thino. Understøtter pladsholdere som {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Fast suffiks for thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Tilføj denne streng i slutningen af hver thino. Understøtter pladsholdere som {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Ordantal overskredet`,"Word count feature":`Ordtællingsfunktion`,"Enable real-time word count display in the editor":`Aktiver realtids ordtælling i editoren`,"Maximum word count":`Maksimalt ordantal`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Indstil et maksimalt ordantal for thino. Editoren vil vise en advarsel når det overskrides. Indstil til 0 for ubegrænset.`,"No linked thinos found":`Ingen linkede thinos fundet`,"Reference links group":`Referencelinks-gruppe`,"Enable reference links group in thino.":`Aktiver referencelinks-gruppe i thino.`,"No reference links found":`Ingen referencelinks fundet`,"Outgoing Links":`Udgående links`,"Incoming Links":`Indgående links`,"Error fetching reference links":`Fejl ved hentning af referencelinks`,"Double click behavior":`Dobbeltklik-adfærd`,"Set the behavior when double click on a thino.":`Indstil adfærden ved dobbeltklik på en thino.`,"Open thino":`Åbn thino`,"Edit thino":`Rediger thino`,"Go to source":`Gå til kilde`,"Do nothing":`Gør ingenting`,"Use default header in mobile view":`Brug standardoverskrift i mobilvisning`,"Use default header in mobile view of thino rather than custom header.":`Brug standardoverskrift i mobilvisning af thino i stedet for en custom overskrift.`}})),kn,An=o((()=>{kn={welcome:`Willkommen bei Thino`,ribbonIconTitle:`Thino`,to:`zu`,months:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`],monthsShort:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sept.`,`Okt.`,`Nov.`,`Dez.`],weekDays:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`],weekDaysShort:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],year:null,month:null,"Basic Options":`Grundeinstellungen`,"User name":`Benutzername`,"Set your user name here. 'Memos 😏' By default":`Setze deinen Benutzernamen hier. 'Thino 😏' als Standard`,'You can set target heading like "# Heading" to control data location':`Du kannst eine Zielüberschrift wie "# Überschrift" setzen, um den Datenspeicherort zu steuern`,"Insert after heading":`Nach Überschrift einfügen`,"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.":`Wenn leer gelassen, wird der aufgezeichnete Thino-Inhalt am Ende des Tagebuchs eingefügt; wenn ein Titel angegeben wird, werden alle aufgezeichneten Thino-Inhalte einheitlich unter diesem Titel kategorisiert.`,"Allows admonitions to be created using ":`Erlaubt das Erstellen von Hinweisen mit `,"Process Memos below":`Thinos unten verarbeiten`,"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.":`Wenn leer gelassen, zeigt die Thino-Oberfläche alle Thino-Aufzeichnungen an; wenn ein Titel angegeben wird, zeigt die Thino-Oberfläche nur die Inhalte unter diesem Titel an, und anderswo geschriebene Inhalte werden nicht angezeigt.`,"Save Memo button label":`Beschriftung des Thino-Speichern-Buttons`,"The text shown on the save Memo button in the UI. 'NOTEIT' by default.":`Der Text, der auf dem Thino-Speichern-Button in der Benutzeroberfläche angezeigt wird. 'NOTEIT' als Standard.`,"Focus on editor when open memos":`Fokus auf Editor beim Öffnen von Thino`,"Focus on editor when open memos. Focus by default.":`Fokus auf Editor beim Öffnen von Thino. Standardmäßig fokussiert.`,"Open daily memos with open memos":`Tägliche Thinos beim Öffnen von Thino öffnen`,"Open daily memos with open memos. Open by default.":`Tägliche Thinos beim Öffnen von Thino öffnen. Standardmäßig geöffnet.`,"Open Memos when obsidian opens":`Thino beim Öffnen von Obsidian öffnen`,"When enable this, Memos will open when Obsidian opens. False by default.":`Wenn aktiviert, wird Thino beim Öffnen von Obsidian geöffnet. Standardmäßig deaktiviert.`,"Hide done tasks in Memo list":`Erledigte Aufgaben in der Thino-Liste ausblenden`,"Hide all done tasks in Memo list. Show done tasks by default.":`Alle erledigten Aufgaben in der Thino-Liste ausblenden. Standardmäßig werden erledigte Aufgaben angezeigt.`,"Advanced Options":`Erweiterte Einstellungen`,"UI language for date":`UI-Sprache für Datum`,"Translates the date UI language. Only 'en' and 'zh' are available.":`Übersetzt die Datums-UI-Sprache. Nur 'en' und 'zh' sind verfügbar.`,"Default prefix when save thino":`Standardpräfix beim Speichern von Thino`,"Set the default prefix when create memo, 'List' by default.":`Setze das Standardpräfix beim Erstellen von Thino, 'Liste' als Standard.`,"Default insert date format":`Standardformat für Datumseinfügung`,"Set the default date format when insert date by @, 'Tasks' by default.":`Setze das Standarddatumsformat beim Einfügen von Datum mit @, 'Aufgaben' als Standard.`,"Default editor position on mobile":`Standardposition des Editors auf Mobilgeräten`,"Set the default editor position on Mobile, 'Top' by default.":`Setze die Standardposition des Editors auf Mobilgeräten, 'Oben' als Standard.`,"Use button to show editor on mobile":`Button zum Anzeigen des Editors auf Mobilgeräten verwenden`,"Set a float button to call editor on mobile. Only when editor located at the bottom works.":`Setze einen schwebenden Button, um den Editor auf Mobilgeräten aufzurufen. Funktioniert nur, wenn der Editor unten positioniert ist.`,"Show Time When Copy Results":`Zeit beim Kopieren der Ergebnisse anzeigen`,"Show time when you copy results, like 12:00. Copy time by default.":`Zeit beim Kopieren der Ergebnisse anzeigen, wie 12:00. Standardmäßig wird die Zeit kopiert.`,"Show Date When Copy Results":`Datum beim Kopieren der Ergebnisse anzeigen`,"Show date when you copy results, like [[2022-01-01]]. Copy date by default.":`Datum beim Kopieren der Ergebnisse anzeigen, wie [[2022-01-01]]. Standardmäßig wird das Datum kopiert.`,"Add Blank Line Between Different Date":`Leerzeile zwischen verschiedenen Daten einfügen`,"Add blank line when copy result with date. No blank line by default.":`Leerzeile beim Kopieren von Ergebnissen mit Datum einfügen. Standardmäßig keine Leerzeile.`,"Share Options":`Freigabeoptionen`,"Share Memos Image Footer Start":`Start der Fußzeile beim Teilen von Thino-Bildern`,"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":`Setze hier beliebigen Text, verwende {ThinoNum} für die Anzahl der Thinos, {UsedDay} für Tage. '{ThinoNum} Thino {UsedDay} Tage' als Standard`,"Share Memos Image Footer End":`Ende der Fußzeile beim Teilen von Thino-Bildern`,"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":`Setze hier beliebigen Text, verwende {UserName} als deinen Benutzernamen. '✍️ Von {UserName}' als Standard`,"Save Shared Image To Folder For Mobile":`Geteiltes Bild für Mobilgeräte in Ordner speichern`,"Save image to folder for mobile. False by Default":`Bild für Mobilgeräte in Ordner speichern. Standardmäßig deaktiviert`,"Say Thank You":`Danke sagen`,Donate:`Spenden`,"If you like this plugin, consider donating to support continued development:":`Wenn dir dieses Plugin gefällt, erwäge eine Spende zur Unterstützung der weiteren Entwicklung:`,"File Name of Recycle Bin":`Dateiname des Papierkorbs`,"Set the filename for recycle bin. 'delete' By default":`Setze den Dateinamen für den Papierkorb. 'delete' als Standard`,"File Name of Query File":`Dateiname der Abfragedatei`,"Set the filename for query file. 'query' By default":`Setze den Dateinamen für die Abfragedatei. 'query' als Standard`,"Use Tags In Vault":`Tags im Vault verwenden`,"Use tags in vault rather than only in Memos. False by default.":`Tags im Vault anstatt nur in Thino verwenden. Standardmäßig deaktiviert.`,"Ready to convert image into background":`Bereit, Bild in Hintergrund umzuwandeln`,List:`Liste`,Task:`Aufgabe`,Top:`Oben`,Bottom:`Unten`,TAG:`TAG`,DAY:`TAG`,QUERY:`ABFRAGE`,EDIT:`BEARBEITEN`,PIN:`ANHEFTEN`,UNPIN:`LÖSEN`,DELETE:`LÖSCHEN`,"CONFIRM!":`BESTÄTIGEN!`,"CREATE FILTER":`FILTER ERSTELLEN`,"Comment it...":`Kommentieren...`,Settings:`Einstellungen`,"Recycle bin":`Papierkorb`,"About Me":`Über mich`,"Fetching data...":`Daten werden geladen...`,"Here is No Memos.":`Keine Thinos vorhanden.`,"Frequently Used Tags":`Häufig verwendete Tags`,"What do you think now...":`Was denkst du gerade...`,READ:`LESEN`,MARK:`MARKIEREN`,SHARE:`TEILEN`,SOURCE:`QUELLE`,RESTORE:`WIEDERHERSTELLEN`,ARCHIVE:`ARCHIVIEREN`,"Daily Review":`Tagesrückblick`,"DELETE AT":`GELÖSCHT AM`,"Noooop!":`Nööö!`,"All Data is Loaded 🎉":`Alle Daten geladen 🎉`,"Quick filter":`Schnellfilter`,TYPE:`TYP`,LINKED:`VERLINKT`,"NO TAGS":`KEINE TAGS`,"HAS LINKS":`HAT LINKS`,"HAS IMAGES":`HAT BILDER`,INCLUDE:`EINSCHLIESSEN`,EXCLUDE:`AUSSCHLIESSEN`,TEXT:`TEXT`,IS:`IST`,AND:`UND`,OR:`ODER`,LIST:`LISTE`,ISNOT:`IST NICHT`,PATH:`PFAD`,METADATA:`METADATEN`,SELECT:`AUSWÄHLEN`,"ADD FILTER TERMS":`FILTERKRITERIEN HINZUFÜGEN`,FILTER:`FILTER`,Filter:`Filter`,TITLE:`TITEL`,"CREATE QUERY":`ABFRAGE ERSTELLEN`,"EDIT QUERY":`ABFRAGE BEARBEITEN`,MATCH:`ÜBEREINSTIMMUNG`,TIMES:`ZEITEN`,"Share Memo Image":`Thino-Bild teilen`,"↗Click the button to save":`↗Klicke den Button zum Speichern`,"Image is generating...":`Bild wird generiert...`,"Image is loading...":`Bild wird geladen...`,"Loading...":`Lädt...`,"😟 Cannot load image, image link maybe broken":`😟 Bild kann nicht geladen werden, Link ist möglicherweise defekt`,"Daily Memos":`Tägliche Thinos`,"CANCEL EDIT":`BEARBEITUNG ABBRECHEN`,"LINK TO THE":`LINK ZUM`,"Mobile Options":`Mobile Optionen`,"Experimental Options":`Experimentelle Optionen`,"Don't support web image yet, please input image path in vault":`Webbilder werden noch nicht unterstützt, bitte Bildpfad im Vault eingeben`,"Background Image in Dark Theme":`Hintergrundbild im dunklen Theme`,"Background Image in Light Theme":`Hintergrundbild im hellen Theme`,'Set background image in dark theme. Set something like "Daily/one.png"':`Setze Hintergrundbild im dunklen Theme. Setze etwas wie "Daily/one.png"`,'Set background image in light theme. Set something like "Daily/one.png"':`Setze Hintergrundbild im hellen Theme. Setze etwas wie "Daily/one.png"`,'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':`Setze Standard-Thino-Zusammensetzung, verwende {TIME} als "HH:mm" und {CONTENT} als Inhalt. "{TIME} {CONTENT}" als Standard`,"Default Memo Composition":`[Veraltet] Standard-Thino-Zusammensetzung`,"Show Tasks Label":`Aufgaben-Label anzeigen`,"Show tasks label near the time text. False by default":`Aufgaben-Label neben dem Zeittext anzeigen. Standardmäßig deaktiviert`,"Please Open Memos First":`Bitte öffne zuerst Thino`,DATE:`DATUM`,OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:`OBSIDIAN_NLDATES_PLUGIN_NICHT_AKTIVIERT`,BEFORE:`VOR`,AFTER:`NACH`,"Allow Comments On Memos":`Kommentare für Thinos erlauben`,"You can comment on memos. False by default":`Du kannst Thinos kommentieren. Standardmäßig deaktiviert`,Import:`Importieren`,"TITLE CANNOT BE NULL!":`TITEL DARF NICHT LEER SEIN!`,"FILTER CANNOT BE NULL!":`FILTER DARF NICHT LEER SEIN!`,"Comments In Original DailyNotes/Notes":`Kommentare in Original-Tagesnotizen/Notizen`,"You should install Dataview Plugin ver 0.5.9 or later to use this feature.":`Du solltest das Dataview Plugin Ver. 0.5.9 oder höher installieren, um diese Funktion zu nutzen.`,"Open Memos Successfully":`Thino erfolgreich geöffnet`,"Fetch Memos Error":`😭 Fehler beim Laden`,"Copied to clipboard Successfully":`Erfolgreich in die Zwischenablage kopiert`,"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":`Prüfe, ob du das Daily Notes Plugin oder Periodic Notes Plugin geöffnet hast`,"Please finish the last filter setting first":`Bitte beende zuerst die letzte Filtereinstellung`,"Close Memos Successfully":`Thino erfolgreich geschlossen`,"Insert as Memo":`Als Thino einfügen`,"Insert file as memo content":`Datei als Thino-Inhalt einfügen`,"Image load failed":`Bildladung fehlgeschlagen`,"Content cannot be empty":`Inhalt darf nicht leer sein`,"Unable to create new file.":`Neue Datei konnte nicht erstellt werden.`,"Failed to fetch deleted memos: ":`Fehler beim Laden gelöschter Thinos: `,"RESTORE SUCCEED":`WIEDERHERSTELLUNG ERFOLGREICH`,"DELETE SUCCEED":`LÖSCHEN ERFOLGREICH`,"Save Memo button icon":`Thino-Speichern-Button-Symbol`,"The icon shown on the save Memo button in the UI.":`Das Symbol auf dem Thino-Speichern-Button in der Benutzeroberfläche.`,"Fetch Memos From Particular Notes":`Thinos aus bestimmten Notizen laden`,'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':`Du kannst jede Dataview-Abfrage für Thinos setzen. Alle Thinos in diesen Notizen werden in der Liste angezeigt. "#memo" als Standard`,"Allow Memos to Fetch Memo from Notes":`Thino erlauben, Thinos aus Notizen zu laden`,"Use Memos to manage all memos in your notes, not only in daily notes. False by default":`Verwende Thino, um alle Thinos in deinen Notizen zu verwalten, nicht nur in Tagesnotizen. Standardmäßig deaktiviert`,"Always Show Memo Comments":`Thino-Kommentare immer anzeigen`,"Always show memo comments on memos. False by default":`Thino-Kommentare immer bei Thinos anzeigen. Standardmäßig deaktiviert`,"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":`Du hast keinen Ordner für Tagesnotizen in beiden Plugins (periodic-notes und daily-notes) festgelegt.`,"Please check your daily note plugin OR periodic notes plugin settings":`Bitte überprüfe deine Einstellungen für das Daily Note Plugin ODER Periodic Notes Plugin`,"Use which plugin's default configuration":`Welche Plugin-Standardkonfiguration verwenden`,"Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":`Thino verwendet die Plugin-Standardkonfiguration zum Laden von Thinos aus Tagesnotizen, 'Daily' als Standard.`,Daily:`Täglich`,"Always Show Leaf Sidebar on PC":`Seitenleiste auf PC immer anzeigen`,"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":`Linke Seitenleiste auf PC/Tablet auch bei einer Blattbreite unter 875px anzeigen. Standardmäßig deaktiviert.`,"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":`Du hast kein Format für Tagesnotizen in beiden Plugins (periodic-notes und daily-notes) festgelegt.`,"fetch more":`mehr laden`,"Search all settings":`Alle Einstellungen durchsuchen`,General:`Allgemein`,Theme:`Theme`,Share:`Teilen`,Advanced:`Erweitert`,Thino:`Thino`,"Random Review":`Zufällige Überprüfung`,"ARCHIVED AT":`ARCHIVIERT AM`,"Failed to get memos from daily notes":`Fehler beim Laden von Thinos aus Tagesnotizen`,"Failed to delete memo":`Fehler beim Löschen des Thinos`,"CTRL + ENTER to save":`STRG + ENTER zum Speichern`,"Started from":`Gestartet von`,"Custom Background Image":`Benutzerdefiniertes Hintergrundbild`,"Set custom background image.":`Benutzerdefiniertes Hintergrundbild festlegen.`,"Custom Memo Footer":`Benutzerdefinierte Thino-Fußzeile`,"Set custom memo footer.":`Benutzerdefinierte Thino-Fußzeile festlegen.`,"Heatmap Color Scheme":`Heatmap-Farbschema`,"Set different color scheme for heatmap.":`Verschiedene Farbschemata für die Heatmap festlegen.`,"Enable Local Http Server":`Lokalen HTTP-Server aktivieren`,"Memos Http Server Port":`Thino HTTP-Server-Port`,"Set memos http server port to listen. '43999' by default":`Port für den Thino HTTP-Server festlegen. '43999' als Standard`,"Default Editor Mode":`Standard-Editor-Modus`,"Live-Preview Mode OR Source Mode.":`Live-Vorschau-Modus ODER Quelltext-Modus.`,"Save type for Thino":`Speichertyp für Thino`,DAILY:`TÄGLICH`,MULTI:`MEHRFACH`,CANVAS:`LEINWAND`,ALL:`ALLE`,FILE:`DATEI`,TODO:`TODO`,DONE:`ERLEDIGT`,JOURNAL:`JOURNAL`,OTHER:`ANDERE`,"Failed to create daily note, check if it exists.":`Fehler beim Erstellen der Tagesnotiz, prüfe ob sie existiert.`,"Failed to create daily note. Please check if you created a folder for daily notes.":`Fehler beim Erstellen der Tagesnotiz. Bitte prüfe, ob du einen Ordner für Tagesnotizen erstellt hast.`,"After you verify your account, please refresh this page.":`Nach der Verifizierung deines Kontos aktualisiere bitte diese Seite.`,Verify:`Verifizieren`,"Oops! You forget to verify insider account":`Ups! Du hast vergessen, das Insider-Konto zu verifizieren`,"If you have any questions, please contact us.":`Bei Fragen kontaktiere uns bitte.`,"Delete Thino Directly":`Thino direkt löschen`,"When delete thino directly, it will not be moved to trash. False by default.":`Wenn Thino direkt gelöscht wird, wird es nicht in den Papierkorb verschoben. Standardmäßig deaktiviert.`,"Enable opening thino globally":`Globales Öffnen von Thino aktivieren`,"Enable opening thino globally. False by default.":`Globales Öffnen von Thino aktivieren. Standardmäßig deaktiviert.`,"Key for opening thino globally":`Tastenkombination für globales Öffnen von Thino`,"Set key for opening thino globally. CTRL + SHIFT + T by default.":`Tastenkombination für globales Öffnen von Thino festlegen. STRG + SHIFT + T als Standard.`,"Key for showing thino globally":`Tastenkombination für globales Anzeigen von Thino`,"Set key for showing thino globally. CTRL + SHIFT + E by default.":`Tastenkombination für globales Anzeigen von Thino festlegen. STRG + SHIFT + E als Standard.`,"Get activation code":`Aktivierungscode erhalten`,"Input activation code here":`Aktivierungscode hier eingeben`,"Copy Thino id":`Thino-ID kopieren`,"Activate Pro Version":`Pro-Version aktivieren`,"Please copy Thino id first":`Bitte kopiere zuerst die Thino-ID`,'You can set folder name with file name like "folder/file"':`Du kannst den Ordnernamen mit Dateinamen wie "ordner/datei" festlegen`,'You can set folder name like "folder1/folder2/folder3" to create sub-folder':`Du kannst Ordnernamen wie "ordner1/ordner2/ordner3" festlegen, um Unterordner zu erstellen`,"Default save type":`Standard-Speicherort`,'Set the default save type for thino. "DAILY" by default':`Standard-Speichertyp für Thino festlegen. "DAILY" als Standard`,"Sync Thino via PKMer":`Thino über PKMer synchronisieren`,Unlink:`Verknüpfung aufheben`,Link:`Verknüpfen`,"Connect to PKMer Sync, you can check it in ":`Mit PKMer Sync verbinden, du kannst es überprüfen in `,"PKMer Sync":`PKMer Sync`,"Remove successfully":`Erfolgreich entfernt`,Deactivate:`Deaktivieren`,Remove:`Entfernen`,"Confirm?":`Bestätigen?`,"Sync Status":`Synchronisierungsstatus`,"Start or stop sync":`Synchronisierung starten oder stoppen`,"Stop sync successfully":`Synchronisierung erfolgreich gestoppt`,"Start sync successfully":`Synchronisierung erfolgreich gestartet`,Stop:`Stopp`,Start:`Start`,"Show thino near mouse":`Thino in Mausnähe anzeigen`,"Query not found":`Abfrage nicht gefunden`,"Send to clipboard successfully":`Erfolgreich in die Zwischenablage kopiert`,"Thino - Failed to start HTTP server, please check the port is available.":`Thino - HTTP-Server konnte nicht gestartet werden, bitte prüfe ob der Port verfügbar ist.`,"Thino - Started HTTP server on port":`Thino - HTTP-Server gestartet auf Port`,"Thino - Terminated HTTP server":`Thino - HTTP-Server beendet`,"File not exist":`Datei existiert nicht`,"Thino not found":`Thino nicht gefunden`,"File not found for the given thino path, is creating a new file":`Datei für den angegebenen Thino-Pfad nicht gefunden, erstelle neue Datei`,"Saved sync token successfully":`Sync-Token erfolgreich gespeichert`,"Failed to find daily notes folder":`Tagesnotizen-Ordner konnte nicht gefunden werden`,"Please install obsidian-hover-editor plugin first":`Bitte installiere zuerst das obsidian-hover-editor Plugin`,"Copied app id successfully":`App-ID erfolgreich kopiert`,"Please input token first":`Bitte gib zuerst den Token ein`,"Please enable sync first":`Bitte aktiviere zuerst die Synchronisierung`,"Init Failed":`Initialisierung fehlgeschlagen`,"Verify successfully":`Erfolgreich verifiziert`,"Failed to verify":`Verifizierung fehlgeschlagen`,"Folder not found for the given thino path, is creating a new folder":`Ordner für den angegebenen Thino-Pfad nicht gefunden, erstelle neuen Ordner`,"File not found for the given thino path":`Datei für den angegebenen Thino-Pfad nicht gefunden`,"Failed to read current daily note, check if it exists.":`Aktuelle Tagesnotiz konnte nicht gelesen werden, prüfe ob sie existiert.`,"Failed to save":`Speichern fehlgeschlagen`,"Failed to login, please login again":`Anmeldung fehlgeschlagen, bitte erneut anmelden`,"COPY FAILED":`KOPIEREN FEHLGESCHLAGEN`,"COPY SUCCEED":`KOPIEREN ERFOLGREICH`,"Copy selected text":`Ausgewählten Text kopieren`,"Copy thino":`Thino kopieren`,COPY:`KOPIEREN`,"This is a pro feature, please upgrade to pro version to use it.":`Dies ist eine Pro-Funktion, bitte upgrade auf die Pro-Version um sie zu nutzen.`,"You can get pro version from: ":`Du kannst die Pro-Version hier erhalten: `,Save:`Speichern`,Cancel:`Abbrechen`,"Thino Daily Target":`Thino Tagesziel`,Input:`Eingabe`,"#Tag":`#Tag`,"to create tag":`um Tag zu erstellen`,"You have verified your account. Congrats!":`Du hast dein Konto verifiziert. Glückwunsch!`,"Pro features":`Pro-Funktionen`,"Target Thino Count":`Ziel-Thino-Anzahl`,on:`am`,"Switch waterfall view":`Zur Wasserfall-Ansicht wechseln`,"Switch view":`Ansicht wechseln`,"Switch list view":`Zur Listen-Ansicht wechseln`,"Set daily target":`Tagesziel festlegen`,"Thino Save To: ":`Thino speichern unter: `,"Enter fullscreen mode":`Vollbildmodus aktivieren`,"Exit fullscreen mode":`Vollbildmodus verlassen`,words:`Wörter`,word:`Wort`,"Return To Home Page":`Zur Startseite zurückkehren`,"No thinos to review!":`Keine Thinos zum Überprüfen!`,"Thinos to review":`Thinos zum Überprüfen`,"Start Review":`Überprüfen starten`,Hard:`Schwer`,Good:`Gut`,Easy:`Leicht`,Again:`Wiederholen`,"Clear all review data":`Alle Überprüfungsdaten löschen`,"Daily Progress":`Täglicher Fortschritt`,"Show stats":`Stats anzeigen`,"Hide stats":`Stats ausblenden`,Remaining:`Verbleibend`,"Total Reviews":`Gesamte Überprüfungen`,"Today, you have reviewed all your thinos!":`Heute hast du alle deine Thinos überprüft!`,"Daily review limit reached! Come back tomorrow.":`Tägliche Überprüfungslimit erreicht! Komm morgen wieder.`,"Open thino in center window":`Thino im zentralen Fenster öffnen`,"Open thino in float window":`Thino im schwebenden Fenster öffnen`,"Open thino in right sidebar":`Thino in der rechten Seitenleiste öffnen`,"Open thino in left sidebar":`Thino in der linken Seitenleiste öffnen`,"Show thino editor":`Thino-Editor anzeigen`,"Toggle minimal mode":`Minimalen Modus umschalten`,"Focus on thino editor":`Fokus auf Thino-Editor`,"ReSync web thinos to local":`Web-Thinos mit lokalen synchronisieren`,"Sync local thinos to web":`Lokale Thinos mit Web synchronisieren`,"Show daily thino":`Tägliches Thino anzeigen`,"Focus on search bar":`Fokus auf Suchleiste`,"Show-thino in popover(Hover editor)":`Thino in Popover anzeigen (Hover-Editor)`,"Center window":`Zentrales Fenster`,"Float window":`Schwebendes Fenster`,"Right sidebar":`Rechte Seitenleiste`,"Left sidebar":`Linke Seitenleiste`,"Save thino type when sync local":`Thino-Typ beim lokalen Synchronisieren speichern`,"Set the default save thino type when sync local, FILE by default.":`Standardtyp zum Speichern von Thino beim lokalen Synchronisieren festlegen, standardmäßig DATEI.`,"Sync service":`Synchronisierungsdienst`,"Pro verification status":`Pro-Verifizierungsstatus`,"Live-preview":`Live-Vorschau`,Source:`Quelle`,"Global copy":`Globales Kopieren`,"Set the folder name":`Ordnernamen festlegen`,"Set the filename":`Dateinamen festlegen`,"Set the filename for current location file":`Dateinamen für aktuelle Ortsdatei festlegen`,"Switch calendar type":`Kalendertyp wechseln`,alphabetical:`alphabetisch`,alphabeticalReverse:`alphabetisch rückwärts`,byCount:`nach Anzahl`,byCountReverse:`nach Anzahl rückwärts`,"Type here":`Hier tippen`,Today:`Heute`,Yesterday:`Gestern`,"Last 7 days":`Letzte 7 Tage`,"Last 30 days":`Letzte 30 Tage`,"Last 90 days":`Letzte 90 Tage`,"Last 180 days":`Letzte 180 Tage`,"Last 365 days":`Letzte 365 Tage`,Found:`Gefunden`,"Copy filtered thinos":`Gefilterte Thinos kopieren`,"Bulk delete":`Massenweise löschen`,"Bulk archive":`Massenweise archivieren`,"Bulk tag operation":`Massenhafte Tag-Operation`,"Bulk restore":`Massenweise wiederherstellen`,"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.":`Wenn du das tägliche Notizen-Plugin deaktivierst, könnte es sein, dass das Thino nicht richtig gelöscht oder aktualisiert wird. Bitte aktiviere das Plugin und versuche es erneut.`,Preview:`Vorschau`,"Set and save":`Festlegen und speichern`,"Show day mark in thino list":`Tagesmarkierung in Thino-Liste anzeigen`,"Show day mark on the top of daily range thino. False by default.":`Tagesmarkierung oben auf dem täglichen Bereichs-Thino anzeigen. Standardmäßig deaktiviert.`,"Click to expand or fold, Cmd+Click to show all thinos of the day":`Klicken zum Erweitern oder Falten, Cmd+Klick um alle Thinos des Tages anzuzeigen`,"You can buy a license from":`Du kannst eine Lizenz kaufen von`,"No thinos in range":`Keine Thinos im Bereich`,Month:`Monat`,Week:`Woche`,Day:`Tag`,Agenda:`Agenda`,Tomorrow:`Morgen`,Previous:`Vorherige`,Next:`Nächste`,"Search all columns...":`Alle Spalten durchsuchen...`,"Basic Info":`Grundinformationen`,"Additional Info":`Zusätzliche Informationen`,"Created At":`Erstellt am`,Content:`Inhalt`,"Thino Type":`Thino-Typ`,"Source Type":`Quelltyp`,"Row status":`Zeilenstatus`,Path:`Pfad`,"Pinned Status":`Angeheftet-Status`,Table:`Tabelle`,Chat:`Chat`,Moments:`Momente`,Waterfall:`Wasserfall`,Calendar:`Kalender`,"Go to page":`Zur Seite gehen`,Page:`Seite`,Show:`Zeigen`,rows:`Zeilen`,"Temp Filter":`Temporärer Filter`,"Open link directly in Thino view":`Link direkt in Thino-Ansicht öffnen`,"Day mark range":`Tagesmarkierungsbereich`,"Set the range of day mark. Day by default.":`Bereich der Tagesmarkierung festlegen. Standardmäßig Tag.`,"Thino is locked":`Thino ist gesperrt`,"Please unlock Thino by input password":`Bitte entsperre Thino durch Eingabe des Passworts`,"Auto Download Image":`Automatischer Bilddownload`,"Auto download image when save to thino. 'false' by default":`Automatischer Bilddownload beim Speichern in Thino. Standardmäßig 'false'`,"Thino Http IP Type":`Thino Http IP-Typ`,"Set Thino http server ip to listen. 'localhost' by default":`Thino-HTTP-Server-IP zum Abhören festlegen. Standardmäßig 'localhost'`,"Password to lock Thino":`Passwort zum Sperren von Thino`,Unlock:`Entsperren`,Locked:`Gesperrt`,"Password is incorrect":`Passwort ist falsch`,Lock:`Sperren`,"Need password to unlock Thino":`Passwort zum Entsperren von Thino erforderlich`,"You have not set a password or enable this feature yet":`Du hast noch kein Passwort festgelegt oder diese Funktion aktiviert`,Password:`Passwort`,"Password for Thino":`Passwort für Thino`,"Please input your password to change password settings":`Bitte gib dein Passwort ein, um die Passworteinstellungen zu ändern`,"Please input your password":`Bitte gib dein Passwort ein`,"Lock thino":`Thino sperren`,date:`Datum`,time:`Zeit`,event:`Ereignis`,"Add tag position":`Tag-Position hinzufügen`,"Set the position of the tag when adding tag automatically":`Position des Tags festlegen, wenn Tags automatisch hinzugefügt werden`,"Add tag automatically":`Tag automatisch hinzufügen`,"Add tag to the end or beginning of the thino content when creating a thino and filtering tags":`Tag am Ende oder Anfang des Thino-Inhalts hinzufügen, wenn ein Thino erstellt und Tags gefiltert werden`,"Add tag with new line":`Tag mit neuer Zeile hinzufügen`,"Add tag with new line when adding tag automatically":`Tag mit neuer Zeile hinzufügen, wenn Tags automatisch hinzugefügt werden`,"Input to select more tags":`Eingabe, um weitere Tags auszuwählen`,"Tag Bulk Edit":`Tag-Massenbearbeitung`,"Tag Bulk Select":`Tag-Massenauswahl`,"Exist Tags":`Vorhandene Tags`,"Selected Tags":`Ausgewählte Tags`,"Click to remove exist tag":`Klicken, um vorhandenes Tag zu entfernen`,"Click to remove selected tag":`Klicken, um ausgewähltes Tag zu entfernen`,"Select tags":`Tags auswählen`,"Input to select exist tag":`Eingabe, um vorhandenes Tag auszuwählen`,Beginning:`Anfang`,End:`Ende`,"Set the heading for saving thino":`Überschrift zum Speichern von Thino festlegen`,"# Heading":`# Überschrift`,"Chat view style":`Chat-Ansichtsstil`,"Set the style of chat view":`Stil der Chat-Ansicht festlegen`,"Background image for moments view":`Hintergrundbild für Momente-Ansicht`,"Set the background image for moments view":`Hintergrundbild für Momente-Ansicht festlegen`,"Icon for moments/chat view/share image":`Symbol für Momente/Chat-Ansicht/Freigabebild`,"Set the icon for moments/chat view/share image":`Symbol für Momente/Chat-Ansicht/Freigabebild festlegen`,"Quote for moments view/share image":`Zitat für Momente-Ansicht/Freigabebild`,"Set the quote for moments view/share image":`Zitat für Momente-Ansicht/Freigabebild festlegen`,"Theme for Thino":`Thema für Thino`,"Set the theme for Thino":`Thema für Thino festlegen`,"Interface Details":`Schnittstellendetails`,"Task amount":`Aufgabenmenge`,"Thino status":`Thino-Status`,"Used tags":`Verwendete Tags`,"Used days":`Verwendete Tage`,"Most active day":`Aktivster Tag`,"Most active hour":`Aktivste Stunde`,"Thino amount":`Thino-Menge`,"No content to generate.":`Kein Inhalt zum Generieren.`,"Image generated successfully.":`Bild erfolgreich generiert.`,"Failed to generate image.":`Fehler beim Generieren des Bildes.`,"Share filtered thinos as image":`Gefilterte Thinos als Bild teilen`,"Latest version":`Neueste Version`,"Previous version":`Vorherige Version`,"Thino update info":`Thino-Update-Info`,"Debug info copied to clipboard":`Debug-Informationen in die Zwischenablage kopiert`,"Copy debug info":`Debug-Informationen kopieren`,"Failed to load changelog":`Fehler beim Laden des Changelogs`,"View online":`Online ansehen`,ChangeLog:`Änderungsprotokoll`,"Please open thino first":`Bitte öffne zuerst Thino`,"Insert editor":`Editor einfügen`,"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.":`Bitte lege unterschiedliche Speicherorte für Mehrfachdatei-Einstellungen in Thino fest. Der Tagebuchordner überschneidet sich mit dem Mehrfachdatei-Speicherort, oder es besteht die Gefahr, dass er wiederholt gelesen wird.`,"Default time prefix for thino in daily notes":`Standard-Zeitpräfix für Thino in täglichen Notizen`,"Set default time prefix for thino in daily notes.":`Standard-Zeitpräfix für Thino in täglichen Notizen festlegen.`,"Save image successfully":`Bild erfolgreich gespeichert`,"User quote":`Benutzerzitat`,"Set user quote for thino":`Benutzerzitat für Thino festlegen`,"User icon":`Benutzersymbol`,"Set user icon for thino. You can input http/https link or file path in vault.":`Benutzersymbol für Thino festlegen. Du kannst einen http/https-Link oder Dateipfad im Tresor eingeben.`,"User info":`Benutzerinfo`,"Copy filtered results":`Gefilterte Ergebnisse kopieren`,"Share image":`Bild teilen`,Default:`Standard`,Gray:`Grau`,Grass:`Gras`,Flame:`Flamme`,Olive:`Olive`,Ice:`Eis`,Magenta:`Magenta`,"Daily notes":`Tägliche Notizen`,Editor:`Editor`,"Append/prepend text when share to Thino":`Text anhängen/voranstellen beim Teilen zu Thino`,"Append text when share to Thino":`Text anhängen beim Teilen zu Thino`,"Prepend text when share to Thino":`Text voranstellen beim Teilen zu Thino`,"Add newline when append/prepend text":`Neue Zeile hinzufügen beim Anhängen/Voranstellen von Text`,"Input anything here":`Hier etwas eingeben`,Prepend:`Voranstellen`,Append:`Anhängen`,Both:`Beides`,None:`Keines`,"Hide pinned group":`Angeheftete Gruppe ausblenden`,"Hide pinned group in thino list. False by default.":`Angeheftete Gruppe in Thino-Liste ausblenden. Standardmäßig deaktiviert.`,"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.":`Überschrift für den Aufgabentyp von Thino festlegen. Standardmäßig wird der aufgezeichnete Thino-Inhalt am Ende des Tagebuchs eingefügt; wenn ein Titel angegeben wird, werden alle aufgezeichneten Thino-Inhalte einheitlich unter diesem Titel kategorisiert.`,"Different insert target for different type":`Unterschiedliches Einfügeziel für verschiedene Typen`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`Aktiviere dies, um unterschiedliche Einfügeziele für verschiedene Thino-Typen festzulegen, wie Aufgaben- oder Listentyp von Thino`,"You can set whole diary or only part of it":`Du kannst das gesamte Tagebuch oder nur einen Teil davon festlegen`,"Set process target":`Verarbeitungsziel festlegen`,Custom:`Benutzerdefiniert`,"Whole diary":`Gesamtes Tagebuch`,"Set thino insert place":`Thino-Einfügeort festlegen`,"Set where to insert thino content":`Festlegen, wo Thino-Inhalt eingefügt werden soll`,"End of the diary":`Ende des Tagebuchs`,"Custom location":`Benutzerdefinierter Ort`,"Setting guide":`Einstellungsanleitung`,"Details settings":`Detaileinstellungen`,"Start Thino":`Thino starten`,"About Thino Pro":`Über Thino Pro`,Enabled:`Aktiviert`,Enable:`Aktivieren`,"Daily notes folder":`Ordner für tägliche Notizen`,"Set daily notes folder":`Ordner für tägliche Notizen festlegen`,"Daily note name format":`Namensformat für tägliche Notizen`,"Set daily note name format":`Namensformat für tägliche Notizen festlegen`,"Daily note plugin":`Plugin für tägliche Notizen`,"Enable daily note plugin":`Plugin für tägliche Notizen aktivieren`,Selected:`Ausgewählt`,Select:`Auswählen`,"A classic theme for Thino with a two-column layout":`Ein klassisches Thema für Thino mit zweispaltigem Layout`,Classic:`Klassisch`,"A modern theme for Thino with a three-column layout and some unique features.":`Ein modernes Thema für Thino mit dreispaltigem Layout und einigen einzigartigen Funktionen.`,Modern:`Modern`,"Go and enjoy Thino":`Los geht's, viel Spaß mit Thino`,"Congrats! All settings done":`Glückwunsch! Alle Einstellungen abgeschlossen`,"Adjust settings that influence your user experience with Thino.":`Passe Einstellungen an, die deine Benutzererfahrung mit Thino beeinflussen.`,"Set preferences for using Thino":`Präferenzen für die Verwendung von Thino festlegen`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`Wenn du die Thino-Basisversion verwendest, ist die Aktivierung des Plugins für tägliche Notizen erforderlich. Konfiguriere seine Einstellungen, um effektiv damit zu arbeiten.`,"Go with daily note plugin":`Mit Plugin für tägliche Notizen fortfahren`,"Choose a theme for Thino.":`Wähle ein Thema für Thino.`,"Set theme for Thino":`Thema für Thino festlegen`,"Set up your user info for Thino.":`Richte deine Benutzerinformationen für Thino ein.`,"Get started with Thino":`Erste Schritte mit Thino`,"Skip and start Thino":`Überspringen und Thino starten`,"Next step":`Nächster Schritt`,"Back to previous step":`Zurück zum vorherigen Schritt`,"Click to enable =>":`Klicken zum Aktivieren =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`Dies ist Thinos Seitenleiste. Navigiere zu verschiedenen Pfaden oder wähle Abfragefilter.`,"Click here and go to settings page.":`Klicke hier und gehe zur Einstellungsseite.`,"Click here and go to different path.":`Klicke hier und gehe zu einem anderen Pfad.`,"Select or create query filter here.":`Wähle oder erstelle hier Abfragefilter.`,"See the status of Thinos here.":`Siehe hier den Status von Thinos.`,"Search your thino quickly here.":`Suche dein Thino schnell hier.`,"Edit or create your thino here.":`Bearbeite oder erstelle dein Thino hier.`,"See your thinos here.":`Siehe deine Thinos hier.`,"See your time status of thinos here.":`Siehe hier deinen Zeitstatus von Thinos.`,"See your tags here. Tags will be shown when thino contains tags.":`Siehe deine Tags hier. Tags werden angezeigt, wenn Thino Tags enthält.`,Done:`Fertig`,"Thino is ready to use. ":`Thino ist einsatzbereit. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`Du kannst Thino jetzt verwenden. Wenn du mehr über Thino Pro erfahren möchtest, klicke auf die Schaltfläche unten.`,"Default time prefix":`Standard-Zeitpräfix`,"Append Text Action":`Text-Anhänge-Aktion`,"Prepend Text Action":`Text-Voranstell-Aktion`,Preset:`Voreinstellung`,"Select Tags":`Tags auswählen`,"It is not available on small view":`Es ist nicht verfügbar in der kleinen Ansicht`,"Append text":`Text anhängen`,"Prepend text":`Text voranstellen`,"Your daily note folder is not set correctly, please check your settings":`Dein Ordner für tägliche Notizen ist nicht korrekt eingestellt, bitte überprüfe deine Einstellungen`,"Default sharing style":`Standard-Freigabestil`,"Set the default style for sharing thino, 'Modern' by default.":`Lege den Standardstil für die Freigabe von Thino fest, standardmäßig "Modern".`,Clean:`Sauber`,Minimal:`Minimal`,Gradient:`Farbverlauf`,"Thino share":`Thino-Freigabe`,"Copy to clipboard failed":`Kopieren in die Zwischenablage fehlgeschlagen`,"Copy to clipboard successfully":`Erfolgreich in die Zwischenablage kopiert`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Dein Inhalt wurde in die Zwischenablage kopiert und in den Editor eingefügt. Bitte versuche es erneut`,"Share thino":`Thino teilen`,"Set file name after create thino":`Dateinamen nach Erstellung von Thino festlegen`,"You can set file name after create thino. A input box will show when you create thino.":`Du kannst den Dateinamen nach der Erstellung von Thino festlegen. Ein Eingabefeld wird angezeigt, wenn du Thino erstellst.`,SPLIT:`TEILEN`,"Split by Heading 1":`Nach Überschrift 1 teilen`,"Split by Heading 2":`Nach Überschrift 2 teilen`,"Split by Heading 3":`Nach Überschrift 3 teilen`,"Insert task":`Aufgabe einfügen`,"All settings have been reset to default.":`Alle Einstellungen wurden auf die Standardwerte zurückgesetzt.`,"Reset all Thino settings":`Alle Thino-Einstellungen zurücksetzen`,"Reset settings":`Einstellungen zurücksetzen`,"Reset Thino settings to default settings.":`Thino-Einstellungen auf Standardeinstellungen zurücksetzen.`,"Task Management":`Aufgabenverwaltung`,"Append completed date when task done in thino":`Abschlussdatum anhängen, wenn Aufgabe in Thino erledigt ist`,"Append completed date when task done in thino. False by default":`Abschlussdatum anhängen, wenn Aufgabe in Thino erledigt ist. Standardmäßig deaktiviert`,"Set tag for single file that Thino indexes":`Tag für einzelne Datei festlegen, die Thino indiziert`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"Wenn du hier ein Tag festlegst, wird Thino diese Datei indizieren, die dieses Tag enthält, und es in der Liste anzeigen. Du musst kein `#` hinzufügen.","Set tag for file type file":`Tag für Dateityp-Datei festlegen`,"Set tag for multi type file":`Tag für Mehrfachtyp-Datei festlegen`,"Please input the tag":`Bitte gib das Tag ein`,"Merge thinos in to thino share image":`Thinos in Thino-Freigabebild zusammenführen`,"Custom height for Thino content":`Benutzerdefinierte Höhe für Thino-Inhalt`,"Set custom height for Thino content. Like 200px or 20rem":`Benutzerdefinierte Höhe für Thino-Inhalt festlegen. Wie 200px oder 20rem`,"Input height":`Höhe eingeben`,"Submit issue":`Problem melden`,"Current version":`Aktuelle Version`,"Bug report":`Fehlerbericht`,"Click the button to copy debug info and open the issue page":`Klicke auf die Schaltfläche, um Debug-Informationen zu kopieren und die Problemseite zu öffnen`,"Copy and go":`Kopieren und los`,"Debug info copied":`Debug-Informationen kopiert`,"Feature request":`Funktionsanfrage`,"Submit your feature request to the issue page":`Reiche deine Funktionsanfrage auf der Problemseite ein`,Go:`Los`,"Toggle query list visibility":`Abfragelistensichtbarkeit umschalten`,"Toggle tags visibility":`Tag-Sichtbarkeit umschalten`,"Toggle sidebar visibility":`Seitenleistensichtbarkeit umschalten`,Collapse:`Einklappen`,Expand:`Ausklappen`,"Max height for collapse":`Maximale Höhe für Einklappen`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`Die maximale Höhe für Thino-Einklappen, wenn auf 0 gesetzt, würde Thino nicht einklappen. Standardmäßig 0. (Dies ist keine Zeilenanzahl, sondern die Höhe in px.)`,"Render content":`Inhalt rendern`,"Optimize for Callout":`Für Callout optimieren`,"Won't render content contains more than 3 callouts automatically. True by default":`Rendert Inhalte mit mehr als 3 Callouts nicht automatisch. Standardmäßig aktiviert`,"The value should be greater than":`Der Wert sollte größer sein als`,"Append Text":`Text anhängen`,"Prepend Text":`Text voranstellen`,"Thino height when collapsed":`Thino-Höhe im eingeklappten Zustand`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`Die Höhe für Thino im eingeklappten Zustand, wenn auf 0 gesetzt, würde Thino nicht einklappen. Standardmäßig 100. (Dies ist keine Zeilenanzahl, sondern die Höhe in px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`Diese Option ermöglicht es dir, andere Ansichten zu verwenden, wenn die Blattbreite nicht ausreicht. Standardmäßig deaktiviert.`,"Can select other views when leaf width is not enough":`Kann andere Ansichten auswählen, wenn Blattbreite nicht ausreicht`,"TRASH BOX":`PAPIERKORB`,"Wait templater to finish parse before insert thino":`Warte, bis Templater das Parsen beendet hat, bevor Thino eingefügt wird`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`Diese Option ermöglicht es dir, zu warten, bis Templater das Parsen beendet hat, bevor Thino eingefügt wird, was dazu führen kann, dass du zwischen dem Einfügen von Thino zweimal bestätigen musst. Standardmäßig deaktiviert.`,"Get thino capture extension":`Thino-Erfassungserweiterung holen`,"You can capture idea/text from chrome now.":`Du kannst jetzt Ideen/Text aus Chrome erfassen.`,"Open File":`Datei öffnen`,"Exported CSV file":`Exportierte CSV-Datei`,"Updated At":`Aktualisiert am`,"Export to CSV":`Nach CSV exportieren`,"Quick add button on mobile navbar":`Schnellhinzufügen-Schaltfläche in der mobilen Navigationsleiste`,"Always show status text":`Statustext immer anzeigen`,"Support filter by metadata from file":`Filterung nach Metadaten aus Datei unterstützen`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`Wenn du dies aktivierst, kannst du über Metadaten aus der Datei filtern, wie z.B. Tags in der Datei. Thinos aus Canvas werden jedoch nicht unterstützt. Standardmäßig deaktiviert.`,"Show source near timestamp in thino":`Quelle neben Zeitstempel in Thino anzeigen`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`Wenn du dies aktivierst, kannst du die Quelle neben dem Zeitstempel in Thino sehen. Du kannst den Titel in den Metadaten festlegen, um dies zu überschreiben. Standardmäßig deaktiviert.`,"Show Update Message":`Aktualisierungsnachricht anzeigen`,"Show update message when Thino is updated. True by default":`Aktualisierungsnachricht anzeigen, wenn Thino aktualisiert wird. Standardmäßig aktiviert`,"Sync manually":`Manuell synchronisieren`,"Show all scrollbars":`Alle Scrollbalken anzeigen`,"TIME RANGE":`ZEITRAUM`,WITHIN:`INNERHALB`,"7 days":`7 Tage`,"14 days":`14 Tage`,"30 days":`30 Tage`,"3 months":`3 Monate`,"6 months":`6 Monate`,"1 year":`1 Jahr`,"This week":`Diese Woche`,"Last week":`Letzte Woche`,"This month":`Dieser Monat`,"Last month":`Letzter Monat`,"This year":`Dieses Jahr`,"Last year":`Letztes Jahr`,"No history":`Keine Historie`,"Today Remaining":`Heute verbleibend`,"Today Total":`Heute gesamt`,"Historical Statistics":`Historische Statistiken`,byTime:`Nach Zeit`,byTimeReverse:`Nach Zeit (umgekehrt)`,Stat:`Statistik`,Statistics:`Statistiken`,"Daily Thino Count":`Tägliche Thino-Anzahl`,Total:`Gesamt`,thinos:`Thinos`,"Thino Types":`Thino-Typen`,"Distribution of thino types":`Verteilung der Thino-Typen`,"Thino Status":`Thino-Status`,"Distribution of thino status":`Verteilung des Thino-Status`,"Popular Tags":`Beliebte Tags`,"Top 10 most used tags":`Top 10 der meistverwendeten Tags`,"Thino Count":`Thino-Anzahl`,"Hourly distribution":`Stündliche Verteilung`,"Current month":`Aktueller Monat`,"Monthly distribution":`Monatliche Verteilung`,"30 Days":`Letzte 30 Tage`,Year:`Jahr`,"Time Distribution":`Zeitverteilung`,"When do you write thinos":`Wann schreibst du Thinos`,"Content Length":`Inhaltslänge`,"Distribution of thino lengths":`Verteilung der Thino-Längen`,"Daily Thinos":`Tägliche Thinos`,"Show Time Distribution":`Zeitverteilung anzeigen`,"Hide date picker":`Datumsauswahl ausblenden`,"Show date picker":`Datumsauswahl anzeigen`,"Clear filter":`Filter löschen`,"Copy link":`Link kopieren`,"Copy embed link":`Einbettungslink kopieren`,"Ctrl/Cmd + Enter to save thino":`Strg/Cmd + Enter zum Speichern des Thinos`,"Fixed strings for thinos":`Feste Zeichenketten für Thinos`,"Use fixed strings for thinos":`Feste Zeichenketten für Thinos verwenden`,"Enable to add fixed strings at the beginning or end of thinos.":`Aktivieren, um feste Zeichenketten am Anfang oder Ende von Thinos hinzuzufügen.`,"Fixed prefix for thinos":`Festes Präfix für Thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Füge diese Zeichenkette am Anfang jedes Thinos hinzu. Unterstützt Platzhalter wie {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Festes Suffix für Thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Füge diese Zeichenkette am Ende jedes Thinos hinzu. Unterstützt Platzhalter wie {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Wortzahl überschritten`,"Word count feature":`Wortzählfunktion`,"Enable real-time word count display in the editor":`Echtzeit-Wortzählanzeige im Editor aktivieren`,"Maximum word count":`Maximale Wortzahl`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Lege eine maximale Wortzahl für Thino fest. Der Editor zeigt eine Warnung an, wenn diese überschritten wird. Setze auf 0 für unbegrenzt.`,"No linked thinos found":`Keine verknüpften Thinos gefunden`,"Reference links group":`Referenzlinks-Gruppe`,"Enable reference links group in thino.":`Referenzlinks-Gruppe in Thino aktivieren.`,"No reference links found":`Keine Referenzlinks gefunden`,"Outgoing Links":`Ausgehende Links`,"Incoming Links":`Eingehende Links`,"Error fetching reference links":`Fehler beim Abrufen von Referenzlinks`,"Double click behavior":`Doppelklick-Verhalten`,"Set the behavior when double click on a thino.":`Lege das Verhalten fest, wenn du auf ein Thino doppelklickst.`,"Open thino":`Thino öffnen`,"Edit thino":`Thino bearbeiten`,"Go to source":`Zur Quelle gehen`,"Do nothing":`Nichts tun`,"Use default header in mobile view":`Standardkopfzeile in der mobilen Ansicht verwenden`,"Use default header in mobile view of thino rather than custom header.":`Verwende die Standardkopfzeile in der mobilen Ansicht von Thino anstelle einer benutzerdefinierten Kopfzeile.`}})),jn,Mn=o((()=>{jn={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":`Default prefix when save thino`,"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`,"Daily Review":`Daily Review`,"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`,PATH:`PATH`,METADATA:`METADATA`,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`,"Outer Frame":`Outer Frame`,"Enable Frame":`Enable Frame`,"Frame Padding":`Frame Padding`,"Frame Color":`Frame Color`,"↗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/Tablet even when the leaf width is less than 875px. False by default.":`Show left sidebar on PC/Tablet 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`,"Journal mode saves memos into periodic note files (daily/weekly/monthly/yearly)":`Journal mode saves memos into periodic note files (daily/weekly/monthly/yearly)`,"Journal granularity":`Journal granularity`,"Choose the period type for journal files":`Choose the period type for journal files`,Daily:`Daily`,Weekly:`Weekly`,Monthly:`Monthly`,Yearly:`Yearly`,"Use independent settings":`Use independent settings`,"When enabled, use custom folder/format/template instead of inheriting from daily notes plugin":`When enabled, use custom folder/format/template instead of inheriting from daily notes plugin`,"Heading date format":`Heading date format`,"Format for date headings in journal files":`Format for date headings in journal files`,Custom:`Custom`,"Custom heading format":`Custom heading format`,Folder:`Folder`,"Folder path for":`Folder path for`,notes:`notes`,"e.g.":`e.g.`,"Date format":`Date format`,"Moment.js format for file names":`Moment.js format for file names`,default:`default`,Template:`Template`,"Template file path for new notes":`Template file path for new notes`,"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`,"Login with PKMer":`Login with PKMer`,"Logout from PKMer":`Logout from PKMer`,"Logged in as":`Logged in as`,Devices:`Devices`,"AI Quota":`AI Quota`,Logout:`Logout`,"Pro activated":`Pro activated`,"Thino Copilot quota":`Thino Copilot quota`,"Contact support":`Contact support`,"Click to manage in Super settings":`Click to manage in Super settings`,"Login with PKMer account to activate Pro features":`Login with PKMer account to activate Pro features`,"Legacy activation (deprecated)":`Legacy activation (deprecated)`,"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`,word:`word`,"Return To Home Page":`Return To Home Page`,"No thinos to review!":`No thinos to review!`,"Thinos to review":`Thinos to review`,"Start Review":`Start Review`,Hard:`Hard`,Good:`Good`,Easy:`Easy`,Again:`Again`,"Clear all review data":`Clear all review data`,"Daily Progress":`Daily Progress`,"Show stats":`Show stats`,"Hide stats":`Hide stats`,Remaining:`Remaining`,"Total Reviews":`Total Reviews`,"Today, you have reviewed all your thinos!":`Today, you have reviewed all your thinos!`,"Daily review limit reached! Come back tomorrow.":`Daily review limit reached! Come back tomorrow.`,"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`,"Send to file":`Send to file`,"Hide entry":`Hide entry`,"Show entry":`Show entry`,More:`More`,"Pin tag":`Pin tag`,"Unpin tag":`Unpin tag`,"Rename tag":`Rename tag`,"Rename all":`Rename all`,"New tag name":`New tag name`,Renamed:`Renamed`,"Set emoji":`Set emoji`,"Set emoji for tag":`Set emoji for tag`,"Custom emoji":`Custom emoji`,"Set color":`Set color`,"Set color for tag":`Set color for tag`,Clear:`Clear`,"Select target file":`Select target file`,"Content format":`Content format`,"List item":`List item`,Callout:`Callout`,"Plain text":`Plain text`,"Archive originals":`Archive originals`,"Delete originals":`Delete originals`,"After sending":`After sending`,Target:`Target`,"Processing...":`Processing...`,"ORGANIZE SUCCEED":`Successfully organized thinos`,"Organize failed":`Organize failed`,"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`,"Tag Bulk Select":`Tag Bulk Select`,"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`,Gallery:`Gallery`,"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. You can input http/https link or file path in vault.":`Set user icon for thino. You can input http/https link or file path in vault.`,"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`,"Setting guide":`User setting guide`,"Details settings":`Details settings`,"Start Thino":`Start Thino`,"About Thino Pro":`About Thino Pro`,Enabled:`Enabled`,Enable:`Enable`,"Daily notes folder":`Daily notes folder`,"Set daily notes folder":`Set daily notes folder`,"Daily note name format":`Daily note name format`,"Set daily note name format":`Set daily note name format`,"Daily note plugin":`Daily note plugin`,"Enable daily note plugin":`Enable daily note plugin`,Selected:`Selected`,Select:`Select`,"A classic theme for Thino with a two-column layout":`A classic theme for Thino with a two-column layout`,Classic:`Classic`,"A modern theme for Thino with a three-column layout and some unique features.":`A modern theme for Thino with a three-column layout and some unique features.`,Modern:`Modern`,Focus:`Focus`,"A focus-first theme with a serif hero composer and diary-style stream.":`A focus-first theme with a serif hero composer and diary-style stream.`,Immersive:`Immersive`,"Show more":`Show more`,"Collapse tags":`Collapse`,"Search inspirations…":`Search inspirations…`,"Show {count} more…":`Show {count} more…`,thoughts:`thoughts`,tags:`tags`,days:`days`,"Immersive mode (F)":`Immersive mode (F)`,"Exit immersive mode (Esc)":`Exit immersive mode (Esc)`,"Go and enjoy Thino":`Go and enjoy Thino`,"Congrats! All settings done":`Congrats! All settings done`,"Adjust settings that influence your user experience with Thino.":`Adjust settings that influence your user experience with Thino.`,"Set preferences for using Thino":`Set preferences for using Thino`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.`,"Go with daily note plugin":`Go with daily note plugin`,"Choose a theme for Thino.":`Choose a theme for Thino.`,"Set theme for Thino":`Set theme for Thino`,"Set up your user info for Thino.":`Set up your user info for Thino.`,"Get started with Thino":`Get started with Thino`,"Skip and start Thino":`Skip and start Thino`,"Next step":`Next step`,"Back to previous step":`Back to previous step`,"Click to enable =>":`Click to enable =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`This is Thino's sidebar. Navigate to different path or select query filter.`,"Click here and go to settings page.":`Click here and go to settings page.`,"Click here and go to different path.":`Click here and go to different path.`,"Select or create query filter here.":`Select or create query filter here.`,"See the status of Thinos here.":`See the status of Thinos here.`,"Search your thino quickly here.":`Search your thino quickly here.`,"Edit or create your thino here.":`Edit or create your thino here.`,"See your thinos here.":`See your thinos here.`,"See your time status of thinos here.":`See your time status of thinos here.`,"See your tags here. Tags will be shown when thino contains tags.":`See your tags here. Tags will be shown when thino contains tags.`,Done:`Done`,"Thino is ready to use. ":`Thino is ready to use. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`You can start using Thino now. If you want to know more about Thino Pro, click the button below.`,"Default time prefix":`Default time prefix`,"Append Text Action":`Append Text Action`,"Prepend Text Action":`Prepend Text Action`,Preset:`Preset`,"Select Tags":`Select Tags`,"It is not available on small view":`It is not available on small view`,"Append text":`Append text`,"Prepend text":`Prepend text`,"Your daily note folder is not set correctly, please check your settings":`Your daily note folder is not set correctly, please check your settings`,"Default sharing style":`Default sharing style`,"Select the font for the memo content":`Select the font for the memo content`,"Select the background for the memo image":`Select the background for the memo image`,"Select the content type for the left bottom area":`Select the content type for the left bottom area`,"Default text":`Default text`,"Activity heatmap":`Activity heatmap`,"Left bottom content":`Left bottom content`,Font:`Font`,Background:`Background`,"Default font":`Default font`,"Orange gradient":`Orange gradient`,"Blue gradient":`Blue gradient`,"Green gradient":`Green gradient`,"Pink gradient":`Pink gradient`,"Image read failed, please try again":`Image read failed, please try again`,"Please select a valid image file":`Please select a valid image file`,"Default background":`Default background`,"Select local image":`Select local image`,"Image file cannot exceed 5MB":`Image file cannot exceed 5MB`,"Font size":`Font size`,"Adjust the font size":`Adjust the font size`,"Set the default style for sharing thino, 'Modern' by default.":`Set the default style for sharing thino, "Modern" by default.`,Clean:`Clean`,Minimal:`Minimal`,Gradient:`Gradient`,"Thino share":`Thino share`,"Copy to clipboard failed":`Copy to clipboard failed`,"Auto-copy was blocked. Long-press the box below to select and copy your Thino id manually.":`Auto-copy was blocked. Long-press the box below to select and copy your Thino id manually.`,"Copy to clipboard successfully":`Copy to clipboard successfully`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Your content has been copied to clipboard, and inserted into the editor. Please try it again`,"Share thino":`Share thino`,"Set file name after create thino":`Set file name after create thino`,"You can set file name after create thino. A input box will show when you create thino.":`You can set file name after create thino. A input box will show when you create thino.`,SPLIT:`SPLIT`,"Split by Heading 1":`Split by Heading 1`,"Split by Heading 2":`Split by Heading 2`,"Split by Heading 3":`Split by Heading 3`,"Insert task":`Insert task`,"All settings have been reset to default.":`All settings have been reset to default.`,"Reset all Thino settings":`Reset all Thino settings`,"Reset settings":`Reset settings`,"Reset Thino settings to default settings.":`Reset Thino settings to default settings.`,"Task Management":`Task Management`,"Append completed date when task done in thino":`Append completed date when task done in thino`,"Append completed date when task done in thino. False by default":`Append completed date when task done in thino. False by default`,"Set tag for single file that Thino indexes":`Set tag for single file that Thino indexes`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.","Set tag for file type file":`Set tag for file type file`,"Set tag for multi type file":`Set tag for multi type file`,"Ignore folders for multi type":`Ignore folders for multi type`,"Set folders to ignore when using multi type. Separate multiple folders with comma (,).":`Set folders to ignore when using multi type. Separate multiple folders with comma (,).`,"folder1,folder2/subfolder":`folder1,folder2/subfolder`,Interface:`Interface`,"Please input the tag":`Please input the tag`,"Merge thinos in to thino share image":`Merge thinos in to thino share image`,"Custom height for Thino content":`Custom height for Thino content`,"Set custom height for Thino content. Like 200px or 20rem":`Set custom height for Thino content. Like 200px or 20rem`,"Input height":`Input height`,"Submit issue":`Submit issue`,"Current version":`Current version`,"Bug report":`Bug report`,"Click the button to copy debug info and open the issue page":`Click the button to copy debug info and open the issue page`,"Copy and go":`Copy and go`,"Debug info copied":`Debug info copied`,"Feature request":`Feature request`,"Submit your feature request to the issue page":`Submit your feature request to the issue page`,Go:`Go`,"Toggle query list visibility":`Toggle query list visibility`,"Toggle tags visibility":`Toggle tags visibility`,"Toggle sidebar visibility":`Toggle sidebar visibility`,Collapse:`Collapse`,Expand:`Expand`,"Max height for collapse":`Max height for collapse`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)`,"Render content":`Render content`,"Optimize for Callout":`Optimize for Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`Won't render content contains more than 3 callouts automatically. True by default`,"The value should be greater than":`The value should be greater than`,"Append Text":`Append Text`,"Prepend Text":`Prepend Text`,"Thino height when collapsed":`Thino height when collapsed`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`The height for thino when it is collapsed, when set 0, thino would not collapse . 100 by default. (This is not lines count, it is height in px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`This option will allow you use other views when leaf width is not enough. False by default.`,"Can select other views when leaf width is not enough":`Can select other views when leaf width is not enough`,"TRASH BOX":`TRASH BOX`,"Wait templater to finish parse before insert thino":`Wait templater to finish parse before insert thino`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.`,"Get thino capture extension":`Get thino capture extension`,"You can capture idea/text from chrome now.":`You can capture idea/text from chrome now.`,"Open File":`Open File`,"Exported CSV file":`Exported CSV file`,"Updated At":`Updated At`,"Export to CSV":`Export to CSV`,"Quick add button on mobile navbar":`Quick add button on mobile navbar`,"Always show status text":`Always show status text`,"Support filter by metadata from file":`Support filter by metadata from file`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.`,"Show source near timestamp in thino":`Show source near timestamp in thino`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.`,"Show Update Message":`Show Update Message`,"Show update message when Thino is updated. True by default":`Show update message when Thino is updated. True by default`,"Sync manually":`Sync manually`,"Show all scrollbars":`Show all scrollbars`,"TIME RANGE":`TIME RANGE`,WITHIN:`WITHIN`,"7 days":`7 days`,"14 days":`14 days`,"30 days":`30 days`,"3 months":`3 months`,"6 months":`6 months`,"1 year":`1 year`,"This week":`This week`,"Last week":`Last week`,"This month":`This month`,"Last month":`Last month`,"This year":`This year`,"Last year":`Last year`,"No history":`No history`,"Today Remaining":`Today Remaining`,"Today Total":`Today Total`,"Historical Statistics":`Historical Statistics`,byTime:`By Time`,byTimeReverse:`By Time Reverse`,Stat:`Stat`,Statistics:`Statistics`,"Daily Thino Count":`Daily Thino Count`,Total:`Total`,thinos:`thinos`,"Thino Types":`Thino Types`,"Distribution of thino types":`Distribution of thino types`,"Thino Status":`Thino Status`,"Distribution of thino status":`Distribution of thino status`,"Popular Tags":`Popular Tags`,"Top 10 most used tags":`Top 10 most used tags`,"Thino Count":`Thino Count`,"Hourly distribution":`Hourly distribution`,"Current month":`Current month`,"Monthly distribution":`Monthly distribution`,"30 Days":`Last 30 days`,Year:`Year`,"Time Distribution":`Time Distribution`,"When do you write thinos":`When do you write thinos`,"Content Length":`Content Length`,"Distribution of thino lengths":`Distribution of thino lengths`,"Daily Thinos":`Daily Thinos`,"Show Time Distribution":`Show Time Distribution`,"Hide date picker":`Hide date picker`,"Show date picker":`Show date picker`,"Clear filter":`Clear filter`,"Copy link":`Copy link`,"Copy embed link":`Copy embed link`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter to save thino`,"Fixed strings for thinos":`Fixed strings for thinos`,"Use fixed strings for thinos":`Use fixed strings for thinos`,"Enable to add fixed strings at the beginning or end of thinos.":`Enable to add fixed strings at the beginning or end of thinos.`,"Fixed prefix for thinos":`Fixed prefix for thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Fixed suffix for thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Word count exceeded`,"Word count feature":`Word count feature`,"Enable real-time word count display in the editor":`Enable real-time word count display in the editor`,"Maximum word count":`Maximum word count`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.`,"No linked thinos found":`No linked thinos found`,"Reference links group":`Reference links group`,"Enable reference links group in thino.":`Enable reference links group in thino.`,"No reference links found":`No reference links found`,"Outgoing Links":`Outgoing Links`,"Incoming Links":`Incoming Links`,"Error fetching reference links":`Error fetching reference links`,"Double click behavior":`Double click behavior`,"Set the behavior when double click on a thino.":`Set the behavior when double click on a thino.`,"Open thino":`Open thino`,"Edit thino":`Edit thino`,"Go to source":`Go to source`,"Do nothing":`Do nothing`,"Use default header in mobile view":`Use default header in mobile view`,"Use default header in mobile view of thino rather than custom header.":`Use default header in mobile view of thino rather than custom header.`,"Using block link when dragging a thino":`Using block link when dragging a thino`,"Using block link when dragging a thino for daily":`Using block link when dragging a thino for daily`,"Matched via tag in content":`Matched via tag in content`,"Matched via tag in file":`Matched via tag in file`,"Focus on editor when open":`Focus on editor when open`,"Focus on editor when open. True by default.":`Focus on editor when open. True by default.`,"Show scroll to top button":`Show scroll to top button`,"Show scroll to top button. True by default":`Show scroll to top button. True by default.`,"Zoom image by default":`Zoom image by default`,"Zoom image by default when viewing image.":`Zoom image by default when viewing image.`,"View archive in random review":`View archive in random review`,"View archived thinos in random review. True by default":`View archived thinos in random review. True by default.`,"Linked by":`Linked by`,Linked:`Linked`,DUPLICATE:`Duplicate`,"Show scrollbars in all thino views.":`Show scrollbars in all thino views.`,"Drag to paste content":`Drag to paste content`,"You will be able to paste content from other apps to thino by dragging rather than pasting the block link.":`You will be able to paste content from other apps to thino by dragging rather than pasting the block link.`,"Dragging behavior":`Dragging behavior`,"Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.":`Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.`,"Block link":`Block link`,"Quick capture tool that allows you to create and manage your ideas, tasks, and more.":`Quick capture tool that allows you to create and manage your ideas, tasks, and more.`,About:`About`,Blank:`Blank`,Text:`Text`,"Open Documentation":`Open Documentation`,Documentation:`Documentation`,Version:`Version`,"View the documentation for this plugin":`View the documentation for this plugin`,"Activate Pro":`Activate Pro`,Pro:`Pro`,"Activated Pro":`Activated Pro`,Tasks:`Tasks`,"Show release notes":`Show release notes`,"Show release notes when Thino is updated. True by default":`Show release notes when Thino is updated. True by default`,"Open change log":`Open change log`,"Change log":`Change log`,"View the change log for this plugin":`View the change log for this plugin`,items:`items`,"Deleting...":`Deleting...`,"Archiving...":`Archiving...`,"Pinning...":`Pinning...`,"Unpinning...":`Unpinning...`,"Pin/Unpin":`Pin/Unpin`,Confirm:`Confirm`,"Successfully deleted":`Successfully deleted`,"Successfully archived":`Successfully archived`,"Successfully pinned":`Successfully pinned`,"Successfully unpinned":`Successfully unpinned`,"Successfully copied":`Successfully copied`,failed:`failed`,Thinos:`Thinos`,Processed:`Processed`,"Secret Content Masking":`Secret Content Masking`,"Enable secret masking":`Enable secret masking`,"Mask memo content matching a regex pattern":`Mask memo content matching a regex pattern`,"Secret content regex":`Secret content regex`,"Regex pattern to match content that should be masked":`Regex pattern to match content that should be masked`,"Masking style":`Masking style`,"Choose between blur effect or block character replacement":`Choose between blur effect or block character replacement`,"Set secret password":`Set secret password`,"Set or update the password used to reveal masked content":`Set or update the password used to reveal masked content`,"Enter password to reveal":`Enter password to reveal`,"Enter password":`Enter password`,"Confirm password":`Confirm password`,"Passwords do not match":`Passwords do not match`,"Incorrect password":`Incorrect password`,"Password set successfully":`Password set successfully`,"Click to reveal secret content":`Click to reveal secret content`,"Requires Obsidian API 1.11.4+":`Requires Obsidian API 1.11.4+`,"WeChat Integration":`WeChat Integration`,"Receive WeChat messages and save them as Thino memos. Desktop only. Requires Pro.":`Receive WeChat messages and save them as Thino memos. Desktop only. Requires Pro.`,"Enable WeChat":`Enable WeChat`,"Enable WeChat message receiver":`Enable WeChat message receiver`,"Auto start":`Auto start`,"Automatically start WeChat receiver when Obsidian opens":`Automatically start WeChat receiver when Obsidian opens`,"Default reply":`Default reply`,"Auto-reply text when a message is saved. Leave empty to disable.":`Auto-reply text when a message is saved. Leave empty to disable.`,"Voice save mode":`Voice save mode`,"How to save voice messages: transcription text, audio file, or both":`How to save voice messages: transcription text, audio file, or both`,"Text + Audio":`Text + Audio`,"Text only":`Text only`,"Audio only":`Audio only`,Connection:`Connection`,"WeChat is running":`WeChat is running`,"WeChat is stopped":`WeChat is stopped`,"Credentials found. Click Start to connect.":`Credentials found. Click Start to connect.`,"No credentials. Will show QR code on start.":`No credentials. Will show QR code on start.`,Start:`Start`,Stop:`Stop`,"Clear stored credentials and disconnect":`Clear stored credentials and disconnect`,"Voice Codec":`Voice Codec`,"SILK Decoder":`SILK Decoder`,"Installed. Voice messages will be converted to playable WAV files.":`Installed. Voice messages will be converted to playable WAV files.`,"Not installed. Download to enable voice message playback in Obsidian.":`Not installed. Download to enable voice message playback in Obsidian.`,Remove:`Remove`,Download:`Download`,"Downloading...":`Downloading...`,"Voice codec removed":`Voice codec removed`,"Voice codec downloaded":`Voice codec downloaded`,"Download failed":`Download failed`,Commands:`Commands`,"Send messages to the WeChat bot with these command prefixes:":`Send messages to the WeChat bot with these command prefixes:`,or:`or`,"Save to daily note":`Save to daily note`,"Save as task":`Save as task`,"Save as multi-file note":`Save as multi-file note`,"No prefix":`No prefix`,"Save using default save type":`Save using default save type`,"WeChat integration is only available on desktop":`WeChat integration is only available on desktop`,"WeChat is already running":`WeChat is already running`,"WeChat connected":`WeChat connected`,"WeChat disconnected":`WeChat disconnected`,"WeChat logged out":`WeChat logged out`,"Scanned! Please confirm on your phone.":`Scanned! Please confirm on your phone.`,"Login successful!":`Login successful!`,"QR code expired. Please restart.":`QR code expired. Please restart.`,Saved:`Saved`,"Empty message, not saved":`Empty message, not saved`,"Agent Routing":`Agent Routing`,"Route incoming WeChat messages to AI agents (ACP/CLI/HTTP). When enabled, messages with @agent or /agent prefix are forwarded to the specified agent.":`Route incoming WeChat messages to AI agents (ACP/CLI/HTTP). When enabled, messages with @agent or /agent prefix are forwarded to the specified agent.`,"Enable Agent Routing":`Enable Agent Routing`,"Forward messages to AI agents instead of saving as memos":`Forward messages to AI agents instead of saving as memos`,"Default Agent":`Default Agent`,"Agent used when message has no @agent prefix":`Agent used when message has no @agent prefix`,"None (save as memo)":`None (save as memo)`,Agents:`Agents`,"Configure AI agents":`Configure AI agents`,"Add Agent":`Add Agent`,"Agent name":`Agent name`,Delete:`Delete`,Endpoint:`Endpoint`,"OpenAI-compatible API endpoint URL":`OpenAI-compatible API endpoint URL`,"API Key":`API Key`,Command:`Command`,"Path to agent binary":`Path to agent binary`,Args:`Args`,"Extra command-line arguments (space-separated)":`Extra command-line arguments (space-separated)`,Model:`Model`,"System Prompt":`System Prompt`,"Optional system prompt for the agent":`Optional system prompt for the agent`,"Agent Commands":`Agent Commands`,"Send to specific agent":`Send to specific agent`,"Broadcast to multiple agents":`Broadcast to multiple agents`,"no message":`no message`,"Switch default agent":`Switch default agent`,"Reset agent session":`Reset agent session`,"Show current agent info":`Show current agent info`,"Built-in aliases":`Built-in aliases`,"Working Directory":`Working Directory`,"Default working directory for all agents. Leave empty to use vault root.":`Default working directory for all agents. Leave empty to use vault root.`,"Vault root":`Vault root`,"Permission Mode":`Permission Mode`,"Approval policy for agent tool calls":`Approval policy for agent tool calls`,Default:`Default`,"Accept Edits":`Accept Edits`,"Plan Mode":`Plan Mode`,"Don't Ask":`Don't Ask`,"Bypass Permissions":`Bypass Permissions`,"Override global working directory for this agent":`Override global working directory for this agent`,"Use global":`Use global`,Type:`Type`,"Switched to thino mode":`Switched to thino mode`,"Reasoning Effort":`Reasoning Effort`,"Thinking budget level (codex/ACP agents)":`Thinking budget level (codex/ACP agents)`,None:`None`,Low:`Low`,Medium:`Medium`,High:`High`,"Extra High":`Extra High`,"Usage: /thino <content>":`Usage: /thino <content>`,"Allow All File Paths":`Allow All File Paths`,"Skip path restriction when sending files. Enable if agents need to send files from any directory.":`Skip path restriction when sending files. Enable if agents need to send files from any directory.`,Date:`Date`,results:`results`,"Previous page":`Previous page`,"Next page":`Next page`,"No keywords found":`No keywords found`,"No data to chart":`No data to chart`,"(empty)":`(empty)`}})),Nn,Pn=o((()=>{Nn={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 categorised under that title.":`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 categorised under that title.`,"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 enabled, 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":`Default Prefix When Save Thino`,"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`,"Daily Review":`Daily Review`,"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:`IS NOT`,PATH:`PATH`,METADATA:`METADATA`,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 may be 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 haven'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/Tablet even when the leaf width is less than 875px. False by default.":`Show left sidebar on PC/Tablet 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 haven'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 Colour Scheme`,"Set different color scheme for heatmap.":`Set different colour 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 forgot 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 bin. 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 does 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, 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, 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`,word:`word`,"Return To Home Page":`Return To Home Page`,"No thinos to review!":`No thinos to review!`,"Thinos to review":`Thinos to review`,"Start Review":`Start Review`,Hard:`Hard`,Good:`Good`,Easy:`Easy`,Again:`Again`,"Clear all review data":`Clear all review data`,"Daily Progress":`Daily Progress`,"Show stats":`Show stats`,"Hide stats":`Hide stats`,Remaining:`Remaining`,"Total Reviews":`Total Reviews`,"Today, you have reviewed all your thinos!":`Today, you have reviewed all your thinos!`,"Daily review limit reached! Come back tomorrow.":`Daily review limit reached! Come back tomorrow.`,"Open thino in center window":`Open thino in centre 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":`Centre 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 licence 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 enabled 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`,"Tag Bulk Select":`Tag Bulk Select`,"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. You can input http/https link or file path in vault.":`Set user icon for thino. You can input http/https link or file path in vault.`,"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`,"Setting guide":`User setting guide`,"Details settings":`Details settings`,"Start Thino":`Start Thino`,"About Thino Pro":`About Thino Pro`,Enabled:`Enabled`,Enable:`Enable`,"Daily notes folder":`Daily notes folder`,"Set daily notes folder":`Set daily notes folder`,"Daily note name format":`Daily note name format`,"Set daily note name format":`Set daily note name format`,"Daily note plugin":`Daily note plugin`,"Enable daily note plugin":`Enable daily note plugin`,Selected:`Selected`,Select:`Select`,"A classic theme for Thino with a two-column layout":`A classic theme for Thino with a two-column layout`,Classic:`Classic`,"A modern theme for Thino with a three-column layout and some unique features.":`A modern theme for Thino with a three-column layout and some unique features.`,Modern:`Modern`,"Go and enjoy Thino":`Go and enjoy Thino`,"Congrats! All settings done":`Congrats! All settings done`,"Adjust settings that influence your user experience with Thino.":`Adjust settings that influence your user experience with Thino.`,"Set preferences for using Thino":`Set preferences for using Thino`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.`,"Go with daily note plugin":`Go with daily note plugin`,"Choose a theme for Thino.":`Choose a theme for Thino.`,"Set theme for Thino":`Set theme for Thino`,"Set up your user info for Thino.":`Set up your user info for Thino.`,"Get started with Thino":`Get started with Thino`,"Skip and start Thino":`Skip and start Thino`,"Next step":`Next step`,"Back to previous step":`Back to previous step`,"Click to enable =>":`Click to enable =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`This is Thino's sidebar. Navigate to different path or select query filter.`,"Click here and go to settings page.":`Click here and go to settings page.`,"Click here and go to different path.":`Click here and go to different path.`,"Select or create query filter here.":`Select or create query filter here.`,"See the status of Thinos here.":`See the status of Thinos here.`,"Search your thino quickly here.":`Search your thino quickly here.`,"Edit or create your thino here.":`Edit or create your thino here.`,"See your thinos here.":`See your thinos here.`,"See your time status of thinos here.":`See your time status of thinos here.`,"See your tags here. Tags will be shown when thino contains tags.":`See your tags here. Tags will be shown when thino contains tags.`,Done:`Done`,"Thino is ready to use. ":`Thino is ready to use. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`You can start using Thino now. If you want to know more about Thino Pro, click the button below.`,"Default time prefix":`Default time prefix`,"Append Text Action":`Append Text Action`,"Prepend Text Action":`Prepend Text Action`,Preset:`Preset`,"Select Tags":`Select Tags`,"It is not available on small view":`It is not available on small view`,"Append text":`Append text`,"Prepend text":`Prepend text`,"Your daily note folder is not set correctly, please check your settings":`Your daily note folder is not set correctly, please check your settings`,"Default sharing style":`Default sharing style`,"Set the default style for sharing thino, 'Modern' by default.":`Set the default style for sharing thino, "Modern" by default.`,Clean:`Clean`,Minimal:`Minimal`,Gradient:`Gradient`,"Thino share":`Thino share`,"Copy to clipboard failed":`Copy to clipboard failed`,"Copy to clipboard successfully":`Copy to clipboard successfully`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Your content has been copied to clipboard, and inserted into the editor. Please try it again`,"Share thino":`Share thino`,"Set file name after create thino":`Set file name after create thino`,"You can set file name after create thino. A input box will show when you create thino.":`You can set file name after create thino. A input box will show when you create thino.`,SPLIT:`SPLIT`,"Split by Heading 1":`Split by Heading 1`,"Split by Heading 2":`Split by Heading 2`,"Split by Heading 3":`Split by Heading 3`,"Insert task":`Insert task`,"All settings have been reset to default.":`All settings have been reset to default.`,"Reset all Thino settings":`Reset all Thino settings`,"Reset settings":`Reset settings`,"Reset Thino settings to default settings.":`Reset Thino settings to default settings.`,"Task Management":`Task Management`,"Append completed date when task done in thino":`Append completed date when task done in thino`,"Append completed date when task done in thino. False by default":`Append completed date when task done in thino. False by default`,"Set tag for single file that Thino indexes":`Set tag for single file that Thino indexes`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.","Set tag for file type file":`Set tag for file type file`,"Set tag for multi type file":`Set tag for multi type file`,"Please input the tag":`Please input the tag`,"Merge thinos in to thino share image":`Merge thinos in to thino share image`,"Custom height for Thino content":`Custom height for Thino content`,"Set custom height for Thino content. Like 200px or 20rem":`Set custom height for Thino content. Like 200px or 20rem`,"Input height":`Input height`,"Submit issue":`Submit issue`,"Current version":`Current version`,"Bug report":`Bug report`,"Click the button to copy debug info and open the issue page":`Click the button to copy debug info and open the issue page`,"Copy and go":`Copy and go`,"Debug info copied":`Debug info copied`,"Feature request":`Feature request`,"Submit your feature request to the issue page":`Submit your feature request to the issue page`,Go:`Go`,"Toggle query list visibility":`Toggle query list visibility`,"Toggle tags visibility":`Toggle tags visibility`,"Toggle sidebar visibility":`Toggle sidebar visibility`,Collapse:`Collapse`,Expand:`Expand`,"Max height for collapse":`Max height for collapse`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)`,"Render content":`Render content`,"Optimize for Callout":`Optimize for Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`Won't render content contains more than 3 callouts automatically. True by default`,"The value should be greater than":`The value should be greater than`,"Append Text":`Append Text`,"Prepend Text":`Prepend Text`,"Thino height when collapsed":`Thino height when collapsed`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`The height for thino when it is collapsed, when set 0, thino would not collapse . 100 by default. (This is not lines count, it is height in px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`This option will allow you use other views when leaf width is not enough. False by default.`,"Can select other views when leaf width is not enough":`Can select other views when leaf width is not enough`,"TRASH BOX":`TRASH BOX`,"Wait templater to finish parse before insert thino":`Wait templater to finish parse before insert thino`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.`,"Get thino capture extension":`Get thino capture extension`,"You can capture idea/text from chrome now.":`You can capture idea/text from chrome now.`,"Open File":`Open File`,"Exported CSV file":`Exported CSV file`,"Updated At":`Updated At`,"Export to CSV":`Export to CSV`,"Quick add button on mobile navbar":`Quick add button on mobile navbar`,"Always show status text":`Always show status text`,"Support filter by metadata from file":`Support filter by metadata from file`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.`,"Show source near timestamp in thino":`Show source near timestamp in thino`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.`,"Show Update Message":`Show Update Message`,"Show update message when Thino is updated. True by default":`Show update message when Thino is updated. True by default`,"Sync manually":`Sync manually`,"Show all scrollbars":`Show all scrollbars`,"TIME RANGE":`TIME RANGE`,WITHIN:`WITHIN`,"7 days":`7 days`,"14 days":`14 days`,"30 days":`30 days`,"3 months":`3 months`,"6 months":`6 months`,"1 year":`1 year`,"This week":`This week`,"Last week":`Last week`,"This month":`This month`,"Last month":`Last month`,"This year":`This year`,"Last year":`Last year`,"No history":`No history`,"Today Remaining":`Today Remaining`,"Today Total":`Today Total`,"Historical Statistics":`Historical Statistics`,byTime:`By Time`,byTimeReverse:`By Time Reverse`,Stat:`Stat`,Statistics:`Statistics`,"Daily Thino Count":`Daily Thino Count`,Total:`Total`,thinos:`thinos`,"Thino Types":`Thino Types`,"Distribution of thino types":`Distribution of thino types`,"Thino Status":`Thino Status`,"Distribution of thino status":`Distribution of thino status`,"Popular Tags":`Popular Tags`,"Top 10 most used tags":`Top 10 most used tags`,"Thino Count":`Thino Count`,"Hourly distribution":`Hourly distribution`,"Current month":`Current month`,"Monthly distribution":`Monthly distribution`,"30 Days":`Last 30 days`,Year:`Year`,"Time Distribution":`Time Distribution`,"When do you write thinos":`When do you write thinos`,"Content Length":`Content Length`,"Distribution of thino lengths":`Distribution of thino lengths`,"Daily Thinos":`Daily Thinos`,"Show Time Distribution":`Show Time Distribution`,"Hide date picker":`Hide date picker`,"Show date picker":`Show date picker`,"Clear filter":`Clear filter`,"Copy link":`Copy link`,"Copy embed link":`Copy embed link`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter to save thino`,"Fixed strings for thinos":`Fixed strings for thinos`,"Use fixed strings for thinos":`Use fixed strings for thinos`,"Enable to add fixed strings at the beginning or end of thinos.":`Enable to add fixed strings at the beginning or end of thinos.`,"Fixed prefix for thinos":`Fixed prefix for thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Fixed suffix for thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Word count exceeded`,"Word count feature":`Word count feature`,"Enable real-time word count display in the editor":`Enable real-time word count display in the editor`,"Maximum word count":`Maximum word count`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.`,"No linked thinos found":`No linked thinos found`,"Reference links group":`Reference links group`,"Enable reference links group in thino.":`Enable reference links group in thino.`,"No reference links found":`No reference links found`,"Outgoing Links":`Outgoing Links`,"Incoming Links":`Incoming Links`,"Error fetching reference links":`Error fetching reference links`,"Double click behavior":`Double click behavior`,"Set the behavior when double click on a thino.":`Set the behavior when double click on a thino.`,"Open thino":`Open thino`,"Edit thino":`Edit thino`,"Go to source":`Go to source`,"Do nothing":`Do nothing`,"Use default header in mobile view":`Use default header in mobile view`,"Use default header in mobile view of thino rather than custom header.":`Use default header in mobile view of thino rather than custom header.`}})),Fn,In=o((()=>{Fn={welcome:`¡Bienvenido a Thino!`,ribbonIconTitle:`Thino`,to:`a`,months:[`Enero`,`Febrero`,`Marzo`,`Abril`,`Mayo`,`Junio`,`Julio`,`Agosto`,`Septiembre`,`Octubre`,`Noviembre`,`Diciembre`],monthsShort:[`Ene.`,`Feb.`,`Mar.`,`Abr.`,`May.`,`Jun.`,`Jul.`,`Ago.`,`Sep.`,`Oct.`,`Nov.`,`Dic.`],weekDays:[`Domingo`,`Lunes`,`Martes`,`Miércoles`,`Jueves`,`Viernes`,`Sábado`],weekDaysShort:[`Dom`,`Lun`,`Mar`,`Mié`,`Jue`,`Vie`,`Sáb`],year:null,month:null,"Basic Options":`Opciones básicas`,"User name":`Nombre de usuario`,"Set your user name here. 'Memos 😏' By default":`Establece tu nombre de usuario aquí. 'Thino 😏' por defecto`,'You can set target heading like "# Heading" to control data location':`Puedes establecer un encabezado objetivo como "# Encabezado" para controlar la ubicación de los datos`,"Insert after heading":`Insertar después del encabezado`,"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.":`Si se deja en blanco, el contenido thino registrado se insertará al final del diario; si se proporciona un título, todo el contenido thino registrado se categorizará uniformemente bajo ese título.`,"Allows admonitions to be created using ":`Permite crear advertencias usando `,"Process Memos below":`Procesar thinos debajo`,"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.":`Si se deja en blanco, la interfaz de Thino mostrará todos los contenidos de registros thino; si se proporciona un título, la interfaz de Thino solo mostrará los contenidos bajo ese título, y los contenidos escritos en otros lugares no se mostrarán.`,"Save Memo button label":`Etiqueta del botón Guardar thino`,"The text shown on the save Memo button in the UI. 'NOTEIT' by default.":`El texto mostrado en el botón guardar Thino en la interfaz. 'NOTEIT' por defecto.`,"Focus on editor when open memos":`Enfocar en el editor al abrir thinos`,"Focus on editor when open memos. Focus by default.":`Enfocar en el editor al abrir thinos. Enfocado por defecto.`,"Open daily memos with open memos":`Abrir thinos diarios al abrir thinos`,"Open daily memos with open memos. Open by default.":`Abrir thinos diarios al abrir thinos. Abierto por defecto.`,"Open Memos when obsidian opens":`Abrir Thino cuando se abre Obsidian`,"When enable this, Memos will open when Obsidian opens. False by default.":`Cuando esto está habilitado, Thino se abrirá cuando se abra Obsidian. Deshabilitado por defecto.`,"Hide done tasks in Memo list":`Ocultar tareas completadas en la lista de thinos`,"Hide all done tasks in Memo list. Show done tasks by default.":`Ocultar todas las tareas completadas en la lista de thinos. Mostrar tareas completadas por defecto.`,"Advanced Options":`Opciones avanzadas`,"UI language for date":`Idioma de la interfaz para fechas`,"Translates the date UI language. Only 'en' and 'zh' are available.":`Traduce el idioma de la interfaz de fechas. Solo 'en' y 'zh' están disponibles.`,"Default prefix when save thino":`Prefijo predeterminado al guardar thino`,"Set the default prefix when create memo, 'List' by default.":`Establece el prefijo predeterminado al crear thino, 'Lista' por defecto.`,"Default insert date format":`Formato de fecha de inserción predeterminado`,"Set the default date format when insert date by @, 'Tasks' by default.":`Establece el formato de fecha predeterminado al insertar fecha con @, 'Tareas' por defecto.`,"Default editor position on mobile":`Posición predeterminada del editor en móvil`,"Set the default editor position on Mobile, 'Top' by default.":`Establece la posición predeterminada del editor en móvil, 'Arriba' por defecto.`,"Use button to show editor on mobile":`Usar botón para mostrar editor en móvil`,"Set a float button to call editor on mobile. Only when editor located at the bottom works.":`Establece un botón flotante para llamar al editor en móvil. Solo funciona cuando el editor está ubicado en la parte inferior.`,"Show Time When Copy Results":`Mostrar hora al copiar resultados`,"Show time when you copy results, like 12:00. Copy time by default.":`Mostrar hora cuando copias resultados, como 12:00. Copiar hora por defecto.`,"Show Date When Copy Results":`Mostrar fecha al copiar resultados`,"Show date when you copy results, like [[2022-01-01]]. Copy date by default.":`Mostrar fecha cuando copias resultados, como [[2022-01-01]]. Copiar fecha por defecto.`,"Add Blank Line Between Different Date":`Agregar línea en blanco entre fechas diferentes`,"Add blank line when copy result with date. No blank line by default.":`Agregar línea en blanco al copiar resultado con fecha. Sin línea en blanco por defecto.`,"Share Options":`Opciones de compartir`,"Share Memos Image Footer Start":`Inicio del pie de imagen al compartir Thino`,"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":`Establece lo que quieras aquí, usa {ThinoNum} para mostrar el número de thino, {UsedDay} para días. '{ThinoNum} Thino {UsedDay} Días' por defecto`,"Share Memos Image Footer End":`Final del pie de imagen al compartir Thino`,"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":`Establece lo que quieras aquí, usa {UserName} como tu nombre de usuario. '✍️ Por {UserName}' por defecto`,"Save Shared Image To Folder For Mobile":`Guardar imagen compartida en carpeta para móvil`,"Save image to folder for mobile. False by Default":`Guardar imagen en carpeta para móvil. Deshabilitado por defecto`,"Say Thank You":`Dar las gracias`,Donate:`Donar`,"If you like this plugin, consider donating to support continued development:":`Si te gusta este plugin, considera donar para apoyar el desarrollo continuo:`,"File Name of Recycle Bin":`Nombre del archivo de la papelera de reciclaje`,"Set the filename for recycle bin. 'delete' By default":`Establece el nombre de archivo para la papelera. 'eliminar' por defecto`,"File Name of Query File":`Nombre del archivo de consulta`,"Set the filename for query file. 'query' By default":`Establece el nombre de archivo para consulta. 'consulta' por defecto`,"Use Tags In Vault":`Usar etiquetas en la bóveda`,"Use tags in vault rather than only in Memos. False by default.":`Usar etiquetas en la bóveda en lugar de solo en Thino. Deshabilitado por defecto.`,"Ready to convert image into background":`Listo para convertir imagen en fondo`,List:`Lista`,Task:`Tarea`,Top:`Arriba`,Bottom:`Abajo`,TAG:`ETIQUETA`,DAY:`DÍA`,QUERY:`CONSULTA`,EDIT:`EDITAR`,PIN:`FIJAR`,UNPIN:`DESFIJAR`,DELETE:`ELIMINAR`,"CONFIRM!":`¡CONFIRMAR!`,"CREATE FILTER":`CREAR FILTRO`,"Comment it...":`Comentar...`,Settings:`Ajustes`,"Recycle bin":`Papelera de reciclaje`,"About Me":`Sobre mí`,"Fetching data...":`Obteniendo datos...`,"Here is No Memos.":`No hay thinos aquí.`,"Frequently Used Tags":`Etiquetas frecuentes`,"What do you think now...":`¿Qué piensas ahora...?`,READ:`LEER`,MARK:`MARCAR`,SHARE:`COMPARTIR`,SOURCE:`FUENTE`,RESTORE:`RESTAURAR`,ARCHIVE:`Archivar`,"Daily Review":`Revisión diaria`,"DELETE AT":`ELIMINADO EL`,"Noooop!":`¡Noooop!`,"All Data is Loaded 🎉":`Todos los datos están cargados 🎉`,"Quick filter":`Filtro rápido`,TYPE:`TIPO`,LINKED:`ENLAZADO`,"NO TAGS":`SIN ETIQUETAS`,"HAS LINKS":`TIENE ENLACES`,"HAS IMAGES":`TIENE IMÁGENES`,INCLUDE:`INCLUIR`,EXCLUDE:`EXCLUIR`,TEXT:`TEXTO`,IS:`ES`,AND:`Y`,OR:`O`,LIST:`LISTA`,ISNOT:`NO ES`,PATH:`RUTA`,METADATA:`METADATOS`,SELECT:`SELECCIONAR`,"ADD FILTER TERMS":`AGREGAR TÉRMINOS DE FILTRO`,FILTER:`FILTRAR`,Filter:`Filtro`,TITLE:`TÍTULO`,"CREATE QUERY":`CREAR CONSULTA`,"EDIT QUERY":`EDITAR CONSULTA`,MATCH:`COINCIDE`,TIMES:`VECES`,"Share Memo Image":`Compartir imagen de Thino`,"↗Click the button to save":`↗Haz clic en el botón para guardar`,"Image is generating...":`Generando imagen...`,"Image is loading...":`Cargando imagen...`,"Loading...":`Cargando...`,"😟 Cannot load image, image link maybe broken":`😟 No se puede cargar la imagen, el enlace puede estar roto`,"Daily Memos":`Thinos diarios`,"CANCEL EDIT":`CANCELAR EDICIÓN`,"LINK TO THE":`ENLAZAR A`,"Mobile Options":`Opciones móviles`,"Experimental Options":`Opciones experimentales`,"Don't support web image yet, please input image path in vault":`Aún no se admiten imágenes web, por favor ingresa la ruta de la imagen en la bóveda`,"Background Image in Dark Theme":`Imagen de fondo en tema oscuro`,"Background Image in Light Theme":`Imagen de fondo en tema claro`,'Set background image in dark theme. Set something like "Daily/one.png"':`Establece la imagen de fondo en tema oscuro. Establece algo como "Daily/one.png"`,'Set background image in light theme. Set something like "Daily/one.png"':`Establece la imagen de fondo en tema claro. Establece algo como "Daily/one.png"`,'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':`Establece la composición predeterminada de thino, debes usar {TIME} como "HH:mm" y {CONTENT} como contenido. "{TIME} {CONTENT}" por defecto`,"Default Memo Composition":`[Obsoleto] Composición predeterminada de Thino`,"Show Tasks Label":`Mostrar etiqueta de tareas`,"Show tasks label near the time text. False by default":`Mostrar etiqueta de tareas cerca del texto de hora. Deshabilitado por defecto`,"Please Open Memos First":`Por favor abre Thino primero`,DATE:`FECHA`,OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:`PLUGIN_NLDATES_DE_OBSIDIAN_NO_HABILITADO`,BEFORE:`ANTES`,AFTER:`DESPUÉS`,"Allow Comments On Memos":`Permitir comentarios en Thino`,"You can comment on memos. False by default":`Puedes comentar en thinos. Deshabilitado por defecto`,Import:`Importar`,"TITLE CANNOT BE NULL!":`¡EL TÍTULO NO PUEDE ESTAR VACÍO!`,"FILTER CANNOT BE NULL!":`¡EL FILTRO NO PUEDE ESTAR VACÍO!`,"Comments In Original DailyNotes/Notes":`Comentarios en notas diarias/notas originales`,"You should install Dataview Plugin ver 0.5.9 or later to use this feature.":`Debes instalar el Plugin Dataview ver 0.5.9 o posterior para usar esta función.`,"Open Memos Successfully":`Thino abierto exitosamente`,"Fetch Memos Error":`😭 Error al obtener`,"Copied to clipboard Successfully":`Copiado al portapapeles exitosamente`,"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":`Verifica si abriste el Plugin de notas diarias o el Plugin de notas periódicas`,"Please finish the last filter setting first":`Por favor termina la última configuración de filtro primero`,"Close Memos Successfully":`Thino cerrado exitosamente`,"Insert as Memo":`Insertar como Thino`,"Insert file as memo content":`Insertar archivo como contenido de thino`,"Image load failed":`Error al cargar la imagen`,"Content cannot be empty":`El contenido no puede estar vacío`,"Unable to create new file.":`No se puede crear nuevo archivo.`,"Failed to fetch deleted memos: ":`Error al obtener thinos eliminados: `,"RESTORE SUCCEED":`RESTAURACIÓN EXITOSA`,"DELETE SUCCEED":`ELIMINACIÓN EXITOSA`,"Save Memo button icon":`Icono del botón guardar Thino`,"The icon shown on the save Memo button in the UI.":`El icono mostrado en el botón guardar Thino en la interfaz.`,"Fetch Memos From Particular Notes":`Obtener Thinos 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':`Puedes establecer cualquier consulta Dataview para thinos para obtenerlos. Todos los thinos en esas notas se mostrarán en la lista. "#memo" por defecto`,"Allow Memos to Fetch Memo from Notes":`Permitir a Thino obtener Thino de notas`,"Use Memos to manage all memos in your notes, not only in daily notes. False by default":`Usar Thino para administrar todos los thinos en tus notas, no solo en notas diarias. Deshabilitado por defecto`,"Always Show Memo Comments":`Mostrar siempre comentarios de Thino`,"Always show memo comments on memos. False by default":`Mostrar siempre comentarios de thino en thinos. Deshabilitado por defecto`,"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":`No estableciste carpeta para notas diarias en los plugins de notas periódicas y notas diarias.`,"Please check your daily note plugin OR periodic notes plugin settings":`Por favor verifica la configuración de tu plugin de notas diarias O plugin de notas periódicas`,"Use which plugin's default configuration":`Usar la configuración predeterminada de qué plugin`,"Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":`Thino usa la configuración predeterminada del plugin para obtener thinos de diario, 'Diario' por defecto.`,Daily:`Diario`,"Always Show Leaf Sidebar on PC":`Mostrar siempre barra lateral en PC`,"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":`Mostrar barra lateral izquierda en PC/Tablet incluso cuando el ancho de la hoja es menor a 875px. Deshabilitado por defecto.`,"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":`No estableciste formato para notas diarias en los plugins de notas periódicas y notas diarias.`,"fetch more":`cargar más`,"Search all settings":`Buscar todos los ajustes`,General:`General`,Theme:`Tema`,Share:`Compartir`,Advanced:`Avanzado`,Thino:`Thino`,"Random Review":`Revisión aleatoria`,"ARCHIVED AT":`ARCHIVADO EL`,"Failed to get memos from daily notes":`Error al obtener thinos de notas diarias`,"Failed to delete memo":`Error al eliminar thino`,"CTRL + ENTER to save":`CTRL + ENTER para guardar`,"Started from":`Comenzado desde`,"Custom Background Image":`Imagen de fondo personalizada`,"Set custom background image.":`Establecer imagen de fondo personalizada.`,"Custom Memo Footer":`Pie de Thino personalizado`,"Set custom memo footer.":`Establecer pie de thino personalizado.`,"Heatmap Color Scheme":`Esquema de color del mapa de calor`,"Set different color scheme for heatmap.":`Establecer diferente esquema de color para el mapa de calor.`,"Enable Local Http Server":`Habilitar servidor Http local`,"Memos Http Server Port":`Puerto del servidor Http de Thino`,"Set memos http server port to listen. '43999' by default":`Establecer puerto del servidor http de thino para escuchar. '43999' por defecto`,"Default Editor Mode":`Modo de editor predeterminado`,"Live-Preview Mode OR Source Mode.":`Modo vista previa en vivo O modo fuente.`,"Save type for Thino":`Tipo de guardado para Thino`,DAILY:`DIARIO`,MULTI:`MÚLTIPLE`,CANVAS:`LIENZO`,ALL:`TODO`,FILE:`ARCHIVO`,TODO:`POR HACER`,DONE:`HECHO`,JOURNAL:`DIARIO`,OTHER:`OTRO`,"Failed to create daily note, check if it exists.":`Error al crear nota diaria, verifica si existe.`,"Failed to create daily note. Please check if you created a folder for daily notes.":`Error al crear nota diaria. Por favor verifica si creaste una carpeta para notas diarias.`,"After you verify your account, please refresh this page.":`Después de verificar tu cuenta, por favor actualiza esta página.`,Verify:`Verificar`,"Oops! You forget to verify insider account":`¡Ups! Olvidaste verificar la cuenta insider`,"If you have any questions, please contact us.":`Si tienes alguna pregunta, por favor contáctanos.`,"Delete Thino Directly":`Eliminar Thino directamente`,"When delete thino directly, it will not be moved to trash. False by default.":`Al eliminar thino directamente, no se moverá a la papelera. Deshabilitado por defecto.`,"Enable opening thino globally":`Habilitar apertura global de thino`,"Enable opening thino globally. False by default.":`Habilitar apertura global de thino. Deshabilitado por defecto.`,"Key for opening thino globally":`Tecla para abrir thino globalmente`,"Set key for opening thino globally. CTRL + SHIFT + T by default.":`Establecer tecla para abrir thino globalmente. CTRL + SHIFT + T por defecto.`,"Key for showing thino globally":`Tecla para mostrar thino globalmente`,"Set key for showing thino globally. CTRL + SHIFT + E by default.":`Establecer tecla para mostrar thino globalmente. CTRL + SHIFT + E por defecto.`,"Get activation code":`Obtener código de activación`,"Input activation code here":`Ingresa el código de activación aquí`,"Copy Thino id":`Copiar id de Thino`,"Activate Pro Version":`Activar versión Pro`,"Please copy Thino id first":`Por favor copia el id de Thino primero`,'You can set folder name with file name like "folder/file"':`Puedes establecer nombre de carpeta con nombre de archivo como "carpeta/archivo"`,'You can set folder name like "folder1/folder2/folder3" to create sub-folder':`Puedes establecer nombre de carpeta como "carpeta1/carpeta2/carpeta3" para crear subcarpeta`,"Default save type":`Ubicación de guardado predeterminada`,'Set the default save type for thino. "DAILY" by default':`Establece el tipo de guardado predeterminado para thino. "DIARIO" por defecto`,"Sync Thino via PKMer":`Sincronizar Thino vía PKMer`,Unlink:`Desvincular`,Link:`Vincular`,"Connect to PKMer Sync, you can check it in ":`Conectar a PKMer Sync, puedes verificarlo en `,"PKMer Sync":`PKMer Sync`,"Remove successfully":`Eliminado exitosamente`,Deactivate:`Desactivar`,Remove:`Eliminar`,"Confirm?":`¿Confirmar?`,"Sync Status":`Estado de sincronización`,"Start or stop sync":`Iniciar o detener sincronización`,"Stop sync successfully":`Sincronización detenida exitosamente`,"Start sync successfully":`Sincronización iniciada exitosamente`,Stop:`Detener`,Start:`Iniciar`,"Show thino near mouse":`Mostrar thino cerca del mouse`,"Query not found":`Consulta no encontrada`,"Send to clipboard successfully":`Enviado al portapapeles exitosamente`,"Thino - Failed to start HTTP server, please check the port is available.":`Thino - Error al iniciar servidor HTTP, por favor verifica que el puerto esté disponible.`,"Thino - Started HTTP server on port":`Thino - Servidor HTTP iniciado en el puerto`,"Thino - Terminated HTTP server":`Thino - Servidor HTTP terminado`,"File not exist":`Archivo no existe`,"Thino not found":`Thino no encontrado`,"File not found for the given thino path, is creating a new file":`Archivo no encontrado para la ruta de thino dada, creando nuevo archivo`,"Saved sync token successfully":`Token de sincronización guardado exitosamente`,"Failed to find daily notes folder":`Error al encontrar carpeta de notas diarias`,"Please install obsidian-hover-editor plugin first":`Por favor instala primero el plugin obsidian-hover-editor`,"Copied app id successfully":`ID de aplicación copiado exitosamente`,"Please input token first":`Por favor ingresa el token primero`,"Please enable sync first":`Por favor habilita la sincronización primero`,"Init Failed":`Fallo de inicialización`,"Verify successfully":`Verificación exitosa`,"Failed to verify":`Error al verificar`,"Folder not found for the given thino path, is creating a new folder":`Carpeta no encontrada para la ruta de thino dada, creando nueva carpeta`,"File not found for the given thino path":`Archivo no encontrado para la ruta de thino dada`,"Failed to read current daily note, check if it exists.":`Error al leer nota diaria actual, verifica si existe.`,"Failed to save":`Error al guardar`,"Failed to login, please login again":`Error al iniciar sesión, por favor inicia sesión nuevamente`,"COPY FAILED":`ERROR AL COPIAR`,"COPY SUCCEED":`COPIADO EXITOSO`,"Copy selected text":`Copiar texto seleccionado`,"Copy thino":`Copiar thino`,COPY:`COPIAR`,"This is a pro feature, please upgrade to pro version to use it.":`Esta es una función pro, por favor actualiza a la versión pro para usarla.`,"You can get pro version from: ":`Puedes obtener la versión pro desde: `,Save:`Guardar`,Cancel:`Cancelar`,"Thino Daily Target":`Objetivo diario de Thino`,Input:`Entrada`,"#Tag":`#Etiqueta`,"to create tag":`para crear etiqueta`,"You have verified your account. Congrats!":`¡Has verificado tu cuenta. ¡Felicitaciones!`,"Pro features":`Funciones pro`,"Target Thino Count":`Contador objetivo de Thino`,on:`en`,"Switch waterfall view":`Cambiar a vista cascada`,"Switch view":`Cambiar vista`,"Switch list view":`Cambiar a vista lista`,"Set daily target":`Establecer objetivo diario`,"Thino Save To: ":`Guardar Thino en: `,"Enter fullscreen mode":`Entrar en modo pantalla completa`,"Exit fullscreen mode":`Salir del modo pantalla completa`,words:`palabras`,word:`palabra`,"Return To Home Page":`Volver a la página principal`,"No thinos to review!":`¡No hay thinos para revisar!`,"Thinos to review":`Thinos para revisar`,"Start Review":`Comenzar revisión`,Hard:`Difícil`,Good:`Bueno`,Easy:`Fácil`,Again:`De nuevo`,"Clear all review data":`Borrar todos los datos de revisión`,"Daily Progress":`Progreso diario`,"Show stats":`Mostrar estadísticas`,"Hide stats":`Ocultar estadísticas`,Remaining:`Restante`,"Total Reviews":`Total de revisiones`,"Today, you have reviewed all your thinos!":`¡Hoy has revisado todos tus thinos!`,"Daily review limit reached! Come back tomorrow.":`¡Límite de revisión diaria alcanzado! Vuelve mañana.`,"Open thino in center window":`Abrir thino en ventana central`,"Open thino in float window":`Abrir thino en ventana flotante`,"Open thino in right sidebar":`Abrir thino en barra lateral derecha`,"Open thino in left sidebar":`Abrir thino en barra lateral izquierda`,"Show thino editor":`Mostrar editor de thino`,"Toggle minimal mode":`Alternar modo mínimo`,"Focus on thino editor":`Enfocar en editor de thino`,"ReSync web thinos to local":`Resincronizar thinos web a local`,"Sync local thinos to web":`Sincronizar thinos locales a web`,"Show daily thino":`Mostrar thino diario`,"Focus on search bar":`Enfocar en barra de búsqueda`,"Show-thino in popover(Hover editor)":`Mostrar thino en ventana emergente (Editor flotante)`,"Center window":`Ventana central`,"Float window":`Ventana flotante`,"Right sidebar":`Barra lateral derecha`,"Left sidebar":`Barra lateral izquierda`,"Save thino type when sync local":`Guardar tipo de thino al sincronizar local`,"Set the default save thino type when sync local, FILE by default.":`Establecer el tipo de guardado predeterminado de thino al sincronizar local, ARCHIVO por defecto.`,"Sync service":`Servicio de sincronización`,"Pro verification status":`Estado de verificación Pro`,"Live-preview":`Vista previa en vivo`,Source:`Fuente`,"Global copy":`Copia global`,"Set the folder name":`Establecer el nombre de la carpeta`,"Set the filename":`Establecer el nombre del archivo`,"Set the filename for current location file":`Establecer el nombre del archivo para la ubicación actual`,"Switch calendar type":`Cambiar tipo de calendario`,alphabetical:`alfabético`,alphabeticalReverse:`alfabético inverso`,byCount:`por conteo`,byCountReverse:`por conteo inverso`,"Type here":`Escribe aquí`,Today:`Hoy`,Yesterday:`Ayer`,"Last 7 days":`Últimos 7 días`,"Last 30 days":`Últimos 30 días`,"Last 90 days":`Últimos 90 días`,"Last 180 days":`Últimos 180 días`,"Last 365 days":`Últimos 365 días`,Found:`Encontrado`,"Copy filtered thinos":`Copiar thinos filtrados`,"Bulk delete":`Eliminación masiva`,"Bulk archive":`Archivo masivo`,"Bulk tag operation":`Operación masiva de etiquetas`,"Bulk restore":`Restauración masiva`,"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.":`Si estás desactivando el complemento de notas diarias, es posible que el thino no se elimine o actualice correctamente. Por favor, activa el complemento e inténtalo de nuevo.`,Preview:`Vista previa`,"Set and save":`Establecer y guardar`,"Show day mark in thino list":`Mostrar marca de día en la lista de thinos`,"Show day mark on the top of daily range thino. False by default.":`Mostrar marca de día en la parte superior del rango diario de thino. Falso por defecto.`,"Click to expand or fold, Cmd+Click to show all thinos of the day":`Clic para expandir o plegar, Cmd+Clic para mostrar todos los thinos del día`,"You can buy a license from":`Puedes comprar una licencia desde`,"No thinos in range":`No hay thinos en el rango`,Month:`Mes`,Week:`Semana`,Day:`Día`,Agenda:`Agenda`,Tomorrow:`Mañana`,Previous:`Anterior`,Next:`Siguiente`,"Search all columns...":`Buscar en todas las columnas...`,"Basic Info":`Información básica`,"Additional Info":`Información adicional`,"Created At":`Creado el`,Content:`Contenido`,"Thino Type":`Tipo de Thino`,"Source Type":`Tipo de fuente`,"Row status":`Estado de la fila`,Path:`Ruta`,"Pinned Status":`Estado fijado`,Table:`Tabla`,Chat:`Chat`,Moments:`Momentos`,Waterfall:`Cascada`,Calendar:`Calendario`,"Go to page":`Ir a la página`,Page:`Página`,Show:`Mostrar`,rows:`filas`,"Temp Filter":`Filtro temporal`,"Open link directly in Thino view":`Abrir enlace directamente en vista Thino`,"Day mark range":`Rango de marca de día`,"Set the range of day mark. Day by default.":`Establecer el rango de marca de día. Día por defecto.`,"Thino is locked":`Thino está bloqueado`,"Please unlock Thino by input password":`Por favor, desbloquea Thino introduciendo la contraseña`,"Auto Download Image":`Descarga automática de imagen`,"Auto download image when save to thino. 'false' by default":`Descargar imagen automáticamente al guardar en thino. 'falso' por defecto`,"Thino Http IP Type":`Tipo de IP Http de Thino`,"Set Thino http server ip to listen. 'localhost' by default":`Establecer IP del servidor http de Thino para escuchar. 'localhost' por defecto`,"Password to lock Thino":`Contraseña para bloquear Thino`,Unlock:`Desbloquear`,Locked:`Bloqueado`,"Password is incorrect":`La contraseña es incorrecta`,Lock:`Bloquear`,"Need password to unlock Thino":`Se necesita contraseña para desbloquear Thino`,"You have not set a password or enable this feature yet":`No has establecido una contraseña o habilitado esta función aún`,Password:`Contraseña`,"Password for Thino":`Contraseña para Thino`,"Please input your password to change password settings":`Por favor, introduce tu contraseña para cambiar la configuración de contraseña`,"Please input your password":`Por favor, introduce tu contraseña`,"Lock thino":`Bloquear thino`,date:`fecha`,time:`hora`,event:`evento`,"Add tag position":`Agregar posición de etiqueta`,"Set the position of the tag when adding tag automatically":`Establecer la posición de la etiqueta al agregarla automáticamente`,"Add tag automatically":`Agregar etiqueta automáticamente`,"Add tag to the end or beginning of the thino content when creating a thino and filtering tags":`Agregar etiqueta al final o al principio del contenido del thino al crear un thino y filtrar etiquetas`,"Add tag with new line":`Agregar etiqueta con nueva línea`,"Add tag with new line when adding tag automatically":`Agregar etiqueta con nueva línea al agregar etiqueta automáticamente`,"Input to select more tags":`Ingresa para seleccionar más etiquetas`,"Tag Bulk Edit":`Edición masiva de etiquetas`,"Tag Bulk Select":`Selección masiva de etiquetas`,"Exist Tags":`Etiquetas existentes`,"Selected Tags":`Etiquetas seleccionadas`,"Click to remove exist tag":`Clic para eliminar etiqueta existente`,"Click to remove selected tag":`Clic para eliminar etiqueta seleccionada`,"Select tags":`Seleccionar etiquetas`,"Input to select exist tag":`Ingresa para seleccionar etiqueta existente`,Beginning:`Inicio`,End:`Fin`,"Set the heading for saving thino":`Establecer el encabezado para guardar thino`,"# Heading":`# Encabezado`,"Chat view style":`Estilo de vista de chat`,"Set the style of chat view":`Establecer el estilo de vista de chat`,"Background image for moments view":`Imagen de fondo para vista de momentos`,"Set the background image for moments view":`Establecer la imagen de fondo para vista de momentos`,"Icon for moments/chat view/share image":`Icono para vista de momentos/chat/imagen compartida`,"Set the icon for moments/chat view/share image":`Establecer el icono para vista de momentos/chat/imagen compartida`,"Quote for moments view/share image":`Cita para vista de momentos/imagen compartida`,"Set the quote for moments view/share image":`Establecer la cita para vista de momentos/imagen compartida`,"Theme for Thino":`Tema para Thino`,"Set the theme for Thino":`Establecer el tema para Thino`,"Interface Details":`Detalles de interfaz`,"Task amount":`Cantidad de tareas`,"Thino status":`Estado de Thino`,"Used tags":`Etiquetas usadas`,"Used days":`Días usados`,"Most active day":`Día más activo`,"Most active hour":`Hora más activa`,"Thino amount":`Cantidad de Thinos`,"No content to generate.":`No hay contenido para generar.`,"Image generated successfully.":`Imagen generada exitosamente.`,"Failed to generate image.":`Error al generar imagen.`,"Share filtered thinos as image":`Compartir thinos filtrados como imagen`,"Latest version":`Última versión`,"Previous version":`Versión anterior`,"Thino update info":`Información de actualización de Thino`,"Debug info copied to clipboard":`Información de depuración copiada al portapapeles`,"Copy debug info":`Copiar información de depuración`,"Failed to load changelog":`Error al cargar el registro de cambios`,"View online":`Ver en línea`,ChangeLog:`Registro de cambios`,"Please open thino first":`Por favor, abre thino primero`,"Insert editor":`Insertar 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.":`Por favor, establece diferentes ubicaciones de guardado para la configuración multi-archivo en Thino. La carpeta del diario se superpone con la ubicación de guardado multi-archivo, o hay riesgo de que se lea repetidamente.`,"Default time prefix for thino in daily notes":`Prefijo de tiempo predeterminado para thino en notas diarias`,"Set default time prefix for thino in daily notes.":`Establecer prefijo de tiempo predeterminado para thino en notas diarias.`,"Save image successfully":`Imagen guardada exitosamente`,"User quote":`Cita de usuario`,"Set user quote for thino":`Establecer cita de usuario para thino`,"User icon":`Icono de usuario`,"Set user icon for thino. You can input http/https link or file path in vault.":`Establecer icono de usuario para thino. Puedes ingresar enlace http/https o ruta de archivo en la bóveda.`,"User info":`Información de usuario`,"Copy filtered results":`Copiar resultados filtrados`,"Share image":`Compartir imagen`,Default:`Predeterminado`,Gray:`Gris`,Grass:`Hierba`,Flame:`Llama`,Olive:`Oliva`,Ice:`Hielo`,Magenta:`Magenta`,"Daily notes":`Notas diarias`,Editor:`Editor`,"Append/prepend text when share to Thino":`Agregar texto al principio/final al compartir en Thino`,"Append text when share to Thino":`Agregar texto al final al compartir en Thino`,"Prepend text when share to Thino":`Agregar texto al principio al compartir en Thino`,"Add newline when append/prepend text":`Agregar nueva línea al agregar texto al principio/final`,"Input anything here":`Ingresa cualquier cosa aquí`,Prepend:`Agregar al principio`,Append:`Agregar al final`,Both:`Ambos`,None:`Ninguno`,"Hide pinned group":`Ocultar grupo fijado`,"Hide pinned group in thino list. False by default.":`Ocultar grupo fijado en la lista de thino. Falso por defecto.`,"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.":`Establecer el encabezado para el tipo de tarea de thino, por defecto el contenido de thino grabado se insertará al final del diario; si se proporciona un título, todo el contenido de thino grabado se categorizará uniformemente bajo ese título.`,"Different insert target for different type":`Diferente objetivo de inserción para diferente tipo`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`Activa esto para establecer diferente objetivo de inserción para diferente tipo de thino, como tipo tarea o lista de thino`,"You can set whole diary or only part of it":`Puedes establecer todo el diario o solo una parte`,"Set process target":`Establecer objetivo de proceso`,Custom:`Personalizado`,"Whole diary":`Diario completo`,"Set thino insert place":`Establecer lugar de inserción de thino`,"Set where to insert thino content":`Establecer dónde insertar contenido de thino`,"End of the diary":`Final del diario`,"Custom location":`Ubicación personalizada`,"Setting guide":`Guía de configuración`,"Details settings":`Configuraciones detalladas`,"Start Thino":`Iniciar Thino`,"About Thino Pro":`Acerca de Thino Pro`,Enabled:`Habilitado`,Enable:`Habilitar`,"Daily notes folder":`Carpeta de notas diarias`,"Set daily notes folder":`Establecer carpeta de notas diarias`,"Daily note name format":`Formato de nombre de nota diaria`,"Set daily note name format":`Establecer formato de nombre de nota diaria`,"Daily note plugin":`Complemento de nota diaria`,"Enable daily note plugin":`Habilitar complemento de nota diaria`,Selected:`Seleccionado`,Select:`Seleccionar`,"A classic theme for Thino with a two-column layout":`Un tema clásico para Thino con diseño de dos columnas`,Classic:`Clásico`,"A modern theme for Thino with a three-column layout and some unique features.":`Un tema moderno para Thino con diseño de tres columnas y algunas características únicas.`,Modern:`Moderno`,"Go and enjoy Thino":`Ve y disfruta Thino`,"Congrats! All settings done":`¡Felicitaciones! Todas las configuraciones completadas`,"Adjust settings that influence your user experience with Thino.":`Ajusta las configuraciones que influyen en tu experiencia de usuario con Thino.`,"Set preferences for using Thino":`Establecer preferencias para usar Thino`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`Si estás usando la versión básica de Thino, se requiere habilitar el complemento de nota diaria. Configura sus ajustes para trabajar efectivamente con él.`,"Go with daily note plugin":`Ir con complemento de nota diaria`,"Choose a theme for Thino.":`Elige un tema para Thino.`,"Set theme for Thino":`Establecer tema para Thino`,"Set up your user info for Thino.":`Configura tu información de usuario para Thino.`,"Get started with Thino":`Comenzar con Thino`,"Skip and start Thino":`Saltar e iniciar Thino`,"Next step":`Siguiente paso`,"Back to previous step":`Volver al paso anterior`,"Click to enable =>":`Clic para habilitar =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`Esta es la barra lateral de Thino. Navega a diferentes rutas o selecciona filtro de consulta.`,"Click here and go to settings page.":`Haz clic aquí y ve a la página de configuración.`,"Click here and go to different path.":`Haz clic aquí y ve a una ruta diferente.`,"Select or create query filter here.":`Selecciona o crea filtro de consulta aquí.`,"See the status of Thinos here.":`Ve el estado de los Thinos aquí.`,"Search your thino quickly here.":`Busca tu thino rápidamente aquí.`,"Edit or create your thino here.":`Edita o crea tu thino aquí.`,"See your thinos here.":`Ve tus thinos aquí.`,"See your time status of thinos here.":`Ve tu estado de tiempo de thinos aquí.`,"See your tags here. Tags will be shown when thino contains tags.":`Ve tus etiquetas aquí. Las etiquetas se mostrarán cuando thino contenga etiquetas.`,Done:`Hecho`,"Thino is ready to use. ":`Thino está listo para usar. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`Puedes comenzar a usar Thino ahora. Si quieres saber más sobre Thino Pro, haz clic en el botón de abajo.`,"Default time prefix":`Prefijo de tiempo predeterminado`,"Append Text Action":`Acción de agregar texto al final`,"Prepend Text Action":`Acción de agregar texto al principio`,Preset:`Preestablecido`,"Select Tags":`Seleccionar etiquetas`,"It is not available on small view":`No está disponible en vista pequeña`,"Append text":`Agregar texto al final`,"Prepend text":`Agregar texto al principio`,"Your daily note folder is not set correctly, please check your settings":`Tu carpeta de notas diarias no está configurada correctamente, por favor revisa tu configuración`,"Default sharing style":`Estilo de compartir predeterminado`,"Set the default style for sharing thino, 'Modern' by default.":`Establecer el estilo predeterminado para compartir thino, "Moderno" por defecto.`,Clean:`Limpio`,Minimal:`Mínimo`,Gradient:`Gradiente`,"Thino share":`Compartir Thino`,"Copy to clipboard failed":`Error al copiar al portapapeles`,"Copy to clipboard successfully":`Copiado al portapapeles exitosamente`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Tu contenido ha sido copiado al portapapeles e insertado en el editor. Por favor inténtalo de nuevo`,"Share thino":`Compartir thino`,"Set file name after create thino":`Establecer nombre de archivo después de crear thino`,"You can set file name after create thino. A input box will show when you create thino.":`Puedes establecer el nombre del archivo después de crear thino. Se mostrará una caja de entrada cuando crees thino.`,SPLIT:`DIVIDIR`,"Split by Heading 1":`Dividir por Encabezado 1`,"Split by Heading 2":`Dividir por Encabezado 2`,"Split by Heading 3":`Dividir por Encabezado 3`,"Insert task":`Insertar tarea`,"All settings have been reset to default.":`Todas las configuraciones han sido restablecidas a los valores predeterminados.`,"Reset all Thino settings":`Restablecer todas las configuraciones de Thino`,"Reset settings":`Restablecer configuraciones`,"Reset Thino settings to default settings.":`Restablecer configuraciones de Thino a valores predeterminados.`,"Task Management":`Gestión de tareas`,"Append completed date when task done in thino":`Agregar fecha de completado cuando la tarea se complete en thino`,"Append completed date when task done in thino. False by default":`Agregar fecha de completado cuando la tarea se complete en thino. Falso por defecto`,"Set tag for single file that Thino indexes":`Establecer etiqueta para archivo único que Thino indexa`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"Cuando estableces una etiqueta aquí, Thino indexará este archivo que contiene esta etiqueta y lo mostrará en la lista. No necesitas agregar `#`.","Set tag for file type file":`Establecer etiqueta para archivo tipo archivo`,"Set tag for multi type file":`Establecer etiqueta para archivo multi tipo`,"Please input the tag":`Por favor ingresa la etiqueta`,"Merge thinos in to thino share image":`Fusionar thinos en imagen compartida de thino`,"Custom height for Thino content":`Altura personalizada para contenido de Thino`,"Set custom height for Thino content. Like 200px or 20rem":`Establecer altura personalizada para contenido de Thino. Como 200px o 20rem`,"Input height":`Ingresar altura`,"Submit issue":`Enviar problema`,"Current version":`Versión actual`,"Bug report":`Reporte de error`,"Click the button to copy debug info and open the issue page":`Haz clic en el botón para copiar información de depuración y abrir la página de problemas`,"Copy and go":`Copiar e ir`,"Debug info copied":`Información de depuración copiada`,"Feature request":`Solicitud de función`,"Submit your feature request to the issue page":`Envía tu solicitud de función a la página de problemas`,Go:`Ir`,"Toggle query list visibility":`Alternar visibilidad de lista de consultas`,"Toggle tags visibility":`Alternar visibilidad de etiquetas`,"Toggle sidebar visibility":`Alternar visibilidad de barra lateral`,Collapse:`Colapsar`,Expand:`Expandir`,"Max height for collapse":`Altura máxima para colapsar`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`La altura máxima para colapsar thino, cuando se establece en 0, thino no colapsará. 0 por defecto. (Esto no es conteo de líneas, es altura en px.)`,"Render content":`Renderizar contenido`,"Optimize for Callout":`Optimizar para Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`No renderizará automáticamente contenido que contenga más de 3 callouts. Verdadero por defecto`,"The value should be greater than":`El valor debe ser mayor que`,"Append Text":`Agregar texto al final`,"Prepend Text":`Agregar texto al principio`,"Thino height when collapsed":`Altura de Thino cuando está colapsado`,"The height for thino when it is collapsed, when set 0, thino would not collapse . 100 by default. (This is not lines count, it is height in px.)":`La altura para thino cuando está colapsado, cuando se establece en 0, thino no colapsará. 100 por defecto. (Esto no es conteo de líneas, es altura en px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`Esta opción te permitirá usar otras vistas cuando el ancho de la hoja no sea suficiente. Falso por defecto.`,"Can select other views when leaf width is not enough":`Puede seleccionar otras vistas cuando el ancho de la hoja no es suficiente`,"TRASH BOX":`PAPELERA`,"Wait templater to finish parse before insert thino":`Esperar a que templater termine de analizar antes de insertar thino`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`Esta opción te permitirá esperar a que templater termine de analizar antes de insertar thino, lo que puede hacer que necesites confirmar dos veces entre insertar thino. Falso por defecto.`,"Get thino capture extension":`Obtener extensión de captura de thino`,"You can capture idea/text from chrome now.":`Ahora puedes capturar idea/texto desde chrome.`,"Open File":`Abrir archivo`,"Exported CSV file":`Archivo CSV exportado`,"Updated At":`Actualizado el`,"Export to CSV":`Exportar a CSV`,"Quick add button on mobile navbar":`Botón de agregar rápido en barra de navegación móvil`,"Always show status text":`Siempre mostrar texto de estado`,"Support filter by metadata from file":`Soportar filtro por metadatos desde archivo`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`Cuando habilites esto, podrás filtrar a través de metadatos desde archivo, como etiquetas en archivo. Pero los thinos desde canvas no están soportados. Falso por defecto.`,"Show source near timestamp in thino":`Mostrar fuente cerca de marca de tiempo en thino`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`Cuando habilites esto, podrás ver la fuente cerca de la marca de tiempo en thino. Puedes establecer título en metadatos para sobrescribir esto. Falso por defecto.`,"Show Update Message":`Mostrar mensaje de actualización`,"Show update message when Thino is updated. True by default":`Mostrar mensaje de actualización cuando Thino se actualiza. Verdadero por defecto`,"Sync manually":`Sincronizar manualmente`,"Show all scrollbars":`Mostrar todas las barras de desplazamiento`,"TIME RANGE":`RANGO DE TIEMPO`,WITHIN:`DENTRO DE`,"7 days":`7 días`,"14 days":`14 días`,"30 days":`30 días`,"3 months":`3 meses`,"6 months":`6 meses`,"1 year":`1 año`,"This week":`Esta semana`,"Last week":`Semana pasada`,"This month":`Este mes`,"Last month":`Mes pasado`,"This year":`Este año`,"Last year":`Año pasado`,"No history":`Sin historial`,"Today Remaining":`Restante hoy`,"Today Total":`Total hoy`,"Historical Statistics":`Estadísticas históricas`,byTime:`Por tiempo`,byTimeReverse:`Por tiempo inverso`,Stat:`Estadística`,Statistics:`Estadísticas`,"Daily Thino Count":`Conteo diario de Thino`,Total:`Total`,thinos:`thinos`,"Thino Types":`Tipos de Thino`,"Distribution of thino types":`Distribución de tipos de thino`,"Thino Status":`Estado de Thino`,"Distribution of thino status":`Distribución de estado de thino`,"Popular Tags":`Etiquetas populares`,"Top 10 most used tags":`Top 10 etiquetas más usadas`,"Thino Count":`Conteo de Thino`,"Hourly distribution":`Distribución por hora`,"Current month":`Mes actual`,"Monthly distribution":`Distribución mensual`,"30 Days":`Últimos 30 días`,Year:`Año`,"Time Distribution":`Distribución de tiempo`,"When do you write thinos":`Cuándo escribes thinos`,"Content Length":`Longitud de contenido`,"Distribution of thino lengths":`Distribución de longitudes de thino`,"Daily Thinos":`Thinos diarios`,"Show Time Distribution":`Mostrar distribución de tiempo`,"Hide date picker":`Ocultar selector de fecha`,"Show date picker":`Mostrar selector de fecha`,"Clear filter":`Limpiar filtro`,"Copy link":`Copiar enlace`,"Copy embed link":`Copiar enlace incrustado`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter para guardar thino`,"Fixed strings for thinos":`Cadenas fijas para thinos`,"Use fixed strings for thinos":`Usar cadenas fijas para thinos`,"Enable to add fixed strings at the beginning or end of thinos.":`Habilitar para agregar cadenas fijas al principio o final de los thinos.`,"Fixed prefix for thinos":`Prefijo fijo para thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Agregar esta cadena al principio de cada thino. Admite marcadores como {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Sufijo fijo para thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Agregar esta cadena al final de cada thino. Admite marcadores como {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Conteo de palabras excedido`,"Word count feature":`Función de conteo de palabras`,"Enable real-time word count display in the editor":`Habilitar visualización de conteo de palabras en tiempo real en el editor`,"Maximum word count":`Conteo máximo de palabras`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Establecer un conteo máximo de palabras para thino. El editor mostrará una advertencia cuando se exceda. Establecer en 0 para ilimitado.`,"No linked thinos found":`No se encontraron thinos vinculados`,"Reference links group":`Grupo de enlaces de referencia`,"Enable reference links group in thino.":`Habilitar grupo de enlaces de referencia en thino.`,"No reference links found":`No se encontraron enlaces de referencia`,"Outgoing Links":`Enlaces salientes`,"Incoming Links":`Enlaces entrantes`,"Error fetching reference links":`Error al obtener enlaces de referencia`,"Double click behavior":`Comportamiento de doble clic`,"Set the behavior when double click on a thino.":`Establecer el comportamiento al hacer doble clic en un thino.`,"Open thino":`Abrir thino`,"Edit thino":`Editar thino`,"Go to source":`Ir a la fuente`,"Do nothing":`No hacer nada`,"Use default header in mobile view":`Usar encabezado predeterminado en vista móvil`,"Use default header in mobile view of thino rather than custom header.":`Usar encabezado predeterminado en vista móvil de thino en lugar de encabezado personalizado.`}})),Ln,Rn=o((()=>{Ln={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`}})),zn,Bn=o((()=>{zn={}})),Vn,Hn=o((()=>{Vn={}})),Un,Wn=o((()=>{Un={}})),Gn,Kn=o((()=>{Gn={}})),qn,Jn=o((()=>{qn={}})),Yn,Xn=o((()=>{Yn={}})),Zn,Qn=o((()=>{Zn={}})),$n,er=o((()=>{$n={}})),tr,nr=o((()=>{tr={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":`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`}})),rr,ir=o((()=>{rr={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":`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`}})),ar,or=o((()=>{ar={}})),sr,cr=o((()=>{sr={}})),lr,ur=o((()=>{lr={}})),dr,fr=o((()=>{dr={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":`保存 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:`归档`,"Daily Review":`每日回顾`,"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:`选择`,PATH:`路径`,METADATA:`元数据`,"ADD FILTER TERMS":`添加检索条件`,FILTER:`筛选器`,TITLE:`标题`,"CREATE QUERY":`创建检索式`,"EDIT QUERY":`编辑检索式`,MATCH:`匹配`,TIMES:`次`,"Share Memo Image":`分享 Thino 图片`,"Outer Frame":`外框`,"Enable Frame":`启用外框`,"Frame Padding":`外框边距`,"Frame Color":`外框颜色`,"↗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":`展示任务标签`,Gallery:`画廊`,"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/Tablet 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":`随机回顾`,"Calendar view":`日历视图`,"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:`所有`,"Journal mode saves memos into periodic note files (daily/weekly/monthly/yearly)":`Journal 模式将 Thino 保存到周期笔记文件中(日/周/月/年)`,"Journal granularity":`周期粒度`,"Choose the period type for journal files":`选择 Journal 文件的周期类型`,Daily:`日记`,Weekly:`周记`,Monthly:`月报`,Yearly:`年报`,"Use independent settings":`使用独立设置`,"When enabled, use custom folder/format/template instead of inheriting from daily notes plugin":`启用后,使用自定义的文件夹/格式/模板,不再继承日记插件设置`,"Heading date format":`标题日期格式`,"Format for date headings in journal files":`Journal 文件中日期标题的格式`,Custom:`自定义`,"Custom heading format":`自定义标题格式`,Folder:`文件夹`,"Folder path for":`文件夹路径:`,notes:`笔记`,"e.g.":`例如`,"Date format":`日期格式`,"Moment.js format for file names":`文件名的 Moment.js 日期格式`,default:`默认`,Template:`模板`,"Template file path for new notes":`新笔记的模板文件路径`,"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":`验证失败`,"Login with PKMer":`使用 PKMer 登录`,"Logout from PKMer":`退出 PKMer 登录`,"Logged in as":`已登录为`,Devices:`设备数`,"AI Quota":`AI 额度`,Logout:`退出登录`,"Pro activated":`Pro 已激活`,"Thino Copilot quota":`Thino Copilot 额度`,"Contact support":`联系支持`,"Click to manage in Super settings":`点击前往 Super 设置管理`,"Login with PKMer account to activate Pro features":`使用 PKMer 账号登录以激活 Pro 功能`,"Legacy activation (deprecated)":`传统激活方式(已弃用)`,"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:`字词`,word:`字`,"Return To Home Page":`返回首页`,"No thinos to review!":`没有 thino 需要回顾!`,"Thinos to review":`Thino 需要回顾`,"Start Review":`开始回顾`,Hard:`困难`,Good:`良好`,Easy:`简单`,Again:`重来`,"Daily Progress":`每日进度`,"Clear all review data":`清除所有回顾数据`,"Show stats":`显示统计`,"Hide stats":`隐藏统计`,Remaining:`剩余`,"Total Reviews":`总回顾`,"Today, you have reviewed all your thinos!":`今天你已经回顾了所有 thino!`,"Daily review limit reached! Come back tomorrow.":`每日回顾上限已达到!明天再来吧。`,"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":`批量恢复`,"Send to file":`发送到文件`,"Select target file":`选择目标文件`,"Content format":`内容格式`,"List item":`列表项`,Callout:`高亮块`,"Plain text":`纯文本`,"Archive originals":`归档原内容`,"Delete originals":`删除原内容`,"After sending":`发送后操作`,Target:`目标`,"Processing...":`处理中...`,"Hide entry":`隐藏入口`,"Show entry":`显示入口`,More:`更多`,"Pin tag":`置顶标签`,"Unpin tag":`取消置顶`,"Rename tag":`重命名标签`,"Rename all":`将所有`,"New tag name":`新标签名`,Renamed:`已重命名`,"Set emoji":`设置 Emoji`,"Set emoji for tag":`设置标签 Emoji`,"Custom emoji":`自定义 Emoji`,"Set color":`设置颜色`,"Set color for tag":`设置标签颜色`,Clear:`清除`,"ORGANIZE SUCCEED":`整理完成`,"Organize failed":`整理失败`,"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":`标签批量编辑`,"Tag Bulk Select":`标签批量选择`,"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. You can input http/https link or file path in vault.":`设置用户头像。你可以设置 http/https 链接或者 vault 中的文件路径。`,"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":`自定义位置`,"Setting guide":`设置流程`,"Details settings":`详细设置`,"Start Thino":`开始 Thino`,"About Thino Pro":`关于 Thino 专业版`,Enabled:`已启用`,Enable:`启用`,"Daily notes folder":`日记文件夹`,"Set daily notes folder":`设置日记文件夹`,"Daily note name format":`日记文件名格式`,"Set daily note name format":`设置日记文件名格式`,"Daily note plugin":`日记插件`,"Enable daily note plugin":`启用日记插件`,Selected:`已选择`,Select:`选择`,"A classic theme for Thino with a two-column layout":`Thino 的经典主题,采用两列布局`,Classic:`经典`,"A modern theme for Thino with a three-column layout and some unique features.":`Thino 的现代主题,采用三列布局和一些独特的功能。`,Modern:`现代`,Focus:`聚焦`,Immersive:`沉浸`,"Show more":`展开更多`,"Collapse tags":`收起`,"Search inspirations…":`搜索灵感…`,"Show {count} more…":`展开剩余 {count} 个…`,thoughts:`想法`,tags:`标签`,days:`天`,"Immersive mode (F)":`进入沉浸模式(F)`,"Exit immersive mode (Esc)":`退出沉浸模式(Esc)`,"Go and enjoy Thino":`去享受 Thino 吧`,"Congrats! All settings done":`恭喜!所有设置已完成`,"Adjust settings that influence your user experience with Thino.":`调整影响你使用 Thino 的设置。`,"Set preferences for using Thino":`设置使用 Thino 的偏好`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`如果你使用的是 Thino 基础版,启用日记插件是必须的。配置其设置以有效地使用它。`,"Go with daily note plugin":`使用日记插件`,"Choose a theme for Thino.":`选择 Thino 的主题。`,"Set theme for Thino":`设置 Thino 的主题`,"Set up your user info for Thino.":`设置你的用户信息。`,"Get started with Thino":`开始使用 Thino`,"Skip and start Thino":`跳过并开始 Thino`,"Next step":`下一步`,"Back to previous step":`返回上一步`,"Click to enable =>":`点击启用 =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`这是 Thino 的侧边栏。你可以导航到不同的路径或选择查询过滤器。`,"Click here and go to settings page.":`点击这里并转到设置页面。`,"Click here and go to different path.":`点击这里并转到不同的路径。`,"Select or create query filter here.":`在这里选择或创建查询过滤器。`,"See the status of Thinos here.":`在这里看到 Thino 的状态。`,"Search your thino quickly here.":`在这里快速搜索你的 Thino。`,"Edit or create your thino here.":`在这里编辑或创建你的 Thino。`,"See your thinos here.":`在这里看到你的 Thino。`,"See your time status of thinos here.":`在这里看到你的 Thino 时间状态。`,"See your tags here. Tags will be shown when thino contains tags.":`在这里看到你的标签。当 Thino 包含标签时,标签将显示。`,Done:`完成`,"Thino is ready to use. ":`Thino 已准备好使用。`,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`你现在可以开始使用 Thino 了。如果你想了解更多关于 Thino 专业版的信息,请点击下面的按钮。`,"Default time prefix":`默认时间前缀`,"Append Text Action":`分享到 Thino 时的后置文本动作`,"Prepend Text Action":`分享到 Thino 时的前置文本动作`,Preset:`预设`,"Select Tags":`选择标签`,"It is not available on small view":`在窄的视图中不可用`,"Append text":`在末尾添加文本`,"Prepend text":`在开头添加文本`,"Your daily note folder is not set correctly, please check your settings":`你的日记文件夹设置不正确,请检查你的设置`,"Default sharing style":`默认分享样式`,"Select the font for the memo content":`选择备忘录内容的字体`,"Select the background for the memo image":`选择备忘录图片的背景`,"Select the content type for the left bottom area":`选择左下角区域的内容类型`,"Default text":`默认文本`,"Activity heatmap":`活动热图`,"Left bottom content":`左下角内容`,Font:`字体`,Background:`背景`,"Default font":`默认字体`,"Orange gradient":`橙色渐变`,"Blue gradient":`蓝色渐变`,"Green gradient":`绿色渐变`,"Pink gradient":`粉色渐变`,"Image read failed, please try again":`图片读取失败,请重试`,"Please select a valid image file":`请选择有效的图片文件`,"Default background":`默认背景`,"Select local image":`选择本地图片`,"Image file cannot exceed 5MB":`图片文件不能超过 5MB`,"Font size":`字体大小`,"Adjust the font size":`调整字体大小`,"Set the default style for sharing thino, 'Modern' by default.":`设置 Thino 的默认分享样式,默认为"现代"。`,Clean:`清爽`,Minimal:`极简`,Gradient:`渐变`,"Thino share":`Thino 分享`,"Copy to clipboard failed":`复制到剪贴板失败`,"Auto-copy was blocked. Long-press the box below to select and copy your Thino id manually.":`自动复制被系统阻止,请长按下方文本框选中并手动复制你的 Thino id。`,"Copy to clipboard successfully":`复制到剪贴板成功`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`你的内容已经复制到剪贴板,并插入到编辑器中。请再试一次`,"Share thino":`分享 Thino`,"Set file name after create thino":`创建 Thino 后设置文件名`,"You can set file name after create thino. A input box will show when you create thino.":`你可以在创建 Thino 后设置文件名。当你创建 Thino 时,会显示一个输入框。`,SPLIT:`分割`,"Split by Heading 1":`按一级标题分割`,"Split by Heading 2":`按二级标题分割`,"Split by Heading 3":`按三级标题分割`,"Insert task":`插入任务`,"All settings have been reset to default.":`所有设置已重置为默认值。`,"Reset all Thino settings":`重置所有 Thino 设置`,"Reset settings":`重置设置`,"Reset Thino settings to default settings.":`将 Thino 设置重置为默认设置。`,"Task Management":`任务管理`,"Append completed date when task done in thino":`在 Thino 中的任务完成时添加完成日期`,"Append completed date when task done in thino. False by default":`在 Thino 中的任务完成时添加完成日期。默认为关闭`,"Set tag for single file that Thino indexes":`Thino 会索引被设置标签的单文件`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"当你在这里设置一个标签时,Thino 会索引包含这个标签的文件,并在列表中显示。不需要添加 `#`。","Set tag for file type file":`为单文件类型文件设置标签`,"Set tag for multi type file":`为多文件类型文件设置标签`,"Please input the tag":`请输入标签`,"Merge thinos in to thino share image":`合并 Thino 到 Thino 分享图片`,"Custom height for Thino content":`自定义 Thino 内容高度`,"Set custom height for Thino content. Like 200px or 20rem":`设置 Thino 内容的自定义高度。如 200px 或 20rem`,"Input height":`输入高度`,"Submit issue":`提交问题`,"Current version":`当前版本`,"Bug report":`Bug 报告`,"Click the button to copy debug info and open the issue page":`点击按钮复制调试信息并打开问题页面`,"Copy and go":`复制并前往`,"Debug info copied":`调试信息已复制`,"Feature request":`功能请求`,"Submit your feature request to the issue page":`提交你的功能请求到问题页面`,Go:`前往`,"Toggle query list visibility":`切换 Query 列表可见性`,"Toggle tags visibility":`切换标签可见性`,"Toggle sidebar visibility":`切换侧边栏可见性`,Collapse:`收起`,Expand:`展开`,"Max height for collapse":`折叠的最大高度`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`Thino 折叠的最大高度,设置为 0 时,Thino 不会折叠。默认为 0。(这不是行数,而是像素高度值)`,"Render content":`渲染内容`,"Optimize for Callout":`优化 Callout 渲染性能问题`,"Won't render content contains more than 3 callouts automatically. True by default":`不会自动渲染包含超过 3 个 Callout 的内容。默认为开启`,"The value should be greater than":`值应大于`,"Append Text":`后置文本`,"Prepend Text":`前置文本`,"Thino height when collapsed":`Thino 折叠时的高度`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`Thino 折叠时的高度,当设置为 0 时,完全折叠。默认为 100。(这不是行数,而是像素高度值)`,"This option will allow you use other views when leaf width is not enough. False by default.":`当页面宽度不够时,可以选择其他视图。默认为关闭。`,"Can select other views when leaf width is not enough":`当页面宽度不够时,可以选择其他视图`,"TRASH BOX":`回收站`,"Wait templater to finish parse before insert thino":`在插入 Thino 之前等待 Templater 完成解析`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`此选项将允许您在插入 Thino 之前等待 Templater 完成解析,这可能会导致您在插入 Thino 之间需要确认两次。默认为关闭。`,"Get thino capture extension":`获取 Thino 剪裁扩展`,"You can capture idea/text from chrome now.":`你现在可以从 Chrome 中捕获想法/文本。`,"Open File":`打开文件`,"Exported CSV file":`导出的 CSV 文件`,"Updated At":`更新于`,"Export to CSV":`导出为 CSV`,"Quick add button on mobile navbar":`移动端导航栏的快速添加按钮`,"Always show status text":`始终显示状态文本`,"Support filter by metadata from file":`支持通过文件中的元数据进行筛选`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`启用后,你可以通过文件中的元数据进行筛选,例如文件中的标签。但画布中的 Thino 不支持。默认为关闭。`,"Show source near timestamp in thino":`在 Thino 时间戳旁显示 Thino 的来源`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`启用后,你可以在 Thino 时间戳旁看到 Thino 的来源。你可以在元数据中设置 title 来覆盖文件名。默认为关闭。`,"Show Update Message":`显示更新消息`,"Show update message when Thino is updated. True by default":`Thino 更新时显示更新消息。默认为开启`,"Sync manually":`手动同步`,"Show all scrollbars":`显示所有滚动条`,"TIME RANGE":`时间范围`,WITHIN:`在内`,"7 days":`7天`,"14 days":`14天`,"30 days":`30天`,"3 months":`3个月`,"6 months":`6个月`,"1 year":`1年`,"This week":`本周`,"Last week":`上周`,"This month":`本月`,"Last month":`上月`,"This year":`今年`,"Last year":`去年`,"No history":`没有历史记录`,"Today Remaining":`今日剩余`,"Today Total":`今日总计`,"Historical Statistics":`历史统计`,byTime:`按时间`,byTimeReverse:`按时间反序`,Stat:`统计`,Statistics:`统计`,"Daily Thino Count":`每日 Thino 数量`,Total:`总计`,thinos:`thinos`,"Thino Types":`Thino 类型`,"Distribution of thino types":`Thino 类型分布`,"Thino Status":`Thino 状态`,"Distribution of thino status":`Thino 状态分布`,"Popular Tags":`常用标签`,"Top 10 most used tags":`Top 10 常用标签`,"Thino Count":`Thino 数量`,"Hourly distribution":`每小时分布`,"Current month":`当前月份`,"Monthly distribution":`每月分布`,"30 Days":`过去 30 天`,Year:`年份`,"Time Distribution":`时间分布`,"When do you write thinos":`你什么时候写 Thino`,"Content Length":`内容长度`,"Distribution of thino lengths":`Thino 长度分布`,"Daily Thinos":`每日 Thino`,"Show Time Distribution":`显示时间分布`,"Hide date picker":`隐藏日期选择器`,"Show date picker":`显示日期选择器`,"Clear filter":`清除筛选`,"Copy link":`复制链接`,"Copy embed link":`复制嵌入链接`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter 保存 Thino`,"Fixed strings for thinos":`固定字符串`,"Use fixed strings for thinos":`使用固定字符串`,"Enable to add fixed strings at the beginning or end of thinos.":`启用为每个 Thino 添加固定字符串。`,"Fixed prefix for thinos":`固定前缀`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`在每个 Thino 的开头添加此字符串。支持占位符,如 {{TIME|YYYYMMDDHHmmss}}。`,"Fixed suffix for thinos":`固定后缀`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`在每个 Thino 的末尾添加此字符串。支持占位符,如 {{TIME|YYYYMMDDHHmmss}}。`,"Word count exceeded":`字数超出限制`,"Word count feature":`字数统计`,"Enable real-time word count display in the editor":`启用实时字数显示`,"Maximum word count":`最大字数`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`设置 Thino 的最大字数。当超过时,编辑器将显示警告。设置为 0 时,没有限制。`,"No linked thinos found":`没有找到链接的 Thino`,"Reference links group":`链接组`,"Enable reference links group in thino.":`在 Thino 中启用链接组。`,"No reference links found":`没有找到链接`,"Error fetching reference links":`获取链接失败`,"Outgoing Links":`出链`,"Incoming Links":`入链`,"Double click behavior":`双击行为`,"Set the behavior when double click on a thino.":`设置双击 Thino 的行为。`,"Open thino":`打开 Thino`,"Edit thino":`编辑 Thino`,"Go to source":`前往来源`,"Do nothing":`什么都不做`,"Use default header in mobile view":`使用默认的移动端头部`,"Use default header in mobile view of thino rather than custom header.":`使用默认的移动端头部,而不是自定义的头部。`,"Ignore folders for multi type":`忽略多文件类型文件夹`,"Set folders to ignore when using multi type. Separate multiple folders with comma (,).":`设置多文件类型时忽略的文件夹。用逗号 (,) 分隔多个文件夹。`,"folder1,folder2/subfolder":`folder1,folder2/subfolder`,"Using block link when dragging a thino":`拖动 Thino 以插入连结`,"Using block link when dragging a thino for daily":`拖动 Thino 以插入连结到日记`,"Matched via tag in content":`通过内容中的标签匹配`,"Matched via tag in file":`通过文件中的标签匹配`,"Focus on editor when open":`打开时聚焦编辑器`,"Focus on editor when open. True by default.":`打开时聚焦编辑器。默认为开启`,"Show scroll to top button":`显示滚动到顶部按钮`,"Show scroll to top button. True by default":`显示滚动到顶部按钮。默认为开启`,"Zoom image by default":`默认缩放图片`,"Zoom image by default when viewing image.":`查看图片时默认缩放图片。`,"View archive in random review":`在随机回顾中查看归档的 Thino`,"View archived thinos in random review. True by default":`在随机回顾中查看归档的 Thino。默认为开启`,"Linked by":`链接自`,Linked:`链接`,DUPLICATE:`复制`,"Show scrollbars in all thino views.":`在所有 Thino 视图中显示滚动条。`,"Drag to paste content":`拖动粘贴内容`,"You will be able to paste content from other apps to thino by dragging rather than pasting the block link.":`你可以通过拖动而不是粘贴块链接来将内容从其他应用粘贴到 Thino 中。`,"Dragging behavior":`拖动行为`,"Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.":`控制拖动 Thino 的行为。默认粘贴块链接。块链接选项仅在源类型为日记时有效。`,"Block link":`块链接`,"Quick capture tool that allows you to create and manage your ideas, tasks, and more.":`快速捕获工具,允许你创建和管理你的想法、任务等。`,About:`关于`,Text:`文本`,"Open Documentation":`打开文档`,Documentation:`文档`,Version:`版本`,"View the documentation for this plugin":`查看此插件的文档`,"Activate Pro":`激活专业版`,Pro:`专业版`,"Activated Pro":`已激活专业版`,Tasks:`任务`,"Show release notes":`显示发布说明`,"Show release notes when Thino is updated. True by default":`显示发布说明当 Thino 更新时。默认为开启`,"Open change log":`打开更新日志`,"Change log":`更新日志`,"View the change log for this plugin":`查看此插件的更新日志`,items:`项`,"Deleting...":`删除中...`,"Archiving...":`归档中...`,"Pinning...":`置顶中...`,"Unpinning...":`取消置顶中...`,"Pin/Unpin":`置顶/取消置顶`,Confirm:`确认`,"Successfully deleted":`成功删除`,"Successfully archived":`成功归档`,"Successfully pinned":`成功置顶`,"Successfully unpinned":`成功取消置顶`,"Successfully copied":`成功复制`,failed:`失败`,Thinos:`条 Thino`,Processed:`已处理`,"Secret Content Masking":`隐秘内容遮罩`,"Enable secret masking":`启用隐秘遮罩`,"Mask memo content matching a regex pattern":`对匹配正则表达式的 Thino 内容进行遮罩`,"Secret content regex":`隐秘内容正则`,"Regex pattern to match content that should be masked":`用于匹配需要遮罩内容的正则表达式`,"Masking style":`遮罩样式`,"Choose between blur effect or block character replacement":`选择模糊效果或方块字符替换`,"Set secret password":`设置密码`,"Set or update the password used to reveal masked content":`设置或更新用于揭示遮罩内容的密码`,"Enter password to reveal":`输入密码以揭示内容`,"Enter password":`输入密码`,"Confirm password":`确认密码`,"Passwords do not match":`两次密码不一致`,"Incorrect password":`密码错误`,"Password set successfully":`密码设置成功`,"Click to reveal secret content":`点击揭示隐秘内容`,"Requires Obsidian API 1.11.4+":`需要 Obsidian API 1.11.4+`,"WeChat Integration":`微信集成`,"Receive WeChat messages and save them as Thino memos. Desktop only. Requires Pro.":`接收微信消息并保存为 Thino。仅限桌面端,需要 Pro。`,"Enable WeChat":`启用微信`,"Enable WeChat message receiver":`启用微信消息接收器`,"Auto start":`自动启动`,"Automatically start WeChat receiver when Obsidian opens":`打开 Obsidian 时自动启动微信接收器`,"Default reply":`默认回复`,"Auto-reply text when a message is saved. Leave empty to disable.":`消息保存后的自动回复文本。留空则不回复。`,"Voice save mode":`语音保存方式`,"How to save voice messages: transcription text, audio file, or both":`语音消息的保存方式:转文字、音频文件、或两者皆有`,"Text + Audio":`文字 + 音频`,"Text only":`仅文字`,"Audio only":`仅音频`,Connection:`连接`,"WeChat is running":`微信运行中`,"WeChat is stopped":`微信已停止`,"Credentials found. Click Start to connect.":`已找到凭据,点击启动以连接。`,"No credentials. Will show QR code on start.":`无凭据,启动时将显示二维码。`,Start:`启动`,Stop:`停止`,"Clear stored credentials and disconnect":`清除已保存的凭据并断开连接`,"Voice Codec":`语音编解码器`,"SILK Decoder":`SILK 解码器`,"Installed. Voice messages will be converted to playable WAV files.":`已安装。语音消息将被转换为可播放的 WAV 文件。`,"Not installed. Download to enable voice message playback in Obsidian.":`未安装。下载后可在 Obsidian 中播放语音消息。`,Remove:`移除`,Download:`下载`,"Downloading...":`下载中...`,"Voice codec removed":`语音编解码器已移除`,"Voice codec downloaded":`语音编解码器已下载`,"Download failed":`下载失败`,Commands:`命令`,"Send messages to the WeChat bot with these command prefixes:":`使用以下命令前缀发送消息给微信机器人:`,or:`或`,"Save to daily note":`保存到日记`,"Save as task":`保存为任务`,"Save as multi-file note":`保存为多文件笔记`,"No prefix":`无前缀`,"Save using default save type":`使用默认方式保存`,"WeChat integration is only available on desktop":`微信集成仅在桌面端可用`,"WeChat is already running":`微信已在运行`,"WeChat connected":`微信已连接`,"WeChat disconnected":`微信已断开`,"WeChat logged out":`微信已退出登录`,"Scanned! Please confirm on your phone.":`已扫描!请在手机上确认。`,"Login successful!":`登录成功!`,"QR code expired. Please restart.":`二维码已过期,请重新启动。`,Saved:`已保存`,"Empty message, not saved":`空消息,未保存`,"Agent Routing":`Agent 路由`,"Route incoming WeChat messages to AI agents (ACP/CLI/HTTP). When enabled, messages with @agent or /agent prefix are forwarded to the specified agent.":`将微信消息路由到 AI 代理(ACP/CLI/HTTP)。启用后,带有 @agent 或 /agent 前缀的消息将转发给指定的代理。`,"Enable Agent Routing":`启用 Agent 路由`,"Forward messages to AI agents instead of saving as memos":`将消息转发给 AI 代理,而非保存为备忘录`,"Default Agent":`默认 Agent`,"Agent used when message has no @agent prefix":`消息无 @agent 前缀时使用的默认代理`,"None (save as memo)":`无(保存为备忘录)`,Agents:`代理列表`,"Configure AI agents":`配置 AI 代理`,"Add Agent":`添加代理`,"Agent name":`代理名称`,Delete:`删除`,Endpoint:`接口地址`,"OpenAI-compatible API endpoint URL":`OpenAI 兼容的 API 接口地址`,"API Key":`API 密钥`,Command:`命令`,"Path to agent binary":`代理程序路径`,Args:`参数`,"Extra command-line arguments (space-separated)":`额外的命令行参数(空格分隔)`,Model:`模型`,"System Prompt":`系统提示词`,"Optional system prompt for the agent":`可选的代理系统提示词`,"Agent Commands":`代理命令`,"Send to specific agent":`发送给指定代理`,"Broadcast to multiple agents":`广播给多个代理`,"no message":`无消息`,"Switch default agent":`切换默认代理`,"Reset agent session":`重置代理会话`,"Show current agent info":`显示当前代理信息`,"Built-in aliases":`内置别名`,"Working Directory":`工作目录`,"Default working directory for all agents. Leave empty to use vault root.":`所有代理的默认工作目录。留空则使用 Vault 根目录。`,"Vault root":`Vault 根目录`,"Permission Mode":`权限模式`,"Approval policy for agent tool calls":`代理工具调用的审批策略`,Default:`默认`,"Accept Edits":`接受编辑`,"Plan Mode":`计划模式`,"Don't Ask":`不询问`,"Bypass Permissions":`跳过权限`,"Override global working directory for this agent":`覆盖此代理的全局工作目录`,"Use global":`使用全局`,Type:`类型`,"Switched to thino mode":`已切换到备忘录模式`,"Reasoning Effort":`推理力度`,"Thinking budget level (codex/ACP agents)":`思考预算等级(codex/ACP 代理)`,None:`无`,Low:`低`,Medium:`中`,High:`高`,"Extra High":`极高`,"Usage: /thino <content>":`用法:/thino <内容>`,"Allow All File Paths":`允许所有文件路径`,"Skip path restriction when sending files. Enable if agents need to send files from any directory.":`跳过文件路径限制。如果代理需要发送任意目录的文件,请启用此选项。`,Date:`日期`,results:`条结果`,"Previous page":`上一页`,"Next page":`下一页`,"No keywords found":`未找到关键词`,"No data to chart":`暂无可用于绘图的数据`,"(empty)":`(空)`}})),pr,mr=o((()=>{pr={welcome:`歡迎使用 Thino`,ribbonIconTitle:`Thino`,to:`至`,months:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],monthsShort:[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`],weekDays:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`],weekDaysShort:[`日`,`一`,`二`,`三`,`四`,`五`,`六`],year:null,month:null,"Basic Options":`基本選項`,"User name":`使用者名稱`,"Set your user name here. 'Memos 😏' By default":`設定您的使用者名稱。預設為 'Thino 😏'`,'You can set target heading like "# Heading" to control data location':`您可以設定目標標題如 "# 標題" 來控制資料位置`,"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.":`如果留空,記錄的 thino 內容將插入日記末尾;如果提供標題,所有記錄的 thino 內容將統一歸類在該標題下。`,"Allows admonitions to be created using ":`允許使用以下方式創建提示 `,"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":`儲存 thino 按鈕標籤`,"The text shown on the save Memo button in the UI. 'NOTEIT' by default.":`UI 中儲存 Thino 按鈕顯示的文字。預設為 'NOTEIT'。`,"Focus on editor when open memos":`開啟 thino 時聚焦編輯器`,"Focus on editor when open memos. Focus by default.":`開啟 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.":`啟用此選項時,Obsidian 開啟時將開啟 Thino。預設為關閉。`,"Hide done tasks in Memo list":`在 Thino 列表中隱藏已完成的任務`,"Hide all done tasks in Memo list. Show done tasks by default.":`在 Thino 列表中隱藏所有已完成的任務。預設顯示已完成的任務。`,"Advanced Options":`進階選項`,"UI language for date":`日期 UI 語言`,"Translates the date UI language. Only 'en' and 'zh' are available.":`翻譯日期 UI 語言。僅支援 'en' 和 'zh'。`,"Default prefix when save thino":`儲存 thino 時的預設前綴`,"Set the default prefix when create memo, 'List' by default.":`創建 thino 時的預設前綴,預設為 'List'。`,"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.":`設定行動裝置上的預設編輯器位置,預設為 'Top'。`,"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:":`如果您喜歡這個外掛,請考慮贊助以支持持續開發:`,"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 中使用。預設為關閉。`,"Ready to convert image into background":`準備將圖片轉換為背景`,List:`列表`,Task:`任務`,Top:`頂部`,Bottom:`底部`,TAG:`標籤`,DAY:`日`,QUERY:`查詢`,EDIT:`編輯`,PIN:`釘選`,UNPIN:`取消釘選`,DELETE:`刪除`,"CONFIRM!":`確認!`,"CREATE FILTER":`創建過濾器`,"Comment it...":`添加評論...`,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:`封存`,"Daily Review":`每日回顧`,"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:`不是`,PATH:`路徑`,METADATA:`元資料`,SELECT:`選擇`,"ADD FILTER TERMS":`添加過濾條件`,FILTER:`過濾`,Filter:`過濾`,TITLE:`標題`,"CREATE QUERY":`創建查詢`,"EDIT QUERY":`編輯查詢`,MATCH:`匹配`,TIMES:`次數`,"Share Memo Image":`分享 Thino 圖片`,"↗Click the button to save":`↗點擊按鈕儲存`,"Image is generating...":`圖片生成中...`,"Image is loading...":`圖片載入中...`,"Loading...":`載入中...`,"😟 Cannot load image, image link maybe broken":`😟 無法載入圖片,圖片連結可能已損壞`,"Daily Memos":`每日 Thino`,"CANCEL EDIT":`取消編輯`,"LINK TO THE":`連結到`,"Mobile Options":`行動裝置選項`,"Experimental Options":`實驗性選項`,"Don't support web image yet, please input image path in vault":`尚不支援網路圖片,請輸入儲存庫中的圖片路徑`,"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} 作為內容。預設為 "{TIME} {CONTENT}"`,"Default Memo Composition":`[已棄用] 預設 Thino 組成`,"Show Tasks Label":`顯示任務標籤`,Gallery:`畫廊`,"Show tasks label near the time text. False by default":`在時間文字旁顯示任務標籤。預設為關閉`,"Please Open Memos First":`請先開啟 Thino`,DATE:`日期`,OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:`OBSIDIAN_NLDATES_PLUGIN_未啟用`,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.":`您需要安裝 Dataview 外掛 0.5.9 或更新版本才能使用此功能。`,"Open Memos Successfully":`成功開啟 Thino`,"Fetch Memos Error":`😭 獲取錯誤`,"Copied to clipboard Successfully":`成功複製到剪貼簿`,"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":`請檢查是否已開啟每日筆記外掛或定期筆記外掛`,"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":`還原成功`,"DELETE SUCCEED":`刪除成功`,"Save Memo button icon":`儲存 Thino 按鈕圖示`,"The icon shown on the save Memo button in the UI.":`UI 中儲存 Thino 按鈕顯示的圖示。`,"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':`您可以為 thino 設定任何 Dataview 查詢來獲取它。這些筆記中的所有 thino 都會顯示在列表中。預設為 "#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":`使用 Thino 管理您筆記中的所有 thino,而不僅僅是每日筆記中的。預設為關閉`,"Always Show Memo Comments":`始終顯示 Thino 評論`,"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.":`您尚未在定期筆記和每日筆記外掛中設定每日筆記的資料夾。`,"Please check your daily note plugin OR periodic notes plugin settings":`請檢查您的每日筆記外掛或定期筆記外掛設定`,"Use which plugin's default configuration":`使用哪個外掛的預設配置`,"Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":`Thino 使用外掛的預設配置從每日筆記中獲取 thino,預設為 'Daily'。`,Daily:`每日`,"Always Show Leaf Sidebar on PC":`在 PC 上始終顯示葉面側邊欄`,"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":`即使葉面寬度小於 875px,也在 PC/平板上顯示左側邊欄。預設為關閉。`,"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":`您尚未在定期筆記和每日筆記外掛中設定每日筆記的格式。`,"fetch more":`獲取更多`,"Search all settings":`搜尋所有設定`,General:`一般`,Theme:`主題`,Share:`分享`,Advanced:`進階`,Interface:`介面`,Thino:`Thino`,"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'`,"Default Editor Mode":`預設編輯器模式`,"Live-Preview Mode OR Source Mode.":`即時預覽模式或原始碼模式。`,"Save type for Thino":`Thino 的儲存類型`,DAILY:`每日`,MULTI:`多個`,CANVAS:`畫布`,ALL:`全部`,FILE:`檔案`,TODO:`待辦`,DONE:`已完成`,JOURNAL:`日誌`,OTHER:`其他`,"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 時,不會移至垃圾桶。預設為關閉。`,"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。`,"Key for showing thino globally":`全域顯示 thino 的快速鍵`,"Set key for showing thino globally. CTRL + SHIFT + E by default.":`設定全域顯示 thino 的快速鍵。預設為 CTRL + SHIFT + E。`,"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 的預設儲存類型。預設為 "DAILY"`,"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":`成功複製應用程式 id`,"Please input token first":`請先輸入令牌`,"Please enable sync first":`請先啟用同步`,"Init Failed":`初始化失敗`,"Verify successfully":`驗證成功`,"Failed to verify":`驗證失敗`,"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.":`讀取當前每日筆記失敗,請檢查是否存在。`,"Failed to save":`儲存失敗`,"Failed to login, please login again":`登入失敗,請重新登入`,"COPY FAILED":`複製失敗`,"COPY SUCCEED":`複製成功`,"Copy selected text":`複製選定文字`,"Copy thino":`複製 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:`字`,word:`字`,"Return To Home Page":`返回首頁`,"No thinos to review!":`沒有要回顧的 thino!`,"Thinos to review":`要回顧的 thino`,"Start Review":`開始回顧`,Hard:`困難`,Good:`良好`,Easy:`簡單`,Again:`再次`,"Clear all review data":`清除所有回顧資料`,"Daily Progress":`每日進度`,"Show stats":`顯示統計`,"Hide stats":`隱藏統計`,Remaining:`剩餘`,"Total Reviews":`總回顧次數`,"Today, you have reviewed all your thinos!":`今天,您已回顧完所有 thino!`,"Daily review limit reached! Come back tomorrow.":`已達到每日回顧限制!明天再來。`,"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":`切換最小化模式`,"Focus on thino editor":`聚焦 thino 編輯器`,"ReSync web thinos to local":`重新同步網路 thino 到本地`,"Sync local thinos to web":`同步本地 thino 到網路`,"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:`來源`,"Global copy":`全域複製`,"Set the folder name":`設定資料夾名稱`,"Set the filename":`設定檔案名稱`,"Set the filename for current location file":`設定目前位置檔案的檔案名稱`,"Switch calendar type":`切換日曆類型`,alphabetical:`按字母順序`,alphabeticalReverse:`按字母倒序`,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":`複製已篩選的 thinos`,"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+點擊顯示當天所有 thinos`,"You can buy a license from":`您可以從以下位置購買授權:`,"No thinos in range":`範圍內沒有 thinos`,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":`臨時篩選`,"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 時自動下載圖片。預設為否。`,"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":`標籤批量編輯`,"Tag Bulk Select":`標籤批量選擇`,"Exist Tags":`現有標籤`,"Selected Tags":`已選標籤`,"Click to remove exist tag":`點擊移除現有標籤`,"Click to remove selected tag":`點擊移除已選標籤`,"Select tags":`選擇標籤`,"Input to select exist tag":`輸入以選擇現有標籤`,Beginning:`開頭`,End:`結尾`,"Set the heading for saving thino":`設定儲存 thino 的標題`,"# Heading":`# 標題`,"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":`將已篩選的 thinos 分享為圖片`,"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":`設定 thino 的使用者引言`,"User icon":`使用者圖示`,"Set user icon for thino. You can input http/https link or file path in vault.":`設定 thino 的使用者圖示。您可以輸入 http/https 連結或儲存庫中的檔案路徑。`,"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":`附加/前置文字時換行`,"Input anything here":`在此輸入任何內容`,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 內容將插入日記末尾;如果提供標題,所有記錄的 thino 內容將統一歸類在該標題下。`,"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":`切換此選項以為不同類型的 thino 設定不同的插入目標,如任務或列表類型的 thino`,"You can set whole diary or only part of it":`您可以設定整個日記或僅部分內容`,"Set process target":`設定處理目標`,Custom:`自訂`,"Whole diary":`整個日記`,"Set thino insert place":`設定 thino 插入位置`,"Set where to insert thino content":`設定插入 thino 內容的位置`,"End of the diary":`日記末尾`,"Custom location":`自訂位置`,"Setting guide":`設定指南`,"Details settings":`詳細設定`,"Start Thino":`開始使用 Thino`,"About Thino Pro":`關於 Thino Pro`,Enabled:`已啟用`,Enable:`啟用`,"Daily notes folder":`每日筆記資料夾`,"Set daily notes folder":`設定每日筆記資料夾`,"Daily note name format":`每日筆記名稱格式`,"Set daily note name format":`設定每日筆記名稱格式`,"Daily note plugin":`每日筆記外掛程式`,"Enable daily note plugin":`啟用每日筆記外掛程式`,Selected:`已選擇`,Select:`選擇`,"A classic theme for Thino with a two-column layout":`具有雙欄佈局的 Thino 經典主題`,Classic:`經典`,"A modern theme for Thino with a three-column layout and some unique features.":`具有三欄佈局和一些獨特功能的 Thino 現代主題。`,Modern:`現代`,Focus:`聚焦`,Immersive:`沉浸`,"Show more":`展開更多`,"Collapse tags":`收起`,"Search inspirations…":`搜尋靈感…`,"Show {count} more…":`展開剩餘 {count} 個…`,thoughts:`想法`,tags:`標籤`,days:`天`,"Immersive mode (F)":`進入沉浸模式(F)`,"Exit immersive mode (Esc)":`退出沉浸模式(Esc)`,"Go and enjoy Thino":`開始使用並享受 Thino`,"Congrats! All settings done":`恭喜!所有設定已完成`,"Adjust settings that influence your user experience with Thino.":`調整影響您使用 Thino 體驗的設定。`,"Set preferences for using Thino":`設定使用 Thino 的偏好`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`如果您使用的是 Thino 基本版,需要啟用每日筆記外掛程式。配置其設定以有效使用。`,"Go with daily note plugin":`使用每日筆記外掛程式`,"Choose a theme for Thino.":`為 Thino 選擇主題。`,"Set theme for Thino":`設定 Thino 主題`,"Set up your user info for Thino.":`設定您的 Thino 使用者資訊。`,"Get started with Thino":`開始使用 Thino`,"Skip and start Thino":`跳過並開始使用 Thino`,"Next step":`下一步`,"Back to previous step":`返回上一步`,"Click to enable =>":`點擊啟用 =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`這是 Thino 的側邊欄。導航到不同路徑或選擇查詢篩選器。`,"Click here and go to settings page.":`點擊此處前往設定頁面。`,"Click here and go to different path.":`點擊此處前往不同路徑。`,"Select or create query filter here.":`在此選擇或建立查詢篩選器。`,"See the status of Thinos here.":`在此查看 Thinos 的狀態。`,"Search your thino quickly here.":`在此快速搜尋您的 thino。`,"Edit or create your thino here.":`在此編輯或建立您的 thino。`,"See your thinos here.":`在此查看您的 thinos。`,"See your time status of thinos here.":`在此查看您的 thinos 時間狀態。`,"See your tags here. Tags will be shown when thino contains tags.":`在此查看您的標籤。當 thino 包含標籤時會顯示標籤。`,Done:`完成`,"Thino is ready to use. ":`Thino 已準備就緒。`,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`您現在可以開始使用 Thino。如果您想了解更多關於 Thino Pro 的資訊,請點擊下方按鈕。`,"Default time prefix":`預設時間前綴`,"Append Text Action":`附加文字動作`,"Prepend Text Action":`前置文字動作`,Preset:`預設`,"Select Tags":`選擇標籤`,"It is not available on small view":`在小視圖中不可用`,"Append text":`附加文字`,"Prepend text":`前置文字`,"Your daily note folder is not set correctly, please check your settings":`您的每日筆記資料夾設定不正確,請檢查您的設定`,"Default sharing style":`預設分享樣式`,"Set the default style for sharing thino, 'Modern' by default.":`設定分享 thino 的預設樣式,預設為「現代」。`,Clean:`簡潔`,Minimal:`極簡`,Gradient:`漸層`,"Thino share":`Thino 分享`,"Copy to clipboard failed":`複製到剪貼簿失敗`,"Copy to clipboard successfully":`成功複製到剪貼簿`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`您的內容已複製到剪貼簿,並插入到編輯器中。請重試`,"Share thino":`分享 thino`,"Set file name after create thino":`建立 thino 後設定檔案名稱`,"You can set file name after create thino. A input box will show when you create thino.":`您可以在建立 thino 後設定檔案名稱。建立 thino 時會顯示輸入框。`,SPLIT:`分割`,"Split by Heading 1":`按一級標題分割`,"Split by Heading 2":`按二級標題分割`,"Split by Heading 3":`按三級標題分割`,"Insert task":`插入任務`,"All settings have been reset to default.":`所有設定已重設為預設值。`,"Reset all Thino settings":`重設所有 Thino 設定`,"Reset settings":`重設設定`,"Reset Thino settings to default settings.":`將 Thino 設定重設為預設設定。`,"Task Management":`任務管理`,"Append completed date when task done in thino":`在 thino 中完成任務時附加完成日期`,"Append completed date when task done in thino. False by default":`在 thino 中完成任務時附加完成日期。預設為否`,"Set tag for single file that Thino indexes":`設定 Thino 索引的單一檔案的標籤`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"當您在此設定標籤時,Thino 將索引包含此標籤的檔案並在列表中顯示。不需要加上 `#`。","Set tag for file type file":`設定檔案類型檔案的標籤`,"Set tag for multi type file":`設定多類型檔案的標籤`,"Please input the tag":`請輸入標籤`,"Merge thinos in to thino share image":`將 thinos 合併到 thino 分享圖片中`,"Custom height for Thino content":`自訂 Thino 內容高度`,"Set custom height for Thino content. Like 200px or 20rem":`設定 Thino 內容的自訂高度。如 200px 或 20rem`,"Input height":`輸入高度`,"Submit issue":`提交問題`,"Current version":`目前版本`,"Bug report":`錯誤回報`,"Click the button to copy debug info and open the issue page":`點擊按鈕複製除錯資訊並開啟問題頁面`,"Copy and go":`複製並前往`,"Debug info copied":`除錯資訊已複製`,"Feature request":`功能請求`,"Submit your feature request to the issue page":`將您的功能請求提交到問題頁面`,Go:`前往`,"Toggle query list visibility":`切換查詢列表可見性`,"Toggle tags visibility":`切換標籤可見性`,"Toggle sidebar visibility":`切換側邊欄可見性`,Collapse:`摺疊`,Expand:`展開`,"Max height for collapse":`摺疊的最大高度`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`thino 摺疊的最大高度,設為 0 時 thino 不會摺疊。預設為 0。(這不是行數,而是以像素為單位的高度。)`,"Render content":`渲染內容`,"Optimize for Callout":`優化 Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`不會自動渲染包含超過 3 個 callouts 的內容。預設為是`,"The value should be greater than":`值應大於`,"Append Text":`附加文字`,"Prepend Text":`前置文字`,"Thino height when collapsed":`Thino 摺疊時的高度`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`thino 摺疊時的高度,設為 0 時 thino 不會摺疊。預設為 100。(這不是行數,而是以像素為單位的高度。)`,"This option will allow you use other views when leaf width is not enough. False by default.":`此選項將允許您在葉寬度不足時使用其他視圖。預設為否。`,"Can select other views when leaf width is not enough":`當葉寬度不足時可以選擇其他視圖`,"TRASH BOX":`垃圾箱`,"Wait templater to finish parse before insert thino":`在插入 thino 前等待模板解析完成`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`此選項將允許您在插入 thino 前等待模板解析完成,這可能導致您需要在插入 thino 時確認兩次。預設為否。`,"Get thino capture extension":`獲取 thino 擷取擴充功能`,"You can capture idea/text from chrome now.":`您現在可以從 Chrome 擷取想法/文字。`,"Open File":`開啟檔案`,"Exported CSV file":`匯出的 CSV 檔案`,"Updated At":`更新時間`,"Export to CSV":`匯出為 CSV`,"Quick add button on mobile navbar":`行動導航欄上的快速新增按鈕`,"Always show status text":`始終顯示狀態文字`,"Support filter by metadata from file":`支援從檔案中的元資料進行篩選`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`啟用此選項後,您可以通過檔案中的元資料進行篩選,如檔案中的標籤。但不支援來自畫布的 thinos。預設為否。`,"Show source near timestamp in thino":`在 thino 中的時間戳記附近顯示來源`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`啟用此選項後,您可以在 thino 中的時間戳記附近看到來源。您可以在元資料中設定標題來覆寫此設定。預設為否。`,"Show Update Message":`顯示更新訊息`,"Show update message when Thino is updated. True by default":`Thino 更新時顯示更新訊息。預設為是`,"Sync manually":`手動同步`,"Show all scrollbars":`顯示所有捲軸`,"TIME RANGE":`時間範圍`,WITHIN:`在`,"7 days":`7 天`,"14 days":`14 天`,"30 days":`30 天`,"3 months":`3 個月`,"6 months":`6 個月`,"1 year":`1 年`,"This week":`本週`,"Last week":`上週`,"This month":`本月`,"Last month":`上月`,"This year":`今年`,"Last year":`去年`,"No history":`無歷史記錄`,"Today Remaining":`今日剩餘`,"Today Total":`今日總計`,"Historical Statistics":`歷史統計`,byTime:`按時間`,byTimeReverse:`按時間倒序`,Stat:`統計`,Statistics:`統計資料`,"Daily Thino Count":`每日 Thino 數量`,Total:`總計`,thinos:`thinos`,"Thino Types":`Thino 類型`,"Distribution of thino types":`Thino 類型分佈`,"Thino Status":`Thino 狀態`,"Distribution of thino status":`Thino 狀態分佈`,"Popular Tags":`熱門標籤`,"Top 10 most used tags":`前 10 個最常用標籤`,"Thino Count":`Thino 數量`,"Hourly distribution":`每小時分佈`,"Current month":`本月`,"Monthly distribution":`每月分佈`,"30 Days":`最近 30 天`,Year:`年`,"Time Distribution":`時間分佈`,"When do you write thinos":`您何時寫 thinos`,"Content Length":`內容長度`,"Distribution of thino lengths":`Thino 長度分佈`,"Daily Thinos":`每日 Thinos`,"Show Time Distribution":`顯示時間分佈`,"Hide date picker":`隱藏日期選擇器`,"Show date picker":`顯示日期選擇器`,"Clear filter":`清除篩選`,"Copy link":`複製連結`,"Copy embed link":`複製嵌入連結`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter 儲存 thino`,"Fixed strings for thinos":`Thinos 的固定字串`,"Use fixed strings for thinos":`使用 thinos 的固定字串`,"Enable to add fixed strings at the beginning or end of thinos.":`啟用在 thinos 的開頭或結尾新增固定字串。`,"Fixed prefix for thinos":`Thinos 的固定前綴`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`在每個 thino 的開頭添加此字串。支援像 {{TIME|YYYYMMDDHHmmss}} 這樣的佔位符。`,"Fixed suffix for thinos":`Thinos 的固定後綴`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`在每個 thino 的結尾添加此字串。支援像 {{TIME|YYYYMMDDHHmmss}} 這樣的佔位符。`,"Word count exceeded":`字數超出限制`,"Word count feature":`字數統計功能`,"Enable real-time word count display in the editor":`在編輯器中啟用即時字數顯示`,"Maximum word count":`最大字數`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`為 thino 設定最大字數。超出時編輯器將顯示警告。設為 0 則無限制。`,"No linked thinos found":`未找到相關連結的 thinos`,"Reference links group":`參考連結群組`,"Enable reference links group in thino.":`在 thino 中啟用參考連結群組。`,"No reference links found":`未找到參考連結`,"Outgoing Links":`外部連結`,"Incoming Links":`內部連結`,"Error fetching reference links":`獲取參考連結時出錯`,"Double click behavior":`雙擊行為`,"Set the behavior when double click on a thino.":`設定在 thino 上雙擊時的行為。`,"Open thino":`開啟 thino`,"Edit thino":`編輯 thino`,"Go to source":`前往來源`,"Do nothing":`不做任何操作`,"Use default header in mobile view":`在行動裝置視圖中使用預設標頭`,"Use default header in mobile view of thino rather than custom header.":`在 thino 的行動裝置視圖中使用預設標頭而非自定義標頭。`,"Ignore folders for multi type":`忽略多文件類型文件夾`,"Set folders to ignore when using multi type. Separate multiple folders with comma (,).":`設置多文件類型時忽略的文件夾。用逗號 (,) 分隔多個文件夾。`,"folder1,folder2/subfolder":`folder1,folder2/subfolder`,"Using block link when dragging a thino":`拖動 thino 以插入連結`,"Using block link when dragging a thino for daily":`拖動 thino 以插入連結到日記`,"Matched via tag in content":`通過內容中的標籤匹配`,"Matched via tag in file":`通過文件中的標籤匹配`,"Focus on editor when open":`打開時聚焦編輯器`,"Focus on editor when open. True by default.":`打開時聚焦編輯器。默認為開啟`,"Show scroll to top button":`顯示滾動到頂部按鈕`,"Show scroll to top button. True by default":`顯示滾動到頂部按鈕。默認為開啟`,"Zoom image by default":`預設縮放圖片`,"Zoom image by default when viewing image.":`查看圖片時預設縮放圖片。`,"View archive in random review":`在隨機回顧中查看歸檔的 Thino`,"View archived thinos in random review. True by default":`在隨機回顧中查看歸檔的 Thino。默認為開啟`,"Linked by":`鏈接自`,Linked:`鏈接`,DUPLICATE:`複製`,"Show scrollbars in all thino views.":`在所有 Thino 視圖中顯示滾動條。`,"Drag to paste content":`拖動粘貼內容`,"You will be able to paste content from other apps to thino by dragging rather than pasting the block link.":`您將能夠通過拖動而不是粘貼塊鏈接來將內容從其他應用程序粘貼到 Thino 中。`,"Dragging behavior":`拖動行為`,"Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.":`控制拖動 Thino 的行為。默認粘貼塊鏈接。塊鏈接選項僅在源類型為日記時有效。`,"Block link":`塊鏈接`,"Quick capture tool that allows you to create and manage your ideas, tasks, and more.":`快速捕獲工具,允許你創建和管理你的想法、任務等。`,About:`關於`,Text:`文本`,"Open Documentation":`開啟文件`,Documentation:`文件`,Version:`版本`,"View the documentation for this plugin":`查看此插件的文件`,"Activate Pro":`激活專業版`,"Activated Pro":`已激活專業版`,Tasks:`任務`,"Show release notes":`顯示發布說明`,"Show release notes when Thino is updated. True by default":`顯示發布說明當 Thino 更新時。默認為開啟`,"Open change log":`開啟更新日志`,"Change log":`更新日志`,"View the change log for this plugin":`查看此插件的更新日志`}}));function j(e){let t=hr&&hr[e]||jn[e];return t===null?t:t||e}var hr,M=o((()=>{wn(),En(),On(),An(),Mn(),Pn(),In(),Rn(),Bn(),Hn(),Wn(),Kn(),Jn(),Xn(),Qn(),er(),nr(),ir(),or(),cr(),ur(),fr(),mr(),hr={ar:Cn,cs:Tn,da:Dn,de:kn,en:jn,"en-gb":Nn,es:Fn,fr:Ln,hi:zn,id:Vn,it:Un,ja:Gn,ko:qn,nl:Yn,nn:Zn,pl:$n,pt:tr,"pt-br":rr,ro:ar,ru:sr,tr:lr,"zh-cn":dr,"zh-tw":pr}[f.moment.locale()]}));function gr(){return{userState:xn.getState(),queryState:{queries:ui.getState().queries},memoState:{memos:P.getState().memos,commentMemos:P.getState().commentMemos,tags:P.getState().tags,tagsNum:P.getState().tagsNum,preparingUpdateMemo:P.getState().preparingUpdateMemo},globalState:vi.getState(),locationState:Si.getState(),dailyNotesState:F.getState()}}var _r=o((()=>{I()})),vr,yr=o((()=>{_r(),I(),vr={getState:gr}})),br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr=o((()=>{yr(),br=/```([\s\S]*?)```/g,xr=/\*\*(.+?)\*\*/g,Sr=/\*(.+?)\*/g,Cr=/\[ \] /g,wr=/\[.{1}\] /g,Tr=/^[*-]/g,Er=/(\d+)\. /g,Dr=/\[\[([^\]]+)\]\]/g,Or=/\[([^\]]+)\]\((([^\]]+).md)\)/g,kr=(e,t)=>{let n=e.replace(br,`<pre lang=''>$1</pre>`).replace(Tr,`<span class='counter-block'>•</span>`).replace(Er,`<span class='counter-block'>$1.</span>`).replace(Cr,`<span class='todo-block' data-type='todo'>⬜</span>`).replace(wr,`<span class='todo-block' data-type='done'>✅</span>`).replace(xr,`<strong>$1</strong>`).replace(Sr,`<em>$1</em>`).replace(/<br>/g,`</p><p>`).replace(/&/g,`&`),r=n;if(t){if(Dr.test(n)){let e=n.match(Dr);for(let t=0;t<e.length;t++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(e[t])){let i=jr(e[t]);if(/\|/g.test(i)){let[a,o]=i.split(`|`),s=Ar(a,o);r=n.replace(e[t],s)}else{let n=Ar(i,``);r=r.replace(e[t],n)}}}if(Or.test(n)){let e=n.match(Or);for(let t=0;t<e.length;t++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(e[t])){let i=Ar(Nr(e[t]),Mr(e[t]));r=n.replace(e[t],i)}}}return r},Ar=(e,t)=>{let{metadataCache:n}=vr.getState().dailyNotesState.app;return n.getFirstLinkpathDest(decodeURIComponent(e),``)instanceof f.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>`},jr=e=>/\[\[([^\]]+)\]\]/g.exec(e)?.[1],Mr=e=>Or.exec(e)?.[1],Nr=e=>/\[([^\]]+)\]\((([^\]]+).md)\)/g.exec(e)?.[3],Pr=e=>{let t=document.createElement(`div`);return t.className=`memo-content-text`,t.innerHTML=e,t.innerText},Fr=e=>e.replace(/\n/g,`<br>`),Ir=e=>{let t=document.createElement(`div`);return t.textContent=e,t.innerHTML}})),Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r=o((()=>{Rr=`mobile-show-sidebar`,zr=3600*24*1e3,Br=/\s#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,Vr=/(<p>|<br>)#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,Hr=/^#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/gu,Ur=/(\s|:|\(|>|^)((http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))/g,Wr=/\[([\s\S]*?)\]\(([\s\S]*?)\)/gu,Gr=/([^\s<\\*>'(]+\.(jpeg|jpg|gif|png|svg))(\]\])?(\))?/g,Kr=/(\s|:|^)(http[s]?:\/\/)([^\/\s]+\/)(\S*?)(jpeg|jpg|gif|png|svg|bmp|webp)(?!\))/g,qr=/!\[\[(([^|\]]+?)\.(jpeg|jpg|gif|png|svg|bmp|webp))?(\|)?([^\]]*)?\]\]/gi,Jr=/(!\[([^\]]*)\]\(([^)"\s]*\.(jpg|jpeg|png|gif|svg|bmp|webp))(?:\s*"[^"]*")?\s*\))/gi,Yr=/\[@(.+?)\]\((.+?)\)/g,Xr=/[#*"\/\\<>:|\[\]\?]/gim,Zr=/^(-|\*|\d\.)\s(\[.\]\s)?(\d{1,2}:\d{2}(:\d{2})?)(-\d{1,2}:\d{2}(:\d{2})?)?\s(.*)/g,Qr=[{title:`DAILY`,icon:`list`},{title:`CANVAS`,icon:`layout-dashboard`},{title:`MULTI`,icon:`file-text`},{title:`FILE`,icon:`edit`},{title:`JOURNAL`,icon:`book-open`}]}));function ei(e){let t=document,n=t.createElement(`textarea`);n.value=e,n.contentEditable=`true`,n.readOnly=!1,n.style.position=`fixed`,n.style.top=`0`,n.style.left=`0`,n.style.width=`1px`,n.style.height=`1px`,n.style.opacity=`0`,n.style.pointerEvents=`none`,n.style.webkitUserSelect=`text`,n.style.userSelect=`text`,t.body.appendChild(n);let r=t.getSelection(),i=[];if(r)for(let e=0;e<r.rangeCount;e++)i.push(r.getRangeAt(e));try{if(n.focus(),n.select(),n.setSelectionRange(0,e.length),f.Platform.isIosApp||f.Platform.isSafari){let r=t.createRange();r.selectNodeContents(n);let i=t.getSelection();i&&(i.removeAllRanges(),i.addRange(r)),n.setSelectionRange(0,e.length)}let a=t.execCommand(`copy`);if(r){r.removeAllRanges();for(let e of i)r.addRange(e)}return a}catch(e){return console.warn(`Legacy copy to clipboard failed.`,e),!1}finally{n.remove()}}async function ti(e){let t=window.Capacitor?.Plugins?.Clipboard;if(!t?.write)return!1;try{return await t.write({string:e}),!0}catch(e){return console.warn(`Capacitor copy to clipboard failed.`,e),!1}}function ni(){let e=``,t=app.plugins.getPlugin(`obsidian-memos`).settings,n=``,r=window.app.plugins.getPlugin(`periodic-notes`)?.calendarSetManager?.getActiveConfig(`day`)?.folder,i=window.app.plugins.getPlugin(`periodic-notes`)?.settings?.daily?.format;switch(n=r===void 0?i:r,t?.UseDailyOrPeriodic||`Daily`){case`Daily`:e=O().format||`YYYY-MM-DD`;break;case`Periodic`:e=n||`YYYY-MM-DD`;break;default:e=O().format||`YYYY-MM-DD`;break}return e===void 0&&new f.Notice(j(`You didn't set format for daily notes in both periodic-notes and daily-notes plugins.`)),e}function ri(){let e=``,t=app.plugins.getPlugin(`obsidian-memos`).settings,n=``,r=window.app.plugins.getPlugin(`periodic-notes`)?.calendarSetManager?.getActiveConfig(`day`)?.folder,i=window.app.plugins.getPlugin(`periodic-notes`)?.settings?.daily?.folder;switch(n=r===void 0?i:r,t?.UseDailyOrPeriodic||`Daily`){case`Daily`:e=O().folder||``;break;case`Periodic`:e=n||``;break;default:e=O().folder||``;break}return e===void 0&&new f.Notice(j(`You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.`)),e}function ii(){let e=ri();return!(e!==void 0&&!app.vault.getFolderByPath(e))}function ai(e,t){e=Ir(e),e=Fr(e).split(`<br>`).map(e=>`<p>${e===``?`<br>`:e}</p>`).join(``),e=kr(e,t),e=e.replace(Br,`<span class='tag-span'>#$1</span>`).replace(Vr,`<p><span class='tag-span'>#$2</span>`).replace(Ur,`$1<a class='link' target='_blank' rel='noreferrer' href='$2'>$2</a>`).replace(Wr,`<a class='link' target='_blank' rel='noreferrer' href='$2'>$1</a>`).replace(Yr,`<span class='memo-link-text' data-value='$2'>$1</span>`).replace(/\^\S{6}/g,``);let n=document.createElement(`div`);n.innerHTML=e;for(let e=0;e<n.children.length;e++){let t=n.children[e];if(t.tagName===`P`&&t.textContent===``&&t.firstElementChild?.tagName!==`BR`){t.remove(),e--;continue}}return n.innerHTML}function oi(e,t){return Object.keys(t).every(n=>typeof t[n]==`object`&&t[n]!==null&&typeof e[n]==`object`&&e[n]!==null?oi(e[n],t[n]):Object.prototype.hasOwnProperty.call(e,n)&&e[n]===t[n])}var si,N,ci,li=o((()=>{je(),M(),Lr(),$r(),(function(e){function t(){return parseInt((0,f.moment)().format(`x`))}e.getNowTimeStamp=t;function n(e){let t=new RegExp([`(?:[0-9]+(?:(?:,|\\.)[0-9]+)*|[\\-'’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])+`,`\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u4E00-\\u9FD5`,`[\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u4E00-\\u9FD5]{1}`].join(`|`),`g`);return(e.match(t)||[]).length}e.getWordCount=n;function r(e){re()&&e?.EnabledLocationList.some(e=>e.value===`DAILY`)&&e?.EnabledLocationList.some(e=>e.value===`MULTI`)&&ri().contains(e?.MemoOtherSaveLocation.MemoDefaultMultiFilePath)&&new f.Notice(j(`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 i(){let e=navigator.userAgent,t=`Unknown`;return e.indexOf(`Win`)==-1?e.indexOf(`Mac`)==-1?e.indexOf(`Linux`)!=-1&&(t=`Linux`):t=`MacOS`:t=`Windows`,t}e.getOSVersion=i;function a(e){return typeof e==`string`&&(e=e.replaceAll(`-`,`/`)),new Date(e).getTime()}e.getTimeStampByDate=a;function o(e,t=`createdAt`){return t===`createdAt`&&e.createdAtTs!=null?e.createdAtTs:t===`updatedAt`&&e.updatedAtTs!=null?e.updatedAtTs:a(e[t])}e.getMemoTimestamp=o;function s(e){return e.createdAtTs==null&&e.createdAt&&(e.createdAtTs=a(e.createdAt)),e.updatedAtTs==null&&e.updatedAt&&(e.updatedAtTs=a(e.updatedAt)),e}e.stampMemoTimestamps=s;function c(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=`${r.id}|${r.updatedAt||r.createdAt}|${r.deletedAt||``}|${r.rowStatus||``}|${r.pinned?1:0}|${r.content||``}`;for(let e=0;e<i.length;e++)t=t*31+i.charCodeAt(e)|0}return String(t)}e.computeMemosHash=c;function l(e){let t=new Date(a(e));return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}e.getDateStampByDate=l;function u(e){let t=new Date(a(e));return`${t.getFullYear()}/${t.getMonth()+1}/${t.getDate()}`}e.getDateString=u;function d(e){let t=new Date(a(e)),n=t.getHours(),r=t.getMinutes();return`${n<10?`0`+n:n}:${r<10?`0`+r:r}`}e.getTimeString=d;function p(e){let t=new Date(a(e)),n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),o=t.getHours(),s=t.getMinutes(),c=t.getSeconds();return`${n}/${r<10?`0`+r:r}/${i<10?`0`+i:i} ${o<10?`0`+o:o}:${s<10?`0`+s:s}:${c<10?`0`+c:c}`}e.getDateTimeString=p;function m(e){return Array.from(new Set(e))}e.dedupe=m;function h(e){let t=new Set,n=[];for(let r of e)t.has(r.id)||(t.add(r.id),n.push(r));return n}e.dedupeObjectWithId=h;function g(e,t){let n=null;return()=>{n&&clearTimeout(n),n=setTimeout(e,t)}}e.debounce=g;function _(e,t,n=!1,r){let i=null,a=!1;function o(...o){if(i&&clearTimeout(i),n&&!a){let t=e.apply(this,o);r&&typeof r==`function`&&r(t),a=!0}else i=setTimeout(()=>{let t=e.apply(this,o);r&&typeof r==`function`&&r(t),a=!1,i=null},t)}return o.cancel=function(){i&&clearTimeout(i),i=null,a=!1},o}e.debouncePlus=_;function v(e,t){let n=!0;return()=>{if(!n)return!1;n=!1,setTimeout(()=>{e(),n=!0},t)}}e.throttle=v;function y(e){let t=[],n=Object.keys(e).sort();for(let r of n){let n=e[r];n&&(typeof n==`object`?t.push(...y(n).split(`&`)):t.push(`${r}=${n}`))}return t.join(`&`)}e.transformObjectToParamsString=y;function b(e){let t={},n=e.split(`&`);for(let e of n){let[n,r]=e.split(`=`);n&&r&&(t[n]=r)}return t}e.transformParamsStringToObject=b;function x(e){if(!e)return{};let t={},n=Object.keys(e).sort();for(let r of n){let n=e[r];if(typeof n==`object`){let e=x(JSON.parse(JSON.stringify(n)));e&&Object.keys(e).length>0&&(t[r]=e)}else n&&(t[r]=n)}return t}e.filterObjectNullKeys=x;async function S(e){if(f.Platform.isMobile&&await ti(e)||(f.Platform.isIosApp||f.Platform.isSafari)&&ei(e))return!0;if(navigator.clipboard&&navigator.clipboard.writeText)try{return await navigator.clipboard.writeText(e),!0}catch(e){console.warn(`Copy to clipboard failed, falling back.`,e)}return ei(e)}e.copyTextToClipboard=S;function C(e){return new Promise(t=>{let n=new Image;n.onload=()=>{let{width:e,height:r}=n;t(e>0&&r>0?{width:e,height:r}:{width:0,height:0})},n.onerror=()=>{t({width:0,height:0})},n.className=`thino-hidden`,n.src=e,document.body.appendChild(n),n.remove()})}e.getImageSize=C;async function w(e){let t,n=app.plugins.getPlugin(`obsidian-memos`).settings.UseDailyOrPeriodic===`Daily`;try{return!n&&window.app.plugins?.getPlugin(`periodic-notes`)?.calendarSetManager?.getActiveConfig(`day`)?.enabled?(t=await window.app.plugins.getPlugin(`periodic-notes`).createPeriodicNote(`day`,e),t):(t=await app.internalPlugins.getPluginById(`daily-notes`).instance.getDailyNote(e)||await be(e),t)}catch(e){return console.error(e),new f.Notice(j(`Failed to create daily note. Please check if you created a folder for daily notes.`)),null}}e.createDailyNoteCheck=w;function T(e){let t=[],n=0;for(;n<e;n++)t.push((16*Math.random()|0).toString(16));return t.join(``)}e.randomId=T;function E(e){return e.replace(/[\p{P}\p{Z}\p{S}]/gu,``).length}e.countWords=E;async function D(e){try{let t=await(0,f.requestUrl)(e),n=new Uint8Array(t.arrayBuffer);return new Blob([n],{type:`image/png`})}catch(t){return console.error(`error in grabImageFromUrl`,e,t),new Blob}}e.grabImageFromUrl=D})(si||={}),N=si,ci=(e,t)=>{let n=window.atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return new Blob([r],{type:t})}})),ui,di=o((()=>{Ve(),nt(),tn(),bn(),li(),ui=ze()(Ye(tt(en(e=>({queries:[],setQueries:t=>e(e=>{e.queries=N.dedupeObjectWithId(t.sort((e,t)=>N.getTimeStampByDate(t.createdAt)-N.getTimeStampByDate(e.createdAt)).sort((e,t)=>N.getTimeStampByDate(t.pinnedAt??0)-N.getTimeStampByDate(e.pinnedAt??0)))}),insertQuery:t=>e(e=>{let n=[t,...e.queries].sort((e,t)=>N.getTimeStampByDate(t.createdAt)-N.getTimeStampByDate(e.createdAt));e.queries=N.dedupeObjectWithId(n)}),deleteQueryById:t=>e(e=>{e.queries=e.queries.filter(e=>e.id!==t)}),updateQuery:t=>e(e=>{let n=e.queries.findIndex(e=>e.id===t.id);n!==-1&&(e.queries[n]={...e.queries[n],...t})}),toggleQueryPin:t=>e(e=>{let n=e.queries.find(e=>e.id===t);n&&(n.pinnedAt=n.pinnedAt?void 0:new Date().toISOString(),e.queries.sort((e,t)=>{let n=N.getTimeStampByDate(t.pinnedAt??0)-N.getTimeStampByDate(e.pinnedAt??0);return n===0?N.getTimeStampByDate(t.createdAt)-N.getTimeStampByDate(e.createdAt):n}))}),clearQueries:()=>e(e=>{e.queries=[]})})),{name:`query-store-cache`,storage:yn.queries,partialize:e=>({queries:e.queries.slice(0,50)}),version:1}),{name:`query-store`}))}));function fi(e,t){let n=N.getMemoTimestamp(e),r=N.getMemoTimestamp(t);return n===r?t.id.localeCompare(e.id):r-n}function pi(){try{let e=localStorage.getItem(`memo-store-cache`);if(e){let t=JSON.parse(e)?.state?.memos||[];if(Array.isArray(t)&&t.length>0)return t.forEach(N.stampMemoTimestamps),console.log(`[MemoStore] Quick-loaded ${t.length} memos from cache`),t}}catch(e){console.debug(`[MemoStore] Failed to quick-load from cache:`,e)}return[]}var mi,P,hi=o((()=>{Ve(),nt(),tn(),bn(),li(),mi=pi(),P=ze()(Qe(Ye(tt(en(e=>({memos:mi,commentMemos:[],tags:[],tagsNum:{},memosHash:mi.length>0?N.computeMemosHash(mi):``,preparingUpdateMemo:[],setMemos:t=>e(()=>{let e=[...t].sort(fi),n=N.dedupeObjectWithId(e);return{memos:n,memosHash:N.computeMemosHash(n)}}),insertMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e.memos];return r[n]=t,{memos:r,memosHash:N.computeMemosHash(r)}}let r=N.getMemoTimestamp(t),i=e.memos.findIndex(e=>N.getMemoTimestamp(e)<r),a;return a=i===-1?[...e.memos,t]:i===0&&e.memos.length>0&&N.getMemoTimestamp(e.memos[0])<r?[t,...e.memos]:[...e.memos.slice(0,i),t,...e.memos.slice(i)],{memos:a,memosHash:N.computeMemosHash(a)}}),deleteMemoById:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t);if(n===-1)return e;let r=[...e.memos];return r.splice(n,1),{memos:r,memosHash:N.computeMemosHash(r)}}),deleteMemoBatch:t=>e(e=>{let n=new Set(t),r=e.memos.filter(e=>!n.has(e.id));return{memos:r,memosHash:N.computeMemosHash(r)}}),updateMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.memos];return r[n]=t,r.sort(fi),{memos:r,memosHash:N.computeMemosHash(r)}}return e}),updateMemoBatch:(t,n)=>e(e=>{let r=new Map(t.map(e=>[e.id,e])),i=new Set(e.memos.map(e=>e.id)),a=e.memos.map(e=>e.path===n&&r.has(e.id)?r.get(e.id):e),o=t.filter(e=>!i.has(e.id)),s=[...a,...o].sort(fi);return{memos:s,memosHash:N.computeMemosHash(s)}}),archiveMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.memos];return r[n]=t,{memos:r,memosHash:N.computeMemosHash(r)}}return e}),unarchiveMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.memos];return r[n]=t,{memos:r,memosHash:N.computeMemosHash(r)}}return e}),archiveMemoBulk:t=>e(e=>{let n=new Map(t.map(e=>[e.id,e])),r=e.memos.map(e=>n.has(e.id)?n.get(e.id):e);return{memos:r,memosHash:N.computeMemosHash(r)}}),pinMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.memos];return r[n]=t,{memos:r,memosHash:N.computeMemosHash(r)}}return e}),replaceMemoById:(t,n)=>e(e=>{let r=e.memos.findIndex(e=>e.id===t);if(r!==-1){let t=[...e.memos];return t[r]=n,{memos:t,memosHash:N.computeMemosHash(t)}}return e}),clearMemos:()=>e(()=>({memos:[],commentMemos:[],memosHash:``})),setMemosAndComments:(t,n)=>e(()=>{let e=[...t].sort(fi),r=[...n].sort((e,t)=>N.getMemoTimestamp(t)-N.getMemoTimestamp(e)),i=N.dedupeObjectWithId(e);return{memos:i,commentMemos:N.dedupeObjectWithId(r),memosHash:N.computeMemosHash(i)}}),setCommentMemos:t=>e(()=>{let e=[...t].sort((e,t)=>N.getMemoTimestamp(t)-N.getMemoTimestamp(e));return{commentMemos:N.dedupeObjectWithId(e)}}),insertCommentMemo:t=>e(e=>{let n=[t,...e.commentMemos].sort((e,t)=>N.getMemoTimestamp(t)-N.getMemoTimestamp(e));return{commentMemos:N.dedupeObjectWithId(n)}}),updateCommentMemo:t=>e(e=>{let n=e.commentMemos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.commentMemos];return r[n]=t,{commentMemos:r}}return e}),setTags:(t,n)=>e(e=>{e.tags=t,e.tagsNum=n}),setWaitingForTemplater:t=>e(e=>{e.preparingUpdateMemo.push(t)}),prepareUpdateThino:(t,n)=>e(e=>{e.preparingUpdateMemo=e.preparingUpdateMemo.filter(e=>e.id!==n);let r=e.memos.findIndex(e=>e.id===n);r!==-1&&(e.memos[r]=t)}),removePrepareUpdateThino:()=>e(e=>{e.preparingUpdateMemo=[]}),removeParticularPrepareUpdateThino:t=>e(e=>{e.preparingUpdateMemo=e.preparingUpdateMemo.filter(e=>e.id!==t)})})),{name:`memo-store-cache`,storage:yn.memos,partialize:e=>{let t=e.memos.slice(0,200);try{let e={state:{memos:t.slice(0,100)},version:1,updatedAt:Date.now()};localStorage.setItem(`memo-store-cache`,JSON.stringify(e))}catch(e){console.debug(`[MemoStore] Failed to update quick cache:`,e)}return{memos:t,tags:e.tags,tagsNum:e.tagsNum}},version:1,migrate:(e,t)=>{if(t<1&&e.memos){let t=Array.isArray(e.memos)?e.memos:[];return{...e,memos:N.dedupeObjectWithId(t.filter(e=>e&&e.id))}}return e},merge:(e,t)=>{let n={...t,...e};return t.memos.length===0&&e?.memos?.length>0&&(n.memos=N.dedupeObjectWithId(e.memos)),t.tags.length>0&&(n.tags=t.tags,n.tagsNum=t.tagsNum),n}}),{name:`memo-store`})))}));function gi(){try{let e=localStorage.getItem(`memo-store-cache`);if(e){let t=JSON.parse(e)?.state?.memos||[];if(Array.isArray(t)&&t.length>0)return console.log(`[GlobalState] Found cached memos, setting loaded=true`),!0}}catch(e){console.debug(`[GlobalState] Failed to check cache for loaded state:`,e)}return!1}var _i,vi,yi=o((()=>{Ve(),nt(),tn(),bn(),_i={markMemoId:``,editMemoId:``,commentMemoId:``,isMobileView:!1,isPhoneView:!1,showSiderbarInMobileView:!1,changedByMemos:!1,memoListView:`list`,globalEditorShown:!1,immersiveMode:!1,shouldSplitMemoWord:!0,shouldHideImageUrl:!0,shouldUseMarkdownParser:!0,useTinyUndoHistoryCache:!1,useVirtualScrolling:!0,manifest:null,refresh:!1,loaded:gi(),locked:!1,exited:!1,collapsedGroups:[],instances:{}},vi=ze()(Qe(Ye(tt(en((e,t)=>({..._i,setMarkMemoId:t=>e(e=>{e.markMemoId=t}),setEditMemoId:t=>e(e=>{e.editMemoId=t}),setCommentMemoId:t=>e(e=>{e.commentMemoId=t}),setGlobalEditorShown:t=>e(e=>{e.globalEditorShown=t}),setImmersiveMode:t=>e(e=>{e.immersiveMode=t}),toggleImmersiveMode:()=>e(e=>{e.immersiveMode=!e.immersiveMode}),clearEditorStates:()=>e(e=>{e.markMemoId=``,e.editMemoId=``,e.commentMemoId=``,e.globalEditorShown=!1}),setMobileView:t=>e(e=>{e.isMobileView=t}),setPhoneView:t=>e(e=>{e.isPhoneView!==t&&(e.isPhoneView=t)}),setShowSidebarInMobileView:t=>e(e=>{e.showSiderbarInMobileView===t&&typeof t==`boolean`||(e.showSiderbarInMobileView=t)}),setMemoListView:t=>e(e=>{e.memoListView=t}),toggleSidebarInMobileView:()=>e(e=>{e.showSiderbarInMobileView=!e.showSiderbarInMobileView}),setAppSetting:t=>e(e=>{Object.assign(e,t)}),updateSetting:(t,n)=>e(e=>{e[t]=n}),setLoaded:t=>e(e=>{e.loaded=t}),setRefresh:t=>e(e=>{e.refresh=t}),setLocked:t=>e(e=>{e.locked=t}),setExited:t=>e(e=>{e.exited=t}),setChangedByMemos:t=>e(e=>{e.changedByMemos=t}),setManifest:t=>e(e=>{e.manifest=t}),toggleCollapsedGroup:t=>e(e=>{let n=e.collapsedGroups.indexOf(t);n>=0?e.collapsedGroups.splice(n,1):e.collapsedGroups.push(t)}),setCollapsedGroup:(t,n)=>e(e=>{let r=e.collapsedGroups.indexOf(t);n&&r<0?e.collapsedGroups.push(t):!n&&r>=0&&e.collapsedGroups.splice(r,1)}),setInstance:(t,n)=>e(e=>{e.instances[t]=n}),getInstance:e=>t().instances[e],removeInstance:t=>e(e=>{delete e.instances[t]}),clearInstances:()=>e(e=>{e.instances={}}),reset:()=>e(()=>({..._i,instances:{}}))})),{name:`global-state-store-cache`,storage:yn.ui,partialize:e=>({shouldSplitMemoWord:e.shouldSplitMemoWord,shouldHideImageUrl:e.shouldHideImageUrl,shouldUseMarkdownParser:e.shouldUseMarkdownParser,useTinyUndoHistoryCache:e.useTinyUndoHistoryCache,useVirtualScrolling:e.useVirtualScrolling,memoListView:e.memoListView,isMobileView:e.isMobileView,showSiderbarInMobileView:e.showSiderbarInMobileView,collapsedGroups:e.collapsedGroups}),version:1}),{name:`global-state-store`})))})),bi,xi,Si,Ci=o((()=>{Ve(),nt(),tn(),bn(),bi={tag:``,duration:null,type:``,path:``,metadata:{},text:``,filter:``},xi={pathname:`/`,hash:``,query:bi},Si=ze()(Qe(Ye(tt(en((e,t)=>({...xi,setLocation:t=>e(()=>t),setPathname:t=>e(e=>{e.pathname!==t&&(e.pathname=t)}),setHash:t=>e(e=>{e.hash!==t&&(e.hash=t)}),navigate:(t,n)=>e(e=>{e.pathname=t,n&&(e.query={...bi,...n})}),reload:()=>e(()=>xi),setQuery:t=>e(e=>{e.query={...t}}),updateQuery:t=>e(e=>{e.query={...e.query,...t}}),setTagQuery:t=>e(e=>{e.query.tag!==t&&(e.query={...e.query,tag:t})}),setDurationQuery:t=>e(e=>{e.query={...e.query,duration:t}}),setPathQuery:t=>e(e=>{e.query.path!==t&&(e.query={...e.query,path:t})}),setTypeQuery:t=>e(e=>{e.query.type!==t&&(e.query={...e.query,type:t})}),setTextQuery:t=>e(e=>{e.query.text!==t&&(e.query={...e.query,text:t})}),setFilterQuery:t=>e(e=>{e.query.filter!==t&&(e.query={...e.query,filter:t})}),setMetadataQuery:(t,n)=>e(e=>{let r={...e.query.metadata||{}};r[t]=n,e.query={...e.query,metadata:r}}),clearQuery:()=>e(e=>{e.query={...bi}}),buildUrl:()=>{let e=t(),n=new URLSearchParams;e.query.tag&&n.set(`tag`,e.query.tag),e.query.type&&n.set(`type`,e.query.type),e.query.text&&n.set(`text`,e.query.text),e.query.path&&n.set(`path`,e.query.path),e.query.filter&&n.set(`filter`,e.query.filter),e.query.duration&&(n.set(`from`,e.query.duration.from.toString()),n.set(`to`,e.query.duration.to.toString()));let r=n.toString();return`${e.pathname}${r?`?`+r:``}${e.hash?`#`+e.hash:``}`},parseUrl:t=>e(e=>{try{let n=new URL(t,`http://localhost`);e.pathname=n.pathname,e.hash=n.hash.slice(1);let r=n.searchParams;e.query={tag:r.get(`tag`)||``,type:r.get(`type`)||``,text:r.get(`text`)||``,path:r.get(`path`)||``,filter:r.get(`filter`)||``,duration:r.has(`from`)&&r.has(`to`)?{from:parseInt(r.get(`from`)),to:parseInt(r.get(`to`))}:null,metadata:{}}}catch(e){console.error(`Failed to parse URL:`,e)}})})),{name:`location-store-cache`,storage:yn.ui,partialize:e=>({query:{tag:e.query.tag,type:e.query.type,text:e.query.text,path:e.query.path,filter:e.query.filter,duration:e.query.duration,metadata:{}}}),version:1}),{name:`location-store`})))})),wi,F,Ti=o((()=>{Ve(),nt(),tn(),bn(),wi={dailyNotes:{},app:null,view:null,settings:null,editor:null,plugin:null,verifyState:{appId:``}},F=ze()(Qe(Ye(tt(en((e,t)=>({...wi,setDailyNotes:t=>e(e=>{e.dailyNotes=t}),setApp:t=>e(e=>{e.app||=t}),setView:t=>e(e=>{(!t||!e.view||e.view?.leaf?.id!==t?.leaf?.id)&&(e.view=t)}),setSettings:t=>e(e=>{e.settings={...t}}),setEditor:t=>e(e=>{(!e.editor||e.editor!==t)&&(e.editor=t)}),setPlugin:t=>e(e=>{e.plugin||=t}),setVerifyState:t=>e(e=>{e.verifyState=t}),updateVerifyState:t=>e(e=>{Object.assign(e.verifyState,t)}),addDailyNote:(t,n)=>e(e=>{e.dailyNotes[t]=n}),removeDailyNote:t=>e(e=>{delete e.dailyNotes[t]}),getDailyNote:e=>t().dailyNotes[e],hasDailyNote:e=>e in t().dailyNotes,clearFiles:()=>e(e=>{e.dailyNotes={}}),clearView:()=>e(e=>{if(e.view){try{e.view.unload?.()}catch(e){console.error(`Error unloading view:`,e)}e.view=null}}),clearEditor:()=>e(e=>{e.editor=null}),reset:()=>e(()=>({...wi})),isInitialized:()=>{let e=t();return!!(e.app&&e.plugin&&e.settings)},getActiveFile:()=>{let e=t();return e.app?.workspace?e.app.workspace.getActiveFile():null}})),{name:`daily-notes-store-cache`,storage:yn.ui,partialize:e=>({verifyState:e.verifyState}),version:1}),{name:`daily-notes-store`})))})),Ei,Di,Oi=o((()=>{Ve(),nt(),Ei={selectedIds:[]},Di=ze()(Ye(Qe((e,t)=>({...Ei,toggleSelection:t=>{e(e=>{let n=e.selectedIds;return n.indexOf(t)>-1?{selectedIds:n.filter(e=>e!==t)}:{selectedIds:[...n,t]}})},selectMultiple:t=>{e(e=>{let n=new Set(e.selectedIds);return t.forEach(e=>n.add(e)),{selectedIds:Array.from(n)}})},addSelection:t=>{e(e=>e.selectedIds.includes(t)?e:{selectedIds:[...e.selectedIds,t]})},removeSelection:t=>{e(e=>({selectedIds:e.selectedIds.filter(e=>e!==t)}))},clearSelection:()=>{e({selectedIds:[]})},isSelected:e=>t().selectedIds.includes(e),getSelectedCount:()=>t().selectedIds.length,getSelectedIds:()=>t().selectedIds,setSelection:t=>{e({selectedIds:[...t]})}})),{name:`SelectionStore`}))})),I=o((()=>{Sn(),di(),hi(),yi(),Ci(),Ti(),Oi(),Sn(),di(),hi(),yi(),Ci(),Ti(),Oi()})),ki,L,Ai=o((()=>{I(),je(),ki=class{initialized=!1;getState(){return F.getState()}setApp(e){return F.getState().setApp(e),e}setPlugin(e){return F.getState().setPlugin(e),e}setSettings(e){return F.getState().setSettings(e),this.initialized||=!0,e}setView(e){return F.getState().setView(e),e}setEditor(e){return F.getState().setEditor(e),e}async updateDailyNotes(e,t){let n=`day-${de(e,`day`).format(`YYYY-MM-DD`)}T00:00:00+08:00`;return t?F.getState().removeDailyNote(n):F.getState().addDailyNote(n,e),this.getState().dailyNotes}setVerifyState(e){return F.getState().setVerifyState(e),e}async fechLocalDailyNotes(){try{let e=ge();return F.getState().setDailyNotes(e),e}catch(e){console.error(e)}}},L=new ki})),ji,Mi=o((()=>{(function(e){function t(e){let t={};for(let n of e)try{let e=localStorage.getItem(n);e!==null&&(t[n]=JSON.parse(e))}catch(e){console.error(`Get storage failed in `,n,e)}return t}e.get=t;function n(e){for(let t in e)try{let n=JSON.stringify(e[t]);localStorage.setItem(t,n)}catch(e){console.error(`Save storage failed in `,t,e)}}e.set=n;function r(e){for(let t of e)try{localStorage.removeItem(t)}catch(e){console.error(`Remove storage failed in `,t,e)}}e.remove=r;function i(){let e=document.createElement(`iframe`);e.style.display=`none`,document.body.appendChild(e),e.contentWindow?.localStorage.setItem(`t`,Date.now().toString()),e.remove()}e.emitStorageChangedEvent=i})(ji||={})})),Ni,R,Pi=o((()=>{Mi(),I(),Ni=class{constructor(){let e=ji.get([`shouldSplitMemoWord`,`shouldHideImageUrl`,`shouldUseMarkdownParser`,`useTinyUndoHistoryCache`]),t={shouldSplitMemoWord:e.shouldSplitMemoWord||!0,shouldHideImageUrl:e.shouldHideImageUrl||!0,shouldUseMarkdownParser:e.shouldUseMarkdownParser||!0,useTinyUndoHistoryCache:e.useTinyUndoHistoryCache||!1};this.setAppSetting(t)}getState=()=>vi.getState();setEditMemoId=e=>{vi.getState().setEditMemoId(e)};setRefresh=e=>{vi.getState().setRefresh(e)};setCommentMemoId=e=>{vi.getState().setCommentMemoId(e)};setMarkMemoId=e=>{vi.getState().setMarkMemoId(e)};setLoaded=e=>{vi.getState().setLoaded(e)};setGlobalEditorShown=e=>{vi.getState().setGlobalEditorShown(e)};setImmersiveMode=e=>{vi.getState().setImmersiveMode(e)};toggleImmersiveMode=()=>{vi.getState().toggleImmersiveMode()};setIsMobileView=e=>{vi.getState().setMobileView(e)};setIsPhoneView=e=>{vi.getState().setPhoneView(e)};setChangedByMemos=e=>{vi.getState().setChangedByMemos(e)};setShowSiderbarInMobileView=e=>{vi.getState().setShowSidebarInMobileView(e)};setAppSetting=e=>{vi.getState().setAppSetting(e),ji.set(e)};setMemoListView=e=>{vi.getState().setMemoListView(e)};setInstance=(e,t)=>{vi.getState().setInstance(e,t)};setLocked=e=>{vi.getState().setLocked(e)};setExitSteps=e=>{vi.getState().setExited(e)};setPluginManifest=e=>{vi.getState().setManifest(e)}},R=new Ni})),Fi,z,Ii=o((()=>{I(),Fi=class{constructor(){this.updateStateWithLocation(),window.onpopstate=()=>{this.updateStateWithLocation()}}updateStateWithLocation=()=>{let{pathname:e,search:t,hash:n}=window.location,r=new URLSearchParams(t),i={pathname:`/`,hash:``,query:{tag:``,duration:null,text:``,type:``,filter:``,path:``,metadata:{}}};i.query.tag=r.get(`tag`)||``,i.query.type=r.get(`type`)??``,i.query.text=r.get(`text`)??``,i.query.filter=r.get(`filter`)??``;let a=parseInt(r.get(`from`)??`0`),o=parseInt(r.get(`to`)??`0`);o>a&&o!==0&&(i.query.duration={from:a,to:o}),i.hash=n,i.pathname=this.getValidPathname(e),Si.getState().setLocation(i)};getState=()=>Si.getState();clearQuery=()=>{Si.getState().clearQuery()};setQuery=e=>{Si.getState().setQuery(e)};reloadApp=()=>{Si.getState().reload()};setHash=e=>{Si.getState().setHash(e)};setPathname=e=>{Si.getState().setPathname(e)};pushHistory=e=>{Si.getState().setPathname(e)};replaceHistory=e=>{Si.getState().setPathname(e)};setMemoTypeQuery=(e=``)=>{Si.getState().setTypeQuery(e)};setMemoFilter=e=>{console.log(`ThinoDebug setMemoFilter`,{filterId:e}),Si.getState().setFilterQuery(e)};setTextQuery=e=>{Si.getState().setTextQuery(e)};setTimeQuery=e=>{Si.getState().setDurationQuery(e)};setPathQuery=e=>{Si.getState().setPathQuery(e)};setMetadataQuery=(e,t)=>{Si.getState().setMetadataQuery(e,t)};setTagQuery=e=>{Si.getState().setTagQuery(e)};setFromAndToQuery=(e,t)=>{Si.getState().setDurationQuery({from:e,to:t})};getValidPathname=e=>[`/`,`/homeboard`,`/recycle`,`/setting`].includes(e)?e:`/`},z=new Fi})),Li,Ri,zi,Bi,Vi,Hi=o((()=>{H(),Li=e=>`${e.vault.configDir}/query.json`,Ri=async(e,t)=>{try{return await e.vault.adapter.read(t),!0}catch(e){return console.error(e),!1}},zi=async e=>(await Ri(e,Li(e))||await Vi(e),JSON.parse(await e.vault.adapter.read(Li(e))).queries||[]),Bi=async(e,t)=>{await e.vault.adapter.write(Li(e),JSON.stringify({queries:t},null,2))},Vi=async e=>{let t=R.getState().manifest,n=e.plugins.getPlugin(t.id||`obsidian-memos`).settings,r=e.metadataCache.getFirstLinkpathDest(n.QueryFileName,``);if(!r)await e.vault.adapter.write(Li(e),JSON.stringify({queries:[]},null,2));else{let t=(await e.vault.read(r)).split(`
- `);t.length===0&&await e.vault.adapter.write(Li(e),JSON.stringify({queries:[]},null,2));let n=[];for(let e=0;e<t.length;e++){let r=e,i=`未命名`,a=t[e],o=(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),s=`[]`,c=a.match(/^\d{14,16}/);c&&(o=(0,f.moment)(c[0].slice(0,14),`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:ss`));let l=a.match(/\[\{(.+)\}\]/);l&&(s=l[0]);let u=a.match(/\s(.+)\s\[\{/);u&&(i=u[0].slice(1,-3)),n.push({id:r,pinnedAt:``,createdAt:o,updatedAt:o,title:i,querystring:s,userId:`Memos`})}await e.vault.adapter.write(Li(e),JSON.stringify({queries:n},null,2))}}})),Ui,Wi=o((()=>{yr(),Hi(),Ui=async()=>{let{app:e}=vr.getState().dailyNotesState;return await Ri(e,Li(e))||await Vi(e),await zi(e)||[]}})),Gi,Ki,qi=o((()=>{yr(),M(),Hi(),Gi=(e,t)=>({createdAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),id:e,pinnedAt:``,querystring:t,title:j(`Temp Filter`),updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),userId:`Thino`}),Ki=async(e,t)=>{let n=await zi(vr.getState().dailyNotesState.app)||[],r={createdAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),id:(0,f.moment)().format(`YYYYMMDDHHmmss`)+n.length,pinnedAt:``,querystring:t,title:e,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),userId:`Thino`};return n.push(r),await Bi(vr.getState().dailyNotesState.app,n),r}}));function Ji(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(typeof e!=`object`)return e===t;if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ji(e[n],t[n]))return!1;return!0}if(e.constructor!==t.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!Ji(e[i],t[i]))return!1;return!0}function Yi(e){return e==null?!0:typeof e==`string`||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:typeof e==`object`?Object.keys(e).length===0:!1}var Xi=o((()=>{}));function Zi(e){let t=e.match(/^#+/);return t?t[0].length:0}function Qi(e,t){let n=e.split(`
- `),r=``,i=[],a=!1,o=1;for(let e=0;e<n.length;e++){let s=n[e];if(s.startsWith(`#`)&&/^#{1,6}\s/g.test(s)){if(a&&Zi(s)<=Zi(t))break;r=s,r===t?(a=!0,o=e+1):a&&Zi(s)>Zi(t)?i.push(s):(a=!1,i=[])}else a&&i.push(s)}return t?Yi(i)?{content:``,startLine:-1}:{content:i.join(`
- `),startLine:o}:{content:e,startLine:0}}function $i(e){let t={};for(let n of e)n.parent&&n.parent>0&&(t[n.position.start.line]=n.parent);return t}function ea(e,t,n){let r={},i=(e,t)=>{for(;e[t]!==void 0&&e[t]!==t;)t=e[t];return t},a=L.getState().app,o=n.split(`
- `),s=t+o.length-1,c=a.metadataCache.getFileCache(e)?.listItems,l={};if(!c)return[];let u=e=>RegExp(`^(-|\\*|\\d\\.)\\s(\\[.\\]\\s)?(\\d{1,2}:\\d{2}(:\\d{2})?)(-\\d{1,2}:\\d{2}(:\\d{2})?)?\\s?`).test(e);return c.forEach(e=>{let n=e.position.start.line,a=e.position.end.line;if(n>=t&&a<=s){let s=n-t,c=a-t,d=o.slice(s,c+1),f=d.join(`
- `);if(e.parent&&e.parent>0&&(r[e.position.start.line]=e.parent),e.parent&&l[e.parent]){if(n-e.parent===1){let t=o[s]?.match(/^(\s*)/);t&&(l[e.parent].indent=t[0])}let t=RegExp(`^`+l[e.parent].indent);l[e.parent].content+=`
- `+f.split(`
- `).map(e=>e?.replace(t,``)).join(`
- `)}else if(e.parent&&l[i(r,e.parent)]){let t=i(r,e.parent),n=RegExp(`^`+l[t].indent);l[t].content+=`
- `+d.map(e=>e?.replace(n,``)).join(`
- `)}else if(u(f)||new RegExp(Zr).test(f)){l[n]||(l[n]={content:``,blockId:``,indent:``});let t=d.length>1&&d[1]?.match(/^(\s*)/);t&&(l[n].indent=t[0]),l[n].content=d.map(e=>e?.replace(l[n].indent,``)).join(`
- `),l[n].blockId=e.id}}}),Object.keys(l).map(e=>{let t=parseInt(e);return{line:l[t].content,blockId:l[t].blockId||``,index:t}})}async function ta(e,t){let n=t.vault.getAbstractFileByPath(e);return n||(new f.Notice(j(`File not found for the given thino path, is creating a new file`)),n=await t.vault.create(e,`{"nodes": [], "edges": []}`),V.markPathPending(e),R.setChangedByMemos(!0)),n}async function na(e,t){let n;try{n=await t.vault.read(e)}catch(r){console.error(r),n=await t.vault.cachedRead(e)}let r=t.metadataCache.getFileCache(e)?.frontmatterPosition;return r?n.slice(r.end.offset+1):n}function ra(e){let t=e.split(/\r?\n/),n=[],r=!1,i=[],a=``;for(let e=0;e<t.length;e++){let o=t[e];o.startsWith(`> [!thino]`)?(r&&(n.push({metadata:a,content:i.join(`
- `).trim()}),i=[]),r=!0,a=o.replace(`> [!thino]`,``).trim()):r&&o.startsWith(`>`)?i.push(o.replace(/^> /,``)):r&&!o.startsWith(`>`)&&(r=!1,n.push({metadata:a,content:i.join(`
- `).trim()}),i=[],a=``)}return r&&n.push({metadata:a,content:i.join(`
- `).trim()}),n}var ia=o((()=>{Xi(),$r(),H(),M()}));async function aa(e,t={}){let{maxRetries:n=3,retryDelay:r=200,useExponentialBackoff:i=!0,forceReread:a=!1}=t;return oa(e,0,n,r,i,a)}async function oa(e,t,n,r,i,a){try{let{vault:t,metadataCache:n}=vr.getState().dailyNotesState.app;if(a)await t.read(e);else try{await t.cachedRead(e)}catch{await t.read(e)}n.getFileCache(e),await new Promise(e=>setTimeout(e,150));let r=n.getFileCache(e)?.listItems||[];return console.log(`🔄 File cache refreshed for ${e.path}, found ${r.length} list items`),!0}catch(o){if(console.warn(`Failed to refresh file cache for ${e.path} (attempt ${t+1}):`,o),t<n){let o=i?r*2**t:r;return await new Promise(e=>setTimeout(e,o)),oa(e,t+1,n,r,i,a)}return!1}}async function sa(e){try{let{metadataCache:t}=vr.getState().dailyNotesState.app,n=t.getFileCache(e),r=n?.listItems||[];return r.length===0&&await aa(e)&&(n=t.getFileCache(e),r=n?.listItems||[]),r}catch(t){return console.error(`Failed to get list items for ${e.path}:`,t),[]}}var ca=o((()=>{yr()}));async function la(e,t,n,r){let i=n.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-]+)($|\s|\n)/g,``).trim(),a=ua(i),o=null,s=0;for(let n of e){if(!n.position)continue;let e=t.slice(n.position.start.line,n.position.end.line+1).join(`
- `).replace(/^- \d{2}:\d{2}\s*/,``).replace(/^- \[.\]\s*\d{2}:\d{2}\s*/,``).replace(/^- \[.\]\s*/,``).replace(/^- /,``).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-]+)($|\s|\n)/g,``).trim(),r=da(i,e,a);if(r===1)return console.log(`✅ Found memo by exact content match at line ${n.position.start.line}`),n;r>s&&r>.8&&e.startsWith(i.split(`
- `)[0])&&(o=n,s=r)}return o&&s>.8?(console.log(`✅ Found memo by best content match (score: ${s.toFixed(2)}) at line ${o.position.start.line}`),o):(console.warn(`⚠️ Could not find memo by content for memo ${r.slice(-6)} (best score: ${s.toFixed(2)})`),null)}function ua(e){let t=e.split(/\s+/).filter(e=>e.length>3),n=[...new Set(t)].slice(0,5).join(` `);return`${e.substring(0,30)}|${e.length>30?e.substring(e.length-30):``}|${n}`}function da(e,t,n){if(e===t)return 1;if(n===ua(t))return .95;let r=Math.min(e.length,t.length)/Math.max(e.length,t.length);if(r<.5)return 0;let i=new Set(e.toLowerCase().split(/\s+/)),a=new Set(t.toLowerCase().split(/\s+/)),o=new Set([...i].filter(e=>a.has(e))),s=new Set([...i,...a]),c=o.size/s.size,l=e.length>20&&t.includes(e.substring(0,Math.min(50,e.length)))?.3:0;return Math.max(c,l)*r}function fa(e,t){let n=/%%(.*?)%%/,r=e.match(n);if(!r)return e;let i=r[1].trim(),a={};i.split(` `).forEach(e=>{let[t,n]=e.slice(1,-1).split(`::`);a[t]=n});for(let e of Object.keys(t))if(e!==`id`&&e!==`content`){if(e===`rowStatus`&&t.rowStatus===`ARCHIVED`){a.archived=`true`;continue}else if(e===`rowStatus`&&t.rowStatus===`NORMAL`){delete a.archived;continue}e===`deleted`&&t.deleted?a.deleted=(0,f.moment)().format(`YYYYMMDDHHmmss`):typeof t[e]==`boolean`?t[e]?a[e]=`true`:delete a[e]:t[e]&&(typeof t[e]==`string`||typeof t[e]==`boolean`)&&(a[e]=t[e])}let o=Object.entries(a).map(([e,t])=>`[${e}::${t}]`).join(` `);return e.replace(n,`%% ${o} %%`)}async function pa(e,t){if(!e.sourceType||e.sourceType!==`MULTI`)return e;let{vault:n,fileManager:r}=vr.getState().dailyNotesState.app,i=n.getAbstractFileByPath(e.path);if(!i)return e;let a=(0,f.moment)();if(console.log(t),V.markPathPending(i.path),await r.processFrontMatter(i,e=>{(t.pinned!==void 0||t.thinoType||t.rowStatus||t.visibility||t.deleted)&&R.setChangedByMemos(!0),t.id&&(e.id=t.id),t.thinoType&&(e.thinoType=t.thinoType),t.rowStatus&&(e.rowStatus=t.rowStatus),t.visibility&&(e.visibility=t.visibility),t.webId&&(e.webId=t.webId),t.pinned!==void 0&&(e.pinned=t.pinned),t.deleted!==void 0&&(e.deletedAt=t.deleted?a.format(`YYYY/MM/DD HH:mm:ss`):``),e.createdAt||=a.format(`YYYY/MM/DD HH:mm:ss`),e.updatedAt=a.format(`YYYY/MM/DD HH:mm:ss`)}),t.content){let r=await n.read(i),a=r,o=t.content.replace(/\$/g,`$$$$`);a=r.replace(e.content,o),await n.modify(i,a)}return R.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:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned===void 0?e.pinned:t.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 ma(e,t){if(!e.sourceType||e.sourceType!==`FILE`)return e;let{vault:n}=vr.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;let i=(0,f.moment)(),a=``;try{a=await n.read(r)}catch(e){console.error(e),a=await n.cachedRead(r)}let o=a.split(/\r?\n/),s=o.findIndex(t=>t.includes(`id::`+e.id)||t.includes(`Id::`+e.id)||e.webId&&t.includes(e.webId)),c=o[s];if(!c)return e;let l=fa(c,t);if(console.log(t,l),!c)return e;let u=l+`
- `,d=o.findIndex((e,t)=>t>s&&e.trim()===``),p=``;d===-1&&(p=o.slice(s+1).join(`
- `)),d!==-1&&(p=o.slice(s+1,d).join(`
- `));let m=p;t?.content&&(m=t.content.split(/\r?\n/).map(e=>`> `+e).join(`
- `));let h=u+m,g=h.split(/\r?\n/);console.log(h,g,s),o.splice(s,d===-1?o.length-s:d-s,...g);let _=o.join(`
- `);return V.markPathPending(r.path),R.setChangedByMemos(!0),await n.modify(r,_),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||i.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned===void 0?e.pinned:t.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?i.format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt?e.deletedAt:``}}async function ha(e,t){if(!e.sourceType||e.sourceType!==`CANVAS`)return e;let{vault:n}=vr.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;let i=await n.read(r),a=JSON.parse(i),o=a.nodes.find(t=>t.id===e.id);if(!o)return e;t.content&&(o.text=t.content),t.thinoType&&(o.thinoType=t.thinoType),t.rowStatus&&(o.rowStatus=t.rowStatus),t.visibility&&(o.visibility=t.visibility),t.pinned!==void 0&&(o.pinned=t.pinned),t.webId&&(o.webId=t.webId);let s=(0,f.moment)();t.deleted!==void 0&&(o.deletedAt=t.deleted?s.format(`YYYY/MM/DD HH:mm:ss`):``),o.updatedAt=s.format(`YYYY/MM/DD HH:mm:ss`),V.markPathPending(r.path),R.setChangedByMemos(!0);let c=JSON.stringify(a,null,2);return await n.modify(r,c),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),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?s.format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt?e.deletedAt:``}}function ga(e,t,n){let r=[];if(!t.find(t=>t.position.start.line===e))return r;let i=(n[e]||``).match(/^(\s*)/),a=i?i[1].length:0,o=e=>/^(\s*)- (\[.\] )?\d{2}:\d{2}/.test(e);for(let i of t){let s=i.position.start.line;if(s<=e)continue;let c=n[s]||``,l=c.match(/^(\s*)/),u=l?l[1].length:0;if(u>a){let i=!0;for(let r of t){let t=r.position.start.line;if(t>e&&t<s){let e=(n[t]||``).match(/^(\s*)/);if((e?e[1].length:0)<=a){i=!1;break}}}i&&r.push(s)}else if(u===a){if(o(c))break}else break}return r}async function _a(e,t){Ra()||new f.Notice(j(`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.`));let{vault:n,metadataCache:r}=vr.getState().dailyNotesState.app,i=vr.getState().dailyNotesState.app,{settings:a}=vr.getState().dailyNotesState,o=e.id.toString().slice(0,14),s=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isSame((0,f.moment)(o,`YYYYMMDDHHmmss`))?(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`):(0,f.moment)(o,`YYYYMMDDHHmmss`),c=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isSame(s,`day`),l=e.path,u=n.getAbstractFileByPath(l)||n.getAbstractFileByPath(e.path);if(!u)return new f.Notice(j(`Please check your daily note plugin OR periodic notes plugin settings`)),e;let d=(await n.read(u)).split(`
- `),p=r.getFileCache(u),m=p?.listItems||[];if(m.length===0&&(console.log(`⚠️ No list items found for memo ${e.id.slice(-6)}, attempting to refresh file cache...`),await aa(u)&&(p=r.getFileCache(u),m=p?.listItems||[],m.length>0&&console.log(`✅ File cache refresh successful, found ${m.length} list items`)),m.length===0)){console.warn(`⚠️ No list items found for memo ${e.id.slice(-6)} even after cache refresh. This might be a newly created memo.`);let n={...e,content:t.content||e.content,thinoType:t.thinoType||e.thinoType,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),pinned:t.pinned===void 0?e.pinned:t.pinned,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,webId:t.webId||e.webId,deletedAt:t.deleted?(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt||``};return console.warn(`Returning updated memo without file modification for memo ${e.id.slice(-6)}`),n}let h=parseInt(e.id.slice(14)),g=h;$i(m);let _=m.find(e=>e.position.start.line===h);if(!_&&e.content&&(console.log(`🔍 Memo not found at original line ${h}, searching by content...`),_=await la(m,d,e.content,e.id)),!_&&e.hasId&&(console.log(`🔍 Searching by block ID: ${e.hasId}`),_=m.find(t=>t.position?d.slice(t.position.start.line,t.position.end.line+1).join(`
- `).includes(`^${e.hasId}`):!1)),!_){console.warn(`⚠️ List item not found after all search strategies for memo ${e.id.slice(-6)}. Original line: ${h}. This might indicate a line number mismatch.`);let n={...e,content:t.content||e.content,thinoType:t.thinoType||e.thinoType,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),pinned:t.pinned===void 0?e.pinned:t.pinned,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,webId:t.webId||e.webId,deletedAt:t.deleted?(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt||``};return console.warn(`Returning updated memo without file modification for memo ${e.id.slice(-6)}`),n}let v=_.position.start.line;v!==h&&console.log(`📍 Memo location corrected: ${h} → ${v} for memo ${e.id.slice(-6)}`);let y=_.position.end?.line;g=typeof y==`number`&&y>=v?y:v+e.content.split(`
- `).length,g>=d.length&&(g=d.length-1);let b=m.find(e=>{let t=e.position.start.line;if(t<=v)return!1;let n=d[t]||``;return/^(\s*)- (\[.\] )?\d{2}:\d{2}/.test(n)});b&&g>=b.position.start.line&&(console.warn(`⚠️ Limiting endLine to prevent including next memo. Original: ${g}, Limited: ${b.position.start.line-1}`),g=b.position.start.line-1);let x=d.slice(v,g+1),S=x.join(`
- `),C=S;console.log(`Original content:`,S);let w=i.vault.getConfig(`useTab`)===void 0||app.vault.getConfig(`useTab`)===!0,T=w?1:i.vault.getConfig(`tabSize`),E=(w?` `:` `).repeat(T),D=S.match(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/),O=t.hasId===void 0?D?D[1]:e.hasId||null:t.hasId,k=ka(x[0]||``),ee;ee=k.fullTimeMatch?k.fullTimeMatch:c?(0,f.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 A=ee;!k.fullTimeMatch&&a.DefaultTimePrefix!==`HH:mm`&&(A=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(a.DefaultTimePrefix));let te={pinned:S.includes(`[pinned::true]`),deleted:S.match(/\[deleted::([^\]]+)\]/)?.[1]||``,archived:S.includes(`[archived::true]`),webId:S.match(/\[webId::([^\]]+)\]/)?.[1]||``,visibility:S.match(/\[visibility::"([^"]+)"\]/)?.[1]||``};if(S.match(/^(- \[.\] |- |(\*|\d{1,2}\.) )/)?.[0],t.content){let n=t.thinoType?t.thinoType===`TASK-TODO`?`- [ ] `:t.thinoType===`TASK-DONE`?`- [x] `:t.thinoType.startsWith(`TASK`)?`- [${t.thinoType.slice(5)}] `:`- `:e.thinoType===`TASK-TODO`?`- [ ] `:e.thinoType===`TASK-DONE`?`- [x] `:e.thinoType.startsWith(`TASK`)?`- [${e.thinoType.slice(5)}] `:`- `,r=[];if((t.pinned===void 0?te.pinned:t.pinned)&&r.push(`[pinned::true]`),t.deleted||t.deleted!==!1&&te.deleted){let e=t.deleted?(0,f.moment)().format(`YYYYMMDDHHmmss`):te.deleted;r.push(`[deleted::${e}]`)}(t.rowStatus===`ARCHIVED`||t.rowStatus!==`NORMAL`&&te.archived)&&r.push(`[archived::true]`),(t.webId===void 0?te.webId:t.webId)&&r.push(`[webId::${t.webId===void 0?te.webId:t.webId}]`),(t.visibility||te.visibility)&&r.push(`[visibility::"${t.visibility||te.visibility}"]`);let i=O?`^${O}`:``,a=t.content.trim().split(`
- `).length>1,o=t.content.trim().split(`
- `);if(a){let e=o.map(e=>E+e);C=`${n}${A}${O?` ${i}`:``}\n${e.join(`
- `)} ${r.join(` `)}`.trim()}else C=`${n}${A} ${t.content.trim()} ${r.join(` `)}`.trim()+(i?` ${i}`:``)}else{if(t.thinoType){let e=t.thinoType===`TASK-TODO`?`- [ ] `:t.thinoType===`TASK-DONE`?`- [x] `:t.thinoType.startsWith(`TASK`)?`- [${t.thinoType.slice(5)}] `:`- `;C=C.replace(/^((- \[.\] )|((-|\*) ))/,e)}if(t.rowStatus&&(t.rowStatus===`ARCHIVED`?C.includes(`[archived::`)?C=C.replace(/\[archived::(true|false)\]/,`[archived::true]`):C+=(C.endsWith(` `)?``:` `)+`[archived::true]`:t.rowStatus===`NORMAL`&&(C=C.replace(/\s?\[archived::(true|false)\]/,``))),t.visibility){let e=`[visibility::"${t.visibility}"]`;C.includes(`[visibility::`)?C=C.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/,e):C+=(C.endsWith(` `)?``:` `)+e}if(t.pinned!==void 0&&(t.pinned?C.includes(`[pinned::`)?C=C.replace(/\[pinned::(true|false)\]/,`[pinned::true]`):C+=(C.endsWith(` `)?``:` `)+`[pinned::true]`:C=C.replace(/\s?\[pinned::(true|false)\]/,``)),t.webId!==void 0&&(C.includes(`[webId::`)?C=t.webId===``?C.replace(/\s?\[webId::([^\]]+)\]/,``):C.replace(/\[webId::([^\]]+)\]/,`[webId::${t.webId}]`):t.webId!==``&&(C+=(C.endsWith(` `)?``:` `)+`[webId::${t.webId}]`)),t.deleted!==void 0){let e=(0,f.moment)();if(t.deleted){let t=`[deleted::${e.format(`YYYYMMDDHHmmss`)}]`;C.includes(`[deleted::`)?C=C.replace(/\[deleted::([^\]]+)\]/,t):C+=(C.endsWith(` `)?``:` `)+t}else C=C.replace(/\s?\[deleted::([^\]]+)\]/,``)}if(t.hasId!==void 0||O){let e=t.hasId===void 0?O:t.hasId;if(C=C.replace(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/g,``),e){let t=C.split(`
- `);t[0]=t[0].trimEnd()+` ^${e}`,C=t.join(`
- `)}}}if(C!==S){let r=g-v+1,i=C.trim().split(`
- `);r>10&&i.length<r/2&&console.warn(`⚠️ Safety check: Replacing ${r} lines with ${i.length} lines for memo ${e.id.slice(-6)}. This might indicate content mixing.`);let a=(S.match(/^- \d{2}:\d{2}/gm)||[]).length;if(a>1){console.warn(`⚠️ Safety check: Original content contains ${a} memo-like structures. Limiting replacement to single memo.`);let e=S.match(/^- \d{2}:\d{2}.*$/m);if(e){let t=S.indexOf(e[0]),n=S.substring(t+e[0].length).match(/^- \d{2}:\d{2}/m);if(n){let r=v+S.substring(0,t+e[0].length+S.substring(t+e[0].length).indexOf(n[0])).split(`
- `).length-1;g=Math.min(g,r-1),console.log(`📍 Limited endLine to ${g} to prevent including next memo`)}}}let o=g-v+1;d.splice(v,o,C.trim()),V.markPathPending(u.path),R.setChangedByMemos(!0),await n.modify(u,d.join(`
- `)),console.log(`memo`,e,t.deleted);let s=(0,f.moment)();return{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),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,hasId:t.hasId??e.hasId,deletedAt:t.deleted?s.format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt?e.deletedAt:``}}return e}async function va(e,t,n){let{vault:r,metadataCache:i}=vr.getState().dailyNotesState.app||window.app,a=r.getFileByPath(e);if(!a)return;let o=i.getFileCache(a)?.listItems||[];$i(o);let s=[],c=r.getConfig(`useTab`)===void 0||app.vault.getConfig(`useTab`)===!0,l=c?1:r.getConfig(`tabSize`),u=(c?` `:` `).repeat(l);function d(e,t){let n=[];for(let r in t)t[r]===e&&n.push(parseInt(r),...d(parseInt(r),t));return n}let p=(0,f.moment)(),m=(await r.read(a)).split(`
- `);return t.map(e=>{let t=parseInt(e.id.slice(14)),n=o.find(e=>e.position.start.line===t);if(!n&&e.content&&(console.log(`🔍 Bulk update: Memo not found at original line ${t}, searching by content...`),n=o.find(t=>{if(!t.position)return!1;let n=m.slice(t.position.start.line,t.position.end.line+1).join(`
- `).replace(/^- \d{2}:\d{2}\s*/,``).replace(/^- \[.\]\s*\d{2}:\d{2}\s*/,``).replace(/^- \[.\]\s*/,``).replace(/^- /,``).trim(),r=e.content.trim();return n.includes(r.substring(0,50))})),!n)return console.warn(`⚠️ Bulk update: Could not find memo ${e.id.slice(-6)} at line ${t}`),null;let r=n.position.start.line,i=ga(r,o,m).map(e=>{let t=o.find(t=>t.position.start.line===e);return t?t.position.end.line:-1}),a=Math.max(...i,n.position.end.line),s=o.find(e=>e.position.start.line>r&&(!e.parent||e.parent<=0));return s&&a>=s.position.start.line&&(console.warn(`⚠️ Bulk update: Limiting endLine to prevent including next block. Original: ${a}, Limited: ${s.position.start.line-1}`),a=s.position.start.line-1),{id:e.id,start:r,end:a}}).filter(Boolean).forEach(e=>{let r=m.slice(e.start,e.end+1).join(`
- `),i=r.split(`
- `),a=i[i.length-1].trim(),o=r,c=/\[(pinned|archived|deleted|webId|visibility)::[^\]]*\]\s*$/.test(a),l=(e,t)=>e.split(`
- `).length>1&&(/```/g.test(a)||!c)?e+`
- `+u+t:e+(e.endsWith(` `)?``:` `)+t;if(n===`delete`){let e=`[deleted::`+p.format(`YYYYMMDDHHmmss`)+`]`;o=o.replace(/\[deleted::([^\]]+)\]/,``),o=l(o,e)}if(n===`restoreFromDelete`&&(o=o.replace(/ ?\[deleted::([^\]]+)\]/,``)),n===`archive`){let e=`[archived::true]`;o=o.includes(`[archived::`)?o.replace(/\[archived::(true|false)\]/,e):l(o,e)}n===`restoreFromArchive`&&(o=o.replace(/ ?\[archived::(true|false)\]/,``)),n===`deleteForever`?m.splice(e.start,e.end-e.start+1):m.splice(e.start,e.end-e.start+1,o),s.push({...t.find(t=>t.id===e.id),deletedAt:n===`delete`?p.format(`YYYY/MM/DD HH:mm:ss`):``,rowStatus:n===`archive`?`ARCHIVED`:`NORMAL`})}),V.markPathPending(a.path),R.setChangedByMemos(!0),await r.modify(a,m.join(`
- `)),s}async function ya(e,t){return!e.sourceType||e.sourceType!==`JOURNAL`?e:{...await _a({...e,sourceType:`DAILY`},t),sourceType:`JOURNAL`}}var ba,xa,Sa=o((()=>{yr(),M(),H(),Ba(),ia(),ca(),ba=e=>{switch(e?.sourceType){case`CANVAS`:return ha(e,{id:e.id,pinned:!0});case`DAILY`:return _a(e,{id:e.id,pinned:!0});case`MULTI`:return pa(e,{id:e.id,pinned:!0});case`FILE`:return ma(e,{id:e.id,pinned:!0});case`JOURNAL`:return ya(e,{id:e.id,pinned:!0})}},xa=e=>{switch(e?.sourceType){case`CANVAS`:return ha(e,{id:e.id,pinned:!1});case`DAILY`:return _a(e,{id:e.id,pinned:!1});case`MULTI`:return pa(e,{id:e.id,pinned:!1});case`FILE`:return ma(e,{id:e.id,pinned:!1});case`JOURNAL`:return ya(e,{id:e.id,pinned:!1})}}}));async function Ca(e,t){if(!t)return 0;let{vault:n}=vr.getState().dailyNotesState.app,r=e?.DefaultMemoComposition,i=e?.ProcessEntriesBelow&&e?.ProcessContentTarget!==`whole`?e?.ProcessEntriesBelow:``,a=e?.ProcessContentTarget===`whole`?``:e?.DifferentInsertTarget?e?.InsertAfterForTask?e?.InsertAfterForTask:``:i,o;try{o=await n.read(t)}catch(e){console.error(e),o=await n.cachedRead(t)}let s;s=r!=``&&/{TIME}/g.test(r)&&/{CONTENT}/g.test(r)?`(-|\\*) (\\[(.{1})\\]\\s)?`+r.replace(/{TIME}/g,`((\\<time\\>)?\\d{1,2}:\\d{2}(\\:\\d{2})?)?`).replace(/ {CONTENT}/g,``):`(-|\\*) (\\[(.{1})\\]\\s)?((\\<time\\>)?\\d{1,2}\\:\\d{2}(\\:\\d{2})?)?`;let c=new RegExp(s,`g`),l=(o.match(c)||[]).length,u=new RegExp(i.replace(/([.?*+^$[\]\\(){}|-])/g,`\\$1`),`g`),d=new RegExp(a.replace(/([.?*+^$[\]\\(){}|-])/g,`\\$1`),`g`),f=(o.match(u)||[]).length,p=(o.match(d)||[]).length;return o=null,f||p?l:0}function wa(e,t,n,r,i){let a=vr.getState().dailyNotesState.app||window.app,o=de(i,`day`)||(0,f.moment)(i.stat.ctime),s=ea(i,n,t),c=a?.metadataCache.getFileCache(i),l={frontmatter:c?.frontmatter||{},tags:c?.frontmatter?.tags||[]};for(let t of s){Ta(o,t,e);let{rawText:n,memoType:a}=Ea(t),{content:s,pinned:c,archived:u,deleted:d,deletedAtStr:p,webId:m,visibility:h}=Da(n,t),g=Oa(s);r.push({id:o.format(`YYYYMMDDHHmmss`)+`${t.index}`,content:s.trim(),createdAt:o.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:o.format(`YYYY/MM/DD HH:mm:ss`),createdAtTs:o.valueOf(),updatedAtTs:o.valueOf(),thinoType:a,hasId:t.blockId?t.blockId:``,linkId:g,path:i.path,deletedAt:d?(0,f.moment)(p,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,rowStatus:u?`ARCHIVED`:`NORMAL`,visibility:h,pinned:c,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,webId:m,fileInfo:l})}}function Ta(e,t,n){let r=ka(t.line);if(r.startHour&&r.startMin)e.hours(parseInt(r.startHour)),e.minutes(parseInt(r.startMin)),r.startSec?e.seconds(parseInt(r.startSec)):e.seconds(0);else{let r=Pa(n.DefaultMemoComposition,t.line),i=Fa(n.DefaultMemoComposition,t.line),a=Ia(t.line);e.hours(parseInt(r)),e.minutes(parseInt(i)),a?e.seconds(parseInt(a)):e.seconds(0)}}function Ea(e){let t=Aa(e.line),n;if(/^\s*[-*]\s(\[(.)\])\s/g.test(e.line)){let r=La(e.line);t=ja(e.line),n=Na(r)}else n=`JOURNAL`;return{rawText:t,memoType:n}}function Da(e,t){if(!e)return{content:``,pinned:!1,archived:!1,deleted:!1,deletedAtStr:``,webId:``,visibility:`PRIVATE`};let n=e.trim().replaceAll(/<br>/g,`
- `),r=new RegExp(/\[(pinned|PINNED)::true\]/,`g`).test(e),i=new RegExp(/\[(archived|ARCHIVED)::true\]/,`g`).test(e),a=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,`g`).test(e),o=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,`g`).exec(e)?.[2],s=new RegExp(/\[(webId|WEBID)::([^\]]*)\]/,`g`).exec(e)?.[2],c=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,`g`).test(e)?`PUBLIC`:`PRIVATE`;return n=n.replace(/\s?\[pinned::[^\]]+\]/g,``).replace(/\s?\[visibility::[^\]]+\]/g,``).replace(/\s?\[archived::[^\]]+\]/g,``).replace(/\s?\[deleted::[^\]]+\]/g,``).replace(/\s?\[webId::[^\]]+\]/g,``),t.blockId&&(n=n.replace(`^`+t.blockId,``)),{content:n,pinned:r,archived:i,deleted:a,deletedAtStr:o,webId:s,visibility:c}}function Oa(e){let t=[],n=/(?:\[\[([^\]|]+)#\^([a-zA-Z0-9-]+)(?:\|[^\]]+)?\]\])|(?:\[.+?\]\(([^)]+)#\^([a-zA-Z0-9-]+)\))/g,r;for(;(r=n.exec(e))!==null;)r[1]&&r[2]?t.push(`${r[1]}#^${r[2]}`):r[3]&&r[4]&&t.push(`${r[3]}#^${r[4]}`);return t}function ka(e){let t=/^\s*(-|\*|\d+\.)\s+(\[.\]\s+)?((\d{1,2}):(\d{2})(:(\d{2}))?)-(\d{1,2}):(\d{2})(:(\d{2}))?/,n=/^\s*(-|\*|\d+\.)\s+(\[.\]\s+)?(\d{1,2}):(\d{2})(:(\d{2}))?/,r=e.match(t);if(r){let e=r[0].replace(/^\s*(-|\*|\d+\.)\s+(\[.\]\s+)?/,``);return{startHour:r[4],startMin:r[5],startSec:r[7],endHour:r[8],endMin:r[9],endSec:r[11],fullTimeMatch:e}}let i=e.match(n);if(i){let e=i[0].replace(/^\s*(-|\*|\d+\.)\s+(\[.\]\s+)?/,``);return{startHour:i[3],startMin:i[4],startSec:i[6],fullTimeMatch:e}}return{startHour:``,startMin:``,fullTimeMatch:``}}function Aa(e){let t=ka(e);return t.fullTimeMatch?e.replace(RegExp(`^(-|\\*|\\d\\.) (${t.fullTimeMatch})\\s(.*)`),`$3`):e.replace(/^(-|\*|\d\.) (\d{1,2}:\d{2}(:\d{2})?)\s(.*)/g,`$4`)}function ja(e){return za(e)}async function Ma(e,t=!1){let n=vr.getState().dailyNotesState.app,r=n.vault.getFileByPath(e.path);if(r&&e.hasId)return t?`!`+n.fileManager.generateMarkdownLink(r,``,`#^`+e.hasId,e.id):e.hasId?n.fileManager.generateMarkdownLink(r,``,`#^`+e.hasId,e.id):`[@THINO](${e.id})`;let i=N.randomId(6);return await _a(e,{id:e.id,hasId:i}),r?t?`!`+n.fileManager.generateMarkdownLink(r,``,`#^`+i,e.id):n.fileManager.generateMarkdownLink(r,``,`#^`+i,e.id):`[@THINO](${e.id})`}var Na,Pa,Fa,Ia,La,Ra,za,Ba=o((()=>{yr(),je(),M(),ia(),li(),Sa(),Na=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},Pa=(e,t)=>{let n=ka(t);if(n.startHour)return n.startHour;let r;return r=e!=``&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?`+e.replace(/{TIME}/g,`(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?`).replace(/{CONTENT}/g,`(.*)`):`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)`,new RegExp(r,``).exec(t)?.[6]},Fa=(e,t)=>{let n=ka(t);if(n.startMin)return n.startMin;let r;return r=e!=``&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?`+e.replace(/{TIME}/g,`(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?`).replace(/{CONTENT}/g,`(.*)`):`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)`,new RegExp(r,``).exec(t)?.[7]},Ia=e=>{let t=ka(e);return t.startSec?t.startSec:RegExp(`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\d{1,2})\\:(\\d{2})\\:(\\d{2})(.*)`,``).exec(e)?.[7]},La=e=>/^\s*[\-\*]\s(\[(.{1})\])\s(.*)/.exec(e)?.[2],Ra=()=>re()?!0:(new f.Notice(j(`Check if you opened Daily Notes Plugin Or Periodic Notes Plugin`)),!1),za=e=>{let t=ka(e);return t.fullTimeMatch?RegExp(`^(-|\\*|\\d\\.)\\s+\\[.\\]\\s(${t.fullTimeMatch})\\s([\\w\\W]*)`).exec(e)?.[3]:RegExp(`^(-|\\*|\\d\\.)\\s+\\[.\\]\\s(\\d{1,2}:\\d{2}(:\\d{2})?)\\s([\\w\\W]*)`,``).exec(e)?.[4]}}));function Va(){let e=window;return e.__THINO_PERF__||={records:{}},e.__THINO_PERF__}var Ha,Ua,Wa=o((()=>{Ha=()=>typeof performance<`u`?performance.now():Date.now(),Ua={start(e){try{let t=Va();t.records[e]={label:e,start:Ha()}}catch{console.log(`Do nothing`)}},end(e,t){try{let n=Va().records[e];if(!n)return;n.end=Ha(),n.duration=n.end-n.start,console.log(`[THINO][PERF] ${e}: ${n.duration.toFixed(1)}ms`,t||``)}catch{console.log(`Do nothing`)}},mark(e){this.start(e),this.end(e)},getAll(){try{return{...Va().records}}catch{return{}}}}}));async function Ga(e,t){if(!e)return t;let n=vr.getState().dailyNotesState.app||window.app;if(!await n.vault.adapter.exists(e.path))return console.log(`ThinoDebug getMemosFromFiles: file no longer exists`,e.path),t;let r=vr.getState().dailyNotesState.settings,i=await na(e,n),a=r.IgnoreFolderForMultiType;if(new Set(a.filter(e=>e!==``)).has(e.parent?.path))return t;let o=(0,f.moment)(e.stat.ctime).format(`YYYY/MM/DD HH:mm:ss`),s=n?.metadataCache.getFileCache(e),c={frontmatter:s?.frontmatter||{},tags:s?.frontmatter?.tags||[]};await n.fileManager.processFrontMatter(e,n=>{if(n.id||=N.randomId(16),n.createdAt?o=(0,f.moment)(n.createdAt,`YYYY/MM/DD HH:mm:ss`).isValid()?n.createdAt:o:n.createdAt=o,!i.trim())return t;let r=!!n.pinned,a=n.rowStatus&&n.rowStatus===`ARCHIVED`,s=!!n.deletedAt,l=n.deletedAt?n.deletedAt:``,u=n.visibility?n.visibility:`PRIVATE`,d=n.thinoType?n.thinoType:`JOURNAL`,p=n.webId?n.webId:``,m=n.id?n.id:``,h=n.hasId?n.hasId:``,g=n.linkId?n.linkId:``,_=e.path,v={id:m,content:i,createdAt:o,updatedAt:o,deletedAt:s?(0,f.moment)(l,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,pinned:r,rowStatus:a?`ARCHIVED`:`NORMAL`,visibility:u,thinoType:d,hasId:h,linkId:g,path:_,creatorName:`Memo`,sourceType:`MULTI`,resourceList:[],webId:p,fileInfo:c};return N.stampMemoTimestamps(v),t.push(v),t})}async function Ka(e,t){if(!e)return t;if(!await(vr.getState().dailyNotesState.app||window.app).vault.adapter.exists(e.path))return console.log(`ThinoDebug getMemosFromSingleFile: file no longer exists`,e.path),t;let{vault:n,metadataCache:r}=vr.getState().dailyNotesState.app||window.app,i;try{i=await n.read(e)}catch(n){return console.log(`ThinoDebug getMemosFromSingleFile: file read failed, likely deleted`,e.path,n),t}if(!i)return;let a=(0,f.moment)(e.stat.ctime).format(`YYYY/MM/DD HH:mm:ss`),o=(0,f.moment)(e.stat.mtime).format(`YYYY/MM/DD HH:mm:ss`),s=e.path,c=[],l=[],u=r.getFileCache(e),d={frontmatter:u?.frontmatter||{},tags:u?.frontmatter?.tags||[]},p=ra(i);for(let e of p){let n=e.metadata.match(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/g);if(!n)continue;let r=e.metadata.match(/id::([^\]]*)/g)?.[0]?.replace(`id::`,``);if(!r)continue;let i=n?n[0]:a,u=n?n[0]:o,p=e.metadata.match(/webId::([^\]]*)/g)?e.metadata.match(/webId::([^\]]*)/g)?.[0]?.replace(`webId::`,``):``,m=e.metadata.contains(`[pinned::true]`),h=e.metadata.contains(`[archived::true]`),g=e.metadata.contains(`[deleted::`),_=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,`g`).exec(e.metadata)?.[2],v=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,`g`).test(e.metadata)?`PUBLIC`:`PRIVATE`,y=new RegExp(/\[(thinoType|THINOTYPE)::([^\]]*)\]/,`g`).exec(e.metadata)?.[2],b={id:r,content:e.content,createdAt:i,updatedAt:u,deletedAt:g?(0,f.moment)(_,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,pinned:m,rowStatus:h?`ARCHIVED`:`NORMAL`,visibility:v,thinoType:y||`JOURNAL`,hasId:``,linkId:c,path:s,creatorName:`Thino`,sourceType:`FILE`,resourceList:l,webId:p,fileInfo:d};N.stampMemoTimestamps(b),t.push(b)}return t}async function qa(e,t){if(!e)return[];let n=vr.getState().dailyNotesState.app||window.app;if(!await n.vault.adapter.exists(e.path))return console.log(`ThinoDebug getMemosFromDailyNote: file no longer exists`,e.path),t;let r=vr.getState().dailyNotesState.settings,{vault:i}=n;if(await Ca(r,e)===0)return;let a;try{a=await i.read(e)}catch(n){return console.log(`ThinoDebug getMemosFromDailyNote: file read failed, likely deleted`,e.path,n),t}let{content:o,startLine:s}=Qi(a,r?.ProcessContentTarget===`whole`?``:r.ProcessEntriesBelow),c=``,l=0;if(r.DifferentInsertTarget&&r?.ProcessContentTarget!==`whole`&&r.InsertAfterForTask&&!o.includes(r.InsertAfterForTask)){let{content:e,startLine:t}=Qi(a,r.InsertAfterForTask);c=e,l=t}let u=[];wa(r,o,s,u,e),r.DifferentInsertTarget&&c&&wa(r,c,l,u,e),u.length!==0&&t.push(...u.sort((e,t)=>e.createdAt>t.createdAt?-1:1))}async function Ja(e,t){let n=vr.getState().dailyNotesState.app||window.app;if(!(e instanceof f.TFile))return;if(!await n.vault.adapter.exists(e.path))return console.log(`ThinoDebug getMemosFromCanvas: file no longer exists`,e.path),t;let r;try{r=await n.vault.read(e)}catch(t){console.error(t),r=await n.vault.cachedRead(e)}if(!r)return;let i=JSON.parse(r)?.nodes;for(let n of i){if(n.type===`group`||n.createdAt===void 0||n.text.trim()===``)continue;let r=(0,f.moment)(n?.createdAt,`YYYYMMDDHHmmss`),i=(0,f.moment)(n?.updatedAt,`YYYYMMDDHHmmss`),a=r.format(`YYYY/MM/DD HH:mm:SS`),o=i.format(`YYYY/MM/DD HH:mm:SS`),s=n?.deletedAt?(0,f.moment)(n?.deletedAt,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,c=!!n?.pinned,l=n?.archived?`ARCHIVED`:`NORMAL`,u=n?.visibility?n?.visibility:`PRIVATE`,d=n?.thinoType?n?.thinoType:`JOURNAL`,p=n?.text?n?.text:``,m=n?.id?n?.id:``,h=n?.hasId?n?.hasId:``,g=n?.linkId?n?.linkId:``,_=e.path,v=[],y=n?.webId?n?.webId:void 0;t.push({id:m,content:p,createdAt:a,updatedAt:o,createdAtTs:r.valueOf(),updatedAtTs:i.valueOf(),deletedAt:s,pinned:c,rowStatus:l,visibility:u,thinoType:d,hasId:h,linkId:g,path:_,creatorName:`Memo`,sourceType:`CANVAS`,resourceList:v,webId:y,fileInfo:{frontmatter:{},tags:[]}})}}async function Ya(e=[]){let t=[],n=[],r=vr.getState().dailyNotesState.app||app,{vault:i}=r,{settings:a}=vr.getState().dailyNotesState,o=r.loadLocalStorage(`tokenForSync`),s=async(e,n)=>{for(let r of e)try{await n(r,t,a)}catch(e){console.error(e),new f.Notice(e)}};try{if(e.includes(`CANVAS`)){let e=Xa(i),n=t.length;Ua.start(`startup:getMemos:CANVAS`),await s(e,Ja),Ua.end(`startup:getMemos:CANVAS`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}try{if(e.includes(`MULTI`)){let e=Za(i,r,a),n=t.length;Ua.start(`startup:getMemos:MULTI`),await s(e,Ga),Ua.end(`startup:getMemos:MULTI`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}try{if(e.includes(`DAILY`)){let e=await Qa(i),n=t.length;Ua.start(`startup:getMemos:DAILY`),await s(e,qa),Ua.end(`startup:getMemos:DAILY`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}try{if(e.includes(`FILE`)||o){let e=$a(i,r,a),n=t.length;Ua.start(`startup:getMemos:FILE`),await s(e,Ka),Ua.end(`startup:getMemos:FILE`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}try{if(e.includes(`JOURNAL`)){let e=eo(i,a),n=t.length;Ua.start(`startup:getMemos:JOURNAL`),await s(e,to),Ua.end(`startup:getMemos:JOURNAL`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}return{memos:t,commentMemos:n}}function Xa(e){return e.getAllLoadedFiles().filter(e=>e instanceof f.TFile&&e.extension===`canvas`&&e.name.includes(`.thino`))}function Za(e,t,n){let r=e.getMarkdownFiles(),i=r.filter(e=>e.parent?.path.includes(n.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim())&&!e.path?.endsWith(`thino.md`)),a=n.TagForMultiTypeFiles?r.filter(e=>!(e.parent?.path.includes(n.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim())&&!e.path?.endsWith(`thino.md`))&&(0,f.getAllTags)(t.metadataCache.getFileCache(e))?.contains(`#`+n.TagForMultiTypeFiles.replace(`#`,``))):[];return console.log(`MULTI FILES`,i,a),[...i,...a]}async function Qa(e){let t=ri();t===void 0&&new f.Notice(j(`Please check your daily note plugin OR periodic notes plugin settings`)+`folder path is empty or undefined`),e.getAbstractFileByPath((0,f.normalizePath)(t))||new f.Notice(j(`Failed to find daily notes folder`));let n=ge();return Object.values(n).filter(e=>e instanceof f.TFile&&e.extension===`md`)}function $a(e,t,n){let r=e.getMarkdownFiles(),i=r.filter(e=>e.name.trim().includes(`thino`)),a=n.TagForFileTypeFiles?r.filter(e=>!e.name.trim().includes(`thino`)&&(0,f.getAllTags)(t.metadataCache.getFileCache(e))?.contains(`#`+n.TagForFileTypeFiles.replace(`#`,``))):[];return[...i,...a]}function eo(e,t){let{getAllPeriodicNotes:n,setThinoPeriodicSettings:r}=(je(),d(w)),i=t?.JournalSettings?.granularity||`day`,a=t?.JournalSettings;if(a?.useIndependentSettings){let e={day:a.daily,week:a.weekly,month:a.monthly,year:a.yearly}[i];e&&(e.folder||e.format||e.template)&&r(i,e)}try{let e=n(i);return Object.values(e).filter(e=>e instanceof f.TFile)}catch(e){return console.error(`Failed to get journal files:`,e),[]}}async function to(e,t){if(!e||!await(vr.getState().dailyNotesState.app||window.app).vault.adapter.exists(e.path))return t;let n=vr.getState().dailyNotesState.settings;return(n?.JournalSettings?.granularity||`day`)===`day`?no(e,t,n):ro(e,t,n)}async function no(e,t,n){let r=[];await qa(e,r);for(let e of r)e.sourceType=`JOURNAL`,t.push(e);return t}async function ro(e,t,n){let{vault:r,metadataCache:i}=vr.getState().dailyNotesState.app||window.app,a;try{a=await r.read(e)}catch{return t}if(!a)return t;let o=i.getFileCache(e),s={frontmatter:o?.frontmatter||{},tags:o?.frontmatter?.tags||[]},c=a.split(/\r?\n/),l=[];for(let e=0;e<c.length;e++){let t=c[e].match(/^##\s+(.+)$/);t&&(l.length>0&&(l[l.length-1].endLine=e-1),l.push({heading:t[1].trim(),startLine:e,endLine:c.length-1}))}let u=/^(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\s|$)/,d=n?.JournalSettings?.headingDateFormat||`YYYY-MM-DD`;for(let n of l){let r=(0,f.moment)(n.heading,d,!1);if(!r.isValid()){let e=n.heading.match(/(\d{4})[/-](\d{1,2})[/-](\d{1,2})/);e&&(r=(0,f.moment)(`${e[1]}-${e[2]}-${e[3]}`,`YYYY-M-D`,!0))}if(!(!r||!r.isValid()))for(let i=n.startLine+1;i<=n.endLine;i++){let a=c[i];if(!a)continue;let o=a.match(/^(\s*)(-|\*|\d+\.)\s+(\[(.)\]\s+)?(.*)/);if(!o||o[1].length>0)continue;let l=o[4],d=o[5]||``,p=r.clone(),m=d,h=d.match(u);h&&(p.hours(parseInt(h[1])).minutes(parseInt(h[2])),h[3]&&p.seconds(parseInt(h[3])),m=d.slice(h[0].length));let g=m,_=``,v=0;for(let e=i+1;e<=n.endLine;e++){let t=c[e];if(t&&/^(-|\*|\d+\.)\s/.test(t)||t&&/^##\s/.test(t))break;if(!t||t.trim()===``){v++;continue}if(!_){let e=t.match(/^(\s+)/);_=e?e[0]:``}for(let e=0;e<v;e++)g+=`
- `;v=0;let n=_?t.replace(RegExp(`^`+_),``):t;g+=`
- `+n}let y=/\[(pinned|PINNED)::true\]/.test(g),b=/\[(archived|ARCHIVED)::true\]/.test(g),x=/\[(deleted|DELETED)::([^\]]*)\]/.test(g),S=/\[(deleted|DELETED)::([^\]]*)\]/.exec(g)?.[2],C=/\[(webId|WEBID)::([^\]]*)\]/.exec(g)?.[2],w=/\[(id|ID)::([^\]]*)\]/.exec(g)?.[2],T=/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/.test(g)?`PUBLIC`:`PRIVATE`,E=g.replace(/\s?\[pinned::[^\]]+\]/g,``).replace(/\s?\[visibility::[^\]]+\]/g,``).replace(/\s?\[archived::[^\]]+\]/g,``).replace(/\s?\[deleted::[^\]]+\]/g,``).replace(/\s?\[webId::[^\]]+\]/g,``).replace(/\s?\[id::[^\]]+\]/g,``).trim(),D=`JOURNAL`;l!==void 0&&(D=l===` `?`TASK-TODO`:l===`x`?`TASK-DONE`:`TASK-${l}`);let O={id:w||p.format(`YYYYMMDDHHmmss`)+`${i}`,content:E,createdAt:p.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:p.format(`YYYY/MM/DD HH:mm:ss`),createdAtTs:p.valueOf(),updatedAtTs:p.valueOf(),deletedAt:x?(0,f.moment)(S,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,thinoType:D,hasId:``,linkId:[],path:e.path,pinned:y,rowStatus:b?`ARCHIVED`:`NORMAL`,visibility:T,creatorName:`Thino`,resourceList:[],sourceType:`JOURNAL`,webId:C,fileInfo:s};N.stampMemoTimestamps(O),t.push(O)}}return t}var io=o((()=>{je(),yr(),M(),li(),ia(),Ba(),Wa()})),ao,oo=o((()=>{yr(),Hi(),ao=async(e,t,n)=>{let r=await zi(vr.getState().dailyNotesState.app)||[],i=r.find(t=>t.id===e),a={...i,title:t,querystring:n},o=r.findIndex(t=>t.id===e);return r[o]=a,await Bi(vr.getState().dailyNotesState.app,r),[i]}}));function so(e){return e.substring(e.lastIndexOf(`.`)+1)}function co(e){return{id:e.id,createdAt:Date.now().toString(),filename:e.id,type:`${so(e.id)}`,size:e.size.toString()}}function lo(e){let t=e?.matchAll(So);return t?Array.from(t).map(e=>co({url:e.groups?.link,id:xo,size:0,mtime:``})).filter(e=>e.type!=`html`):[]}function uo(e){return{id:e.id,createdAt:(0,f.moment)(e.ctime.toString(),`x`).format(`YYYY/MM/DD HH:mm:ss`),updatedAt:(0,f.moment)(e.mtime.toString(),`x`).format(`YYYY/MM/DD HH:mm:ss`),deletedAt:e.ttime?.toString()?(0,f.moment)(e.ttime.toString(),`x`).format(`YYYY-MM-DD HH:mm:ss`):``,rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,resourceList:lo(e.content),creatorName:`thino`,sourceType:e?.thinoType||`FILE`,visibility:`PUBLIC`,localId:e.originalId,deleted:!!e.dtime,thinoType:e?.thinoStatus||`JOURNAL`}}function fo(){return(vr.getState().dailyNotesState.app||app)?.loadLocalStorage(`tokenForSync`)||``}async function po(e){return(0,f.requestUrl)({url:`${bo}/thino/getThinos${e?`?since=${e}&includeDeleted=true`:``}`,method:`GET`,headers:{Authorization:`Bearer ${fo()}`}}).then(e=>{e.status>=400&&console.error(`Failed to fetch memos: ${e.status}`);try{return e.json.payload.map(e=>uo(e))}catch(e){console.error(`Error processing memo response: ${e}`)}}).catch(e=>(console.error(e),[]))}async function mo(e){return(0,f.requestUrl)({url:`${bo}/thino/createThino`,method:`POST`,contentType:`application/json`,body:JSON.stringify({content:e.content,thinoType:e?.thinoType||`FILE`,thinoStatus:e?.thinoStatus||`JOURNAL`,pinned:!1,rowStatus:`NORMAL`,encrypted:!1}),headers:{Authorization:`Bearer ${fo()}`}}).then(e=>{e.status>=400&&console.error(`Failed to create memo: ${e.status}`);try{let t=e.json;return uo(t.payload)}catch(e){console.error(`Error processing memo creation response: ${e}`)}}).catch(e=>(console.error(e),null))}function ho(e){return{id:e.id,ctime:(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).valueOf(),mtime:(0,f.moment)(e.updatedAt,`YYYY/MM/DD HH:mm:ss`).valueOf(),ttime:e.deletedAt?(0,f.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`,thinoStatus:e.thinoType,tags:[]}}async function go(e){let t=`${bo}/thino/createThinosByData`,n=e.map(e=>ho(e));return(0,f.requestUrl)({url:t,method:`POST`,contentType:`application/json`,body:JSON.stringify(n),headers:{Authorization:`Bearer ${fo()}`}}).then(e=>{e.status>=400&&console.error(`Failed to create thinos: ${e.status}`);try{return e.json.payload.map(e=>uo(e))}catch(e){console.error(`Error processing thinos creation response: ${e}`)}}).catch(e=>(console.error(e),[]))}async function _o(e){return(0,f.requestUrl)({url:`${bo}/thino/updateThinoById/${e.id}`,method:`POST`,contentType:`application/json`,body:JSON.stringify(e),headers:{Authorization:`Bearer ${fo()}`}}).then(e=>{e.status>=400&&console.error(`Failed to update memo: ${e.status}`);try{let t=e.json;return uo(t.payload)}catch(e){console.error(`Error processing memo update response: ${e}`)}}).catch(e=>(console.error(e),null))}async function vo(e){return(0,f.requestUrl)({url:`${bo}/thino/recoverThinoFromTrash/${e}`,method:`POST`,headers:{Authorization:`Bearer ${fo()}`}}).then(e=>{e.status>=400&&console.error(`Failed to recover memo: ${e.status}`);try{let t=e.json;return uo(t.payload)}catch(e){console.error(`Error processing memo recovery response: ${e}`)}}).catch(e=>(console.error(e),null))}async function yo(e){return(0,f.requestUrl)({url:`${bo}/thino/deleteThinoById/${e}`,method:`DELETE`,headers:{Authorization:`Bearer ${fo()}`}}).then(e=>{e.status>=400&&console.error(`Failed to delete memo: ${e.status}`)}).catch(e=>(console.error(e),null))}var bo,xo,So,Co=o((()=>{yr(),bo=`https://api.thino.pkmer.cn/test`,xo=`unknown`,So=/!\[(?<content>[^\]]+)\]\((?<link>[^)]+)\)/g}));function wo(){return(Yg(),d(Kg)).default}var To,Eo,Do=o((()=>{Ai(),Co(),To=class{_pollingInterval=null;_pollingActive=!1;isSyncEnabled(){let e=L.getState().settings;return!!(L.getState().app?.loadLocalStorage(`tokenForSync`)&&e?.startSync)}getToken(){return L.getState().app?.loadLocalStorage(`tokenForSync`)||``}getLastUpdatedTime(){let e=L.getState().app;try{return e?.loadLocalStorage?.(`thinoLastUpdated`)||(0,f.moment)(`2000-01-01 00:01:00`,`YYYY-MM-DD HH:mm:ss`).format(`x`)}catch(e){return console.error(e),(0,f.moment)().format(`x`)}}setLastUpdatedTime(){let e=L.getState().app;try{e?.saveLocalStorage?.(`thinoLastUpdated`,(0,f.moment)().format(`x`))}catch(e){console.error(e)}}resetLastUpdatedTime(){let e=L.getState().app;try{e?.saveLocalStorage?.(`thinoLastUpdated`,(0,f.moment)(`2000-01-01 00:01:00`,`YYYY-MM-DD HH:mm:ss`).format(`x`))}catch(e){console.error(e)}}async pullFromWeb(e){if(!this.isSyncEnabled())return;let t=await po(e);if(!t||t.length===0)return;t.sort((e,t)=>(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isAfter((0,f.moment)(t.createdAt,`YYYY/MM/DD HH:mm:ss`))?1:-1);let n=wo(),r=t.filter(e=>!e.deleted),i=t.filter(e=>e.deleted);for(let e of r){let t=await n.createOrPatchThinoFromWeb(e);t&&n.pushMemo(t)}for(let e of i){let t=n.getMemoByWebId(e.id);t&&await n.deleteMemoById(t.id,`local`)}n.updateTagsState(),this.setLastUpdatedTime()}async pushToWeb(){if(!this.isSyncEnabled())return;let e=wo(),t=await go(e.getState().memos.filter(e=>!e.webId));for(let n of t)await e.createOrPatchThinoFromWeb(n)}async syncCreate(e,t,n){if(!this.isSyncEnabled())return null;try{return await mo({content:e,thinoType:t===`DAILY`||t===`JOURNAL`?`DAILY`:`FILE`,thinoStatus:n?`JOURNAL`:`TASK-TODO`})}catch(e){return console.error(e),null}}async syncCreateForWebId(e,t){if(!this.isSyncEnabled())return``;try{return(await mo({content:e,thinoType:`DAILY`,thinoStatus:t?`JOURNAL`:`TASK-TODO`}))?.id||``}catch(e){return console.error(e),``}}async syncEdit(e){if(this.isSyncEnabled()&&e?.webId)try{_o({id:e.webId,content:e.content,rowStatus:e.rowStatus,pinned:e.pinned,ttime:e.deletedAt?(0,f.moment)(e.deletedAt,`YYYY/MM/DD HH:mm:ss`).valueOf():0,thinoType:e.sourceType===`DAILY`||e.sourceType===`JOURNAL`?`DAILY`:`FILE`,thinoStatus:e.thinoType===`JOURNAL`?`JOURNAL`:e.thinoType===`TASK-TODO`?`TASK-TODO`:`TASK-DONE`})}catch(e){console.error(e)}}async syncDelete(e){if(this.isSyncEnabled()&&e)try{await yo(e)}catch(e){console.error(e)}}async syncPin(e,t){if(!this.isSyncEnabled()||!e)return null;try{return await _o({id:e,pinned:t})}catch(e){return console.error(e),null}}async syncRecover(e){if(this.isSyncEnabled()&&e)try{await vo(e)}catch(e){console.error(e)}}startPolling(e){if(this._pollingActive||!this.isSyncEnabled()||L.getState().settings?.SyncManually)return;let t=this.getLastUpdatedTime();this.pullFromWeb(t),this._pollingInterval=window.setInterval(async()=>{console.log(`syncing...`);let e=this.getLastUpdatedTime();await this.pullFromWeb(e)},3e4),e.registerInterval(this._pollingInterval),this._pollingActive=!0}stopPolling(){this._pollingInterval!==null&&(window.clearInterval(this._pollingInterval),this._pollingInterval=null),this._pollingActive=!1}},Eo=new To}));function Oo(e){return e?.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`)||e}function ko(e,t){return e&&e.replace(/\{\{TIME\|(.*?)\}\}/g,(e,n)=>{try{return t.format(n)}catch(t){return console.error(`Invalid time format:`,n,t),e}})}function Ao(e){let t=[],n=e;for(;n.contains(`
- `);){let e=n.indexOf(`
- `);t.push(n.slice(0,e)),n=n.slice(e+1)}return t.push(n),t}async function jo({content:e,isList:t,name:n}){let r=vr.getState().dailyNotesState.settings,i=(0,f.moment)(),a=N.randomId(16),o=r?.MemoOtherSaveLocation.MemoDefaultMultiFilePath||`Thino`,s=`${o}/${n||`${i.format(`YYYYMMDD`)}-${a}`}.md`,c={id:a,content:e,deletedAt:``,path:s,createdAt:i.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:i.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`,fileInfo:{tags:[],frontmatter:{}}},l=L.getState().app||window.app,{vault:u,fileManager:d}=l,p=u.getAbstractFileByPath(o);(!p||!(p instanceof f.TFolder))&&(new f.Notice(j(`Folder not found for the given thino path, is creating a new folder`)),await u.createFolder(o)),R.setChangedByMemos(!0),V.markPathPending(s);let m,h=l.vault.getFileByPath(s);if(h){let t=`${o}/${i.format(`YYYYMMDD`)}-${a}.md`;V.markPathPending(t),m=await u.create(t,e)}else m=await u.create(s,e);await d.processFrontMatter(m,e=>{e.id=a,e.createdAt=i.format(`YYYY/MM/DD HH:mm:ss`),e.updatedAt=i.format(`YYYY/MM/DD HH:mm:ss`),e.thinoType=t?`JOURNAL`:`TASK-TODO`}),(!n||h)&&r?.SetFileNameAfterCreate&&l.fileManager.promptForFileRename(m);let g=l.metadataCache.getFileCache(m),_={tags:g?.frontmatter?.tags||[],frontmatter:g?.frontmatter||{}};return{...c,fileInfo:_}}async function Mo({content:e,isList:t}){let n=vr.getState().dailyNotesState.settings,r=(0,f.moment)(),i=N.randomId(16),a=n?.MemoOtherSaveLocation.MemoDefaultSingleFilePath||`basic.thino.md`,o={id:i,content:e,deletedAt:``,path:a,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`,fileInfo:{tags:[],frontmatter:{}}},s=L.getState().app,{vault:c}=s,l=c.getAbstractFileByPath(a);(!l||!(l instanceof f.TFile))&&(new f.Notice(j(`File not found for the given thino path, is creating a new file`)),l=await c.create(a,``));let u=s.metadataCache.getFileCache(l),d={tags:u?.frontmatter?.tags||[],frontmatter:u?.frontmatter||{}},p=``;try{p=await c.read(l)||await c.cachedRead(l)}catch(e){console.error(e),new f.Notice(j(`Failed to read current daily note, check if it exists.`))}let m=p.indexOf(`# ${r.format(`YYYY-MM-DD`)}`),h=p.indexOf(`
- #`,m+1);h===-1&&(h=p.length);let g=`\n${`> [!thino] ${r.format(`YYYY/MM/DD HH:mm:ss`)} %% [id::${i}] [thinoType::${t?`JOURNAL`:`TASK-TODO`}] %%`}\n> ${e.replace(/\n/g,`
- > `)}\n`,_;if(m===-1){let e=`# ${r.format(`YYYY-MM-DD`)}`;_=`${p.substring(0,h)}\n${e}${g}\n${p.substring(h)}`}else _=`${p.substring(0,h)}${g}${p.substring(h)}`;return setTimeout(async()=>{R.setChangedByMemos(!0),V.markPathPending(l.path),await c.modify(l,_)},200),{...o,fileInfo:d}}async function No(e){let t=vr.getState().dailyNotesState.settings,n=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`),r=e.id,i=t?.MemoOtherSaveLocation.MemoDefaultSingleFilePath||`basic.thino.md`,a={id:r,content:e.content,deletedAt:e.deletedAt||``,path:i,createdAt:n.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:n.format(`YYYY/MM/DD HH:mm:ss`),thinoType:e.thinoType||`JOURNAL`,hasId:``,linkId:[],pinned:e.pinned,visibility:`PUBLIC`,rowStatus:e.rowStatus||`NORMAL`,creatorName:`Thino`,resourceList:[],sourceType:`FILE`,webId:e.id,fileInfo:e?.fileInfo},o=L.getState().app,{vault:s}=o,c=s.getAbstractFileByPath(i);(!c||!(c instanceof f.TFile))&&(new f.Notice(j(`File not found for the given thino path, is creating a new file`)),c=await s.create(i,``));let l=``;try{l=await s.read(c)||await s.cachedRead(c)}catch(e){console.error(e),new f.Notice(j(`Failed to read current daily note, check if it exists.`))}let u=o.metadataCache.getFileCache(c),d={tags:u?.frontmatter?.tags||[],frontmatter:u?.frontmatter||{}},p=l.indexOf(`# ${n.format(`YYYY-MM-DD`)}`),m=l.indexOf(`
- #`,p+1);m===-1&&(m=l.length);let h=`\n${`> [!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}]`:``} %%`}\n> ${e.content.replace(/\n/g,`
- > `)}\n`,g;if(p===-1){let e=`# ${n.format(`YYYY-MM-DD`)}`;g=`${l.substring(0,m)}\n${e}${h}\n${l.substring(m)}`}else g=`${l.substring(0,m)}${h}${l.substring(m)}`;return R.setChangedByMemos(!0),V.markPathPending(c.path),await s.modify(c,g),{...a,fileInfo:d}}async function Po({content:e,isList:t}){let n=vr.getState().dailyNotesState.settings?.MemoOtherSaveLocation.MemoDefaultCanvasPath||`basic.thino.canvas`,r=(0,f.moment)(),i=N.randomId(16),a={id:i,content:e,deletedAt:``,path:n,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:`CANVAS`,fileInfo:{tags:[],frontmatter:{}}},o=L.getState().app,{vault:s}=o,c=await ta(n,o);if(!c||!(c instanceof f.TFile)){new f.Notice(j(`File not found for the given thino path, is creating a new file`));return}let l=await s.read(c),u=JSON.parse(l);if(u.nodes.find(e=>e.id===a.id))return;let d;u.nodes.length>0&&(d=[...u.nodes].reduce((e,t)=>{if(!e.createdAt)return t;let n=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`),r=(0,f.moment)(t.createdAt,`YYYY/MM/DD HH:mm:ss`);return n.isAfter(r)?e:t}));let p=d?{x:d.x,y:d.y+100,width:d.width,height:d.height}:{x:0,y:0,width:200,height:100};u.nodes.push({...p,type:`text`,id:i,text:e,deletedAt:``,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:[]}),R.setChangedByMemos(!0),V.markPathPending(c.path);let m=JSON.stringify(u,null,2);return await s.modify(c,m),a}async function Fo(e,t,n,r){let{vault:i}=vr.getState().dailyNotesState.app||window.app,a=vr.getState().dailyNotesState.app||window.app,o=vr.getState().dailyNotesState.settings,s=a.vault.getConfig(`useTab`)===void 0||window.app.vault.getConfig(`useTab`)===!0,c=s?1:a.vault.getConfig(`tabSize`),l=(s?` `:` `).repeat(c),u=e.split(`
- `).join(`
- `+l),d=n||(0,f.moment)(),{DifferentInsertTarget:p,InsertAfterForTask:m,InsertType:h}=o,g=d.format(o.DefaultTimePrefix||`HH:mm`),_=``,v=``;o.UseMemoFixedStrings&&(_=ko(o.MemoFixedPrefix||``,d),v=ko(o.MemoFixedSuffix||``,d));let y=h===`end`?``:t?o.InsertAfter:p&&m||o.InsertAfter,b=``;!r&&e&&(b=await Eo.syncCreateForWebId(e,t));let x=_?_+(_.endsWith(` `)?``:` `)+u:u,S=v?x+(x.endsWith(` `)?``:` `)+v:x,C=t?`- `:`- [ ] `,w=o?.DefaultMemoComposition?`${C}${o?.DefaultMemoComposition?.replace(/{TIME}/g,g).replace(/{CONTENT}/g,(S.split(`
- `).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(S)?`
- `+l:``)+S)}${S.split(`
- `).length>1&&/((-|\*|\d\.|>)\s|```)/g.test(S.split(`
- `)[S.split(`
- `).length-1])&&b?`
- `+l:` `}${b?`[webId::${b}]`:``}`:`${C}${g} ${S.split(`
- `).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(S)?`
- `+l:``}${S}${S.split(`
- `).length>1&&/((-|\*|\d\.|>)\s|```)/g.test(S.split(`
- `)[S.split(`
- `).length-1])&&b?`
- `+l:` `}${b?`[webId::${b}]`:``}`,T=ve(d,ge()),E=performance.now(),D=`fake`+N.randomId(16),O=!1,k=a.plugins.getPlugin(`templater-obsidian`),ee;if(T?(ee=T,console.log(`[Thino:Perf] daily note exists +${(performance.now()-E).toFixed(1)}ms`)):(k?.templater&&k?.settings.trigger_on_file_creation&&(V.setWaitingForTemplater({origin:e,date:d,isList:t,id:D,type:b?`web`:`local`}),O=!0),R.setChangedByMemos(!0),ee=await N.createDailyNoteCheck(d),V.markPathPending(ee.path),console.log(`[Thino:Perf] daily note created +${(performance.now()-E).toFixed(1)}ms`)),!ee){new f.Notice(j(`Failed to create daily note, check if it exists.`));return}if(T||(await L.fechLocalDailyNotes(),console.log(`[Thino:Perf] fechLocalDailyNotes done +${(performance.now()-E).toFixed(1)}ms`)),k&&k?.templater&&k?.settings.trigger_on_file_creation&&O)return R.setChangedByMemos(!0),{id:D,content:S,deletedAt:``,createdAt:d.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:d.format(`YYYY/MM/DD HH:mm:ss`),thinoType:t?`JOURNAL`:`TASK-TODO`,path:ee.path,hasId:``,linkId:[],webId:b,pinned:!1,visibility:`PUBLIC`,rowStatus:`NORMAL`,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,fileInfo:{tags:[],frontmatter:{}}};let A=``;try{A=await i.read(ee)||await i.cachedRead(ee)}catch(e){console.error(e),new f.Notice(j(`Failed to read current daily note, check if it exists.`))}let te=a.metadataCache.getFileCache(ee),ne={tags:te?.frontmatter?.tags||[],frontmatter:te?.frontmatter||{}},re=await Lo(y,w,A);console.log(`[Thino:Perf] insertAfterHandler done +${(performance.now()-E).toFixed(1)}ms`),await i.modify(ee,re.content),console.log(`[Thino:Perf] vault.modify done +${(performance.now()-E).toFixed(1)}ms`);let ie=re.posNum===-1?Uo(re.content).length-(w.split(`
- `).length-1)-1:re.posNum+1;return R.setChangedByMemos(!0),console.log(`[Thino:Perf] createMemoInDailyNote return +${(performance.now()-E).toFixed(1)}ms`),{id:d.format(`YYYYMMDDHHmm`)+`00`+ie,content:S,deletedAt:``,createdAt:d.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:d.format(`YYYY/MM/DD HH:mm:ss`),thinoType:t?`JOURNAL`:`TASK-TODO`,path:ee.path,hasId:``,linkId:[],webId:b,pinned:!1,visibility:`PUBLIC`,rowStatus:`NORMAL`,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,fileInfo:ne}}async function Io(e){let{vault:t}=vr.getState().dailyNotesState.app||window.app,n=vr.getState().dailyNotesState.app||window.app,{DefaultMemoComposition:r,InsertAfter:i,DefaultTimePrefix:a,DifferentInsertTarget:o,InsertAfterForTask:s,InsertType:c,UseMemoFixedStrings:l,MemoFixedPrefix:u,MemoFixedSuffix:d}=vr.getState().dailyNotesState.settings,p=(e.pinned?` [pinned::true]`:``)+(e.rowStatus===`ARCHIVED`?` [archived::true]`:``)+(e.visibility===`PRIVATE`?` [visibility::"PRIVATE"]`:``);if(e.id){let t=` [webId::`+e.id+`]`;p+=t}let m=(0,f.moment)();if(e.deletedAt){let e=` [deleted::`+m.format(`YYYYMMDDHHmmss`)+`]`;p+=e}let h=n.vault.getConfig(`useTab`)===void 0||n.vault.getConfig(`useTab`)===!0,g=h?1:n.vault.getConfig(`tabSize`),_=(h?` `:` `).repeat(g),v=e.content.split(`
- `).join(`
- `+_),y=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`),b=``,x=``;l&&(b=ko(u||``,y),x=ko(d||``,y));let S=b?b+(b.endsWith(` `)?``:` `)+v:v,C=x?S+(S.endsWith(` `)?``:` `)+x:S,w=y.format(a||`HH:mm`),T=!e.thinoType||e.thinoType===`JOURNAL`?`- `:e.thinoType===`TASK-TODO`?`- [ ] `:`- [x] `,E=r?`${T}${r?.replace(/{TIME}/g,w).replace(/{CONTENT}/g,(C.split(`
- `).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(C)?`
- `+_:``)+C)}${C.split(`
- `).length>1&&/```/g.test(C.split(`
- `)[C.split(`
- `).length-1])&&p.trim()?`
- `+_:` `}${p}`:`${T}${w} ${C.split(`
- `).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(C)?`
- `+_:``}${C}${C.split(`
- `).length>1&&/```/g.test(C.split(`
- `)[C.split(`
- `).length-1])&&p.trim()?`
- `+_:` `}${p}`,D=ve(y,ge()),O=`fake`+N.randomId(16),k=!1,ee=n.plugins.getPlugin(`templater-obsidian`),A;if(D?A=D:(ee?.templater&&ee?.settings.trigger_on_file_creation&&(V.setWaitingForTemplater({origin:e.content,date:y,isList:e.thinoType&&e.thinoType===`JOURNAL`,id:O,type:`local`}),k=!0),R.setChangedByMemos(!0),A=await N.createDailyNoteCheck(y),V.markPathPending(A.path)),!A){new f.Notice(j(`Failed to create daily note, check if it exists.`)),new f.Notice(j(`Your content has been copied to clipboard, and inserted into the editor. Please try it again`)),await navigator.clipboard.writeText(e.content);let t=n.workspace.getLeavesOfType(`thino_view`).first();n.workspace.trigger(`send-to-thino`,e.content,t);return}if(D||await L.fechLocalDailyNotes(),ee&&ee?.templater&&ee?.settings.trigger_on_file_creation&&k)return R.setChangedByMemos(!0),{id:O,content:e.content,deletedAt:e.deletedAt??``,createdAt:y.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:y.format(`YYYY/MM/DD HH:mm:ss`),thinoType:e.thinoType||`JOURNAL`,path:A.path,hasId:``,linkId:[],pinned:e.pinned??!1,visibility:`PUBLIC`,rowStatus:e.rowStatus??`NORMAL`,webId:e.webId||e.id,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,fileInfo:e?.fileInfo||{tags:[],frontmatter:{}}};let te=n.metadataCache.getFileCache(A),ne={tags:te?.frontmatter?.tags||[],frontmatter:te?.frontmatter||{}},re=``;try{re=await t.read(A)||await t.cachedRead(A)}catch(e){console.error(e),new f.Notice(j(`Failed to read current daily note, check if it exists.`))}let ie=await Lo(c===`end`?``:e.thinoType&&o&&s||i,E,re);await t.modify(A,ie.content);let ae=ie.posNum===-1?Uo(ie.content).length-1:ie.posNum+1;return R.setChangedByMemos(!0),{id:y.format(`YYYYMMDDHHmm`)+`00`+ae,content:e.content,deletedAt:e.deletedAt??``,createdAt:y.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:y.format(`YYYY/MM/DD HH:mm:ss`),thinoType:e.thinoType||`JOURNAL`,path:A.path,hasId:``,linkId:[],pinned:e.pinned??!1,visibility:`PUBLIC`,rowStatus:e.rowStatus??`NORMAL`,webId:e.id,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,fileInfo:ne}}async function Lo(e,t,n){let r=RegExp(`(\s*?)${await Oo(e)}(\s*?)`),i=Ao(n),a=i.findIndex(e=>r.test(e)),o=e?.trim()===``?!0:a===-1;o&&console.info(`unable to find insert after line in file.`);let s=i.slice(a+1).findIndex(e=>/(^#+ |---|^\^[a-zA-Z0-9-]{2,}$)/.test(e)),c=s!==-1;if(c){let e;for(let t=s+a;t>a;t--)if(!/^[\s\n ]*$/.test(i[t])){e=t;break}return e||=a,await Ro(t,n,o?-1:e,c)}else return await Ro(t,n,i.length-1,c)}async function Ro(e,t,n,r){if(n<-1)throw Error(`Invalid position`);if(n===-1)return{content:`${t}\n${e}`,posNum:-1};let i=t.split(`
- `),a=i.slice(0,n+1).join(`
- `),o=i.slice(n+1).join(`
- `),s=o.trim().length>0;return{content:`${a}${!s&&!r||!a.endsWith(`
- `)?`
- `:``}${e}${(s||r?`
- `:``)+o}`,posNum:n}}function zo(e,t,n){let r=n||Wo[t]||`YYYY-MM-DD`;return`## ${e.format(r)}`}function Bo(e,t){let n=e.findIndex(e=>e.trim()===t);if(n===-1){let t=e.length;for(;t>0&&e[t-1].trim()===``;)t--;return{insertIndex:t,needsNewHeading:!0}}let r=e.length;for(let t=n+1;t<e.length;t++)if(/^##\s/.test(e[t])){r=t;break}let i=r;for(;i>n+1&&e[i-1].trim()===``;)i--;return{insertIndex:i,needsNewHeading:!1}}function Vo(e,t){let n=e?.JournalSettings;if(!n?.useIndependentSettings)return;let r={day:n.daily,week:n.weekly,month:n.monthly,year:n.yearly}[t];r&&(r.folder||r.format||r.template)&&T(t,r)}async function Ho({content:e,isList:t}){let n=vr.getState().dailyNotesState.settings,r=L.getState().app,{vault:i}=r,a=(0,f.moment)(),o=n?.JournalSettings?.granularity||`day`;Vo(n,o);let s=ye(a,_e(o),o);if(!s)try{R.setChangedByMemos(!0),s=await xe(a,o),V.markPathPending(s.path)}catch(e){console.error(e),new f.Notice(j(`Failed to create daily note, check if it exists.`));return}let c=r.metadataCache.getFileCache(s),l={tags:c?.frontmatter?.tags||[],frontmatter:c?.frontmatter||{}},u=``;try{u=await i.read(s)||await i.cachedRead(s)}catch(e){console.error(e),new f.Notice(j(`Failed to read current daily note, check if it exists.`))}let d=r.vault.getConfig(`useTab`)===void 0||r.vault.getConfig(`useTab`)===!0,p=d?1:r.vault.getConfig(`tabSize`),m=(d?` `:` `).repeat(p),h=e.split(`
- `).join(`
- `+m),g=a.format(n?.DefaultTimePrefix||`HH:mm`),_=``,v=``;n?.UseMemoFixedStrings&&(_=ko(n.MemoFixedPrefix||``,a),v=ko(n.MemoFixedSuffix||``,a));let y=_?_+(_.endsWith(` `)?``:` `)+h:h,b=v?y+(y.endsWith(` `)?``:` `)+v:y,x=t?`- `:`- [ ] `,S=b.split(`
- `).length>1,C=/^((-|\*|\d\.|>)\s|```)/g.test(b),w=n?.DefaultMemoComposition?`${x}${n.DefaultMemoComposition.replace(/{TIME}/g,g).replace(/{CONTENT}/g,(S||C?`
- `+m:``)+b)}`:`${x}${g} ${S||C?`
- `+m:``}${b}`,T,E;if(o===`day`){let e=await Lo(n?.InsertType===`end`?``:n?.InsertAfter||``,w,u);T=e.content,E=e.posNum===-1?Uo(T).length-1:e.posNum+1}else{let e=zo(a,`day`,n?.JournalSettings?.headingDateFormat||``),t=u.split(/\r?\n/),{insertIndex:r,needsNewHeading:i}=Bo(t,e);if(i){let n=u.trim()?[``,e,``,w]:[e,``,w];t.splice(r,0,...n)}else t.splice(r,0,w);T=t.join(`
- `),E=r+(i?3:0)}return setTimeout(async()=>{R.setChangedByMemos(!0),V.markPathPending(s.path),await i.modify(s,T)},200),{id:a.format(`YYYYMMDDHHmm`)+`00`+E,content:b,deletedAt:``,path:s.path,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:`JOURNAL`,fileInfo:l}}var Uo,Wo,Go=o((()=>{je(),yr(),H(),li(),ia(),M(),Do(),Uo=e=>e.split(/\r?\n/),Wo={day:Se,week:Ce,month:we,year:Ee}}));async function Ko(e){let t=vr.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof f.TFile)){new f.Notice(j(`File not found for the given thino path`));return}await t.vault.delete(n)}async function qo(e){let t=vr.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof f.TFile)){new f.Notice(j(`File not found for the given thino path`));return}let r=(await t.vault.read(n)).split(`
- `),i=r.findIndex(t=>t.includes(e.id));if(i===-1){new f.Notice(j(`Thino not found`));return}let a=r.findIndex((e,t)=>t>i&&e.trim()===``);a===-1?r.splice(i,r.length-i):r.splice(i,a-i);let o=r.join(`
- `);if(!o){new f.Notice(j(`Thino not found`));return}V.markPathPending(n.path),R.setChangedByMemos(!0),await t.vault.modify(n,o)}async function Jo(e){let t=vr.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest(``,e.path);if(!n){new f.Notice(j(`File not found for the given thino path`));return}let r=await t.vault.read(n),i=JSON.parse(r),a=i.nodes,o=a.findIndex(t=>t.id===e.id);if(o===-1){new f.Notice(j(`Thino not found`));return}a.splice(o,1);let s=i.edges;s.filter(t=>t.fromNode===e.id||t.toNode===e.id).forEach(e=>{let t=s.findIndex(t=>t.id===e.id);t!==-1&&s.splice(t,1)}),V.markPathPending(n.path),R.setChangedByMemos(!0);let c=JSON.stringify(i,null,2);await t.vault.modify(n,c)}async function Yo(e){Ra()||new f.Notice(j(`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);let{vault:t}=vr.getState().dailyNotesState.app,n=e.path,r=t.getAbstractFileByPath(n);if(!r){new f.Notice(j(`Please check your daily note plugin OR periodic notes plugin settings`));return}let i=await t.read(r);if(!i){new f.Notice(j(`Thino not found`));return}let a=i.split(`
- `),o=await sa(r),s=parseInt(e.id.slice(14)),c=o.find(e=>e.position?.start.line===s);if(!c&&e.content&&(console.log(`[delete] Memo not found at line ${s}, searching by content...`),c=await la(o,a,e.content,e.id)),!c&&e.hasId&&(c=o.find(t=>t.position?a.slice(t.position.start.line,t.position.end.line+1).join(`
- `).includes(`^${e.hasId}`):!1)),!c){console.error(`[delete] Memo ${e.id} not found in ${e.path} after all strategies`),new f.Notice(j(`Thino not found`));return}let l=c.position.start.line;l!==s&&console.log(`[delete] Memo location corrected: ${s} → ${l}`);let u=c.position.end.line;function d(e,t){let n=[];for(let r in t)if(t[r]===e){let e=parseInt(r);n.push(e,...d(e,t))}return n}let p=d(l,$i(o));if(p.length>0){let e=p.map(e=>{let t=o.find(t=>t.position?.start.line===e);return t?t.position.end.line:-1});u=Math.max(u,...e)}let m=o.find(e=>e.position?.start.line>l&&!p.includes(e.position.start.line));m&&(u=Math.min(u,m.position.start.line-1)),u=Math.min(u,a.length-1),V.markPathPending(r.path),R.setChangedByMemos(!0),a.splice(l,u-l+1),await t.modify(r,a.join(`
- `))}async function Xo(){let{vault:e,metadataCache:t}=vr.getState().dailyNotesState.app,n=vr.getState().dailyNotesState.settings,r=ri()+`/`+n.DeleteFileName+`.md`,i=[],a=t.getFirstLinkpathDest(``,r);if(a instanceof f.TFile){let t=await e.read(a),n=Qo(t);if(n.length===0)return i;for(let e=0;e<n.length;e++){let t=n[e];if(/- /.test(t)){let r=(0,f.moment)($o(t).slice(0,13),`YYYYMMDDHHmmss`),a=ts(n[e]),o=(0,f.moment)(a.slice(0,13),`YYYYMMDDHHmmss`),s=es(n[e]);i.push({id:a,content:s,user_id:1,createdAt:r.format(`YYYY/MM/DD HH:mm:SS`),updatedAt:r.format(`YYYY/MM/DD HH:mm:SS`),deletedAt:o})}else continue}n=null,t=null}return i}async function Zo(e){return Yo({...e,sourceType:`DAILY`})}var Qo,$o,es,ts,ns=o((()=>{yr(),je(),Go(),li(),M(),H(),Ba(),ia(),ca(),Sa(),Qo=e=>e.split(/\r?\n/),$o=e=>/^- (\d{14})(\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e)?.[1],es=e=>/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e)?.[2],ts=e=>/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e)?.[4]}));async function rs(e){let t=await zi(vr.getState().dailyNotesState.app)||[],n=t.findIndex(t=>t.id===e);t.splice(n,1),await Bi(vr.getState().dailyNotesState.app,t)}var is=o((()=>{yr(),Hi()})),as,os,ss=o((()=>{yr(),Hi(),M(),as=async e=>{let{app:t}=vr.getState().dailyNotesState,n=await zi(t)||[],r=n.find(t=>t.id===e);if(r){let e=(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`);return r.pinnedAt=e,await Bi(t,n),e}else{new f.Notice(j(`Query not found`));return}},os=async e=>{let{app:t}=vr.getState().dailyNotesState,n=await zi(t)||[],r=n.find(t=>t.id===e);if(r){r.pinnedAt=``,await Bi(t,n);return}else{new f.Notice(j(`Query not found`));return}}})),cs,ls,us=o((()=>{Wi(),qi(),io(),oo(),ns(),is(),ss(),Sa(),H(),(function(e){async function t(e){return await Ya(e)}e.getMyMemos=t;async function n(e){return await Ya([e])}e.updateSpecificTypeMemo=n;function r(){return Xo()}e.getMyDeletedMemos=r;function i(e){let t=V.getMemoById(e);if(t)switch(t?.sourceType){case`DAILY`:return _a(t,{id:t.id,deleted:!1});case`CANVAS`:return ha(t,{id:t.id,deleted:!1});case`MULTI`:return pa(t,{id:t.id,deleted:!1});case`FILE`:return ma(t,{id:t.id,deleted:!1});case`JOURNAL`:return ya(t,{id:t.id,deleted:!1})}}e.restoreMemo=i;function a(e){return Zo(e)}e.deleteMemoInJournalFile=a;function o(e){return qo(e)}e.deleteMemoInSingleFile=o;function s(e){return Ko(e)}e.deleteMemoInMultiFiles=s;function c(e){return Yo(e)}e.deleteMemoInDailyNote=c;function l(e){return Jo(e)}e.deleteMemoInCanvas=l;function u(){return Ui()}e.getMyQueries=u;async function d(e,t){return await Ki(e,t)}e.createQuery=d;function f(e,t,n){return ao(e,t,n)}e.updateQuery=f;function p(e){return rs(e)}e.deleteQueryById=p;function m(e){return as(e)}e.pinQuery=m;function h(e){return os(e)}e.unpinQuery=h})(cs||={}),ls=cs}));function ds(e,t,n){let r=t.workspace.getLeavesOfType(`markdown`);for(let i of r)if(i.view?.file?.path===e){t.workspace.revealLeaf(i);try{return i.view.setEphemeralState({line:n}),!0}catch(e){return console.error(e),!1}}return!1}var fs,ps,ms,hs,gs=o((()=>{Ai(),M(),fs=async e=>{let t=L.getState().app,n=t.workspace.getLeavesOfType(`markdown`);for(let r of n)if(r.view?.file?.path===e){t.workspace.revealLeaf(r);return}let r=t.metadataCache.getFirstLinkpathDest(``,e);if(!r){new f.Notice(j(`File not found for the given thino path`));return}await t.workspace.getLeaf(!0).openFile(r)},ps=async(e,t)=>{let{app:n}=L.getState(),r=parseInt(e.slice(14));if(ds(t,n,r))return;let i=n.metadataCache.getFirstLinkpathDest(``,t);if(!f.Platform.isMobile)await n.workspace.getLeaf(!0).openFile(i,{eState:{line:r}});else{let e=n.workspace.activeLeaf;e===null&&(e=n.workspace.getLeaf(!0)),await e.openFile(i,{eState:{line:r}})}},ms=async(e,t)=>{let n=L.getState().app,r=n.metadataCache.getFirstLinkpathDest(``,t);if(!r){new f.Notice(j(`File not found for the given thino path`));return}let i=``;try{i=await n.vault.read(r)}catch(e){console.error(e),i=await n.vault.cachedRead(r)}let a=i.split(/\r?\n/).findIndex(t=>t.contains(e)),o=n.workspace.getLeavesOfType(`markdown`);for(let e of o)if(e.view?.file?.path===r.path){n.workspace.revealLeaf(e);try{e.view.editor?.setCursor({line:a,ch:1});return}catch(e){console.error(e)}}let s=n.workspace.getLeaf(!0);await s.openFile(r,{eState:{line:a}});try{s.view.editor?.setCursor({line:a,ch:1})}catch(e){console.error(e)}},hs=async(e,t)=>{let n=L.getState().app,r=(e,t)=>{console.log(Array.from(e.nodes));let n=Array.from(e.nodes.values())?.find(e=>e.id===t);return n?(e.selectOnly(n),e.zoomToSelection(),!0):!1},i=n.workspace.getLeavesOfType(`canvas`);for(let a of i){let i=a.view;if(i?.file?.path===t&&(n.workspace.revealLeaf(a),r(i.canvas,e)))return}let a=n.metadataCache.getFirstLinkpathDest(``,t);if(!a){new f.Notice(j(`File not found for the given thino path`));return}let o=n.workspace.getLeaf(!0);await o.openFile(a),setTimeout(()=>{r(o.view?.canvas,e)},10)}}));function _s(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e==`object`&&t===`[object Date]`?new e.constructor(+e):typeof e==`number`||t===`[object Number]`||typeof e==`string`||t===`[object String]`?new Date(e):new Date(NaN)}var vs=o((()=>{}));function ys(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}var bs=o((()=>{}));function xs(e,t){let n=_s(e);return isNaN(t)?ys(e,NaN):(t&&n.setDate(n.getDate()+t),n)}var Ss=o((()=>{vs(),bs()}));function Cs(e,t){let n=_s(e);if(isNaN(t))return ys(e,NaN);if(!t)return n;let r=n.getDate(),i=ys(e,n.getTime());return i.setMonth(n.getMonth()+t+1,0),r>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}var ws=o((()=>{vs(),bs()})),Ts=o((()=>{})),Es=o((()=>{})),Ds=o((()=>{})),Os=o((()=>{})),ks=o((()=>{})),As=o((()=>{})),js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs=o((()=>{js=365.2425,Ms=6048e5,Ns=864e5,Ps=6e4,Fs=36e5,Is=1e3,Ls=3600,Rs=Ls*24,Rs*7,zs=Rs*js,Bs=zs/12,Bs*3})),Hs=o((()=>{}));function Us(){return Ws}var Ws,Gs=o((()=>{Ws={}}));function Ks(e,t){let n=Us(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=_s(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}var qs=o((()=>{vs(),Gs()}));function Js(e){return Ks(e,{weekStartsOn:1})}var Ys=o((()=>{qs()}));function Xs(e){let t=_s(e),n=t.getFullYear(),r=ys(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let i=Js(r),a=ys(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);let o=Js(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}var Zs=o((()=>{bs(),Ys(),vs()}));function Qs(e){let t=_s(e);return t.setHours(0,0,0,0),t}var $s=o((()=>{vs()}));function ec(e){let t=_s(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}var tc=o((()=>{vs()}));function nc(e,t){let n=Qs(e),r=Qs(t),i=+n-ec(n),a=+r-ec(r);return Math.round((i-a)/Ns)}var rc=o((()=>{Vs(),$s(),tc()}));function ic(e){let t=Xs(e),n=ys(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Js(n)}var ac=o((()=>{Zs(),Ys(),bs()})),oc=o((()=>{})),sc=o((()=>{})),cc=o((()=>{})),lc=o((()=>{})),uc=o((()=>{})),dc=o((()=>{}));function fc(e,t){return Cs(e,t*12)}var pc=o((()=>{ws()})),mc=o((()=>{})),hc=o((()=>{})),gc=o((()=>{})),_c=o((()=>{})),vc=o((()=>{})),yc=o((()=>{})),bc=o((()=>{})),xc=o((()=>{})),Sc=o((()=>{})),Cc=o((()=>{})),wc=o((()=>{}));function Tc(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}var Ec=o((()=>{}));function Dc(e){if(!Tc(e)&&typeof e!=`number`)return!1;let t=_s(e);return!isNaN(Number(t))}var Oc=o((()=>{Ec(),vs()})),kc=o((()=>{})),Ac=o((()=>{})),jc=o((()=>{})),Mc=o((()=>{})),Nc=o((()=>{})),Pc=o((()=>{})),Fc=o((()=>{})),Ic=o((()=>{}));function Lc(e,t){let n=_s(e),r=_s(t),i=Rc(n,r),a=Math.abs(nc(n,r));n.setDate(n.getDate()-i*a);let o=i*(a-Number(Rc(n,r)===-i));return o===0?0:o}function Rc(e,t){let n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}var zc=o((()=>{rc(),vs()})),Bc=o((()=>{})),Vc=o((()=>{})),Hc=o((()=>{})),Uc=o((()=>{})),Wc=o((()=>{}));function Gc(e){let t=_s(e);return t.setHours(23,59,59,999),t}var Kc=o((()=>{vs()}));function qc(e){let t=_s(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}var Jc=o((()=>{vs()})),Yc=o((()=>{})),Xc=o((()=>{})),Zc=o((()=>{})),Qc=o((()=>{})),$c=o((()=>{})),el=o((()=>{})),tl=o((()=>{})),nl=o((()=>{})),rl=o((()=>{})),il=o((()=>{})),al=o((()=>{})),ol=o((()=>{})),sl=o((()=>{})),cl=o((()=>{})),ll=o((()=>{}));function ul(e){let t=_s(e);return t.setDate(1),t.setHours(0,0,0,0),t}var dl=o((()=>{vs()})),fl=o((()=>{}));function pl(e){let t=_s(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}var ml=o((()=>{vs()}));function hl(e){let t=_s(e),n=ys(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}var gl=o((()=>{vs(),bs()})),_l=o((()=>{})),vl=o((()=>{})),yl=o((()=>{})),bl=o((()=>{}));function xl(e,t){let n=Us(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=_s(e),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}var Sl=o((()=>{vs(),Gs()})),Cl=o((()=>{})),wl=o((()=>{})),Tl=o((()=>{})),El=o((()=>{})),Dl=o((()=>{})),Ol=o((()=>{})),kl=o((()=>{})),Al=o((()=>{})),jl,Ml,Nl=o((()=>{jl={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},Ml=(e,t,n)=>{let r,i=jl[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r}}));function Pl(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Fl=o((()=>{})),Il,Ll,Rl,zl,Bl=o((()=>{Fl(),Il={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},Ll={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},Rl={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},zl={date:Pl({formats:Il,defaultWidth:`full`}),time:Pl({formats:Ll,defaultWidth:`full`}),dateTime:Pl({formats:Rl,defaultWidth:`full`})}})),Vl,Hl,Ul=o((()=>{Vl={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Hl=(e,t,n,r)=>Vl[e]}));function Wl(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Gl=o((()=>{})),Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu=o((()=>{Gl(),Kl={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},ql={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},Jl={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},Yl={narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},Xl={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},Zl={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},Ql=(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},$l={ordinalNumber:Ql,era:Wl({values:Kl,defaultWidth:`wide`}),quarter:Wl({values:ql,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Wl({values:Jl,defaultWidth:`wide`}),day:Wl({values:Yl,defaultWidth:`wide`}),dayPeriod:Wl({values:Xl,defaultWidth:`wide`,formattingValues:Zl,defaultFormattingWidth:`wide`})}}));function tu(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?ru(s,e=>e.test(o)):nu(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function nu(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ru(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}var iu=o((()=>{}));function au(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var ou=o((()=>{})),su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu=o((()=>{iu(),ou(),su=/^(\d+)(th|st|nd|rd)?/i,cu=/\d+/i,lu={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},uu={any:[/^b/i,/^(a|c)/i]},du={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fu={any:[/1/i,/2/i,/3/i,/4/i]},pu={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},mu={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},hu={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},gu={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},_u={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},vu={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yu={ordinalNumber:au({matchPattern:su,parsePattern:cu,valueCallback:e=>parseInt(e,10)}),era:tu({matchPatterns:lu,defaultMatchWidth:`wide`,parsePatterns:uu,defaultParseWidth:`any`}),quarter:tu({matchPatterns:du,defaultMatchWidth:`wide`,parsePatterns:fu,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:tu({matchPatterns:pu,defaultMatchWidth:`wide`,parsePatterns:mu,defaultParseWidth:`any`}),day:tu({matchPatterns:hu,defaultMatchWidth:`wide`,parsePatterns:gu,defaultParseWidth:`any`}),dayPeriod:tu({matchPatterns:_u,defaultMatchWidth:`any`,parsePatterns:vu,defaultParseWidth:`any`})}})),xu,Su=o((()=>{Nl(),Bl(),Ul(),eu(),bu(),xu={code:`en-US`,formatDistance:Ml,formatLong:zl,formatRelative:Hl,localize:$l,match:yu,options:{weekStartsOn:0,firstWeekContainsDate:1}}})),Cu=o((()=>{Su()}));function wu(e){let t=_s(e);return nc(t,hl(t))+1}var Tu=o((()=>{rc(),gl(),vs()}));function Eu(e){let t=_s(e),n=Js(t)-+ic(t);return Math.round(n/Ms)+1}var Du=o((()=>{Vs(),Ys(),ac(),vs()}));function Ou(e,t){let n=_s(e),r=n.getFullYear(),i=Us(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=ys(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=Ks(o,t),c=ys(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=Ks(c,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}var ku=o((()=>{bs(),qs(),vs(),Gs()}));function Au(e,t){let n=Us(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ou(e,t),a=ys(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Ks(a,t)}var ju=o((()=>{bs(),ku(),qs(),Gs()}));function Mu(e,t){let n=_s(e),r=Ks(n,t)-+Au(n,t);return Math.round(r/Ms)+1}var Nu=o((()=>{Vs(),qs(),ju(),vs()}));function Pu(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var Fu=o((()=>{})),Iu,Lu=o((()=>{Fu(),Iu={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Pu(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Pu(n+1,2)},d(e,t){return Pu(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return Pu(e.getHours()%12||12,t.length)},H(e,t){return Pu(e.getHours(),t.length)},m(e,t){return Pu(e.getMinutes(),t.length)},s(e,t){return Pu(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Pu(Math.trunc(r*10**(n-3)),t.length)}}}));function Ru(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Pu(a,2)}function zu(e,t){return e%60==0?(e>0?`-`:`+`)+Pu(Math.abs(e)/60,2):Bu(e,t)}function Bu(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Pu(Math.trunc(r/60),2),a=Pu(r%60,2);return n+i+t+a}var Vu,Hu,Uu=o((()=>{Tu(),Du(),Zs(),Nu(),ku(),Fu(),Lu(),Vu={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},Hu={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return Iu.y(e,t)},Y:function(e,t,n,r){let i=Ou(e,r),a=i>0?i:1-i;return t===`YY`?Pu(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Pu(a,t.length)},R:function(e,t){return Pu(Xs(e),t.length)},u:function(e,t){return Pu(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return Pu(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return Pu(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return Iu.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return Pu(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=Mu(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Pu(i,t.length)},I:function(e,t,n){let r=Eu(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Pu(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Iu.d(e,t)},D:function(e,t,n){let r=wu(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Pu(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return Pu(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return Pu(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return Pu(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?Vu.noon:r===0?Vu.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?Vu.evening:r>=12?Vu.afternoon:r>=4?Vu.morning:Vu.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return Iu.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Iu.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Pu(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Pu(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Iu.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Iu.s(e,t)},S:function(e,t){return Iu.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return zu(r);case`XXXX`:case`XX`:return Bu(r);default:return Bu(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return zu(r);case`xxxx`:case`xx`:return Bu(r);default:return Bu(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Ru(r,`:`);default:return`GMT`+Bu(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Ru(r,`:`);default:return`GMT`+Bu(r,`:`)}},t:function(e,t,n){return Pu(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return Pu(e.getTime(),t.length)}}})),Wu,Gu,Ku,qu,Ju=o((()=>{Wu=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Gu=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Ku=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Wu(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Wu(r,t)).replace(`{{time}}`,Gu(i,t))},qu={p:Gu,P:Ku}}));function Yu(e){return $u.test(e)}function Xu(e){return ed.test(e)}function Zu(e,t,n){let r=Qu(e,t,n);if(console.warn(r),td.includes(e))throw RangeError(r)}function Qu(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var $u,ed,td,nd=o((()=>{$u=/^D+$/,ed=/^Y+$/,td=[`D`,`DD`,`YY`,`YYYY`]}));function rd(e,t,n){let r=Us(),i=n?.locale??r.locale??xu,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=_s(e);if(!Dc(s))throw RangeError(`Invalid time value`);let c=t.match(od).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=qu[t];return n(e,i.formatLong)}return e}).join(``).match(ad).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:id(e)};if(Hu[t])return{isToken:!0,value:e};if(t.match(ld))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&Xu(a)||!n?.useAdditionalDayOfYearTokens&&Yu(a))&&Zu(a,t,String(e));let o=Hu[a[0]];return o(s,a,i.localize,l)}).join(``)}function id(e){let t=e.match(sd);return t?t[1].replace(cd,`'`):e}var ad,od,sd,cd,ld,ud=o((()=>{Cu(),Gs(),Uu(),Ju(),nd(),Oc(),vs(),ad=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,od=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sd=/^'([^]*?)'?$/,cd=/''/g,ld=/[a-zA-Z]/})),dd=o((()=>{})),fd=o((()=>{})),pd=o((()=>{})),md=o((()=>{})),hd=o((()=>{})),gd=o((()=>{})),_d=o((()=>{})),vd=o((()=>{})),yd=o((()=>{})),bd=o((()=>{})),xd=o((()=>{})),Sd=o((()=>{})),Cd=o((()=>{})),wd=o((()=>{})),Td=o((()=>{})),Ed=o((()=>{})),Dd=o((()=>{})),Od=o((()=>{}));function kd(){return Object.assign({},Us())}var Ad=o((()=>{Gs()})),jd=o((()=>{}));function Md(e){let t=_s(e).getDay();return t===0&&(t=7),t}var Nd=o((()=>{vs()})),Pd=o((()=>{})),Fd=o((()=>{})),Id=o((()=>{})),Ld=o((()=>{})),Rd=o((()=>{})),zd=o((()=>{})),Bd=o((()=>{})),Vd=o((()=>{})),Hd=o((()=>{})),Ud=o((()=>{})),Wd=o((()=>{})),Gd=o((()=>{})),Kd=o((()=>{})),qd=o((()=>{})),Jd=o((()=>{})),Yd=o((()=>{})),Xd=o((()=>{})),Zd=o((()=>{})),Qd=o((()=>{}));function $d(e,t){let n=_s(e),r=_s(t);return n.getTime()>r.getTime()}var ef=o((()=>{vs()})),tf=o((()=>{})),nf=o((()=>{})),rf=o((()=>{})),af=o((()=>{})),of=o((()=>{})),sf=o((()=>{}));function cf(e,t){let n=t instanceof Date?ys(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}var lf=o((()=>{bs()})),uf,df,ff,pf,mf=o((()=>{lf(),bs(),uf=10,df=class{subPriority=0;validate(e,t){return!0}},ff=class extends df{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}},pf=class extends df{priority=uf;subPriority=-1;set(e,t){return t.timestampIsSet?e:ys(e,cf(e,Date))}}})),hf,gf=o((()=>{mf(),hf=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new ff(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}}})),_f,vf=o((()=>{gf(),_f=class extends hf{priority=140;parse(e,t,n){switch(t){case`G`:case`GG`:case`GGG`:return n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`});case`GGGGG`:return n.era(e,{width:`narrow`});default:return n.era(e,{width:`wide`})||n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`R`,`u`,`t`,`T`]}})),yf,bf,xf=o((()=>{yf={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},bf={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/}}));function Sf(e,t){return e&&{value:t(e.value),rest:e.rest}}function Cf(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function wf(e,t){let n=t.match(e);if(!n)return null;if(n[0]===`Z`)return{value:0,rest:t.slice(1)};let r=n[1]===`+`?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*Fs+a*Ps+o*Is),rest:t.slice(n[0].length)}}function Tf(e){return Cf(yf.anyDigitsSigned,e)}function Ef(e,t){switch(e){case 1:return Cf(yf.singleDigit,t);case 2:return Cf(yf.twoDigits,t);case 3:return Cf(yf.threeDigits,t);case 4:return Cf(yf.fourDigits,t);default:return Cf(RegExp(`^\\d{1,`+e+`}`),t)}}function Df(e,t){switch(e){case 1:return Cf(yf.singleDigitSigned,t);case 2:return Cf(yf.twoDigitsSigned,t);case 3:return Cf(yf.threeDigitsSigned,t);case 4:return Cf(yf.fourDigitsSigned,t);default:return Cf(RegExp(`^-?\\d{1,`+e+`}`),t)}}function Of(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function kf(e,t){let n=t>0,r=n?t:1-t,i;if(r<=50)i=e||100;else{let t=r+50,n=Math.trunc(t/100)*100,a=e>=t%100;i=e+n-(a?100:0)}return n?i:1-i}function Af(e){return e%400==0||e%4==0&&e%100!=0}var jf=o((()=>{Vs(),xf()})),Mf,Nf=o((()=>{gf(),jf(),Mf=class extends hf{priority=130;incompatibleTokens=[`Y`,`R`,`u`,`w`,`I`,`i`,`e`,`c`,`t`,`T`];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`yy`});switch(t){case`y`:return Sf(Ef(4,e),r);case`yo`:return Sf(n.ordinalNumber(e,{unit:`year`}),r);default:return Sf(Ef(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=kf(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}})),Pf,Ff=o((()=>{ku(),qs(),gf(),jf(),Pf=class extends hf{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`YY`});switch(t){case`Y`:return Sf(Ef(4,e),r);case`Yo`:return Sf(n.ordinalNumber(e,{unit:`year`}),r);default:return Sf(Ef(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=Ou(e,r);if(n.isTwoDigitYear){let t=kf(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ks(e,r)}let a=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ks(e,r)}incompatibleTokens=[`y`,`R`,`u`,`Q`,`q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]}})),If,Lf=o((()=>{Ys(),bs(),gf(),jf(),If=class extends hf{priority=130;parse(e,t){return Df(t===`R`?4:t.length,e)}set(e,t,n){let r=ys(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Js(r)}incompatibleTokens=[`G`,`y`,`Y`,`u`,`Q`,`q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]}})),Rf,zf=o((()=>{gf(),jf(),Rf=class extends hf{priority=130;parse(e,t){return Df(t===`u`?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`G`,`y`,`Y`,`R`,`w`,`I`,`i`,`e`,`c`,`t`,`T`]}})),Bf,Vf=o((()=>{gf(),jf(),Bf=class extends hf{priority=120;parse(e,t,n){switch(t){case`Q`:case`QQ`:return Ef(t.length,e);case`Qo`:return n.ordinalNumber(e,{unit:`quarter`});case`QQQ`:return n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQQ`:return n.quarter(e,{width:`narrow`,context:`formatting`});default:return n.quarter(e,{width:`wide`,context:`formatting`})||n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]}})),Hf,Uf=o((()=>{gf(),jf(),Hf=class extends hf{priority=120;parse(e,t,n){switch(t){case`q`:case`qq`:return Ef(t.length,e);case`qo`:return n.ordinalNumber(e,{unit:`quarter`});case`qqq`:return n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqqq`:return n.quarter(e,{width:`narrow`,context:`standalone`});default:return n.quarter(e,{width:`wide`,context:`standalone`})||n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`Q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]}})),Wf,Gf=o((()=>{xf(),gf(),jf(),Wf=class extends hf{incompatibleTokens=[`Y`,`R`,`q`,`Q`,`L`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`M`:return Sf(Cf(yf.month,e),r);case`MM`:return Sf(Ef(2,e),r);case`Mo`:return Sf(n.ordinalNumber(e,{unit:`month`}),r);case`MMM`:return n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`});case`MMMMM`:return n.month(e,{width:`narrow`,context:`formatting`});default:return n.month(e,{width:`wide`,context:`formatting`})||n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}}})),Kf,qf=o((()=>{xf(),gf(),jf(),Kf=class extends hf{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`L`:return Sf(Cf(yf.month,e),r);case`LL`:return Sf(Ef(2,e),r);case`Lo`:return Sf(n.ordinalNumber(e,{unit:`month`}),r);case`LLL`:return n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`});case`LLLLL`:return n.month(e,{width:`narrow`,context:`standalone`});default:return n.month(e,{width:`wide`,context:`standalone`})||n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]}}));function Jf(e,t,n){let r=_s(e),i=Mu(r,n)-t;return r.setDate(r.getDate()-i*7),r}var Yf=o((()=>{Nu(),vs()})),Xf,Zf=o((()=>{Yf(),qs(),xf(),gf(),jf(),Xf=class extends hf{priority=100;parse(e,t,n){switch(t){case`w`:return Cf(yf.week,e);case`wo`:return n.ordinalNumber(e,{unit:`week`});default:return Ef(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){return Ks(Jf(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]}}));function Qf(e,t){let n=_s(e),r=Eu(n)-t;return n.setDate(n.getDate()-r*7),n}var $f=o((()=>{Du(),vs()})),ep,tp=o((()=>{$f(),Ys(),xf(),gf(),jf(),ep=class extends hf{priority=100;parse(e,t,n){switch(t){case`I`:return Cf(yf.week,e);case`Io`:return n.ordinalNumber(e,{unit:`week`});default:return Ef(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return Js(Qf(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]}})),np,rp,ip,ap=o((()=>{xf(),gf(),jf(),np=[31,28,31,30,31,30,31,31,30,31,30,31],rp=[31,29,31,30,31,30,31,31,30,31,30,31],ip=class extends hf{priority=90;subPriority=1;parse(e,t,n){switch(t){case`d`:return Cf(yf.date,e);case`do`:return n.ordinalNumber(e,{unit:`date`});default:return Ef(t.length,e)}}validate(e,t){let n=Af(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=rp[r]:t>=1&&t<=np[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]}})),op,sp=o((()=>{xf(),gf(),jf(),op=class extends hf{priority=90;subpriority=1;parse(e,t,n){switch(t){case`D`:case`DD`:return Cf(yf.dayOfYear,e);case`Do`:return n.ordinalNumber(e,{unit:`date`});default:return Ef(t.length,e)}}validate(e,t){return Af(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`L`,`w`,`I`,`d`,`E`,`i`,`e`,`c`,`t`,`T`]}}));function cp(e,t,n){let r=Us(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=_s(e),o=a.getDay(),s=(t%7+7)%7,c=7-i;return xs(a,t<0||t>6?t-(o+c)%7:(s+c)%7-(o+c)%7)}var lp=o((()=>{Ss(),vs(),Gs()})),up,dp=o((()=>{lp(),gf(),up=class extends hf{priority=90;parse(e,t,n){switch(t){case`E`:case`EE`:case`EEE`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEEE`:return n.day(e,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=cp(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]}})),fp,pp=o((()=>{lp(),gf(),jf(),fp=class extends hf{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`e`:case`ee`:return Sf(Ef(t.length,e),i);case`eo`:return Sf(n.ordinalNumber(e,{unit:`day`}),i);case`eee`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeeee`:return n.day(e,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=cp(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`c`,`t`,`T`]}})),mp,hp=o((()=>{lp(),gf(),jf(),mp=class extends hf{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`c`:case`cc`:return Sf(Ef(t.length,e),i);case`co`:return Sf(n.ordinalNumber(e,{unit:`day`}),i);case`ccc`:return n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`ccccc`:return n.day(e,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});default:return n.day(e,{width:`wide`,context:`standalone`})||n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=cp(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`e`,`t`,`T`]}}));function gp(e,t){let n=_s(e);return xs(n,t-Md(n))}var _p=o((()=>{Ss(),Nd(),vs()})),vp,yp=o((()=>{_p(),gf(),jf(),vp=class extends hf{priority=90;parse(e,t,n){let r=e=>e===0?7:e;switch(t){case`i`:case`ii`:return Ef(t.length,e);case`io`:return n.ordinalNumber(e,{unit:`day`});case`iii`:return Sf(n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiii`:return Sf(n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiiii`:return Sf(n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);default:return Sf(n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=gp(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`E`,`e`,`c`,`t`,`T`]}})),bp,xp=o((()=>{gf(),jf(),bp=class extends hf{priority=80;parse(e,t,n){switch(t){case`a`:case`aa`:case`aaa`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaaa`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Of(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]}})),Sp,Cp=o((()=>{gf(),jf(),Sp=class extends hf{priority=80;parse(e,t,n){switch(t){case`b`:case`bb`:case`bbb`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbbb`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Of(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]}})),wp,Tp=o((()=>{gf(),jf(),wp=class extends hf{priority=80;parse(e,t,n){switch(t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBBB`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Of(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]}})),Ep,Dp=o((()=>{xf(),gf(),jf(),Ep=class extends hf{priority=70;parse(e,t,n){switch(t){case`h`:return Cf(yf.hour12h,e);case`ho`:return n.ordinalNumber(e,{unit:`hour`});default:return Ef(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`H`,`K`,`k`,`t`,`T`]}})),Op,kp=o((()=>{xf(),gf(),jf(),Op=class extends hf{priority=70;parse(e,t,n){switch(t){case`H`:return Cf(yf.hour23h,e);case`Ho`:return n.ordinalNumber(e,{unit:`hour`});default:return Ef(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`K`,`k`,`t`,`T`]}})),Ap,jp=o((()=>{xf(),gf(),jf(),Ap=class extends hf{priority=70;parse(e,t,n){switch(t){case`K`:return Cf(yf.hour11h,e);case`Ko`:return n.ordinalNumber(e,{unit:`hour`});default:return Ef(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`h`,`H`,`k`,`t`,`T`]}})),Mp,Np=o((()=>{xf(),gf(),jf(),Mp=class extends hf{priority=70;parse(e,t,n){switch(t){case`k`:return Cf(yf.hour24h,e);case`ko`:return n.ordinalNumber(e,{unit:`hour`});default:return Ef(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){let r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`H`,`K`,`t`,`T`]}})),Pp,Fp=o((()=>{xf(),gf(),jf(),Pp=class extends hf{priority=60;parse(e,t,n){switch(t){case`m`:return Cf(yf.minute,e);case`mo`:return n.ordinalNumber(e,{unit:`minute`});default:return Ef(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=[`t`,`T`]}})),Ip,Lp=o((()=>{xf(),gf(),jf(),Ip=class extends hf{priority=50;parse(e,t,n){switch(t){case`s`:return Cf(yf.second,e);case`so`:return n.ordinalNumber(e,{unit:`second`});default:return Ef(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=[`t`,`T`]}})),Rp,zp=o((()=>{gf(),jf(),Rp=class extends hf{priority=30;parse(e,t){return Sf(Ef(t.length,e),e=>Math.trunc(e*10**(-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=[`t`,`T`]}})),Bp,Vp=o((()=>{bs(),tc(),xf(),gf(),jf(),Bp=class extends hf{priority=10;parse(e,t){switch(t){case`X`:return wf(bf.basicOptionalMinutes,e);case`XX`:return wf(bf.basic,e);case`XXXX`:return wf(bf.basicOptionalSeconds,e);case`XXXXX`:return wf(bf.extendedOptionalSeconds,e);default:return wf(bf.extended,e)}}set(e,t,n){return t.timestampIsSet?e:ys(e,e.getTime()-ec(e)-n)}incompatibleTokens=[`t`,`T`,`x`]}})),Hp,Up=o((()=>{bs(),tc(),xf(),gf(),jf(),Hp=class extends hf{priority=10;parse(e,t){switch(t){case`x`:return wf(bf.basicOptionalMinutes,e);case`xx`:return wf(bf.basic,e);case`xxxx`:return wf(bf.basicOptionalSeconds,e);case`xxxxx`:return wf(bf.extendedOptionalSeconds,e);default:return wf(bf.extended,e)}}set(e,t,n){return t.timestampIsSet?e:ys(e,e.getTime()-ec(e)-n)}incompatibleTokens=[`t`,`T`,`X`]}})),Wp,Gp=o((()=>{bs(),gf(),jf(),Wp=class extends hf{priority=40;parse(e){return Tf(e)}set(e,t,n){return[ys(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`}})),Kp,qp=o((()=>{bs(),gf(),jf(),Kp=class extends hf{priority=20;parse(e){return Tf(e)}set(e,t,n){return[ys(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`}})),Jp,Yp=o((()=>{vf(),Nf(),Ff(),Lf(),zf(),Vf(),Uf(),Gf(),qf(),Zf(),tp(),ap(),sp(),dp(),pp(),hp(),yp(),xp(),Cp(),Tp(),Dp(),kp(),jp(),Np(),Fp(),Lp(),zp(),Vp(),Up(),Gp(),qp(),Jp={G:new _f,y:new Mf,Y:new Pf,R:new If,u:new Rf,Q:new Bf,q:new Hf,M:new Wf,L:new Kf,w:new Xf,I:new ep,d:new ip,D:new op,E:new up,e:new fp,c:new mp,i:new vp,a:new bp,b:new Sp,B:new wp,h:new Ep,H:new Op,K:new Ap,k:new Mp,m:new Pp,s:new Ip,S:new Rp,X:new Bp,x:new Hp,t:new Wp,T:new Kp}}));function Xp(e,t,n,r){let i=kd(),a=r?.locale??i.locale??xu,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0;if(t===``)return e===``?_s(n):ys(n,NaN);let c={firstWeekContainsDate:o,weekStartsOn:s,locale:a},l=[new pf],u=t.match($p).map(e=>{let t=e[0];if(t in qu){let n=qu[t];return n(e,a.formatLong)}return e}).join(``).match(Qp),d=[];for(let i of u){!r?.useAdditionalWeekYearTokens&&Xu(i)&&Zu(i,t,e),!r?.useAdditionalDayOfYearTokens&&Yu(i)&&Zu(i,t,e);let o=i[0],s=Jp[o];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=d.find(e=>t.includes(e.token)||e.token===o);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${i}\` at the same time`)}else if(s.incompatibleTokens===`*`&&d.length>0)throw RangeError(`The format string mustn't contain \`${i}\` and any other token at the same time`);d.push({token:o,fullToken:i});let r=s.run(e,i,a.match,c);if(!r)return ys(n,NaN);l.push(r.setter),e=r.rest}else{if(o.match(rm))throw RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");if(i===`''`?i=`'`:o===`'`&&(i=Zp(i)),e.indexOf(i)===0)e=e.slice(i.length);else return ys(n,NaN)}}if(e.length>0&&nm.test(e))return ys(n,NaN);let f=l.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>l.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),p=_s(n);if(isNaN(p.getTime()))return ys(n,NaN);let m={};for(let e of f){if(!e.validate(p,c))return ys(n,NaN);let t=e.set(p,m,c);Array.isArray(t)?(p=t[0],Object.assign(m,t[1])):p=t}return ys(n,p)}function Zp(e){return e.match(em)[1].replace(tm,`'`)}var Qp,$p,em,tm,nm,rm,im=o((()=>{bs(),Ad(),Cu(),vs(),Ju(),nd(),Yp(),mf(),Qp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$p=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,em=/^'([^]*?)'?$/,tm=/''/g,nm=/\S/,rm=/[a-zA-Z]/})),am=o((()=>{})),om=o((()=>{})),sm=o((()=>{})),cm=o((()=>{})),lm=o((()=>{})),um=o((()=>{})),dm=o((()=>{})),fm=o((()=>{})),pm=o((()=>{})),mm=o((()=>{})),hm=o((()=>{})),gm=o((()=>{})),_m=o((()=>{})),vm=o((()=>{})),ym=o((()=>{})),bm=o((()=>{})),xm=o((()=>{})),Sm=o((()=>{})),Cm=o((()=>{})),wm=o((()=>{})),Tm=o((()=>{})),Em=o((()=>{})),Dm=o((()=>{})),Om=o((()=>{})),km=o((()=>{})),Am=o((()=>{})),jm=o((()=>{}));function Mm(e,t){let n=+_s(e),[r,i]=[+_s(t.start),+_s(t.end)].sort((e,t)=>e-t);return n>=r&&n<=i}var Nm=o((()=>{vs()}));function Pm(e,t){return xs(e,-t)}var Fm=o((()=>{Ss()})),Im=o((()=>{})),Lm=o((()=>{})),Rm=o((()=>{})),zm=o((()=>{})),Bm=o((()=>{})),Vm=o((()=>{})),Hm=o((()=>{})),Um=o((()=>{})),Wm=o((()=>{})),Gm=o((()=>{})),Km=o((()=>{})),qm=o((()=>{})),Jm=o((()=>{})),Ym=o((()=>{})),Xm=o((()=>{})),Zm=o((()=>{})),Qm=o((()=>{})),$m=o((()=>{})),eh=o((()=>{})),th=o((()=>{})),nh=o((()=>{})),rh=o((()=>{})),ih=o((()=>{})),ah=o((()=>{})),oh=o((()=>{})),sh=o((()=>{})),ch=o((()=>{})),lh=o((()=>{})),uh=o((()=>{})),dh=o((()=>{})),fh=o((()=>{})),ph=o((()=>{})),mh=o((()=>{})),hh=o((()=>{})),gh=o((()=>{})),_h=o((()=>{})),vh=o((()=>{})),yh=o((()=>{})),bh=o((()=>{})),xh=o((()=>{})),Sh=o((()=>{})),Ch=o((()=>{})),wh=o((()=>{})),Th=o((()=>{})),Eh=o((()=>{})),Dh=o((()=>{})),Oh=o((()=>{})),kh=o((()=>{})),Ah=o((()=>{})),jh=o((()=>{})),Mh=o((()=>{})),Nh=o((()=>{})),Ph=o((()=>{})),Fh=o((()=>{})),Ih=o((()=>{})),Lh=o((()=>{})),Rh=o((()=>{})),zh=o((()=>{}));function Bh(e,t){return Cs(e,-t)}var Vh=o((()=>{ws()})),Hh=o((()=>{})),Uh=o((()=>{})),Wh=o((()=>{})),Gh=o((()=>{})),Kh=o((()=>{})),qh=o((()=>{})),Jh=o((()=>{})),Yh=o((()=>{}));function Xh(e,t){return fc(e,-t)}var Zh=o((()=>{pc()})),Qh=o((()=>{})),$h=o((()=>{})),eg=o((()=>{})),tg=o((()=>{})),ng=o((()=>{Ts(),ks(),Ss(),Hs(),sc(),As(),cc(),ws(),lc(),uc(),dc(),pc(),mc(),_c(),vc(),yc(),bc(),xc(),bs(),Sc(),Cc(),kc(),rc(),Ac(),jc(),Mc(),Pc(),Fc(),Ic(),zc(),Vc(),Uc(),Bc(),Wc(),Xc(),Zc(),Qc(),$c(),el(),tl(),nl(),il(),al(),sl(),cl(),ll(),fl(),_l(),vl(),Kc(),yl(),bl(),Cl(),wl(),Tl(),Jc(),El(),Dl(),Ol(),kl(),Sl(),ml(),Al(),ud(),dd(),fd(),pd(),md(),hd(),gd(),_d(),vd(),yd(),bd(),xd(),Sd(),Cd(),wd(),Tu(),Td(),Dd(),Od(),Ad(),jd(),Nd(),Du(),Zs(),Pd(),Fd(),Id(),Ld(),Rd(),Nc(),zd(),Bd(),Vd(),Nu(),Hd(),ku(),Wd(),Gd(),Kd(),qd(),Jd(),Yd(),Xd(),Zd(),Qd(),ef(),tf(),Ec(),nf(),rf(),af(),of(),sf(),Yc(),Ed(),am(),om(),sm(),wc(),lm(),dm(),fm(),pm(),mm(),hm(),_m(),um(),vm(),Es(),Ds(),ym(),bm(),xm(),Sm(),Cm(),wm(),Tm(),Em(),Dm(),Om(),km(),Am(),Oc(),jm(),Os(),Nm(),Im(),Lm(),zm(),Bm(),Ud(),Vm(),Rm(),Hm(),Um(),hc(),Wm(),Gm(),Km(),qm(),gc(),Jm(),Ym(),Xm(),Zm(),Qm(),$m(),eh(),th(),nh(),rh(),ih(),ah(),oh(),im(),sh(),ch(),lh(),uh(),dh(),fh(),ph(),mh(),hh(),gh(),_h(),vh(),yh(),bh(),xh(),Sh(),Ch(),Th(),Eh(),lp(),Dh(),Oh(),kh(),_p(),$f(),oc(),Ah(),jh(),wh(),Mh(),Nh(),Yf(),Ph(),Fh(),$s(),Ih(),cm(),Ys(),ac(),rl(),dl(),ol(),gm(),Lh(),Rh(),qs(),ju(),gl(),zh(),Hh(),Uh(),Fm(),Wh(),Hc(),Gh(),Kh(),Vh(),qh(),Jh(),Yh(),Zh(),vs(),lf(),Qh(),$h(),eg(),tg()}));function rg(e){let t;try{if(t=ag&&(self.URL||self.webkitURL).createObjectURL(ag),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(ig),{name:e?.name})}}var ig,ag,og=o((()=>{ig="(function(){function e(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e==`object`&&t===`[object Date]`?new e.constructor(+e):typeof e==`number`||t===`[object Number]`||typeof e==`string`||t===`[object String]`?new Date(e):new Date(NaN)}function t(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function n(n,r){let i=e(n);return isNaN(r)?t(n,NaN):(r&&i.setDate(i.getDate()+r),i)}function r(n,r){let i=e(n);if(isNaN(r))return t(n,NaN);if(!r)return i;let a=i.getDate(),o=t(n,i.getTime());return o.setMonth(i.getMonth()+r+1,0),a>=o.getDate()?o:(i.setFullYear(o.getFullYear(),o.getMonth(),a),i)}let i={};function a(){return i}function o(t,n){let r=a(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=e(t),s=o.getDay(),c=(s<i?7:0)+s-i;return o.setDate(o.getDate()-c),o.setHours(0,0,0,0),o}function s(e,t){return r(e,t*12)}function c(t){let n=e(t),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function l(t){let n=e(t);return n.setDate(1),n.setHours(0,0,0,0),n}function u(t){let n=e(t),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function d(n){let r=e(n),i=t(n,0);return i.setFullYear(r.getFullYear(),0,1),i.setHours(0,0,0,0),i}function f(t,n){let r=a(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=e(t),s=o.getDay(),c=(s<i?-7:0)+6-(s-i);return o.setDate(o.getDate()+c),o.setHours(23,59,59,999),o}function p(t,n){let r=+e(t),[i,a]=[+e(n.start),+e(n.end)].sort((e,t)=>e-t);return r>=i&&r<=a}function m(e,t){return n(e,-t)}function h(e,t){return r(e,-t)}function g(e,t){return s(e,-t)}let _=/\\s#([^\\u2000-\\u206F\\u2E00-\\u2E7F'!\"#$%&()*+,.:;<=>?@^`{|}~\\[\\]\\\\\\s]+)/g,v=/(<p>|<br>)#([^\\u2000-\\u206F\\u2E00-\\u2E7F'!\"#$%&()*+,.:;<=>?@^`{|}~\\[\\]\\\\\\s]+)/g,y=/^#([^\\u2000-\\u206F\\u2E00-\\u2E7F'!\"#$%&()*+,.:;<=>?@^`{|}~\\[\\]\\\\\\s]+)/gu,b=/(\\s|:|\\(|>|^)((http|ftp|https):\\/\\/([\\w_-]+(?:(?:\\.[\\w_-]+)+))([\\w.,@?^=%&:/~+#-]*[\\w@?^=%&/~+#-]))/g,x=/([^\\s<\\\\*>'(]+\\.(jpeg|jpg|gif|png|svg))(\\]\\])?(\\))?/g,S=/\\[@(.+?)\\]\\((.+?)\\)/g;function C(e){return e?Array.isArray(e)?e.filter(e=>e).map(e=>e.toString().trim()):typeof e==`string`?e.split(/[\\s,]+/).filter(Boolean):[]:[]}function w(e){return[/#([^\\s#]+)/g,/\\n#([^\\s#]+)/g,/^#([^\\s#]+)/g].reduce((t,n)=>((e.match(n)||[]).forEach(e=>{let r=e.replace(n,`$1`).trim().split(`/`),i=``;r.forEach(e=>{i+=e,t.add(i),i+=`/`})}),t),new Set)}function T(e){if(!Array.isArray(e)||e.length===0)return new Set;let t=e.filter(e=>!!e).map(e=>e.toString().trim());if(t.length===0)return new Set;let n=new Set;return t.forEach(e=>{let t=e.split(`/`),r=``;t.forEach((e,t)=>{r+=(t>0?`/`:``)+e,n.add(r)})}),n}function E(e){let t=e.toLowerCase();return e=>e.includes(t)}function D(e,t,n){let{onlyFilterType:r,filterArchived:i=!0,filterDeleted:a=!0,filterDoneTasks:o=!1,filterComments:s=!0,filterTagsInFile:c=!1}=n||{},l=/#([^\\s#]+)/g,u=/^#([^\\s#]+)/g,d=/\\n#([^\\s#]+)/g,f=/\\[(.+?)\\]\\((.+?)\\)/g,p=/!\\[(.+?)\\]\\((.+?)\\)/g,m=/\\[\\[(.+?)\\]\\]/g,h=e;if(r&&r!==`all`)switch(r){case`archived`:h=e.filter(e=>e.rowStatus===`ARCHIVED`&&!e.deletedAt),console.log(h,e);break;case`deleted`:h=e.filter(e=>e.deletedAt!==``&&e.deletedAt);break;case`doneTasks`:h=e.filter(e=>e.thinoType===`TASK-DONE`);break;case`comments`:h=e.filter(e=>e.content.includes(`comment:`));break}else h=e.filter(e=>!(i&&e.rowStatus===`ARCHIVED`||a&&e.deletedAt||s&&e.content.includes(`comment:`)||o&&e.thinoType===`TASK-DONE`));if(console.log(t,O(t)),O(t))return h;let{tag:g,duration:_,type:v,text:y,filter:b,path:x,metadata:S}=t,D=y?.toLowerCase()||``,j=!S||Object.keys(S).length===0,M=D?E(D):null;return h.filter(e=>{if(b)try{let n=t.filterContent;if(Array.isArray(n)&&!A(e,n))return!1}catch(e){console.error(`Failed to parse query filters:`,e)}if(!j&&Object.keys(S).some(t=>e.fileInfo?.frontmatter[t]!==S[t])||x&&e.path&&!e.path.toLowerCase().includes(x.toLowerCase()))return!1;if(M){let t=M(e.content.toLowerCase()),n=e.path?e.path.toLowerCase().includes(D):!1;if(e.thinoType===`MULTI`&&e.path){if(!t&&!n)return!1}else if(!t)return!1}if(g){let t=w(e.content),n=c?T(C(e.fileInfo?.tags)):new Set;if(!t.has(g)&&!n.has(g))return!1}if(_&&_.from!==0&&_.to!==0){let t=e.createdAtTs??k(e.createdAt);if(t<_.from||t>_.to)return!1}if(v)switch(v){case`NOT_TAGGED`:if(e.content.match(l)||e.content.match(u)||e.content.match(d))return!1;break;case`LINKED`:if(!e.content.match(f))return!1;break;case`IMAGED`:if(!e.content.match(p))return!1;break;case`CONNECTED`:if(!e.content.match(m))return!1;break}return!0})}function O(e){if(!e)return!0;let{tag:t,duration:n,type:r,text:i,filter:a,path:o,metadata:s}=e,c=!s||Object.keys(s).length===0;return!(t||n&&n.from<n.to||r||i||a||o||!c)}function k(e){return new Date(e).getTime()}function A(e,t){if(!Array.isArray(t)||t.length===0)return!0;let n=j(e,t[0]);for(let r=1;r<t.length;r++){let i=t[r],a=j(e,i);i.relation===`OR`?n||=a:n&&=a}return n}function j(e,t){if(!t||typeof t!=`object`||!t.type||!t.value||typeof t.value!=`object`)return!0;let{type:n,value:r}=t,i=r.operator,a=r.value;switch(n){case`TAG`:{let t=typeof a==`string`?a:``,n=w(e.content),r=T(C(e.fileInfo?.tags)),o=Array.from(n).some(e=>e===t||e.startsWith(`${t}/`))||Array.from(r).some(e=>e===t||e.startsWith(`${t}/`));return i===`CONTAIN`?o:!o}case`TEXT`:{let t=typeof a==`string`?a.toLowerCase():``,n=e.content.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`TYPE`:{let t=!1;return(a===`NOT_TAGGED`&&e.content.match(_)===null&&e.content.match(v)===null&&e.content.match(y)===null||a===`LINKED`&&e.content.match(b)!==null||a===`IMAGED`&&e.content.match(x)!==null||a===`CONNECTED`&&e.content.match(S)!==null)&&(t=!0),i===`IS`?t:!t}case`DATE`:{let t=typeof a==`string`?new Date(a):typeof a==`object`&&a&&`value`in a?new Date(a.value):null;if(!t)return!0;let n=new Date(e.createdAt);return i===`CONTAIN`?n>=t:n<t}case`LIST`:switch(a){case`TODO`:{let t=e.thinoType===`TASK-TODO`;return i===`IS`?t:!t}case`DONE`:{let t=e.thinoType===`TASK-DONE`;return i===`IS`?t:!t}case`LIST`:{let t=e.thinoType===`JOURNAL`;return i===`IS`?t:!t}case`OTHER`:{let t=![`TASK-TODO`,`TASK-DONE`,`JOURNAL`].includes(e.thinoType);return i===`IS`?t:!t}default:return!0}case`SOURCE`:return i===`IS`?e.sourceType===a:e.sourceType!==a;case`PATH`:{if(!e.path)return i!==`CONTAIN`;let t=typeof a==`string`?a.toLowerCase():``,n=e.path.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`METADATA`:{if(!e.fileInfo?.frontmatter)return i!==`CONTAIN`;let t=typeof a==`object`&&a?a:{name:``,value:``},n=`name`in t?t.name:``,r=`value`in t?t.value:``;if(!n)return!0;let o=e.fileInfo.frontmatter[n]===r;return i===`CONTAIN`?o:!o}case`TIME_RANGE`:{let t=new Date,n,r=t;if(typeof a!=`string`)return!0;switch(a){case`7d`:n=m(t,7);break;case`14d`:n=m(t,14);break;case`30d`:n=m(t,30);break;case`90d`:n=m(t,90);break;case`180d`:n=m(t,180);break;case`365d`:n=m(t,365);break;case`thisWeek`:n=o(t),r=f(t);break;case`thisMonth`:n=l(t),r=c(t);break;case`thisYear`:n=d(t),r=u(t);break;case`lastWeek`:{let e=m(t,7);n=o(e),r=f(e);break}case`lastMonth`:{let e=h(t,1);n=l(e),r=c(e);break}case`lastYear`:{let e=g(t,1);n=d(e),r=u(e);break}default:return!0}let s=new Date(e.createdAt);return i===`WITHIN`?p(s,{start:n,end:r}):i===`BEFORE`?s<n:!0}default:return!0}}let M=e=>{let t=e?.match(/^(\\d{4})[-/](\\d{1,2})[-/](\\d{1,2})/);return t?`${t[1]}/${t[2].padStart(2,`0`)}/${t[3].padStart(2,`0`)}`:``},N=e=>{let t=e?.match(/^(\\d{4})[-/](\\d{1,2})/);return t?`${t[1]}/${t[2].padStart(2,`0`)}`:``},P=e=>{let t=e?.match(/\\s(\\d{1,2}):/);if(!t)return null;let n=parseInt(t[1],10);return Number.isNaN(n)?null:n},F=e=>{let t={};return e.forEach(e=>{let n=M(e.createdAt);n&&(t[n]?t[n]++:t[n]=1)}),Object.keys(t).sort((e,n)=>t[n]-t[e])[0]||``},I=e=>{let t={};return e.forEach(e=>{let n=P(e.createdAt)?.toString().padStart(2,`0`);n&&(t[n]?t[n]++:t[n]=1)}),Object.keys(t).sort((e,n)=>t[n]-t[e])[0]||``},L=(e,t)=>{let n=Math.abs(t.getTime()-e.getTime());return Math.round(n/864e5)+1};function R(e,t){let n=new Set,r={},i=new Map;for(let a of e){if(a.deletedAt!==``&&a.deletedAt||a.rowStatus===`ARCHIVED`)continue;let e=[];if(t.filterTagsInFile&&!i.has(a.path)){let t=(Array.isArray(a?.fileInfo?.tags)?a.fileInfo.tags:typeof a?.fileInfo?.tags==`string`?[a.fileInfo.tags]:[]).filter(e=>e).map(e=>e.toString().trim());i.set(a.path,t),e.push(...t)}let o=a.content.replace(/<[^>]*>/g,``).replace(/\\`\\`\\`(.*)?\\n[\\s\\S]*?\\n\\`\\`\\`/gm,``).replace(/\\`([^\\`].*?)\\`/g,``),s=[...Array.from(o.match(_)||[]),...Array.from(o.match(y)||[]),...Array.from(o.match(v)||[])];e.push(...s);for(let t of e){if(!t||t===`undefined`)continue;let e=t.replace(_,`$1`).replace(y,`$1`).replace(v,`$2`).trim();e&&!/^\\d+$/.test(e)&&(n.add(e),r[e]=(r[e]||0)+1)}}return{tagsSet:n,counts:r}}self.addEventListener(`message`,e=>{Promise.resolve().then(async()=>{try{let{type:t,data:n}=e.data;if(t===`filter-memos`){let{memos:e,query:t,filterOptions:r}=n,i=D(e,t,r);console.log(`filteredMemos`,i),postMessage({type:`filter-result`,data:i})}else if(t===`build-tag-tree`){let{memos:e,filterOptions:t}=n,{tagsSet:r,counts:i}=R(e,t);postMessage({type:`build-tag-tree-result`,data:{tagsSet:r,counts:i}})}else if(t===`calculate-stats-banner`){let{memos:e,tags:t}=n,r=e.filter(e=>!(e.deletedAt!==``&&e.deletedAt)).length,i=t.length,a=e.length>0?e[e.length-1]:null,o=0;if(a&&a.createdAt){let e=M(a.createdAt).split(`/`);o=L(new Date(parseInt(e[0]),parseInt(e[1])-1,parseInt(e[2])),new Date)}let s=e.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`).filter(e=>e.thinoType&&e.thinoType?.startsWith(`TASK`)).length,c=F(e),l=I(e);postMessage({type:`stats-banner-result`,data:{memosLength:r,tagsLength:i,createdDays:o,taskAmount:s,mostActiveDay:c,mostActiveHour:l,earliestMemo:a,lengthOverflow:r>9999||i>999||o>999}})}else if(t===`calculate-stats`){let{memos:e}=n,t=new Date,r=new Date(t),i=[...Array(30)].map((t,n)=>{let i=new Date(r);i.setDate(r.getDate()-(29-n));let a=i.toISOString().split(`T`)[0].replace(/-/g,`/`),o=e.filter(e=>M(e.createdAt)===a).length;return{date:`${(i.getMonth()+1).toString().padStart(2,`0`)}/${i.getDate().toString().padStart(2,`0`)}`,count:o}}),a=t.getMonth(),o=t.getFullYear(),s=new Date(o,a+1,0).getDate(),c=[...Array(s)].map((t,n)=>{let r=new Date(o,a,n+1),i=r.toISOString().split(`T`)[0].replace(/-/g,`/`),s=e.filter(e=>M(e.createdAt)===i).length;return{date:`${(r.getMonth()+1).toString().padStart(2,`0`)}/${r.getDate().toString().padStart(2,`0`)}`,count:s}}),l=[...Array(12)].map((t,n)=>{let r=new Date(o,n,1),i=r.toISOString().slice(0,7).replace(/-/g,`/`),a=e.filter(e=>N(e.createdAt)===i).length;return{date:`${(r.getMonth()+1).toString().padStart(2,`0`)}`,count:a}}),u=[...Array(24)].map((t,n)=>{let r=e.filter(e=>P(e.createdAt)===n).length;return{hour:`${n.toString().padStart(2,`0`)}:00`,count:r}}),d=[{period:`00:00-03:00`,count:0},{period:`03:00-06:00`,count:0},{period:`06:00-09:00`,count:0},{period:`09:00-12:00`,count:0},{period:`12:00-15:00`,count:0},{period:`15:00-18:00`,count:0},{period:`18:00-21:00`,count:0},{period:`21:00-24:00`,count:0}];e.forEach(e=>{let t=P(e.createdAt);t!==null&&(t<3?d[0].count++:t<6?d[1].count++:t<9?d[2].count++:t<12?d[3].count++:t<15?d[4].count++:t<18?d[5].count++:t<21?d[6].count++:d[7].count++)});let f=[{min:0,max:25,label:`0-25`},{min:26,max:50,label:`26-50`},{min:51,max:75,label:`51-75`},{min:76,max:100,label:`76-100`},{min:101,max:200,label:`101-200`},{min:201,max:500,label:`201-500`},{min:501,max:1/0,label:`500+`}].map(t=>({range:t.label,count:e.filter(e=>{let n=e.content.length;return n>=t.min&&n<=t.max}).length}));postMessage({type:`stats-result`,data:{dailyData:i,monthlyData:c,yearlyData:l,hourlyData:u,timeDistData:d,lengthData:f}})}}catch(e){console.error(`Worker failed to process:`,e),postMessage({type:`error`,error:e.message||`Unknown error in worker`})}})})})();",ag=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,ig],{type:`text/javascript;charset=utf-8`})}));function sg(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}var cg=o((()=>{}));function lg(e){e.worker.terminate(),e.active&&e.active[1].reject(`Terminated`),e.active=void 0}var ug,dg,fg,pg,mg,hg,gg=o((()=>{og(),cg(),H(),ug={workers:8,utilization:.75,workerName:`Thino Parser Worker`},dg=function(e){return e[e.HIGH=0]=`HIGH`,e[e.MEDIUM=1]=`MEDIUM`,e[e.LOW=2]=`LOW`,e}(dg||{}),fg=function(e){return e.BUILD_TAG_TREE=`BUILD_TAG_TREE`,e.CALCULATE_STATS=`CALCULATE_STATS`,e.CALCULATE_STATS_BANNER=`CALCULATE_STATS_BANNER`,e.FILTER_MEMOS=`FILTER_MEMOS`,e.PARSE_FILE=`PARSE_FILE`,e.FILTER_MEMOS_TOP_K=`FILTER_MEMOS_TOP_K`,e}(fg||{}),pg={[fg.BUILD_TAG_TREE]:dg.HIGH,[fg.CALCULATE_STATS]:dg.HIGH,[fg.CALCULATE_STATS_BANNER]:dg.HIGH,[fg.FILTER_MEMOS]:dg.LOW,[fg.PARSE_FILE]:dg.MEDIUM,[fg.FILTER_MEMOS_TOP_K]:dg.HIGH},mg=e=>{let t={...e};if(e.filter){let n=Zg.getQueryById(e.filter);n&&n.querystring&&(t.filterContent=JSON.parse(n.querystring))}return t},hg=class extends f.Component{workers;nextWorkerId;shutdown;taskQueue;outstanding;throttle;cacheVersion=0;memoVersions=new Map;app;plugin;constructor(e,t,n,r){super(),this.workers=new Map,this.shutdown=!1,this.nextWorkerId=0,this.throttle=n??(()=>({...ug,workerName:r??ug.workerName})),this.taskQueue=[],this.outstanding=new Map,this.app=e,this.plugin=t}import(e){let t=e.map(e=>e.id).join(`,`),n=this.outstanding.get(t);if(n)return n;let r=sg();return this.outstanding.set(t,r),this.addToQueue({type:fg.FILTER_MEMOS,memos:e,promise:r,priority:dg.LOW,timestamp:Date.now(),outstandingKey:t}),this.schedule(),r}addToQueue(e){this.taskQueue.push(e),this.taskQueue.sort((e,t)=>e.priority===t.priority?e.timestamp-t.timestamp:e.priority-t.priority)}getNextTask(){if(this.taskQueue.length!==0)return this.taskQueue.shift()}unthrottle(){for(let e of this.workers.values())e.availableAt=Date.now()}async schedule(){if(this.taskQueue.length===0||this.shutdown)return;let e=this.availableWorker();if(!e)return;let t=this.getNextTask();if(t){e.active=[t.memos,t.promise,Date.now(),t.outstandingKey];try{switch(t.type){case fg.CALCULATE_STATS:e.worker.postMessage({type:`calculate-stats`,data:{memos:t.memos}});break;case fg.CALCULATE_STATS_BANNER:e.worker.postMessage({type:`calculate-stats-banner`,data:{memos:t.memos,tags:t.tags||[]}});break;case fg.FILTER_MEMOS:case fg.FILTER_MEMOS_TOP_K:e.worker.postMessage({type:`filter-memos`,data:{memos:t.memos,query:mg(t.query),filterOptions:t.filterOptions,topK:t.topK,returnIds:!!t.topK}});break;case fg.BUILD_TAG_TREE:e.worker.postMessage({type:`build-tag-tree`,data:{memos:t.memos,filterOptions:t.filterOptions}});break;case fg.PARSE_FILE:e.worker.postMessage({type:`parse-file`,data:{filePath:t.filePath,mtime:t.mtime,cacheVersion:this.cacheVersion}});break}}catch(t){console.log(`Obsidian-Thino: Background processing failed. `+t),e.active=void 0,setTimeout(this.schedule.bind(this),0)}}}finish(e,t){if(!e.active){console.log(`Obsidian-Thino: Received a stale worker message. Ignoring.`,t);return}let[n,r,i,a]=e.active;if(`error`in t?r.reject(t.error):r.resolve(t),a)this.outstanding.delete(a);else for(let[e,t]of this.outstanding.entries())if(t===r){this.outstanding.delete(e);break}if(this.workers.size>this.throttle().workers)this.workers.delete(e.id),lg(e);else{let t=Date.now(),n=Math.max(.1,this.throttle().utilization)-1,r=(t-i)*n;e.active=void 0,r<=1e-10?(e.availableAt=t,this.schedule()):(e.availableAt=t+r,setTimeout(this.schedule.bind(this),r))}}availableWorker(){let e=Date.now();for(let t of this.workers.values())if(!t.active&&t.availableAt<=e)return t;if(this.workers.size<this.throttle().workers){let e=this.newWorker();return this.workers.set(e.id,e),e}}newWorker(){let e={id:this.nextWorkerId++,availableAt:Date.now(),worker:new rg,name:this.throttle().workerName};return e.worker.onmessage=async t=>await this.handleWorkerMessage(e,t.data),e}onunload(){for(let e of this.workers.values())lg(e);for(;this.taskQueue.length>0;){let e=this.taskQueue.shift();e&&e.promise.reject(`Terminated`)}this.shutdown=!0}invalidateCache(e){if(!e||e.length===0){this.cacheVersion++,console.log(`Invalidated all cache, new version:`,this.cacheVersion);return}for(let t of e){let e=this.memoVersions.get(t)||0;this.memoVersions.set(t,e+1)}let t=[];this.outstanding.forEach((n,r)=>{let i=r.split(`_`);e.some(e=>i.includes(e))&&t.push(r)}),t.forEach(e=>this.outstanding.delete(e)),console.log(`Invalidated cache for ${e.length} memos`)}getVersionString(e){let t=`_v${this.cacheVersion}`;if(e&&e.length>0){let n=e.slice(0,10).map(e=>`${e.id}:${this.memoVersions.get(e.id)||0}`).join(`;`);t+=`_m${n}_len${e.length}`}return t}async calculateStats(e,t=!1){try{if(!e||e.length===0)return{};let n=t?`_force${Date.now()}`:this.getVersionString(e),r=e.map(e=>e.id).join(`,`)+`_stats`+n,i=this.outstanding.get(r);if(i&&!t)return i;let a=sg();return this.outstanding.set(r,a),this.addToQueue({type:fg.CALCULATE_STATS,memos:e,promise:a,priority:pg[fg.CALCULATE_STATS],timestamp:Date.now(),outstandingKey:r}),this.schedule(),a}catch(e){return console.error(`Obsidian-Thino: Failed to calculate stats. `+e),Promise.reject(e)}}async calculateStatsBanner(e,t,n=!1){try{if(!e||e.length===0)return{memosLength:0,tagsLength:t?.length||0,createdDays:0,taskAmount:0,mostActiveDay:``,mostActiveHour:``,earliestMemo:null,lengthOverflow:!1};let r=n?`_force${Date.now()}`:this.getVersionString(e),i=e.map(e=>e.id).join(`,`)+`_banner`+r,a=this.outstanding.get(i);if(a&&!n)return a;let o=sg();return this.outstanding.set(i,o),this.addToQueue({type:fg.CALCULATE_STATS_BANNER,memos:e,tags:t,promise:o,priority:pg[fg.CALCULATE_STATS_BANNER],timestamp:Date.now(),outstandingKey:i}),this.schedule(),o}catch(e){return console.error(`Obsidian-Thino: Failed to calculate banner stats. `+e),Promise.reject(e)}}async parseFile(e,t,n){try{let r=`parse_${e}_${t}_v${n}`,i=this.outstanding.get(r);if(i)return console.log(`ThinoDebug parseFile: using existing promise`,{filePath:e}),i;let a=sg();return this.outstanding.set(r,a),this.addToQueue({type:fg.PARSE_FILE,memos:[],promise:a,filePath:e,mtime:t,priority:pg[fg.PARSE_FILE],timestamp:Date.now()}),this.schedule(),a}catch(e){return console.error(`Obsidian-Thino: Failed to parse file. `+e),Promise.reject(e)}}async filterMemos(e,t,n={},r,i=!1){try{if(!e||e.length===0)return[];let a=mg(t),o=JSON.stringify(a),s=JSON.stringify({...n,filterTagsInFile:this.plugin.settings.FilterByMetadata}),c=i?`_force${Date.now()}`:this.getVersionString(e),l=e.slice(0,20).map(e=>`${e.id}-${e.updatedAt||e.createdAt}`).join(`|`)+`|total:${e.length}_filter_`+o+`_`+s+(r?`_topK${r}`:``)+c,u=this.outstanding.get(l);if(u&&!i)return console.log(`Using cached filter result`),u;let d=sg();this.outstanding.set(l,d);let f=r?fg.FILTER_MEMOS_TOP_K:fg.FILTER_MEMOS;return this.addToQueue({type:f,memos:e,promise:d,query:a,filterOptions:{...n,filterTagsInFile:this.plugin.settings.FilterByMetadata},topK:r,priority:pg[f],timestamp:Date.now(),outstandingKey:l}),this.schedule(),d}catch(e){return console.error(`Obsidian-Thino: Failed to filter memos. `+e),Promise.reject(e)}}async buildTagTree(e,t=!1){try{if(!e||e.length===0)return{};let n={filterTagsInFile:this.plugin.settings.FilterByMetadata},r=t?`_force${Date.now()}`:this.getVersionString(e),i=e.map(e=>e.id).join(`,`)+`_tags_`+JSON.stringify(n)+r,a=this.outstanding.get(i);if(a&&!t)return a;let o=sg();return this.outstanding.set(i,o),this.addToQueue({type:fg.BUILD_TAG_TREE,memos:e,promise:o,filterOptions:n,priority:pg[fg.BUILD_TAG_TREE],timestamp:Date.now(),outstandingKey:i}),this.schedule(),o}catch(e){return console.error(`Obsidian-Thino: Failed to build tag tree. `+e),Promise.reject(e)}}async handleWorkerMessage(e,t){if(t.type===`stats-result`){e.active&&(console.log(`[${e.name}] Received stats-result for worker #${e.id}`),this.finish(e,t.data));return}if(t.type===`stats-banner-result`){e.active&&(console.log(`[${e.name}] Received stats-banner-result for worker #${e.id}`),this.finish(e,t.data));return}if(t.type===`filter-result`){e.active&&(console.log(`[${e.name}] Received filter-result for worker #${e.id}`,t.data),this.finish(e,t.data));return}if(t.type===`build-tag-tree-result`){e.active&&(console.log(`[${e.name}] Received build-tag-tree-result for worker #${e.id}`,t.data),this.finish(e,t.data));return}if(t.type===`parse-file-result`){e.active&&(console.log(`[${e.name}] Received parse-file-result for worker #${e.id}`,t.data),this.finish(e,t.data));return}if(t.type===`error`){e.active&&(console.log(`[${e.name}] Error from worker #${e.id}:`,t.error),this.finish(e,{error:t.error}));return}}memoUpdated(e){let t=this.memoVersions.get(e)||0;this.memoVersions.set(e,t+1);let n=[];this.outstanding.forEach((t,r)=>{r.includes(e)&&n.push(r)}),n.forEach(e=>this.outstanding.delete(e)),console.log(`Updated version for memo ${e} to ${t+1}`)}memosUpdated(e){if(!e||e.length===0)return;for(let t of e){let e=this.memoVersions.get(t)||0;this.memoVersions.set(t,e+1)}let t=[];this.outstanding.forEach((n,r)=>{let i=r.split(`,`)[0].split(`_`);e.some(e=>i.includes(e))&&t.push(r)}),t.forEach(e=>this.outstanding.delete(e)),console.log(`Updated versions for ${e.length} memos`)}}}));function _g(e){return e.thinoWorkerManager||(e.thinoWorkerManager=new hg(e.app,e),e.addChild(e.thinoWorkerManager)),e.thinoWorkerManager}function vg(e,t,n){let{filterArchived:r=!0,filterDeleted:i=!0,filterDoneTasks:a=!1,filterComments:o=!0}=n,s=e.filter(e=>!(r&&e.rowStatus===`ARCHIVED`||i&&e.deletedAt||o&&e.content.includes(`comment:`)||a&&e.thinoType===`TASK-DONE`));if(yg(t))return s;let{tag:c,duration:l,type:u,text:d,filter:p,path:m,metadata:h}=t,g=d?.toLowerCase()||``,_=!h||Object.keys(h).length===0,v=g?(0,f.prepareSimpleSearch)(g):null;return console.log(`prepared`,v),s.filter(e=>{if(p){let t=Zg.getQueryById(p);if(console.log(`queryFilter`,t),t){let n=JSON.parse(t.querystring);if(Array.isArray(n)&&!Cg(e,n))return!1}}if(!_&&Object.keys(h).some(t=>e.fileInfo?.frontmatter[t]!==h[t])||m&&e.path&&!e.path.toLowerCase().includes(m.toLowerCase()))return!1;if(v){let t=v(e.content.toLowerCase()),n=e.path?e.path.toLowerCase().includes(g):!1;if(e.thinoType===`MULTI`&&e.path){if(!t&&!n)return!1}else if(!t)return!1}if(c){let t=bg(e.content),n=Sg(xg(e.fileInfo?.tags));if(!t.has(c)&&!n.has(c))return!1}if(l&&l.from!==0&&l.to!==0){let t=N.getMemoTimestamp(e);if(t<l.from||t>l.to)return!1}if(u)switch(u){case`NOT_TAGGED`:if(e.content.match(Br)||e.content.match(Vr)||e.content.match(Hr))return!1;break;case`LINKED`:if(!e.content.match(Ur))return!1;break;case`IMAGED`:if(!e.content.match(Gr))return!1;break;case`CONNECTED`:if(!e.content.match(Yr))return!1;break}return!0})}function yg(e){if(!e)return!0;let{tag:t,duration:n,type:r,text:i,filter:a,path:o,metadata:s}=e,c=!s||Object.keys(s).length===0;return!(t||n&&n.from<n.to||r||i||a||o||!c)}function bg(e){return[Br,Hr,Vr]?.reduce((t,n)=>((e.match(n)||[]).forEach(e=>{let r=(e?.replace(n,`$1`).trim()).split(`/`),i=``;r.forEach(e=>{i+=e,t.add(i),i+=`/`})}),t),new Set)}function xg(e){return e?Array.isArray(e)?e.filter(e=>e).map(e=>e.toString().trim()):typeof e==`string`?e.split(/[\s,]+/).filter(Boolean):[]:[]}function Sg(e){if(!Array.isArray(e)||e.length===0)return new Set;let t=e.filter(e=>!!e).map(e=>e.toString().trim());if(t.length===0)return new Set;let n=new Set;return t.forEach(e=>{let t=e.split(`/`),r=``;t.forEach((e,t)=>{r+=(t>0?`/`:``)+e,n.add(r)})}),n}function Cg(e,t){return!Array.isArray(t)||t.length===0?!0:t.every(t=>{if(!t||typeof t!=`object`||!t.type||!t.value||typeof t.value!=`object`)return!0;let{type:n,value:r}=t,i=r.operator,a=r.value;switch(console.log(n,r),n){case`TAG`:{let t=typeof a==`string`?a:``,n=bg(e.content),r=Sg(xg(e.fileInfo?.tags)),o=Array.from(n).some(e=>e===t||e.startsWith(`${t}/`))||Array.from(r).some(e=>e===t||e.startsWith(`${t}/`));return i===`CONTAIN`?o:!o}case`TEXT`:{let t=typeof a==`string`?a.toLowerCase():``,n=e.content.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`TYPE`:{let t=!1;return(a===`NOT_TAGGED`&&e.content.match(Br)===null&&e.content.match(Vr)===null&&e.content.match(Hr)===null||a===`LINKED`&&e.content.match(Ur)!==null||a===`IMAGED`&&e.content.match(Gr)!==null||a===`CONNECTED`&&e.content.match(Yr)!==null)&&(t=!0),i===`IS`?t:!t}case`DATE`:{let t=typeof a==`string`?new Date(a):typeof a==`object`&&a&&`value`in a?new Date(a.value):null;if(!t)return!0;let n=new Date(e.createdAt);return i===`CONTAIN`?n>=t:n<t}case`LIST`:switch(a){case`TODO`:{let t=e.thinoType===`TASK-TODO`;return i===`IS`?t:!t}case`DONE`:{let t=e.thinoType===`TASK-DONE`;return i===`IS`?t:!t}case`LIST`:{let t=e.thinoType===`JOURNAL`;return i===`IS`?t:!t}case`OTHER`:{let t=![`TASK-TODO`,`TASK-DONE`,`JOURNAL`].includes(e.thinoType);return i===`IS`?t:!t}default:return!0}case`SOURCE`:return i===`IS`?e.sourceType===a:e.sourceType!==a;case`PATH`:{if(!e.path)return i!==`CONTAIN`;let t=typeof a==`string`?a.toLowerCase():``,n=e.path.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`METADATA`:{if(!e.fileInfo?.frontmatter)return i!==`CONTAIN`;let t=typeof a==`object`&&a?a:{name:``,value:``},n=`name`in t?t.name:``,r=`value`in t?t.value:``;if(!n)return!0;let o=e.fileInfo.frontmatter[n]===r;return i===`CONTAIN`?o:!o}case`TIME_RANGE`:{let t=new Date,n,r=t;if(typeof a!=`string`)return!0;switch(a){case`7d`:n=Pm(t,7);break;case`14d`:n=Pm(t,14);break;case`30d`:n=Pm(t,30);break;case`90d`:n=Pm(t,90);break;case`180d`:n=Pm(t,180);break;case`365d`:n=Pm(t,365);break;case`thisWeek`:n=Ks(t),r=xl(t);break;case`thisMonth`:n=ul(t),r=qc(t);break;case`thisYear`:n=hl(t),r=pl(t);break;case`lastWeek`:{let e=Pm(t,7);n=Ks(e),r=xl(e);break}case`lastMonth`:{let e=Bh(t,1);n=ul(e),r=qc(e);break}case`lastYear`:{let e=Xh(t,1);n=hl(e),r=pl(e);break}default:return!0}let o=new Date(e.createdAt);return i===`WITHIN`?Mm(o,{start:n,end:r}):i===`BEFORE`?o<n:!0}default:return!0}})}var wg,Tg=o((()=>{H(),$r(),li(),ng(),gg(),wg=async({memos:e,query:t={},filterOptions:n={},plugin:r,topK:i,forceRefresh:a=!1})=>{let o={onlyFilterType:`all`,filterArchived:!0,filterDeleted:!0,filterDoneTasks:!!n.filterDoneTasks,filterComments:!0,...n},s={...t};if(!r){let t=vg(e,s,o);if(i){let e=t.slice(0,i);return{ids:e.map(e=>e.id),total:t.length,partial:e.length<t.length}}return t}try{console.log(`ThinoDebug calculateMemos start`,{query:s,options:o,memos:e?.length,topK:i,forceRefresh:a});let t=await _g(r).filterMemos(e,s,o,i,a);return console.log(`ThinoDebug calculateMemos worker result`,{isArray:Array.isArray(t),hasIds:t&&`ids`in t,length:Array.isArray(t)?t.length:t?.ids?.length}),t}catch(t){console.error(`Failed to filter memos using worker, falling back to synchronous filtering`,t);let n=vg(e,s,o);if(console.log(`ThinoDebug calculateMemos fallback result`,{length:n?.length}),i){let e=n.slice(0,i);return{ids:e.map(e=>e.id),total:n.length,partial:e.length<n.length}}return n}}}));function Eg(e,t){switch(t){case`createdAt`:return e.createdAtTs??new Date(e.createdAt).getTime();case`updatedAt`:return e.updatedAtTs??new Date(e.updatedAt).getTime();case`content-length`:return e.content.length;case`sourceType`:return e.sourceType||``;case`thinoType`:return e.thinoType||``;case`pinned`:return e.pinned?1:0;default:return t in e&&e[t]||``}}function Dg(e,t,n){let r=0;if(typeof e==`number`&&typeof t==`number`)r=e-t;else if(typeof e==`string`&&typeof t==`string`)r=e.localeCompare(t);else{let n=String(e),i=String(t);r=n.localeCompare(i)}return n===`desc`?-r:r}function Og(e,t){return e.slice().sort((e,n)=>e.pinned===n.pinned?Dg(Eg(e,t.field),Eg(n,t.field),t.direction):e.pinned?-1:1)}function kg(){return{field:`createdAt`,direction:`desc`,label:`Created Time`}}function Ag(e){try{let t=e?.loadLocalStorage(`memoSortConfig`);if(t){let e=JSON.parse(t);if(e.field&&e.direction&&e.label)return e}}catch(e){console.warn(`Failed to load sort config:`,e)}return kg()}var jg=o((()=>{})),Mg,Ng=o((()=>{Ve(),nt(),tn(),bn(),jg(),Mg=ze()(Qe(Ye(tt(en(e=>({sort:kg(),setSort:t=>e(e=>void(e.sort=t))})),{name:`memo-sort-store-cache`,storage:yn.ui,partialize:e=>({sort:e.sort}),version:1}),{name:`memo-sort-store`})))})),Pg,Fg=o((()=>{Ve(),nt(),Pg=ze()(Ye((e,t)=>({tagCache:new Map,lastTagQuery:``,lastTagResult:[],quickTagFilter:(n,r)=>{let i=t().tagCache.get(r);if(i)return console.log(`ThinoDebug quickTagFilter: cache hit`,r),i;console.log(`ThinoDebug quickTagFilter: filtering`,r,`memos:`,n.length);let a=typeof r==`string`?r.split(`,`).map(e=>e.trim()).filter(Boolean):[],o=n.filter(e=>{if(e.rowStatus===`ARCHIVED`||e.deletedAt||e.content.includes(`comment:`))return!1;if(!a.length)return!0;let t=a.some(t=>{let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return[`^#${n}$`,`^#${n}\\s`,`\\s#${n}\\s`,`\\s#${n}$`,`^#${n}/`,`\\s#${n}/`,`#${n}\\n`,`\\n#${n}`].some(t=>new RegExp(t).test(e.content))}),n=e.fileInfo?.tags,r=[];if(Array.isArray(n))r=n.filter(Boolean).map(String);else if(typeof n==`string`)r=n.split(`,`).map(e=>e.trim()).filter(Boolean);else if(n&&typeof n[Symbol.iterator]==`function`)try{r=Array.from(n).map(String)}catch{r=[]}let i=r.length>0&&a.some(e=>r.some(t=>t===e||t.startsWith(`${e}/`)));return t||i});console.log(`ThinoDebug quickTagFilter: filtered result`,o.length);let s=new Map(t().tagCache);if(s.size>20){let e=s.keys().next().value;s.delete(e)}return s.set(r,o),e({tagCache:s,lastTagQuery:r,lastTagResult:o}),o},clearCache:()=>{console.log(`ThinoDebug quickTagFilter: clearing cache`),e({tagCache:new Map,lastTagQuery:``,lastTagResult:[]})}})))})),Ig,Lg,B,Rg=o((()=>{Ve(),nt(),tn(),bn(),Ig={totalMemos:0,indexedMemos:0,isIndexing:!1,lastIndexedAt:null,failedMemos:[]},Lg={enabled:!1,engineInstalled:!1,engineDownloading:!1,engineDownloadStatus:``,wasmReady:!1,modelReady:!1,assetDownloading:!1,assetDownloadProgress:0,assetDownloadStatus:``,assetDownloadError:null,embeddingReady:!1,loadingStatus:``,loadingProgress:0,indexStatus:{...Ig},messages:[],isProcessing:!1,conversations:[],activeConversationId:null,searchQuery:``,searchResults:[],isSearching:!1,providers:{},activeEmbeddingProvider:`local`,activeCompletionProvider:`openai`,embeddingModel:`Xenova/paraphrase-multilingual-MiniLM-L12-v2`},B=ze()(Qe(Ye(tt(en(e=>({...Lg,setEnabled:t=>e(e=>{e.enabled=t}),setEngineInstalled:t=>e(e=>{e.engineInstalled=t}),setEngineDownloading:t=>e(e=>{e.engineDownloading=t}),setEngineDownloadStatus:t=>e(e=>{e.engineDownloadStatus=t}),setWasmReady:t=>e(e=>{e.wasmReady=t}),setModelReady:t=>e(e=>{e.modelReady=t}),setAssetDownloading:t=>e(e=>{e.assetDownloading=t}),setAssetDownloadProgress:t=>e(e=>{e.assetDownloadProgress=t}),setAssetDownloadStatus:t=>e(e=>{e.assetDownloadStatus=t}),setAssetDownloadError:t=>e(e=>{e.assetDownloadError=t}),setEmbeddingReady:t=>e(e=>{e.embeddingReady=t}),setLoadingStatus:t=>e(e=>{e.loadingStatus=t}),setLoadingProgress:t=>e(e=>{e.loadingProgress=t}),updateIndexStatus:t=>e(e=>{Object.assign(e.indexStatus,t)}),resetIndexStatus:()=>e(e=>{e.indexStatus={...Ig}}),addMessage:t=>e(e=>{if(e.messages.push(t),e.activeConversationId){let n=e.conversations.find(t=>t.id===e.activeConversationId);n&&(n.messages.push(t),n.updatedAt=Date.now())}}),updateMessage:(t,n)=>e(e=>{let r=e.messages.findIndex(e=>e.id===t);if(r!==-1&&Object.assign(e.messages[r],n),e.activeConversationId){let r=e.conversations.find(t=>t.id===e.activeConversationId);if(r){let e=r.messages.find(e=>e.id===t);e&&(Object.assign(e,n),r.updatedAt=Date.now())}}}),clearMessages:()=>e(e=>{e.messages=[]}),setIsProcessing:t=>e(e=>{e.isProcessing=t}),createConversation:()=>{let t=`conv-${Date.now()}`,n=Date.now();return e(e=>{e.conversations.push({id:t,title:`New Chat`,messages:[],createdAt:n,updatedAt:n}),e.activeConversationId=t,e.messages=[]}),t},setActiveConversation:t=>e(e=>{if(e.activeConversationId=t,t){let n=e.conversations.find(e=>e.id===t);e.messages=n?n.messages.map(e=>({...e})):[]}else e.messages=[]}),deleteConversation:t=>e(e=>{e.conversations=e.conversations.filter(e=>e.id!==t),e.activeConversationId===t&&(e.activeConversationId=null,e.messages=[])}),renameConversation:(t,n)=>e(e=>{let r=e.conversations.find(e=>e.id===t);r&&(r.title=n)}),loadExternalMessages:t=>e(e=>{e.activeConversationId=null,e.messages=t}),setSearchQuery:t=>e(e=>{e.searchQuery=t}),setSearchResults:t=>e(e=>{e.searchResults=t}),setIsSearching:t=>e(e=>{e.isSearching=t}),updateProvider:(t,n)=>e(e=>{e.providers[t]={...e.providers[t],...n}}),removeProvider:t=>e(e=>{delete e.providers[t]}),setActiveEmbeddingProvider:t=>e(e=>{e.activeEmbeddingProvider=t}),setActiveCompletionProvider:t=>e(e=>{e.activeCompletionProvider=t}),setEmbeddingModel:t=>e(e=>{e.embeddingModel=t}),reset:()=>e(()=>({...Lg}))})),{name:`super-store-cache`,storage:yn.ui,partialize:e=>({enabled:e.enabled,providers:e.providers,activeEmbeddingProvider:e.activeEmbeddingProvider,activeCompletionProvider:e.activeCompletionProvider,embeddingModel:e.embeddingModel,conversations:e.conversations,activeConversationId:e.activeConversationId}),onRehydrateStorage:()=>(e,t)=>{t||queueMicrotask(()=>{let e=B.getState();e.activeConversationId&&e.setActiveConversation(e.activeConversationId)})},version:3,migrate:(e,t)=>(t<2&&(e.embeddingModel=`Xenova/paraphrase-multilingual-MiniLM-L12-v2`),t<3&&(e.conversations=e.conversations||[],e.activeConversationId=e.activeConversationId||null),e)}),{name:`super-store`})))}));function zg(e){let t=P.getState().memos,{query:n}=Si.getState(),{settings:r}=F.getState(),i=Vg.getState().filteredMemos;if(console.group(`=== Thino Search Debug ===`),console.log(`Total memos in store:`,t.length),console.log(`Filtered memos shown:`,i.length),console.log(`Current query:`,JSON.stringify(n,null,2)),console.log(`HideDoneTasks:`,r?.HideDoneTasks),e){let a=e.toLowerCase(),o=t.filter(e=>e.content.toLowerCase().includes(a));console.log(`Memos matching "${e}":`,o.length),o.forEach(e=>{let t=i.some(t=>t.id===e.id);console.log(` [${t?`SHOWN`:`HIDDEN`}] id=${e.id} type=${e.thinoType} source=${e.sourceType} rowStatus=${e.rowStatus} deleted=${!!e.deletedAt} content="${e.content.slice(0,60)}"`),t||(e.rowStatus===`ARCHIVED`&&console.log(` -> REASON: memo is archived`),e.deletedAt&&console.log(` -> REASON: memo is deleted`),e.content.includes(`comment:`)&&console.log(` -> REASON: content contains "comment:" (treated as comment)`),r?.HideDoneTasks&&e.thinoType===`TASK-DONE`&&console.log(` -> REASON: HideDoneTasks setting`),n.filter&&console.log(` -> CHECK: query.filter is active:`,n.filter),n.tag&&console.log(` -> CHECK: tag filter active:`,n.tag),n.type&&console.log(` -> CHECK: type filter active:`,n.type))}),o.length===0&&(console.log(`No memos contain this text. All task-type memos:`),t.filter(e=>e.thinoType?.startsWith(`TASK`)).forEach(e=>console.log(` id=${e.id} type=${e.thinoType} content="${e.content.slice(0,80)}"`)))}if(n.filter){let e=Zg.getQueryById(n.filter);e?console.log(`Active filter:`,e.title,`| filters:`,e.querystring):(console.warn(`STALE FILTER: query.filter references non-existent query:`,n.filter),console.warn(`Run: window.__thinoClearFilter() to clear it`))}console.groupEnd()}function Bg(){Si.getState().setFilterQuery(``),Vg.getState().recompute(),console.log(`Filter cleared. Recomputing...`)}var Vg,Hg=o((()=>{Ve(),nt(),Tg(),hi(),I(),Ng(),jg(),Fg(),H(),Rg(),typeof window<`u`&&(window.__thinoDebugSearch=zg,window.__thinoClearFilter=Bg),Vg=ze()(Ye((e,t)=>({filteredMemos:[],lastNonEmpty:[],isCalculating:!1,error:null,version:0,lastQuerySig:void 0,lastSortSig:void 0,lastTopKey:void 0,inflightSig:void 0,recompute:async()=>{let n=P.getState().memos,{query:r}=Si.getState(),{settings:i,plugin:a}=F.getState(),o=Mg.getState().sort;if(!n||n.length===0){e({isCalculating:!1}),console.log(`ThinoDebug recompute skipped: memos empty, keep previous view`);return}!r?.metadata||Object.keys(r.metadata).length;let s=B.getState().enabled&&r?.text?B.getState().searchResults.map(e=>e.entry.memoId).join(`,`):``,c=JSON.stringify({tag:r?.tag||``,dur:r?.duration?[r.duration.from,r.duration.to]:null,type:r?.type||``,text:r?.text||``,filter:r?.filter||``,path:r?.path||``,metadata:r?.metadata||{},hideDone:!!i?.HideDoneTasks,superResults:s}),l=JSON.stringify(o||null),u=P.getState().memosHash||``,d=t();if(d.lastQuerySig===c&&d.lastSortSig===l&&d.lastMemosSig===u&&!d.error){console.log(`ThinoDebug recompute skipped: no changes detected`);return}let f=`${c}|${l}|${u}`;if(d.inflightSig===f){console.log(`ThinoDebug recompute skipped: already in flight`);return}if(r?.tag&&!r.text&&!r.type&&!r.filter&&!r.path&&(!r.metadata||Object.keys(r.metadata).length===0)&&(!r.duration||r.duration.from===0&&r.duration.to===0)&&!i?.HideDoneTasks){console.log(`ThinoDebug recompute: using fast tag filter for`,r.tag);let t=Pg.getState().quickTagFilter(n,r.tag),i=Og(t,o);console.log(`ThinoDebug fast tag filter result`,{tag:r.tag,filteredCount:t.length,sortedCount:i.length}),e(e=>{let t=e.version+1;return{filteredMemos:[...i],lastNonEmpty:i.length>0?[...i]:e.lastNonEmpty,isCalculating:!1,error:null,version:t,lastQuerySig:c,lastSortSig:l,lastMemosSig:u,lastTopKey:i.slice(0,5).map(e=>`${e.id}-${e.updatedAt||e.createdAt}`).join(`,`),inflightSig:void 0}});return}let p=B.getState();if(p.enabled&&r?.text&&p.searchResults.length>0&&!p.isSearching){console.log(`ThinoDebug recompute: using Super search results`,{resultCount:p.searchResults.length,query:r.text});let t=new Map;p.searchResults.forEach((e,n)=>{t.has(e.entry.memoId)||t.set(e.entry.memoId,n)});let o=new Map(n.map(e=>[e.id,e])),s=[];for(let[e]of t){let t=o.get(e);t&&s.push(t)}let d=await wg({memos:s,query:{...r,text:``},filterOptions:{filterDoneTasks:i?.HideDoneTasks||!1},plugin:a});if(!Array.isArray(d))return;let f=new Set(d.map(e=>e.id)),m=s.filter(e=>f.has(e.id)),h=m.slice(0,5).map(e=>`${e.id}-${e.updatedAt||e.createdAt}`).join(`,`);e(e=>{let t=e.version+1;return{filteredMemos:[...m],lastNonEmpty:m.length>0?[...m]:e.lastNonEmpty,isCalculating:!1,error:null,version:t,lastQuerySig:c,lastSortSig:l,lastMemosSig:u,lastTopKey:h,inflightSig:void 0}});return}console.log(`ThinoDebug recompute: using Worker for complex query`,{query:r,hasTag:!!r?.tag,hasText:!!r?.text,hasType:!!r?.type,hasFilter:!!r?.filter}),e({inflightSig:f});try{let t=await wg({memos:n,query:r,filterOptions:{filterDoneTasks:i?.HideDoneTasks||!1},plugin:a});if(!Array.isArray(t))return;let s=Og(t,o),d=!r?.metadata||Object.keys(r.metadata).length===0,f=!(r?.tag||r?.duration&&r.duration.from<r.duration.to||r?.type||r?.text||r?.filter||r?.path||!d),p=(n?.length||0)>0,m=(s||[]).slice(0,5).map(e=>`${e.id}-${e.updatedAt||e.createdAt}`).join(`,`);e(e=>{if(e.lastQuerySig===c&&e.lastSortSig===l&&e.lastMemosSig===u&&e.lastTopKey===m&&e.filteredMemos.length===s.length)return console.log(`ThinoDebug recompute result unchanged, skipping update`),{isCalculating:!1,error:null,inflightSig:void 0};let t=p&&s.length===0&&f?e.lastNonEmpty.length>0?e.lastNonEmpty:e.filteredMemos:s,n=e.version+1;return console.log(`ThinoDebug recompute set filtered`,{nextLen:s.length,safeLen:t.length,prevVersion:e.version,nextVersion:n,queryEmpty:f}),{filteredMemos:[...t],lastNonEmpty:s.length>0?[...s]:e.lastNonEmpty,isCalculating:!1,error:null,version:n,lastQuerySig:c,lastSortSig:l,lastMemosSig:u,lastTopKey:m,inflightSig:void 0}})}catch(t){e(e=>({isCalculating:!1,error:t?.message||String(t),version:e.version+1}))}},setFilteredMemos:t=>e(()=>({filteredMemos:t})),quickInsertMemo:t=>{let{query:n}=Si.getState(),{settings:r}=F.getState(),i=Mg.getState().sort;if(!(()=>{if(!n||Object.keys(n).every(e=>!n[e]))return!0;if(n.tag&&!t.content.includes(`#${n.tag}`)||n.text&&!t.content.toLowerCase().includes(n.text.toLowerCase()))return!1;if(n.type)switch(n.type){case`NOT_TAGGED`:if(t.content.match(/#[^\s#]+/))return!1;break;case`LINKED`:if(!t.content.match(/\[.+?\]\(.+?\)/))return!1;break;case`IMAGED`:if(!t.content.match(/!\[.+?\]\(.+?\)/))return!1;break;case`CONNECTED`:if(!t.content.match(/\[\[.+?\]\]/))return!1;break}return!(r?.HideDoneTasks&&t.thinoType===`TASK-DONE`)})()){console.log(`ThinoDebug quickInsert: memo filtered out`,t.id);return}e(e=>{let n=Og([t,...[...e.filteredMemos]],i);return console.log(`ThinoDebug quickInsert: adding memo`,{memoId:t.id,prevCount:e.filteredMemos.length,newCount:n.length}),{filteredMemos:n,version:e.version+1,lastNonEmpty:n.length>0?n:e.lastNonEmpty}})},quickDeleteMemo:t=>{e(e=>{let n=e.filteredMemos.findIndex(e=>e.id===t);if(n===-1)return console.log(`ThinoDebug quickDelete: memo not in filtered list`,t),e;let r=[...e.filteredMemos];return r.splice(n,1),console.log(`ThinoDebug quickDelete: removing memo`,{memoId:t,prevCount:e.filteredMemos.length,newCount:r.length}),{filteredMemos:r,version:e.version+1,lastNonEmpty:r.length>0?r:[],lastMemosSig:void 0}})},quickDeleteBatch:n=>{n.length!==0&&(n.length<=10?e(e=>{let t=new Set(n),r=e.filteredMemos.filter(e=>!t.has(e.id));return r.length===e.filteredMemos.length?(console.log(`ThinoDebug quickDeleteBatch: no memos to remove`),e):r.length===e.filteredMemos.length&&r.every((t,n)=>t.id===e.filteredMemos[n].id)?e:(console.log(`ThinoDebug quickDeleteBatch: removing memos`,{removeCount:n.length,prevCount:e.filteredMemos.length,newCount:r.length}),{filteredMemos:r,version:e.version+1,lastNonEmpty:r.length>0?r:[],lastMemosSig:void 0})}):(console.log(`ThinoDebug quickDeleteBatch: large batch, triggering recompute`),t().recompute()))},quickUpdateBatch:n=>{if(n.length===0)return;let{query:r}=Si.getState(),{settings:i}=F.getState(),a=Mg.getState().sort;n.length<=10?e(e=>{let t=n.filter(e=>e.content&&e.content.trim()!==``&&e.rowStatus!==`DELETED`&&e.rowStatus!==`ARCHIVED`&&!e.deletedAt);if(console.log(`ThinoDebug quickUpdateBatch: filtering memos`,{inputCount:n.length,validCount:t.length,archivedCount:n.filter(e=>e.rowStatus===`ARCHIVED`).length,deletedCount:n.filter(e=>e.deletedAt).length,archivedIds:n.filter(e=>e.rowStatus===`ARCHIVED`).map(e=>e.id),currentFilteredCount:e.filteredMemos.length,currentFilteredIds:e.filteredMemos.map(e=>e.id)}),t.length===0){let t=new Set(n.map(e=>e.id)),r=e.filteredMemos.filter(e=>!t.has(e.id));return console.log(`ThinoDebug quickUpdateBatch: all memos empty/deleted/archived, removing`,{removeCount:n.length,prevCount:e.filteredMemos.length,newCount:r.length,removedIds:[...t],remainingIds:r.map(e=>e.id)}),{filteredMemos:r,version:e.version+1,lastNonEmpty:r.length>0?r:[],lastMemosSig:void 0}}let o=new Map(t.map(e=>[e.id,e])),s=new Set(n.map(e=>e.id)),c=e.filteredMemos.filter(e=>!s.has(e.id)||o.has(e.id)).map(e=>o.has(e.id)?o.get(e.id):e),l=new Set(e.filteredMemos.map(e=>e.id)),u=t.filter(e=>l.has(e.id)?!1:!r||Object.keys(r).every(e=>!r[e])?!0:!(r.tag&&!e.content.includes(`#${r.tag}`)||r.text&&!e.content.toLowerCase().includes(r.text.toLowerCase())||i?.HideDoneTasks&&e.thinoType===`TASK-DONE`));u.length>0&&(c=[...c,...u]);let d=Og(c,a);if(d.length===e.filteredMemos.length&&d.every((t,n)=>t.id===e.filteredMemos[n].id))return e;console.log(`ThinoDebug quickUpdateBatch: updating memos`,{inputCount:n.length,validCount:t.length,addedCount:u.length,finalCount:d.length});let f=d.length<e.filteredMemos.length;return{filteredMemos:d,version:e.version+1,lastNonEmpty:d.length>0?d:[],lastMemosSig:f?void 0:e.lastMemosSig}}):(console.log(`ThinoDebug quickUpdateBatch: large batch, triggering recompute`),t().recompute())}})))})),Ug,Wg,Gg=o((()=>{Ug=class{cache=new Map;DEFAULT_TTL=300*1e3;set(e,t,n){this.cache.set(e,{data:t,timestamp:Date.now(),ttl:n||this.DEFAULT_TTL})}get(e){let t=this.cache.get(e);return t?Date.now()-t.timestamp>t.ttl?(this.cache.delete(e),null):t.data:null}has(e){return this.get(e)!==null}clear(e){e?this.cache.delete(e):this.cache.clear()}getCachedMemos(e){return this.get(`memos:${e}`)}cacheMemos(e,t){this.set(`memos:${e}`,t,600*1e3)}getCachedFileContent(e){return this.get(`file:${e}`)}cacheFileContent(e,t){this.set(`file:${e}`,t,30*1e3)}invalidateFile(e){this.clear(`file:${e}`);for(let[e]of this.cache)e.startsWith(`memos:`)&&this.clear(e)}cleanup(){let e=Date.now();for(let[t,n]of this.cache)e-n.timestamp>n.ttl&&this.cache.delete(t)}},Wg=new Ug,setInterval(()=>{Wg.cleanup()},300*1e3)})),Kg=c({default:()=>V}),qg,Jg,V,Yg=o((()=>{qg=u(C()),us(),li(),I(),Go(),Sa(),M(),io(),H(),gs(),Pi(),Do(),Wa(),Hg(),Fg(),Gg(),Jg=class{initialized=!1;_pendingWritePaths=new Map;markPathPending(e){let t=this._pendingWritePaths.get(e);t&&clearTimeout(t);let n=setTimeout(()=>this._pendingWritePaths.delete(e),5e3);this._pendingWritePaths.set(e,n)}releasePathPending(e){let t=this._pendingWritePaths.get(e);t&&clearTimeout(t),this._pendingWritePaths.delete(e)}isPathPending(e){return this._pendingWritePaths.has(e)}getState(){return P.getState()}async fetchAllMemos(){let e=L.getState().settings;if(!e)return console.warn(`Settings not initialized yet in fetchAllMemos`),[];N.checkDailyInMulti(e);let t=`all-memos:${e.EnabledLocationList.map(e=>e.value).join(`,`)}`,n=Wg.get(t);if(n&&this.initialized)return n.memos.forEach(N.stampMemoTimestamps),n.commentMemos.forEach(N.stampMemoTimestamps),(0,qg.startTransition)(()=>{P.getState().setMemosAndComments(n.memos,n.commentMemos)}),this.fetchFreshMemos(e,t).catch(console.error),n.memos;Ua.start(`startup:api.getMyMemos`);let r=await ls.getMyMemos(e.EnabledLocationList.map(e=>e.value));Ua.end(`startup:api.getMyMemos`,{sources:e.EnabledLocationList.map(e=>e.value)});let i=[...r.memos],a=[...r.commentMemos];return Wg.set(t,{memos:i,commentMemos:a},300*1e3),i.forEach(N.stampMemoTimestamps),a.forEach(N.stampMemoTimestamps),(0,qg.startTransition)(()=>{P.getState().setMemosAndComments(i,a)}),queueMicrotask(()=>{Pg.getState().clearCache()}),this.initialized||(this.initialized=!0,R.setLoaded(!0)),i}async fetchFreshMemos(e,t){let n=await ls.getMyMemos(e.EnabledLocationList.map(e=>e.value)),r=[...n.memos],i=[...n.commentMemos];Wg.set(t,{memos:r,commentMemos:i},300*1e3);let a=P.getState().memosHash;r.forEach(N.stampMemoTimestamps),i.forEach(N.stampMemoTimestamps),N.computeMemosHash(r)!==a&&((0,qg.startTransition)(()=>{P.getState().setMemosAndComments(r,i)}),queueMicrotask(()=>{Pg.getState().clearCache()}))}async updateTypeMemos(e){let t=await ls.updateSpecificTypeMemo(e),n=this.getState().memos.filter(t=>t.sourceType!==e);P.getState().setMemos([...n,...t.memos])}async removeTypeMemos(e){let t=this.getState().memos.filter(t=>t.sourceType!==e);P.getState().setMemos([...t])}async fetchDeletedMemos(){let e=await ls.getMyDeletedMemos();return e.sort((e,t)=>N.getTimeStampByDate(t.deletedAt)-N.getTimeStampByDate(e.deletedAt)),e}pushMemo(e){P.getState().insertMemo(e),Vg.getState().quickInsertMemo(e),e.path&&this.releasePathPending(e.path)}pushCommentMemo(e){P.getState().insertCommentMemo(e),Vg.getState().recompute()}getMemoById(e){for(let t of this.getState().memos)if(t.id===e)return t;return null}getCommentMemoById(e){for(let t of this.getState().commentMemos)if(t.id===e)return t;return null}getMemoByWebId(e){for(let t of this.getState().memos)if(t.webId===e||t.id===e)return t;return null}async finishWaitingForTemplaterThinos(){let e=this.getState().preparingUpdateMemo;if(console.log(`preparingUpdateMemos`,e),e.length!==0)for(let t of e){let e=this.getMemoById(t.id),n=t.type===`local`?await Fo(t.origin,t.isList,t.date,!0):await Io(e);await this.replaceOldThinoWithNewThino(t.id,n),P.getState().removeParticularPrepareUpdateThino(t.id)}}async replaceOldThinoWithNewThino(e,t){this.getMemoById(e)&&P.getState().replaceMemoById(e,t)}async updateMemoById(e,t,n){let r=this.getMemoByWebId(e);if(!r)return;let i=null,a=n?{}:{content:t.content,rowStatus:t.rowStatus,pinned:t.pinned,deleted:!!t.deletedAt,thinoType:t.thinoType||`JOURNAL`},o=oi({...r,deleted:!!t.deletedAt},{...a,webId:t.id});if(console.log(`update web id`,r,o,t.id),o)return r;switch(r.sourceType){case`DAILY`:i=await _a(r,{id:r.id,webId:t.id,...a});break;case`CANVAS`:i=await ha(r,{id:r.id,webId:t.id,...a});break;case`MULTI`:i=await pa(r,{id:r.id,webId:t.id,...a});break;case`FILE`:i=await ma(r,{id:r.id,webId:t.id,...a});break;case`JOURNAL`:i=await ya(r,{id:r.id,webId:t.id,...a});break}if(!i)return r;P.getState().updateMemo(i)}async archiveThinoBulk(e){let t=[];for(let n of e){let e;switch(n.sourceType){case`DAILY`:e=await _a(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break;case`CANVAS`:e=await ha(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break;case`MULTI`:e=await pa(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break;case`FILE`:e=await ma(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break;case`JOURNAL`:e=await ya(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break}}return t.length>0?(P.getState().archiveMemoBulk(t),t):e}async dealWithDailyThinoBulk(e,t,n){let r=await va(e,t,n);return n===`deleteForever`?await this.deleteThinosWithIdBulk(r.map(e=>e.id)):this.editMemoBulk(r),r}async deleteThinosWithIdBulk(e){for(let t of e)P.getState().deleteMemoById(t)}async archiveMemo(e){let t=null;switch(e.sourceType){case`DAILY`:t=await _a(e,{id:e.id,rowStatus:`ARCHIVED`});break;case`CANVAS`:t=await ha(e,{id:e.id,rowStatus:`ARCHIVED`});break;case`MULTI`:t=await pa(e,{id:e.id,rowStatus:`ARCHIVED`});break;case`FILE`:t=await ma(e,{id:e.id,rowStatus:`ARCHIVED`});break;case`JOURNAL`:t=await ya(e,{id:e.id,rowStatus:`ARCHIVED`});break}if(!t)return e;P.getState().archiveMemo(t),Si.getState().query?.filter===`ARCHIVED`?Vg.getState().quickInsertMemo(t):Vg.getState().quickDeleteMemo(t.id);try{L.getState().plugin?.thinoWorkerManager?.memoUpdated(t.id)}catch{}return t}async pushToUpdateList(e,t){P.getState().prepareUpdateThino(e,t)}async removePrepareUpdateThinoById(e){P.getState().removeParticularPrepareUpdateThino(e)}async removePrepareUpdateThino(){P.getState().removePrepareUpdateThino()}async unarchiveThinoBulk(e){let t=[];for(let n of e){let e;switch(n.sourceType){case`DAILY`:e=await _a(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break;case`CANVAS`:e=await ha(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break;case`MULTI`:e=await pa(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break;case`FILE`:e=await ma(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break;case`JOURNAL`:e=await ya(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break}}return t.length>0?(P.getState().archiveMemoBulk(t),t):e}async unarchiveMemo(e){let t=null;switch(e.sourceType){case`DAILY`:t=await _a(e,{id:e.id,rowStatus:`NORMAL`});break;case`CANVAS`:t=await ha(e,{id:e.id,rowStatus:`NORMAL`});break;case`MULTI`:t=await pa(e,{id:e.id,rowStatus:`NORMAL`});break;case`FILE`:t=await ma(e,{id:e.id,rowStatus:`NORMAL`});break;case`JOURNAL`:t=await ya(e,{id:e.id,rowStatus:`NORMAL`});break}P.getState().unarchiveMemo(t),Si.getState().query?.filter===`ARCHIVED`?Vg.getState().quickDeleteMemo(t.id):Vg.getState().quickInsertMemo(t);try{L.getState().plugin?.thinoWorkerManager?.memoUpdated(t.id)}catch{}return t}async hideMemoById(e){let t=this.getMemoById(e);if(!t)return t;let n=null;switch(t.sourceType){case`DAILY`:n=await _a(t,{id:t.id,deleted:!0});break;case`CANVAS`:n=await ha(t,{id:t.id,deleted:!0});break;case`MULTI`:n=await pa(t,{id:t.id,deleted:!0});break;case`FILE`:n=await ma(t,{id:t.id,deleted:!0});break;case`JOURNAL`:n=await ya(t,{id:t.id,deleted:!0});break}if(!n)return t;if(n)return n}async restoreMemoById(e){return await ls.restoreMemo(e)}async deleteMemoById(e,t){let n=this.getMemoById(e);try{switch(n.sourceType){case`DAILY`:await ls.deleteMemoInDailyNote(n);break;case`CANVAS`:await ls.deleteMemoInCanvas(n);break;case`MULTI`:await ls.deleteMemoInMultiFiles(n);break;case`FILE`:await ls.deleteMemoInSingleFile(n);break;case`JOURNAL`:await ls.deleteMemoInJournalFile(n);break}P.getState().deleteMemoById(e),Vg.getState().quickDeleteMemo(e);try{L.getState().plugin?.thinoWorkerManager?.memoUpdated(n.id)}catch{}}catch(e){console.error(e),new f.Notice(j(`Failed to delete memo`))}t!==`local`&&n.webId&&await Eo.syncDelete(n.webId)}async removeMemosInFile(e,t){let n=[];try{if(e.path.endsWith(`.md`)&&!e.path.contains(`.thino`)&&!t){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());n.push(...t)}else if(e.path.contains(`thino.canvas`)){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());n.push(...t)}else if(e?.parent?.path.contains(t)||!e?.parent&&!e?.parent?.path){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());t.length>0&&n.push(...t)}else e.path.endsWith(`.md`)&&e.path.contains(`.thino`)&&await Ka(e,n);let r=n.map(e=>e.id);P.getState().deleteMemoBatch(r),r.length>0&&(Vg.getState().quickDeleteBatch(r),console.log(`ThinoDebug removeMemosInFile: removed`,r.length,`memos from`,e.path))}catch(e){console.error(e)}}async removeThinosByPath(e){let t=this.getState().memos.filter(t=>t.path===e).map(e=>e.id);P.getState().deleteMemoBatch(t),t.length>0&&(Vg.getState().quickDeleteBatch(t),console.log(`ThinoDebug removeThinosByPath: removed`,t.length,`memos from`,e))}async updateMemosInFile(e,t){let n=L.getState().app,r=await n.vault.adapter.exists(e.path);if(console.log(n,r),!r){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());if(t.length>0){console.log(`ThinoDebug updateMemosInFile: file no longer exists, removing`,t.length,`memos`);let e=t.map(e=>e.id);P.getState().deleteMemoBatch(e),Vg.getState().quickDeleteBatch(e),this.updateTagsState()}return}let i=[],a=async()=>{if(e.path.endsWith(`.md`)&&!e.path.contains(`.thino`)&&!t){await qa(e,i);return}else if(e.path.contains(`thino.canvas`)){await Ja(e,i);return}else if(e?.parent?.path.contains(t)&&!e.path.endsWith(`.thino.md`)){await Ga(e,i);return}else if(e.path.endsWith(`.thino.md`)){console.log(e),await Ka(e,i);return}};try{if(await a(),i.length===0){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());if(t.length>0){console.log(`ThinoDebug updateMemosInFile: file empty or deleted, removing`,t.length,`old memos`);let e=t.map(e=>e.id);P.getState().deleteMemoBatch(e),Vg.getState().quickDeleteBatch(e),this.updateTagsState();return}}try{let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim()),n=new Set(i.map(e=>e.id)),r=[];for(let e of t)n.has(e.id)||r.push(e.id);if(r.length>0){console.log(`ThinoDebug updateMemosInFile: removing missing memos for`,e.path,`count:`,r.length),P.getState().deleteMemoBatch(r);try{Vg.getState().quickDeleteBatch(r)}catch{}}}catch(e){console.debug(`ThinoDebug updateMemosInFile: cleanup diff failed`,e)}if(P.getState().updateMemoBatch(i,e.path),i.length<=10){console.log(`ThinoDebug updateMemosInFile: small update, using quickUpdateBatch for`,i.length,`memos`),Vg.getState().quickUpdateBatch(i);let e=L.getState().plugin;e&&e.thinoWorkerManager.memosUpdated(i.map(e=>e.id)),this.updateTagsState()}else console.log(`ThinoDebug updateMemosInFile: large update, using editMemoBulk for`,i.length,`memos`),this.editMemoBulk(i)}catch(e){console.error(e)}}async updateMemoProperty(e){let t=await pa(e,{id:N.randomId(16)});P.getState().updateMemo(t),Vg.getState().recompute()}editMemo(e,t=!1){P.getState().updateMemo(e);let n=L.getState().plugin;n&&!t&&n.thinoWorkerManager.memoUpdated(e.id),t||Vg.getState().recompute(),Eo.syncEdit(e)}editMemoBulk(e){let t=L.getState().plugin;t&&t.thinoWorkerManager.memosUpdated(e.map(e=>e.id));for(let t of e)this.editMemo(t,!0);this.updateTagsState(),e.length<=10?(console.log(`ThinoDebug editMemoBulk: small batch, using quickUpdateBatch for`,e.length,`memos`),Vg.getState().quickUpdateBatch(e)):(console.log(`ThinoDebug editMemoBulk: large batch, using recompute for`,e.length,`memos`),Vg.getState().recompute())}editCommentMemo(e){P.getState().updateCommentMemo(e)}getThinoViaKeyword(e){let{memos:t}=this.getState();return t.filter(t=>t.content.toLowerCase().includes(e?.toLowerCase()))}updateTagsStateThrottled=N.throttle(()=>{let{memos:e}=this.getState(),{plugin:t}=L.getState();!t||!e||e.length===0||t.thinoWorkerManager.buildTagTree(e).then(({tagsSet:e,counts:t})=>{P.getState().setTags(Array.from(e),t)})},300);async throttleUpdateTagsState(){this.updateTagsStateThrottled()}updateTagsState(){this.updateTagsStateThrottled()}clearMemos(){P.getState().clearMemos()}async getLinkedMemos(e){let{memos:t}=this.getState();return t.filter(t=>t.content.includes(e))}async getLinkedMemoByBlockId(e,t){let{memos:n}=this.getState();return n.find(n=>n.hasId===e?t&&n.path?n.path.includes(t)||t.includes(n.path):!0:!1)}async getLinkedMemosByLinkId(e,t){let{memos:n}=this.getState(),r=`${t}#^${e}`;return n.filter(n=>n.linkId?n.linkId.some(n=>n===r||t&&n.endsWith(`#^${e}`)):!1)}async getCommentMemos(e){let{memos:t}=this.getState();return t.filter(t=>t.content.includes(`comment: `+e))}async createMemoMultiFile({content:e,isList:t,name:n}){return await jo({content:e,isList:t,name:n})}async createMemoSingleFile({content:e,isList:t}){return await Mo({content:e,isList:t})}async createMemoJournalFile({content:e,isList:t}){return await Ho({content:e,isList:t})}async createOrPatchThinoFromWeb(e){let t=this.getState().memos;if(e.localId&&t?.some(t=>t.id===e.localId))return await this.updateMemoById(e.localId,e,!0),null;if(console.log(`thino`,e),t?.some(t=>t.id===e.id)||t?.some(t=>t.webId===e.id))return await this.updateMemoById(e.id,e,!1),console.log(`thino`,e),null;let n=e.sourceType,r=L.getState().settings;switch(r&&r?.saveThinoType&&(n=r.saveThinoType===`FILE`?e.sourceType:r.saveThinoType),n){case`FILE`:case`MULTI`:case`CANVAS`:return await No(e);case`DAILY`:case`JOURNAL`:return await Io(e);default:return await No(e)}}async initSync(){await Eo.pushToWeb()}async createMemoCanvas({text:e,isList:t}){return await Po({content:e,isList:t})}async createMemoDaily(e,t){return await Fo(e,t)}setWaitingForTemplater({origin:e,date:t,isList:n,id:r,type:i}){P.getState().setWaitingForTemplater({origin:e,date:t,isList:n,id:r,type:i})}async pinMemoById(e){let t=await ba(this.getMemoById(e));P.getState().pinMemo(t);let n=await Eo.syncPin(t.webId,!0);n&&this.editMemo(n)}async unpinMemoById(e){let t=await xa(this.getMemoById(e));P.getState().pinMemo(t);let n=await Eo.syncPin(t.webId,!1);n&&this.editMemo(n)}async importMemos(e,t,n){return await Fo(e,t,n)}async createThino({content:e,isList:t,type:n,name:r}){let i=null;switch(n.toLowerCase()){case`canvas`:i=await V.createMemoCanvas({text:e,isList:t});break;case`multi`:i=await V.createMemoMultiFile({content:e,isList:t,name:r});break;case`daily`:i=await V.createMemoDaily(e,t);break;case`file`:i=await V.createMemoSingleFile({content:e,isList:t});break;case`journal`:i=await V.createMemoJournalFile({content:e,isList:t});break;default:i=await V.createMemoDaily(e,t);break}let a=L.getState().plugin;return a&&a.thinoWorkerManager.memoUpdated(i.id),i&&n!==`DAILY`&&setTimeout(async()=>{let r=await Eo.syncCreate(e,n,t);r&&await this.updateMemoById(i.id,r,!0)},200),i}async openThinoByID(e){let t=this.getMemoById(e);if(console.log(t.path),t)switch(t.sourceType){case`DAILY`:await ps(t.id,t.path);break;case`CANVAS`:await hs(t.id,t.path);break;case`MULTI`:await fs(t.path);break;case`FILE`:await ms(t.id,t.path);break;case`JOURNAL`:await ps(t.id,t.path);break}}async updateMemo(e,t,n){let r=this.getMemoById(e);if(!r)return console.warn(`Memo with ID ${e} not found for update`),null;if(r){let e=null;switch(r.sourceType){case`DAILY`:e=await _a(r,{id:r.id,content:t,thinoType:n||r.thinoType});break;case`CANVAS`:e=await ha(r,{id:r.id,content:t,thinoType:n||r.thinoType});break;case`MULTI`:e=await pa(r,{id:r.id,content:t,thinoType:n||r.thinoType});break;case`FILE`:e=await ma(r,{id:r.id,content:t,thinoType:n||r.thinoType});break;case`JOURNAL`:e=await ya(r,{id:r.id,content:t,thinoType:n||r.thinoType});break}if(e)return this.editMemo(e),e}return console.warn(`Failed to update memo ${e}: no updated memo returned`),null}},V=new Jg})),Xg,Zg,Qg=o((()=>{us(),I(),qi(),H(),Xg=class{getState(){return ui.getState()}async getMyAllQueries(){let e=z.getState().query.filter,t=this.getQueryById(e),n=await ls.getMyQueries();return ui.getState().setQueries([...n,...t?[t]:[]]),n}getQueryById(e){return this.getState().queries.find(t=>t.id===e)}pushQuery(e){ui.getState().insertQuery(e)}editQuery(e){ui.getState().updateQuery(e)}async deleteQuery(e){await ls.deleteQueryById(e),ui.getState().deleteQueryById(e)}async createQuery(e,t){return await ls.createQuery(e,t)}createTempQuery(e,t){return Gi(e,t)}async updateQuery(e,t,n){return await ls.updateQuery(e,t,n)}async pinQuery(e){await ls.pinQuery(e)}async unpinQuery(e){await ls.unpinQuery(e)}},Zg=new Xg})),$g,e_,t_,n_=o((()=>{je(),I(),H(),$g=class{async upload(e){let{vault:t,fileManager:n}=F.getState().app,r=await e.arrayBuffer(),i=e_(e.type),a=ge(),o=(0,f.moment)(),s=ve(o,a),c;if(s)s instanceof f.TFile&&(c=await t.createBinary(await t.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,i,s),r));else{let e=await be(o);c=await t.createBinary(await t.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,i,e),r)}return n.generateMarkdownLink(c,c.path,``,``)}async parseHtml(e){let t=await e.text(),n=document.createElement(`html`);n.innerHTML=t;let r=Array.from(n.getElementsByClassName(`memo`));for(let e of r){let t=e.getElementsByClassName(`content`)[0],n=(0,f.htmlToMarkdown)(t.innerHTML),r=await V.importMemos(n,!0,(0,f.moment)(e.getElementsByClassName(`time`)[0].innerHTML));V.pushMemo(r)}}},e_=e=>/^image\/(.+)$/.exec(e)?.[1],t_=new $g})),H=o((()=>{Ai(),Pi(),Ii(),Yg(),Qg(),n_(),Do()})),r_=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,te(x);else{var t=n(l);t!==null&&ne(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&ne(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,A=ee.port2;ee.port1.onmessage=O,k=function(){A.postMessage(null)}}else k=function(){g(O,0)};function te(e){C=e,S||(S=!0,k())}function ne(t,n){w=g(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,te(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,ne(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,te(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i_=s(((e,t)=>{t.exports=r_()})),a_=s((e=>{var t=C(),n=i_();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),w=Symbol.for(`react.portal`),T=Symbol.for(`react.fragment`),E=Symbol.for(`react.strict_mode`),D=Symbol.for(`react.profiler`),O=Symbol.for(`react.provider`),k=Symbol.for(`react.context`),ee=Symbol.for(`react.forward_ref`),A=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=Symbol.for(`react.offscreen`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Object.assign,ce;function le(e){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||``}return`
- `+ce+e}var ue=!1;function de(e,t){if(!e||ue)return``;ue=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
- `),a=r.stack.split(`
- `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
- `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ue=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?le(e):``}function fe(e){switch(e.tag){case 5:return le(e.type);case 16:return le(`Lazy`);case 13:return le(`Suspense`);case 19:return le(`SuspenseList`);case 0:case 2:case 15:return e=de(e.type,!1),e;case 11:return e=de(e.type.render,!1),e;case 1:return e=de(e.type,!0),e;default:return``}}function pe(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case T:return`Fragment`;case w:return`Portal`;case D:return`Profiler`;case E:return`StrictMode`;case A:return`Suspense`;case te:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case k:return(e.displayName||`Context`)+`.Consumer`;case O:return(e._context.displayName||`Context`)+`.Provider`;case ee:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?pe(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}function me(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return pe(t);case 8:return t===E?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function he(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ge(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function _e(e){var t=ge(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ve(e){e._valueTracker||=_e(e)}function ye(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ge(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function be(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function xe(e,t){var n=t.checked;return se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Se(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=he(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function Ce(e,t){t=t.checked,t!=null&&b(e,`checked`,t,!1)}function we(e,t){Ce(e,t);var n=he(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Ee(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Ee(e,t.type,he(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Te(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Ee(e,t,n){(t!==`number`||be(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var De=Array.isArray;function Oe(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+he(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ke(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return se({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function Ae(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(De(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:he(n)}}function je(e,t){var n=he(t.value),r=he(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function Me(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function Ne(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function Pe(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?Ne(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Fe,Ie=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Fe||=document.createElement(`div`),Fe.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Fe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Le(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Re={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},ze=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Re).forEach(function(e){ze.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Re[t]=Re[e]})});function Be(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Re.hasOwnProperty(e)&&Re[e]?(``+t).trim():t+`px`}function Ve(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Be(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var He=se({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 Ue(e,t){if(t){if(He[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function We(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Ge=null;function Ke(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qe=null,Je=null,Ye=null;function Xe(e){if(e=Hi(e)){if(typeof qe!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Wi(t),qe(e.stateNode,e.type,t))}}function Ze(e){Je?Ye?Ye.push(e):Ye=[e]:Je=e}function Qe(){if(Je){var e=Je,t=Ye;if(Ye=Je=null,Xe(e),t)for(e=0;e<t.length;e++)Xe(t[e])}}function $e(e,t){return e(t)}function et(){}var tt=!1;function nt(e,t,n){if(tt)return e(t,n);tt=!0;try{return $e(e,t,n)}finally{tt=!1,(Je!==null||Ye!==null)&&(et(),Qe())}}function rt(e,t){var n=e.stateNode;if(n===null)return null;var i=Wi(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var it=!1;if(c)try{var at={};Object.defineProperty(at,`passive`,{get:function(){it=!0}}),window.addEventListener(`test`,at,at),window.removeEventListener(`test`,at,at)}catch{it=!1}function ot(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var st=!1,ct=null,lt=!1,ut=null,dt={onError:function(e){st=!0,ct=e}};function ft(e,t,n,r,i,a,o,s,c){st=!1,ct=null,ot.apply(dt,arguments)}function pt(e,t,n,i,a,o,s,c,l){if(ft.apply(this,arguments),st){if(st){var u=ct;st=!1,ct=null}else throw Error(r(198));lt||(lt=!0,ut=u)}}function mt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ht(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function gt(e){if(mt(e)!==e)throw Error(r(188))}function _t(e){var t=e.alternate;if(!t){if(t=mt(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return gt(a),e;if(o===i)return gt(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function vt(e){return e=_t(e),e===null?null:yt(e)}function yt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=yt(e);if(t!==null)return t;e=e.sibling}return null}var bt=n.unstable_scheduleCallback,xt=n.unstable_cancelCallback,St=n.unstable_shouldYield,Ct=n.unstable_requestPaint,wt=n.unstable_now,Tt=n.unstable_getCurrentPriorityLevel,Et=n.unstable_ImmediatePriority,Dt=n.unstable_UserBlockingPriority,Ot=n.unstable_NormalPriority,kt=n.unstable_LowPriority,At=n.unstable_IdlePriority,jt=null,Mt=null;function Nt(e){if(Mt&&typeof Mt.onCommitFiberRoot==`function`)try{Mt.onCommitFiberRoot(jt,e,void 0,(e.current.flags&128)==128)}catch{}}var Pt=Math.clz32?Math.clz32:Lt,Ft=Math.log,It=Math.LN2;function Lt(e){return e>>>=0,e===0?32:31-(Ft(e)/It|0)|0}var Rt=64,zt=4194304;function Bt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Vt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Bt(a))):r=Bt(s)}else o=n&~i,o===0?a!==0&&(r=Bt(a)):r=Bt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Pt(t),i=1<<n,r|=e[n],t&=~i;return r}function Ht(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ut(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Pt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ht(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Wt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Gt(){var e=Rt;return Rt<<=1,!(Rt&4194240)&&(Rt=64),e}function Kt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Pt(t),e[t]=n}function Jt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Pt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Xt=0;function Zt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qt,$t,en,tn,nn,rn=!1,an=[],on=null,sn=null,cn=null,ln=new Map,un=new Map,dn=[],fn=`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 pn(e,t){switch(e){case`focusin`:case`focusout`:on=null;break;case`dragenter`:case`dragleave`:sn=null;break;case`mouseover`:case`mouseout`:cn=null;break;case`pointerover`:case`pointerout`:ln.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:un.delete(t.pointerId)}}function mn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Hi(t),t!==null&&$t(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function hn(e,t,n,r,i){switch(t){case`focusin`:return on=mn(on,e,t,n,r,i),!0;case`dragenter`:return sn=mn(sn,e,t,n,r,i),!0;case`mouseover`:return cn=mn(cn,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return ln.set(a,mn(ln.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,un.set(a,mn(un.get(a)||null,e,t,n,r,i)),!0}return!1}function gn(e){var t=Vi(e.target);if(t!==null){var n=mt(t);if(n!==null){if(t=n.tag,t===13){if(t=ht(n),t!==null){e.blockedOn=t,nn(e.priority,function(){en(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function _n(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=On(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ge=r,n.target.dispatchEvent(r),Ge=null}else return t=Hi(n),t!==null&&$t(t),e.blockedOn=n,!1;t.shift()}return!0}function vn(e,t,n){_n(e)&&n.delete(t)}function yn(){rn=!1,on!==null&&_n(on)&&(on=null),sn!==null&&_n(sn)&&(sn=null),cn!==null&&_n(cn)&&(cn=null),ln.forEach(vn),un.forEach(vn)}function bn(e,t){e.blockedOn===t&&(e.blockedOn=null,rn||(rn=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,yn)))}function xn(e){function t(t){return bn(t,e)}if(0<an.length){bn(an[0],e);for(var n=1;n<an.length;n++){var r=an[n];r.blockedOn===e&&(r.blockedOn=null)}}for(on!==null&&bn(on,e),sn!==null&&bn(sn,e),cn!==null&&bn(cn,e),ln.forEach(t),un.forEach(t),n=0;n<dn.length;n++)r=dn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<dn.length&&(n=dn[0],n.blockedOn===null);)gn(n),n.blockedOn===null&&dn.shift()}var Sn=x.ReactCurrentBatchConfig,Cn=!0;function wn(e,t,n,r){var i=Xt,a=Sn.transition;Sn.transition=null;try{Xt=1,En(e,t,n,r)}finally{Xt=i,Sn.transition=a}}function Tn(e,t,n,r){var i=Xt,a=Sn.transition;Sn.transition=null;try{Xt=4,En(e,t,n,r)}finally{Xt=i,Sn.transition=a}}function En(e,t,n,r){if(Cn){var i=On(e,t,n,r);if(i===null)vi(e,t,r,Dn,n),pn(e,r);else if(hn(i,e,t,n,r))r.stopPropagation();else if(pn(e,r),t&4&&-1<fn.indexOf(e)){for(;i!==null;){var a=Hi(i);if(a!==null&&Qt(a),a=On(e,t,n,r),a===null&&vi(e,t,r,Dn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else vi(e,t,r,null,n)}}var Dn=null;function On(e,t,n,r){if(Dn=null,e=Ke(r),e=Vi(e),e!==null)if(t=mt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ht(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Dn=e,null}function kn(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(Tt()){case Et:return 1;case Dt:return 4;case Ot:case kt:return 16;case At:return 536870912;default:return 16}default:return 16}}var An=null,jn=null,Mn=null;function Nn(){if(Mn)return Mn;var e,t=jn,n=t.length,r,i=`value`in An?An.value:An.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Mn=i.slice(e,1<r?1-r:void 0)}function Pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Fn(){return!0}function In(){return!1}function Ln(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Fn:In,this.isPropagationStopped=In,this}return se(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Fn)},persist:function(){},isPersistent:Fn}),t}var Rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zn=Ln(Rn),Bn=se({},Rn,{view:0,detail:0}),Vn=Ln(Bn),Hn,Un,Wn,Gn=se({},Bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Wn&&(Wn&&e.type===`mousemove`?(Hn=e.screenX-Wn.screenX,Un=e.screenY-Wn.screenY):Un=Hn=0,Wn=e),Hn)},movementY:function(e){return`movementY`in e?e.movementY:Un}}),Kn=Ln(Gn),qn=Ln(se({},Gn,{dataTransfer:0})),Jn=Ln(se({},Bn,{relatedTarget:0})),Yn=Ln(se({},Rn,{animationName:0,elapsedTime:0,pseudoElement:0})),Xn=Ln(se({},Rn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Zn=Ln(se({},Rn,{data:0})),Qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},$n={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`},er={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function tr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=er[e])?!!t[e]:!1}function nr(){return tr}var rr=Ln(se({},Bn,{key:function(e){if(e.key){var t=Qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?$n[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nr,charCode:function(e){return e.type===`keypress`?Pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ir=Ln(se({},Gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ar=Ln(se({},Bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nr})),or=Ln(se({},Rn,{propertyName:0,elapsedTime:0,pseudoElement:0})),sr=Ln(se({},Gn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),cr=[9,13,27,32],lr=c&&`CompositionEvent`in window,ur=null;c&&`documentMode`in document&&(ur=document.documentMode);var dr=c&&`TextEvent`in window&&!ur,fr=c&&(!lr||ur&&8<ur&&11>=ur),pr=` `,mr=!1;function j(e,t){switch(e){case`keyup`:return cr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var M=!1;function gr(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(mr=!0,pr):null;case`textInput`:return e=t.data,e===pr&&mr?null:e;default:return null}}function _r(e,t){if(M)return e===`compositionend`||!lr&&j(e,t)?(e=Nn(),Mn=jn=An=null,M=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return fr&&t.locale!==`ko`?null:t.data;default:return null}}var vr={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 yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){Ze(r),t=bi(t,`onChange`),0<t.length&&(n=new zn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){pi(e,0)}function wr(e){if(ye(Ui(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(c){var Dr;if(c){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,Ke(e)),nt(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Br(e,t){var n=zr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=zr(n)}}function Vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(){for(var e=window,t=be();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=be(e.document)}return t}function Ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Wr(e){var t=Hr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Vr(n.ownerDocument.documentElement,n)){if(r!==null&&Ur(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Br(n,a);var o=Br(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Gr=c&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==be(r)||(r=Kr,`selectionStart`in r&&Ur(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jr&&Rr(Jr,r)||(Jr=r,r=bi(qr,`onSelect`),0<r.length&&(t=new zn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};c&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionend`),oi=new Map,si=`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 N(e,t){oi.set(e,t),o(t,[e])}for(var ci=0;ci<si.length;ci++){var li=si[ci];N(li.toLowerCase(),`on`+(li[0].toUpperCase()+li.slice(1)))}N(ni,`onAnimationEnd`),N(ri,`onAnimationIteration`),N(ii,`onAnimationStart`),N(`dblclick`,`onDoubleClick`),N(`focusin`,`onFocus`),N(`focusout`,`onBlur`),N(ai,`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 ui=`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(` `),di=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ui));function fi(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,pt(r,t,void 0,e),e.currentTarget=null}function pi(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;fi(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;fi(i,s,l),a=c}}}if(lt)throw e=ut,lt=!1,ut=null,e}function mi(e,t){var n=t[Ri];n===void 0&&(n=t[Ri]=new Set);var r=e+`__bubble`;n.has(r)||(_i(t,e,2,!1),n.add(r))}function P(e,t,n){var r=0;t&&(r|=4),_i(n,e,r,t)}var hi=`_reactListening`+Math.random().toString(36).slice(2);function gi(e){if(!e[hi]){e[hi]=!0,i.forEach(function(t){t!==`selectionchange`&&(di.has(t)||P(t,!1,e),P(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hi]||(t[hi]=!0,P(`selectionchange`,!1,t))}}function _i(e,t,n,r){switch(kn(t)){case 1:var i=wn;break;case 4:i=Tn;break;default:i=En}n=i.bind(null,t,n,e),i=void 0,!it||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function vi(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Vi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}nt(function(){var r=a,i=Ke(n),o=[];a:{var s=oi.get(e);if(s!==void 0){var c=zn,l=e;switch(e){case`keypress`:if(Pn(n)===0)break a;case`keydown`:case`keyup`:c=rr;break;case`focusin`:l=`focus`,c=Jn;break;case`focusout`:l=`blur`,c=Jn;break;case`beforeblur`:case`afterblur`:c=Jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=qn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=ar;break;case ni:case ri:case ii:c=Yn;break;case ai:c=or;break;case`scroll`:c=Vn;break;case`wheel`:c=sr;break;case`copy`:case`cut`:case`paste`:c=Xn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=ir}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=rt(p,f),h!=null&&u.push(yi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Ge&&(l=n.relatedTarget||n.fromElement)&&(Vi(l)||l[Li]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Vi(l):null,l!==null&&(d=mt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Kn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=ir,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Ui(c),m=l==null?s:Ui(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Vi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=xi(m))p++;for(m=0,h=f;h;h=xi(h))m++;for(;0<p-m;)u=xi(u),p--;for(;0<m-p;)f=xi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=xi(u),f=xi(f)}u=null}else u=null;c!==null&&Si(o,s,c,u,!1),l!==null&&d!==null&&Si(o,d,l,u,!0)}}a:{if(s=r?Ui(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=Tr;else if(yr(s))if(Er)g=Fr;else{g=Nr;var _=Mr}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Pr);if(g&&=g(e,r)){br(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&Ee(s,`number`,s.value)}switch(_=r?Ui(r):window,e){case`focusin`:(yr(_)||_.contentEditable===`true`)&&(Kr=_,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(o,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(o,n,i)}var v;if(lr)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else M?j(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(fr&&n.locale!==`ko`&&(M||y!==`onCompositionStart`?y===`onCompositionEnd`&&M&&(v=Nn()):(An=i,jn=`value`in An?An.value:An.textContent,M=!0)),_=bi(r,y),0<_.length&&(y=new Zn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=hr(n),v!==null&&(y.data=v)))),(v=dr?gr(e,n):_r(e,n))&&(r=bi(r,`onBeforeInput`),0<r.length&&(i=new Zn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}pi(o,t)})}function yi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function bi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=rt(e,n),a!=null&&r.unshift(yi(e,a,i)),a=rt(e,t),a!=null&&r.push(yi(e,a,i))),e=e.return}return r}function xi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Si(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=rt(n,a),c!=null&&o.unshift(yi(n,c,s))):i||(c=rt(n,a),c!=null&&o.push(yi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ci=/\r\n?/g,wi=/\u0000|\uFFFD/g;function F(e){return(typeof e==`string`?e:``+e).replace(Ci,`
- `).replace(wi,``)}function Ti(e,t,n){if(t=F(t),F(e)!==t&&n)throw Error(r(425))}function Ei(){}var Di=null,Oi=null;function I(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ki=typeof setTimeout==`function`?setTimeout:void 0,L=typeof clearTimeout==`function`?clearTimeout:void 0,Ai=typeof Promise==`function`?Promise:void 0,ji=typeof queueMicrotask==`function`?queueMicrotask:Ai===void 0?ki:function(e){return Ai.resolve(null).then(e).catch(Mi)};function Mi(e){setTimeout(function(){throw e})}function Ni(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),xn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);xn(t)}function R(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Pi(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Fi=Math.random().toString(36).slice(2),z=`__reactFiber$`+Fi,Ii=`__reactProps$`+Fi,Li=`__reactContainer$`+Fi,Ri=`__reactEvents$`+Fi,zi=`__reactListeners$`+Fi,Bi=`__reactHandles$`+Fi;function Vi(e){var t=e[z];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Li]||n[z]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Pi(e);e!==null;){if(n=e[z])return n;e=Pi(e)}return t}e=n,n=e.parentNode}return null}function Hi(e){return e=e[z]||e[Li],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ui(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Wi(e){return e[Ii]||null}var Gi=[],Ki=-1;function qi(e){return{current:e}}function Ji(e){0>Ki||(e.current=Gi[Ki],Gi[Ki]=null,Ki--)}function Yi(e,t){Ki++,Gi[Ki]=e.current,e.current=t}var Xi={},Zi=qi(Xi),Qi=qi(!1),$i=Xi;function ea(e,t){var n=e.type.contextTypes;if(!n)return Xi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ta(e){return e=e.childContextTypes,e!=null}function na(){Ji(Qi),Ji(Zi)}function ra(e,t,n){if(Zi.current!==Xi)throw Error(r(168));Yi(Zi,t),Yi(Qi,n)}function ia(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,me(e)||`Unknown`,a));return se({},n,i)}function aa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xi,$i=Zi.current,Yi(Zi,e),Yi(Qi,Qi.current),!0}function oa(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ia(e,t,$i),i.__reactInternalMemoizedMergedChildContext=e,Ji(Qi),Ji(Zi),Yi(Zi,e)):Ji(Qi),Yi(Qi,n)}var sa=null,ca=!1,la=!1;function ua(e){sa===null?sa=[e]:sa.push(e)}function da(e){ca=!0,ua(e)}function fa(){if(!la&&sa!==null){la=!0;var e=0,t=Xt;try{var n=sa;for(Xt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sa=null,ca=!1}catch(t){throw sa!==null&&(sa=sa.slice(e+1)),bt(Et,fa),t}finally{Xt=t,la=!1}}return null}var pa=[],ma=0,ha=null,ga=0,_a=[],va=0,ya=null,ba=1,xa=``;function Sa(e,t){pa[ma++]=ga,pa[ma++]=ha,ha=e,ga=t}function Ca(e,t,n){_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ya=e;var r=ba;e=xa;var i=32-Pt(r)-1;r&=~(1<<i),n+=1;var a=32-Pt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ba=1<<32-Pt(t)+i|n<<i|r,xa=a+e}else ba=1<<a|n<<i|r,xa=e}function wa(e){e.return!==null&&(Sa(e,1),Ca(e,1,0))}function Ta(e){for(;e===ha;)ha=pa[--ma],pa[ma]=null,ga=pa[--ma],pa[ma]=null;for(;e===ya;)ya=_a[--va],_a[va]=null,xa=_a[--va],_a[va]=null,ba=_a[--va],_a[va]=null}var Ea=null,Da=null,Oa=!1,ka=null;function Aa(e,t){var n=au(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ja(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,Ea=e,Da=R(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,Ea=e,Da=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=ya===null?null:{id:ba,overflow:xa},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=au(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ea=e,Da=null,!0);default:return!1}}function Ma(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Na(e){if(Oa){var t=Da;if(t){var n=t;if(!ja(e,t)){if(Ma(e))throw Error(r(418));t=R(n.nextSibling);var i=Ea;t&&ja(e,t)?Aa(i,n):(e.flags=e.flags&-4097|2,Oa=!1,Ea=e)}}else{if(Ma(e))throw Error(r(418));e.flags=e.flags&-4097|2,Oa=!1,Ea=e}}}function Pa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ea=e}function Fa(e){if(e!==Ea)return!1;if(!Oa)return Pa(e),Oa=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!I(e.type,e.memoizedProps)),t&&=Da){if(Ma(e))throw Ia(),Error(r(418));for(;t;)Aa(e,t),t=R(t.nextSibling)}if(Pa(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){Da=R(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Da=null}}else Da=Ea?R(e.stateNode.nextSibling):null;return!0}function Ia(){for(var e=Da;e;)e=R(e.nextSibling)}function La(){Da=Ea=null,Oa=!1}function Ra(e){ka===null?ka=[e]:ka.push(e)}var za=x.ReactCurrentBatchConfig;function Ba(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Va(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Ha(e){var t=e._init;return t(e._payload)}function Ua(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=cu(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=fu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===T?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===re&&Ha(i)===t.type)?(r=a(t,n.props),r.ref=Ba(e,t,n),r.return=e,r):(r=lu(n.type,n.key,n.props,null,e.mode,r),r.ref=Ba(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=uu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=fu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case S:return n=lu(t.type,t.key,t.props,null,e.mode,n),n.ref=Ba(e,null,t),n.return=e,n;case w:return t=pu(t,e.mode,n),t.return=e,t;case re:var r=t._init;return f(e,r(t._payload),n)}if(De(t)||oe(t))return t=uu(t,e.mode,n,null),t.return=e,t;Va(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case S:return n.key===i?l(e,t,n,r):null;case w:return n.key===i?u(e,t,n,r):null;case re:return i=n._init,p(e,t,i(n._payload),r)}if(De(n)||oe(n))return i===null?d(e,t,n,r,null):null;Va(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case S:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case w:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:var a=r._init;return m(e,t,n,a(r._payload),i)}if(De(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);Va(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Oa&&Sa(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Oa&&Sa(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Oa&&Sa(r,h),l}function g(a,s,c,l){var u=oe(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Oa&&Sa(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Oa&&Sa(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Oa&&Sa(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===T&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case S:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===T){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===re&&Ha(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ba(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===T?(r=uu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=lu(i.type,i.key,i.props,null,e.mode,o),o.ref=Ba(e,r,i),o.return=e,e=o)}return s(e);case w:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=pu(i,e.mode,o),r.return=e,e=r}return s(e);case re:return l=i._init,_(e,r,l(i._payload),o)}if(De(i))return h(e,r,i,o);if(oe(i))return g(e,r,i,o);Va(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=fu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Wa=Ua(!0),Ga=Ua(!1),Ka=qi(null),qa=null,Ja=null,Ya=null;function Xa(){Ya=Ja=qa=null}function Za(e){var t=Ka.current;Ji(Ka),e._currentValue=t}function Qa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $a(e,t){qa=e,Ya=Ja=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Us=!0),e.firstContext=null)}function eo(e){var t=e._currentValue;if(Ya!==e)if(e={context:e,memoizedValue:t,next:null},Ja===null){if(qa===null)throw Error(r(308));Ja=e,qa.dependencies={lanes:0,firstContext:e}}else Ja=Ja.next=e;return t}var to=null;function no(e){to===null?to=[e]:to.push(e)}function ro(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,no(t)):(n.next=i.next,i.next=n),t.interleaved=n,io(e,r)}function io(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ao=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function so(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function lo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$c&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,io(e,n)}return i=r.interleaved,i===null?(t.next=t,no(r)):(t.next=i.next,i.next=t),r.interleaved=t,io(e,n)}function uo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yt(e,n)}}function fo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function po(e,t,n,r){var i=e.updateQueue;ao=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=se({},d,f);break a;case 2:ao=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);sl|=o,e.lanes=o,e.memoizedState=d}}function mo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var ho={},go=qi(ho),_o=qi(ho),vo=qi(ho);function yo(e){if(e===ho)throw Error(r(174));return e}function bo(e,t){switch(Yi(vo,t),Yi(_o,e),Yi(go,ho),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Pe(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Pe(t,e)}Ji(go),Yi(go,t)}function xo(){Ji(go),Ji(_o),Ji(vo)}function So(e){yo(vo.current);var t=yo(go.current),n=Pe(t,e.type);t!==n&&(Yi(_o,e),Yi(go,n))}function Co(e){_o.current===e&&(Ji(go),Ji(_o))}var wo=qi(0);function To(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Eo=[];function Do(){for(var e=0;e<Eo.length;e++)Eo[e]._workInProgressVersionPrimary=null;Eo.length=0}var Oo=x.ReactCurrentDispatcher,ko=x.ReactCurrentBatchConfig,Ao=0,jo=null,Mo=null,No=null,Po=!1,Fo=!1,Io=0,Lo=0;function Ro(){throw Error(r(321))}function zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Bo(e,t,n,i,a,o){if(Ao=o,jo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Oo.current=e===null||e.memoizedState===null?Cs:ws,e=n(i,a),Fo){o=0;do{if(Fo=!1,Io=0,25<=o)throw Error(r(301));o+=1,No=Mo=null,t.updateQueue=null,Oo.current=Ts,e=n(i,a)}while(Fo)}if(Oo.current=Ss,t=Mo!==null&&Mo.next!==null,Ao=0,No=Mo=jo=null,Po=!1,t)throw Error(r(300));return e}function Vo(){var e=Io!==0;return Io=0,e}function Ho(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return No===null?jo.memoizedState=No=e:No=No.next=e,No}function Uo(){if(Mo===null){var e=jo.alternate;e=e===null?null:e.memoizedState}else e=Mo.next;var t=No===null?jo.memoizedState:No.next;if(t!==null)No=t,Mo=e;else{if(e===null)throw Error(r(310));Mo=e,e={memoizedState:Mo.memoizedState,baseState:Mo.baseState,baseQueue:Mo.baseQueue,queue:Mo.queue,next:null},No===null?jo.memoizedState=No=e:No=No.next=e}return No}function Wo(e,t){return typeof t==`function`?t(e):t}function Go(e){var t=Uo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Mo,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Ao&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,jo.lanes|=d,sl|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Lr(i,t.memoizedState)||(Us=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,jo.lanes|=o,sl|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ko(e){var t=Uo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Lr(o,t.memoizedState)||(Us=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function qo(){}function Jo(e,t){var n=jo,i=Uo(),a=t(),o=!Lr(i.memoizedState,a);if(o&&(i.memoizedState=a,Us=!0),i=i.queue,os(Zo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||No!==null&&No.memoizedState.tag&1){if(n.flags|=2048,ts(9,Xo.bind(null,n,i,a,t),void 0,null),el===null)throw Error(r(349));Ao&30||Yo(n,t,a)}return a}function Yo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=jo.updateQueue,t===null?(t={lastEffect:null,stores:null},jo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xo(e,t,n,r){t.value=n,t.getSnapshot=r,Qo(t)&&$o(e)}function Zo(e,t,n){return n(function(){Qo(t)&&$o(e)})}function Qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function $o(e){var t=io(e,1);t!==null&&Dl(t,e,1,-1)}function es(e){var t=Ho();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:e},t.queue=e,e=e.dispatch=vs.bind(null,jo,e),[t.memoizedState,e]}function ts(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=jo.updateQueue,t===null?(t={lastEffect:null,stores:null},jo.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function ns(){return Uo().memoizedState}function rs(e,t,n,r){var i=Ho();jo.flags|=e,i.memoizedState=ts(1|t,n,void 0,r===void 0?null:r)}function is(e,t,n,r){var i=Uo();r=r===void 0?null:r;var a=void 0;if(Mo!==null){var o=Mo.memoizedState;if(a=o.destroy,r!==null&&zo(r,o.deps)){i.memoizedState=ts(t,n,a,r);return}}jo.flags|=e,i.memoizedState=ts(1|t,n,a,r)}function as(e,t){return rs(8390656,8,e,t)}function os(e,t){return is(2048,8,e,t)}function ss(e,t){return is(4,2,e,t)}function cs(e,t){return is(4,4,e,t)}function ls(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function us(e,t,n){return n=n==null?null:n.concat([e]),is(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=Uo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=Uo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ms(e,t,n){return Ao&21?(Lr(n,t)||(n=Gt(),jo.lanes|=n,sl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Us=!0),e.memoizedState=n)}function hs(e,t){var n=Xt;Xt=n!==0&&4>n?n:4,e(!0);var r=ko.transition;ko.transition={};try{e(!1),t()}finally{Xt=n,ko.transition=r}}function gs(){return Uo().memoizedState}function _s(e,t,n){var r=El(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ys(e))bs(t,n);else if(n=ro(e,t,n,r),n!==null){var i=Tl();Dl(n,e,r,i),xs(n,t,r)}}function vs(e,t,n){var r=El(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ys(e))bs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Lr(s,o)){var c=t.interleaved;c===null?(i.next=i,no(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=ro(e,t,i,r),n!==null&&(i=Tl(),Dl(n,e,r,i),xs(n,t,r))}}function ys(e){var t=e.alternate;return e===jo||t!==null&&t===jo}function bs(e,t){Fo=Po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yt(e,n)}}var Ss={readContext:eo,useCallback:Ro,useContext:Ro,useEffect:Ro,useImperativeHandle:Ro,useInsertionEffect:Ro,useLayoutEffect:Ro,useMemo:Ro,useReducer:Ro,useRef:Ro,useState:Ro,useDebugValue:Ro,useDeferredValue:Ro,useTransition:Ro,useMutableSource:Ro,useSyncExternalStore:Ro,useId:Ro,unstable_isNewReconciler:!1},Cs={readContext:eo,useCallback:function(e,t){return Ho().memoizedState=[e,t===void 0?null:t],e},useContext:eo,useEffect:as,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),rs(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){return rs(4,2,e,t)},useMemo:function(e,t){var n=Ho();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ho();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=_s.bind(null,jo,e),[r.memoizedState,e]},useRef:function(e){var t=Ho();return e={current:e},t.memoizedState=e},useState:es,useDebugValue:ds,useDeferredValue:function(e){return Ho().memoizedState=e},useTransition:function(){var e=es(!1),t=e[0];return e=hs.bind(null,e[1]),Ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=jo,a=Ho();if(Oa){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),el===null)throw Error(r(349));Ao&30||Yo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Zo.bind(null,i,o,e),[e]),i.flags|=2048,ts(9,Xo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Ho(),t=el.identifierPrefix;if(Oa){var n=xa,r=ba;n=(r&~(1<<32-Pt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Io++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Lo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},ws={readContext:eo,useCallback:fs,useContext:eo,useEffect:os,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Go,useRef:ns,useState:function(){return Go(Wo)},useDebugValue:ds,useDeferredValue:function(e){return ms(Uo(),Mo.memoizedState,e)},useTransition:function(){return[Go(Wo)[0],Uo().memoizedState]},useMutableSource:qo,useSyncExternalStore:Jo,useId:gs,unstable_isNewReconciler:!1},Ts={readContext:eo,useCallback:fs,useContext:eo,useEffect:os,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Ko,useRef:ns,useState:function(){return Ko(Wo)},useDebugValue:ds,useDeferredValue:function(e){var t=Uo();return Mo===null?t.memoizedState=e:ms(t,Mo.memoizedState,e)},useTransition:function(){return[Ko(Wo)[0],Uo().memoizedState]},useMutableSource:qo,useSyncExternalStore:Jo,useId:gs,unstable_isNewReconciler:!1};function Es(e,t){if(e&&e.defaultProps){for(var n in t=se({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ds(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:se({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Os={isMounted:function(e){return(e=e._reactInternals)?mt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tl(),i=El(e),a=co(r,i);a.payload=t,n!=null&&(a.callback=n),t=lo(e,a,i),t!==null&&(Dl(t,e,i,r),uo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tl(),i=El(e),a=co(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=lo(e,a,i),t!==null&&(Dl(t,e,i,r),uo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tl(),r=El(e),i=co(n,r);i.tag=2,t!=null&&(i.callback=t),t=lo(e,i,r),t!==null&&(Dl(t,e,r,n),uo(t,e,r))}};function ks(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(i,a):!0}function As(e,t,n){var r=!1,i=Xi,a=t.contextType;return typeof a==`object`&&a?a=eo(a):(i=ta(t)?$i:Zi.current,r=t.contextTypes,a=(r=r!=null)?ea(e,i):Xi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Os,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function js(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Os.enqueueReplaceState(t,t.state,null)}function Ms(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},oo(e);var a=t.contextType;typeof a==`object`&&a?i.context=eo(a):(a=ta(t)?$i:Zi.current,i.context=ea(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Ds(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Os.enqueueReplaceState(i,i.state,null),po(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Ns(e,t){try{var n=``,r=t;do n+=fe(r),r=r.return;while(r);var i=n}catch(e){i=`
- Error generating stack: `+e.message+`
- `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Ps(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Fs(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Is=typeof WeakMap==`function`?WeakMap:Map;function Ls(e,t,n){n=co(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hl||(hl=!0,gl=r),Fs(e,t)},n}function Rs(e,t,n){n=co(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Fs(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Fs(e,t),typeof r!=`function`&&(_l===null?_l=new Set([this]):_l.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function zs(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Is;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Ql.bind(null,e,t,n),t.then(e,e))}function Bs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Vs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=co(-1,1),t.tag=2,lo(n,t,1))),n.lanes|=1),e)}var Hs=x.ReactCurrentOwner,Us=!1;function Ws(e,t,n,r){t.child=e===null?Ga(t,null,n,r):Wa(t,e.child,n,r)}function Gs(e,t,n,r,i){n=n.render;var a=t.ref;return $a(t,i),r=Bo(e,t,n,r,a,i),n=Vo(),e!==null&&!Us?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dc(e,t,i)):(Oa&&n&&wa(t),t.flags|=1,Ws(e,t,r,i),t.child)}function Ks(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ou(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,qs(e,t,a,r,i)):(e=lu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return dc(e,t,i)}return t.flags|=1,e=cu(a,r),e.ref=t.ref,e.return=t,t.child=e}function qs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref)if(Us=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Us=!0);else return t.lanes=e.lanes,dc(e,t,i)}return Xs(e,t,n,r,i)}function Js(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Yi(il,rl),rl|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Yi(il,rl),rl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Yi(il,rl),rl|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Yi(il,rl),rl|=r;return Ws(e,t,i,n),t.child}function Ys(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Xs(e,t,n,r,i){var a=ta(n)?$i:Zi.current;return a=ea(t,a),$a(t,i),n=Bo(e,t,n,r,a,i),r=Vo(),e!==null&&!Us?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dc(e,t,i)):(Oa&&r&&wa(t),t.flags|=1,Ws(e,t,n,i),t.child)}function Zs(e,t,n,r,i){if(ta(n)){var a=!0;aa(t)}else a=!1;if($a(t,i),t.stateNode===null)uc(e,t),As(t,n,r),Ms(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=eo(l):(l=ta(n)?$i:Zi.current,l=ea(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&js(t,o,r,l),ao=!1;var f=t.memoizedState;o.state=f,po(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Qi.current||ao?(typeof u==`function`&&(Ds(t,n,u,r),c=t.memoizedState),(s=ao||ks(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,so(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Es(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=eo(c):(c=ta(n)?$i:Zi.current,c=ea(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&js(t,o,r,c),ao=!1,f=t.memoizedState,o.state=f,po(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Qi.current||ao?(typeof p==`function`&&(Ds(t,n,p,r),m=t.memoizedState),(l=ao||ks(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Qs(e,t,n,r,a,i)}function Qs(e,t,n,r,i,a){Ys(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&oa(t,n,!1),dc(e,t,a);r=t.stateNode,Hs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Wa(t,e.child,null,a),t.child=Wa(t,null,s,a)):Ws(e,t,s,a),t.memoizedState=r.state,i&&oa(t,n,!0),t.child}function $s(e){var t=e.stateNode;t.pendingContext?ra(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ra(e,t.context,!1),bo(e,t.containerInfo)}function ec(e,t,n,r,i){return La(),Ra(i),t.flags|=256,Ws(e,t,n,r),t.child}var tc={dehydrated:null,treeContext:null,retryLane:0};function nc(e){return{baseLanes:e,cachePool:null,transitions:null}}function rc(e,t,n){var r=t.pendingProps,i=wo.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Yi(wo,i&1),e===null)return Na(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=du(o,r,0,null),e=uu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=nc(n),t.memoizedState=tc,e):ic(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return oc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=cu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=uu(a,o,n,null),a.flags|=2):a=cu(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?nc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=tc,r}return a=e.child,e=a.sibling,r=cu(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ic(e,t){return t=du({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function ac(e,t,n,r){return r!==null&&Ra(r),Wa(t,e.child,null,n),e=ic(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Ps(Error(r(422))),ac(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=du({mode:`visible`,children:i.children},a,0,null),o=uu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Wa(t,e.child,null,s),t.child.memoizedState=nc(s),t.memoizedState=tc,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return ac(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Ps(o,i,void 0),ac(e,t,s,i)}if(c=(s&e.childLanes)!==0,Us||c){if(i=el,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,io(e,a),Dl(i,e,a,-1))}return Vl(),i=Ps(Error(r(421))),ac(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=eu.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Da=R(a.nextSibling),Ea=t,Oa=!0,ka=null,e!==null&&(_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ba=e.id,xa=e.overflow,ya=t),t=ic(t,i.children),t.flags|=4096,t)}function sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qa(e.return,t,n)}function cc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function lc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ws(e,t,r.children,n),r=wo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sc(e,n,t);else if(e.tag===19)sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Yi(wo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&To(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),cc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&To(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}cc(t,!0,n,null,a);break;case`together`:cc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function uc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sl|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=cu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fc(e,t,n){switch(t.tag){case 3:$s(t),La();break;case 5:So(t);break;case 1:ta(t.type)&&aa(t);break;case 4:bo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Yi(Ka,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Yi(wo,wo.current&1),e=dc(e,t,n),e===null?null:e.sibling):rc(e,t,n):(Yi(wo,wo.current&1),t.flags|=128,null);Yi(wo,wo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return lc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Yi(wo,wo.current),r)break;return null;case 22:case 23:return t.lanes=0,Js(e,t,n)}return dc(e,t,n)}var pc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},mc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,yo(go.current);var o=null;switch(n){case`input`:i=xe(e,i),r=xe(e,r),o=[];break;case`select`:i=se({},i,{value:void 0}),r=se({},r,{value:void 0}),o=[];break;case`textarea`:i=ke(e,i),r=ke(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=Ei)}Ue(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&mi(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},hc=function(e,t,n,r){n!==r&&(t.flags|=4)};function gc(e,t){if(!Oa)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function _c(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vc(e,t,n){var i=t.pendingProps;switch(Ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _c(t),null;case 1:return ta(t.type)&&na(),_c(t),null;case 3:return i=t.stateNode,xo(),Ji(Qi),Ji(Zi),Do(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Fa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ka!==null&&(jl(ka),ka=null))),_c(t),null;case 5:Co(t);var o=yo(vo.current);if(n=t.type,e!==null&&t.stateNode!=null)mc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return _c(t),null}if(e=yo(go.current),Fa(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[z]=t,i[Ii]=s,e=(t.mode&1)!=0,n){case`dialog`:mi(`cancel`,i),mi(`close`,i);break;case`iframe`:case`object`:case`embed`:mi(`load`,i);break;case`video`:case`audio`:for(o=0;o<ui.length;o++)mi(ui[o],i);break;case`source`:mi(`error`,i);break;case`img`:case`image`:case`link`:mi(`error`,i),mi(`load`,i);break;case`details`:mi(`toggle`,i);break;case`input`:Se(i,s),mi(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},mi(`invalid`,i);break;case`textarea`:Ae(i,s),mi(`invalid`,i)}for(var c in Ue(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&Ti(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&Ti(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&mi(`scroll`,i)}switch(n){case`input`:ve(i),Te(i,s,!0);break;case`textarea`:ve(i),Me(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=Ei)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Ne(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[z]=t,e[Ii]=i,pc(e,t,!1,!1),t.stateNode=e;a:{switch(c=We(n,i),n){case`dialog`:mi(`cancel`,e),mi(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:mi(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ui.length;o++)mi(ui[o],e);o=i;break;case`source`:mi(`error`,e),o=i;break;case`img`:case`image`:case`link`:mi(`error`,e),mi(`load`,e),o=i;break;case`details`:mi(`toggle`,e),o=i;break;case`input`:Se(e,i),o=xe(e,i),mi(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=se({},i,{value:void 0}),mi(`invalid`,e);break;case`textarea`:Ae(e,i),o=ke(e,i),mi(`invalid`,e);break;default:o=i}for(s in Ue(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Ve(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Ie(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Le(e,u):typeof u==`number`&&Le(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&mi(`scroll`,e):u!=null&&b(e,s,u,c))}switch(n){case`input`:ve(e),Te(e,i,!1);break;case`textarea`:ve(e),Me(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+he(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&Oe(e,!!i.multiple,i.defaultValue,!0):Oe(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=Ei)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return _c(t),null;case 6:if(e&&t.stateNode!=null)hc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=yo(vo.current),yo(go.current),Fa(t)){if(i=t.stateNode,n=t.memoizedProps,i[z]=t,(s=i.nodeValue!==n)&&(e=Ea,e!==null))switch(e.tag){case 3:Ti(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Ti(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[z]=t,t.stateNode=i}return _c(t),null;case 13:if(Ji(wo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Oa&&Da!==null&&t.mode&1&&!(t.flags&128))Ia(),La(),t.flags|=98560,s=!1;else if(s=Fa(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[z]=t}else La(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_c(t),s=!1}else ka!==null&&(jl(ka),ka=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||wo.current&1?al===0&&(al=3):Vl())),t.updateQueue!==null&&(t.flags|=4),_c(t),null);case 4:return xo(),e===null&&gi(t.stateNode.containerInfo),_c(t),null;case 10:return Za(t.type._context),_c(t),null;case 17:return ta(t.type)&&na(),_c(t),null;case 19:if(Ji(wo),s=t.memoizedState,s===null)return _c(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)gc(s,!1);else{if(al!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=To(e),c!==null){for(t.flags|=128,gc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Yi(wo,wo.current&1|2),t.child}e=e.sibling}s.tail!==null&&wt()>pl&&(t.flags|=128,i=!0,gc(s,!1),t.lanes=4194304)}else{if(!i)if(e=To(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),gc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Oa)return _c(t),null}else 2*wt()-s.renderingStartTime>pl&&n!==1073741824&&(t.flags|=128,i=!0,gc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(_c(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=wt(),t.sibling=null,n=wo.current,Yi(wo,i?n&1|2:n&1),t);case 22:case 23:return Ll(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?rl&1073741824&&(_c(t),t.subtreeFlags&6&&(t.flags|=8192)):_c(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function yc(e,t){switch(Ta(t),t.tag){case 1:return ta(t.type)&&na(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xo(),Ji(Qi),Ji(Zi),Do(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Co(t),null;case 13:if(Ji(wo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));La()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ji(wo),null;case 4:return xo(),null;case 10:return Za(t.type._context),null;case 22:case 23:return Ll(),null;case 24:return null;default:return null}}var bc=!1,xc=!1,Sc=typeof WeakSet==`function`?WeakSet:Set,Cc=null;function wc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Zl(e,t,n)}else n.current=null}function Tc(e,t,n){try{n()}catch(n){Zl(e,t,n)}}var Ec=!1;function Dc(e,t){if(Di=Cn,e=Hr(),Ur(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Oi={focusedElem:e,selectionRange:n},Cn=!1,Cc=t;Cc!==null;)if(t=Cc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Cc=e;else for(;Cc!==null;){t=Cc;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Es(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Zl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Cc=e;break}Cc=t.return}return h=Ec,Ec=!1,h}function Oc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Tc(t,n,a)}i=i.next}while(i!==r)}}function kc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ac(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function jc(e){var t=e.alternate;t!==null&&(e.alternate=null,jc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[z],delete t[Ii],delete t[Ri],delete t[zi],delete t[Bi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mc(e){return e.tag===5||e.tag===3||e.tag===4}function Nc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Mc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ei));else if(r!==4&&(e=e.child,e!==null))for(Pc(e,t,n),e=e.sibling;e!==null;)Pc(e,t,n),e=e.sibling}function Fc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fc(e,t,n),e=e.sibling;e!==null;)Fc(e,t,n),e=e.sibling}var Ic=null,Lc=!1;function Rc(e,t,n){for(n=n.child;n!==null;)zc(e,t,n),n=n.sibling}function zc(e,t,n){if(Mt&&typeof Mt.onCommitFiberUnmount==`function`)try{Mt.onCommitFiberUnmount(jt,n)}catch{}switch(n.tag){case 5:xc||wc(n,t);case 6:var r=Ic,i=Lc;Ic=null,Rc(e,t,n),Ic=r,Lc=i,Ic!==null&&(Lc?(e=Ic,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ic.removeChild(n.stateNode));break;case 18:Ic!==null&&(Lc?(e=Ic,n=n.stateNode,e.nodeType===8?Ni(e.parentNode,n):e.nodeType===1&&Ni(e,n),xn(e)):Ni(Ic,n.stateNode));break;case 4:r=Ic,i=Lc,Ic=n.stateNode.containerInfo,Lc=!0,Rc(e,t,n),Ic=r,Lc=i;break;case 0:case 11:case 14:case 15:if(!xc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Tc(n,t,o),i=i.next}while(i!==r)}Rc(e,t,n);break;case 1:if(!xc&&(wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Zl(n,t,e)}Rc(e,t,n);break;case 21:Rc(e,t,n);break;case 22:n.mode&1?(xc=(r=xc)||n.memoizedState!==null,Rc(e,t,n),xc=r):Rc(e,t,n);break;default:Rc(e,t,n)}}function Bc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Sc),t.forEach(function(t){var r=tu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Vc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Ic=c.stateNode,Lc=!1;break a;case 3:Ic=c.stateNode.containerInfo,Lc=!0;break a;case 4:Ic=c.stateNode.containerInfo,Lc=!0;break a}c=c.return}if(Ic===null)throw Error(r(160));zc(o,s,a),Ic=null,Lc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Zl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Hc(t,e),t=t.sibling}function Hc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Vc(t,e),Uc(e),i&4){try{Oc(3,e,e.return),kc(3,e)}catch(t){Zl(e,e.return,t)}try{Oc(5,e,e.return)}catch(t){Zl(e,e.return,t)}}break;case 1:Vc(t,e),Uc(e),i&512&&n!==null&&wc(n,n.return);break;case 5:if(Vc(t,e),Uc(e),i&512&&n!==null&&wc(n,n.return),e.flags&32){var a=e.stateNode;try{Le(a,``)}catch(t){Zl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&Ce(a,o),We(c,s);var u=We(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Ve(a,f):d===`dangerouslySetInnerHTML`?Ie(a,f):d===`children`?Le(a,f):b(a,d,f,u)}switch(c){case`input`:we(a,o);break;case`textarea`:je(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?Oe(a,!!o.multiple,o.multiple?[]:``,!1):Oe(a,!!o.multiple,o.defaultValue,!0)):Oe(a,!!o.multiple,m,!1)}a[Ii]=o}catch(t){Zl(e,e.return,t)}}break;case 6:if(Vc(t,e),Uc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Zl(e,e.return,t)}}break;case 3:if(Vc(t,e),Uc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{xn(t.containerInfo)}catch(t){Zl(e,e.return,t)}break;case 4:Vc(t,e),Uc(e);break;case 13:Vc(t,e),Uc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(fl=wt())),i&4&&Bc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(xc=(u=xc)||d,Vc(t,e),xc=u):Vc(t,e),Uc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Cc=e,d=e.child;d!==null;){for(f=Cc=d;Cc!==null;){switch(p=Cc,m=p.child,p.tag){case 0:case 11:case 14:case 15:Oc(4,p,p.return);break;case 1:wc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Zl(i,n,e)}}break;case 5:wc(p,p.return);break;case 22:if(p.memoizedState!==null){qc(f);continue}}m===null?qc(f):(m.return=p,Cc=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Be(`display`,s))}catch(t){Zl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Zl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Vc(t,e),Uc(e),i&4&&Bc(e);break;case 21:break;default:Vc(t,e),Uc(e)}}function Uc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Mc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Le(a,``),i.flags&=-33),Fc(e,Nc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Pc(e,Nc(e),o);break;default:throw Error(r(161))}}catch(t){Zl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wc(e,t,n){Cc=e,Gc(e,t,n)}function Gc(e,t,n){for(var r=(e.mode&1)!=0;Cc!==null;){var i=Cc,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||bc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||xc;s=bc;var l=xc;if(bc=o,(xc=c)&&!l)for(Cc=i;Cc!==null;)o=Cc,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Jc(i):(c.return=o,Cc=c);for(;a!==null;)Cc=a,Gc(a,t,n),a=a.sibling;Cc=i,bc=s,xc=l}Kc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Cc=a):Kc(e,t,n)}}function Kc(e){for(;Cc!==null;){var t=Cc;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:xc||kc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!xc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Es(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&mo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}mo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&xn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}xc||t.flags&512&&Ac(t)}catch(e){Zl(t,t.return,e)}}if(t===e){Cc=null;break}if(n=t.sibling,n!==null){n.return=t.return,Cc=n;break}Cc=t.return}}function qc(e){for(;Cc!==null;){var t=Cc;if(t===e){Cc=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Cc=n;break}Cc=t.return}}function Jc(e){for(;Cc!==null;){var t=Cc;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{kc(4,t)}catch(e){Zl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Zl(t,i,e)}}var a=t.return;try{Ac(t)}catch(e){Zl(t,a,e)}break;case 5:var o=t.return;try{Ac(t)}catch(e){Zl(t,o,e)}}}catch(e){Zl(t,t.return,e)}if(t===e){Cc=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Cc=s;break}Cc=t.return}}var Yc=Math.ceil,Xc=x.ReactCurrentDispatcher,Zc=x.ReactCurrentOwner,Qc=x.ReactCurrentBatchConfig,$c=0,el=null,tl=null,nl=0,rl=0,il=qi(0),al=0,ol=null,sl=0,cl=0,ll=0,ul=null,dl=null,fl=0,pl=1/0,ml=null,hl=!1,gl=null,_l=null,vl=!1,yl=null,bl=0,xl=0,Sl=null,Cl=-1,wl=0;function Tl(){return $c&6?wt():Cl===-1?Cl=wt():Cl}function El(e){return e.mode&1?$c&2&&nl!==0?nl&-nl:za.transition===null?(e=Xt,e===0?(e=window.event,e=e===void 0?16:kn(e.type),e):e):(wl===0&&(wl=Gt()),wl):1}function Dl(e,t,n,i){if(50<xl)throw xl=0,Sl=null,Error(r(185));qt(e,n,i),(!($c&2)||e!==el)&&(e===el&&(!($c&2)&&(cl|=n),al===4&&Nl(e,nl)),Ol(e,i),n===1&&$c===0&&!(t.mode&1)&&(pl=wt()+500,ca&&fa()))}function Ol(e,t){var n=e.callbackNode;Ut(e,t);var r=Vt(e,e===el?nl:0);if(r===0)n!==null&&xt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&xt(n),t===1)e.tag===0?da(Pl.bind(null,e)):ua(Pl.bind(null,e)),ji(function(){!($c&6)&&fa()}),n=null;else{switch(Zt(r)){case 1:n=Et;break;case 4:n=Dt;break;case 16:n=Ot;break;case 536870912:n=At;break;default:n=Ot}n=ru(n,kl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function kl(e,t){if(Cl=-1,wl=0,$c&6)throw Error(r(327));var n=e.callbackNode;if(Yl()&&e.callbackNode!==n)return null;var i=Vt(e,e===el?nl:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Hl(e,i);else{t=i;var a=$c;$c|=2;var o=Bl();(el!==e||nl!==t)&&(ml=null,pl=wt()+500,Rl(e,t));do try{Wl();break}catch(t){zl(e,t)}while(1);Xa(),Xc.current=o,$c=a,tl===null?(el=null,nl=0,t=al):t=0}if(t!==0){if(t===2&&(a=Wt(e),a!==0&&(i=a,t=Al(e,a))),t===1)throw n=ol,Rl(e,0),Nl(e,i),Ol(e,wt()),n;if(t===6)Nl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Ml(a)&&(t=Hl(e,i),t===2&&(o=Wt(e),o!==0&&(i=o,t=Al(e,o))),t===1))throw n=ol,Rl(e,0),Nl(e,i),Ol(e,wt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:ql(e,dl,ml);break;case 3:if(Nl(e,i),(i&130023424)===i&&(t=fl+500-wt(),10<t)){if(Vt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){Tl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ki(ql.bind(null,e,dl,ml),t);break}ql(e,dl,ml);break;case 4:if(Nl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-Pt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=wt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Yc(i/1960))-i,10<i){e.timeoutHandle=ki(ql.bind(null,e,dl,ml),i);break}ql(e,dl,ml);break;case 5:ql(e,dl,ml);break;default:throw Error(r(329))}}}return Ol(e,wt()),e.callbackNode===n?kl.bind(null,e):null}function Al(e,t){var n=ul;return e.current.memoizedState.isDehydrated&&(Rl(e,t).flags|=256),e=Hl(e,t),e!==2&&(t=dl,dl=n,t!==null&&jl(t)),e}function jl(e){dl===null?dl=e:dl.push.apply(dl,e)}function Ml(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Lr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Nl(e,t){for(t&=~ll,t&=~cl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Pt(t),r=1<<n;e[n]=-1,t&=~r}}function Pl(e){if($c&6)throw Error(r(327));Yl();var t=Vt(e,0);if(!(t&1))return Ol(e,wt()),null;var n=Hl(e,t);if(e.tag!==0&&n===2){var i=Wt(e);i!==0&&(t=i,n=Al(e,i))}if(n===1)throw n=ol,Rl(e,0),Nl(e,t),Ol(e,wt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ql(e,dl,ml),Ol(e,wt()),null}function Fl(e,t){var n=$c;$c|=1;try{return e(t)}finally{$c=n,$c===0&&(pl=wt()+500,ca&&fa())}}function Il(e){yl!==null&&yl.tag===0&&!($c&6)&&Yl();var t=$c;$c|=1;var n=Qc.transition,r=Xt;try{if(Qc.transition=null,Xt=1,e)return e()}finally{Xt=r,Qc.transition=n,$c=t,!($c&6)&&fa()}}function Ll(){rl=il.current,Ji(il)}function Rl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,L(n)),tl!==null)for(n=tl.return;n!==null;){var r=n;switch(Ta(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&na();break;case 3:xo(),Ji(Qi),Ji(Zi),Do();break;case 5:Co(r);break;case 4:xo();break;case 13:Ji(wo);break;case 19:Ji(wo);break;case 10:Za(r.type._context);break;case 22:case 23:Ll()}n=n.return}if(el=e,tl=e=cu(e.current,null),nl=rl=t,al=0,ol=null,ll=cl=sl=0,dl=ul=null,to!==null){for(t=0;t<to.length;t++)if(n=to[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}to=null}return e}function zl(e,t){do{var n=tl;try{if(Xa(),Oo.current=Ss,Po){for(var i=jo.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Po=!1}if(Ao=0,No=Mo=jo=null,Fo=!1,Io=0,Zc.current=null,n===null||n.return===null){al=1,ol=t,tl=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=nl,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Bs(s);if(m!==null){m.flags&=-257,Vs(m,s,c,o,t),m.mode&1&&zs(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){zs(o,u,t),Vl();break a}l=Error(r(426))}}else if(Oa&&c.mode&1){var _=Bs(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Vs(_,s,c,o,t),Ra(Ns(l,c));break a}}o=l=Ns(l,c),al!==4&&(al=2),ul===null?ul=[o]:ul.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Ls(o,l,t);fo(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(_l===null||!_l.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Rs(o,c,t);fo(o,x);break a}}o=o.return}while(o!==null)}Kl(n)}catch(e){t=e,tl===n&&n!==null&&(tl=n=n.return);continue}break}while(1)}function Bl(){var e=Xc.current;return Xc.current=Ss,e===null?Ss:e}function Vl(){(al===0||al===3||al===2)&&(al=4),el===null||!(sl&268435455)&&!(cl&268435455)||Nl(el,nl)}function Hl(e,t){var n=$c;$c|=2;var i=Bl();(el!==e||nl!==t)&&(ml=null,Rl(e,t));do try{Ul();break}catch(t){zl(e,t)}while(1);if(Xa(),$c=n,Xc.current=i,tl!==null)throw Error(r(261));return el=null,nl=0,al}function Ul(){for(;tl!==null;)Gl(tl)}function Wl(){for(;tl!==null&&!St();)Gl(tl)}function Gl(e){var t=nu(e.alternate,e,rl);e.memoizedProps=e.pendingProps,t===null?Kl(e):tl=t,Zc.current=null}function Kl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=yc(n,t),n!==null){n.flags&=32767,tl=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{al=6,tl=null;return}}else if(n=vc(n,t,rl),n!==null){tl=n;return}if(t=t.sibling,t!==null){tl=t;return}tl=t=e}while(t!==null);al===0&&(al=5)}function ql(e,t,n){var r=Xt,i=Qc.transition;try{Qc.transition=null,Xt=1,Jl(e,t,n,r)}finally{Qc.transition=i,Xt=r}return null}function Jl(e,t,n,i){do Yl();while(yl!==null);if($c&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Jt(e,o),e===el&&(tl=el=null,nl=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||vl||(vl=!0,ru(Ot,function(){return Yl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Qc.transition,Qc.transition=null;var s=Xt;Xt=1;var c=$c;$c|=4,Zc.current=null,Dc(e,n),Hc(n,e),Wr(Oi),Cn=!!Di,Oi=Di=null,e.current=n,Wc(n,e,a),Ct(),$c=c,Xt=s,Qc.transition=o}else e.current=n;if(vl&&(vl=!1,yl=e,bl=a),o=e.pendingLanes,o===0&&(_l=null),Nt(n.stateNode,i),Ol(e,wt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(hl)throw hl=!1,e=gl,gl=null,e;return bl&1&&e.tag!==0&&Yl(),o=e.pendingLanes,o&1?e===Sl?xl++:(xl=0,Sl=e):xl=0,fa(),null}function Yl(){if(yl!==null){var e=Zt(bl),t=Qc.transition,n=Xt;try{if(Qc.transition=null,Xt=16>e?16:e,yl===null)var i=!1;else{if(e=yl,yl=null,bl=0,$c&6)throw Error(r(331));var a=$c;for($c|=4,Cc=e.current;Cc!==null;){var o=Cc,s=o.child;if(Cc.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(Cc=u;Cc!==null;){var d=Cc;switch(d.tag){case 0:case 11:case 15:Oc(8,d,o)}var f=d.child;if(f!==null)f.return=d,Cc=f;else for(;Cc!==null;){d=Cc;var p=d.sibling,m=d.return;if(jc(d),d===u){Cc=null;break}if(p!==null){p.return=m,Cc=p;break}Cc=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}Cc=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Cc=s;else b:for(;Cc!==null;){if(o=Cc,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Oc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,Cc=v;break b}Cc=o.return}}var y=e.current;for(Cc=y;Cc!==null;){s=Cc;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,Cc=b;else b:for(s=y;Cc!==null;){if(c=Cc,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:kc(9,c)}}catch(e){Zl(c,c.return,e)}if(c===s){Cc=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,Cc=x;break b}Cc=c.return}}if($c=a,fa(),Mt&&typeof Mt.onPostCommitFiberRoot==`function`)try{Mt.onPostCommitFiberRoot(jt,e)}catch{}i=!0}return i}finally{Xt=n,Qc.transition=t}}return!1}function Xl(e,t,n){t=Ns(n,t),t=Ls(e,t,1),e=lo(e,t,1),t=Tl(),e!==null&&(qt(e,1,t),Ol(e,t))}function Zl(e,t,n){if(e.tag===3)Xl(e,e,n);else for(;t!==null;){if(t.tag===3){Xl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_l===null||!_l.has(r))){e=Ns(n,e),e=Rs(t,e,1),t=lo(t,e,1),e=Tl(),t!==null&&(qt(t,1,e),Ol(t,e));break}}t=t.return}}function Ql(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Tl(),e.pingedLanes|=e.suspendedLanes&n,el===e&&(nl&n)===n&&(al===4||al===3&&(nl&130023424)===nl&&500>wt()-fl?Rl(e,0):ll|=n),Ol(e,t)}function $l(e,t){t===0&&(e.mode&1?(t=zt,zt<<=1,!(zt&130023424)&&(zt=4194304)):t=1);var n=Tl();e=io(e,t),e!==null&&(qt(e,t,n),Ol(e,n))}function eu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$l(e,n)}function tu(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),$l(e,n)}var nu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qi.current)Us=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Us=!1,fc(e,t,n);Us=!!(e.flags&131072)}else Us=!1,Oa&&t.flags&1048576&&Ca(t,ga,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;uc(e,t),e=t.pendingProps;var a=ea(t,Zi.current);$a(t,n),a=Bo(null,t,i,e,a,n);var o=Vo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ta(i)?(o=!0,aa(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,oo(t),a.updater=Os,t.stateNode=a,a._reactInternals=t,Ms(t,i,e,n),t=Qs(null,t,i,!0,o,n)):(t.tag=0,Oa&&o&&wa(t),Ws(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(uc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=su(i),e=Es(i,e),a){case 0:t=Xs(null,t,i,e,n);break a;case 1:t=Zs(null,t,i,e,n);break a;case 11:t=Gs(null,t,i,e,n);break a;case 14:t=Ks(null,t,i,Es(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Es(i,a),Xs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Es(i,a),Zs(e,t,i,a,n);case 3:a:{if($s(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,so(e,t),po(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ns(Error(r(423)),t),t=ec(e,t,i,n,a);break a}else if(i!==a){a=Ns(Error(r(424)),t),t=ec(e,t,i,n,a);break a}else for(Da=R(t.stateNode.containerInfo.firstChild),Ea=t,Oa=!0,ka=null,n=Ga(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(La(),i===a){t=dc(e,t,n);break a}Ws(e,t,i,n)}t=t.child}return t;case 5:return So(t),e===null&&Na(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,I(i,a)?s=null:o!==null&&I(i,o)&&(t.flags|=32),Ys(e,t),Ws(e,t,s,n),t.child;case 6:return e===null&&Na(t),null;case 13:return rc(e,t,n);case 4:return bo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Wa(t,null,i,n):Ws(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Es(i,a),Gs(e,t,i,a,n);case 7:return Ws(e,t,t.pendingProps,n),t.child;case 8:return Ws(e,t,t.pendingProps.children,n),t.child;case 12:return Ws(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Yi(Ka,i._currentValue),i._currentValue=s,o!==null)if(Lr(o.value,s)){if(o.children===a.children&&!Qi.current){t=dc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=co(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Qa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Qa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ws(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,$a(t,n),a=eo(a),i=i(a),t.flags|=1,Ws(e,t,i,n),t.child;case 14:return i=t.type,a=Es(i,t.pendingProps),a=Es(i.type,a),Ks(e,t,i,a,n);case 15:return qs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Es(i,a),uc(e,t),t.tag=1,ta(i)?(e=!0,aa(t)):e=!1,$a(t,n),As(t,i,a),Ms(t,i,a,n),Qs(null,t,i,!0,e,n);case 19:return lc(e,t,n);case 22:return Js(e,t,n)}throw Error(r(156,t.tag))};function ru(e,t){return bt(e,t)}function iu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function au(e,t,n,r){return new iu(e,t,n,r)}function ou(e){return e=e.prototype,!(!e||!e.isReactComponent)}function su(e){if(typeof e==`function`)return ou(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ee)return 11;if(e===ne)return 14}return 2}function cu(e,t){var n=e.alternate;return n===null?(n=au(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function lu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ou(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case T:return uu(n.children,a,o,t);case E:s=8,a|=8;break;case D:return e=au(12,n,t,a|2),e.elementType=D,e.lanes=o,e;case A:return e=au(13,n,t,a),e.elementType=A,e.lanes=o,e;case te:return e=au(19,n,t,a),e.elementType=te,e.lanes=o,e;case ie:return du(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case O:s=10;break a;case k:s=9;break a;case ee:s=11;break a;case ne:s=14;break a;case re:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=au(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function uu(e,t,n,r){return e=au(7,e,r,t),e.lanes=n,e}function du(e,t,n,r){return e=au(22,e,r,t),e.elementType=ie,e.lanes=n,e.stateNode={isHidden:!1},e}function fu(e,t,n){return e=au(6,e,null,t),e.lanes=n,e}function pu(e,t,n){return t=au(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Kt(0),this.expirationTimes=Kt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hu(e,t,n,r,i,a,o,s,c){return e=new mu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=au(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oo(a),e}function gu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:w,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function _u(e){if(!e)return Xi;e=e._reactInternals;a:{if(mt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(ta(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(ta(n))return ia(e,n,t)}return t}function vu(e,t,n,r,i,a,o,s,c){return e=hu(n,r,!0,e,i,a,o,s,c),e.context=_u(null),n=e.current,r=Tl(),i=El(n),a=co(r,i),a.callback=t??null,lo(n,a,i),e.current.lanes=i,qt(e,i,r),Ol(e,r),e}function yu(e,t,n,r){var i=t.current,a=Tl(),o=El(i);return n=_u(n),t.context===null?t.context=n:t.pendingContext=n,t=co(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=lo(i,t,o),e!==null&&(Dl(e,i,o,a),uo(e,i,o)),o}function bu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function xu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Su(e,t){xu(e,t),(e=e.alternate)&&xu(e,t)}function Cu(){return null}var wu=typeof reportError==`function`?reportError:function(e){console.error(e)};function Tu(e){this._internalRoot=e}Eu.prototype.render=Tu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));yu(e,t,null,null)},Eu.prototype.unmount=Tu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Il(function(){yu(null,e,null,null)}),t[Li]=null}};function Eu(e){this._internalRoot=e}Eu.prototype.unstable_scheduleHydration=function(e){if(e){var t=tn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<dn.length&&t!==0&&t<dn[n].priority;n++);dn.splice(n,0,e),n===0&&gn(e)}};function Du(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ou(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function ku(){}function Au(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=bu(o);a.call(e)}}var o=vu(t,r,e,0,null,!1,!1,``,ku);return e._reactRootContainer=o,e[Li]=o.current,gi(e.nodeType===8?e.parentNode:e),Il(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=bu(c);s.call(e)}}var c=hu(e,0,!1,null,null,!1,!1,``,ku);return e._reactRootContainer=c,e[Li]=c.current,gi(e.nodeType===8?e.parentNode:e),Il(function(){yu(t,c,n,r)}),c}function ju(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=bu(o);s.call(e)}}yu(t,o,e,i)}else o=Au(n,t,e,i,r);return bu(o)}Qt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Bt(t.pendingLanes);n!==0&&(Yt(t,n|1),Ol(t,wt()),!($c&6)&&(pl=wt()+500,fa()))}break;case 13:Il(function(){var t=io(e,1);t!==null&&Dl(t,e,1,Tl())}),Su(e,1)}},$t=function(e){if(e.tag===13){var t=io(e,134217728);t!==null&&Dl(t,e,134217728,Tl()),Su(e,134217728)}},en=function(e){if(e.tag===13){var t=El(e),n=io(e,t);n!==null&&Dl(n,e,t,Tl()),Su(e,t)}},tn=function(){return Xt},nn=function(e,t){var n=Xt;try{return Xt=e,t()}finally{Xt=n}},qe=function(e,t,n){switch(t){case`input`:if(we(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Wi(i);if(!a)throw Error(r(90));ye(i),we(i,a)}}}break;case`textarea`:je(e,n);break;case`select`:t=n.value,t!=null&&Oe(e,!!n.multiple,t,!1)}},$e=Fl,et=Il;var Mu={usingClientEntryPoint:!1,Events:[Hi,Ui,Wi,Ze,Qe,Fl]},Nu={findFiberByHostInstance:Vi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Pu={bundleType:Nu.bundleType,version:Nu.version,rendererPackageName:Nu.rendererPackageName,rendererConfig:Nu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=vt(e),e===null?null:e.stateNode},findFiberByHostInstance:Nu.findFiberByHostInstance||Cu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Fu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fu.isDisabled&&Fu.supportsFiber)try{jt=Fu.inject(Pu),Mt=Fu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Du(t))throw Error(r(200));return gu(e,t,null,n)},e.createRoot=function(e,t){if(!Du(e))throw Error(r(299));var n=!1,i=``,a=wu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=hu(e,1,!1,null,null,n,!1,i,a),e[Li]=t.current,gi(e.nodeType===8?e.parentNode:e),new Tu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=vt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Il(e)},e.hydrate=function(e,t,n){if(!Ou(t))throw Error(r(200));return ju(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!Du(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=wu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=vu(t,null,e,1,n??null,a,!1,o,s),e[Li]=t.current,gi(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Eu(t)},e.render=function(e,t,n){if(!Ou(t))throw Error(r(200));return ju(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!Ou(e))throw Error(r(40));return e._reactRootContainer?(Il(function(){ju(null,null,e,!1,function(){e._reactRootContainer=null,e[Li]=null})}),!0):!1},e.unstable_batchedUpdates=Fl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Ou(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return ju(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),o_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=a_()})),s_=s((e=>{var t=o_();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),c_=s((e=>{var t=C(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),l_=s(((e,t)=>{t.exports=c_()}));$r();var U=u(C()),u_=u(s_()),W=l_(),d_=e=>{let{children:t,className:n,clickSpaceDestroy:r,destroy:i}=e,a=()=>{r&&i()},o=e=>{(e.key===`Escape`||(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`w`)&&i()};return(0,W.jsx)(`div`,{className:`dialog-wrapper ${n}`,onClick:a,onKeyDown:e=>o(e),children:(0,W.jsx)(`div`,{className:`dialog-container`,onClick:e=>e.stopPropagation(),children:t})})};function f_(e,t,n){let r=document.createElement(`div`);document.body.append(r),setTimeout(()=>{r.firstElementChild?.classList.add(`showup`)},0);let i={destroy:()=>{r.firstElementChild?.classList.remove(`showup`),r.firstElementChild?.classList.add(`showoff`),setTimeout(()=>{r.detach(),s.unmount(),document.body.find(`.domtoimage-thino`)&&document.body.findAll(`.domtoimage-thino`).forEach(e=>{e.detach()})},200)}},a={...n,destroy:i.destroy},o=(0,W.jsx)(d_,{destroy:i.destroy,clickSpaceDestroy:!0,...e,children:(0,W.jsx)(t,{...a})}),s=u_.createRoot(r);return s.render(o),i}function p_(){return localStorage.getItem(`language`)||navigator.language||`en`}function m_(){let e=p_().toLowerCase();return e===`zh`||e.startsWith(`zh-`)}var h_=o((()=>{}));M(),h_();var g_=`thino-changelog-view`;async function __(e){let{workspace:t}=e,n=t.getLeavesOfType(g_);if(n.length>0){t.revealLeaf(n[0]);return}let r=t.getLeaf(`tab`);await r.setViewState({type:g_,active:!0}),t.revealLeaf(r)}var v_=class extends f.ItemView{component;version;constructor(e,t){super(e),this.version=t}getViewType(){return g_}getDisplayText(){return j(`Thino update info`)}getIcon(){return`info`}async onOpen(){let e=this.containerEl.children[1];e.empty(),e.addClass(`thino-changelog-modal`),e.createEl(`h2`,{text:j(`Thino update info`),cls:`thino-changelog-title`}).createDiv({cls:`thino-changelog-version`,text:`${this.version}`});try{e.createEl(`h3`,{text:j(`Latest version`)});let t=e.createDiv(`current-change-log`);e.createEl(`hr`),e.createEl(`h3`,{text:j(`Previous version`)});let n=e.createDiv(`prev-change-log`),r=await(0,f.requestUrl)(`https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md`);this.component=new f.Component;let[i,a]=this.getLatestVersionContent(r.text),o=i,s=a;try{o=m_()?i.replaceAll(`> [!tips]+`,`> [!tips]-`).replaceAll(`> [!note]-`,`> [!note]+`):i,s=m_()?a.replaceAll(`> [!tips]+`,`> [!tips]-`).replaceAll(`> [!note]-`,`> [!note]+`):a}catch(e){console.error(e)}await f.MarkdownRenderer.render(this.app,o,t,``,this.component),await f.MarkdownRenderer.render(this.app,s,n,``,this.component)}catch(t){console.error(t),e.createEl(`p`,{text:j(`Failed to load changelog`)}),e.createEl(`a`,{text:j(`View online`),attr:{href:`https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md`,target:`_blank`}})}}async onClose(){this.component?.unload()}getLatestVersionContent(e){let t=[...e.matchAll(/^# .+/gm)];if(t.length===0)return[e,``];let n=t[0].index||0,r=e.length;return t.length>1&&(r=t[1].index||e.length),[e.substring(n,r).trim(),e.substring(r).trim()]}};H(),M(),I();var y_=class extends f.Modal{plugin;constructor(e,t,n){super(e),this.version=n,this.plugin=t}onOpen(){super.onOpen(),this.titleEl.setText(j(`Submit issue`)),new f.Setting(this.contentEl).setName(j(`Current version`)+`: `+this.version),new f.Setting(this.contentEl).setName(j(`Bug report`)).setDesc(j(`Click the button to copy debug info and open the issue page`)).addButton(e=>{e.setButtonText(j(`Copy and go`)).onClick(async()=>{await Q9(this.plugin),new f.Notice(j(`Debug info copied`)),setTimeout(()=>{window.open(`https://github.com/Quorafind/Obsidian-Thino/issues/new/choose`,`_blank`),this.close()},100)})}),new f.Setting(this.contentEl).setName(j(`Feature request`)).setDesc(j(`Submit your feature request to the issue page`)).addButton(e=>{e.setButtonText(j(`Go`)).onClick(async()=>{window.open(`https://github.com/Quorafind/Obsidian-Thino/issues/new/choose`,`_blank`),this.close()})})}};function b_(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=b_(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function x_(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=b_(e))&&(r&&(r+=` `),r+=t);return r}M(),H(),Yg(),li(),I(),Mi(),ng();var S_=(e,t,n)=>{console.warn(`This function is deprecated, use ThinoWorkerManager.calculateStatsBanner() instead`);let r={memosLength:0,tagsLength:0,createdDays:0,taskAmount:0,mostActiveDay:``,mostActiveHour:``,earliestMemo:null,lengthOverflow:!1};if(r.memosLength=e.filter(e=>!(e.deletedAt!==``&&e.deletedAt)).length,r.tagsLength=t.length,r.earliestMemo=e.length>0?e[e.length-1]:null,r.earliestMemo&&r.earliestMemo.createdAt){let e=Xp(r.earliestMemo.createdAt,`yyyy/MM/dd HH:mm:ss`,new Date);r.createdDays=Lc(new Date,e)+1}return r.taskAmount=e.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`).filter(e=>e.thinoType&&e.thinoType?.startsWith(`TASK`)).length,r.mostActiveDay=C_(e),r.mostActiveHour=w_(e),r.lengthOverflow=r.memosLength>9999||r.tagsLength>999||r.createdDays>999,n&&O_(n)&&k_({tags:r.tagsLength,memos:r.memosLength,days:r.createdDays},n),r},C_=e=>{let t={};return e.forEach(e=>{let n=e.createdAt.split(` `)[0];t[n]?t[n]++:t[n]=1}),Object.keys(t).sort((e,n)=>t[n]-t[e])[0]},w_=e=>{let t={};return e.forEach(e=>{let n=e.createdAt.slice(11,13);t[n]?t[n]++:t[n]=1}),Object.keys(t).sort((e,n)=>t[n]-t[e])[0]};function T_(e,t=1e3){let[n,r]=(0,U.useState)(e),i=(0,U.useRef)(),a=(0,U.useRef)(),o=(0,U.useRef)(!0);return(0,U.useEffect)(()=>(o.current=!0,()=>{o.current=!1,i.current&&cancelAnimationFrame(i.current)}),[]),(0,U.useEffect)(()=>{if(!o.current)return;let s=n,c=e-s;if(Math.abs(c)<.01){r(e);return}let l=n=>{if(!o.current)return;a.current||=n;let u=n-a.current,d=Math.min(u/t,1),f=s+c*d;o.current&&r(f),d<1&&o.current?i.current=requestAnimationFrame(l):(o.current&&r(e),a.current=void 0)};return i.current=requestAnimationFrame(l),()=>{i.current&&cancelAnimationFrame(i.current),a.current=void 0}},[e,t,n]),Math.round(n)}var E_=({statusType:e})=>{let{memos:t,tags:n}=P(),{pathname:r}=Si(),{settings:i,app:a,plugin:o}=F(),s=(0,U.useRef)(!0),c=(0,U.useRef)(null),[l,u]=(0,U.useState)({memosLength:0,createdDays:0,tagsLength:0,taskAmount:0,mostActiveDay:``,mostActiveHour:``,earliestMemo:null,lengthOverflow:!1}),[d,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(null),g=T_(l.memosLength),_=T_(l.createdDays),v=U.useCallback((e,t)=>{if(!s.current)return;if(d&&t===m){z.setMemoFilter(``),p(!1);return}let n=Zg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([e]));Zg.pushQuery(n),z.setMemoFilter(n.id),p(!0),h(t)},[d,m]),y=U.useCallback(()=>{v({type:`LIST`,value:{operator:`IS_NOT`,value:`LIST`},relation:`AND`},`LIST`)},[v]),S=U.useCallback(()=>{v({type:`TYPE`,value:{operator:`IS_NOT`,value:`NOT_TAGGED`},relation:`AND`},`TYPE`)},[v]),C=U.useCallback(()=>{R.setShowSiderbarInMobileView(!1),z.setPathname(`/daily`)},[]),w=U.useCallback(()=>{if(!l.mostActiveDay)return;let e=Xp(l.mostActiveDay,`yyyy/MM/dd`,new Date),t=Qs(e).getTime(),n=Gc(e).getTime();z.setFromAndToQuery(t,n)},[l.mostActiveDay]);return(0,U.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]),(0,U.useEffect)(()=>{if(!a||!a.appId||!s.current)return;let e=O_(a);s.current&&u(t=>({...t,tagsLength:e.tags,memosLength:e.memos,createdDays:e.days}))},[a]),(0,U.useEffect)(()=>{if(!s.current||!V.initialized||!o?.thinoWorkerManager||!t||r!==`/`)return;let e=!1,i=async()=>{try{let r=await o.thinoWorkerManager.calculateStatsBanner(t,n);if(e||!s.current)return;let i={memosLength:r.memosLength,tagsLength:Math.max(r.tagsLength,n.length),earliestMemo:r.earliestMemo,lengthOverflow:r.lengthOverflow,createdDays:r.createdDays||0,taskAmount:r.taskAmount||0,mostActiveDay:r.mostActiveDay||``,mostActiveHour:r.mostActiveHour||``};s.current&&u(e=>({...e,...i})),a&&s.current&&k_({tags:i.tagsLength,memos:i.memosLength,days:i.createdDays},a)}catch(r){if(e||!s.current)return;console.error(`Failed to calculate stats banner:`,r);try{let e=S_(t,n,o.app);s.current&&u(t=>({...t,memosLength:e.memosLength,tagsLength:e.tagsLength,earliestMemo:e.earliestMemo,lengthOverflow:e.lengthOverflow}))}catch(e){console.error(`Fallback calculation also failed:`,e)}}},c=f.Platform.isIosApp||f.Platform.isSafari?window.setTimeout(()=>{e||i()},0):b(()=>{e||i()},{timeout:2e3});return()=>{e=!0,f.Platform.isIosApp||f.Platform.isSafari?window.clearTimeout(c):x(c)}},[n,t,r,o,a]),(0,U.useEffect)(()=>{if(!s.current||e===`banner`||!o?.thinoWorkerManager)return;let r=!1,i=async()=>{try{let e=await o.thinoWorkerManager.calculateStatsBanner(t,n);if(r||!s.current)return;u(t=>({...t,taskAmount:e.taskAmount||0,mostActiveDay:e.mostActiveDay||``,mostActiveHour:e.mostActiveHour||``}))}catch(e){!r&&s.current&&console.error(`Failed to calculate sidebar stats:`,e)}},a=f.Platform.isIosApp||f.Platform.isSafari?window.setTimeout(()=>{r||i()},0):b(()=>{r||i()},{timeout:2e3});return()=>{r=!0,f.Platform.isIosApp||f.Platform.isSafari?window.clearTimeout(a):x(a)}},[t,n,e,o]),(0,U.useEffect)(()=>{!s.current||!c.current||!l.earliestMemo?.createdAt||(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(c.current,j(`Started from`)+` `+N.getDateTimeString(l.earliestMemo?.createdAt??``))},[l.earliestMemo]),(0,W.jsx)(`div`,{className:x_(`status-text-container`,l.lengthOverflow?`text-overflow`:``,e),children:e===`banner`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`status-text memos-text`,children:[(0,W.jsx)(`span`,{className:`amount-text`,children:g}),(0,W.jsx)(`span`,{className:`type-text`,children:`THINO`})]}),(0,W.jsxs)(`div`,{className:`status-text tags-text`,children:[(0,W.jsx)(`span`,{className:`amount-text`,children:l.tagsLength}),(0,W.jsx)(`span`,{className:`type-text`,children:j(`TAG`)})]}),(0,W.jsxs)(`div`,{ref:c,className:`status-text duration-text`,onClick:C,children:[(0,W.jsx)(`span`,{className:`amount-text`,children:_??0}),(0,W.jsx)(`span`,{className:`type-text`,children:j(`DAY`)})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`status-sidebar-header title-text`,children:(0,W.jsx)(`span`,{className:`normal-text`,children:j(`Thino status`)})}),(0,W.jsxs)(`div`,{className:`status-sidebar-wrapper`,children:[(0,W.jsxs)(`div`,{className:`status-text memos-text`,children:[(0,W.jsx)(`span`,{className:`type-text`,children:j(`Thino amount`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:g})]}),(0,W.jsxs)(`div`,{className:`status-text memos-text`,onClick:y,children:[(0,W.jsx)(`span`,{className:`type-text`,children:j(`Task amount`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:l.taskAmount??0})]}),(0,W.jsxs)(`div`,{className:`status-text tags-text`,onClick:S,children:[(0,W.jsx)(`span`,{className:`type-text`,children:j(`Used tags`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:l.tagsLength})]}),(0,W.jsxs)(`div`,{ref:c,className:`status-text duration-text`,onClick:C,children:[(0,W.jsx)(`span`,{className:`type-text`,children:j(`Used days`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:_??0})]}),(0,W.jsxs)(`div`,{className:`status-text most-active-day-text`,onClick:w,children:[(0,W.jsx)(`span`,{className:`type-text`,children:j(`Most active day`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:l.mostActiveDay})]}),(0,W.jsxs)(`div`,{className:`status-text most-active-hour-text`,children:[(0,W.jsx)(`span`,{className:`type-text`,children:j(`Most active hour`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:l.mostActiveHour})]})]})]})})};function D_(e){return`userBannerCache:${e}`}function O_(e){try{if(!e?.appId)return{tags:0,memos:0,days:0};let t=D_(e.appId),n=ji.get([t])[t];return n?JSON.parse(n):{tags:0,memos:0,days:0}}catch(e){return console.error(e),{tags:0,memos:0,days:0}}}function k_({tags:e,memos:t,days:n},r){try{if(!r?.appId)return;let i={tags:e,memos:t,days:n},a=D_(r.appId);ji.set({[a]:JSON.stringify(i)})}catch(e){console.error(e)}}var A_=u(o_());function j_(e,t){let n=e.length,r=0,i=0,a=0;for(let o=0;o<n;o++)r+=e[o]*t[o],i+=e[o]*e[o],a+=t[o]*t[o];let o=Math.sqrt(i)*Math.sqrt(a);return o===0?0:r/o}var M_=2,N_=5e3,P_=384,F_=class{vectors=new Map;memoIndex=new Map;dirty=!1;saveTimer=null;adapter=null;storePath=``;dimensions=P_;async initialize(e,t){this.adapter=e,this.storePath=`${t}/vectors/index.json`;let n=`${t}/vectors`;if(await e.exists(n)||await e.mkdir(n),await e.exists(this.storePath))try{let t=await e.read(this.storePath),n=JSON.parse(t);if(n.version===M_){this.dimensions=n.dimensions;for(let[e,t]of Object.entries(n.entries))this.vectors.set(e,t),this.addToMemoIndex(t.memoId,e)}}catch(e){console.warn(`[VectorStore] Failed to load index, starting fresh:`,e)}}async addVectorBatch(e){for(let t of e){if(t.vector.length!==this.dimensions&&this.vectors.size>0){console.warn(`[VectorStore] Dimension mismatch: expected ${this.dimensions}, got ${t.vector.length}`);continue}this.vectors.size===0&&t.vector.length!==this.dimensions&&(this.dimensions=t.vector.length),this.vectors.set(t.id,t),this.addToMemoIndex(t.memoId,t.id)}this.markDirty()}async removeVectorsByMemoId(e){let t=this.memoIndex.get(e);if(t){for(let e of t)this.vectors.delete(e);this.memoIndex.delete(e),this.markDirty()}}search(e,t=10,n=.6){if(this.vectors.size===0)return[];let r=[];for(let t of this.vectors.values()){let i=j_(e,t.vector);i>=n&&r.push({entry:t,score:i})}return r.sort((e,t)=>t.score-e.score),r.slice(0,t)}hasVector(e){return this.memoIndex.has(e)}getVectorUpdatedAt(e){let t=this.memoIndex.get(e);return!t||t.length===0?null:this.vectors.get(t[0])?.updatedAt??null}async save(){if(!this.dirty||!this.adapter)return;let e={version:M_,dimensions:this.dimensions,entries:Object.fromEntries(this.vectors)};try{await this.adapter.write(this.storePath,JSON.stringify(e)),this.dirty=!1}catch(e){console.error(`[VectorStore] Failed to save:`,e)}}async clear(){this.vectors.clear(),this.memoIndex.clear(),this.dirty=!1,this.adapter&&await this.adapter.exists(this.storePath)&&await this.adapter.remove(this.storePath)}getStats(){return{totalEntries:this.vectors.size,dimensions:this.dimensions,memoCount:this.memoIndex.size}}dispose(){this.saveTimer&&=(clearTimeout(this.saveTimer),null),this.dirty&&this.save().catch(()=>{})}addToMemoIndex(e,t){let n=this.memoIndex.get(e)||[];n.includes(t)||(n.push(t),this.memoIndex.set(e,n))}markDirty(){this.dirty=!0,this.saveTimer&&clearTimeout(this.saveTimer),this.saveTimer=setTimeout(()=>this.save(),N_)}};function I_(e){let t=e;return t=t.replace(/!\[\[.*?\]\]/g,``),t=t.replace(/!\[.*?\]\(.*?\)/g,``),t=t.replace(/\[\[([^\]|]+)\|([^\]]+)\]\]/g,`$2`),t=t.replace(/\[\[([^\]]+)\]\]/g,`$1`),t=t.replace(/\[([^\]]+)\]\([^)]+\)/g,`$1`),t=t.replace(/```[\s\S]*?```/g,`[code]`),t=t.replace(/<[^>]+>/g,``),t=t.replace(/\n{3,}/g,`
- `),t=t.trim(),t}function L_(e,t=500){let n=I_(e.content);if(!n)return[];if(n.length<=t)return[{text:n,memoId:e.id,chunkIndex:0}];let r=n.split(/\n\n+/).filter(Boolean),i=[],a=``,o=0;for(let n of r){if(a.length+n.length+2>t&&a.length>0){i.push({text:a.trim(),memoId:e.id,chunkIndex:o}),o++;let t=a.split(/[.!?]\s/).pop()||``;a=t.length<100?t+`
- `:``}a+=(a?`
- `:``)+n}return a.trim()&&i.push({text:a.trim(),memoId:e.id,chunkIndex:o}),i}var R_='(function(){let e=null,t=null,n=null,r=new Map,i=new Map,a=``,o=self.fetch.bind(self);self.fetch=async(e,t)=>{let n=typeof e==`string`?e:e instanceof URL?e.href:e.url;if(n?.includes(`ort-wasm-simd-threaded`)){let e=n.split(`/`).pop();if(e&&r.has(e)){let t=r.get(e),n=e.endsWith(`.mjs`)?`application/javascript`:`application/wasm`;return new Response(t,{status:200,headers:{"Content-Type":n}})}}if(n?.includes(`huggingface.co`)&&a){let e=n.indexOf(`/resolve/main/`);if(e!==-1){let t=n.slice(e+14).split(`?`)[0];if(i.has(t)){let e=i.get(t),n=t.endsWith(`.json`)?`application/json`:`application/octet-stream`;return new Response(e,{status:200,headers:{"Content-Type":n,"Content-Length":String(e.byteLength)}})}}}return o(e,t)};function s(){let e=[];if(typeof process<`u`&&process.versions){let t=Object.getOwnPropertyDescriptor(process.versions,`node`);Object.defineProperty(process.versions,`node`,{get:()=>void 0,configurable:!0}),e.push(()=>{t?Object.defineProperty(process.versions,`node`,t):delete process.versions.node})}if(typeof globalThis.require==`function`){let t=globalThis.require;globalThis.require=function(e){if(e===`onnxruntime-node`||e.includes(`onnxruntime-node`))throw Error(`onnxruntime-node blocked in worker — using web backend`);return t(e)},Object.assign(globalThis.require,t),e.push(()=>{globalThis.require=t})}return()=>e.forEach(e=>e())}async function c(n){let r=n,i={},a=(e,t,n)=>{let a=r.match(t);i[e]=a?a.length:0,r=r.replace(t,n)};a(`process?.release?.name`,/"node"===process\\?\\.release\\?\\.name/g,`false`),a(`process.release.name alt`,/"node"===process\\.release\\.name/g,`false`),a(`release?.name==="node"`,/process\\?\\.release\\?\\.name==="node"/g,`false`),a(`onnxruntime-node`,/onnxruntime-node/g,`__ort_node_blocked__`);let o=new Blob([r],{type:`text/javascript`}),s=URL.createObjectURL(o);try{let n=await import(s);e=n.pipeline,t=n.env}finally{URL.revokeObjectURL(s)}if(!e||!t)throw Error(`Failed to load transformers library: pipeline or env not found`)}self.onmessage=async o=>{let l=o.data;switch(l.type){case`init`:{if(a=l.modelId,l.wasmFiles)for(let[e,t]of Object.entries(l.wasmFiles))r.set(e,t);if(l.modelFiles)for(let[e,t]of Object.entries(l.modelFiles))i.set(e,t);let o=s();try{await c(l.transformersScript)}catch(e){o(),self.postMessage({type:`init-error`,error:`Failed to load transformers: ${e?.message||String(e)}`});break}t.allowLocalModels=!1,t.useBrowserCache!==void 0&&(t.useBrowserCache=!1);try{let e=t.version||`3.8.1`;t.backends?.onnx?.wasm&&(t.backends.onnx.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${e}/dist/`,t.backends.onnx.wasm.numThreads=1,t.backends.onnx.wasm.proxy=!1)}catch{}try{self.postMessage({type:`progress`,status:`Initializing model...`,progress:5}),n=await e(`feature-extraction`,l.modelId,{device:`wasm`,dtype:`q8`,progress_callback:e=>{e?.status===`progress`&&e?.progress!=null&&self.postMessage({type:`progress`,status:`Loading model...`,progress:Math.round(e.progress)})}}),self.postMessage({type:`ready`})}catch(e){self.postMessage({type:`init-error`,error:e?.message||String(e)})}finally{o()}break}case`embed`:if(!n){self.postMessage({type:`error`,id:l.id,error:`Extractor not initialized`});break}try{let e=(await n(l.texts,{pooling:`mean`,normalize:!0})).tolist(),t=l.texts.map(e=>Math.ceil(e.length/4));self.postMessage({type:`result`,id:l.id,vectors:e,tokenCounts:t})}catch(e){self.postMessage({type:`error`,id:l.id,error:e?.message||String(e)})}break;case`dispose`:try{n?.dispose?.()}catch{}n=null,e=null,t=null,r.clear(),i.clear(),self.close();break}}})();',z_=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,R_],{type:`text/javascript;charset=utf-8`});function B_(e){let t;try{if(t=z_&&(self.URL||self.webkitURL).createObjectURL(z_),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(R_),{name:e?.name})}}var V_=`Xenova/paraphrase-multilingual-MiniLM-L12-v2`,H_=[`ort-wasm-simd-threaded.jsep.mjs`,`ort-wasm-simd-threaded.jsep.wasm`],U_=[`config.json`,`tokenizer.json`,`tokenizer_config.json`,`onnx/model_quantized.onnx`],W_=class{worker=null;_initialized=!1;initializing=!1;activeDevice=null;onProgress=null;assetManager=null;pendingEmbeds=new Map;nextEmbedId=1;initResolve=null;initReject=null;setProgressCallback(e){this.onProgress=e}setAssetManager(e){this.assetManager=e}async initialize(e,t){if(!(this._initialized&&this.worker)&&!this.initializing){this.initializing=!0;try{this.onProgress?.(`Reading local assets...`,0),console.log(`[EmbeddingService] Starting worker-based initialization`);let t=e||V_,[n,r,i]=await Promise.all([this.readAllWasmFiles(),this.readAllModelFiles(t),this.readTransformersScript()]);if(!i)throw Error(`transformers.min.js not found. Please import the Transformers.js runtime from the settings page.`);this.onProgress?.(`Initializing embedding worker...`,5),this.worker=new B_,this.worker.onmessage=e=>this.handleWorkerMessage(e),this.worker.onerror=e=>{console.error(`[EmbeddingService] Worker error:`,e),this.initReject?.(Error(e.message||`Worker error`))};let a=[...Object.values(n),...Object.values(r)];await new Promise((e,o)=>{this.initResolve=e,this.initReject=o,this.worker.postMessage({type:`init`,modelId:t,wasmFiles:n,modelFiles:r,transformersScript:i},a)}),this._initialized=!0,this.activeDevice=`wasm`,this.onProgress?.(`Ready`,100),console.log(`[EmbeddingService] Worker initialization complete`)}catch(e){throw console.error(`[EmbeddingService] Initialization FAILED:`,e),this.terminateWorker(),e}finally{this.initializing=!1,this.initResolve=null,this.initReject=null}}}async embed(e){if(!this._initialized||!this.worker)throw Error(`EmbeddingService is not initialized. Call initialize() first.`);if(e.length===0)return{vectors:[],tokenCounts:[]};let t=this.nextEmbedId++;return new Promise((n,r)=>{this.pendingEmbeds.set(t,{resolve:n,reject:r}),this.worker.postMessage({type:`embed`,id:t,texts:e})})}async embedMemo(e){let t=L_(e);if(t.length===0)return[];let n=t.map(e=>e.text),{vectors:r,tokenCounts:i}=await this.embed(n);return t.map((t,n)=>({id:`${e.id}-${t.chunkIndex}`,vector:r[n],content:t.text,memoId:e.id,chunkIndex:t.chunkIndex,updatedAt:e.updatedAt,metadata:{tokenCount:i[n],sourceType:e.sourceType}}))}isReady(){return this._initialized&&this.worker!==null}getDevice(){return this.activeDevice}dispose(){}terminateWorker(){if(this.worker){try{this.worker.postMessage({type:`dispose`})}catch{}this.worker.terminate(),this.worker=null}this._initialized=!1,this.activeDevice=null;for(let[,{reject:e}]of this.pendingEmbeds)e(Error(`Worker terminated`));this.pendingEmbeds.clear()}handleWorkerMessage(e){let t=e.data;switch(t.type){case`ready`:this.initResolve?.();break;case`init-error`:this.initReject?.(Error(t.error));break;case`progress`:this.onProgress?.(t.status,t.progress);break;case`result`:{let e=this.pendingEmbeds.get(t.id);e&&(this.pendingEmbeds.delete(t.id),e.resolve({vectors:t.vectors,tokenCounts:t.tokenCounts}));break}case`error`:{let e=this.pendingEmbeds.get(t.id);e&&(this.pendingEmbeds.delete(t.id),e.reject(Error(t.error)));break}}}async readTransformersScript(){return this.assetManager?await this.assetManager.readTransformersScript():null}async readAllWasmFiles(){let e={};if(!this.assetManager)return e;for(let t of H_){let n=await this.assetManager.readWasmFile(t);n&&(e[t]=n)}return e}async readAllModelFiles(e){let t={};if(!this.assetManager)return t;for(let n of U_){let r=await this.assetManager.readModelFile(e,n);r&&(t[n]=r)}return t}};function G_(e){if(!f.Platform.isDesktop)return{};try{return window.require(e)}catch{return{}}}var K_=o((()=>{}));K_();var q_=[`ort-wasm-simd-threaded.jsep.mjs`,`ort-wasm-simd-threaded.jsep.wasm`],J_=`transformers.min.js`,Y_=[`config.json`,`tokenizer.json`,`tokenizer_config.json`,`onnx/model_quantized.onnx`],eee=`https://cdn.jsdelivr.net/npm/@huggingface/transformers`,tee=`https://huggingface.co`,nee=class{adapter=null;basePath=``;initialize(e,t){this.adapter=e,this.basePath=t}async isWasmReady(){if(!this.adapter)return!1;try{let e=await this.readManifest(this.wasmDir());if(!e)return!1;for(let t of q_)if(!e.files[t]||!await this.adapter.exists(this.wasmPath(t)))return!1;return!!await this.adapter.exists(this.wasmPath(J_))}catch{return!1}}async isModelReady(e){if(!this.adapter)return!1;try{let t=await this.readManifest(this.modelDir(e));if(!t)return!1;for(let n of Y_)if(!t.files[n]||!await this.adapter.exists(this.modelPath(e,n)))return!1;return!0}catch{return!1}}async isFullyReady(e){return await this.isWasmReady()&&await this.isModelReady(e)}async downloadWasm(e,t,n){this.ensureAdapter(),await this.ensureDir(this.wasmDir());let r=`${eee}@${e}/dist`,i={version:e,downloadedAt:new Date().toISOString(),files:{}},a=[...q_,J_];for(let e=0;e<a.length;e++){if(n?.aborted)throw new DOMException(`Download aborted`,`AbortError`);let o=a[e],s=`${r}/${o}`,c=Math.round((e+.5)/a.length*50);t?.({phase:`wasm`,fileName:o,bytesDownloaded:0,bytesTotal:0,overallProgress:c});let l=(await(0,f.requestUrl)({url:s})).arrayBuffer;if(o.endsWith(`.mjs`)){let e=new TextDecoder().decode(l),t=this.patchEmscriptenModule(e);l=new TextEncoder().encode(t).buffer}await this.adapter.writeBinary(this.wasmPath(o),l),i.files[o]={size:l.byteLength},t?.({phase:`wasm`,fileName:o,bytesDownloaded:l.byteLength,bytesTotal:l.byteLength,overallProgress:Math.round((e+1)/a.length*50)})}await this.writeManifest(this.wasmDir(),i)}async downloadModel(e,t,n){this.ensureAdapter();let r=this.modelDir(e);await this.ensureDir(r),await this.ensureDir(`${r}/onnx`);let i={version:e,downloadedAt:new Date().toISOString(),files:{}};for(let r=0;r<Y_.length;r++){if(n?.aborted)throw new DOMException(`Download aborted`,`AbortError`);let a=Y_[r],o=`${tee}/${e}/resolve/main/${a}`,s=50+Math.round((r+.5)/Y_.length*50);t?.({phase:`model`,fileName:a,bytesDownloaded:0,bytesTotal:0,overallProgress:s});let c=(await(0,f.requestUrl)({url:o})).arrayBuffer;await this.adapter.writeBinary(this.modelPath(e,a),c),i.files[a]={size:c.byteLength},t?.({phase:`model`,fileName:a,bytesDownloaded:c.byteLength,bytesTotal:c.byteLength,overallProgress:50+Math.round((r+1)/Y_.length*50)})}await this.writeManifest(r,i)}async downloadAll(e,t,n,r){await this.downloadWasm(e,n,r),await this.downloadModel(t,n,r)}async readWasmFile(e){if(!this.adapter)return null;let t=this.wasmPath(e);try{return await this.adapter.exists(t)?await this.adapter.readBinary(t):null}catch{return null}}async readTransformersScript(){if(!this.adapter)return null;let e=this.wasmPath(J_);try{return await this.adapter.exists(e)?await this.adapter.read(e):null}catch{return null}}async readModelFile(e,t){if(!this.adapter)return null;let n=this.modelPath(e,t);try{return await this.adapter.exists(n)?await this.adapter.readBinary(n):null}catch{return null}}async importModelFromFolder(e,t,n){this.ensureAdapter();let r=G_(`fs`),i=G_(`path`),a=this.modelDir(e);await this.ensureDir(a),await this.ensureDir(`${a}/onnx`);let o=[],s=[],c={version:e,downloadedAt:new Date().toISOString(),files:{}};for(let a of Y_){let l=i.join(t,a);n?.(a);try{if(r.existsSync(l)){let t=r.readFileSync(l),n=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);await this.adapter.writeBinary(this.modelPath(e,a),n),c.files[a]={size:t.byteLength},o.push(a)}else s.push(a)}catch{s.push(a)}}return o.length===Y_.length&&await this.writeManifest(a,c),{imported:o,missing:s}}async importWasmFromFolder(e,t){this.ensureAdapter();let n=G_(`fs`),r=G_(`path`);await this.ensureDir(this.wasmDir());let i=[],a=[],o={version:`imported`,downloadedAt:new Date().toISOString(),files:{}},s=[...q_,J_];for(let c of s){let s=r.join(e,c);t?.(c);try{if(n.existsSync(s)){let e=n.readFileSync(s),t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(c.endsWith(`.mjs`)){let e=new TextDecoder().decode(t),n=this.patchEmscriptenModule(e);t=new TextEncoder().encode(n).buffer}await this.adapter.writeBinary(this.wasmPath(c),t),o.files[c]={size:t.byteLength},i.push(c)}else a.push(c)}catch{a.push(c)}}return i.length===s.length&&await this.writeManifest(this.wasmDir(),o),{imported:i,missing:a}}async removeAll(){if(this.adapter)try{for(let e of q_)await this.safeRemove(this.wasmPath(e));await this.safeRemove(this.wasmPath(J_)),await this.safeRemove(`${this.wasmDir()}/manifest.json`)}catch{}}wasmDir(){return`${this.basePath}/wasm`}wasmPath(e){return`${this.basePath}/wasm/${e}`}modelDir(e){return`${this.basePath}/models/${this.sanitizeModelId(e)}`}modelPath(e,t){return`${this.basePath}/models/${this.sanitizeModelId(e)}/${t}`}sanitizeModelId(e){return e.replace(/\//g,`--`)}patchEmscriptenModule(e){return e.replace(/"string"==typeof process\.versions\.node/g,`false`).replace(/typeof\s+globalThis\.process\?\.versions\?\.node\s*==\s*["']string["']/g,`false`)}async readManifest(e){if(!this.adapter)return null;let t=`${e}/manifest.json`;try{if(!await this.adapter.exists(t))return null;let e=await this.adapter.read(t);return JSON.parse(e)}catch{return null}}async writeManifest(e,t){await this.adapter.write(`${e}/manifest.json`,JSON.stringify(t,null,2))}async ensureDir(e){await this.adapter.exists(e)||await this.adapter.mkdir(e)}async safeRemove(e){try{await this.adapter.exists(e)&&await this.adapter.remove(e)}catch{}}ensureAdapter(){if(!this.adapter)throw Error(`AssetManager not initialized`)}},ree=class{providers=new Map;activeEmbeddingType=null;activeCompletionType=null;register(e){let t=this.providers.get(e.type);t&&t!==e&&t.dispose(),this.providers.set(e.type,e)}unregister(e){let t=this.providers.get(e);t&&(t.dispose(),this.providers.delete(e),this.activeEmbeddingType===e&&(this.activeEmbeddingType=null),this.activeCompletionType===e&&(this.activeCompletionType=null))}setActiveEmbeddingProvider(e){if(!this.providers.has(e)){console.debug(`[ProviderManager] Embedding provider "${e}" not registered, skipping.`);return}this.activeEmbeddingType=e}setActiveCompletionProvider(e){if(!this.providers.has(e)){console.debug(`[ProviderManager] Completion provider "${e}" not registered, skipping.`);return}this.activeCompletionType=e}getEmbeddingProvider(){return this.activeEmbeddingType?this.providers.get(this.activeEmbeddingType)??null:null}getCompletionProvider(){return this.activeCompletionType?this.providers.get(this.activeCompletionType)??null:null}getProvider(e){return this.providers.get(e)??null}getAllProviders(){return Array.from(this.providers.values())}async initializeAll(){let e=await Promise.allSettled(Array.from(this.providers.entries()).map(async([e,t])=>{if(!await t.isAvailable()){console.info(`[ProviderManager] Provider "${e}" is not available, skipping init.`);return}await t.initialize(),console.info(`[ProviderManager] Provider "${e}" initialized successfully.`)}));for(let t of e)t.status===`rejected`&&console.error(`[ProviderManager] Provider initialization failed:`,t.reason)}disposeAll(){let e=Array.from(this.providers.values());for(let t of e)try{t.dispose()}catch(e){console.error(`[ProviderManager] Error disposing provider "${t.type}":`,e)}this.providers.clear(),this.activeEmbeddingType=null,this.activeCompletionType=null}},iee=class{name=`Local (Transformers.js)`;type=`local`;embeddingService;constructor(e){this.embeddingService=e}async isAvailable(){return f.Platform.isDesktop}async initialize(){if(!f.Platform.isDesktop)throw Error(`Local provider is only available on desktop.`);await this.embeddingService.initialize()}async embed(e){if(!this.embeddingService.isReady())throw Error(`Local embedding service is not initialized. Call initialize() first.`);let t=await this.embeddingService.embed(e);return t.vectors.map((e,n)=>({vector:new Float32Array(e),tokenCount:t.tokenCounts[n]}))}async complete(e,t){throw Error(`Local text generation not supported. Configure an API provider for chat features.`)}async*completeStream(e,t){throw Error(`Local text generation not supported. Configure an API provider for chat features.`)}dispose(){}},X_=`https://api.openai.com`,Z_=`text-embedding-3-small`,Q_=`gpt-5.2`,$_=class{name=`OpenAI`;type=`openai`;apiKey;baseUrl;embeddingModel;completionModel;maxTokens;constructor(e){this.apiKey=e.apiKey??``,this.baseUrl=(e.baseUrl??X_).replace(/\/+$/,``).replace(/\/v1$/,``),this.embeddingModel=e.embeddingModel??Z_,this.completionModel=e.completionModel??Q_,this.maxTokens=e.maxTokens??4096}async isAvailable(){return!!this.apiKey&&!!this.baseUrl}async initialize(){if(!this.apiKey)throw Error(`OpenAI provider requires an API key.`);if(!this.baseUrl)throw Error(`OpenAI provider requires a base URL.`)}async embed(e){if(e.length===0)return[];let t=await(0,f.requestUrl)({url:`${this.baseUrl}/v1/embeddings`,method:`POST`,headers:{Authorization:`Bearer ${this.apiKey}`,"Content-Type":`application/json`},body:JSON.stringify({model:this.embeddingModel,input:e})});if(t.status>=400){let e=t.json?.error?.message??`HTTP ${t.status}`;throw Error(`OpenAI embeddings request failed: ${e}`)}return[...t.json.data].sort((e,t)=>e.index-t.index).map(e=>({vector:new Float32Array(e.embedding),tokenCount:0}))}async complete(e,t){let n=await(0,f.requestUrl)({url:`${this.baseUrl}/v1/chat/completions`,method:`POST`,headers:{Authorization:`Bearer ${this.apiKey}`,"Content-Type":`application/json`},body:JSON.stringify({model:this.completionModel,messages:this.mapMessages(e),max_tokens:t?.maxTokens??this.maxTokens,temperature:t?.temperature??.7,stream:!1,...t?.tools?.length?{tools:this.mapToolDefs(t.tools)}:{}})});if(n.status>=400){let e=n.json?.error?.message??`HTTP ${n.status}`;throw Error(`OpenAI completion request failed: ${e}`)}let r=n.json?.choices?.[0]?.message?.content;if(typeof r!=`string`)throw Error(`OpenAI completion returned an unexpected response format.`);return r}async*completeStream(e,t){let n=await fetch(`${this.baseUrl}/v1/chat/completions`,{method:`POST`,headers:{Authorization:`Bearer ${this.apiKey}`,"Content-Type":`application/json`},body:JSON.stringify({model:this.completionModel,messages:this.mapMessages(e),max_tokens:t?.maxTokens??this.maxTokens,temperature:t?.temperature??.7,stream:!0,...t?.tools?.length?{tools:this.mapToolDefs(t.tools)}:{}})});if(!n.ok){let e=`HTTP ${n.status}`;try{e=(await n.json())?.error?.message??e}catch{}throw Error(`OpenAI streaming request failed: ${e}`)}if(!n.body)throw Error(`OpenAI streaming response has no body.`);let r=n.body.getReader(),i=new TextDecoder(`utf-8`),a=``,o=new Map,s=0;try{for(;;){let{done:e,value:t}=await r.read();if(e)break;a+=i.decode(t,{stream:!0});let n=a.split(`
- `);a=n.pop()??``;for(let e of n){let t=e.trim();if(!t||t.startsWith(`:`)||!t.startsWith(`data: `))continue;let n=t.slice(6);if(n===`[DONE]`){o.size>0?yield{content:``,done:!0,tool_calls:this.collectToolCalls(o)}:yield{content:``,done:!0};return}try{let e=JSON.parse(n)?.choices?.[0],t=e?.delta,r=e?.finish_reason;if(t){let e=Object.keys(t).filter(e=>t[e]!==null&&t[e]!==void 0&&t[e]!==``);e.length>0&&console.log(`[OpenAIProvider] delta keys=[${e.join(`,`)}]${r?` finish_reason=${r}`:``}`,e.includes(`tool_calls`)?t.tool_calls:``)}if(r&&!t&&console.log(`[OpenAIProvider] finish_reason=${r} (no delta)`),typeof t?.content==`string`&&t.content.length>0&&(r&&s>0&&t.content.length>s?console.log(`[OpenAIProvider] Skipping duplicate final delta (${t.content.length} chars, already streamed ${s})`):(s+=t.content.length,yield{content:t.content,done:!1})),typeof t?.reasoning_content==`string`&&t.reasoning_content.length>0&&(yield{content:``,done:!1,reasoning:t.reasoning_content}),t?.tool_calls)for(let e of t.tool_calls){let t=e.index??0,n=o.get(t);n?(e.id&&(n.id=e.id),e.function?.name&&(n.name+=e.function.name),n.arguments+=e.function?.arguments??``):o.set(t,{id:e.id??``,name:e.function?.name??``,arguments:e.function?.arguments??``})}}catch{}}}if(a.trim()){let e=a.trim();if(e.startsWith(`data: `)&&e.slice(6)!==`[DONE]`)try{let t=JSON.parse(e.slice(6))?.choices?.[0]?.delta;typeof t?.content==`string`&&t.content.length>0&&(yield{content:t.content,done:!1})}catch{}}o.size>0?yield{content:``,done:!0,tool_calls:this.collectToolCalls(o)}:yield{content:``,done:!0}}finally{r.releaseLock()}}dispose(){}mapMessages(e){return e.map(e=>e.role===`tool`?{role:`tool`,content:e.content,tool_call_id:e.tool_call_id}:e.role===`assistant`&&e.tool_calls?.length?{role:`assistant`,content:e.content||null,tool_calls:e.tool_calls.map(e=>({id:e.id,type:`function`,function:{name:e.name,arguments:e.arguments}}))}:{role:e.role,content:e.content})}mapToolDefs(e){return e.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.parameters}}))}collectToolCalls(e){return Array.from(e.entries()).sort(([e],[t])=>e-t).map(([,e])=>({id:e.id,name:e.name,arguments:e.arguments}))}},ev=`https://api.anthropic.com`,tv=`2023-06-01`,nv=`claude-sonnet-4-6`,rv=class{name=`Anthropic`;type=`anthropic`;apiKey;baseUrl;completionModel;maxTokens;constructor(e){this.apiKey=e.apiKey??``,this.baseUrl=(e.baseUrl??ev).replace(/\/+$/,``).replace(/\/v1$/,``),this.completionModel=e.completionModel??nv,this.maxTokens=e.maxTokens??4096}async isAvailable(){return!!this.apiKey}async initialize(){if(!this.apiKey)throw Error(`Anthropic provider requires an API key.`)}async embed(e){throw Error(`Anthropic does not support embeddings. Use Local or OpenAI provider for embeddings.`)}async complete(e,t){let{system:n,apiMessages:r}=this.prepareMessages(e),i=await(0,f.requestUrl)({url:`${this.baseUrl}/v1/messages`,method:`POST`,headers:{"x-api-key":this.apiKey,"anthropic-version":tv,"Content-Type":`application/json`},body:JSON.stringify({model:this.completionModel,max_tokens:t?.maxTokens??this.maxTokens,temperature:t?.temperature??.7,...n?{system:n}:{},messages:r,...t?.tools?.length?{tools:this.mapToolDefs(t.tools)}:{}})});if(i.status>=400){let e=i.json?.error?.message??`HTTP ${i.status}`;throw Error(`Anthropic completion request failed: ${e}`)}let a=i.json?.content?.find(e=>e.type===`text`);if(!a||typeof a.text!=`string`)throw Error(`Anthropic completion returned an unexpected response format.`);return a.text}async*completeStream(e,t){let{system:n,apiMessages:r}=this.prepareMessages(e),i=await fetch(`${this.baseUrl}/v1/messages`,{method:`POST`,headers:{"x-api-key":this.apiKey,"anthropic-version":tv,"Content-Type":`application/json`},body:JSON.stringify({model:this.completionModel,max_tokens:t?.maxTokens??this.maxTokens,temperature:t?.temperature??.7,stream:!0,...n?{system:n}:{},messages:r,...t?.tools?.length?{tools:this.mapToolDefs(t.tools)}:{}})});if(!i.ok){let e=`HTTP ${i.status}`;try{e=(await i.json())?.error?.message??e}catch{}throw Error(`Anthropic streaming request failed: ${e}`)}if(!i.body)throw Error(`Anthropic streaming response has no body.`);let a=i.body.getReader(),o=new TextDecoder(`utf-8`),s=``,c=new Map,l=-1,u=``;try{for(;;){let{done:e,value:t}=await a.read();if(e)break;s+=o.decode(t,{stream:!0});let n=s.split(`
- `);s=n.pop()??``;for(let e of n){let t=e.trim();if(!t||t.startsWith(`:`)||t.startsWith(`event: `)||!t.startsWith(`data: `))continue;let n=t.slice(6);try{let e=JSON.parse(n);switch(e.type){case`content_block_start`:{l++;let t=e.content_block;t?.type===`tool_use`?c.set(l,{id:t.id??``,name:t.name??``,arguments:``}):t?.type;break}case`content_block_delta`:if(e.delta?.type===`text_delta`){let t=e.delta.text;typeof t==`string`&&t.length>0&&(yield{content:t,done:!1})}else if(e.delta?.type===`input_json_delta`){let t=c.get(l);t&&e.delta.partial_json&&(t.arguments+=e.delta.partial_json)}break;case`message_delta`:e.delta?.stop_reason&&(u=e.delta.stop_reason);break;case`message_stop`:u===`tool_use`&&c.size>0?yield{content:``,done:!0,tool_calls:this.collectToolCalls(c)}:yield{content:``,done:!0};return}}catch{}}}if(s.trim()){let e=s.trim();if(e.startsWith(`data: `))try{let t=JSON.parse(e.slice(6));if(t.type===`content_block_delta`&&t.delta?.type===`text_delta`){let e=t.delta.text;typeof e==`string`&&e.length>0&&(yield{content:e,done:!1})}}catch{}}u===`tool_use`&&c.size>0?yield{content:``,done:!0,tool_calls:this.collectToolCalls(c)}:yield{content:``,done:!0}}finally{a.releaseLock()}}dispose(){}prepareMessages(e){let t=e.filter(e=>e.role===`system`),n=e.filter(e=>e.role!==`system`),r=t.length>0?t.map(e=>e.content).join(`
- `):null,i=[];for(let e of n)if(e.role===`tool`)i.push({role:`user`,content:[{type:`tool_result`,tool_use_id:e.tool_call_id,content:e.content}]});else if(e.role===`assistant`&&e.tool_calls?.length){let t=[];e.content&&t.push({type:`text`,text:e.content});for(let n of e.tool_calls){let e={};try{e=JSON.parse(n.arguments)}catch{}t.push({type:`tool_use`,id:n.id,name:n.name,input:e})}i.push({role:`assistant`,content:t})}else i.push({role:e.role,content:e.content});return{system:r,apiMessages:i}}mapToolDefs(e){return e.map(e=>({name:e.name,description:e.description,input_schema:e.parameters}))}collectToolCalls(e){return Array.from(e.entries()).sort(([e],[t])=>e-t).map(([,e])=>({id:e.id,name:e.name,arguments:e.arguments}))}},iv=`https://newapi.pkmer.cn`,av=`03-agent`,ov=[{id:`03-agent`,displayName:`Agent`,description:`Agent model (powerful)`,price:`1`},{id:`04-fast`,displayName:`Fast`,description:`Fast model (naming, etc.)`,price:`0.001`},{id:`02-summary`,displayName:`Summary`,description:`Summary model`,price:`1`},{id:`01-tag`,displayName:`Tag`,description:`Tag recommendation`,price:`0.001`},{id:`00-image-desc`,displayName:`Image Desc`,description:`Image description`,price:`0.001`},{id:`05-webSummary`,displayName:`Web Summary`,description:`Web summary`,price:`0.001`},{id:`06-image-gen`,displayName:`Image Gen`,description:`Image generation`,price:`1`}],sv=ov.filter(e=>e.id===`03-agent`);async function cv(e,t=!0){try{let n=(await(0,f.requestUrl)({url:`${iv}/v1/models`,method:`GET`,headers:{Authorization:`Bearer ${e}`}})).json?.data;if(!Array.isArray(n)||n.length===0)return t?sv:ov;let r=new Map(ov.map(e=>[e.id,e])),i=n.filter(e=>/^0[0-6]-/.test(e.id)).map(e=>{let t=r.get(e.id);return{id:e.id,displayName:t?.displayName||e.id.replace(/^\d+-/,``),description:t?.description||e.id,price:t?.price||`1`}});return t?i.filter(e=>e.id===`03-agent`):i}catch{return t?sv:ov}}var lv=class{name=`PKMer AI`;type=`pkmer`;delegate;constructor(e){this.delegate=new $_({...e,type:`openai`,baseUrl:e.baseUrl||iv,completionModel:e.completionModel||av})}isAvailable(){return this.delegate.isAvailable()}initialize(){return this.delegate.initialize()}embed(e){return this.delegate.embed(e)}complete(e,t){return this.delegate.complete(e,t)}completeStream(e,t){return this.delegate.completeStream(e,t)}dispose(){this.delegate.dispose()}};I(),Rg(),Yg();var uv=50,dv=10,fv=new class{vectorStore=new F_;embeddingService=new W_;assetManager=new nee;providerManager=new ree;app=null;plugin=null;indexAbort=null;memoUnsubscribe=null;initialized=!1;pendingSubagentImages=[];async initialize(e,t){if(console.log(`[SuperService] initialize() called, initialized:`,this.initialized),this.initialized){console.log(`[SuperService] Already initialized, skipping`);return}this.app=e,this.plugin=t;let n=t.manifest.dir||``;this.assetManager.initialize(e.vault.adapter,`${n}/super`),this.embeddingService.setAssetManager(this.assetManager),await this.vectorStore.initialize(e.vault.adapter,n),B.getState().setEngineInstalled(!0);let r=B.getState();if(f.Platform.isDesktop&&r.activeEmbeddingProvider===`local`){let e=await this.assetManager.isWasmReady(),t=await this.assetManager.isModelReady(r.embeddingModel);console.log(`[SuperService] Asset readiness — wasm:`,e,`model:`,t),r.setWasmReady(e),r.setModelReady(t)}else r.setWasmReady(!0),r.setModelReady(!0);this.setupProviders();let i=null;this.memoUnsubscribe=P.subscribe(e=>e.memos,(e,t)=>{B.getState().enabled&&(i&&clearTimeout(i),i=setTimeout(()=>{i=null,this.handleMemoChanges(e,t)},200))}),this.initialized=!0,console.log(`[SuperService] Phase 1 initialization complete`)}async initializeEmbeddingAndIndex(){console.log(`[SuperService] initializeEmbeddingAndIndex() called`);let e=B.getState();this.embeddingService.setProgressCallback((t,n)=>{e.setLoadingStatus(t),n!=null&&e.setLoadingProgress(n)});let t=this.providerManager.getEmbeddingProvider();if(console.log(`[SuperService] Embedding provider:`,t?.type??`NONE`),t)try{await t.initialize(),console.log(`[SuperService] Embedding provider initialized OK`)}catch(e){throw console.error(`[SuperService] Failed to initialize embedding provider:`,e),e}finally{this.embeddingService.setProgressCallback(null)}console.log(`[SuperService] Starting indexing...`),await this.startIndexing(),console.log(`[SuperService] initializeEmbeddingAndIndex() complete`)}async downloadAssets(){let e=B.getState(),t=e.embeddingModel;e.setAssetDownloading(!0),e.setAssetDownloadError(null),e.setAssetDownloadProgress(0);try{await this.assetManager.downloadAll(`3.8.1`,t,t=>{e.setAssetDownloadProgress(t.overallProgress);let n=t.phase===`wasm`?`WASM runtime`:`Model`;e.setAssetDownloadStatus(`${n}: ${t.fileName}`)}),e.setWasmReady(!0),e.setModelReady(!0),e.setEngineInstalled(!0),e.setAssetDownloadStatus(`Download complete`)}catch(t){throw e.setAssetDownloadError(t?.message||`Unknown error`),t}finally{e.setAssetDownloading(!1)}}async importLocalModel(e){let t=B.getState();t.setAssetDownloading(!0),t.setAssetDownloadError(null),t.setAssetDownloadStatus(`Importing model files...`);try{let n=await this.assetManager.importModelFromFolder(t.embeddingModel,e,e=>t.setAssetDownloadStatus(`Importing: ${e}`));return n.missing.length===0?(t.setModelReady(!0),t.setAssetDownloadStatus(`Model import complete`),await this.assetManager.isWasmReady()&&t.setEngineInstalled(!0)):t.setAssetDownloadStatus(`Missing: ${n.missing.join(`, `)}`),n}catch(e){throw t.setAssetDownloadError(e?.message||`Model import failed`),e}finally{t.setAssetDownloading(!1)}}async importLocalWasm(e){let t=B.getState();t.setAssetDownloading(!0),t.setAssetDownloadError(null),t.setAssetDownloadStatus(`Importing WASM files...`);try{let n=await this.assetManager.importWasmFromFolder(e,e=>t.setAssetDownloadStatus(`Importing: ${e}`));return n.missing.length===0?(t.setWasmReady(!0),t.setAssetDownloadStatus(`WASM import complete`),await this.assetManager.isModelReady(t.embeddingModel)&&t.setEngineInstalled(!0)):t.setAssetDownloadStatus(`Missing: ${n.missing.join(`, `)}`),n}catch(e){throw t.setAssetDownloadError(e?.message||`WASM import failed`),e}finally{t.setAssetDownloading(!1)}}getAssetManager(){return this.assetManager}isEmbeddingReady(){let e=this.providerManager.getEmbeddingProvider();return e?this.embeddingService.isReady()?!0:e.type!==`local`:!1}async startIndexing(){if(!this.isEmbeddingReady()){console.warn(`[SuperService] Skipping indexing: no embedding provider ready.`);return}this.indexAbort&&this.stopIndexing(),this.indexAbort=new AbortController;let e=P.getState().memos.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt);B.getState().updateIndexStatus({totalMemos:e.length,indexedMemos:0,isIndexing:!0,failedMemos:[]});let t=document.createDocumentFragment(),n=document.createElement(`span`);n.textContent=`Thino Super: Indexing 0/${e.length} memos...`,t.appendChild(n);let r=new f.Notice(t,0),i=[],a=0,o=0;for(let t=0;t<e.length&&!this.indexAbort.signal.aborted;t+=uv){let r=e.slice(t,t+uv),s=r.filter(e=>{let t=this.vectorStore.getVectorUpdatedAt(e.id);return!t||t<e.updatedAt});if(s.length>0)try{await this.indexMemoBatch(s),o++}catch(e){console.warn(`[SuperService] Batch indexing error:`,e),i.push(...s.map(e=>e.id))}a+=r.length,B.getState().updateIndexStatus({indexedMemos:a,failedMemos:[...i]});let c=Math.round(a/e.length*100);n.textContent=`Thino Super: Indexing ${a}/${e.length} memos (${c}%)`,o>=dv&&(await this.vectorStore.save(),o=0),await new Promise(e=>setTimeout(e,0))}r.hide(),B.getState().updateIndexStatus({isIndexing:!1,lastIndexedAt:new Date().toISOString()}),await this.vectorStore.save(),this.indexAbort=null,i.length>0?new f.Notice(`Thino Super: Indexed ${a} memos (${i.length} failed)`,5e3):new f.Notice(`Thino Super: ${a} memos indexed`,3e3)}async indexMemo(e){let t=await this.buildVectorEntries(e);t.length>0&&(await this.vectorStore.removeVectorsByMemoId(e.id),await this.vectorStore.addVectorBatch(t))}async removeMemoFromIndex(e){await this.vectorStore.removeVectorsByMemoId(e)}async semanticSearch(e,t=10){let n=this.providerManager.getEmbeddingProvider();if(!n)throw Error(`No embedding provider available`);let r=await n.embed([e]);if(r.length===0)return[];let i=Array.from(r[0].vector),a=this.vectorStore.search(i,t),o=P.getState().memos,s=new Map(o.map(e=>[e.id,e]));for(let e of a)e.memo=s.get(e.entry.memoId);let c=new Set;return a.filter(e=>c.has(e.entry.memoId)?!1:(c.add(e.entry.memoId),!0))}textSearch(e,t=20){let n=e.toLowerCase().trim();if(!n)return[];let r=P.getState().memos.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt),i=[];for(let e of r){if(i.length>=t)break;e.content.toLowerCase().includes(n)&&i.push({entry:{id:`text-${e.id}`,vector:[],content:e.content,memoId:e.id,chunkIndex:0,updatedAt:e.updatedAt},score:-1,memo:e})}return i}async hybridSearch(e,t=10){let n=[];try{this.providerManager.getEmbeddingProvider()&&(n=await this.semanticSearch(e,t))}catch(e){console.warn(`[SuperService] Semantic search failed, falling back to text:`,e)}let r=this.textSearch(e,t),i=new Set(n.map(e=>e.entry.memoId)),a=[...n];for(let e of r)i.has(e.entry.memoId)||(i.add(e.entry.memoId),a.push(e));return a.slice(0,Math.max(t,a.length))}async*chat(e,t){this.syncCompletionProvider();let n=this.providerManager.getCompletionProvider();if(!n)throw Error(`No completion provider configured. Add an API key in Super settings.`);let r=this.buildToolSystemPrompt(),i=this.getToolDefinitions(),a=[{role:`system`,content:r},...t.filter(e=>e.role!==`system`).slice(-10).map(e=>({role:e.role,content:e.content})),{role:`user`,content:e}],o=0,s=``;for(let e=0;e<5;e++){let t=``,r=0,c,l=s.length;console.log(`[SuperService.chat] round=${e} starting completeStream, prevContentLen=${l}`);for await(let u of n.completeStream(a,{maxTokens:2048,temperature:.7,tools:i})){if(o++,u.reasoning&&(console.log(`[SuperService.chat] seq=${o} round=${e} REASONING len=${u.reasoning.length} preview="${u.reasoning.slice(0,50)}"`),yield{content:``,done:!1,reasoning:u.reasoning}),u.content)if(t+=u.content,e===0||l===0)s+=u.content,r=t.length,console.log(`[SuperService.chat] seq=${o} round=${e} CONTENT len=${u.content.length} totalContent=${t.length} preview="${u.content.slice(0,50)}"`),yield{content:u.content,done:!1};else{let n=s.slice(0,l),i=n.trimEnd();if(t.length<=i.length&&i.startsWith(t))continue;let a=r;r===0&&(t.startsWith(i)?a=i.length:t.startsWith(n)&&(a=l),a>0&&console.log(`[SuperService.chat] round=${e} stripping duplicate prefix: ${a} chars`));let c=t.slice(a);if(c.length>0){let n=c.slice(r>a?r-a:0);if(n.length>0){s+=n,r=t.length,console.log(`[SuperService.chat] seq=${o} round=${e} CONTENT (deduped) len=${n.length} totalContent=${s.length}`),yield{content:n,done:!1};continue}}r=t.length}u.done&&(c=u.tool_calls,console.log(`[SuperService.chat] seq=${o} round=${e} DONE toolCalls=${c?.length??0}`,c?.map(e=>`${e.name}(${e.id})`)))}if(e>0&&l>0&&t.length>0&&r===0){let n=s.slice(0,l),r=n.trimEnd(),i=0;t.startsWith(r)?i=r.length:t.startsWith(n)&&(i=l);let a=t.slice(i);a.trim().length>0?(s+=a,console.log(`[SuperService.chat] round=${e} flushing deduped content: skipped=${i} yielding=${a.length} chars`),yield{content:a,done:!1}):console.log(`[SuperService.chat] round=${e} entire round content (${t.length} chars) was duplicate, skipped`)}if(!c||c.length===0){console.log(`[SuperService.chat] round=${e} no tool calls, finishing. totalYieldedContent=${s.length}`),this.refreshPKMerQuota(),yield{content:``,done:!0};return}a.push({role:`assistant`,content:t,tool_calls:c});for(let t of c){o++,console.log(`[SuperService.chat] seq=${o} round=${e} TOOL_START name=${t.name} id=${t.id} args=${t.arguments.slice(0,80)}`),yield{content:``,done:!1,toolEvent:{type:`tool_start`,toolCallId:t.id,name:t.name,arguments:t.arguments}};let n=await this.executeTool(t.name,t.arguments);this.pendingSubagentImages.length>0&&(yield{content:``,done:!1,subagentImages:this.pendingSubagentImages.splice(0)}),a.push({role:`tool`,content:n,tool_call_id:t.id,name:t.name}),o++,console.log(`[SuperService.chat] seq=${o} round=${e} TOOL_RESULT name=${t.name} id=${t.id} resultLen=${n.length}`),yield{content:``,done:!1,toolEvent:{type:`tool_result`,toolCallId:t.id,name:t.name,result:n}}}}console.log(`[SuperService.chat] exhausted MAX_TOOL_ROUNDS`),this.refreshPKMerQuota(),yield{content:``,done:!0}}getToolDefinitions(){let e=[{name:`search_memos`,description:`Search through memos using natural language. Uses semantic similarity combined with exact text matching. Best for finding memos about a topic, concept, or theme.`,parameters:{type:`object`,properties:{query:{type:`string`,description:`Natural language search query`},limit:{type:`number`,description:`Max results to return (default 10, max 20)`}},required:[`query`]}},{name:`filter_memos`,description:`Filter memos by structured criteria: tags, date ranges, and memo type. Use when the user asks about specific tags, time periods, or task status.`,parameters:{type:`object`,properties:{tag:{type:`string`,description:`Tag to filter by (e.g. "#project")`},from_date:{type:`string`,description:`Start date (e.g. "2025-01-01")`},to_date:{type:`string`,description:`End date (e.g. "2025-12-31")`},type:{type:`string`,enum:[`JOURNAL`,`TASK-TODO`,`TASK-DONE`],description:`Memo type filter`},text:{type:`string`,description:`Text substring to match`},limit:{type:`number`,description:`Max results (default 20, max 50)`}}}},{name:`get_memo`,description:`Retrieve a specific memo by its ID. Use when you need the full content of a memo referenced in search results.`,parameters:{type:`object`,properties:{memo_id:{type:`string`,description:`The memo ID to retrieve`}},required:[`memo_id`]}},{name:`get_related_memos`,description:`Find memos that are linked to, reference, or comment on a given memo.`,parameters:{type:`object`,properties:{memo_id:{type:`string`,description:`The memo ID to find relations for`},relation_type:{type:`string`,enum:[`linked`,`comments`,`all`],description:`Type of relation (default: all)`}},required:[`memo_id`]}}];if(this.providerManager.getCompletionProvider()?.type!==`pkmer`)return e;let t=[{name:`generate_image`,description:`Generate an image from a text description. Use when the user explicitly requests an image, illustration, or visual. Returns the generated image.`,parameters:{type:`object`,properties:{prompt:{type:`string`,description:`Detailed description of the image to generate`}},required:[`prompt`]}},{name:`summarize_text`,description:`Summarize a long piece of text concisely. Use when you need to condense large amounts of retrieved memo content before presenting it.`,parameters:{type:`object`,properties:{text:{type:`string`,description:`The text content to summarize`},style:{type:`string`,enum:[`bullet`,`paragraph`,`headline`],description:`Output format (default: paragraph)`}},required:[`text`]}},{name:`summarize_url`,description:`Fetch and summarize a web page. Use when the user provides a URL and wants its content summarized.`,parameters:{type:`object`,properties:{url:{type:`string`,description:`The URL of the web page to summarize`}},required:[`url`]}},{name:`delegate_fast`,description:`Delegate a quick, self-contained task to a fast model. Ideal for: generating a title, writing a short label, classifying a single item, or any task where speed matters more than depth.`,parameters:{type:`object`,properties:{task:{type:`string`,description:`The specific task to perform (be explicit and concise)`}},required:[`task`]}}];return[...e,...t]}buildToolSystemPrompt(){let e=P.getState().memos.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt).length,t=this.providerManager.getCompletionProvider()?.type===`pkmer`,n=[`You are a helpful assistant integrated into Thino, a personal memo/note-taking app.`,`The user has ${e} memos in their collection.`,`You have access to tools for searching and filtering memos.`,`Use these tools to find relevant information before answering questions about the user's notes.`,``,`Guidelines:`,`- Use search_memos for semantic/natural language searches about topics or themes.`,`- Use filter_memos when the user asks about specific tags, date ranges, or task types.`,`- Use get_memo to retrieve full details of a specific memo by ID.`,`- Use get_related_memos to find linked or commented memos.`,`- You may call multiple tools or the same tool multiple times to gather enough context.`,`- If tools return no results, say so honestly rather than guessing.`,`- Be concise and reference specific memos (by date and content) when relevant.`,`- Respond in the same language the user uses.`,`- IMPORTANT: After using tools, do NOT repeat content you already wrote before the tool call. Continue from where you left off and only add new information.`];return t&&n.push(``,`You also have access to specialized subagent tools that delegate to other AI models:`,`- Use generate_image when the user explicitly requests a picture, illustration, or visual output.`,`- Use summarize_text to condense large amounts of text before presenting a final answer.`,`- Use summarize_url when the user provides a URL and wants its content summarized.`,`- Use delegate_fast for quick naming, labeling, or classification subtasks.`,`- Handle creative writing, analysis, and conversation yourself — only delegate when a specialized model is clearly better suited.`,`- Do NOT use generate_image unless the user explicitly requests an image or illustration.`),n.join(`
- `)}async callSubagentText(e,t){let n=B.getState().providers.pkmer;if(!n?.apiKey)throw Error(`PKMer API key not available for subagent call`);let r=new $_({type:`openai`,enabled:!0,apiKey:n.apiKey,baseUrl:n.baseUrl||`https://newapi.pkmer.cn`,completionModel:e,maxTokens:n.maxTokens??4096}),i=[{role:`user`,content:t}],a=``;for await(let e of r.completeStream(i,{maxTokens:4096,temperature:.7}))if(e.content&&(a+=e.content),e.done)break;return a}async executeTool(e,t){try{let n=JSON.parse(t);switch(e){case`search_memos`:{let e=Math.min(n.limit??10,20),t=(await this.hybridSearch(n.query,e)).map(e=>e.memo).filter(e=>!!e);return this.formatMemoResults(t)}case`filter_memos`:{let e=P.getState().memos.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt);if(n.tag){let t=n.tag.startsWith(`#`)?n.tag:`#${n.tag}`;e=e.filter(e=>e.content.includes(t))}if(n.from_date&&(e=e.filter(e=>e.createdAt>=n.from_date)),n.to_date&&(e=e.filter(e=>e.createdAt<=n.to_date)),n.type&&(e=e.filter(e=>e.thinoType===n.type)),n.text){let t=n.text.toLowerCase();e=e.filter(e=>e.content.toLowerCase().includes(t))}let t=Math.min(n.limit??20,50),r=e.slice(0,t),i=e.length>t?`\n(Showing ${t} of ${e.length} total matches)`:``;return this.formatMemoResults(r)+i}case`get_memo`:{let e=P.getState().memos.find(e=>e.id===n.memo_id);return e?this.formatSingleMemo(e):`No memo found with ID: ${n.memo_id}`}case`get_related_memos`:{let e=n.relation_type??`all`,t=[];if(e===`linked`||e===`all`){let e=await V.getLinkedMemos(n.memo_id);t.push(...e)}if(e===`comments`||e===`all`){let e=await V.getCommentMemos(n.memo_id);t.push(...e)}return t.length===0?`No related memos found for ID: ${n.memo_id}`:this.formatMemoResults(t)}case`generate_image`:return await this.callSubagentText(`06-image-gen`,n.prompt);case`summarize_text`:{let e=`Summarize the following text in ${n.style??`paragraph`} format:\n\n${n.text}`;return await this.callSubagentText(`02-summary`,e)}case`summarize_url`:return await this.callSubagentText(`05-webSummary`,`Summarize the content of this web page: ${n.url}`);case`delegate_fast`:return await this.callSubagentText(`04-fast`,n.task);default:return`Unknown tool: ${e}`}}catch(e){return`Tool execution error: ${e instanceof Error?e.message:String(e)}`}}formatMemoResults(e){return e.length===0?`No memos found.`:e.map(e=>this.formatSingleMemo(e)).join(`
- ---
- `)}formatSingleMemo(e){let t=[`[ID: ${e.id}]`,`[Date: ${e.createdAt}]`];return e.thinoType&&e.thinoType!==`JOURNAL`&&t.push(`[Type: ${e.thinoType}]`),e.pinned&&t.push(`[Pinned]`),t.push(e.content),t.join(` `)}refreshPKMerQuota(){this.plugin&&B.getState().activeCompletionProvider===`pkmer`&&this.plugin.pkmerAuth.refreshQuota().then(e=>{if(!e)return;let t=5e5;B.getState().updateProvider(`pkmer`,{quotaInfo:{remaining:Math.floor(e.remainingQuota/t),total:Math.floor(e.quota/t)}})}).catch(e=>console.warn(`[SuperService] Failed to refresh PKMer quota:`,e))}stopIndexing(){this.indexAbort?.abort(),this.indexAbort=null,B.getState().updateIndexStatus({isIndexing:!1}),this.vectorStore.save().catch(()=>{})}async initializeAndIndex(){return this.initializeEmbeddingAndIndex()}async rebuildIndex(){await this.vectorStore.clear(),B.getState().resetIndexStatus(),await this.startIndexing()}getVectorStats(){return this.vectorStore.getStats()}dispose(){console.log(`[SuperService] dispose() called`),this.memoUnsubscribe?.(),this.memoUnsubscribe=null,this.stopIndexing(),this.vectorStore.dispose(),this.providerManager.disposeAll(),this.initialized=!1,console.log(`[SuperService] dispose() complete`)}syncCompletionProvider(){let e=B.getState(),t=e.activeCompletionProvider,n=e.providers[t];n&&(t===`openai`?this.providerManager.register(new $_(n)):t===`anthropic`?this.providerManager.register(new rv(n)):t===`pkmer`&&n.apiKey&&this.providerManager.register(new lv(n)),this.providerManager.setActiveCompletionProvider(t))}setupProviders(){let e=B.getState();if(f.Platform.isDesktop){let e=new iee(this.embeddingService);this.providerManager.register(e)}let t=e.providers.openai||{type:`openai`,enabled:!1};this.providerManager.register(new $_(t));let n=e.providers.anthropic||{type:`anthropic`,enabled:!1};this.providerManager.register(new rv(n));let r=e.providers.pkmer||{type:`pkmer`,enabled:!1};r.apiKey&&this.providerManager.register(new lv(r)),this.providerManager.setActiveEmbeddingProvider(e.activeEmbeddingProvider),this.providerManager.setActiveCompletionProvider(e.activeCompletionProvider)}async indexMemoBatch(e){let t=[];for(let n of e){let e=await this.buildVectorEntries(n);t.push(...e)}if(t.length>0){for(let t of e)await this.vectorStore.removeVectorsByMemoId(t.id);await this.vectorStore.addVectorBatch(t)}}async buildVectorEntries(e){let t=L_(e);if(t.length===0)return[];let n=this.providerManager.getEmbeddingProvider();if(!n)return[];let r=t.map(e=>e.text),i=await n.embed(r);return t.map((t,n)=>({id:`${e.id}-${t.chunkIndex}`,vector:Array.from(i[n].vector),content:t.text,memoId:e.id,chunkIndex:t.chunkIndex,updatedAt:e.updatedAt}))}handleMemoChanges(e,t){if(!this.initialized)return;let n=new Map(t.map(e=>[e.id,e])),r=new Map(e.map(e=>[e.id,e]));for(let t of e){let e=n.get(t.id);(!e||e.updatedAt!==t.updatedAt)&&this.indexMemo(t).catch(e=>console.warn(`[SuperService] Incremental index error:`,e))}for(let e of t)r.has(e.id)||this.removeMemoFromIndex(e.id).catch(e=>console.warn(`[SuperService] Remove from index error:`,e))}};M(),$r(),ng(),Tg();var pv=[{text:j(`AND`),value:`AND`},{text:j(`OR`),value:`OR`}],mv={TAG:{value:`TAG`,text:j(`TAG`),operators:[{text:j(`INCLUDE`),value:`CONTAIN`},{text:j(`EXCLUDE`),value:`NOT_CONTAIN`}]},TYPE:{value:`TYPE`,text:j(`TYPE`),operators:[{value:`IS`,text:j(`IS`)},{value:`IS_NOT`,text:j(`ISNOT`)}],values:[{value:`CONNECTED`,text:j(`LINKED`)},{value:`NOT_TAGGED`,text:j(`NO TAGS`)},{value:`LINKED`,text:j(`HAS LINKS`)},{value:`IMAGED`,text:j(`HAS IMAGES`)}]},TEXT:{value:`TEXT`,text:j(`TEXT`),operators:[{value:`CONTAIN`,text:j(`INCLUDE`)},{value:`NOT_CONTAIN`,text:j(`EXCLUDE`)}]},DATE:{value:`DATE`,text:j(`DATE`),operators:[{value:`NOT_CONTAIN`,text:j(`BEFORE`)},{value:`CONTAIN`,text:j(`AFTER`)}]},LIST:{value:`LIST`,text:j(`LIST`),operators:[{value:`IS`,text:j(`IS`)},{value:`IS_NOT`,text:j(`ISNOT`)}],values:[{value:`TODO`,text:j(`TODO`)},{value:`DONE`,text:j(`DONE`)},{value:`LIST`,text:j(`JOURNAL`)},{value:`OTHER`,text:j(`OTHER`)}]},SOURCE:{value:`SOURCE`,text:j(`SOURCE`),operators:[{value:`IS`,text:j(`IS`)},{value:`IS_NOT`,text:j(`ISNOT`)}],values:[{value:`DAILY`,text:j(`DAILY`)},{value:`MULTI`,text:j(`MULTI`)},{value:`FILE`,text:j(`FILE`)},{value:`CANVAS`,text:j(`CANVAS`)}]},PATH:{value:`PATH`,text:j(`PATH`),operators:[{value:`CONTAIN`,text:j(`INCLUDE`)},{value:`NOT_CONTAIN`,text:j(`EXCLUDE`)}]},METADATA:{value:`METADATA`,text:j(`METADATA`),operators:[{value:`CONTAIN`,text:j(`INCLUDE`)},{value:`NOT_CONTAIN`,text:j(`EXCLUDE`)}]},TIME_RANGE:{value:`TIME_RANGE`,text:j(`TIME RANGE`),operators:[{value:`WITHIN`,text:j(`WITHIN`)},{value:`BEFORE`,text:j(`BEFORE`)}],values:[{value:`7d`,text:j(`7 days`)},{value:`14d`,text:j(`14 days`)},{value:`30d`,text:j(`30 days`)},{value:`90d`,text:j(`3 months`)},{value:`180d`,text:j(`6 months`)},{value:`365d`,text:j(`1 year`)},{value:`thisWeek`,text:j(`This week`)},{value:`thisMonth`,text:j(`This month`)},{value:`thisYear`,text:j(`This year`)},{value:`lastWeek`,text:j(`Last week`)},{value:`lastMonth`,text:j(`Last month`)},{value:`lastYear`,text:j(`Last year`)}]}},hv=mv.TYPE.values,gv=e=>{for(let t of hv)if(t.value===e)return t.text;return``},_v=()=>({type:`TAG`,value:{operator:`CONTAIN`,value:``},relation:`AND`}),vv=(e,t)=>{if(!t||t.length===0)return!0;let n=yv(e,t[0]);for(let r=1;r<t.length;r++){let i=t[r],{relation:a}=i,o=yv(e,i);a===`OR`?n||=o:n&&=o}return n},yv=(e,t)=>{if(!t||typeof t!=`object`||!t.type||!t.value||typeof t.value!=`object`)return!0;let{type:n,value:r}=t,i=r.operator,a=r.value;if(a===``&&n!==`TYPE`&&n!==`LIST`)return!0;switch(n){case`TAG`:{let t=bg(e.content),n=typeof a==`string`?a:``,r=Array.from(t).some(e=>e===n||e.startsWith(`${n}/`));return i===`CONTAIN`?r:!r}case`TEXT`:{let t=(0,f.prepareSimpleSearch)(typeof a==`string`?a.toLowerCase():``)(e.content.toLowerCase());return i===`CONTAIN`?t:!t}case`TYPE`:{let t=!1;return(a===`NOT_TAGGED`&&e.content.match(Br)===null&&e.content.match(Vr)===null&&e.content.match(Hr)===null||a===`LINKED`&&e.content.match(Ur)!==null||a===`IMAGED`&&e.content.match(Gr)!==null||a===`CONNECTED`&&e.content.match(Yr)!==null)&&(t=!0),i===`IS`?t:!t}case`LIST`:{let t=(e.thinoType===`JOURNAL`?`LIST`:e.thinoType===`TASK-TODO`?`TODO`:e.thinoType===`TASK-DONE`?`DONE`:`OTHER`)===a;return i===`IS`?t:!t}case`SOURCE`:return i===`IS`?e.sourceType===a:e.sourceType!==a;case`PATH`:{if(!e.path)return i!==`CONTAIN`;let t=typeof a==`string`?a.toLowerCase():``,n=e.path.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`METADATA`:{if(!e.fileInfo?.frontmatter)return i!==`CONTAIN`;let t=typeof a==`object`&&a?a:{name:``,value:``},n=`name`in t?t.name:``,r=`value`in t?t.value:``;if(!n)return!0;let o=e.fileInfo.frontmatter,s=o[n]&&o[n]?.toString().includes(r);return i===`CONTAIN`?s:!s}case`TIME_RANGE`:{let t=new Date,n,r=t;if(typeof a!=`string`)return!0;switch(a){case`7d`:n=Pm(t,7);break;case`14d`:n=Pm(t,14);break;case`30d`:n=Pm(t,30);break;case`90d`:n=Pm(t,90);break;case`180d`:n=Pm(t,180);break;case`365d`:n=Pm(t,365);break;case`thisWeek`:n=Ks(t),r=xl(t);break;case`thisMonth`:n=ul(t),r=qc(t);break;case`thisYear`:n=hl(t),r=pl(t);break;case`lastWeek`:{let e=Pm(t,7);n=Ks(e),r=xl(e);break}case`lastMonth`:{let e=Bh(t,1);n=ul(e),r=qc(e);break}case`lastYear`:{let e=Xh(t,1);n=hl(e),r=pl(e);break}default:return!0}let o=new Date(e.createdAt);return i===`WITHIN`?Mm(o,{start:n,end:r}):i===`BEFORE`?o<n:!0}case`DATE`:{let t=null;if(typeof a==`string`){let e=new Date(a);if(!isNaN(e.getTime()))t=e;else{let e=app.plugins.enabledPlugins.has(`nldates-obsidian`)&&app.plugins.getPlugin(`nldates-obsidian`);if(e){let n=e.parseDate(a);if(n.date!==null)t=new Date(n.date);else return!0}else return!0}}else typeof a==`object`&&a&&`value`in a&&(t=new Date(a.value));if(!t||isNaN(t.getTime()))return!0;let n=$d(new Date(e.createdAt),Qs(t));return i===`CONTAIN`?n:!n}default:return!0}},bv=typeof window<`u`?U.useLayoutEffect:U.useEffect;function xv(e,t,n,r){let i=(0,U.useRef)(t);bv(()=>{i.current=t},[t]),(0,U.useEffect)(()=>{let t=n?.current||window;if(!(t&&t.addEventListener))return;let a=e=>{i.current(e)};return t.addEventListener(e,a,r),()=>{t.removeEventListener(e,a,r)}},[e,n,r])}function Sv(e,t,n=`mousedown`){xv(n,n=>{let r=n.target;!r||!r.isConnected||r.closest(`.suggestion-container`)||r.closest(`.menu`)||(Array.isArray(e)?e.every(e=>e.current&&!e.current.contains(r)):e.current&&!e.current.contains(r))&&t(n)})}function Cv(e,t,n=[]){let r=(0,U.useRef)(),i=(0,U.useCallback)(()=>{r.current&&clearTimeout(r.current)},[]);return(0,U.useCallback)((...n)=>{i(),r.current=window.setTimeout(()=>{e(...n)},t)},n)}I(),Rg(),H(),M();var wv=[{value:`7d`,text:j(`7 days`)},{value:`14d`,text:j(`14 days`)},{value:`30d`,text:j(`30 days`)},{value:`90d`,text:j(`3 months`)},{value:`180d`,text:j(`6 months`)},{value:`365d`,text:j(`1 year`)},{value:`thisWeek`,text:j(`This week`)},{value:`thisMonth`,text:j(`This month`)},{value:`thisYear`,text:j(`This year`)},{value:`lastWeek`,text:j(`Last week`)},{value:`lastMonth`,text:j(`Last month`)},{value:`lastYear`,text:j(`Last year`)}];function Tv(e){let t=(0,f.moment)(),n,r=t.clone().endOf(`day`);switch(e){case`7d`:n=t.clone().subtract(7,`days`).startOf(`day`);break;case`14d`:n=t.clone().subtract(14,`days`).startOf(`day`);break;case`30d`:n=t.clone().subtract(30,`days`).startOf(`day`);break;case`90d`:n=t.clone().subtract(90,`days`).startOf(`day`);break;case`180d`:n=t.clone().subtract(180,`days`).startOf(`day`);break;case`365d`:n=t.clone().subtract(365,`days`).startOf(`day`);break;case`thisWeek`:n=t.clone().startOf(`week`),r=t.clone().endOf(`week`);break;case`thisMonth`:n=t.clone().startOf(`month`),r=t.clone().endOf(`month`);break;case`thisYear`:n=t.clone().startOf(`year`),r=t.clone().endOf(`year`);break;case`lastWeek`:n=t.clone().subtract(1,`week`).startOf(`week`),r=t.clone().subtract(1,`week`).endOf(`week`);break;case`lastMonth`:n=t.clone().subtract(1,`month`).startOf(`month`),r=t.clone().subtract(1,`month`).endOf(`month`);break;case`lastYear`:n=t.clone().subtract(1,`year`).startOf(`year`),r=t.clone().subtract(1,`year`).endOf(`year`);break;default:return null}return{from:n.valueOf(),to:r.valueOf()}}var Ev=({isSearching:e,embeddingReady:t,loadingProgress:n,loadingStatus:r,indexStatus:i})=>{if(e)return(0,W.jsx)(`div`,{className:`search-bar-spinner`});if(!t)return(0,W.jsxs)(`div`,{className:`search-bar-super-badge loading`,title:r||`Loading model...`,children:[(0,W.jsx)(`div`,{className:`search-bar-mini-spinner`}),n>0&&n<100&&(0,W.jsxs)(`span`,{className:`search-bar-progress-text`,children:[Math.round(n),`%`]})]});if(i.isIndexing){let e=i.totalMemos>0?Math.round(i.indexedMemos/i.totalMemos*100):0;return(0,W.jsx)(`div`,{className:`search-bar-super-badge indexing`,title:`Indexing: ${i.indexedMemos}/${i.totalMemos}`,children:(0,W.jsx)(`div`,{className:`search-bar-mini-progress-bar`,children:(0,W.jsx)(`div`,{className:`search-bar-mini-progress-fill`,style:{width:`${e}%`}})})})}return(0,W.jsx)(`div`,{className:`search-bar-super-badge ready`,title:j(`Super search active`)})},Dv=({disableSuper:e=!1})=>{let{app:t,view:n}=F(),{query:{type:r,text:i,duration:a}}=Si(),o=B(e=>e.enabled),s=B(e=>e.embeddingReady),c=B(e=>e.isSearching),l=B(e=>e.indexStatus),u=B(e=>e.loadingProgress),d=B(e=>e.loadingStatus),p=o&&!e,m=(0,U.useRef)(null),h=(0,U.useRef)(null),g=(0,U.useRef)(null),_=(0,U.useRef)(null),v=(0,U.useRef)(null),[y,b]=(0,U.useState)(i||``),[x,S]=(0,U.useState)(!1),[C,w]=(0,U.useState)(``),[T,E]=(0,U.useState)(null),[D,O]=(0,U.useState)(),k=!!T,ee=!!(r||a||C);(0,U.useEffect)(()=>{b(i||``)},[i]),(0,U.useEffect)(()=>{a||w(``)},[a]),(0,U.useEffect)(()=>{!h||!n||!t||(n.registerEvent(t.workspace.on(`blur-on-memos`,()=>{h.current?.blur()})),n.registerEvent(t.workspace.on(`focus-on-searchBar`,()=>{h.current?.focus()})))},[h,t,n]),(0,U.useEffect)(()=>{g.current&&(0,f.setIcon)(g.current,`search`)},[]),(0,U.useLayoutEffect)(()=>{E(m.current?.closest(`#page-wrapper.focus`)||null)},[]),(0,U.useLayoutEffect)(()=>{if(!x||!T)return;let e=()=>{let e=m.current?.querySelector(`.search-bar-inputer`)?.getBoundingClientRect(),t=T.getBoundingClientRect();e&&O({top:e.bottom-t.top+6,left:e.left-t.left})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[T,x]),(0,U.useEffect)(()=>{_.current&&(0,f.setIcon)(_.current,`chevron-down`)},[]),Sv([v,_],()=>{S(!1)});let A=Cv((e,t)=>{if(z.setTextQuery(e),t){let t=B.getState();if(t.setSearchQuery(e),!e.trim()){t.setSearchResults([]),t.setIsSearching(!1);return}t.setIsSearching(!0),fv.hybridSearch(e,20).then(e=>t.setSearchResults(e)).catch(e=>{console.warn(`[SearchBar] Hybrid search error:`,e),t.setSearchResults([])}).finally(()=>t.setIsSearching(!1))}},300,[]),te=(0,U.useCallback)(e=>{let t=e.currentTarget.value;b(t),A(t,p)},[A,p]),ne=(0,U.useCallback)(()=>{if(b(``),z.setTextQuery(``),p){let e=B.getState();e.setSearchQuery(``),e.setSearchResults([])}h.current?.focus()},[p]),re=(0,U.useCallback)(e=>{let{type:t}=z.getState().query;e===t&&(e=``),z.setMemoTypeQuery(e)},[]),ie=(0,U.useCallback)(e=>{if(C===e)w(``),z.setTimeQuery({from:0,to:0});else{let t=Tv(e);t&&(w(e),z.setTimeQuery(t))}},[C]),ae=(0,U.useCallback)(()=>{S(e=>!e)},[]),oe=x&&(0,W.jsxs)(`div`,{className:`search-bar-filters-panel`,ref:v,style:k?D:void 0,children:[(0,W.jsxs)(`div`,{className:`search-bar-filter-section`,children:[(0,W.jsx)(`span`,{className:`filter-section-label`,children:j(`TYPE`)}),(0,W.jsx)(`div`,{className:`filter-section-options`,children:hv.map(e=>(0,W.jsx)(`button`,{className:`clickable-icon filter-option-chip ${r===e.value?`active`:``}`,onClick:()=>re(e.value),children:e.text},e.value))})]}),(0,W.jsxs)(`div`,{className:`search-bar-filter-section`,children:[(0,W.jsx)(`span`,{className:`filter-section-label`,children:j(`TIME RANGE`)}),(0,W.jsx)(`div`,{className:`filter-section-options`,children:wv.map(e=>(0,W.jsx)(`button`,{className:`clickable-icon filter-option-chip ${C===e.value?`active`:``}`,onClick:()=>ie(e.value),children:e.text},e.value))})]})]});return(0,W.jsxs)(`div`,{className:`search-bar-container`,ref:m,children:[(0,W.jsxs)(`div`,{className:`search-bar-inputer`,children:[(0,W.jsx)(`span`,{ref:g,className:`btn icon-img`}),(0,W.jsx)(`input`,{ref:h,className:`text-input`,type:`text`,value:y,placeholder:p&&!s?`${j(`Type here`)} (${j(`model loading...`)})`:j(`Type here`),onChange:te}),p&&(0,W.jsx)(Ev,{isSearching:c,embeddingReady:s,loadingProgress:u,loadingStatus:d,indexStatus:l}),y&&(0,W.jsx)(`button`,{className:`search-bar-clear clickable-icon`,onClick:ne,title:j(`Clear search`),children:`×`}),(0,W.jsx)(`div`,{ref:_,className:`search-bar-filter-toggle clickable-icon ${x?`active`:``} ${ee?`has-filter`:``}`,onClick:ae,title:j(`Toggle filters`)})]}),k&&T?(0,A_.createPortal)(oe,T):oe]})},Ov=e=>{let{children:t,when:n}=e;return n?(0,W.jsx)(W.Fragment,{children:t}):null};function kv(){let e=document.createDocumentFragment();e.createEl(`div`,{cls:`thino-info`}).createEl(`div`,{text:j(`This is a pro feature, please upgrade to pro version to use it.`)});let t=e.createEl(`div`,{cls:`thino-link`}).createEl(`div`,{text:j(`You can get pro version from: `)}),n=m_()?`https://pkmer.cn/products/thino/`:`https://thino.pkmer.net/en/`;t.createEl(`a`,{text:`PKMer`,attr:{href:n}}),new f.Notice(e,5e3)}var Av=o((()=>{M(),h_()}));function jv(){return process.platform===`win32`?process.arch===`ia32`&&Object.hasOwnProperty.call(process.env,`PROCESSOR_ARCHITEW6432`)?`mixed`:`native`:``}function Mv(e){return Lv(`sha256`).update(e).digest(`hex`)}function Nv(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 Error(`Unsupported platform: ${process.platform}`)}}function Pv(e=!1){return new Promise((t,n)=>{Fv(Rv[process.platform],{},(r,i)=>{if(r)return n(Error(`Error while obtaining machine id: ${r.stack}`));let a=Nv(i.toString());return t(e?a:Mv(a))})})}var Fv,Iv,Lv,Rv,zv=o((()=>{K_(),{exec:Fv,execSync:Iv}=G_(`child_process`),{createHash:Lv}=G_(`crypto`),Rv=f.Platform.isDesktop&&{darwin:`ioreg -rd1 -c IOPlatformExpertDevice`,win32:`${{native:`%windir%\\System32`,mixed:`%windir%\\sysnative\\cmd.exe /c %windir%\\System32`}[jv()]}\\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`}}));I(),H(),Av(),M(),zv();var Bv={list:`align-left`,waterfall:`layout-grid`,calendar:`calendar`,minimal:`list`,table:`table`,chat:`message-square`,moments:`chrome`,flow:`workflow`},Vv=({className:e})=>{let{app:t,view:n,verifyState:r,settings:i}=F(),{manifest:a,isMobileView:o}=vi(),s=(0,U.useRef)(null),c=(0,U.useRef)(null),[l,u]=(0,U.useState)(()=>(window.app||t)?.loadLocalStorage(`thinoListView`)||`list`),[d,p]=(0,U.useState)(null),m=(0,U.useCallback)(()=>{if(!n?.leaf||n.leaf.height===0||!d?.settings)return;let e=d.settings.MemoListView;if(d.settings.SupportSelectOtherView||e===`chat`||e===`moments`||e===`flow`)return;let t=n.leaf.width>950?e:`list`;u(t),R.setMemoListView(t)},[n,d]);(0,U.useEffect)(()=>{if(!a||!t)return;let e=t.plugins.getPlugin(a.id);if(e){p(e);let t=e.settings?.MemoListView||`list`;u(t),R.setMemoListView(t)}},[a,t]),(0,U.useEffect)(()=>{if(!(!t||!n||!d?.settings))return m(),c.current||(c.current=t.workspace.on(`resize`,m),n.registerEvent(c.current)),()=>{c.current&&=(t.workspace.offref(c.current),null)}},[t,n,d,m]),(0,U.useEffect)(()=>{if(!s.current||!l)return;let e=Bv[l]||`list`;(0,f.setIcon)(s.current,e),R.setMemoListView(l),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(s.current,j(`Switch view`))},[l]);let h=(0,U.useMemo)(()=>{let e=[{view:`list`,title:j(`List`)},{view:`chat`,title:j(`Chat`)},{view:`moments`,title:j(`Moments`)},{view:`flow`,title:j(`Flow`)}];return(!o||i?.SupportSelectOtherView)&&e.push({view:`waterfall`,title:j(`Waterfall`)},{view:`calendar`,title:j(`Calendar`)},{view:`table`,title:j(`Table`)}),e},[o,i?.SupportSelectOtherView]),g=(0,U.useCallback)(async e=>{try{let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;if(!r||r.appId!==n){kv();return}let i=async e=>{l!==e&&(R.setMemoListView(e),d&&(d.settings={...d.settings,MemoListView:e},await d.saveSettings()),u(e))},a=new f.Menu;console.log(`viewOptions`,h),h.forEach(({view:e,title:t})=>{a.addItem(n=>{n.setChecked(l===e).setIcon(Bv[e]).setTitle(t).onClick(()=>i(e))})}),a.showAtMouseEvent(e.nativeEvent)}catch(e){console.error(`Error handling view switcher click:`,e)}},[r,l,d,h]);return(0,W.jsx)(`div`,{className:(0,U.useMemo)(()=>`memos-view-switcher-wrapper ${e||``} pro`.trim(),[e]),ref:s,onClick:g})};M(),H();var Hv=()=>{let e=(0,U.useRef)(null);return(0,U.useEffect)(()=>{e&&((0,f.setIcon)(e.current,`calendar-check`),f.setTooltip&&(0,f.setTooltip)(e.current,j(`Daily Memos`)))},[e]),(0,W.jsx)(`div`,{className:`memos-review-entry-wrapper`,ref:e,onClick:()=>{z.setPathname(`/daily`)}})},Uv=function(e){return e.reduce(function(e,t){var n=t[0];return e[n]=t[1],e},{})},Wv=typeof window<`u`&&window.document&&window.document.createElement?U.useLayoutEffect:U.useEffect,Gv=`bottom`,Kv=`right`,qv=`left`,Jv=`auto`,Yv=[`top`,Gv,Kv,qv],Xv=`start`,Zv=`clippingParents`,Qv=`viewport`,$v=`popper`,ey=`reference`,ty=Yv.reduce(function(e,t){return e.concat([t+`-`+Xv,t+`-end`])},[]),ny=[].concat(Yv,[Jv]).reduce(function(e,t){return e.concat([t,t+`-`+Xv,t+`-end`])},[]),ry=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function iy(e){return e?(e.nodeName||``).toLowerCase():null}function ay(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function oy(e){return e instanceof ay(e).Element||e instanceof Element}function sy(e){return e instanceof ay(e).HTMLElement||e instanceof HTMLElement}function cy(e){return typeof ShadowRoot>`u`?!1:e instanceof ay(e).ShadowRoot||e instanceof ShadowRoot}function ly(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!sy(i)||!iy(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function uy(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(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!sy(r)||!iy(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var dy={name:`applyStyles`,enabled:!0,phase:`write`,fn:ly,effect:uy,requires:[`computeStyles`]};function fy(e){return e.split(`-`)[0]}var py=Math.max,my=Math.min,hy=Math.round;function gy(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function _y(){return!/^((?!chrome|android).)*safari/i.test(gy())}function vy(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&sy(e)&&(i=e.offsetWidth>0&&hy(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&hy(r.height)/e.offsetHeight||1);var o=(oy(e)?ay(e):window).visualViewport,s=!_y()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function yy(e){var t=vy(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 by(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&cy(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function xy(e){return ay(e).getComputedStyle(e)}function Sy(e){return[`table`,`td`,`th`].indexOf(iy(e))>=0}function Cy(e){return((oy(e)?e.ownerDocument:e.document)||window.document).documentElement}function wy(e){return iy(e)===`html`?e:e.assignedSlot||e.parentNode||(cy(e)?e.host:null)||Cy(e)}function Ty(e){return!sy(e)||xy(e).position===`fixed`?null:e.offsetParent}function Ey(e){var t=/firefox/i.test(gy());if(/Trident/i.test(gy())&&sy(e)&&xy(e).position===`fixed`)return null;var n=wy(e);for(cy(n)&&(n=n.host);sy(n)&&[`html`,`body`].indexOf(iy(n))<0;){var r=xy(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function Dy(e){for(var t=ay(e),n=Ty(e);n&&Sy(n)&&xy(n).position===`static`;)n=Ty(n);return n&&(iy(n)===`html`||iy(n)===`body`&&xy(n).position===`static`)?t:n||Ey(e)||t}function Oy(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function ky(e,t,n){return py(e,my(t,n))}function Ay(e,t,n){var r=ky(e,t,n);return r>n?n:r}function jy(){return{top:0,right:0,bottom:0,left:0}}function My(e){return Object.assign({},jy(),e)}function Ny(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var Py=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,My(typeof e==`number`?Ny(e,Yv):e)};function Fy(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=fy(n.placement),c=Oy(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=Py(i.padding,n),d=yy(a),f=c===`y`?`top`:qv,p=c===`y`?Gv:Kv,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=Dy(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=ky(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function Iy(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||by(t.elements.popper,r)&&(t.elements.arrow=r))}var Ly={name:`arrow`,enabled:!0,phase:`main`,fn:Fy,effect:Iy,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function Ry(e){return e.split(`-`)[1]}var zy={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function By(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:hy(n*i)/i||0,y:hy(r*i)/i||0}}function Vy(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=qv,b=`top`,x=window;if(l){var S=Dy(n),C=`clientHeight`,w=`clientWidth`;if(S===ay(n)&&(S=Cy(n),xy(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=Gv;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=Kv;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&zy),O=u===!0?By({x:p,y:h},ay(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function Hy(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,s=n.roundOffsets,c=s===void 0?!0:s,l={placement:fy(t.placement),variation:Ry(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Vy(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Vy(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Uy={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:Hy,data:{}},Wy={passive:!0};function Gy(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,o=r.resize,s=o===void 0?!0:o,c=ay(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,Wy)}),s&&c.addEventListener(`resize`,n.update,Wy),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,Wy)}),s&&c.removeEventListener(`resize`,n.update,Wy)}}var Ky={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:Gy,data:{}},qy={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Jy(e){return e.replace(/left|right|bottom|top/g,function(e){return qy[e]})}var Yy={start:`end`,end:`start`};function Xy(e){return e.replace(/start|end/g,function(e){return Yy[e]})}function Zy(e){var t=ay(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Qy(e){return vy(Cy(e)).left+Zy(e).scrollLeft}function $y(e,t){var n=ay(e),r=Cy(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=_y();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+Qy(e),y:c}}function eb(e){var t=Cy(e),n=Zy(e),r=e.ownerDocument?.body,i=py(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=py(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+Qy(e),s=-n.scrollTop;return xy(r||t).direction===`rtl`&&(o+=py(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function tb(e){var t=xy(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function nb(e){return[`html`,`body`,`#document`].indexOf(iy(e))>=0?e.ownerDocument.body:sy(e)&&tb(e)?e:nb(wy(e))}function rb(e,t){t===void 0&&(t=[]);var n=nb(e),r=n===e.ownerDocument?.body,i=ay(n),a=r?[i].concat(i.visualViewport||[],tb(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(rb(wy(a)))}function ib(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ab(e,t){var n=vy(e,!1,t===`fixed`);return n.top+=e.clientTop,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 ob(e,t,n){return t===`viewport`?ib($y(e,n)):oy(t)?ab(t,n):ib(eb(Cy(e)))}function sb(e){var t=rb(wy(e)),n=[`absolute`,`fixed`].indexOf(xy(e).position)>=0&&sy(e)?Dy(e):e;return oy(n)?t.filter(function(e){return oy(e)&&by(e,n)&&iy(e)!==`body`}):[]}function cb(e,t,n,r){var i=t===`clippingParents`?sb(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=ob(e,n,r);return t.top=py(i.top,t.top),t.right=my(i.right,t.right),t.bottom=my(i.bottom,t.bottom),t.left=py(i.left,t.left),t},ob(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function lb(e){var t=e.reference,n=e.element,r=e.placement,i=r?fy(r):null,a=r?Ry(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case Gv:c={x:o,y:t.y+t.height};break;case Kv:c={x:t.x+t.width,y:s};break;case qv:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?Oy(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case Xv:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2);break;default:}}return c}function ub(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?Zv:s,l=n.rootBoundary,u=l===void 0?Qv:l,d=n.elementContext,f=d===void 0?$v:d,p=n.altBoundary,m=p===void 0?!1:p,h=n.padding,g=h===void 0?0:h,_=My(typeof g==`number`?Ny(g,Yv):g),v=f===`popper`?ey:$v,y=e.rects.popper,b=e.elements[m?v:f],x=cb(oy(b)?b:b.contextElement||Cy(e.elements.popper),c,u,o),S=vy(e.elements.reference),C=lb({reference:S,element:y,strategy:`absolute`,placement:i}),w=ib(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function db(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?ny:c,u=Ry(r),d=u?s?ty:ty.filter(function(e){return Ry(e)===u}):Yv,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=ub(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[fy(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function fb(e){if(fy(e)===`auto`)return[];var t=Jy(e);return[Xy(e),t,Xy(t)]}function pb(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!0:o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,h=n.allowedAutoPlacements,g=t.options.placement,_=fy(g)===g,v=c||(_||!m?[Jy(g)]:fb(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(fy(n)===`auto`?db(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=fy(E),O=Ry(E)===Xv,k=[`top`,Gv].indexOf(D)>=0,ee=k?`width`:`height`,A=ub(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),te=k?O?Kv:qv:O?Gv:`top`;b[ee]>x[ee]&&(te=Jy(te));var ne=Jy(te),re=[];if(a&&re.push(A[D]<=0),s&&re.push(A[te]<=0,A[ne]<=0),re.every(function(e){return e})){w=E,C=!1;break}S.set(E,re)}if(C)for(var ie=m?3:1,ae=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},oe=ie;oe>0&&ae(oe)!==`break`;oe--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var mb={name:`flip`,enabled:!0,phase:`main`,fn:pb,requiresIfExists:[`offset`],data:{_skip:!1}};function hb(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 gb(e){return[`top`,Kv,Gv,qv].some(function(t){return e[t]>=0})}function _b(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=ub(t,{elementContext:`reference`}),s=ub(t,{altBoundary:!0}),c=hb(o,r),l=hb(s,i,a),u=gb(c),d=gb(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var vb={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:_b};function yb(e,t,n){var r=fy(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function bb(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=ny.reduce(function(e,n){return e[n]=yb(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var xb={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:bb};function Sb(e){var t=e.state,n=e.name;t.modifiersData[n]=lb({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var Cb={name:`popperOffsets`,enabled:!0,phase:`read`,fn:Sb,data:{}};function wb(e){return e===`x`?`y`:`x`}function Tb(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!1:o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,m=n.tetherOffset,h=m===void 0?0:m,g=ub(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=fy(t.placement),v=Ry(t.placement),y=!v,b=Oy(_),x=wb(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:qv,ee=b===`y`?Gv:Kv,A=b===`y`?`height`:`width`,te=S[b],ne=te+g[k],re=te-g[ee],ie=p?-w[A]/2:0,ae=v===`start`?C[A]:w[A],oe=v===`start`?-w[A]:-C[A],se=t.elements.arrow,ce=p&&se?yy(se):{width:0,height:0},le=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:jy(),ue=le[k],de=le[ee],fe=ky(0,C[A],ce[A]),pe=y?C[A]/2-ie-fe-ue-E.mainAxis:ae-fe-ue-E.mainAxis,me=y?-C[A]/2+ie+fe+de+E.mainAxis:oe+fe+de+E.mainAxis,he=t.elements.arrow&&Dy(t.elements.arrow),ge=he?b===`y`?he.clientTop||0:he.clientLeft||0:0,_e=D?.[b]??0,ve=te+pe-_e-ge,ye=te+me-_e,be=ky(p?my(ne,ve):ne,te,p?py(re,ye):re);S[b]=be,O[b]=be-te}if(s){var xe=b===`x`?`top`:qv,Se=b===`x`?Gv:Kv,Ce=S[x],we=x===`y`?`height`:`width`,Te=Ce+g[xe],Ee=Ce-g[Se],De=[`top`,qv].indexOf(_)!==-1,Oe=D?.[x]??0,ke=De?Te:Ce-C[we]-w[we]-Oe+E.altAxis,Ae=De?Ce+C[we]+w[we]-Oe-E.altAxis:Ee,je=p&&De?Ay(ke,Ce,Ae):ky(p?ke:Te,Ce,p?Ae:Ee);S[x]=je,O[x]=je-Ce}t.modifiersData[r]=O}}var Eb={name:`preventOverflow`,enabled:!0,phase:`main`,fn:Tb,requiresIfExists:[`offset`]};function Db(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ob(e){return e===ay(e)||!sy(e)?Zy(e):Db(e)}function kb(e){var t=e.getBoundingClientRect(),n=hy(t.width)/e.offsetWidth||1,r=hy(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Ab(e,t,n){n===void 0&&(n=!1);var r=sy(t),i=sy(t)&&kb(t),a=Cy(t),o=vy(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((iy(t)!==`body`||tb(a))&&(s=Ob(t)),sy(t)?(c=vy(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Qy(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function jb(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function Mb(e){var t=jb(e);return ry.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function Nb(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function Pb(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var Fb={placement:`bottom`,modifiers:[],strategy:`absolute`};function Ib(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function Lb(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?Fb:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},Fb,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:oy(e)?rb(e):e.contextElement?rb(e.contextElement):[],popper:rb(t)};var s=Mb(Pb([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(Ib(t,n)){i.rects={reference:Ab(t,Dy(n),i.options.strategy===`fixed`),popper:yy(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:Nb(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!Ib(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var Rb=Lb({defaultModifiers:[Ky,Cb,Uy,dy,xb,mb,Eb,Ly,vb]}),zb=u(s(((e,t)=>{var n=typeof Element<`u`,r=typeof Map==`function`,i=typeof Set==`function`,a=typeof ArrayBuffer==`function`&&!!ArrayBuffer.isView;function o(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var s,c,l;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(!o(e[c],t[c]))return!1;return!0}var u;if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!o(c.value[1],t.get(c.value[0])))return!1;return!0}if(i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(e[c]!==t[c])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(l=Object.keys(e),s=l.length,s!==Object.keys(t).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(t,l[c]))return!1;if(n&&e instanceof Element)return!1;for(c=s;c--!==0;)if(!((l[c]===`_owner`||l[c]===`__v`||l[c]===`__o`)&&e.$$typeof)&&!o(e[l[c]],t[l[c]]))return!1;return!0}return e!==e&&t!==t}t.exports=function(e,t){try{return o(e,t)}catch(e){if((e.message||``).match(/stack|recursion/i))return console.warn(`react-fast-compare cannot handle circular refs`),!1;throw e}}}))()),Bb=[],Vb=function(e,t,n){n===void 0&&(n={});var r=U.useRef(null),i={onFirstUpdate:n.onFirstUpdate,placement:n.placement||`bottom`,strategy:n.strategy||`absolute`,modifiers:n.modifiers||Bb},a=U.useState({styles:{popper:{position:i.strategy,left:`0`,top:`0`},arrow:{position:`absolute`}},attributes:{}}),o=a[0],s=a[1],c=U.useMemo(function(){return{name:`updateState`,enabled:!0,phase:`write`,fn:function(e){var t=e.state,n=Object.keys(t.elements);A_.flushSync(function(){s({styles:Uv(n.map(function(e){return[e,t.styles[e]||{}]})),attributes:Uv(n.map(function(e){return[e,t.attributes[e]]}))})})},requires:[`computeStyles`]}},[]),l=U.useMemo(function(){var e={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[c,{name:`applyStyles`,enabled:!1}])};return(0,zb.default)(r.current,e)?r.current||e:(r.current=e,e)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,c]),u=U.useRef();return Wv(function(){u.current&&u.current.setOptions(l)},[l]),Wv(function(){if(!(e==null||t==null)){var r=(n.createPopper||Rb)(e,t,l);return u.current=r,function(){r.destroy(),u.current=null}}},[e,t,n.createPopper]),{state:u.current?u.current.state:null,styles:o.styles,attributes:o.attributes,update:u.current?u.current.update:null,forceUpdate:u.current?u.current.forceUpdate:null}},Hb=s(((e,t)=>{var n=!1,r=function(){};if(n){var i=function(e,t){var n=arguments.length;t=Array(n>1?n-1:0);for(var r=1;r<n;r++)t[r-1]=arguments[r];var i=0,a=`Warning: `+e.replace(/%s/g,function(){return t[i++]});typeof console<`u`&&console.error(a);try{throw Error(a)}catch{}};r=function(e,t,n){var r=arguments.length;n=Array(r>2?r-2:0);for(var a=2;a<r;a++)n[a-2]=arguments[a];if(t===void 0)throw Error("`warning(condition, format, ...args)` requires a warning message argument");e||i.apply(null,[t].concat(n))}}t.exports=r}));function Ub(e=!0){let[t,n]=(0,U.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})}}}function Wb(e){let[t,n]=(0,U.useState)(()=>!!e);return[t,(0,U.useCallback)(e=>{n(typeof e==`boolean`?e:e=>!e)},[])]}M();var Gb={text:j(`SELECT`),value:``},Kb=(0,U.memo)(e=>{let{className:t,dataSource:n,handleValueChanged:r,value:i}=e,[a,o]=Wb(!1),s=(0,U.useRef)(null),c=Gb;for(let e of n)if(e.value===i){c=e;break}(0,U.useEffect)(()=>{a&&window.addEventListener(`click`,e=>{s.current?.contains(e.target)||o(!1)},{capture:!0,once:!0})},[a]);let l=e=>{r&&r(e.value),o(!1)};return(0,W.jsxs)(`div`,{className:`selector-wrapper ${t||``}`,ref:s,children:[(0,W.jsxs)(`div`,{className:`current-value-container ${a?`active`:``}`,onClick:e=>{e.stopPropagation(),o()},children:[(0,W.jsx)(`span`,{className:`value-text`,children:c.text}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn arrow-text`})]}),(0,W.jsx)(`div`,{className:`items-wrapper ${a?``:`thino-hidden`}`,children:n.map(e=>(0,W.jsx)(`div`,{className:`item-container ${e.value===i?`selected`:``}`,onClick:()=>{l(e)},children:e.text},e.value))})]})});M();var qb=e=>{let{year:t,handleYearChange:n}=e,[r,i]=(0,U.useState)([]),[a,o]=(0,U.useState)(t),s=(0,U.useRef)(null),c=(0,U.useRef)(null),[l,u]=U.useState(!1),d=U.useRef(null);Sv(d,()=>{u(!1)}),(0,U.useEffect)(()=>{s.current&&(0,f.setIcon)(s.current,`chevron-left`),c.current&&(0,f.setIcon)(c.current,`chevron-right`)},[s,c,l]),(0,U.useEffect)(()=>{p(a)},[t]);let p=e=>{let t=parseInt(e),n=t-t%10,r=[];for(let e=0;e<10;e++)r.push(`${n+e}`);i(r)};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`btn year-btn`,onClick:()=>{u(!l)},children:[(0,W.jsx)(`span`,{children:t}),(0,W.jsx)(`span`,{children:j(`year`)})]}),l&&(0,W.jsxs)(`div`,{ref:d,className:`year-picker-wrapper`,children:[(0,W.jsxs)(`div`,{className:`year-picker-header`,children:[(0,W.jsxs)(`div`,{className:`year-picker-header-title`,children:[a,` `+(j(`year`)||``)]}),(0,W.jsxs)(`div`,{className:`year-picker-header-btns`,children:[(0,W.jsx)(`span`,{className:`btn`,ref:s,onClick:()=>{let e=parseInt(a)-10;o(e.toString()),p(e.toString())}}),(0,W.jsx)(`span`,{className:`btn`,ref:c,onClick:()=>{let e=parseInt(a)+10;o(e.toString()),p(e.toString())}})]})]}),(0,W.jsx)(`div`,{className:`year-picker-body`,children:(0,W.jsx)(`div`,{className:`year-picker-body-list`,children:r.map(e=>(0,W.jsx)(`div`,{className:`year-picker-body-item ${e===a?`selected`:``}`,onClick:()=>{o(e),n(e),u(!1)},children:e},e))})})]})]})},Jb=e=>{let{month:t,handleMonthChange:n}=e,[r,i]=(0,U.useState)([]),[a,o]=(0,U.useState)((parseInt(t)+1).toString()),[s,c]=U.useState(!1),l=U.useRef(null);Sv(l,()=>{c(!1)}),(0,U.useEffect)(()=>{u()},[t]);let u=()=>{let e=[];for(let t=1;t<=12;t++)e.push(`${t}`);i(e)};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`btn month-btn`,onClick:()=>{c(!s)},children:[(0,W.jsxs)(`span`,{children:[j(`monthsShort`)[parseInt(t)]||parseInt(t)+1,` `]}),(0,W.jsx)(`span`,{children:j(`month`)||``})]}),s&&(0,W.jsxs)(`div`,{ref:l,className:`month-picker-wrapper`,children:[(0,W.jsxs)(`div`,{className:`month-picker-header`,children:[(0,W.jsxs)(`div`,{className:`month-picker-header-title`,children:[a,` `+(j(`month`)||``)]}),(0,W.jsx)(`div`,{className:`month-picker-header-btns`})]}),(0,W.jsx)(`div`,{className:`month-picker-body`,children:(0,W.jsx)(`div`,{className:`month-picker-body-list`,children:r.map(e=>(0,W.jsx)(`div`,{className:`month-picker-body-item ${e===a?`selected`:``}`,onClick:()=>{o(e),n(e),c(!1)},children:e},e))})})]})]})};$r(),M();var Yb=e=>{let{className:t,datestamp:n,handleDateStampChange:r}=e,[i,a]=(0,U.useState)(Zb(n)),[o,s]=(0,U.useState)(n);(0,U.useEffect)(()=>{a(Zb(n))},[n]);let c=new Date(i),l=c.getDay(),u=[];for(let e=0;e<l;e++)u.push({date:0,datestamp:c.getTime()-zr*(7-e)});let d=Xb(i);for(let e=1;e<=d;e++)u.push({date:e,datestamp:c.getTime()+zr*(e-1)});let p=(e,t)=>{r(t,e.nativeEvent),s(t)},m=e=>{let t=c.getFullYear(),n=c.getMonth()+1,r=0;r=n===1&&e===-1?new Date(`${t-1}/12/1`).getTime():n===12&&e===1?new Date(`${t+1}/1/1`).getTime():new Date(`${t}/${n+e}/1`).getTime(),a(Zb(r))};return(0,W.jsxs)(`div`,{className:`date-picker-wrapper ${t}`,children:[(0,W.jsxs)(`div`,{className:`date-picker-header`,children:[(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-left`)},className:`btn btn-text`,onClick:()=>m(-1)}),(0,W.jsxs)(`span`,{className:`normal-text`,children:[(0,W.jsx)(qb,{year:c.getFullYear().toString(),handleYearChange:e=>{a(Zb(new Date(`${e}/${c.getMonth()+1}/1`).getTime()))}}),(0,W.jsx)(Jb,{month:c.getMonth().toString(),handleMonthChange:e=>{a(Zb(new Date(`${c.getFullYear()}/${parseInt(e)}/1`).getTime()))}})]}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn btn-text`,onClick:()=>m(1)})]}),(0,W.jsxs)(`div`,{className:`date-picker-day-container`,children:[(0,W.jsx)(`div`,{className:`date-picker-day-header`,children:j(`weekDaysShort`).map(e=>(0,W.jsx)(`span`,{className:`day-item`,children:e},e))}),(0,W.jsx)(`div`,{className:`date-picker-day-content`,children:u.map(e=>e.date===0?(0,W.jsx)(`span`,{className:`day-item null`,children:``},e.datestamp):(0,W.jsx)(`span`,{className:`day-item ${e.datestamp===n?`current`:``} ${e.datestamp===o?`selected`:``}`,onClick:t=>p(t,e.datestamp),children:(0,W.jsx)(`span`,{className:`day-item-text`,children:e.date})},e.datestamp))})]})]})};function Xb(e){let 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())/zr}function Zb(e){let t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}M(),H();var Qb=[{label:j(`Today`),value:(0,f.moment)().format(`YYYY-MM-DD`)},{label:j(`Yesterday`),value:(0,f.moment)().subtract(1,`days`).format(`YYYY-MM-DD`)},{label:j(`Last 7 days`),value:(0,f.moment)().subtract(7,`days`).format(`YYYY-MM-DD`)},{label:j(`Last 30 days`),value:(0,f.moment)().subtract(30,`days`).format(`YYYY-MM-DD`)},{label:j(`Last 90 days`),value:(0,f.moment)().subtract(90,`days`).format(`YYYY-MM-DD`)},{label:j(`Last 180 days`),value:(0,f.moment)().subtract(180,`days`).format(`YYYY-MM-DD`)},{label:j(`Last 365 days`),value:(0,f.moment)().subtract(365,`days`).format(`YYYY-MM-DD`)}],$b=e=>{let{handleValueChange:t,setShownStatus:n}=e;return(0,W.jsxs)(W.Fragment,{children:[e.type===`icon`&&(0,W.jsx)(`div`,{className:`quick-date-btn-group`,children:Qb.map((e,r)=>(0,W.jsx)(`div`,{className:`btn action-btn quick-date-btn`,onClick:()=>{t(e.value),n&&n(!1)},children:e.label},r))}),(0,W.jsx)(Yb,{className:`calendar-date-picker`,datestamp:e?.defaultValue||(0,f.moment)().startOf(`day`).valueOf(),handleDateStampChange:(r,i)=>{t(e.type===`icon`?(0,f.moment)(r).format(`YYYY-MM-DD`):r.toString()),n&&n(!1)}})]})},ex=e=>{let{handleValueChange:t}=e,[n,r]=U.useState(!1),i=U.useRef(null),a=U.useRef(null),o=Vb(a.current,i.current,{placement:`bottom-start`});return Sv(i,()=>{r(!1)}),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{ref:t=>{a.current=t,t&&e.type===`icon`&&(0,f.setIcon)(t,`calendar`)},className:`btn calendar-btn ${e.type===`icon`?`icon-btn`:`text-btn`}`,onClick:()=>{!f.Platform.isMobile&&r(!n),!f.Platform.isMobile&&o?.update&&o?.update(),f.Platform.isMobile&&new tx(L.getState().app,e.type,t).open()},children:e.type===`text`&&e.defaultValue?e.defaultText?e.defaultText:(0,f.moment)(e.defaultValue,`x`).subtract(e.startOrEnd===`end`?1:0,`days`).format(`YYYY/MM/DD`):``}),(0,W.jsx)(`div`,{className:`menu-btns-popup ${n?``:`thino-hidden`}`,ref:i,style:o.styles.popper,children:(0,W.jsx)($b,{type:e.defaultText?`icon`:e.type,handleValueChange:t,setShownStatus:r})})]})},tx=class extends f.Modal{root;type;handleValueChange;constructor(e,t,n){super(e),this.type=t,this.handleValueChange=n}onOpen(){let{contentEl:e}=this;this.root=(0,u_.createRoot)(e),this.root.render((0,W.jsx)($b,{type:this.type,handleValueChange:this.handleValueChange.bind(this),setShownStatus:e=>{!e&&this.close()}}))}onClose(){this.root?.unmount()}},nx=(e,t)=>(e%t+t)%t,rx=class{owner;values;suggestions;selectedItem;containerEl;constructor(e,t,n){this.owner=e,this.containerEl=t,t.on(`click`,`.suggestion-item`,this.onSuggestionClick.bind(this)),t.on(`mousemove`,`.suggestion-item`,this.onSuggestionMouseover.bind(this)),n.register([],`ArrowUp`,e=>{if(!e.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),n.register([],`ArrowDown`,e=>{if(!e.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),n.register([],`Enter`,e=>{if(!e.isComposing)return this.useSelectedItem(e),!1})}onSuggestionClick(e,t){e.preventDefault();let n=this.suggestions.indexOf(t);this.setSelectedItem(n,!1),this.useSelectedItem(e)}onSuggestionMouseover(e,t){let n=this.suggestions.indexOf(t);this.setSelectedItem(n,!1)}setSuggestions(e){this.containerEl.empty();let t=[];e.forEach(e=>{let n=this.containerEl.createDiv(`suggestion-item`);this.owner.renderSuggestion(e,n),t.push(n)}),this.values=e,this.suggestions=t,this.setSelectedItem(0,!1)}useSelectedItem(e){let t=this.values[this.selectedItem];t&&this.owner.selectSuggestion(t,e)}setSelectedItem(e,t){let n=nx(e,this.suggestions.length),r=this.suggestions[this.selectedItem],i=this.suggestions[n];r?.removeClass(`is-selected`),i?.addClass(`is-selected`),this.selectedItem=n,t&&i.scrollIntoView(!1)}},ix=class{inputEl;placement=`bottom-start`;popper;scope;suggestEl;suggest;_boundInputChanged;_boundClose;_isOpen=!1;cb;constructor(e,t){this.inputEl=e,this.scope=new f.Scope,this.cb=t,this.suggestEl=createDiv(`suggestion-container`);let n=this.suggestEl.createDiv(`suggestion`);this.suggest=new rx(this,n,this.scope),this.scope.register([],`Escape`,this.close.bind(this)),this._boundInputChanged=this.onInputChanged.bind(this),this._boundClose=this.close.bind(this),this.inputEl.addEventListener(`input`,this._boundInputChanged),this.inputEl.addEventListener(`focus`,this._boundInputChanged),this.inputEl.addEventListener(`click`,this._boundInputChanged),this.inputEl.addEventListener(`blur`,this._boundClose),this.suggestEl.on(`mousedown`,`.suggestion-container`,e=>{e.preventDefault()})}get isOpen(){return this._isOpen}clearInput(){this.inputEl.value=``,this.inputEl.trigger(`blur`),this.inputEl.trigger(`focus`),this.inputEl.trigger(`input`),this.onInputChanged()}onInputChanged(){let e=this.inputEl.value,t=this.getSuggestions(e);if(!t){this.close();return}t.length>0?(this.suggest.setSuggestions(t),this.open(app.dom.appContainerEl,this.inputEl)):this.close()}open(e,t){app.keymap.pushScope(this.scope),e.appendChild(this.suggestEl),this.popper=Rb(t,this.suggestEl,{placement:this.placement,modifiers:[{name:`sameWidth`,enabled:!0,fn:({state:e,instance:t})=>{let n=`${e.rects.reference.width}px`;e.styles.popper.width!==n&&(e.styles.popper.width=n,t.update())},phase:`beforeWrite`,requires:[`computeStyles`]}]}),this._isOpen=!0}close(){app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach(),this._isOpen=!1}destroy(){this.inputEl.removeEventListener(`input`,this._boundInputChanged),this.inputEl.removeEventListener(`focus`,this._boundInputChanged),this.inputEl.removeEventListener(`click`,this._boundInputChanged),this.inputEl.removeEventListener(`blur`,this._boundClose),this.close()}updateCb(e){this.cb=e}};H();var ax=e=>{let t=e.metadataCache.getTags();return[...Object.keys(t)].map(e=>e.split(`#`).pop())},ox=class extends ix{fuzzySearchItemsOptimized(e,t){let n=(0,f.prepareFuzzySearch)(e);return t.map(e=>{let t=n(e);return t?{item:e,match:t,score:t.score}:null}).sort((e,t)=>t?.score-e?.score).filter(Boolean)}getSuggestions(e){let{settings:t,app:n}=L.getState(),r=e.toLocaleLowerCase(),i=t.UseVaultTags?ax(n):V.getState().tags;return this.fuzzySearchItemsOptimized(r,i).map(e=>e.item)}renderSuggestion(e,t){t.toggleClass(`thino-image-suggest-item`,!0),t.createSpan({cls:`suggestion-name`,text:e})}selectSuggestion(e){this.inputEl.value=e,this.cb&&this.cb(e),this.inputEl.dispatchEvent(new Event(`change`)),this.inputEl.trigger(`change`),this.close()}};function sx({allItems:e,initialCount:t=50,loadMoreCount:n=50,enabled:r=!0,onLoadMore:i}){let[a,o]=(0,U.useState)(t),[s,c]=(0,U.useState)(!1),l=(0,U.useRef)(null),u=(0,U.useRef)(!1),d=e.slice(0,a),f=a<e.length,p=(0,U.useCallback)(()=>{!f||u.current||(u.current=!0,c(!0),requestAnimationFrame(()=>{o(Math.min(a+n,e.length)),c(!1),u.current=!1,i?.()}))},[f,a,n,e.length,i]),m=(0,U.useCallback)(()=>{o(t),c(!1),u.current=!1},[t]);return(0,U.useEffect)(()=>{e.length<a&&m()},[e.length,a,m]),(0,U.useEffect)(()=>{if(!r||!l.current||!f)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&!u.current&&p()},{root:null,rootMargin:`200px`,threshold:.01});return e.observe(l.current),()=>{e.disconnect()}},[r,f,p]),{displayedItems:d,hasMore:f,loadingMore:s,sentinelRef:l,loadMore:p,reset:m}}var cx=!0;function lx(e,t){if(!cx){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}var ux=class extends Error{constructor(e){super(`react-collapsed: ${e}`)}},dx=(...e)=>lx(e[0],`[react-collapsed] -- ${e[1]}`);function fx(e){let t=(0,U.useRef)(e);return(0,U.useEffect)(()=>{t.current=e}),(0,U.useCallback)((...e)=>t.current?.(...e),[])}function px(e,t,n){let[r,i]=(0,U.useState)(t),a=(0,U.useRef)(e!==void 0),o=a.current?e:r,s=fx(n),c=(0,U.useCallback)(e=>{let t=typeof e==`function`?e(o):e;a.current||i(t),s?.(t)},[s,o]);return(0,U.useEffect)(()=>{dx(!(a.current&&e==null),"`isExpanded` state is changing from controlled to uncontrolled. useCollapse should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop."),dx(!(!a.current&&e!=null),"`isExpanded` state is changing from uncontrolled to controlled. useCollapse should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop.")},[e]),[o,c]}var mx=`(prefers-reduced-motion: reduce)`;function hx(){let[e,t]=(0,U.useState)(!1);return(0,U.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(mx);t(e.matches);let n=e=>{t(e.matches)};if(e.addEventListener)return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)};if(e.addListener)return e.addListener(n),()=>{e.removeListener(n)}},[]),e}var gx=U.useId||(()=>void 0);function _x(){return gx()??``}var vx=typeof window<`u`?U.useLayoutEffect:U.useEffect,yx=!1,bx=0,xx=()=>++bx;function Sx(e){let t=e||(yx?xx():null),[n,r]=U.useState(t);return vx(()=>{n===null&&r(xx())},[]),U.useEffect(()=>{yx===!1&&(yx=!0)},[]),n==null?void 0:String(n)}function Cx(e){let t=_x(),n=Sx(e);return typeof e==`string`?e:typeof t==`string`?t:n}function wx(e,t){let n=performance.now(),r={};function i(){r.id=requestAnimationFrame(r=>{r-n>t?e():i()})}return i(),r}function Tx(e){e.id&&cancelAnimationFrame(e.id)}function Ex(e){return e?.current?e.current.scrollHeight:(dx(!0,"Was not able to find a ref to the collapse element via `getCollapseProps`. Ensure that the element exposes its `ref` prop. If it exposes the ref prop under a different name (like `innerRef`), use the `refKey` property to change it. Example:\n\nconst collapseProps = getCollapseProps({refKey: 'innerRef'})"),0)}function Dx(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function Ox(e,t){if(e!=null)if(typeof e==`function`)e(t);else try{e.current=t}catch{throw new ux(`Cannot assign value "${t}" to ref "${e}"`)}}function kx(...e){return e.every(e=>e==null)?null:t=>{e.forEach(e=>{Ox(e,t)})}}function Ax(e){let t=e=>{};t=e=>{if(!e?.current)return;let{paddingTop:t,paddingBottom:n}=window.getComputedStyle(e.current);dx(!(t&&t!==`0px`||n&&n!==`0px`),`Padding applied to the collapse element will cause the animation to break and not perform as expected. To fix, apply equivalent padding to the direct descendent of the collapse element. Example:
- Before: <div {...getCollapseProps({style: {padding: 10}})}>{children}</div>
- After: <div {...getCollapseProps()}>
- <div style={{padding: 10}}>
- {children}
- </div>
- </div>`)},(0,U.useEffect)(()=>{t(e)},[e])}var jx=typeof window>`u`?U.useEffect:U.useLayoutEffect;function Mx({duration:e,easing:t=`cubic-bezier(0.4, 0, 0.2, 1)`,onTransitionStateChange:n=()=>{},isExpanded:r,defaultExpanded:i=!1,hasDisabledAnimation:a,id:o,...s}={}){let c=fx(n),l=Cx(o?`${o}`:void 0),[u,d]=px(r,i),f=(0,U.useRef)(u),[p,m]=(0,U.useState)(!1),h=hx(),g=a??h,_=(0,U.useRef)(),v=(0,U.useRef)(),y=(0,U.useRef)(null),[b,x]=(0,U.useState)(null);Ax(y);let S=`${s.collapsedHeight||0}px`;function C(e){if(!y.current)return;let t=y.current;for(let n in e){let r=e[n];r?t.style[n]=r:t.style.removeProperty(n)}}return jx(()=>{if(!y.current||u===f.current)return;f.current=u;function n(t){return g?0:e??Dx(t)}let r=e=>`height ${n(e)}ms ${t}`,i=e=>{function t(){u?(C({height:``,overflow:``,transition:``,display:``}),c(`expandEnd`)):(C({transition:``}),c(`collapseEnd`)),m(!1)}v.current&&Tx(v.current),v.current=wx(t,e)};return m(!0),u?_.current=requestAnimationFrame(()=>{c(`expandStart`),C({display:`block`,overflow:`hidden`,height:S}),_.current=requestAnimationFrame(()=>{c(`expanding`);let e=Ex(y);i(n(e)),y.current&&(y.current.style.transition=r(e),y.current.style.height=`${e}px`)})}):_.current=requestAnimationFrame(()=>{c(`collapseStart`);let e=Ex(y);i(n(e)),C({transition:r(e),height:`${e}px`}),_.current=requestAnimationFrame(()=>{c(`collapsing`),C({height:S,overflow:`hidden`})})}),()=>{_.current&&cancelAnimationFrame(_.current),v.current&&Tx(v.current)}},[u,S,g,e,t,c]),{isExpanded:u,setExpanded:d,getToggleProps(e){let{disabled:t,onClick:n,refKey:r,...i}={refKey:`ref`,onClick(){},disabled:!1,...e},a=b?b.tagName===`BUTTON`:void 0,o=e?.[r||`ref`],s={id:`react-collapsed-toggle-${l}`,"aria-controls":`react-collapsed-panel-${l}`,"aria-expanded":u,onClick(e){t||(n?.(e),d(e=>!e))},[r||`ref`]:kx(o,x)},c={type:`button`,disabled:t?!0:void 0},f={"aria-disabled":t?!0:void 0,role:`button`,tabIndex:t?-1:0};return a===!1?{...s,...f,...i}:a===!0?{...s,...c,...i}:{...s,...c,...f,...i}},getCollapseProps(e){let{style:t,refKey:n}={refKey:`ref`,style:{},...e},r=e?.[n||`ref`];return{id:`react-collapsed-panel-${l}`,"aria-hidden":!u,"aria-labelledby":`react-collapsed-toggle-${l}`,role:`region`,...e,[n||`ref`]:kx(y,r),style:{boxSizing:`border-box`,...!p&&!u?{display:S===`0px`?`none`:`block`,height:S,overflow:`hidden`}:{},...t}}}}}$r(),li(),H(),Lr(),M(),Ba();var Nx=(0,U.memo)(({memoId:e,showOutgoingLinks:t=!0,showIncomingLinks:n=!0})=>{let[r,i]=(0,U.useState)([]),[a,o]=(0,U.useState)([]),[s,c]=(0,U.useState)(null),[l,u]=(0,U.useState)(!1),[d,p]=(0,U.useState)(!1),m=(0,U.useRef)(null);(0,U.useEffect)(()=>{!s&&!l&&!d&&(u(!0),(async()=>{let t=V.getMemoById(e);t&&c(t),u(!1)})())},[e,s,l,d]),(0,U.useEffect)(()=>{s&&!d&&!l&&(u(!0),(async()=>{try{if(t){let e=[],t=[...s.content.matchAll(Yr)];for(let n of t)if(n&&n.length===3){let t=n[2],r=V.getMemoById(t);r&&e.push({...r,createdAtStr:N.getDateTimeString(r.createdAt),dateStr:N.getDateString(r.createdAt)})}let n=Oa(s.content);for(let t of n){let[n,r]=t.split(`#^`),i=r;if(n&&i){let t=await V.getLinkedMemoByBlockId(i,n);t&&(e.some(e=>e.id===t.id)||e.push({...t,createdAtStr:N.getDateTimeString(t.createdAt),dateStr:N.getDateString(t.createdAt)}))}}i([...e])}if(n){let e=await V.getLinkedMemos(s.id),t=[];s.hasId&&s.path&&(t=await V.getLinkedMemosByLinkId(s.hasId,s.path));let n=[...e,...t];o(Array.from(new Map(n.map(e=>[e.id,e])).values()).sort((e,t)=>N.getTimeStampByDate(t.createdAt)-N.getTimeStampByDate(e.createdAt)).map(e=>({...e,createdAtStr:N.getDateTimeString(e.createdAt),dateStr:N.getDateString(e.createdAt)})))}p(!0)}catch(e){console.error(`Error fetching linked memos:`,e)}u(!1)})())},[s,t,n,d,l]);let h=(0,U.useCallback)(e=>{Bx(e)},[]);return(0,W.jsxs)(`div`,{className:x_(`reference-links-group`,l?`loading`:`loaded`),ref:m,children:[l&&(0,W.jsx)(`div`,{className:`links-loading`,children:(0,W.jsx)(`span`,{className:`loading-text`,children:j(`Loading...`)})}),d&&(0,W.jsxs)(W.Fragment,{children:[t&&r.length>0&&(0,W.jsx)(`div`,{className:`links-section outgoing-links`,children:(0,W.jsx)(`div`,{className:`links-list`,children:r.map(e=>{let t=Pr(ai(e.content)).replaceAll(`
- `,` `);return(0,W.jsxs)(`div`,{"aria-label":`${j(`Linked`)} ${e.content}`,className:`link-item`,onClick:()=>h(e),children:[(0,W.jsx)(`div`,{className:`link-icon`,ref:e=>e&&(0,f.setIcon)(e,`circle-dot`)}),(0,W.jsxs)(`div`,{className:`link-date`,children:[e.dateStr,`:`]}),(0,W.jsx)(`div`,{className:`link-content`,children:t})]},e.id)})})}),n&&a.length>0&&(0,W.jsx)(`div`,{className:`links-section incoming-links`,children:(0,W.jsx)(`div`,{className:`links-list`,children:a.map(e=>{let t=Pr(ai(e.content)).replaceAll(`
- `,` `);return(0,W.jsxs)(`div`,{"aria-label":`${j(`Linked by`)} ${e.content}`,className:`link-item`,onClick:()=>h(e),children:[(0,W.jsx)(`div`,{className:`link-icon`,ref:e=>e&&(0,f.setIcon)(e,`circle-dot-dashed`)}),(0,W.jsxs)(`div`,{className:`link-date`,children:[e.dateStr,`:`]}),(0,W.jsx)(`div`,{className:`link-content`,children:t})]},e.id)})})}),d&&!l&&r.length===0&&a.length===0&&null]})]})},(e,t)=>e.memoId===t.memoId&&e.showIncomingLinks===t.showIncomingLinks&&e.showOutgoingLinks===t.showOutgoingLinks);I(),M();var Px=new Set,Fx=`█`;function Ix(e,t){if(!t?.enableSecretMasking||!t?.secretContentRegex)return!1;try{return new RegExp(t.secretContentRegex).test(e)}catch{return!1}}var Lx=(0,U.memo)(e=>{let{app:t,view:n,settings:r,plugin:i}=F(),{memoListView:a}=vi(),{getCollapseProps:o,getToggleProps:s,isExpanded:c,setExpanded:l}=Mx({defaultExpanded:!0,collapsedHeight:r?.ThinoCollapsedHeight??100}),{memo:u,handleMemoContentClick:d,handleMemoDoubleClick:p}=e,m=U.useRef(null),[h,g]=U.useState(``),_=U.useRef(h),v=U.useRef(0),[y,b]=U.useState(!1),[x,S]=U.useState(!1),[C,w]=U.useState(!1),T=U.useRef(``),E=(0,f.debounce)((e,t,n)=>{for(let r of e){let{height:e}=r.contentRect,i=e>(t?.ThinoMaxHeight||340);b(i),l(!i),n.disconnect()}},500);(0,U.useEffect)(()=>{if(u.content!==_.current){if(r?.OptimizeForCallout&&u.content.split(`> [!`).length>3&&u.content.split(`
- `).length>10&&!x){let e=m.current.createEl(`button`);e.setText(j(`Render content`)),e.onclick=async()=>{S(!0),await D()};let t=m.current.createEl(`textarea`);t.setText(u.content),t.disabled=!0,m.current?.toggleClass([`raw-content`],!0),l(!0),b(!1);return}D()}},[u.content]),(0,U.useEffect)(()=>{x&&v.current!==r?.ThinoMaxHeight&&(m?.current.hasChildNodes()&&S(!1),D())},[r?.ThinoMaxHeight]),(0,U.useEffect)(()=>{if(!x)return;let e=m.current;if(!e)return;if(!r?.ThinoMaxHeight){l(!0),b(!1);return}let t=new ResizeObserver(e=>{console.log(`resizeObserver`),E(e,r,t)});return t.observe(e),()=>t.disconnect()},[x]),(0,U.useEffect)(()=>{e.lockVersion===void 0||e.lockVersion===0||k()},[e.lockVersion]);let D=async()=>{let e=n||i;m.current&&e&&t&&u.content!==_.current&&(m.current.empty(),await f.MarkdownRenderer.render(t,u.content,m.current,u.path??``,e),(m.current?.querySelectorAll(`.internal-link`))?.forEach(e=>{let r=e,i=r.getAttribute(`data-href`);if(!i)return;t.metadataCache.getFirstLinkpathDest(i,u.path)||e.classList.add(`is-unresolved`);let a=n?n.containerEl:m.current;r.addEventListener(`mouseover`,e=>{e.stopPropagation(),t.workspace.trigger(`hover-link`,{event:e,source:`thino`,hoverParent:a,targetEl:r,linktext:i,sourcePath:r.href})})})),_.current=u.content,m.current?.toggleClass([`markdown-rendered`],!0),m.current?.toggleClass([`raw-content`],!1),S&&S(!0),v.current=r?.ThinoMaxHeight||340,k()},O=()=>{if(!r?.enableSecretMasking||!r?.secretContentRegex||!(0,f.requireApiVersion)(`1.11.4`)||Px.has(u.id))return!1;try{return new RegExp(r.secretContentRegex).test(u.content)}catch{return!1}},k=()=>{if(!m.current||!O()){w(!1);return}if(w(!0),(r?.secretMaskingStyle||`blur`)===`blur`)m.current.classList.add(`secret-masked-blur`);else{T.current=m.current.innerHTML;let e=m.current.textContent?.length||20;m.current.innerHTML=``,m.current.textContent=Fx.repeat(Math.min(e,80)),m.current.classList.add(`secret-masked-block`)}},ee=async n=>{!C||!t||(n.stopPropagation(),n.preventDefault(),new Rx(t,n=>{try{if(n===t.secretStorage.getSecret(`thino-secret-masking-password`)){if(Px.add(u.id),w(!1),e.onReveal?.(),!m.current)return;(r?.secretMaskingStyle||`blur`)===`blur`?m.current.classList.remove(`secret-masked-blur`):(m.current.innerHTML=T.current,m.current.classList.remove(`secret-masked-block`))}else new f.Notice(j(`Incorrect password`))}catch{new f.Notice(j(`Incorrect password`))}}).open())};return(0,W.jsxs)(W.Fragment,{children:[y&&a===`moments`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:`thino-collapse-button`,...s({style:{display:`block`,marginTop:2}}),children:j(c?`Collapse`:`Expand`)}),!c&&r?.ThinoCollapsedHeight!==0&&(0,W.jsx)(`div`,{className:`thino-collapse-shadowOverlay`,onDoubleClick:p})]}),(0,W.jsxs)(`div`,{style:{position:`relative`},children:[(0,W.jsx)(`div`,{...o({style:{margin:0}}),ref:m,className:`memo-content-text`,onClick:e=>d(e,u),onDoubleClick:p,onContextMenu:e=>{e.preventDefault()}}),C&&(0,W.jsx)(`div`,{className:`secret-mask-overlay`,onClick:ee,"aria-label":j(`Click to reveal secret content`),children:(0,W.jsx)(`span`,{className:`secret-mask-icon`,children:`🔒`})})]}),a===`list`&&r?.enableReferenceLinksGroup&&(0,W.jsx)(Nx,{memoId:u.id}),y&&a!==`moments`&&(0,W.jsxs)(W.Fragment,{children:[!c&&r?.ThinoCollapsedHeight!==0&&(0,W.jsx)(`div`,{className:`thino-collapse-shadowOverlay`,onDoubleClick:p}),(0,W.jsx)(`button`,{className:`thino-collapse-button`,...s({style:{display:`block`,marginTop:2}}),children:j(c?`Collapse`:`Expand`)})]})]})},(e,t)=>e.memo.content===t.memo.content&&e.lockVersion===t.lockVersion),Rx=class extends f.Modal{onSubmit;constructor(e,t){super(e),this.onSubmit=t}onOpen(){let{contentEl:e}=this;this.titleEl.setText(j(`Enter password to reveal`));let t=e.createEl(`input`,{type:`password`,placeholder:j(`Enter password`),cls:`thino-secret-password-input`});t.style.width=`100%`,t.style.marginBottom=`12px`;let n=e.createDiv(`button-group`),r=n.createEl(`button`,{text:j(`Cancel`)}),i=n.createEl(`button`,{text:j(`Confirm`),cls:`mod-cta`});r.onclick=()=>this.close(),i.onclick=()=>{this.onSubmit(t.value),this.close()},t.addEventListener(`keydown`,e=>{e.key===`Enter`&&(this.onSubmit(t.value),this.close())}),setTimeout(()=>t.focus(),50)}onClose(){this.contentEl.empty()}};$r(),li(),H(),Lr(),M(),Ba();var zx=e=>{let[t,n]=(0,U.useState)({...e.memo,createdAtStr:N.getDateTimeString(e.memo.createdAt)}),[r,i]=(0,U.useState)([]),[a,o]=(0,U.useState)([]);(0,U.useEffect)(()=>{(async()=>{try{let e=[],n=[...t.content.matchAll(Yr)];for(let t of n)if(t&&t.length===3){let n=t[2],r=V.getMemoById(n);r&&e.push({...r,createdAtStr:N.getDateTimeString(r.createdAt),dateStr:N.getDateString(r.createdAt)})}let r=Oa(t.content);for(let t of r){let[n,r]=t.split(`#^`),i=r;if(n&&i){let t=await V.getLinkedMemoByBlockId(i,n);t&&(e.some(e=>e.id===t.id)||e.push({...t,createdAtStr:N.getDateTimeString(t.createdAt),dateStr:N.getDateString(t.createdAt)}))}}i([...e]);let a=await V.getLinkedMemos(t.id),s=[];t.hasId&&t.path&&(s=await V.getLinkedMemosByLinkId(t.hasId,t.path));let c=[...a,...s];o(Array.from(new Map(c.map(e=>[e.id,e])).values()).sort((e,t)=>N.getTimeStampByDate(t.createdAt)-N.getTimeStampByDate(e.createdAt)).map(e=>({...e,createdAtStr:N.getDateTimeString(e.createdAt),dateStr:N.getDateString(e.createdAt)})))}catch(e){console.error(`Error fetching linked memos:`,e)}})()},[t.id,t.hasId,t.path]);let s=(0,U.useCallback)(async e=>{let t=e.target;if(t.className===`memo-link-text`){let e=t.dataset?.value,r=V.getMemoById(e??``);if(r){let e={...r,createdAtStr:N.getDateTimeString(r.createdAt)};i([]),o([]),n(e)}else new f.Notice(j(`Thino not found`)),t.classList.remove(`memo-link-text`)}},[]),c=(0,U.useCallback)(e=>{i([]),o([]),n({...e,createdAtStr:N.getDateTimeString(e.createdAt)})},[t.id]),l=(0,U.useCallback)(()=>{e.destroy(),R.setEditMemoId(t.id)},[t.id]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`memo-card-container`,children:[(0,W.jsxs)(`div`,{className:`header-container`,children:[(0,W.jsx)(`span`,{className:`time-text`,children:t.createdAtStr}),(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`edit`)},className:`btn edit-btn`,onClick:l}),(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`x`)},className:`btn close-btn`,onClick:e.destroy})]})]}),(0,W.jsx)(`div`,{className:`memo-container`,children:(0,W.jsx)(`div`,{className:`memo-content-text`,children:(0,W.jsx)(Lx,{memo:t,handleMemoContentClick:s,handleMemoDoubleClick:()=>{}})})}),(0,W.jsx)(`div`,{className:`layer-container`})]}),r.length>0?(0,W.jsxs)(`div`,{className:`linked-memos-wrapper`,children:[(0,W.jsxs)(`span`,{className:`normal-text`,children:[j(`LINKED`),` `,r.length,` THINO`,` `]}),r.map(e=>{let t=Pr(ai(e.content)).replaceAll(`
- `,` `);return(0,W.jsxs)(`div`,{className:`linked-memo-container`,onClick:()=>c(e),children:[(0,W.jsxs)(`span`,{className:`time-text`,children:[e.dateStr,` `]}),t]},e.id)})]}):null,a.length>0?(0,W.jsxs)(`div`,{className:`linked-memos-wrapper`,children:[(0,W.jsxs)(`span`,{className:`normal-text`,children:[a.length,` THINO `,j(`LINK TO THE`),` THINO`]}),a.map(e=>{let t=Pr(ai(e.content)).replaceAll(`
- `,` `);return(0,W.jsxs)(`div`,{className:`linked-memo-container`,onClick:()=>c(e),children:[(0,W.jsxs)(`span`,{className:`time-text`,children:[e.dateStr,` `]}),t]},e.id)})]}):null]})};function Bx(e){f_({className:`memo-card-dialog`},zx,{memo:e})}H(),M();var Vx=new Map,Hx=async(e,t=!0)=>{let{vault:n,metadataCache:r}=L.getState().app;if(t&&Vx.has(e))return Promise.resolve(Vx.get(e));if(e.contains(`data:image`))return e;let i,a=await n.adapter.exists((0,f.normalizePath)(e)),o=``;try{if(!a&&!/(http|https)/g.test(e)&&!e.includes(`data:image`)){let t;if(e.startsWith(`app://`)){let t=(0,f.normalizePath)(decodeURIComponent(e).replace(f.Platform.resourcePathPrefix,``).replace(/\?(.*)$/,``).replace((0,f.normalizePath)(app?.vault.adapter.basePath),``));o=(0,f.normalizePath)(decodeURIComponent(t))}else{if(t=r.getFirstLinkpathDest(e,``),!t){new f.Notice(j(`File not exist`));return}o=t.path}}else o=e}catch(e){console.error(e)}if(o){if(!/(http|https)/g.test(o)){if(o){let e=await n.adapter.readBinary(o),t=new Uint8Array(e);i=new Blob([t],{type:`image/png`}),console.log(i)}}else if(o.startsWith(`http://localhost`)){let e=o;e=e.replace(`http://localhost/_capacitor_file_`,``),e=decodeURIComponent(e).replace(/\?(.*)$/,``).replace(app?.vault.adapter.basePath,``),e=(0,f.normalizePath)(decodeURIComponent(e));let t=await n.adapter.readBinary(e),r=new Uint8Array(t);i=new Blob([r],{type:`image/png`})}else try{let t=await(0,f.requestUrl)(e);console.log(e,t);let n=new Uint8Array(t.arrayBuffer);i=new Blob([n],{type:`image/png`}),console.log(i)}catch(e){console.log(`error in grabReleaseFileFromRepository`,URL,e)}return i?await Ux(i,e):``}},Ux=(e,t)=>new Promise(n=>{let r=new FileReader;r.onloadend=()=>{let e=r.result;Vx.set(t,e),n(e)},r.readAsDataURL(e)}),Wx=async e=>{if(!e.style.backgroundImage.includes(`url(`)&&!e.style.backgroundImage.includes(`http`))return;let t=e.style.backgroundImage.includes(`url(`)?e.style.backgroundImage.slice(5,-2):e.style.backgroundImage;if(t)return t.startsWith(`http://localhost`)&&(t=t.replace(`http://localhost/_capacitor_file_`,``),t=decodeURIComponent(t).replace(/\?(.*)$/,``).replace(app?.vault.adapter.basePath,``),t=(0,f.normalizePath)(decodeURIComponent(t))),await Hx(t)},Gx=async e=>{if(e.getAttribute(`src`))return e?.src?.startsWith(`http://localhost`)?await Hx(e.getAttribute(`path`)||(0,f.normalizePath)(e?.parentElement.getAttribute(`src`))):await Hx(e.getAttribute(`src`))},Kx=pS(),qx=mS(),Jx=hS(),Yx=gS(),Xx={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,httpTimeout:3e4,styleCaching:`strict`,corsImg:void 0},Zx={toSvg:tS,toPng:rS,toJpeg:iS,toBlob:aS,toPixelData:nS,toCanvas:oS,impl:{fontFaces:Jx,images:Yx,util:Kx,inliner:qx,urlCache:[],options:{}}},Qx=(typeof Node<`u`?Node.ELEMENT_NODE:void 0)||1,$x=(typeof globalThis<`u`?globalThis.getComputedStyle:void 0)||(typeof window<`u`?window.getComputedStyle:void 0)||globalThis.getComputedStyle,eS=(typeof globalThis<`u`?globalThis.atob:void 0)||(typeof window<`u`?window.atob:void 0)||globalThis.atob;function tS(e,t){let n=Zx.impl.util.getWindow(e);t||={},sS(t);let r=[];return Promise.resolve(e).then(i).then(function(e){return uS(e,t,null,n)}).then(dS).then(fS).then(s).then(c).then(a).then(o);function i(e){if(e.nodeType===Qx)return e;let t=e,n=e.parentNode,i=document.createElement(`span`);return n.replaceChild(i,t),i.append(e),r.push({parent:n,child:t,wrapper:i}),i}function a(e){for(;r.length>0;){let e=r.pop();e.parent.replaceChild(e.child,e.wrapper)}return e}function o(e){return Zx.impl.urlCache=[],wS(),e}function s(e){t.bgcolor&&(e.style.backgroundColor=t.bgcolor),t.width&&(e.style.width=`${t.width}px`),t.height&&(e.style.height=`${t.height}px`),t.style&&Object.keys(t.style).forEach(function(n){e.style[n]=t.style[n]});let n=null;return typeof t.onclone==`function`&&(n=t.onclone(e)),Promise.resolve(n).then(function(){return e})}function c(e){let n=t.width||Kx.width(e),r=t.height||Kx.height(e);return Promise.resolve(e).then(function(e){return e.setAttribute(`xmlns`,`http://www.w3.org/1999/xhtml`),new XMLSerializer().serializeToString(e)}).then(Kx.escapeXhtml).then(function(e){let t=(Kx.isDimensionMissing(n)?` width="100%"`:` width="${n}"`)+(Kx.isDimensionMissing(r)?` height="100%"`:` height="${r}"`);return`<svg xmlns="http://www.w3.org/2000/svg"${(Kx.isDimensionMissing(n)?``:` width="${n}"`)+(Kx.isDimensionMissing(r)?``:` height="${r}"`)}><foreignObject${t}>${e}</foreignObject></svg>`}).then(function(e){return`data:image/svg+xml;charset=utf-8,${e}`})}}function nS(e,t){return cS(e,t).then(function(t){return t.getContext(`2d`).getImageData(0,0,Kx.width(e),Kx.height(e)).data})}function rS(e,t){return cS(e,t).then(function(e){return e.toDataURL()})}function iS(e,t){return cS(e,t).then(function(e){return e.toDataURL(`image/jpeg`,(t?t.quality:void 0)||1)})}function aS(e,t){return cS(e,t).then(Kx.canvasToBlob)}function oS(e,t){return cS(e,t)}function sS(e){e.copyDefaultStyles===void 0?Zx.impl.options.copyDefaultStyles=Xx.copyDefaultStyles:Zx.impl.options.copyDefaultStyles=e.copyDefaultStyles,e.imagePlaceholder===void 0?Zx.impl.options.imagePlaceholder=Xx.imagePlaceholder:Zx.impl.options.imagePlaceholder=e.imagePlaceholder,e.cacheBust===void 0?Zx.impl.options.cacheBust=Xx.cacheBust:Zx.impl.options.cacheBust=e.cacheBust,e.corsImg===void 0?Zx.impl.options.corsImg=Xx.corsImg:Zx.impl.options.corsImg=e.corsImg,e.useCredentials===void 0?Zx.impl.options.useCredentials=Xx.useCredentials:Zx.impl.options.useCredentials=e.useCredentials,e.httpTimeout===void 0?Zx.impl.options.httpTimeout=Xx.httpTimeout:Zx.impl.options.httpTimeout=e.httpTimeout,e.styleCaching===void 0?Zx.impl.options.styleCaching=Xx.styleCaching:Zx.impl.options.styleCaching=e.styleCaching,Zx.impl.options.requestUrl=e.requestUrl,Zx.impl.options.type=e.type||`image/png`}function cS(e,t){return t||={},tS(e,t).then(Kx.makeImage).then(function(r){let i=typeof t.scale==`number`?t.scale:1,a=n(e,i),o=a.getContext(`2d`);return o.msImageSmoothingEnabled=!1,o.imageSmoothingEnabled=!1,r&&(o.scale(i,i),o.drawImage(r,0,0)),a});function n(e,n){let r=t.width||Kx.width(e),i=t.height||Kx.height(e);Kx.isDimensionMissing(r)&&(r=Kx.isDimensionMissing(i)?300:i*2),Kx.isDimensionMissing(i)&&(i=r/2);let a=document.createElement(`canvas`);if(a.width=r*n,a.height=i*n,t.bgcolor){let e=a.getContext(`2d`);e.fillStyle=t.bgcolor,e.fillRect(0,0,a.width,a.height)}return a}}var lS=null;function uS(e,t,n,r){let i=t.filter;if(e===lS||Kx.isHTMLScriptElement(e)||Kx.isHTMLStyleElement(e)||Kx.isHTMLLinkElement(e)||n!==null&&i&&!i(e))return Promise.resolve();return Promise.resolve(e).then(a).then(function(t){return s(t,o(e))}).then(function(t){return c(t,e)});function a(e){return Kx.isHTMLCanvasElement(e)?Kx.makeImage(e.toDataURL()):e.cloneNode(!1)}function o(e){return Kx.isElementHostForOpenShadowRoot(e)?e.shadowRoot:e}function s(e,n){let i=s(n),a=Promise.resolve();if(i.length!==0){let s=$x(o(n));Kx.asArray(i).forEach(function(n){a=a.then(function(){return uS(n,t,s,r).then(function(t){t&&e.appendChild(t)})})})}return a.then(function(){return e});function o(e){return Kx.isShadowRoot(e)?e.host:e}function s(e){return Kx.isShadowSlotElement(e)?e.assignedNodes():e.childNodes}}function c(e,r){if(!Kx.isElement(e)||Kx.isShadowSlotElement(r))return Promise.resolve(e);return Promise.resolve().then(i).then(a).then(o).then(s).then(function(){return e});function i(){a(r,e);function i(e,t){t.font=e.font,t.fontFamily=e.fontFamily,t.fontFeatureSettings=e.fontFeatureSettings,t.fontKerning=e.fontKerning,t.fontSize=e.fontSize,t.fontStretch=e.fontStretch,t.fontStyle=e.fontStyle,t.fontVariant=e.fontVariant,t.fontVariantCaps=e.fontVariantCaps,t.fontVariantEastAsian=e.fontVariantEastAsian,t.fontVariantLigatures=e.fontVariantLigatures,t.fontVariantNumeric=e.fontVariantNumeric,t.fontVariationSettings=e.fontVariationSettings,t.fontWeight=e.fontWeight}function a(e,r){let a=$x(e);a.cssText?(r.style.cssText=a.cssText,i(a,r.style)):(vS(t,e,a,n,r),n===null&&([`inset-block`,`inset-block-start`,`inset-block-end`].forEach(e=>r.style.removeProperty(e)),[`left`,`right`,`top`,`bottom`].forEach(e=>{r.style.getPropertyValue(e)&&r.style.setProperty(e,`0px`)})))}}function a(){let t=Kx.uid();[`:before`,`:after`].forEach(function(e){n(e)});function n(n){let i=$x(r,n),a=i.getPropertyValue(`content`);if(a===``||a===`none`)return;let o=e.getAttribute(`class`)||``;e.setAttribute(`class`,`${o} ${t}`);let s=document.createElement(`style`);s.appendChild(c()),e.appendChild(s);function c(){let e=`.${t}:${n}`,r=i.cssText?o():s();return document.createTextNode(`${e}{${r}}`);function o(){return`${i.cssText} content: ${a};`}function s(){return`${Kx.asArray(i).map(e).join(`; `)};`;function e(e){return`${e}: ${i.getPropertyValue(e)}${i.getPropertyPriority(e)?` !important`:``}`}}}}}function o(){Kx.isHTMLTextAreaElement(r)&&(e.innerHTML=r.value),Kx.isHTMLInputElement(r)&&e.setAttribute(`value`,r.value)}function s(){Kx.isSVGElement(e)&&(e.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),Kx.isSVGRectElement(e)&&[`width`,`height`].forEach(function(t){let n=e.getAttribute(t);n&&e.style.setProperty(t,n)}))}}}function dS(e){return Jx.resolveAll().then(function(t){if(t!==``){let n=document.createElement(`style`);e.appendChild(n),n.appendChild(document.createTextNode(t))}return e})}function fS(e){return Yx.inlineAll(e).then(function(){return e})}function pS(){let e=0;return{escape:T,isDataUrl:_,canvasToBlob:b,resolveUrl:x,getAndEncode:w,uid:S,delay:E,asArray:D,escapeXhtml:O,makeImage:C,width:k,height:ee,getWindow:t,isElement:a,isElementHostForOpenShadowRoot:n,isShadowRoot:r,isInShadowRoot:i,isHTMLElement:s,isHTMLCanvasElement:o,isHTMLInputElement:l,isHTMLImageElement:c,isHTMLLinkElement:u,isHTMLScriptElement:d,isHTMLStyleElement:f,isHTMLTextAreaElement:p,isShadowSlotElement:m,isSVGElement:h,isSVGRectElement:g,isDimensionMissing:v};function t(e){let t=e?e.ownerDocument:void 0;return(t?t.defaultView:void 0)||globalThis||window}function n(e){return a(e)&&e.shadowRoot!==null}function r(e){return e instanceof t(e).ShadowRoot}function i(e){return e!==null&&Object.prototype.hasOwnProperty.call(e,`getRootNode`)&&r(e.getRootNode())}function a(e){return e instanceof t(e).Element}function o(e){return e instanceof t(e).HTMLCanvasElement}function s(e){return e instanceof t(e).HTMLElement}function c(e){return e instanceof t(e).HTMLImageElement}function l(e){return e instanceof t(e).HTMLInputElement}function u(e){return e instanceof t(e).HTMLLinkElement}function d(e){return e instanceof t(e).HTMLScriptElement}function f(e){return e instanceof t(e).HTMLStyleElement}function p(e){return e instanceof t(e).HTMLTextAreaElement}function m(e){return i(e)&&e instanceof t(e).HTMLSlotElement}function h(e){return e instanceof t(e).SVGElement}function g(e){return e instanceof t(e).SVGRectElement}function _(e){return e.search(/^(data:)/)!==-1}function v(e){return isNaN(e)||e<=0}function y(e){return new Promise(function(t){let n=eS(e.toDataURL().split(`,`)[1]),r=n.length,i=new Uint8Array(r);for(let e=0;e<r;e++)i[e]=n.charCodeAt(e);t(new Blob([i],{type:Zx.impl.options.type}))})}function b(e){return e.toBlob?new Promise(function(t){e.toBlob(t)}):y(e)}function x(e,t){let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`);n.head.appendChild(r);let i=n.createElement(`a`);return n.body.appendChild(i),r.href=t,i.href=e,i.href}function S(){return`u${t()}${e++}`;function t(){return`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4)}}function C(e){return e===`data:,`?Promise.resolve():new Promise(function(t,n){let r=new Image;Zx.impl.options.useCredentials&&(r.crossOrigin=`use-credentials`),r.onload=function(){window&&window.requestAnimationFrame?window.requestAnimationFrame(function(){t(r)}):t(r)},r.onerror=n,r.src=e})}function w(e){let t=Zx.impl.urlCache.find(function(t){return t.url===e});return t||(t={url:e,promise:null},Zx.impl.urlCache.push(t)),t.promise===null&&(Zx.impl.options.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime()),Zx.impl.options.requestUrl&&/^http/.test(e)?t.promise=Zx.impl.options.requestUrl({url:e,method:`GET`}).then(e=>new Promise(t=>{let n=new FileReader;n.onload=function(e){t(e.target.result)},n.readAsDataURL(new Blob([e.arrayBuffer],{type:e.headers[`content-type`]}))})).catch(t=>(console.error(`cannot fetch resource: `+e+`, error: `+t),``)):t.promise=new Promise(function(t){let n=Zx.impl.options.httpTimeout,r=new XMLHttpRequest;if(r.onreadystatechange=a,r.ontimeout=o,r.responseType=`blob`,r.timeout=n,Zx.impl.options.useCredentials&&(r.withCredentials=!0),Zx.impl.options.corsImg&&e.indexOf(`http`)===0&&e.indexOf(window.location.origin)===-1){let t=(Zx.impl.options.corsImg.method||`GET`).toUpperCase()===`POST`?`POST`:`GET`;r.open(t,(Zx.impl.options.corsImg.url||``).replace(`#{cors}`,e),!0);let n=!1,i=Zx.impl.options.corsImg.headers||{};Object.keys(i).forEach(function(e){i[e].indexOf(`application/json`)!==-1&&(n=!0),r.setRequestHeader(e,i[e])});let a=s(Zx.impl.options.corsImg.data||``);Object.keys(a).forEach(function(t){typeof a[t]==`string`&&(a[t]=a[t].replace(`#{cors}`,e))}),r.send(n?JSON.stringify(a):a)}else r.open(`GET`,e,!0),r.send();let i;if(Zx.impl.options.imagePlaceholder){let e=Zx.impl.options.imagePlaceholder.split(/,/);e&&e[1]&&(i=e[1])}function a(){if(r.readyState!==4)return;if(r.status>=300){i?t(i):c(`cannot fetch resource: ${e}, status: ${r.status}`);return}let n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(r.response)}function o(){i?t(i):c(`timeout of ${n}ms occured while fetching resource: ${e}`)}function s(e){try{return JSON.parse(JSON.stringify(e))}catch{c(`corsImg.data is missing or invalid`);return}}function c(e){console.error(e),t(``)}})),t.promise}function T(e){return e.replace(/([.*+?^${}()|[]\/\\])/g,`\\$1`)}function E(e){return function(t){return new Promise(function(n){setTimeout(function(){n(t)},e)})}}function D(e){let t=[],n=e.length;for(let r=0;r<n;r++)t.push(e[r]);return t}function O(e){return e.replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/\n/g,`%0A`)}function k(e){let t=A(e,`width`);if(!isNaN(t))return t;let n=A(e,`border-left-width`),r=A(e,`border-right-width`);return e.scrollWidth+n+r}function ee(e){let t=A(e,`height`);if(!isNaN(t))return t;let n=A(e,`border-top-width`),r=A(e,`border-bottom-width`);return e.scrollHeight+n+r}function A(e,t){if(e.nodeType===Qx){let n=$x(e).getPropertyValue(t);if(n.slice(-2)===`px`)return n=n.slice(0,-2),parseFloat(n)}return NaN}}function mS(){let e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:i,shouldProcess:t,impl:{readUrls:n,inline:r}};function t(t){return t.search(e)!==-1}function n(t){let n=[],r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n.filter(function(e){return!Kx.isDataUrl(e)})}function r(e,t,n,r){return Promise.resolve(t).then(function(e){return n?Kx.resolveUrl(e,n):e}).then(r||Kx.getAndEncode).then(function(n){return e.replace(i(t),`$1${n}$3`)});function i(e){return RegExp(`(url\\(['"]?)(${Kx.escape(e)})(['"]?\\))`,`g`)}}function i(e,i,a){if(o())return Promise.resolve(e);return Promise.resolve(e).then(n).then(function(t){let n=Promise.resolve(e);return t.forEach(function(e){n=n.then(function(t){return r(t,e,i,a)})}),n});function o(){return!t(e)}}}function hS(){return{resolveAll:e,impl:{readAll:t}};function e(){return t().then(function(e){return Promise.all(e.map(function(e){return e.resolve()}))}).then(function(e){return e.join(`
- `)})}function t(){return Promise.resolve(Kx.asArray(document.styleSheets)).then(t).then(e).then(function(e){return e.map(n)});function e(e){return e.filter(function(e){return e.type===CSSRule.FONT_FACE_RULE}).filter(function(e){return qx.shouldProcess(e.style.getPropertyValue(`src`))})}function t(e){let t=[];return e.forEach(function(e){if(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(e),`cssRules`))try{Kx.asArray(e.cssRules||[]).forEach(t.push.bind(t))}catch(t){console.error(`domtoimage: Error while reading CSS rules from ${e.href}`,t.toString())}}),t}function n(e){return{resolve:function(){let t=(e.parentStyleSheet||{}).href;return qx.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue(`src`)}}}}}function gS(){return{inlineAll:t,impl:{newImage:e}};function e(e){return{inline:t};function t(t){return Kx.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(t||Kx.getAndEncode).then(function(t){return new Promise(function(n){e.onload=n,e.onerror=n,e.src=t})})}}function t(n){if(!Kx.isElement(n))return Promise.resolve(n);return r(n).then(function(){return Kx.isHTMLImageElement(n)?e(n).inline():Promise.all(Kx.asArray(n.childNodes).map(function(e){return t(e)}))});function r(e){let t=[`background`,`background-image`].map(function(t){let n=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return n?qx.inlineAll(n).then(function(n){e.style.setProperty(t,n,r)}):Promise.resolve()});return Promise.all(t).then(function(){return e})}}}function _S(e,t,n,r){let i=[`background-clip`].indexOf(t)>=0;r?(e.setProperty(t,n,r),i&&e.setProperty(`-webkit-${t}`,n,r)):(e.setProperty(t,n),i&&e.setProperty(`-webkit-${t}`,n))}function vS(e,t,n,r,i){let a=Zx.impl.options.copyDefaultStyles?SS(e,t):{},o=i.style;Kx.asArray(n).forEach(function(e){let t=n.getPropertyValue(e),i=a[e],s=r?r.getPropertyValue(e):void 0;(t!==i||r&&t!==s)&&_S(o,e,t,n.getPropertyPriority(e))})}var yS=null,bS={},xS=`ADDRESS.ARTICLE.ASIDE.BLOCKQUOTE.DETAILS.DIALOG.DD.DIV.DL.DT.FIELDSET.FIGCAPTION.FIGURE.FOOTER.FORM.H1.H2.H3.H4.H5.H6.HEADER.HGROUP.HR.LI.MAIN.NAV.OL.P.PRE.SECTION.SVG.TABLE.UL.math.svg.BODY.HEAD.HTML`.split(`.`);function SS(e,t){let n=s(t),r=c(n);if(bS[r])return bS[r];let i=CS(),a=l(i.document,n),o=u(i,a);return d(a),bS[r]=o,o;function s(e){let t=[];do{if(e.nodeType===Qx){let n=e.tagName;if(t.push(n),xS.includes(n))break}e=e.parentNode}while(e);return t}function c(t){return e.styleCaching===`relaxed`?t.filter((e,t,n)=>t===0||t===n.length-1).join(`>`):t.join(`>`)}function l(e,t){let n=e.body;do{let r=t.pop(),i=e.createElement(r);n.appendChild(i),n=i}while(t.length>0);return n.textContent=``,n}function u(e,t){let n={},r=e.getComputedStyle(t);return Kx.asArray(r).forEach(function(e){n[e]=e===`width`||e===`height`?`auto`:r.getPropertyValue(e)}),n}function d(e){do{let t=e.parentElement;t!==null&&t.removeChild(e),e=t}while(e&&e.tagName!==`BODY`)}}function CS(){if(lS)return lS.contentWindow;let e=document.characterSet||`UTF-8`,t=document.doctype,n=t?`<!DOCTYPE ${r(t.name)} ${r(t.publicId)} ${r(t.systemId)}`.trim()+`>`:``;return lS=document.createElement(`iframe`),lS.id=`domtoimage-sandbox-`+Kx.uid(),lS.className=`domtoimage-thino`,lS.style.visibility=`hidden`,lS.style.position=`fixed`,document.body.appendChild(lS),i(lS,n,e,`domtoimage-sandbox`);function r(e){if(e){let t=document.createElement(`div`);return t.innerText=e,t.innerHTML}else return``}function i(e,t,n,r){try{return e.contentWindow.document.write(`${t}<html><head><meta charset='${n}'><title>${r}</title></head><body></body></html>`),e.contentWindow}catch{}let i=document.createElement(`meta`);i.setAttribute(`charset`,n);try{let n=document.implementation.createHTMLDocument(r);n.head.appendChild(i);let a=t+n.documentElement.outerHTML;return e.setAttribute(`srcdoc`,a),e.contentWindow}catch{}return e.contentDocument.head.appendChild(i),e.contentDocument.title=r,e.contentWindow}}function wS(){lS&&=(document.body.removeChild(lS),null),yS&&clearTimeout(yS),yS=setTimeout(()=>{yS=null,bS={}},20*1e3)}async function TS(e,t,n){return await Zx.toCanvas(e,{width:e.clientWidth,height:e.clientHeight,quality:1,scale:t?2:1,requestUrl:f.requestUrl,type:n})}var ES=async(e,t)=>(console.log(t),(await TS(e,!0,`image/jpeg`)).toDataURL()),DS=({children:e,styles:t,className:n,onReady:r})=>{let i=(0,U.useRef)(null),[a,o]=(0,U.useState)(null);return(0,U.useLayoutEffect)(()=>{if(i.current&&!a){let e=i.current.attachShadow({mode:`open`}),n=document.head.querySelector(`link[href="app.css"]`);if(n){let t=n.cloneNode(!0);e.appendChild(t)}if(t){let n=document.createElement(`style`);n.textContent=t,e.appendChild(n)}o(e)}},[]),(0,U.useLayoutEffect)(()=>{a&&r&&requestAnimationFrame(()=>{r()})},[a,r]),(0,W.jsx)(`div`,{ref:i,className:n,style:{display:`contents`},children:a&&(0,A_.createPortal)(e,a)})},OS=`.theme-light{--memos-masonry-width:1400px;--memos-masonry-content-width:1000px;--memos-list-width:848px;--memos-list-content-width:600px;--memos-calendar-width:1200px;--memos-calendar-content-width:1000px;--memos-table-width:1200px;--memos-table-content-width:1000px;--memos-chat-width:1200px;--memos-chat-content-width:1000px;--memos-sidebar-width:260px;--memos-text-accent:var(--text-accent);--memos-text-accent-hover:var(--text-accent-hover);--memos-text-muted:var(--text-muted);--memos-text-faint:var(--text-faint);--memos-text-hover:var(--text-normal);--memos-accent:var(--memos-stat-day-L4-bg);--memos-accent-hover:var(--memos-stat-day-L3-bg);--memos-radius-s:2px;--memos-radius-m:var(--radius-s);--memos-radius-l:var(--radius-m);--memos-radius-xl:var(--radius-l);--memos-radius-full:var(--radius-xl);--memos-text-black:#37352f;--memos-text-gray:#52504b;--memos-text-lightgray:#d4d4d4;--memos-text-blue:#5783f7;--memos-text-unresolved-blue:#8fa2d6;--memos-text-green:#16a34a;--memos-text-red:#d28653;--memos-text-light-red:#d24c42;--memos-memo-bg:var(--color-base-00);--memos-memo-bg-primary:var(--color-base-30);--memos-memo-modal-bg:var(--background-modifier-cover);--memos-more-action-bg:var(--memos-memo-bg);--memos-location-wrapper-bg:var(--memos-memo-bg);--memos-memo-border:var(--color-base-20);--memos-memo-bg-hover:var(--background-modifier-hover);--memos-dialog-cover:var(--background-modifier-cover);--memos-memo-border-hover:var(--background-modifier-border-hover);--memos-memo-shadow:0 0 8px 0 rgba(0,0,0,.2);--memos-memo-shadow-s:0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);--memos-share-memo-shadow-webkit:15px 15px 27px #e1e1e3, -15px -15px 27px #fff;--memos-share-memo-shadow:15px 15px 27px #c1c1c1, -15px -15px 27px #e2e2e2;--memos-time-text-color:var(--memos-bg-whitegray);--memos-editor-save-btn-bg:var(--memos-text-green);--memos-editor-save-btn-color:var(--memos-bg-lightgray);--memos-editor-suggest-color:var(--memos-text-green);--memos-filter-bg:var(--memos-bg-gray);--memos-filter-hover-filter:contrast(1) brightness(1) invert(.5);--memos-filter-save-btn-bg:var(--memos-text-green);--memos-bg-black:#2f3437;--memos-bg-gray:#e4e4e4;--memos-bg-whitegray:#f8f8f8;--memos-bg-searchbar-lightgray:var(--background-secondary);--memos-bg-lightgray:#eaeaea;--memos-bg-blue:#3b82f6;--memos-bg-yellow:yellow;--memos-bg-light-blue:#eef3fe;--memos-bg-paper-yellow:#fbf4de;--memos-bg-accent:var(--color-accent);--memos-icon:var(--color-base-20);--memos-icon-hover:var(--color-base-30);--memos-show-editor-btn:opacity(30%);--memos-stat-day-L0-bg:var(--color-base-10);--rdp-border-color:#9b9b9b;--rdp-text-color:var(--text-muted);--rdp-cell-size:40px;--rdp-accent-color:#00f;--rdp-background-color:#e7edff;--rdp-accent-color-dark:#3003e1;--rdp-background-color-dark:#180270;--rdp-outline:2px solid var(--rdp-accent-color);--rdp-outline-selected:2px solid rgba(0,0,0,.75);--thino-text-on-accent:var(--text-on-accent);--thino-modern-primary:var(--thino-background-muted);--thino-modern-secondary:var(--thino-background-primary);--thino-setting-border:var(--color-base-40);--thino-modern-text-faint:var(--color-base-50);--thino-modern-text-faint-hover:var(--color-base-70);--thino-button-text-faint:var(--color-base-20);--thino-divider:var(--color-base-10);--thino-divider-hover:var(--color-base-30);--thino-wrapper-border:var(--color-base-20);--thino-wrapper-border-hover:var(--color-base-60);--thino-button-background:var(--color-base-30);--thino-wrapper-background:var(--color-base-60);--thino-wrapper-background-hover:var(--color-base-30);--thino-background-primary:var(--background-primary);--thino-background-secondary:var(--background-secondary);--thino-background-primary-alt:var(--background-primary-alt);--thino-modifier-cover:var(--background-modifier-cover);--thino-modifier-hover:var(--background-modifier-hover);--thino-modifier-border:var(--background-modifier-border);--thino-modifier-border-hover:var(--background-modifier-border-hover);--thino-ui-small:14px;--thino-ui-tiny:10px;--thino-share-background-color:rgba(255,255,255,.5)}.theme-dark{--memos-masonry-width:1400px;--memos-masonry-content-width:1000px;--memos-list-width:848px;--memos-list-content-width:600px;--memos-calendar-width:1200px;--memos-calendar-content-width:1000px;--memos-table-width:1200px;--memos-table-content-width:1000px;--memos-chat-width:1200px;--memos-chat-content-width:1000px;--memos-sidebar-width:260px;--memos-text-accent:var(--text-accent);--memos-text-accent-hover:var(--text-accent-hover);--memos-text-muted:var(--text-muted);--memos-text-hover:var(--text-normal);--memos-text-faint:var(--text-faint);--memos-text-green:#35e06f;--memos-accent:var(--memos-stat-day-L3-bg);--memos-accent-hover:var(--memos-stat-day-L4-bg);--memos-radius-s:2px;--memos-radius-m:var(--radius-s);--memos-radius-l:var(--radius-m);--memos-radius-xl:var(--radius-l);--memos-radius-full:var(--radius-xl);--memos-text-black:#d2d1cd;--memos-text-gray:#c7c4bb;--memos-text-lightgray:#525252;--memos-text-blue:#bbbec7;--memos-text-unresolved-blue:#8c92a1;--memos-text-red:#940b01;--memos-text-light-red:#d24c42;--memos-memo-bg:var(--background-secondary);--memos-memo-bg-primary:var(--color-base-30);--memos-bg-searchbar-lightgray:var(--background-modifier-hover);--memos-memo-modal-bg:var(--background-modifier-cover);--memos-more-action-bg:var(--memos-memo-bg-primary);--memos-location-wrapper-bg:var(--memos-memo-bg-primary);--memos-memo-bg-hover:var(--background-modifier-hover);--memos-dialog-cover:var(--background-modifier-cover);--memos-memo-border:var(--color-base-20);--memos-memo-border-hover:var(--background-modifier-border-hover);--memos-memo-shadow:0 0 8px 0 rgba(0,0,0,.2);--memos-memo-shadow-s:0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);--memos-share-memo-shadow-webkit:15px 15px 27px #666, -15px -15px 27px #3a3a3a;--memos-share-memo-shadow:6px 4px 4px 2px #383333, 5px 2px 4px 2px #444;--memos-time-text-color:#b9b9b9;--memos-editor-save-btn-bg:var(--memos-text-red);--memos-editor-save-btn-color:var(--memos-text-hover);--memos-editor-suggest-color:var(--memos-text-red);--memos-filter-bg:var(--memos-memo-bg);--memos-filter-hover-filter:contrast(1) brightness(1) invert(.9);--memos-filter-save-btn-bg:var(--memos-text-red);--memos-bg-black:#cacdcf;--memos-bg-gray:#353535;--memos-bg-whitegray:gray;--memos-bg-lightgray:#727171;--memos-bg-Search-lightgray:#302e2e;--memos-bg-blue:#1e3a8a;--memos-bg-yellow:#777;--memos-bg-light-blue:#6f8f9b;--memos-bg-paper-yellow:#5f5f5f;--memos-icon:var(--color-base-30);--memos-icon-hover:var(--color-base-40);--memos-bg-accent:var(--color-accent);--memos-show-editor-btn:invert(.8) opacity(65%);--memos-stat-day-L0-bg:var(--color-base-90);--rdp-border-color:#9b9b9b;--rdp-text-color:var(--text-muted);--rdp-dark-cell-size:40px;--rdp-dark-accent-color:#494949;--rdp-dark-background-color:#838383;--rdp-dark-accent-color-dark:#050505;--rdp-dark-background-color-dark:#7e7e7e;--rdp-dark-outline:2px solid var(--rdp-accent-color);--rdp-dark-outline-selected:2px solid rgba(255,255,255,.75);--thino-text-on-accent:var(--text-on-accent);--thino-layout-color-primary:var(--background-primary-alt);--thino-layout-color-secondary:var(--background-secondary);--thino-setting-border:var(--color-base-40);--thino-modern-text-faint:var(--color-base-50);--thino-modern-text-faint-hover:var(--color-base-70);--thino-button-text-faint:var(--color-base-20);--thino-divider:var(--color-base-10);--thino-divider-hover:var(--color-base-30);--thino-wrapper-border:var(--color-base-20);--thino-wrapper-border-hover:var(--color-base-60);--thino-button-background:var(--color-base-30);--thino-wrapper-background:var(--color-base-60);--thino-wrapper-background-hover:var(--color-base-30);--thino-background-primary:var(--background-primary);--thino-background-secondary:var(--background-secondary);--thino-background-primary-alt:var(--background-primary-alt);--thino-modifier-cover:var(--background-modifier-cover);--thino-modifier-hover:var(--background-modifier-hover);--thino-modifier-border:var(--background-modifier-border);--thino-modifier-border-hover:var(--background-modifier-border-hover);--thino-ui-small:14px;--thino-ui-tiny:10px;--thino-share-background-color:rgba(45,45,45,0);--thino-modern-primary:var(--thino-background-secondary);--thino-modern-secondary:var(--thino-background-secondary)}.theme-light .heatmap-default{--memos-stat-day-L1-bg:#9be9a8;--memos-stat-day-L2-bg:#40c463;--memos-stat-day-L3-bg:#30a14e;--memos-stat-day-L4-bg:#216e39}.theme-dark .heatmap-default{--memos-stat-day-L4-bg:#f75205;--memos-stat-day-L3-bg:#e03a07;--memos-stat-day-L2-bg:#bf2104;--memos-stat-day-L1-bg:#940b01}.theme-light .heatmap-gray{--memos-stat-day-L1-bg:#a09da6;--memos-stat-day-L2-bg:#7d7986;--memos-stat-day-L3-bg:#464251;--memos-stat-day-L4-bg:#26222e}.theme-dark .heatmap-gray{--memos-stat-day-L1-bg:#26222e;--memos-stat-day-L2-bg:#464251;--memos-stat-day-L3-bg:#7d7986;--memos-stat-day-L4-bg:#a09da6}.theme-light .heatmap-grass{--memos-stat-day-L1-bg:#a0eaab;--memos-stat-day-L2-bg:#40c463;--memos-stat-day-L3-bg:#30a14e;--memos-stat-day-L4-bg:#216e39}.theme-dark .heatmap-grass{--memos-stat-day-L4-bg:#9be9a8;--memos-stat-day-L3-bg:#40c463;--memos-stat-day-L2-bg:#30a14e;--memos-stat-day-L1-bg:#216e39}.theme-light .heatmap-flame{--memos-stat-day-L1-bg:#f75205;--memos-stat-day-L2-bg:#e03a07;--memos-stat-day-L3-bg:#bf2104;--memos-stat-day-L4-bg:#940b01}.theme-dark .heatmap-flame{--memos-stat-day-L4-bg:#f75205;--memos-stat-day-L3-bg:#e03a07;--memos-stat-day-L2-bg:#bf2104;--memos-stat-day-L1-bg:#940b01}.theme-light .heatmap-olive{--memos-stat-day-L1-bg:#9cc069;--memos-stat-day-L2-bg:#78a851;--memos-stat-day-L3-bg:#648b3f;--memos-stat-day-L4-bg:#4f6e30}.theme-dark .heatmap-olive{--memos-stat-day-L4-bg:#9cc069;--memos-stat-day-L3-bg:#78a851;--memos-stat-day-L2-bg:#648b3f;--memos-stat-day-L1-bg:#4f6e30}.theme-light .heatmap-ice{--memos-stat-day-L1-bg:#82bbf0;--memos-stat-day-L2-bg:#5da2eb;--memos-stat-day-L3-bg:#3889e6;--memos-stat-day-L4-bg:#126fe0}.theme-dark .heatmap-ice{--memos-stat-day-L4-bg:#82bbf0;--memos-stat-day-L3-bg:#5da2eb;--memos-stat-day-L2-bg:#3889e6;--memos-stat-day-L1-bg:#126fe0}.theme-light .heatmap-magenta{--memos-stat-day-L1-bg:#fa9fb5;--memos-stat-day-L2-bg:#ea4e9c;--memos-stat-day-L3-bg:#ae017e;--memos-stat-day-L4-bg:#610070}.theme-dark .heatmap-magenta{--memos-stat-day-L4-bg:#fa9fb5;--memos-stat-day-L3-bg:#ea4e9c;--memos-stat-day-L2-bg:#ae017e;--memos-stat-day-L1-bg:#610070}.mono-font-family{font-family:ubuntu-mono,SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace}.hide-scroll-bar::-webkit-scrollbar{cursor:pointer;width:0;height:0}.hide-scroll-bar::-webkit-scrollbar-thumb{background-color:#d5d5d5;border-radius:8px;width:0;height:0}.hide-scroll-bar::-webkit-scrollbar-thumb:hover{background-color:#ccc}.hide-scroll-bar::-webkit-scrollbar{display:none}.share-memo-image-dialog{--dialog-width-desktop:1000px;--dialog-height-desktop:85vh;--panel-width:360px;--card-width:400px;--card-min-height:500px;--transition-fast:.15s ease;--transition-medium:.3s ease;--transition-slow:.5s ease-out;--shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--shadow-md:0 4px 6px -1px rgba(0,0,0,.1);--shadow-lg:0 10px 15px -3px rgba(0,0,0,.1);--shadow-xl:0 20px 25px -5px rgba(0,0,0,.1);--shadow-2xl:0 25px 50px -12px rgba(0,0,0,.25);--card-bg:rgba(255,255,255,.9);--card-text:#334155;--card-font:var(--font-interface);--card-font-size:16px;--card-radius:16px;--card-shadow:var(--shadow-xl);--card-padding:40px;--card-border:1px solid rgba(255,255,255,.5);--card-blur:12px}.share-memo-image-dialog .custom-scrollbar::-webkit-scrollbar{width:4px;height:4px}.share-memo-image-dialog .custom-scrollbar::-webkit-scrollbar-track{background:0 0}.share-memo-image-dialog .custom-scrollbar::-webkit-scrollbar-thumb{background-color:var(--background-modifier-border);border-radius:20px}.share-memo-image-dialog .custom-scrollbar:hover::-webkit-scrollbar-thumb{background-color:var(--text-muted)}.share-memo-image-dialog>.dialog-container{width:var(--dialog-width-desktop);max-width:95vw;height:var(--dialog-height-desktop);background-color:var(--background-primary);max-height:95vh;box-shadow:var(--shadow-2xl);border:1px solid var(--background-modifier-border);animation:dialogSlideIn var(--transition-medium) ease-out;border-radius:16px;flex-direction:row;padding:0;display:flex;overflow:hidden}@keyframes dialogSlideIn{0%{opacity:0;transform:scale(.95)translateY(10px)}to{opacity:1;transform:scale(1)translateY(0)}}.share-memo-image-dialog>.dialog-container>.dialog-header-container{display:none}.share-memo-image-dialog>.dialog-container>.dialog-content-container{flex-direction:row;justify-content:flex-start;align-items:stretch;width:100%;height:100%;display:flex;position:relative}.share-preview-area{background-color:var(--background-secondary);flex:1;justify-content:center;align-items:center;padding:40px;display:flex;position:relative;overflow:hidden}.share-preview-area:before{content:"";background-image:radial-gradient(var(--background-modifier-border) 1px, transparent 1px);opacity:.5;pointer-events:none;background-size:20px 20px;position:absolute;top:0;bottom:0;left:0;right:0}.share-preview-area .style-indicator{-webkit-backdrop-filter:blur(8px);color:#fff;letter-spacing:.05em;z-index:20;pointer-events:none;box-shadow:var(--shadow-lg);transition:all var(--transition-medium);background-color:rgba(0,0,0,.75);border-radius:999px;padding:6px 16px;font-size:12px;font-weight:500;position:absolute;top:24px;left:50%;transform:translate(-50%)}.share-preview-area .preview-nav-btn{z-index:30;box-shadow:var(--shadow-lg);color:var(--text-normal);border:1px solid var(--background-modifier-border);cursor:pointer;transition:all var(--transition-medium) cubic-bezier(.4, 0, .2, 1);opacity:0;height:var(--size-4-10);width:var(--size-4-10);border-radius:50%;padding:14px;position:absolute;top:50%;transform:translateY(-50%)scale(.9)}.share-preview-area .preview-nav-btn.prev{left:24px}.share-preview-area .preview-nav-btn.next{right:24px}.share-preview-area .preview-nav-btn:hover{background-color:var(--interactive-accent);color:var(--text-on-accent);box-shadow:var(--shadow-xl);border-color:transparent;transform:translateY(-50%)scale(1.1)}.share-preview-area .preview-nav-btn svg{width:20px;height:20px}.share-preview-area:hover .preview-nav-btn{opacity:1;transform:translateY(-50%)scale(1)}.share-preview-area .mobile-back-btn{display:none}.memo-share-card-wrapper{transition:transform var(--transition-slow);justify-content:center;align-items:center;display:flex;position:relative}.memo-share-card-wrapper>.memo-shortcut-img{z-index:100;border-radius:var(--card-radius);cursor:pointer;width:100%;height:auto;transition:transform var(--transition-fast);position:absolute;top:0;left:0}.memo-share-card-wrapper>.memo-shortcut-img:hover{transform:scale(1.01)}.memo-share-card{width:var(--card-width);min-height:var(--card-min-height);border-radius:var(--card-radius);background-color:var(--card-bg);box-shadow:var(--card-shadow);color:var(--card-text);font-family:var(--card-font);transition:all var(--transition-slow);position:relative;overflow:hidden}.memo-share-card .card-bg-layer{z-index:0;border-radius:inherit;position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden}.memo-share-card .card-bg-layer .bg-image{background-position:50%;background-repeat:repeat;width:100%;height:100%}.memo-share-card .card-content-layer{z-index:10;height:100%;min-height:inherit;padding:var(--card-padding);-webkit-backdrop-filter:blur(var(--card-blur));border-radius:inherit;background-color:var(--card-bg);flex-direction:column;display:flex;position:relative}.memo-share-card .card-content-layer .card-header{align-items:center;gap:12px;margin-bottom:32px;display:flex}.memo-share-card .card-content-layer .card-header.center{justify-content:center}.memo-share-card .card-content-layer .card-header .avatar{background-position:50%;background-size:cover;border:2px solid rgba(255,255,255,.5);border-radius:50%;justify-content:center;align-items:center;width:32px;min-width:32px;height:32px;font-size:12px;font-weight:700;display:flex}.memo-share-card .card-content-layer .card-header .avatar:has(svg){border:1px solid var(--background-modifier-border)}.memo-share-card .card-content-layer .card-header .avatar svg{opacity:.6;width:16px;height:16px}.memo-share-card .card-content-layer .card-header .user-meta{flex-direction:column;display:flex}.memo-share-card .card-content-layer .card-header .user-meta .from-label{text-transform:uppercase;letter-spacing:.05em;opacity:.6;margin-bottom:2px;font-size:12px;font-weight:700;line-height:1}.memo-share-card .card-content-layer .card-header .user-meta .username{font-size:14px;font-weight:700;line-height:1.25}.memo-share-card .card-content-layer .card-body{font-size:var(--card-font-size);word-break:break-word;flex:1;padding:0;line-height:1.7}.memo-share-card .card-content-layer .card-body .card-title{font-weight:700;font-size:calc(var(--card-font-size) * 1.4);margin-bottom:16px;line-height:1.3}.memo-share-card .card-content-layer .card-body img{max-width:100%;box-shadow:var(--shadow-sm);border-radius:8px;margin:8px 0}.memo-share-card .card-content-layer .card-body blockquote{opacity:.85;border-left:3px solid;margin-left:0;padding-left:1em;font-style:italic}.memo-share-card .card-content-layer .card-body ul,.memo-share-card .card-content-layer .card-body ol{padding-left:1.5em}.memo-share-card .card-content-layer .card-body code{background:rgba(0,0,0,.05);border-radius:4px;padding:2px 6px;font-size:.9em}.memo-share-card .card-content-layer .card-body pre{background:rgba(0,0,0,.05);border-radius:8px;padding:12px;overflow-x:auto}.memo-share-card .card-content-layer .card-body .tag{opacity:.6;box-shadow:unset;border:unset;margin-right:8px;font-size:12px}.memo-share-card .card-content-layer .card-timestamp{opacity:.5;font-size:12px;font-family:var(--font-monospace);justify-content:flex-end;margin-top:16px;display:flex}.memo-share-card .card-content-layer .card-footer{border-top:1px dashed rgba(128,128,128,.2);justify-content:space-between;align-items:flex-end;gap:16px;margin-top:auto;padding-top:20px;display:flex}.memo-share-card .card-content-layer .card-footer .footer-left{flex-direction:column;gap:8px;font-size:12px;display:flex}.memo-share-card .card-content-layer .card-footer .footer-left .footer-text{opacity:.5}.memo-share-card .card-content-layer .card-footer .footer-right{opacity:.6;letter-spacing:.02em;align-items:center;gap:8px;font-size:14px;font-weight:600;display:flex}.memo-share-card .card-content-layer .card-footer .footer-logo{opacity:.8;justify-content:center;align-items:center;width:40px;height:40px;display:flex}.memo-share-card .card-content-layer .card-footer .footer-logo .logo-placeholder{opacity:.1;background:currentColor;border-radius:8px;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.memo-share-card .card-content-layer .card-footer .footer-logo .logo-placeholder:after{content:"";opacity:.5;background:currentColor;border-radius:50%;width:50%;height:50%}.memo-share-card .card-content-layer .card-footer .footer-logo .qr-placeholder{border:1px solid;justify-content:center;align-items:center;width:100%;height:100%;padding:4px;display:flex}.memo-share-card .card-content-layer .card-footer .footer-logo .qr-placeholder svg{width:100%;height:100%}.memo-share-card[data-theme=modern]{--card-bg:rgba(255,255,255,.9);--card-text:#334155;--card-radius:16px;--card-blur:12px}.memo-share-card[data-theme=modern] .card-content-layer:before{content:"";border-radius:inherit inherit 0 0;background:linear-gradient(90deg,#6366f1,#a855f7,#ec4899);height:4px;position:absolute;top:0;left:0;right:0}.memo-share-card[data-theme=vintage]{--card-bg:#fffbf0;--card-text:#5c4033;--card-radius:2px;--card-font:"Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;--card-blur:0;--card-border:none}.memo-share-card[data-theme=vintage] .card-content-layer{border:4px double rgba(139,90,43,.3)}.memo-share-card[data-theme=vintage] .ancient-corner{opacity:.6;z-index:20;border-style:solid;border-color:#8b5a2b;width:16px;height:16px;position:absolute}.memo-share-card[data-theme=vintage] .ancient-corner.top-left{border-width:2px 0 0 2px;top:8px;left:8px}.memo-share-card[data-theme=vintage] .ancient-corner.top-right{border-width:2px 2px 0 0;top:8px;right:8px}.memo-share-card[data-theme=vintage] .ancient-corner.bottom-left{border-width:0 0 2px 2px;bottom:8px;left:8px}.memo-share-card[data-theme=vintage] .ancient-corner.bottom-right{border-width:0 2px 2px 0;bottom:8px;right:8px}.memo-share-card[data-theme=vintage] .inner-border{pointer-events:none;z-index:15;border:1px solid rgba(139,90,43,.1);position:absolute;top:8px;bottom:8px;left:8px;right:8px}.memo-share-card[data-theme=vintage] .card-body{line-height:1.8}.memo-share-card[data-theme=vintage] .card-footer{border-top-color:rgba(139,90,43,.2)}.memo-share-card[data-theme=cyber]{--card-bg:#1e293b;--card-text:#4ade80;--card-radius:8px;--card-blur:0;--card-shadow:none;--card-border:1px solid rgba(74,222,128,.2)}.memo-share-card[data-theme=cyber] .card-content-layer{background-color:var(--card-bg)}.memo-share-card[data-theme=cyber] .cyber-dots{opacity:.3;gap:4px;display:flex;position:absolute;top:8px;right:8px}.memo-share-card[data-theme=cyber] .cyber-dots .dot{background:currentColor;border-radius:50%;width:4px;height:4px}.memo-share-card[data-theme=cyber] .card-footer{border-top-color:rgba(74,222,128,.2)}.memo-share-card[data-theme=cyber] code{background:rgba(74,222,128,.1)}.memo-share-card[data-theme=outline]{--card-bg:#fff;--card-text:#000;--card-radius:0;--card-blur:0;--card-shadow:none;--card-border:3px solid #000}.memo-share-card[data-theme=outline] .card-content-layer{-webkit-backdrop-filter:none}.memo-share-card[data-theme=classic-gradient]{--card-bg:rgba(255,255,255,.95);--card-text:#1e293b;--card-radius:16px;--card-blur:12px}.memo-share-card[data-theme=nordic]{--card-bg:#fff;--card-text:#334155;--card-radius:12px;--card-blur:0;--card-shadow:0 4px 6px -1px rgba(0,0,0,.05)}.memo-share-card[data-theme=nordic] .card-content-layer{border-left:6px solid #d4a373}.memo-share-card[data-theme=nordic] .nordic-dot{background-color:#d4a373;border-radius:50%;width:8px;height:8px;position:absolute;top:40px;right:40px}.memo-share-card[data-theme=nordic] .card-header{border-bottom:1px solid #f1f5f9;margin-bottom:36px;padding-bottom:20px}.memo-share-card[data-theme=nordic] .card-body{font-weight:300;line-height:1.8}.memo-share-card[data-theme=japanese]{--card-bg:#fdfbf7;--card-text:#2c2c2c;--card-radius:2px;--card-font:"Hiragino Mincho ProN", "Yu Mincho", "SimSun", serif;--card-shadow:0 2px 8px rgba(0,0,0,.06)}.memo-share-card[data-theme=japanese] .card-content-layer{background-image:radial-gradient(#e5e5e5 1px,transparent 0);background-size:40px 40px;padding-right:70px!important}.memo-share-card[data-theme=japanese] .japanese-decor{pointer-events:none}.memo-share-card[data-theme=japanese] .japanese-decor .stamp{opacity:.15;z-index:0;border:2px solid #ef4444;border-radius:50%;width:50px;height:50px;position:absolute;bottom:40px;right:24px}.memo-share-card[data-theme=japanese] .japanese-decor .stamp:after{content:"メモ";color:#ef4444;writing-mode:vertical-rl;justify-content:center;align-items:center;font-size:14px;font-weight:700;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.memo-share-card[data-theme=japanese] .japanese-decor .vertical-line{border-right:1px dashed #d1d5db;width:1px;position:absolute;top:48px;bottom:100px;right:24px}.memo-share-card[data-theme=social]{--card-bg:#fff;--card-text:#1e293b;--card-radius:24px;--card-shadow:0 20px 40px -10px rgba(0,0,0,.1)}.memo-share-card[data-theme=social] .card-header .avatar{background-clip:content-box;border:2px solid transparent;box-shadow:0 0 0 2px #fff,0 0 0 4px #d62976}.memo-share-card[data-theme=social] .card-footer{border-top:1px solid #f1f5f9;padding-top:16px}.memo-share-card[data-theme=social] .card-footer .footer-left{flex-direction:row;align-items:center;gap:16px;display:flex}.memo-share-card[data-theme=social] .card-footer .footer-left:before{content:"❤";color:#ef4444;font-size:18px}.memo-share-card[data-theme=social] .card-footer .footer-left:after{content:"💬";opacity:.6;filter:grayscale();font-size:16px}.memo-share-card[data-theme=magazine]{--card-bg:#fff;--card-text:#000;--card-radius:0}.memo-share-card[data-theme=magazine] .magazine-decor .top-bar,.memo-share-card[data-theme=magazine] .magazine-decor .bottom-bar{background:#000;position:absolute;left:20px;right:20px}.memo-share-card[data-theme=magazine] .magazine-decor .top-bar{height:8px;top:0}.memo-share-card[data-theme=magazine] .magazine-decor .bottom-bar{height:4px;bottom:0}.memo-share-card[data-theme=magazine] .magazine-decor .side-text{transform-origin:100% 0;letter-spacing:4px;white-space:nowrap;font-size:10px;font-weight:700;position:absolute;top:120px;right:12px;transform:rotate(90deg)}.memo-share-card[data-theme=magazine] .card-body{font-family:Times New Roman,Georgia,serif;font-size:1.1em}.memo-share-card[data-theme=magazine] .card-body p:first-of-type:first-letter{float:left;margin-right:8px;font-size:3.5em;font-weight:700;line-height:.8}.memo-share-card[data-theme=handwritten]{--card-bg:#fffbeb;--card-text:#4b5563;--card-border:2px solid rgba(0,0,0,.1);border-radius:255px 15px 225px/15px 225px 15px 255px!important}.memo-share-card[data-theme=handwritten] .tape-decoration{z-index:20;background-color:rgba(255,255,255,.6);border-left:2px dotted rgba(0,0,0,.1);border-right:2px dotted rgba(0,0,0,.1);width:120px;height:32px;position:absolute;top:-12px;left:50%;transform:translate(-50%)rotate(-2deg);box-shadow:0 2px 4px rgba(0,0,0,.1)}.memo-share-card[data-theme=handwritten] .card-body{font-family:Comic Sans MS,Chalkboard SE,cursive}.memo-share-card[data-theme=colorful]{--card-bg:rgba(255,255,255,.2);--card-text:#fff;--card-radius:20px;--card-blur:20px;--card-border:1px solid rgba(255,255,255,.4);--card-shadow:0 8px 32px 0 rgba(31,38,135,.37)}.memo-share-card[data-theme=colorful] .card-content-layer{text-shadow:0 1px 3px rgba(0,0,0,.2)}.memo-share-card[data-theme=colorful] .card-header,.memo-share-card[data-theme=colorful] .card-footer{border-color:rgba(255,255,255,.3)}.memo-share-card[data-theme=colorful] .avatar{border-color:rgba(255,255,255,.8)!important}.heatmap-display{opacity:.7;gap:3px;display:flex}.heatmap-display .heatmap-cell{width:12px;height:12px;transition:opacity var(--transition-fast);background-color:currentColor;border-radius:2px}.heatmap-display .heatmap-cell.level-0{opacity:.15}.heatmap-display .heatmap-cell.level-1{opacity:.35}.heatmap-display .heatmap-cell.level-2{opacity:.55}.heatmap-display .heatmap-cell.level-3{opacity:.75}.heatmap-display .heatmap-cell.level-4{opacity:1}.texture-decoration{opacity:.4;align-items:center;gap:8px;display:flex}.texture-decoration .line{background:currentColor;width:48px;height:1px}.texture-decoration .diamond{border:1px solid;width:8px;height:8px;transform:rotate(45deg)}.share-config-panel{width:var(--panel-width);background-color:var(--background-primary);border-left:1px solid var(--background-modifier-border);z-index:40;flex-direction:column;height:100%;display:flex}.share-config-panel .panel-header{border-bottom:1px solid var(--background-modifier-border);background:var(--background-primary);justify-content:space-between;align-items:center;padding:16px 20px;display:flex}.share-config-panel .panel-header .panel-title{align-items:center;gap:8px;margin:0;font-size:15px;font-weight:600;display:flex}.share-config-panel .panel-header .panel-title svg{width:18px;height:18px;color:var(--interactive-accent)}.share-config-panel .panel-header .close-btn{background:var(--background-secondary);color:var(--text-muted);cursor:pointer;transition:all var(--transition-fast);border-radius:50%;justify-content:center;align-items:center;padding:8px;display:flex}.share-config-panel .panel-header .close-btn:hover{color:var(--text-normal);background:var(--background-modifier-hover)}.share-config-panel .panel-header .close-btn svg{width:16px;height:16px}.share-config-panel .panel-content{flex:1;padding:20px 20px 100px;overflow-y:auto}.share-config-panel .panel-content .config-section{margin-bottom:28px}.share-config-panel .panel-content .config-section .section-title{color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;align-items:center;gap:6px;margin-bottom:12px;font-size:11px;font-weight:700;display:flex}.share-config-panel .panel-content .config-section .section-title svg{width:14px;height:14px}.share-config-panel .panel-footer{border-top:1px solid var(--background-modifier-border);background:var(--background-secondary);flex-direction:column;gap:12px;padding:16px 20px;display:flex}.share-config-panel .panel-footer .action-buttons{gap:12px;display:flex}.share-config-panel .panel-footer .action-buttons .action-btn{cursor:pointer;transition:all var(--transition-fast);border:none;border-radius:10px;flex:1;justify-content:center;align-items:center;gap:8px;padding:12px 16px;font-size:13px;font-weight:600;display:flex}.share-config-panel .panel-footer .action-buttons .action-btn svg{width:16px;height:16px}.share-config-panel .panel-footer .action-buttons .action-btn.secondary{background-color:var(--background-primary);color:var(--text-normal)}.share-config-panel .panel-footer .action-buttons .action-btn.secondary:hover{background-color:var(--background-modifier-hover)}.share-config-panel .panel-footer .action-buttons .action-btn.primary{background-color:var(--text-normal);color:var(--background-primary);box-shadow:var(--shadow-lg);flex:1.5}.share-config-panel .panel-footer .action-buttons .action-btn.primary:hover{opacity:.9;transform:translateY(-1px)}.share-config-panel .panel-footer .action-buttons .action-btn.primary:active{transform:scale(.98)}.share-config-panel .panel-footer .action-buttons .action-btn:disabled{opacity:.5;cursor:not-allowed}.share-config-panel .panel-footer .export-message{text-align:center;color:var(--interactive-accent);font-size:12px;font-weight:500;animation:1s ease-in-out infinite pulse}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.config-tabs{background-color:var(--background-secondary);border-radius:8px;margin-bottom:16px;padding:4px;display:flex}.config-tabs.theme-presets{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}.config-tabs .tab-btn{color:var(--text-muted);cursor:pointer;transition:all var(--transition-fast);box-shadow:none;background:0 0;border:none;border-radius:6px;flex:1;padding:8px 12px;font-size:12px;font-weight:500}.config-tabs .tab-btn:hover{color:var(--text-normal)}.config-tabs .tab-btn.active{background-color:var(--background-primary);color:var(--interactive-accent);box-shadow:var(--shadow-sm)}.gradient-picker-grid{grid-template-columns:repeat(5,1fr);gap:8px;display:grid}.gradient-picker-grid .color-option{aspect-ratio:1;cursor:pointer;transition:all var(--transition-fast);border:2px solid transparent;border-radius:8px;position:relative}.gradient-picker-grid .color-option:hover{transform:scale(1.08)}.gradient-picker-grid .color-option.active{border-color:var(--interactive-accent);box-shadow:var(--shadow-md);transform:scale(1.1)}.gradient-picker-grid .color-option.active:after{content:"✓";color:#fff;background:rgba(0,0,0,.3);border-radius:6px;justify-content:center;align-items:center;font-size:14px;font-weight:700;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.gradient-picker-grid .color-option.upload-btn{border:2px dashed var(--background-modifier-border);color:var(--text-muted);justify-content:center;align-items:center;font-size:20px;display:flex}.gradient-picker-grid .color-option.upload-btn:hover{border-color:var(--interactive-accent);color:var(--interactive-accent)}.config-toggle{background:var(--background-secondary);border:1px solid var(--background-modifier-border);border-radius:8px;justify-content:space-between;align-items:center;margin-bottom:8px;padding:10px 12px;display:flex}.config-toggle .toggle-label{color:var(--text-normal);font-size:13px}.config-toggle .toggle-switch{background-color:var(--background-modifier-border);cursor:pointer;width:36px;height:20px;transition:background-color var(--transition-fast);border-radius:99px;position:relative}.config-toggle .toggle-switch .thumb{width:16px;height:16px;transition:transform var(--transition-fast);background-color:#fff;border-radius:50%;position:absolute;top:2px;left:2px;box-shadow:0 1px 3px rgba(0,0,0,.2)}.config-toggle .toggle-switch.active{background-color:var(--interactive-accent)}.config-toggle .toggle-switch.active .thumb{transform:translate(16px)}.config-slider .slider-header{justify-content:space-between;align-items:center;margin-bottom:8px;display:flex}.config-slider .slider-header .slider-label{color:var(--text-muted);font-size:12px}.config-slider .slider-header .slider-value{color:var(--text-normal);font-size:12px;font-weight:500}.config-slider input[type=range]{background:var(--background-modifier-border);-webkit-appearance:none;appearance:none;border-radius:2px;outline:none;width:100%;height:4px}.config-slider input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--interactive-accent);cursor:pointer;width:16px;height:16px;transition:transform var(--transition-fast);border-radius:50%}.config-slider input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.1)}.config-slider input[type=range]::-moz-range-thumb{background:var(--interactive-accent);cursor:pointer;border:none;border-radius:50%;width:16px;height:16px}.config-select .select-label{color:var(--text-muted);margin-bottom:6px;font-size:12px;display:block}.config-select select{background:var(--background-primary);width:100%;color:var(--text-normal);cursor:pointer;transition:border-color var(--transition-fast);border-radius:6px;font-size:13px}.config-select select:focus{border-color:var(--interactive-accent);outline:none}.config-button-group{background:var(--background-secondary);border-radius:6px;padding:4px;display:flex}.config-button-group .group-btn{color:var(--text-muted);cursor:pointer;transition:all var(--transition-fast);box-shadow:none;background:0 0;border:none;border-radius:4px;flex:1;padding:6px 12px;font-size:12px}.config-button-group .group-btn:hover{color:var(--text-normal)}.config-button-group .group-btn.active{background:var(--background-primary);color:var(--interactive-accent);box-shadow:var(--shadow-sm)}.config-color-picker{align-items:center;gap:12px;display:flex}.config-color-picker .color-label{color:var(--text-muted);font-size:12px}.config-color-picker input[type=color]{cursor:pointer;background:0 0;border:none;border-radius:6px;width:32px;height:32px;padding:0}.config-color-picker input[type=color]::-webkit-color-swatch-wrapper{padding:0}.config-color-picker input[type=color]::-webkit-color-swatch{border:2px solid var(--background-modifier-border);border-radius:6px}.config-input .input-label{color:var(--text-muted);margin-bottom:6px;font-size:12px;display:block}.config-input input[type=text]{border:1px solid var(--background-modifier-border);background:var(--background-primary);width:100%;color:var(--text-normal);transition:border-color var(--transition-fast);border-radius:6px;padding:8px 12px;font-size:13px}.config-input input[type=text]:focus{border-color:var(--interactive-accent);outline:none}.config-input input[type=text]::placeholder{color:var(--text-muted)}.mobile-theme-switcher{display:none}.mobile-theme-switcher .theme-nav{grid-template-columns:1fr 1fr;gap:12px;display:grid}.mobile-theme-switcher .theme-nav .nav-btn{border:1px solid var(--background-modifier-border);background:var(--background-primary);color:var(--text-normal);cursor:pointer;transition:all var(--transition-fast);border-radius:8px;justify-content:center;align-items:center;gap:8px;padding:10px 16px;font-size:13px;font-weight:500;display:flex}.mobile-theme-switcher .theme-nav .nav-btn:active{background:var(--background-modifier-hover)}.mobile-theme-switcher .theme-nav .nav-btn svg{width:16px;height:16px}.mobile-theme-switcher .current-theme{text-align:center;color:var(--interactive-accent);background:rgba(var(--interactive-accent-rgb), .1);border-radius:6px;margin-top:8px;padding:6px 12px;font-size:12px;font-weight:500}@media (max-width:768px){.share-memo-image-dialog>.dialog-container{border:none;border-radius:0;flex-direction:column;width:100%;max-width:100%;height:100%;max-height:100%}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=edit] .share-preview-area{display:none}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=edit] .share-config-panel{display:flex}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=preview] .share-preview-area{height:100%;display:flex}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=preview] .share-config-panel{display:none}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=preview] .mobile-action-bar{display:flex}.share-memo-image-dialog .share-preview-area{height:calc(100% - 80px);padding:60px 16px 16px}.share-memo-image-dialog .share-preview-area .mobile-back-btn{z-index:30;backdrop-filter:blur(8px);color:var(--text-normal);box-shadow:var(--shadow-md);cursor:pointer;background:rgba(255,255,255,.9);border-radius:999px;align-items:center;gap:6px;padding:8px 12px;font-size:12px;font-weight:600;display:flex;position:absolute;top:16px;left:16px}.share-memo-image-dialog .share-preview-area .mobile-back-btn svg{width:14px;height:14px}.share-memo-image-dialog .share-preview-area .preview-nav-btn{display:none}.share-memo-image-dialog .share-preview-area .memo-share-card{max-width:360px;min-height:auto;width:100%!important}.share-memo-image-dialog .share-config-panel{border-left:none;border-radius:0;width:100%;height:100%;position:fixed;top:0;left:0}.share-memo-image-dialog .share-config-panel .panel-content{padding-bottom:160px}.share-memo-image-dialog .mobile-theme-switcher{display:block}.share-memo-image-dialog .mobile-action-bar{background:var(--background-primary);border-top:1px solid var(--background-modifier-border);z-index:50;width:100%;padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom));gap:12px;display:none;position:fixed;bottom:0;left:0}.share-memo-image-dialog .mobile-action-bar .action-btn{cursor:pointer;border:none;border-radius:12px;flex:1;justify-content:center;align-items:center;gap:8px;padding:14px;font-size:14px;font-weight:600;display:flex}.share-memo-image-dialog .mobile-action-bar .action-btn svg{width:16px;height:16px}.share-memo-image-dialog .mobile-action-bar .action-btn.secondary{background:var(--background-primary);color:var(--text-normal)}.share-memo-image-dialog .mobile-action-bar .action-btn.primary{background:var(--interactive-accent);color:var(--text-on-accent);box-shadow:0 4px 12px rgba(var(--interactive-accent-rgb), .3);flex:2}.share-memo-image-dialog .mobile-action-bar .action-btn:active{transform:scale(.98)}.share-memo-image-dialog .mobile-preview-btn{background:var(--background-primary);border-top:1px solid var(--background-modifier-border);z-index:50;width:100%;padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom));position:fixed;bottom:0;left:0}.share-memo-image-dialog .mobile-preview-btn .preview-btn{background:var(--interactive-accent);width:100%;color:var(--text-on-accent);cursor:pointer;box-shadow:0 4px 12px rgba(var(--interactive-accent-rgb), .3);border:none;border-radius:12px;justify-content:center;align-items:center;gap:8px;padding:16px;font-size:15px;font-weight:600;display:flex}.share-memo-image-dialog .mobile-preview-btn .preview-btn:active{transform:scale(.98)}.share-memo-image-dialog .mobile-preview-btn .preview-btn svg{width:18px;height:18px}}.is-phone .share-memo-image-dialog>.dialog-container>.dialog-content-container{flex-direction:column}.is-phone .share-memo-image-dialog>.dialog-container .share-preview-area .style-indicator{top:60px}.is-phone .share-memo-image-dialog>.dialog-container .share-preview-area .memo-share-card{transform-origin:top;transform:scale(.85)}.theme-dark .share-memo-image-dialog .share-preview-area{background-color:var(--background-primary-alt)}.theme-dark .share-memo-image-dialog .share-preview-area:before{background-image:radial-gradient(rgba(255,255,255,.1) 1px,transparent 1px)}.theme-dark .share-memo-image-dialog .share-preview-area .style-indicator{color:var(--text-normal);background-color:rgba(255,255,255,.15)}.theme-dark .share-memo-image-dialog .share-preview-area .preview-nav-btn{color:var(--text-normal);background-color:rgba(30,30,30,.9);border-color:rgba(255,255,255,.1)}.theme-dark .share-memo-image-dialog .share-preview-area .preview-nav-btn:hover{background-color:var(--interactive-accent);color:var(--text-on-accent)}.theme-dark .share-memo-image-dialog .share-preview-area .mobile-back-btn{color:var(--text-normal);background:rgba(30,30,30,.9)}.theme-dark .share-memo-image-dialog .share-config-panel .config-tabs{background-color:var(--background-primary-alt)}.theme-dark .share-memo-image-dialog .share-config-panel .config-tabs .tab-btn.active{background-color:var(--background-secondary)}.theme-dark .share-memo-image-dialog .share-config-panel .config-toggle{background:var(--background-primary-alt);border-color:rgba(255,255,255,.1)}.theme-dark .share-memo-image-dialog .share-config-panel .config-button-group{background:var(--background-primary-alt)}.theme-dark .share-memo-image-dialog .share-config-panel .config-button-group .group-btn.active{background:var(--background-secondary)}.theme-dark .share-memo-image-dialog .share-config-panel .gradient-picker-grid .color-option.active:after{background:rgba(0,0,0,.5)}.theme-dark .share-memo-image-dialog .share-config-panel .gradient-picker-grid .color-option.upload-btn{border-color:rgba(255,255,255,.2)}.theme-dark .share-memo-image-dialog .memo-share-card[data-style=modern] .card-body code{background:rgba(255,255,255,.1)}.theme-dark .share-memo-image-dialog .memo-share-card[data-style=modern] .card-body pre{background:rgba(255,255,255,.05)}.theme-dark .share-memo-image-dialog .mobile-action-bar,.theme-dark .share-memo-image-dialog .mobile-preview-btn{background:var(--background-primary);border-top-color:rgba(255,255,255,.1)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes scaleIn{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.share-memo-image-dialog .heatmap-grid{grid-template-rows:repeat(3,1fr);grid-template-columns:repeat(4,1fr);gap:2px;width:60px;height:36px;display:grid}.share-memo-image-dialog .heatmap-grid .heatmap-cell{background-color:var(--memos-stat-day-L0-bg);border-radius:2px;width:10px;height:10px}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L0-bg{background-color:var(--memos-stat-day-L0-bg)}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L1-bg{background-color:var(--memos-stat-day-L1-bg)}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L2-bg{background-color:var(--memos-stat-day-L2-bg)}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L3-bg{background-color:var(--memos-stat-day-L3-bg)}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L4-bg{background-color:var(--memos-stat-day-L4-bg)}.share-memo-image-dialog .setting-item{border-bottom:1px solid var(--background-modifier-border);align-items:center;padding:12px 0;display:flex}.share-memo-image-dialog .setting-item .setting-item-info{flex:1}.share-memo-image-dialog .setting-item .setting-item-info .setting-item-name{margin-bottom:2px;font-size:14px;font-weight:500}.share-memo-image-dialog .setting-item .setting-item-info .setting-item-description{color:var(--text-muted);font-size:12px}.share-memo-image-dialog .setting-item .setting-item-control{flex:none}.share-memo-image-dialog .setting-item .setting-item-control select,.share-memo-image-dialog .setting-item .setting-item-control input[type=text]{border:1px solid var(--background-modifier-border);background:var(--background-primary);color:var(--text-normal);border-radius:4px;min-width:120px;padding:6px 10px}.share-memo-image-dialog .setting-item .setting-item-control select:focus,.share-memo-image-dialog .setting-item .setting-item-control input[type=text]:focus{border-color:var(--interactive-accent);outline:none}.share-outer-container{transition:all var(--transition-medium)}.share-outer-container:not(.has-frame){background:0 0;padding:0}.share-memo-image-dialog .fullscreen-preview-overlay{z-index:1000;cursor:zoom-out;background-color:rgba(0,0,0,.9);justify-content:center;align-items:center;padding:40px;animation:.2s ease-out fadeIn;display:flex;position:fixed;top:0;bottom:0;left:0;right:0}.share-memo-image-dialog .fullscreen-preview-overlay .fullscreen-preview-content{flex-direction:column;align-items:center;gap:16px;max-width:100%;max-height:100%;display:flex}.share-memo-image-dialog .fullscreen-preview-overlay .fullscreen-preview-content img{object-fit:contain;border-radius:8px;max-width:100%;max-height:calc(100vh - 120px);animation:.2s ease-out scaleIn;box-shadow:0 25px 50px -12px rgba(0,0,0,.5)}.share-memo-image-dialog .fullscreen-preview-overlay .fullscreen-preview-content .fullscreen-preview-hint{color:rgba(255,255,255,.6);text-align:center;font-size:13px}.share-memo-image-dialog .view-preview-btn{width:100%;box-shadow:none;background-color:var(--background-secondary);border:1px solid var(--background-modifier-border);color:var(--text-normal);cursor:pointer;transition:all var(--transition-fast);border-radius:8px;justify-content:center;align-items:center;gap:8px;padding:10px 16px;font-size:13px;font-weight:500;display:flex}.share-memo-image-dialog .view-preview-btn:hover{background-color:var(--background-modifier-hover);border-color:var(--interactive-accent);color:var(--interactive-accent)}.share-memo-image-dialog .view-preview-btn svg{width:16px;height:16px}`;M(),yr(),H(),je(),li(),$r();var kS=({name:e,className:t})=>{let n=(0,U.useRef)(null);return(0,U.useEffect)(()=>{n.current&&(n.current.innerHTML=``,(0,f.setIcon)(n.current,e))},[e]),(0,W.jsx)(`span`,{ref:n,className:x_(`icon`,t)})},AS=[`linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)`,`linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%)`,`linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%)`,`linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%)`,`linear-gradient(to right, #4facfe 0%, #00f2fe 100%)`,`linear-gradient(to right, #fa709a 0%, #fee140 100%)`,`linear-gradient(to right, #6a11cb 0%, #2575fc 100%)`,`linear-gradient(to top, #30cfd0 0%, #330867 100%)`,`linear-gradient(to top, #a8edea 0%, #fed6e3 100%)`,`linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%)`,`linear-gradient(to top, #9890e3 0%, #b1f4cf 100%)`,`linear-gradient(to right, #ff9a9e 0%, #fecfef 99%, #fecfef 100%)`,`linear-gradient(to right, #43e97b 0%, #38f9d7 100%)`],jS=[{name:`点阵`,value:`radial-gradient(#cbd5e1 1px, transparent 1px)`,size:`20px 20px`,bg:`#f8fafc`},{name:`网格`,value:`linear-gradient(#e2e8f0 1px, transparent 1px), linear-gradient(90deg, #e2e8f0 1px, transparent 1px)`,size:`20px 20px`,bg:`#ffffff`},{name:`斜线`,value:`repeating-linear-gradient(45deg, transparent, transparent 10px, #e2e8f0 10px, #e2e8f0 11px)`,size:`20px 20px`,bg:`#ffffff`},{name:`交叉`,value:`repeating-linear-gradient(45deg, #e2e8f0 0, #e2e8f0 1px, transparent 0, transparent 50%), repeating-linear-gradient(135deg, #e2e8f0 0, #e2e8f0 1px, transparent 0, transparent 50%)`,size:`16px 16px`,bg:`#ffffff`},{name:`波点`,value:`radial-gradient(circle, #d1d5db 2px, transparent 2px)`,size:`24px 24px`,bg:`#fafafa`},{name:`菱形`,value:`linear-gradient(135deg, #e5e7eb 25%, transparent 25%), linear-gradient(225deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(315deg, #e5e7eb 25%, transparent 25%)`,size:`20px 20px`,bg:`#ffffff`},{name:`纸张`,value:`linear-gradient(#f1f5f9 1px, transparent 1px)`,size:`100% 28px`,bg:`#fffef0`},{name:`蓝格`,value:`linear-gradient(#dbeafe 1px, transparent 1px), linear-gradient(90deg, #dbeafe 1px, transparent 1px)`,size:`20px 20px`,bg:`#ffffff`}],MS={modern:{name:j(`Simple`),bgType:`gradient`,bgValue:AS[0],bgColor:`#ffffff`,fontColor:`#334155`,fontFamily:`sans-serif`,borderRadius:`16px`,shadow:`0 20px 25px -5px rgb(0 0 0 / 0.1)`,padding:40,cardBgColor:`rgba(255, 255, 255, 0.9)`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},vintage:{name:j(`Old`),bgType:`color`,bgValue:`#e6dccd`,bgColor:`#e6dccd`,fontColor:`#5c4033`,fontFamily:`"Kaiti SC", "STKaiti", "KaiTi", serif`,borderRadius:`2px`,shadow:`0 10px 15px -3px rgb(0 0 0 / 0.1)`,padding:50,cardBgColor:`#fffbf0`,textAlign:`center`,showAvatar:!1,showAuthor:!0,footerMode:`pattern`},cyber:{name:j(`Dark`),bgType:`color`,bgValue:`#0f172a`,bgColor:`#0f172a`,fontColor:`#4ade80`,fontFamily:`monospace`,borderRadius:`8px`,shadow:`none`,padding:32,cardBgColor:`#1e293b`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`heatmap`},outline:{name:j(`Border`),bgType:`pattern`,bgValue:jS[1].value,bgColor:`#ffffff`,fontColor:`#000000`,fontFamily:`sans-serif`,borderRadius:`0px`,shadow:`none`,padding:40,cardBgColor:`#ffffff`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},"classic-gradient":{name:j(`Classic`),bgType:`gradient`,bgValue:AS[4],bgColor:`#ffffff`,fontColor:`#1e293b`,fontFamily:`sans-serif`,borderRadius:`16px`,shadow:`0 20px 25px -5px rgb(0 0 0 / 0.1)`,padding:40,cardBgColor:`rgba(255, 255, 255, 0.95)`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`heatmap`},nordic:{name:j(`Nordic`),bgType:`color`,bgValue:`#F1F5F9`,bgColor:`#F1F5F9`,fontColor:`#334155`,fontFamily:`sans-serif`,borderRadius:`12px`,shadow:`0 4px 6px -1px rgb(0 0 0 / 0.05)`,padding:48,cardBgColor:`#ffffff`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},japanese:{name:j(`Nihon`),bgType:`color`,bgValue:`#E6E4E0`,bgColor:`#E6E4E0`,fontColor:`#2c2c2c`,fontFamily:`"Hiragino Mincho ProN", "Yu Mincho", "SimSun", serif`,borderRadius:`2px`,shadow:`0 1px 3px rgb(0 0 0 / 0.1)`,padding:48,cardBgColor:`#FDFBF7`,textAlign:`left`,showAvatar:!1,showAuthor:!0,footerMode:`pattern`},social:{name:j(`INS Style`),bgType:`gradient`,bgValue:AS[8],bgColor:`#FFF1EB`,fontColor:`#1e293b`,fontFamily:`sans-serif`,borderRadius:`24px`,shadow:`0 25px 50px -12px rgb(0 0 0 / 0.15)`,padding:36,cardBgColor:`#ffffff`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},magazine:{name:j(`Magazine`),bgType:`color`,bgValue:`#0F172A`,bgColor:`#0F172A`,fontColor:`#000000`,fontFamily:`"Times New Roman", "Georgia", serif`,borderRadius:`0px`,shadow:`0 20px 25px -5px rgb(255 255 255 / 0.1)`,padding:40,cardBgColor:`#ffffff`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`none`},handwritten:{name:j(`Handwritten`),bgType:`pattern`,bgValue:jS[1].value,bgColor:`#fefce8`,fontColor:`#4b5563`,fontFamily:`"Comic Sans MS", "Chalkboard SE", cursive`,borderRadius:`4px`,shadow:`2px 4px 12px rgba(0, 0, 0, 0.08)`,padding:40,cardBgColor:`#fffbeb`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},colorful:{name:j(`Colorful`),bgType:`gradient`,bgValue:AS[11],bgColor:`#ffffff`,fontColor:`#ffffff`,fontFamily:`sans-serif`,borderRadius:`20px`,shadow:`0 20px 25px -5px rgba(0, 0, 0, 0.2)`,padding:40,cardBgColor:`rgba(255, 255, 255, 0.2)`,textAlign:`center`,showAvatar:!0,showAuthor:!0,footerMode:`none`}},NS={styleVariant:`modern`,bgType:`gradient`,bgValue:AS[0],bgColor:`#ffffff`,bgSize:`20px 20px`,fontColor:`#334155`,fontFamily:`sans-serif`,fontSize:16,textAlign:`left`,borderRadius:`16px`,shadow:`0 20px 25px -5px rgb(0 0 0 / 0.1)`,padding:40,cardBgColor:`rgba(255, 255, 255, 0.9)`,showAvatar:!0,showAuthor:!0,footerMode:`simple`,footerText:`Created with Thino`,showLogo:!0,showOuterFrame:!1,outerPadding:40,outerBgType:`color`,outerBgValue:`#e5e5e5`},PS=(e,t)=>{let n=window.atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return new Blob([r],{type:t})},FS=async e=>{let t=e.querySelector(`.avatar`);if(!(t&&!/(http|app|base64)/.test(t?.style?.backgroundImage))&&t&&t?.style?.backgroundImage){let e=await Wx(t);t.style.backgroundImage=`url("${e}")`}},IS=async e=>{let t=e.querySelectorAll(`img`);for(let e of t)e.src.startsWith(`http://localhost`)?e.src=await Hx(e.getAttribute(`path`)||(0,f.normalizePath)(e?.parentElement?.getAttribute(`src`)||``)):e.src=await Gx(e)},LS=e=>{let t=new Date,n=[];for(let r=13;r>=0;r--){let i=new Date(t);i.setDate(i.getDate()-r);let a=i.toISOString().split(`T`)[0],o=e.filter(e=>new Date(e.createdAt).toISOString().split(`T`)[0]===a).length;n.push({date:a,count:o})}return n},RS=({memos:e,color:t})=>(0,W.jsx)(`div`,{className:`heatmap-display`,children:(0,U.useMemo)(()=>LS(e),[e]).map((e,n)=>(0,W.jsx)(`div`,{className:x_(`heatmap-cell`,`level-${e.count>4?4:e.count}`),style:{backgroundColor:t},title:`${e.date}: ${e.count} memos`},n))}),zS=({color:e})=>(0,W.jsxs)(`div`,{className:`texture-decoration`,style:{color:e},children:[(0,W.jsx)(`div`,{className:`line`}),(0,W.jsx)(`div`,{className:`diamond`}),(0,W.jsx)(`div`,{className:`line`})]}),BS=U.forwardRef(({memo:e,config:t,app:n,view:r,settings:i,memos:a,onImageGenerated:o,onPreviewClick:s},c)=>{let[l,u]=(0,U.useState)(``),[d,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),[g,_]=(0,U.useState)(null),v=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=new f.Component;return e.load(),_(e),()=>{e.unload()}},[]);let y=(0,U.useMemo)(()=>i?.MomentsIcon?i.MomentsIcon.startsWith(`http`)||i.MomentsIcon.startsWith(`data:`)?`url("${i.MomentsIcon}")`:`url("${n.vault.adapter.getResourcePath((0,f.normalizePath)(i.MomentsIcon))}")`:``,[i?.MomentsIcon,n]),b=(0,U.useCallback)(()=>{h(!0)},[]);(0,U.useEffect)(()=>{!m||!v.current||!g||(v.current.innerHTML=``,(async()=>{v.current?.classList.add(`markdown-rendered`,`markdown-preview-view`),await f.MarkdownRenderer.render(n,e.content+`
- `,v.current,e.path,g)})())},[m,e.content,n,g]);let x=(0,U.useCallback)(async()=>{let e=c?.current;e&&(await FS(e),await IS(e),setTimeout(()=>{ES(e,{pixelRatio:window.devicePixelRatio*2}).then(e=>{u(e),p(!0),o(e)}).catch(e=>{console.error(`Generate image failed:`,e)})},300))},[c,o]);(0,U.useEffect)(()=>{d&&(p(!1),u(``),setTimeout(x,200))},[t]),(0,U.useEffect)(()=>{d||setTimeout(x,200)},[]);let S=(0,U.useMemo)(()=>t.bgType===`color`?{backgroundColor:t.bgValue}:t.bgType===`gradient`?{background:t.bgValue}:t.bgType===`pattern`?{backgroundColor:t.bgColor,backgroundImage:t.bgValue,backgroundSize:t.bgSize||`20px 20px`,backgroundRepeat:`repeat`}:t.bgType===`image`?{backgroundImage:t.bgValue,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`}:{},[t.bgType,t.bgValue,t.bgColor,t.bgSize]),C=(0,U.useMemo)(()=>({"--card-bg":t.cardBgColor,"--card-text":t.fontColor,"--card-font":t.fontFamily,"--card-font-size":`${t.fontSize}px`,"--card-radius":t.borderRadius,"--card-shadow":t.shadow,"--card-padding":`${t.padding}px`}),[t]),w=(0,U.useMemo)(()=>{if(!t.showOuterFrame)return{};let e={padding:`${t.outerPadding}px`,display:`flex`,alignItems:`center`,justifyContent:`center`,width:`fit-content`};return t.outerBgType===`color`?e.backgroundColor=t.outerBgValue:t.outerBgType===`gradient`&&(e.background=t.outerBgValue),e},[t.showOuterFrame,t.outerBgType,t.outerBgValue,t.outerPadding]);return(0,W.jsxs)(`div`,{className:`memo-share-card-wrapper`,children:[l&&(0,W.jsx)(`img`,{className:`memo-shortcut-img`,src:l,alt:`Preview`,onClick:()=>s?.(l)}),(0,W.jsx)(DS,{styles:OS,onReady:b,children:(0,W.jsx)(`div`,{ref:c,className:x_(`share-outer-container`,t.showOuterFrame&&`has-frame`),style:t.showOuterFrame?w:void 0,children:(0,W.jsxs)(`div`,{className:`memo-share-card`,"data-theme":t.styleVariant,style:C,children:[(0,W.jsx)(`div`,{className:`card-bg-layer`,children:(0,W.jsx)(`div`,{className:`bg-image`,style:S})}),(0,W.jsxs)(`div`,{className:`card-content-layer`,style:{textAlign:t.textAlign},children:[t.styleVariant===`vintage`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`ancient-corner top-left`}),(0,W.jsx)(`div`,{className:`ancient-corner top-right`}),(0,W.jsx)(`div`,{className:`ancient-corner bottom-left`}),(0,W.jsx)(`div`,{className:`ancient-corner bottom-right`}),(0,W.jsx)(`div`,{className:`inner-border`})]}),t.styleVariant===`cyber`&&(0,W.jsxs)(`div`,{className:`cyber-dots`,children:[(0,W.jsx)(`div`,{className:`dot`}),(0,W.jsx)(`div`,{className:`dot`}),(0,W.jsx)(`div`,{className:`dot`})]}),t.styleVariant===`nordic`&&(0,W.jsx)(`div`,{className:`nordic-dot`}),t.styleVariant===`japanese`&&(0,W.jsxs)(`div`,{className:`japanese-decor`,children:[(0,W.jsx)(`div`,{className:`stamp`}),(0,W.jsx)(`div`,{className:`vertical-line`})]}),t.styleVariant===`handwritten`&&(0,W.jsx)(`div`,{className:`tape-decoration`}),t.styleVariant===`magazine`&&(0,W.jsxs)(`div`,{className:`magazine-decor`,children:[(0,W.jsx)(`div`,{className:`top-bar`}),(0,W.jsx)(`div`,{className:`bottom-bar`}),(0,W.jsx)(`div`,{className:`side-text`,children:`ISSUE 01`})]}),(t.showAvatar||t.showAuthor)&&(0,W.jsxs)(`div`,{className:x_(`card-header`,t.textAlign===`center`&&`center`),children:[t.showAvatar&&(0,W.jsx)(`div`,{className:`avatar`,style:{backgroundImage:y},ref:e=>{e&&!y&&(0,f.setIcon)(e,`user`)}}),t.showAuthor&&(0,W.jsxs)(`div`,{className:`user-meta`,children:[(0,W.jsx)(`div`,{className:`from-label`,children:`From`}),(0,W.jsx)(`div`,{className:`username`,children:i?.UserName||`Thino User`})]})]}),(0,W.jsx)(`div`,{className:`card-body`,ref:v}),(0,W.jsx)(`div`,{className:`card-timestamp`,children:e.createdAtStr}),(0,W.jsxs)(`div`,{className:`card-footer`,children:[(0,W.jsxs)(`div`,{className:`footer-left`,children:[t.footerMode===`heatmap`&&(0,W.jsx)(RS,{memos:a,color:t.fontColor}),t.footerMode===`pattern`&&(0,W.jsx)(zS,{color:t.fontColor}),t.footerMode===`simple`&&t.footerText&&(0,W.jsx)(`span`,{className:`footer-text`,children:t.footerText})]}),t.showLogo&&(0,W.jsx)(`div`,{className:`footer-right`,children:t.styleVariant===`cyber`?(0,W.jsx)(`div`,{className:`footer-logo`,children:(0,W.jsx)(`div`,{className:`qr-placeholder`,children:(0,W.jsx)(kS,{name:`qr-code`})})}):(0,W.jsx)(`span`,{children:`THINO`})})]})]})]})})})]})});BS.displayName=`SharePreviewCard`;var VS=({config:e,onChange:t,onClose:n,onExport:r,isExporting:i,exportMessage:a,isMobile:o,onPreview:s,onViewFullPreview:c,hasPreviewImage:l})=>{let u=(0,U.useRef)(null),d=(0,U.useRef)(null);(0,U.useEffect)(()=>{u.current&&(0,f.setIcon)(u.current,`x`)},[]);let p=(0,U.useCallback)((n,r)=>{t({...e,[n]:r})},[e,t]),m=(0,U.useCallback)(n=>{let r=Object.keys(MS),i=r.indexOf(e.styleVariant),a=n===`next`?i+1:i-1;a>=r.length&&(a=0),a<0&&(a=r.length-1);let o=r[a],s=MS[o];t({...e,styleVariant:o,...s})},[e,t]),h=(0,U.useCallback)(n=>{let r=MS[n];t({...e,styleVariant:n,...r})},[e,t]);return(0,W.jsxs)(`div`,{className:`share-config-panel`,children:[(0,W.jsxs)(`div`,{className:`panel-header`,children:[(0,W.jsxs)(`h3`,{className:`panel-title`,children:[(0,W.jsx)(kS,{name:`layout-grid`}),j(`Share Memo Image`)]}),(0,W.jsx)(`div`,{ref:u,className:`close-btn`,onClick:n})]}),(0,W.jsxs)(`div`,{className:`panel-content custom-scrollbar`,children:[o&&(0,W.jsxs)(`div`,{className:`config-section mobile-theme-switcher`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(kS,{name:`sun`}),j(`Quick Theme`)]}),(0,W.jsxs)(`div`,{className:`theme-nav`,children:[(0,W.jsxs)(`button`,{className:`nav-btn`,onClick:()=>m(`prev`),children:[(0,W.jsx)(kS,{name:`chevron-left`}),j(`Previous`)]}),(0,W.jsxs)(`button`,{className:`nav-btn`,onClick:()=>m(`next`),children:[j(`Next`),(0,W.jsx)(kS,{name:`chevron-right`})]})]}),(0,W.jsxs)(`div`,{className:`current-theme`,children:[j(`Current`),`: `,MS[e.styleVariant].name]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(kS,{name:`palette`}),j(`Theme Style`)]}),(0,W.jsx)(`div`,{className:`config-tabs theme-presets`,children:Object.keys(MS).map(t=>(0,W.jsx)(`button`,{className:x_(`tab-btn`,e.styleVariant===t&&`active`),onClick:()=>h(t),children:MS[t].name},t))})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(kS,{name:`image`}),j(`Background`)]}),(0,W.jsx)(`div`,{className:`config-tabs`,children:[`color`,`gradient`,`pattern`,`image`].map(t=>(0,W.jsx)(`button`,{className:x_(`tab-btn`,e.bgType===t&&`active`),onClick:()=>p(`bgType`,t),children:{color:j(`Solid`),gradient:j(`Gradient`),pattern:j(`Pattern`),image:j(`Image`)}[t]},t))}),(0,W.jsxs)(`div`,{className:`gradient-picker-grid`,style:{marginTop:`12px`},children:[e.bgType===`gradient`&&AS.map((t,n)=>(0,W.jsx)(`div`,{className:x_(`color-option`,e.bgValue===t&&`active`),style:{background:t},onClick:()=>p(`bgValue`,t)},n)),e.bgType===`pattern`&&jS.map((n,r)=>(0,W.jsx)(`div`,{className:x_(`color-option`,e.bgValue===n.value&&`active`),style:{backgroundColor:n.bg,backgroundImage:n.value,backgroundSize:n.size},onClick:()=>{t({...e,bgValue:n.value,bgColor:n.bg,bgSize:n.size})}},r)),e.bgType===`color`&&(0,W.jsxs)(`div`,{className:`config-color-picker`,style:{gridColumn:`1 / -1`},children:[(0,W.jsx)(`span`,{className:`color-label`,children:j(`Background Color`)}),(0,W.jsx)(`input`,{type:`color`,value:e.bgValue.startsWith(`#`)?e.bgValue:`#ffffff`,onChange:e=>{p(`bgValue`,e.target.value),p(`bgColor`,e.target.value)}})]}),e.bgType===`image`&&(0,W.jsxs)(`div`,{className:`color-option upload-btn`,style:{gridColumn:`1 / -1`,aspectRatio:`auto`,padding:`16px`},onClick:()=>d.current?.click(),children:[`+ `,j(`Upload Image`)]})]}),(0,W.jsx)(`input`,{ref:d,type:`file`,accept:`image/*`,hidden:!0,onChange:n=>{let r=n.target.files?.[0];if(!r)return;if(r.size>5*1024*1024){new f.Notice(j(`Image file cannot exceed 5MB`));return}let i=new FileReader;i.onload=n=>{let r=n.target?.result;t({...e,bgType:`image`,bgValue:`url("${r}")`})},i.onerror=()=>{new f.Notice(j(`Image read failed, please try again`))},i.readAsDataURL(r),n.target.value=``}})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(kS,{name:`type`}),j(`Typography`)]}),(0,W.jsxs)(`div`,{className:`config-slider`,children:[(0,W.jsxs)(`div`,{className:`slider-header`,children:[(0,W.jsx)(`span`,{className:`slider-label`,children:j(`Font Size`)}),(0,W.jsxs)(`span`,{className:`slider-value`,children:[e.fontSize,`px`]})]}),(0,W.jsx)(`input`,{type:`range`,min:`12`,max:`24`,value:e.fontSize,onChange:e=>p(`fontSize`,parseInt(e.target.value))})]}),(0,W.jsxs)(`div`,{className:`config-color-picker`,style:{marginTop:`12px`},children:[(0,W.jsx)(`span`,{className:`color-label`,children:j(`Text Color`)}),(0,W.jsx)(`input`,{type:`color`,value:e.fontColor,onChange:e=>p(`fontColor`,e.target.value)})]}),(0,W.jsxs)(`div`,{className:`config-button-group`,style:{marginTop:`12px`},children:[(0,W.jsx)(`button`,{className:x_(`group-btn`,e.textAlign===`left`&&`active`),onClick:()=>p(`textAlign`,`left`),children:j(`Left`)}),(0,W.jsx)(`button`,{className:x_(`group-btn`,e.textAlign===`center`&&`active`),onClick:()=>p(`textAlign`,`center`),children:j(`Center`)})]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(kS,{name:`panel-top`}),j(`Header`)]}),(0,W.jsxs)(`div`,{className:`config-toggle`,children:[(0,W.jsx)(`span`,{className:`toggle-label`,children:j(`Show Avatar`)}),(0,W.jsx)(`div`,{className:x_(`toggle-switch`,e.showAvatar&&`active`),onClick:()=>p(`showAvatar`,!e.showAvatar),children:(0,W.jsx)(`div`,{className:`thumb`})})]}),(0,W.jsxs)(`div`,{className:`config-toggle`,children:[(0,W.jsx)(`span`,{className:`toggle-label`,children:j(`Show Author`)}),(0,W.jsx)(`div`,{className:x_(`toggle-switch`,e.showAuthor&&`active`),onClick:()=>p(`showAuthor`,!e.showAuthor),children:(0,W.jsx)(`div`,{className:`thumb`})})]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(kS,{name:`panel-bottom`}),j(`Footer`)]}),(0,W.jsxs)(`div`,{className:`config-select`,children:[(0,W.jsx)(`label`,{className:`select-label`,children:j(`Footer Style`)}),(0,W.jsxs)(`select`,{value:e.footerMode,onChange:e=>p(`footerMode`,e.target.value),children:[(0,W.jsx)(`option`,{value:`simple`,children:j(`Simple Text`)}),(0,W.jsx)(`option`,{value:`heatmap`,children:j(`Activity Heatmap`)}),(0,W.jsx)(`option`,{value:`pattern`,children:j(`Decoration`)}),(0,W.jsx)(`option`,{value:`none`,children:j(`None`)})]})]}),e.footerMode!==`none`&&(0,W.jsxs)(`div`,{className:`config-input`,style:{marginTop:`12px`},children:[(0,W.jsx)(`label`,{className:`input-label`,children:j(`Footer Text`)}),(0,W.jsx)(`input`,{type:`text`,value:e.footerText,onChange:e=>p(`footerText`,e.target.value),placeholder:j(`Enter footer text...`)})]}),(0,W.jsxs)(`div`,{className:`config-toggle`,style:{marginTop:`12px`},children:[(0,W.jsx)(`span`,{className:`toggle-label`,children:j(`Show Logo`)}),(0,W.jsx)(`div`,{className:x_(`toggle-switch`,e.showLogo&&`active`),onClick:()=>p(`showLogo`,!e.showLogo),children:(0,W.jsx)(`div`,{className:`thumb`})})]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(kS,{name:`maximize`}),j(`Outer Frame`)]}),(0,W.jsxs)(`div`,{className:`config-toggle`,children:[(0,W.jsx)(`span`,{className:`toggle-label`,children:j(`Enable Frame`)}),(0,W.jsx)(`div`,{className:x_(`toggle-switch`,e.showOuterFrame&&`active`),onClick:()=>p(`showOuterFrame`,!e.showOuterFrame),children:(0,W.jsx)(`div`,{className:`thumb`})})]}),e.showOuterFrame&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`config-slider`,style:{marginTop:`12px`},children:[(0,W.jsxs)(`div`,{className:`slider-header`,children:[(0,W.jsx)(`span`,{className:`slider-label`,children:j(`Frame Padding`)}),(0,W.jsxs)(`span`,{className:`slider-value`,children:[e.outerPadding,`px`]})]}),(0,W.jsx)(`input`,{type:`range`,min:`0`,max:`100`,value:e.outerPadding,onChange:e=>p(`outerPadding`,parseInt(e.target.value))})]}),(0,W.jsx)(`div`,{className:`config-tabs`,style:{marginTop:`12px`},children:[`color`,`gradient`].map(t=>(0,W.jsx)(`button`,{className:x_(`tab-btn`,e.outerBgType===t&&`active`),onClick:()=>p(`outerBgType`,t),children:{color:j(`Solid`),gradient:j(`Gradient`)}[t]},t))}),e.outerBgType===`color`&&(0,W.jsxs)(`div`,{className:`config-color-picker`,style:{marginTop:`12px`},children:[(0,W.jsx)(`span`,{className:`color-label`,children:j(`Frame Color`)}),(0,W.jsx)(`input`,{type:`color`,value:e.outerBgValue.startsWith(`#`)?e.outerBgValue:`#e5e5e5`,onChange:e=>p(`outerBgValue`,e.target.value)})]}),e.outerBgType===`gradient`&&(0,W.jsx)(`div`,{className:`gradient-picker-grid`,style:{marginTop:`12px`},children:AS.map((t,n)=>(0,W.jsx)(`div`,{className:x_(`color-option`,e.outerBgValue===t&&`active`),style:{background:t},onClick:()=>p(`outerBgValue`,t)},n))})]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(kS,{name:`settings`}),j(`Fine-tuning`)]}),(0,W.jsxs)(`div`,{className:`config-fine-tuning`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`select-label`,style:{fontSize:`12px`,color:`var(--text-muted)`,marginBottom:`6px`,display:`block`},children:j(`Border Radius`)}),(0,W.jsx)(`div`,{className:`config-button-group`,children:[`0px`,`16px`,`32px`].map((t,n)=>(0,W.jsx)(`button`,{className:x_(`group-btn`,e.borderRadius===t&&`active`),onClick:()=>p(`borderRadius`,t),children:j(n===0?`Sharp`:n===1?`Round`:`Full`)},t))})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`select-label`,style:{fontSize:`12px`,color:`var(--text-muted)`,marginBottom:`6px`,display:`block`},children:j(`Shadow`)}),(0,W.jsx)(`div`,{className:`config-button-group`,children:[{value:`none`,label:j(`None`)},{value:`0 10px 15px -3px rgb(0 0 0 / 0.1)`,label:j(`Normal`)},{value:`0 20px 25px -5px rgb(0 0 0 / 0.2)`,label:j(`Strong`)}].map(t=>(0,W.jsx)(`button`,{className:x_(`group-btn`,e.shadow===t.value&&`active`),onClick:()=>p(`shadow`,t.value),children:t.label},t.value))})]})]})]})]}),!o&&(0,W.jsxs)(`div`,{className:`panel-footer`,children:[c&&l&&(0,W.jsxs)(`button`,{className:`view-preview-btn`,onClick:c,children:[(0,W.jsx)(kS,{name:`maximize-2`}),j(`View Preview`)]}),(0,W.jsxs)(`div`,{className:`action-buttons`,children:[(0,W.jsxs)(`button`,{className:`action-btn secondary`,disabled:i,onClick:()=>r(`copy`),children:[(0,W.jsx)(kS,{name:`copy`}),i?`...`:j(`Copy`)]}),(0,W.jsxs)(`button`,{className:`action-btn primary`,disabled:i,onClick:()=>r(`download`),children:[(0,W.jsx)(kS,{name:`download`}),j(i?`Processing...`:`Save Image`)]})]}),a&&(0,W.jsx)(`div`,{className:`export-message`,children:a})]}),o&&s&&(0,W.jsx)(`div`,{className:`mobile-preview-btn`,children:(0,W.jsxs)(`button`,{className:`preview-btn`,onClick:s,children:[(0,W.jsx)(kS,{name:`eye`}),j(`Generate Preview`)]})})]})},HS=e=>{let{memo:t,destroy:n,view:r}=e,{memos:i}=vr.getState().memoState,{app:a,settings:o}=vr.getState().dailyNotesState,s=(0,U.useMemo)(()=>({...t,createdAtStr:N.getDateTimeString(t.createdAt)}),[t]),[c,l]=(0,U.useState)(()=>{let e=(a||window.app).loadLocalStorage(`memoShareConfigV2`);if(e)try{return{...NS,...JSON.parse(e)}}catch{return NS}return NS}),[u,d]=(0,U.useState)(`edit`),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(``),[_,v]=(0,U.useState)(``),[y,b]=(0,U.useState)(!1),x=(0,U.useRef)(null),S=f.Platform.isMobile,C=(0,U.useCallback)(e=>{e&&b(!0)},[]);(0,U.useEffect)(()=>{(a||window.app).saveLocalStorage(`memoShareConfigV2`,JSON.stringify(c))},[c,a]);let w=(0,U.useCallback)(e=>{v(e)},[]),T=(0,U.useCallback)(async e=>{if(!_){new f.Notice(j(`Image is generating...`));return}m(!0),g(j(`Processing...`));try{let t=_.split(`base64,`)[1],n=PS(t,`image/png`);if(e===`download`){let e=await n.arrayBuffer(),{vault:t}=a,r=ge(),i;for(let e in r)if(r[e]instanceof f.TFile){i=r[e];break}if(i){let n=await t.getAvailablePathForAttachments(`Thino_Share_${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,`png`,i);await t.createBinary(n,e),g(j(`Saved`)),new f.Notice(j(`Save image successfully`))}}else if(e===`copy`){let e=new ClipboardItem({"image/png":n});await navigator.clipboard.write([e]),g(j(`Copied`)),new f.Notice(j(`Copy to clipboard successfully`))}}catch(t){console.error(`Export failed:`,t),g(j(`Failed`)),new f.Notice(j(e===`copy`?`Copy to clipboard failed`:`Save image failed`))}setTimeout(()=>{m(!1),g(``)},2e3)},[_,a]),E=(0,U.useCallback)(e=>{let t=Object.keys(MS),n=t.indexOf(c.styleVariant),r=e===`next`?n+1:n-1;r>=t.length&&(r=0),r<0&&(r=t.length-1);let i=t[r],a=MS[i];l(e=>({...e,styleVariant:i,...a}))},[c.styleVariant]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`dialog-header-container`,style:{display:`none`}}),y&&_&&(0,W.jsx)(`div`,{className:`fullscreen-preview-overlay`,onClick:()=>b(!1),children:(0,W.jsxs)(`div`,{className:`fullscreen-preview-content`,children:[(0,W.jsx)(`img`,{src:_,alt:`Preview`}),(0,W.jsx)(`div`,{className:`fullscreen-preview-hint`,children:j(`Click anywhere to close`)})]})}),(0,W.jsxs)(`div`,{className:x_(`dialog-content-container`),"data-step":u,children:[(0,W.jsxs)(`div`,{className:`share-preview-area`,children:[S&&u===`preview`&&(0,W.jsxs)(`div`,{className:`mobile-back-btn`,onClick:()=>d(`edit`),children:[(0,W.jsx)(kS,{name:`arrow-left`}),j(`Back`)]}),(0,W.jsx)(`div`,{className:`style-indicator`,children:MS[c.styleVariant].name}),!S&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:`preview-nav-btn prev`,onClick:()=>E(`prev`),children:(0,W.jsx)(kS,{name:`chevron-left`})}),(0,W.jsx)(`button`,{className:`preview-nav-btn next`,onClick:()=>E(`next`),children:(0,W.jsx)(kS,{name:`chevron-right`})})]}),(0,W.jsx)(BS,{ref:x,memo:s,config:c,app:a,view:r,settings:o,memos:i,onImageGenerated:w,onPreviewClick:C}),S&&u===`preview`&&(0,W.jsxs)(`div`,{className:`mobile-action-bar`,children:[(0,W.jsxs)(`button`,{className:`action-btn secondary`,disabled:p,onClick:()=>T(`copy`),children:[(0,W.jsx)(kS,{name:`copy`}),p?`...`:j(`Copy`)]}),(0,W.jsxs)(`button`,{className:`action-btn primary`,disabled:p,onClick:()=>T(`download`),children:[(0,W.jsx)(kS,{name:`download`}),j(p?`Processing...`:`Save`)]})]})]}),(0,W.jsx)(VS,{config:c,onChange:l,onClose:n,onExport:T,isExporting:p,exportMessage:h,isMobile:S,onPreview:S?()=>d(`preview`):void 0,onViewFullPreview:()=>b(!0),hasPreviewImage:!!_})]})]})};function US(e,t,n){f_({className:`share-memo-image-dialog`},HS,{memo:e,style:t,view:n})}li(),yr(),M();var WS=async e=>{e.startsWith(`http`)&&(e=await Hx(e));let t=e.split(`base64,`)[1];await KS(ci(t,`image/png`)),new f.Notice(j(`Send to clipboard successfully`))},GS=async(e,t)=>{let n=await e.vault.adapter.exists(t),r=``;if(n)r=t;else{let n=e.metadataCache.getFirstLinkpathDest(t,``);if(!n){new f.Notice(j(`File not exist`));return}r=n.path}let i=await e.vault.adapter.readBinary(r),a=new Uint8Array(i);await KS(new Blob([a],{type:`image/png`}))},KS=async e=>{let t=new ClipboardItem({"image/png":e});await window.navigator.clipboard.write([t])},qS=1.1,JS=300,YS=20,XS=({destroy:e,imgUrl:t,filepath:n,otherIMGEls:r,currentIndex:i})=>{let a=vr.getState().dailyNotesState.settings.ZoomImageWhenViewing,o=(0,U.useRef)(null),[s,c]=(0,U.useState)(-1),l=vr.getState().dailyNotesState.app,[u,d]=(0,U.useState)(i),[p,m]=(0,U.useState)(t),[h,g]=(0,U.useState)(!1),_={close:(0,U.useRef)(null),previous:(0,U.useRef)(null),next:(0,U.useRef)(null),decrease:(0,U.useRef)(null),increase:(0,U.useRef)(null),zoom:(0,U.useRef)(null),copy:(0,U.useRef)(null)};(0,U.useEffect)(()=>{!n&&!t||((0,f.setIcon)(_.close.current,`x`),_.previous.current&&(0,f.setIcon)(_.previous.current,`arrow-left`),_.next.current&&(0,f.setIcon)(_.next.current,`arrow-right`),(0,f.setIcon)(_.decrease.current,`zoom-out`),(0,f.setIcon)(_.increase.current,`zoom-in`),(0,f.setIcon)(_.zoom.current,`circle`),(0,f.setIcon)(_.copy.current,`clipboard`))},[_]),(0,U.useEffect)(()=>{N.getImageSize(p).then(({width:e})=>{e===0?c(0):(c(40),a&&!h&&(c(80),g(!0)))})},[p,a,h]);let v=()=>{let e=u-1;e<0&&(e=r.length-1),d(e),m(r[e].src)},y=()=>{let e=u+1;e>=r.length&&(e=0),d(e),m(r[e].src)},b=()=>{e()};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{ref:_.close,className:`btn close-btn`,onClick:b}),(0,W.jsxs)(`div`,{className:`img-container internal-embed image-embed is-loaded`,onClick:e=>{e.target!==o.current&&e.target===o.current.parentElement&&b()},onWheel:e=>{if(e.ctrlKey){e.preventDefault();let t=o.current,n=e.nativeEvent.offsetX,r=e.nativeEvent.offsetY,i=n/t.clientWidth,a=r/t.clientHeight,l;l=e.deltaY>0?s/qS:s*qS,l>JS?l=JS:l<YS&&(l=YS);let u=s;c(l);let d=e.currentTarget;d.scrollLeft+=(l-u)*i,d.scrollTop+=(l-u)*a}else e.deltaX!==0&&(e.currentTarget.scrollLeft+=e.deltaX)},children:[(0,W.jsx)(`img`,{className:s<=0?`thino-hidden`:``,ref:o,height:s+`%`,src:p}),(0,W.jsx)(`span`,{className:`loading-text `+(s===-1?``:`thino-hidden`),children:j(`Image is loading...`)}),(0,W.jsx)(`span`,{className:`loading-text `+(s===0?``:`thino-hidden`),children:j(`😟 Cannot load image, image link maybe broken`)})]}),(0,W.jsxs)(`div`,{className:`action-btns-container`,children:[r&&r?.length>1&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{ref:_.previous,className:`btn`,onClick:v}),(0,W.jsx)(`button`,{ref:_.next,className:`btn`,onClick:y})]}),(0,W.jsx)(`button`,{ref:_.decrease,className:`btn`,onClick:()=>{s>30&&c(s-10)}}),(0,W.jsx)(`button`,{ref:_.increase,className:`btn`,onClick:()=>{c(s+10)}}),(0,W.jsx)(`button`,{ref:_.zoom,className:`btn`,onClick:()=>c(80)}),(0,W.jsx)(`button`,{ref:_.copy,className:`btn`,onClick:async()=>{if(p&&!n)await WS(t);else if(n){let e=r[u].parentElement.getAttribute(`src`);if(!e){await WS(p);return}await GS(l,e)}}})]})]})};function ZS({imgUrl:e,filepath:t,otherIMGEls:n,currentIndex:r}){f_({className:`preview-image-dialog`},XS,{imgUrl:e,otherIMGEls:n,currentIndex:r,filepath:t})}function QS({mouseEnterDelayMS:e=0,mouseLeaveDelayMS:t=0}={}){let[n,r]=(0,U.useState)(!1),i,a;return[n,{onMouseEnter:()=>{clearTimeout(a),i=window.setTimeout(()=>r(!0),e)},onMouseLeave:()=>{clearTimeout(i),a=window.setTimeout(()=>r(!1),t)}}]}H(),li();var $S=e=>{let t=[];return e.map(e=>{t.length==0?t.push({date:(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`YYYY-MM-DD`),have:[e]}):t.some(t=>{if(t.date==(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`YYYY-MM-DD`))return t.have.push(e),!0})||t.push({date:(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`YYYY-MM-DD`),have:[e]})}),t},eC=e=>V.getState().commentMemos.filter(t=>t.linkId===e.hasId).sort((e,t)=>N.getTimeStampByDate(e.createdAt)-N.getTimeStampByDate(t.createdAt)).map(e=>({...e,createdAtStr:N.getDateTimeString(e.createdAt),dateStr:N.getDateString(e.createdAt)})),tC=e=>{let t=L.getState().settings,n=ni(),r=t?.ShowDate?` `:``,i=/comment:(.*)$/g,a=/^\d{14}/g,o=(e,t,n)=>{let r=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`HH:mm`);return n?n.replace(/{TIME}/g,r).replace(/{CONTENT}/g,t):`${r} ${t}`},s=e=>{let t=e.match(/TASK-(.*)?/g);return t?t[1]:``},c=e=>e===`TASK-TODO`?`- [ ] `:e===`TASK-DONE`?`- [x] `:e.match(/TASK-(.*)?/g)?`- [${s(e)}] `:`- `,l=e=>e.reduce((e,s)=>{let l=s.sourceType===`MULTI`?`[[${s.path}]]`:`${s.content}`,u=t?.ShowTime?o(s,l,t?.DefaultMemoComposition):l,d=`${c(s.thinoType)}${u}`,p=``;return t.CommentOnMemos&&s.hasId!==void 0&&s.hasId!==``&&(p=eC(s).reduce((e,o)=>{let s=c(o.thinoType),l=o.content.replace(i,``).replace(a,``),u=t?.ShowDate?`${s}[[${(0,f.moment)(o.createdAt).format(n)}]] ${(0,f.moment)(o.createdAt).format(`HH:mm`)} ${l}`:`${s}${l}`;return e+r+` `+u+`
- `},``)),e+r+d.replace(/ \^\S{6}/g,``)+`
- `+p},``);return e.reduce((e,r)=>{let i=t?.ShowDate?`- [[${(0,f.moment)(r.date,`YYYY-MM-DD`).format(n)}]]\n`:``,a=l(r.have),o=t?.ShowDate&&t?.AddBlankLineWhenDate&&!t?.CommentOnMemos?`
- `:``;return e+i+a+o},``).replace(/<br>/g,`
- `)};$r(),M(),H();var nC=e=>{let t=new Set;return e.forEach(e=>{let n=new RegExp(Br).exec(e.content),r=new RegExp(Hr).exec(e.content);if(n)for(let e=1;e<n.length;e++)t.add(n[e]);if(r)for(let e=1;e<r.length;e++)t.add(r[e])}),Array.from(t)},rC=class extends f.Modal{root;cb;tags=[];constructor(e,t){super(e),this.cb=t}onOpen(){super.onOpen(),this.containerEl.toggleClass([`thino-bulk-action-dialog`,`tag-actions`],!0),this.root=u_.createRoot(this.contentEl),this.root.render((0,W.jsx)(iC,{closeDialog:this.closeDialog.bind(this)}))}closeDialog(e){this.tags=e,this.close()}onClose(){this.cb(this.tags),console.log(this.tags),super.onClose(),this.root?.unmount()}},iC=({closeDialog:e})=>{let[t,n]=U.useState([]),r=U.useRef(null),i=U.useRef(null);(0,U.useEffect)(()=>{if(i.current){if(r.current){r.current.updateCb(a);return}r.current=new ox(i.current,a)}},[i.current,t]);let a=e=>{if(!e)return;let i=new Set(t);i.add(e),console.log(i),n(Array.from(i)),r.current.clearInput()};return(0,W.jsxs)(`div`,{className:`thino-tag-operation`,children:[(0,W.jsx)(`div`,{className:`tag-operation-title`,children:j(`Tag Bulk Select`)}),(0,W.jsxs)(`div`,{className:`tag-operation-content`,children:[(0,W.jsxs)(`div`,{className:`tag-operation-content-title selected-tags`,children:[(0,W.jsx)(`div`,{className:`name`,children:j(`Selected Tags`)}),(0,W.jsx)(`div`,{className:`desc`,children:j(`Click to remove selected tag`)})]}),(0,W.jsx)(`div`,{className:`tag-operation-content-tags selected-tags`,children:t.map(e=>(0,W.jsx)(`div`,{className:`tag-operation-content-tag`,onClick:()=>{n(t.filter(t=>t!==e))},children:e},e))}),(0,W.jsx)(`div`,{className:`tag-operation-content-inputer`,children:(0,W.jsx)(`input`,{placeholder:j(`Input to select exist tag`),ref:i,onKeyDown:e=>{e.key===`Enter`&&a(i.current.value)}})}),(0,W.jsxs)(`div`,{className:`tag-operation-content-btn-group`,children:[(0,W.jsx)(`button`,{className:`cancel-btn`,onClick:()=>{e([])},children:j(`Cancel`)}),(0,W.jsx)(`button`,{className:`save-btn`,onClick:()=>{e(t)},children:j(`Save`)})]})]})]})},aC=({app:e,thinos:t,closeDialog:n})=>{let[r,i]=U.useState([]),[a,o]=U.useState([]),[s,c]=U.useState([]),l=U.useRef(null),u=U.useRef(null),d=U.useRef(null),p=U.useRef(`End`),m=U.useRef(!1),h=U.useRef(null);(0,U.useEffect)(()=>{t&&t.length&&i(nC(t))},[t]),(0,U.useEffect)(()=>{!d.current||!u.current||(new f.Setting(u.current).setName(j(`Add tag position`)).addDropdown(e=>{e.addOption(`End`,j(`End`)),e.addOption(`Beginning`,j(`Beginning`)),e.setValue(`End`).onChange(async e=>{p.current=e})}),new f.Setting(d.current).setName(j(`Add tag with new line`)).addToggle(e=>{e.setValue(!1).onChange(async e=>{m.current=e})}))},[]);let g=e=>{if(!e)return;let t=new Set(a);t.add(e),o(Array.from(t)),l.current.clearInput()};(0,U.useEffect)(()=>{if(h.current){if(l.current){l.current.updateCb(g);return}l.current=new ox(h.current,g)}},[h.current,a]);let _=()=>{n(),v({remove:s,add:a,targetThinos:t})},v=async({remove:e,add:t,targetThinos:n})=>{let r=m.current||!1,i=[];for(let a of n){let n=a.content;for(let t of e)n=n.replace(RegExp(`#${t}`,`g`),``);if(n=n.trim(),t.length>0&&(n=p.current===`Beginning`?`${t.map(e=>`#${e}`).join(` `)} ${r?`
- `:``}${n}`:`${n} ${r?`
- `:``}${t.map(e=>`#${e}`).join(` `)}`),a&&a.content!==n){let e=await V.updateMemo(a.id,n?.trim());i.push(e)}}i.length>0&&V.editMemoBulk(i),i.length>0&&z.clearQuery()};return(0,W.jsxs)(`div`,{className:`thino-tag-operation`,children:[(0,W.jsx)(`div`,{className:`tag-operation-title`,children:j(`Tag Bulk Edit`)}),(0,W.jsxs)(`div`,{className:`tag-operation-content`,children:[r.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`tag-operation-content-title exist-tags`,children:[(0,W.jsx)(`div`,{className:`name`,children:j(`Exist Tags`)}),(0,W.jsx)(`div`,{className:`desc`,children:j(`Click to remove exist tag`)})]}),(0,W.jsx)(`div`,{className:`tag-operation-content-tags exist-tags`,children:r.map(e=>(0,W.jsx)(`div`,{className:x_(`tag-operation-content-tag`,s.includes(e)&&`tag-operation-content-tag-removed`),onClick:()=>{s.includes(e)||c([...s,e]),s.includes(e)&&c(s.filter(t=>t!==e)),a.includes(e)&&o(a.filter(t=>t!==e))},children:e},e))})]}),(0,W.jsxs)(`div`,{className:`tag-operation-content-title selected-tags`,children:[(0,W.jsx)(`div`,{className:`name`,children:j(`Selected Tags`)}),(0,W.jsx)(`div`,{className:`desc`,children:j(`Click to remove selected tag`)})]}),(0,W.jsx)(`div`,{className:`tag-operation-content-tags selected-tags`,children:a.map(e=>(0,W.jsx)(`div`,{className:`tag-operation-content-tag`,onClick:()=>{o(a.filter(t=>t!==e))},children:e},e))}),(0,W.jsx)(`div`,{className:`tag-operation-content-inputer`,children:(0,W.jsx)(`input`,{placeholder:j(`Input to select exist tag`),ref:h,onKeyDown:e=>{e.key===`Enter`&&g(h.current.value)}})}),(0,W.jsxs)(`div`,{className:`tag-operation-settings`,children:[(0,W.jsx)(`div`,{ref:u}),(0,W.jsx)(`div`,{ref:d})]}),(0,W.jsxs)(`div`,{className:`tag-operation-content-btn-group`,children:[(0,W.jsx)(`button`,{className:`cancel-btn`,onClick:n,children:j(`Cancel`)}),(0,W.jsx)(`button`,{className:`save-btn`,onClick:_,children:j(`Save`)})]})]})]})};I(),H(),li(),M(),zv(),Av(),Do(),je();var oC=async e=>{let t=e.querySelectorAll(`img`);for(let e of t)e.src.startsWith(`http://localhost`)?e.src=await Hx(e.getAttribute(`path`)||(0,f.normalizePath)(e?.parentElement?.getAttribute(`src`)||``)):e.src=await Hx(e.src)},sC=async()=>{let{verifyState:e}=L.getState(),t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),n=f.Platform.isDesktop?await Pv():t.identifier||t.uuid;return e&&e?.appId===n},cC=async(e,t)=>{if(!(t!==`chat`&&t!==`moments`)){if(t===`moments`){let t=e.querySelectorAll(`.thino-moment-icon`),n=e.find(`.moments-view-user-icon`),r=e.find(`.moments-view-background`);for(let e of t){let t=await Wx(e);e.style.backgroundImage=`url(${t})`}if(n){let e=await Wx(n);n.style.backgroundImage=`url(${e})`}if(r){let e=await Wx(r);r.style.backgroundImage=`url(${e})`}}else if(t===`chat`){let t=e.querySelectorAll(`.icon-img`);for(let e of t){let t=await Wx(e);e.style.backgroundImage=`url(${t})`}}}},lC=class extends f.Modal{constructor(e,t,n){super(e),this.title=t,this.cb=n}onOpen(){super.onOpen(),this.containerEl.toggleClass(`thino-bulk-action-dialog`,!0),this.titleEl.setText(this.title+` `+j(`Confirm?`)),this.contentEl.createEl(`button`,{cls:`mod-warning`,text:j(`Confirm?`).replace(/\?|?/,``)}).onclick=()=>{this.cb(`confirm`),this.close()},this.contentEl.createEl(`button`,{text:j(`Cancel`)}).onclick=()=>{this.cb(`cancel`),this.close()}}onClose(){super.onClose()}},uC=class extends f.Modal{root;constructor(e,t){super(e),this.thinos=t}onOpen(){super.onOpen(),this.containerEl.toggleClass([`thino-bulk-action-dialog`,`tag-actions`],!0),this.root=u_.createRoot(this.contentEl),this.root.render((0,W.jsx)(aC,{app:this.app,closeDialog:this.close.bind(this),thinos:this.thinos}))}onClose(){super.onClose(),this.root?.unmount()}},dC=({thinosCount:e,thinos:t})=>{let{memoListView:n}=vi(),{query:r,pathname:i}=Si(),{settings:a,app:o}=F(),{tag:s,duration:c,type:l,text:u,filter:d,path:p}=r,m=Zg.getQueryById(d),h=!!(s||c&&c.from<c.to||l||u||m||p),g=(0,U.useRef)(null);(0,U.useEffect)(()=>{g&&(0,f.setIcon)(g.current,`more-horizontal`)},[g]);let _=async()=>{if(!(t?.length>0))return;let e=tC($S(t));await N.copyTextToClipboard(e),new f.Notice(j(`Copied to clipboard Successfully`))},v=async()=>{if(!(t?.length>0))return;if(!await sC()){kv();return}let e=[...t],n=a.DeleteThinoDirectly;try{let t=e.filter(e=>e.sourceType===`DAILY`),r=e.filter(e=>e.sourceType!==`DAILY`);for(let e of r)if(n)await V.deleteMemoById(e.id);else{let t=await V.hideMemoById(e.id);t&&V.editMemo(t)}let i=mC(t);for(let{path:e,thinos:t}of i)await V.dealWithDailyThinoBulk(e,t,n?`deleteForever`:`delete`);V.updateTagsState(),z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}},y=async()=>{if(!(t?.length>0))return;if(!await sC()){kv();return}let e=[...t];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`);for(let e of n)await V.deleteMemoById(e.id);let r=mC(t);for(let{path:e,thinos:t}of r){let n=await V.dealWithDailyThinoBulk(e,t,`deleteForever`);for(let e of n)e?.webId&&await Eo.syncDelete(e.webId)}V.updateTagsState(),z.clearQuery(),new f.Notice(j(`DELETE SUCCEED`))}catch(e){console.error(`error`,e),new f.Notice(e.message)}},b=async()=>{if(!(t?.length>0))return;if(!await sC()){kv();return}let e=[...t];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`),r=await V.unarchiveThinoBulk(n);for(let e of r)e&&V.editMemo(e);let i=mC(t);for(let{path:e,thinos:t}of i)await V.dealWithDailyThinoBulk(e,t,`restoreFromArchive`);new f.Notice(j(`RESTORE SUCCEED`)),V.updateTagsState(),z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}},x=async()=>{if(!(t?.length>0))return;if(!await sC()){kv();return}let e=[...t];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`);for(let e of n){let t=await V.restoreMemoById(e.id);t?.webId&&await Eo.syncRecover(t.webId),t&&V.editMemo(t)}let r=mC(t);for(let{path:e,thinos:t}of r){let n=await V.dealWithDailyThinoBulk(e,t,`restoreFromDelete`);for(let e of n)e?.webId&&await Eo.syncRecover(e.webId),e&&V.editMemo(e)}V.updateTagsState(),z.clearQuery(),new f.Notice(j(`RESTORE SUCCEED`))}catch(e){new f.Notice(e.message)}},S=async()=>{if(!(t?.length>0))return;if(!await sC()){kv();return}let e=[...t];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`),r=await V.archiveThinoBulk(n);for(let e of r)e&&V.editMemo(e);let i=mC(t);for(let{path:e,thinos:t}of i)await V.dealWithDailyThinoBulk(e,t,`archive`);V.updateTagsState(),z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}},C=async()=>{if(t?.length>0){if(!await sC()){kv();return}new uC(o,t).open()}},w=async e=>{document.body.toggleClass(`thino-share-page`,!0),setTimeout(async()=>{if(new f.Notice(j(`Image is generating...`)),!e){new f.Notice(j(`No content to generate.`));return}await cC(e,n),await oC(e);let t;t=document.body.hasClass(`theme-dark`)?`#232323`:`#eaeaea`,console.log(e),ES(e,{backgroundColor:t,pixelRatio:window.devicePixelRatio*2}).then(t=>{if(a?.AutoSaveWhenOnMobile&&f.Platform.isMobile){let e=t.split(`base64,`)[1];ci(e,`image/png`).arrayBuffer().then(async e=>{let t,n=ge();for(let e in n)if(n[e]instanceof f.TFile){t=n[e];break}t!==void 0&&await o.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,`png`,t),e)})}document.body.toggleClass(`thino-share-page`,!1),ZS({imgUrl:t}),new f.Notice(j(`Image generated successfully.`)),e.hasClass(`share-image`)?e.toggleClass(`share-image`,!1):e.closest(`.share-image`).toggleClass(`share-image`,!1)}).catch(e=>{document.body.toggleClass(`thino-share-page`,!1),console.error(e)})},0)},T=e=>{let r=new f.Menu;switch(r.addItem(e=>{e.setTitle(j(`Clear filter`)).setIcon(`x`).onClick(async()=>{z.clearQuery()})}),r.addSeparator(),r.addItem(e=>{e.setTitle(j(`Copy filtered thinos`)).setIcon(`copy`).onClick(async()=>{await _()})}),r.addItem(e=>{e.setTitle(j(`Share filtered thinos as image`)).setIcon(`image`).onClick(async()=>{let e=document.querySelector(`.memolist-container`);e.toggleClass(`share-image`,!0);try{if(n===`calendar`)e.find(`.rbc-agenda-table`)&&await w(e.find(`.rbc-agenda-table`)),e.find(`.rbc-month-view`)&&await w(e.find(`.rbc-month-view`));else if(n===`table`){if(e.find(`.thino-table`)){let t=e.find(`.thino-table`);console.log(t),await w(t)}}else await w(e)}catch(t){console.error(t),new f.Notice(j(`Failed to generate image.`)),e.toggleClass(`share-image`,!1)}})}),r.addItem(e=>{e.setTitle(j(`Merge thinos in to thino share image`)).setIcon(`image`).onClick(async()=>{let e=``;t.forEach((n,r)=>{e+=`> [!thino] ${n.createdAt}\n${n.content.split(`
- `).map(e=>(console.log(e),e.trim()?`> ${e}\n`:`>
- `))}\n\n`+(r===t.length-1?`
- `:`
- ------
- `)}),console.log(e),US({createdAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),content:e.replace(/(^|\n),>/g,`
- >`),id:`temp-`+Math.random().toString(36).substr(2,9),thinoType:`JOURNAL`,sourceType:`DAILY`,rowStatus:`NORMAL`,visibility:`PRIVATE`,pinned:!1,creatorName:`thino`,deletedAt:``,path:``,resourceList:[]},`clean`)})}),r.addSeparator(),i){case`/`:r.addItem(e=>{e.setTitle(j(`Bulk tag operation`)).setIcon(`hash`).onClick(async()=>{await C()})}).addItem(e=>{e.setTitle(j(`Bulk archive`)).setIcon(`archive`).onClick(async()=>{new lC(o,j(`ARCHIVE`),async e=>{e===`confirm`&&await S()}).open()})}).addItem(e=>{e.setTitle(j(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new lC(o,j(`DELETE`),async e=>{e===`confirm`&&await v()}).open()})}).addItem(e=>{e.setTitle(j(`Send to file`)).setIcon(`file-output`).onClick(async()=>{if(!await sC()){kv();return}t?.length>0&&bC(o,t)})});break;case`/archive`:r.addItem(e=>{e.setTitle(j(`Bulk restore`)).setIcon(`archive`).onClick(async()=>{new lC(o,j(`RESTORE`),async e=>{e===`confirm`&&await b()}).open()})}).addItem(e=>{e.setTitle(j(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new lC(o,j(`DELETE`),async e=>{e===`confirm`&&await v()}).open()})});break;case`/recycle`:r.addItem(e=>{e.setTitle(j(`Bulk restore`)).setIcon(`archive-restore`).onClick(async()=>{new lC(o,j(`RESTORE`),async e=>{e===`confirm`&&await x()}).open()})}).addItem(e=>{e.setTitle(j(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new lC(o,j(`DELETE`),async e=>{e===`confirm`&&await y()}).open()})});break}r.showAtMouseEvent(e.nativeEvent)};return(0,W.jsxs)(`div`,{className:`filter-query-container ${h?``:`thino-hidden`}`,children:[(0,W.jsxs)(`div`,{className:`filter-query`,children:[(0,W.jsx)(`span`,{className:`tip-text`,children:j(`FILTER`)}),(0,W.jsxs)(`div`,{"data-filter-type":`query`,className:`filter-item-container `+(m?``:`thino-hidden`),onClick:()=>{z.setMemoFilter(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🔖`}),` `,m?.title]}),(0,W.jsxs)(`div`,{"data-filter-type":`tag`,className:`filter-item-container `+(s?``:`thino-hidden`),onClick:()=>{z.setTagQuery(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🏷️`}),` `,s]}),(0,W.jsxs)(`div`,{"data-filter-type":`type`,className:`filter-item-container `+(l?``:`thino-hidden`),onClick:()=>{z.setMemoTypeQuery(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`📦`}),` `,gv(l)]}),c&&c.from<c.to&&(0,W.jsxs)(`div`,{"data-filter-type":`date`,className:`filter-item-container`,children:[(0,W.jsxs)(`div`,{className:`day-picker-component-group`,children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🗓️`}),` `,(0,W.jsx)(ex,{type:`text`,startOrEnd:`start`,defaultValue:(0,f.moment)(c.from,`x`).valueOf(),handleValueChange:e=>{let t=(0,f.moment)(c.to,`x`),n=(0,f.moment)(e,`x`),r=n.isAfter(t)||n.isSame(t);z.setFromAndToQuery(r?t.startOf(`day`).valueOf():(0,f.moment)(e,`x`).startOf(`day`).valueOf(),c.to)}}),(0,W.jsx)(`span`,{children:j(`to`)}),(0,W.jsx)(ex,{type:`text`,startOrEnd:`end`,defaultValue:(0,f.moment)(c.to,`x`).add(1,`days`).valueOf(),handleValueChange:e=>{let t=(0,f.moment)(c.from,`x`),n=(0,f.moment)(e,`x`),r=n.isBefore(t)||n.isSame(t),i=(0,f.moment)(e,`x`).endOf(`day`).valueOf();console.log(`end`,(0,f.moment)(e,`x`).add(1,`days`).format(`YYYY-MM-DD HH:mm:ss`)),z.setFromAndToQuery(c.from,r?t.endOf(`day`).valueOf():i)}})]}),(0,W.jsx)(`div`,{ref:e=>e&&(0,f.setIcon)(e,`x`),className:`btn close-btn`,onClick:()=>{z.setFromAndToQuery(0,0)}})]}),(0,W.jsxs)(`div`,{className:`filter-item-container `+(u?``:`thino-hidden`),onClick:()=>{z.setTextQuery(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🔍`}),` `,u]}),(0,W.jsxs)(`div`,{className:`filter-item-container `+(p?``:`thino-hidden`),onClick:()=>{z.setPathQuery(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`📦`}),` `,(0,W.jsx)(`span`,{className:`path-text`,children:p})]})]}),(0,W.jsxs)(`div`,{className:`thino-filter-items`,children:[e&&(0,W.jsx)(`div`,{className:`thinos-count`,children:`${e?`${e} Thinos `:``}`}),(0,W.jsx)(`div`,{ref:g,className:`btn memo-action-menu`,onClick:T})]})]})};li(),H(),M(),I(),gs();var fC=e=>{let{app:t,settings:n,view:r}=F(),{memo:i,handleUnarchivedMemoAction:a}=e,o=U.useRef(null),s=U.useRef(null),[c,l]=U.useState(``),u={...i,createdAtStr:N.getDateTimeString(i.createdAt),deletedAtStr:N.getDateTimeString(i.deletedAt||i.createdAt)},d=(0,U.useRef)(null);(0,U.useEffect)(()=>{!s||!d.current||(0,f.setIcon)(d.current,`more-horizontal`)},[s]),(0,U.useEffect)(()=>{if(!o.current||!s.current||o.current.hasChildNodes()&&i.content===c||!r)return;l(i.content),o.current.hasChildNodes()&&o.current.empty();async function e(){o.current?.toggleClass([`markdown-rendered`],!0),await f.MarkdownRenderer.render(t,i.content+`
- `,o.current,i.path,r),(o.current?.querySelectorAll(`.internal-link`))?.forEach(e=>{let n=e,a=n.getAttribute(`data-href`);a&&(t.metadataCache.getFirstLinkpathDest(a,i.path)||e.classList.add(`is-unresolved`),n.addEventListener(`mouseover`,e=>{e.stopPropagation(),t.workspace.trigger(`hover-link`,{event:e,source:`thino`,hoverParent:r.containerEl,targetEl:n,linktext:a,sourcePath:n.href})}))})}e()},[i.content,s]);let p=async()=>{switch(u.sourceType){case`DAILY`:await ps(u.id,u.path);break;case`CANVAS`:await hs(u.id,u.path);break;case`MULTI`:await fs(u.path);break;case`FILE`:await ms(u.id,u.path);break;case`JOURNAL`:await ps(u.id,u.path);break}},m=async()=>{try{if(n.DeleteThinoDirectly)await V.deleteMemoById(u.id);else{let e=await V.hideMemoById(u.id);e&&V.editMemo(e)}}catch(e){new f.Notice(e.message)}},h=async()=>{try{let e=await V.unarchiveMemo(u);e&&V.editMemo(e),a(u.id),new f.Notice(j(`RESTORE SUCCEED`))}catch(e){new f.Notice(e.message)}};return(0,W.jsxs)(`div`,{ref:s,className:`memo-wrapper ${`memos-`+u.id}`,children:[(0,W.jsxs)(`div`,{className:`memo-top-wrapper`,children:[(0,W.jsxs)(`span`,{className:`time-text`,children:[j(`ARCHIVED AT`),` `,u.updatedAt]}),(0,W.jsx)(`div`,{className:`btns-container`,children:(0,W.jsx)(`span`,{ref:d,className:`btn more-action-btn`,onClick:e=>{e.stopPropagation();let t=new f.Menu;t.addItem(e=>{e.setTitle(j(`RESTORE`)).setIcon(`archive-restore`).onClick(h)}),t.addItem(e=>{e.setTitle(j(`SOURCE`)).setIcon(`home`).onClick(p)}),t.addItem(t=>{t.setTitle(j(`DELETE`)).setIcon(`trash`).setWarning(!0).onClick(()=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(j(`CONFIRM!`)).setIcon(`trash`).setWarning(!0).onClick(m)}),t.addItem(e=>{e.setTitle(j(`Cancel`)).setIcon(`x`).onClick(()=>{})}),t.showAtMouseEvent(e.nativeEvent)})}),t.showAtMouseEvent(e.nativeEvent)}})})]}),(0,W.jsx)(`div`,{ref:o,className:`memo-content-text`})]})};H(),M();var pC=({title:e,showSidebar:t=!1,onShowSidebarClick:n,showHomeButton:r=!0,children:i,rightContent:a})=>{let o=(0,U.useCallback)(()=>{n?n():R.setShowSiderbarInMobileView(!0)},[n]),s=(0,U.useCallback)(()=>{z.clearQuery(),z.setPathname(`/`)},[]);return(0,W.jsxs)(`div`,{className:`section-header-container`,children:[(0,W.jsx)(`div`,{className:`title-wrapper`,children:(0,W.jsx)(`div`,{className:`title-btns-left-wrapper`,children:(0,W.jsxs)(`div`,{className:`title-text`,children:[t&&(0,W.jsx)(Ov,{when:!0,children:(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`menu`)},className:`btn action-btn clickable-icon`,onClick:o})}),e&&(0,W.jsx)(`span`,{className:`normal-text`,children:e}),r&&(0,W.jsxs)(`button`,{className:`go-home-btn`,onClick:s,children:[`🏠 `,j(`Return To Home Page`)]}),i]})})}),a&&(0,W.jsx)(`div`,{className:`title-btns-right-wrapper`,children:a})]})};I(),H(),M(),Av(),Tg();var mC=e=>{let t=new Map;for(let n of e){let e=n.path;t.has(e)||t.set(e,[]),t.get(e)?.push(n)}return Array.from(t).map(([e,t])=>({path:e,thinos:t}))},hC=()=>{let{query:e}=Si(),{isMobileView:t}=vi(),{memos:n}=P(),{plugin:r}=F(),i=Ub(),[a,o]=(0,U.useState)([]),s=U.useRef(null),c=U.useRef(null);(0,U.useEffect)(()=>{c.current&&(0,f.setIcon)(c.current,`more-horizontal`)},[c]),(0,U.useEffect)(()=>{console.log(n),wg({memos:n,query:e,filterOptions:{filterDoneTasks:!1,onlyFilterType:`archived`},plugin:r}).then(e=>{console.log(e),o(e)}),i.setFinish()},[n,s.current,e]);let l=(0,U.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e))},[]),u=(0,U.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e))},[]);(0,U.useCallback)(()=>{R.setShowSiderbarInMobileView(!0)},[]);let d=async()=>{if(!(a?.length>0))return;if(!await sC()){kv();return}let e=[...a];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`),r=await V.unarchiveThinoBulk(n);for(let e of r)e&&V.editMemo(e);let i=mC(t);for(let{path:e,thinos:t}of i)await V.dealWithDailyThinoBulk(e,t,`restoreFromArchive`);new f.Notice(j(`RESTORE SUCCEED`)),z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}},p=async()=>{if(!(a?.length>0))return;if(!await sC()){kv();return}let e=[...a],t=L.getState().settings.DeleteThinoDirectly;try{let n=e.filter(e=>e.sourceType===`DAILY`),r=e.filter(e=>e.sourceType!==`DAILY`);for(let e of r)if(t)await V.deleteMemoById(e.id);else{let t=await V.hideMemoById(e.id);t&&V.editMemo(t)}let i=mC(n);for(let{path:e,thinos:n}of i)await V.dealWithDailyThinoBulk(e,n,t?`deleteForever`:`delete`);z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}};return(0,W.jsxs)(`div`,{className:`memo-trash-wrapper`,ref:s,children:[(0,W.jsx)(pC,{showSidebar:t,rightContent:(0,W.jsx)(`div`,{className:`header-right-section`,children:(0,W.jsx)(Dv,{disableSuper:!0})}),children:(0,W.jsx)(`span`,{ref:c,className:`menu-popup-btn`,onClick:e=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(j(`Bulk restore`)).setIcon(`archive`).onClick(async()=>{new lC(app,j(`RESTORE`),async e=>{e===`confirm`&&await d()}).open()})}).addItem(e=>{e.setTitle(j(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new lC(app,j(`DELETE`),async e=>{e===`confirm`&&await p()}).open()})}),t.showAtMouseEvent(e.nativeEvent)}})}),(0,W.jsx)(dC,{thinosCount:a.length,thinos:a}),i.isLoading?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`p`,{className:`tip-text`,children:j(`Fetching data...`)})}):a.length===0?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`p`,{className:`tip-text`,children:j(`Here is No Memos.`)})}):(0,W.jsx)(`div`,{className:`deleted-memos-container`,children:a.map(e=>(0,W.jsx)(fC,{memo:e,handleUnarchivedMemoAction:u,handleDeletedMemoAction:l},`${e.id}-${e.updatedAt}`))})]})};M(),H();function gC(e,t){return e.map(e=>{let n=e.createdAt,r=e.content;switch(t){case`list`:return`- ${r.split(`
- `).join(`
- `)}\n - ${j(`Source`)}: ${n}`;case`callout`:return`> [!thino] ${n}\n${r.split(`
- `).map(e=>`> ${e}`).join(`
- `)}`;case`plain`:return r;default:return r}}).join(`
- `)}async function _C(e,t,n,r,i){try{let a=gC(t,r);await e.vault.append(n,`
- `+a+`
- `);let o=t.filter(e=>e.sourceType===`DAILY`),s=t.filter(e=>e.sourceType!==`DAILY`);if(i===`archive`){let e=await V.archiveThinoBulk(s);for(let t of e)t&&V.editMemo(t);let t=mC(o);for(let{path:e,thinos:n}of t)await V.dealWithDailyThinoBulk(e,n,`archive`)}else if(i===`delete`){for(let e of s){let t=await V.hideMemoById(e.id);t&&V.editMemo(t)}let e=mC(o);for(let{path:t,thinos:n}of e)await V.dealWithDailyThinoBulk(t,n,`delete`)}V.updateTagsState(),new f.Notice(j(`ORGANIZE SUCCEED`))}catch(e){console.error(`Organize failed:`,e),new f.Notice(e.message||j(`Organize failed`))}}var vC=class extends f.Modal{format=`list`;postAction=`archive`;constructor(e,t,n){super(e),this.memos=t,this.targetFile=n}onOpen(){let{contentEl:e}=this;this.titleEl.setText(j(`Send to file`)),this.containerEl.toggleClass(`thino-organize-dialog`,!0),e.createEl(`p`,{text:`${j(`Target`)}: ${this.targetFile.path}`,cls:`organize-target-path`}),new f.Setting(e).setName(j(`Content format`)).addDropdown(e=>{e.addOption(`list`,j(`List item`)).addOption(`callout`,j(`Callout`)).addOption(`plain`,j(`Plain text`)).setValue(this.format).onChange(e=>{this.format=e})}),new f.Setting(e).setName(j(`After sending`)).addDropdown(e=>{e.addOption(`archive`,j(`Archive originals`)).addOption(`delete`,j(`Delete originals`)).setValue(this.postAction).onChange(e=>{this.postAction=e})}),e.createEl(`p`,{text:`${this.memos.length} Thino(s)`,cls:`organize-memo-count`});let t=e.createDiv({cls:`modal-button-container`});t.createEl(`button`,{text:j(`Cancel`)}).addEventListener(`click`,()=>{this.close()});let n=t.createEl(`button`,{text:j(`Confirm`),cls:`mod-cta`});n.addEventListener(`click`,async()=>{n.disabled=!0,n.setText(j(`Processing...`)),await _C(this.app,this.memos,this.targetFile,this.format,this.postAction),this.close()})}onClose(){this.contentEl.empty()}},yC=class extends f.FuzzySuggestModal{constructor(e,t){super(e),this.memos=t,this.setPlaceholder(j(`Select target file`))}getItems(){return this.app.vault.getMarkdownFiles()}getItemText(e){return e.path}onChooseItem(e){new vC(this.app,this.memos,e).open()}};function bC(e,t){new yC(e,t).open()}li(),M(),$r(),yr(),H();function xC(e){return e?Array.isArray(e)?e.filter(e=>e).map(e=>e.toString().trim()):typeof e==`string`?e.split(/[\s,]+/).filter(Boolean):[]:[]}var SC=e=>{let{memo:t,memoListView:n,handlePinMemoClick:r,handleFixMemoClick:i,handleSourceMemoClick:a,handleShowMemoStoryDialog:o,handleCopyMemoClick:s,handleEditMemoClick:c,handleGenMemoImageBtnClick:l,handleMarkMemoClick:u,handleArchiveMemo:d,handleDeleteMemoClick:p,handleSplitMemoClick:m,handleCopyEmbedLink:h,handleReferenceLinksGroupClick:g,handleLockMemo:_,canLockMemo:v}=e,y=z.getState().query.tag,b=vr.getState().dailyNotesState.settings,x=b.EnabledLocationList.find(e=>e.value===`MULTI`),S=(0,U.useRef)(null),C={pinRef:(0,U.useRef)(null),fixRef:(0,U.useRef)(null),typeRef:(0,U.useRef)(null),referenceLinksGroupRef:(0,U.useRef)(null),moreRef:(0,U.useRef)(null)},[w,T]=QS({mouseEnterDelayMS:500}),E=(0,U.useRef)();(0,U.useEffect)(()=>{if(!C.typeRef)return;let e=Qr.find(e=>e.title===t.sourceType);(0,f.setIcon)(C.typeRef.current,e.icon),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.typeRef.current,t.path),C.fixRef&&((0,f.setIcon)(C.fixRef.current,`shield-alert`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.fixRef.current,`Update Thino property`)),C.referenceLinksGroupRef&&b?.enableReferenceLinksGroup&&((0,f.setIcon)(C.referenceLinksGroupRef.current,`link`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.referenceLinksGroupRef.current,`Reference links group`))},[C.typeRef,C.referenceLinksGroupRef]),(0,U.useEffect)(()=>{C.pinRef&&(t.pinned?((0,f.setIcon)(C.pinRef.current,`pin-off`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.pinRef.current,j(`UNPIN`))):((0,f.setIcon)(C.pinRef.current,`pin`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.pinRef.current,j(`PIN`))))},[C.pinRef,t.pinned]);let D=(0,f.debounce)(()=>{if(w&&C.moreRef.current){if(E.current&&E.current._loaded||E.current?.useNativeMenu||document.body.find(`.more-action-btns-wrapper`))return;let e=O(),t=C.moreRef.current.getBoundingClientRect();e.showAtPosition({x:t.left,y:t.bottom})}},200);(0,U.useEffect)(()=>{D()},[w]);let O=()=>{let e=new f.Menu;return e.dom.toggleClass([`more-action-btns-wrapper`],!0),e.useNativeMenu?(e.setNoIcon(),e.addItem(e=>{e.setTitle(j(`COPY`)).onClick(s)}),e.addItem(e=>{e.setTitle(j(`EDIT`)).onClick(c)}),e.addItem(e=>{e.setTitle(j(`SHARE`)).onClick(l)})):e.addItem(t=>{let n=t.dom;t.dom.empty(),t.dom.toggleClass([`more-action-btn-group`,`more-action-menu-item`],!0);let r=n.createEl(`span`);new f.ExtraButtonComponent(r).setIcon(`copy`),r.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),r.onclick=t=>{t.stopPropagation(),t.preventDefault(),s(),e.close()};let i=n.createEl(`span`);i.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),i.onclick=t=>{t.stopPropagation(),t.preventDefault(),c(),e.close()},new f.ExtraButtonComponent(i).setIcon(`pencil`);let a=n.createEl(`span`);a.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),a.onclick=t=>{t.stopPropagation(),t.preventDefault(),l(),e.close()},new f.ExtraButtonComponent(a).setIcon(`share-2`)}),e.addSeparator(),t.sourceType===`DAILY`&&(e.addItem(e=>{e.setIcon(`copy`).setTitle(j(`Copy embed link`)).onClick(()=>{h(!0)})}),e.addItem(e=>{e.setIcon(`copy`).setTitle(j(`Copy link`)).onClick(()=>{h(!1)})}),e.addSeparator()),e.addItem(e=>{e.setIcon(`book-open`).setTitle(j(`READ`)).onClick(()=>o(new MouseEvent(`click`)))}),e.addItem(e=>{e.setIcon(`bookmark`).setTitle(j(`MARK`)).onClick(u)}),/(^|\n)#{1,6}\s/g.exec(t.content)?.length>1&&x&&e.addItem(e=>{e.setIcon(`separator-horizontal`).setTitle(j(`SPLIT`)).onClick(m)}),e.addItem(e=>{e.setIcon(`home`).setTitle(j(`SOURCE`)).onClick(()=>a(t))}),v&&_&&e.addItem(t=>{t.setIcon(`lock`).setTitle(j(`Lock`)).onClick(()=>{_(),e.close()})}),e.addItem(n=>{n.setIcon(`file-output`).setTitle(j(`Send to file`)).onClick(()=>{let n=vr.getState().dailyNotesState.app;bC(n,[t]),e.close()})}),e.addSeparator(),e.addItem(e=>{e.setWarning(!0).setIcon(`archive`).setTitle(j(`ARCHIVE`).toUpperCase()).onClick(()=>d(t))}),e.addItem(e=>{e.setWarning(!0).setIcon(`trash`).setTitle(b.DeleteThinoDirectly?j(`DELETE`):j(`TRASH BOX`).toUpperCase()).onClick(()=>{let e=vr.getState().dailyNotesState.app,t=new f.Modal(e);t.titleEl.setText(j(`Confirm`)),t.contentEl.createEl(`p`,{text:j(`Are you sure you want to delete this thino?`)});let n=t.contentEl.createDiv({cls:`modal-button-container`});n.createEl(`button`,{text:j(`Cancel`)}).addEventListener(`click`,()=>{t.close()}),n.createEl(`button`,{text:j(`Confirm`),cls:`mod-warning`}).addEventListener(`click`,()=>{p(),t.close()}),t.open()})}),e.addSeparator(),e.addItem(e=>{e.setDisabled(!0).setTitle(N.getWordCount(t.content.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,``))+` ${j(`words`)}`)}),e.onHide(()=>{}),E.current=e,e},k=e=>{O().showAtMouseEvent(e.nativeEvent)};return(0,W.jsxs)(`div`,{ref:S,className:`memo-top-right-wrapper`,children:[y&&b.FilterByMetadata?t.content.includes(y)?(0,W.jsx)(`span`,{className:`tag-text tag-in-content`,children:j(`Matched via tag in content`)}):xC(t.fileInfo?.tags).includes(y)?(0,W.jsx)(`span`,{className:`tag-text tag-in-file`,children:j(`Matched via tag in file`)}):null:null,(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(`span`,{ref:C.fixRef,className:`btn ${t.sourceType!==`MULTI`||t.id!==``?`thino-hidden`:``} fix-memo-btn`,onClick:()=>i(t)}),b?.enableReferenceLinksGroup&&(0,W.jsx)(`span`,{ref:C.referenceLinksGroupRef,className:`btn ${n===`list`||n===`moments`?`thino-hidden`:``} reference-links-group-btn`,onClick:g}),(0,W.jsx)(`span`,{ref:C.typeRef,className:`btn ${t.sourceType===`DAILY`?`thino-hidden`:``} source-type-btn`,onClick:()=>a(t)}),(0,W.jsx)(`span`,{ref:C.pinRef,className:`btn ${e.memo.pinned?`pinned-btn`:`unpinned-btn`} pro`,onClick:r}),(0,W.jsx)(`span`,{...T,ref:e=>{C.moreRef.current=e,e&&(0,f.setIcon)(e,`more-horizontal`)},onClick:k,className:`btn more-action-btn`})]})]})};H();var CC=e=>{let{memo:t,handleMemoTypeToggle:n,handleShowMemoStoryDialog:r,settings:i}=e,a=t.fileInfo?.frontmatter?.title||t.path.split(`/`).pop().split(`.`).shift();return(0,W.jsxs)(`div`,{className:`memo-top-left-wrapper`,children:[e.children,(0,W.jsx)(`span`,{title:t.createdAt,className:`time-text`,onClick:e=>r(e),children:t.createdAt}),(0,W.jsx)(`div`,{className:`btn memo-type-img ${i?.ShowTaskLabel?``:`thino-hidden`}`,onClick:n,children:t.thinoType!==`JOURNAL`&&(0,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)})}),i?.ShowSourcePath&&(t.sourceType===`FILE`||t.sourceType===`MULTI`)&&(0,W.jsx)(`span`,{className:`time-text source-path`,"aria-label":a,onClick:()=>{z.setPathQuery(a)},children:a})]})},wC=()=>({type:`initialText`,value:``,timestamp:Date.now(),selectionStart:0,selectionEnd:0}),TC={initialValue:``,interval:300},aee=class{constructor(e,t=TC){this.listeners=[],this.runUndo=()=>{let e=this.actions[this.currentIndex].selectionStart;this.currentIndex>0&&this.currentIndex--,this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(e,e),this.dispatchChange()},this.runRedo=()=>{this.currentIndex<this.actions.length-1&&this.currentIndex++;let e=this.actions[this.currentIndex].selectionEnd;this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(e,e),this.dispatchChange()},this.getActions=()=>this.actions,this.setState=(e,t)=>{this.actions=[...e],this.currentIndex=t<this.actions.length?t:this.actions.length-1,this.dispatchChange()},this.resetState=()=>{this.actions=[wC()],this.currentIndex=0,this.dispatchChange()},this.destroy=()=>{this.rmEventListeners()},this.subscribe=e=>{this.listeners.push(e)},this.handleElementKeydown=e=>{let t=e;t.key===`z`&&!t.shiftKey&&(t.metaKey||t.ctrlKey)?(e.preventDefault(),this.runUndo()):(t.key===`z`&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.key===`y`&&(t.metaKey||t.ctrlKey))&&(e.preventDefault(),this.runRedo())},this.handleElementInput=e=>{let t=e,n=this.actions[this.currentIndex];this.pushNewAction({type:t.inputType,value:this.element.value,timestamp:Date.now(),selectionStart:this.element.selectionEnd-(this.element.value.length-n.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=e=>{let t=this.actions[this.currentIndex];t&&t.type===e.type&&e.timestamp-t.timestamp<this.config.interval?this.actions[this.currentIndex]=Object.assign(Object.assign({},t),{value:e.value,selectionEnd:e.selectionEnd,timestamp:e.timestamp}):(this.config.maxSize&&this.currentIndex>=this.config.maxSize?(this.actions.shift(),this.actions[0]=wC()):this.currentIndex++,this.actions[this.currentIndex]=e,this.actions=this.actions.slice(0,this.currentIndex+1)),this.dispatchChange()},this.dispatchChange=()=>{for(let e of this.listeners)e([...this.actions],this.currentIndex)},this.element=e,this.config=Object.assign(Object.assign({},TC),t),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=[wC()],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 oee(){let[,e]=(0,U.useState)(!1);return(0,U.useCallback)(()=>{e(e=>!e)},[])}var see=s(((e,t)=>{(function(){var e=`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`.split(`.`),n=typeof window<`u`,r=n&&window.mozInnerScreenX!=null;function i(t,i,a){if(!n)throw Error(`textarea-caret-position#getCaretCoordinates should only be called in a browser`);var o=a&&a.debug||!1;if(o){var s=document.querySelector(`#input-textarea-caret-position-mirror-div`);s&&s.parentNode.removeChild(s)}var c=document.createElement(`div`);c.id=`input-textarea-caret-position-mirror-div`,document.body.appendChild(c);var l=c.style,u=window.getComputedStyle?getComputedStyle(t):t.currentStyle;l.whiteSpace=`pre-wrap`,t.nodeName!==`INPUT`&&(l.wordWrap=`break-word`),l.position=`absolute`,o||(l.visibility=`hidden`),e.forEach(function(e){l[e]=u[e]}),r?t.scrollHeight>parseInt(u.height)&&(l.overflowY=`scroll`):l.overflow=`hidden`,c.textContent=t.value.substring(0,i),t.nodeName===`INPUT`&&(c.textContent=c.textContent.replace(/\s/g,`\xA0`));var d=document.createElement(`span`);d.textContent=t.value.substring(i)||`.`,c.appendChild(d);var f={top:d.offsetTop+parseInt(u.borderTopWidth),left:d.offsetLeft+parseInt(u.borderLeftWidth)};return o?d.style.backgroundColor=`#aaa`:document.body.removeChild(c),f}t!==void 0&&t.exports!==void 0?t.exports=i:n&&(window.getCaretCoordinates=i)})()})),cee=s(((e,t)=>{var n=globalThis.CustomEvent;function r(){try{var e=new n(`cat`,{detail:{foo:`bar`}});return e.type===`cat`&&e.detail.foo===`bar`}catch{}return!1}t.exports=r()?n:typeof document<`u`&&typeof document.createEvent==`function`?function(e,t){var n=document.createEvent(`CustomEvent`);return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=!!t.bubbles,n.cancelable=!!t.cancelable,n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}})),lee=u(see()),uee=u(cee());function EC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DC(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(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){EC(e,t,n[t])})}return e}function OC(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function kC(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 AC(e,t,n){return t&&kC(e.prototype,t),n&&kC(e,n),e}function jC(e){return jC=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},jC(e)}function MC(e){return MC=typeof Symbol==`function`&&jC(Symbol.iterator)===`symbol`?function(e){return jC(e)}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:jC(e)},MC(e)}function NC(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function PC(e,t){return t&&(MC(t)===`object`||typeof t==`function`)?t:NC(e)}function FC(e){return FC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},FC(e)}function IC(e,t){return IC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},IC(e,t)}function LC(e,t){if(typeof t!=`function`&&t!==null)throw 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&&IC(e,t)}function RC(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function zC(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)===`[object Arguments]`)return Array.from(e)}function BC(){throw TypeError(`Invalid attempt to spread non-iterable instance`)}function VC(e){return RC(e)||zC(e)||BC()}var HC={ESC:27,UP:38,DOWN:40,LEFT:37,RIGHT:39,ENTER:13,TAB:9},UC=new function e(){var t=this;OC(this,e),this.startListen=function(e){e&&e.addEventListener(`keydown`,t.f)},this.stopListen=function(e){e&&e.removeEventListener(`keydown`,t.f)},this.add=function(e,n){var r=e;return typeof r!=`object`&&(r=[r]),t.listeners[t.index]={keyCode:r,fn:n},t.index++},this.remove=function(e){delete t.listeners[e]},this.removeAll=function(){t.listeners={},t.index=1},this.index=1,this.listeners={},this.f=function(e){if(e){var n=e.keyCode||e.which;Object.values(t.listeners).forEach(function(t){var r=t.keyCode,i=t.fn;r.includes(n)&&(e.stopPropagation(),e.preventDefault(),i(e))})}}},WC=function(e){LC(t,e);function t(){var e,n;OC(this,t);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=PC(this,(e=FC(t)).call.apply(e,[this].concat(i))),n.selectItem=function(){var e=n.props,t=e.item,r=e.onSelectHandler;r(t)},n}return AC(t,[{key:`shouldComponentUpdate`,value:function(e){return this.props.item!==e.item||this.props.selected!==e.selected||this.props.style!==e.style||this.props.className!==e.className}},{key:`render`,value:function(){var e=this,t=this.props,n=t.component,r=t.style,i=t.onClickHandler,a=t.item,o=t.selected,s=t.className,c=t.innerRef;return U.createElement(`li`,{className:`rta__item ${o===!0?`rta__item--selected`:``} ${s||``}`,style:r},U.createElement(`div`,{className:`rta__entity ${o===!0?`rta__entity--selected`:``}`,role:`button`,tabIndex:0,onClick:i,onFocus:this.selectItem,onMouseEnter:this.selectItem,onTouchStart:function(){e.clicked=!0,e.selectItem()},onTouchEnd:function(t){t.preventDefault(),e.clicked&&i(t)},onTouchMove:function(){e.clicked=!1},onTouchCancel:function(){e.clicked=!1},ref:c},U.createElement(n,{selected:o,entity:a})))}}]),t}(U.Component),GC=function(e){LC(t,e);function t(){var e,n;OC(this,t);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=PC(this,(e=FC(t)).call.apply(e,[this].concat(i))),n.state={selectedItem:null},n.cachedIdOfItems=new Map,n.onPressEnter=function(e){e!==void 0&&e.preventDefault();var t=n.props.values;n.modifyText(t[n.getPositionInList()])},n.getPositionInList=function(){var e=n.props.values,t=n.state.selectedItem;return t?e.findIndex(function(e){return n.getId(e)===n.getId(t)}):0},n.getId=function(e){if(n.cachedIdOfItems.has(e))return n.cachedIdOfItems.get(e);var t=n.props.getTextToReplace(e),r=function(){if(t){if(t.key)return t.key;if(typeof e==`string`||!e.key)return t.text}if(!e.key)throw Error(`Item ${JSON.stringify(e)} has to have defined "key" property`);return e.key}();return n.cachedIdOfItems.set(e,r),r},n.listeners=[],n.itemsRef={},n.modifyText=function(e){if(e){var t=n.props.onSelect;t(e)}},n.selectItem=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=n.props.onItemHighlighted;n.state.selectedItem!==e&&n.setState({selectedItem:e},function(){r(e),t&&n.props.dropdownScroll(n.itemsRef[n.getId(e)])})},n.scroll=function(e){e.preventDefault();var t=n.props.values,r=e.keyCode||e.which,i=n.getPositionInList(),a;switch(r){case HC.DOWN:a=i+1;break;case HC.UP:a=i-1;break;default:a=i;break}a=(a%t.length+t.length)%t.length,n.selectItem(t[a],[HC.DOWN,HC.UP].includes(r))},n.isSelected=function(e){var t=n.state.selectedItem;return t?n.getId(t)===n.getId(e):!1},n}return AC(t,[{key:`componentDidMount`,value:function(){this.listeners.push(UC.add([HC.DOWN,HC.UP],this.scroll),UC.add([HC.ENTER,HC.TAB],this.onPressEnter));var e=this.props.values;e&&e[0]&&this.selectItem(e[0])}},{key:`componentDidUpdate`,value:function(e){var t=this,n=e.values,r=this.props.values;n.map(function(e){return t.getId(e)}).join(``)!==r.map(function(e){return t.getId(e)}).join(``)&&r&&r[0]&&this.selectItem(r[0])}},{key:`componentWillUnmount`,value:function(){for(var e;this.listeners.length;)e=this.listeners.pop(),UC.remove(e)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.values,r=t.component,i=t.style,a=t.itemClassName,o=t.className,s=t.itemStyle;return U.createElement(`ul`,{className:`rta__list ${o||``}`,style:i},n.map(function(t){return U.createElement(WC,{key:e.getId(t),innerRef:function(n){e.itemsRef[e.getId(t)]=n},selected:e.isSelected(t),item:t,className:a,style:s,onClickHandler:e.onPressEnter,onSelectHandler:e.selectItem,component:r})}))}}]),t}(U.Component);function KC(e,t){var n=parseInt(getComputedStyle(t).getPropertyValue(`height`),10),r=parseInt(getComputedStyle(e).getPropertyValue(`height`),10)-n,i=t.offsetTop,a=e.scrollTop;i<a+r&&a<i||(e.scrollTop=i)}var qC=`next`,JC={X:{LEFT:`rta__autocomplete--left`,RIGHT:`rta__autocomplete--right`},Y:{TOP:`rta__autocomplete--top`,BOTTOM:`rta__autocomplete--bottom`}},YC=function(e){return console.error(`RTA: dataProvider fails: ${e}
-
- Check the documentation or create issue if you think it's bug. https://github.com/webscopeio/react-textarea-autocomplete/issues`)},XC=[`.`,`^`,`$`,`*`,`+`,`-`,`?`,`(`,`)`,`[`,`]`,`{`,`}`,`\\`,`|`],ZC=function(e){return VC(e).map(function(e){return XC.includes(e)?`\\${e}`:e}).join(``)},QC=function(e){LC(t,e);function t(){return OC(this,t),PC(this,FC(t).apply(this,arguments))}return AC(t,[{key:`componentDidMount`,value:function(){var e=this.props.boundariesElement;if(typeof e==`string`){var t=document.querySelector(e);if(!t)throw Error(`RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.`);this.containerElem=t}else if(e instanceof HTMLElement)this.containerElem=e;else throw Error(`RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.`);if(!this.containerElem||!this.containerElem.contains(this.ref))throw Error(`RTA: Invalid prop boundariesElement: it has to be one of the parents of the RTA.`)}},{key:`componentDidUpdate`,value:function(){var e,t,n=this.props.top||0,r=this.props.left||0,i=[],a=[],o=0,s=0,c=this.containerElem.getBoundingClientRect(),l=this.ref.getBoundingClientRect(),u=this.props.textareaRef.getBoundingClientRect(),d=window.getComputedStyle(this.ref),f=parseInt(d.getPropertyValue(`margin-top`),10),p=parseInt(d.getPropertyValue(`margin-bottom`),10),m=parseInt(d.getPropertyValue(`margin-left`),10),h=parseInt(d.getPropertyValue(`margin-right`),10),g=f+p+u.top+n+l.height;m+h+u.left+r+l.width>c.right&&u.left+r>l.width?(s=r-l.width,i.push(JC.X.LEFT),a.push(JC.X.RIGHT)):(s=r,i.push(JC.X.RIGHT),a.push(JC.X.LEFT)),g>c.bottom&&u.top+n>l.height?(o=n-l.height,i.push(JC.Y.TOP),a.push(JC.Y.BOTTOM)):(o=n,i.push(JC.Y.BOTTOM),a.push(JC.Y.TOP)),this.props.renderToBody&&(o+=u.top,s+=u.left),this.ref.style.top=`${o}px`,this.ref.style.left=`${s}px`,(e=this.ref.classList).remove.apply(e,a),(t=this.ref.classList).add.apply(t,i)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.style,r=t.className,i=t.innerRef,a=t.children,o=t.renderToBody,s=document.body,c=U.createElement(`div`,{ref:function(t){e.ref=t,i(t)},className:`rta__autocomplete ${r||``}`,style:n},a);return o&&s!==null?A_.createPortal(c,s):c}}]),t}(U.Component),$C=function(e){LC(t,e);function t(e){var n;OC(this,t),n=PC(this,FC(t).call(this,e)),n.state={top:null,left:null,currentTrigger:null,actualToken:``,data:null,value:``,dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},n.escListenerInit=function(){n.escListener||=UC.add(HC.ESC,n._closeAutocomplete)},n.escListenerDestroy=function(){n.escListener&&(UC.remove(n.escListener),n.escListener=null)},n.getSelectionPosition=function(){return n.textareaRef?{selectionStart:n.textareaRef.selectionStart,selectionEnd:n.textareaRef.selectionEnd}:null},n.getSelectedText=function(){if(!n.textareaRef)return null;var e=n.textareaRef,t=e.selectionStart,r=e.selectionEnd;return t===r?null:n.state.value.substr(t,r-t)},n.setCaretPosition=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;n.textareaRef&&(n.textareaRef.focus(),n.textareaRef.setSelectionRange(e,e))},n.getCaretPosition=function(){return n.textareaRef?n.textareaRef.selectionEnd:0},n._handleCaretChange=function(e){var t=function(){var e=n.getCaretPosition()-1;n.lastTrigger=n.lastTrigger?e:0};if(e.type===`keydown`){switch(e.keyCode||e.which){case HC.UP:case HC.DOWN:n._isAutocompleteOpen()||t();break;case HC.LEFT:case HC.RIGHT:t();break;default:}return}t()},n._onSelect=function(e){var t=n.state,r=t.selectionEnd,i=t.currentTrigger,a=t.value,o=n.props.onItemSelected;if(i){var s=n._getTextToReplace(i);if(!s){n._closeAutocomplete();return}var c=s(e);if(!c){n._closeAutocomplete();return}o&&o({currentTrigger:i,item:e});var l=function(e,t,n){switch(e){case`start`:return n;case`next`:case`end`:return n+t.length;default:if(!Number.isInteger(e))throw Error(`RTA: caretPosition should be "start", "next", "end" or number.`);return e}},u=a.slice(0,r),d=ZC(i),f=u.length-u.lastIndexOf(i),p=u.search(RegExp(`(?!${d})\$`))-f,m=c.caretPosition===`next`?`${c.text} `:c.text,h=l(c.caretPosition,m,p),g=u.substring(0,p)+m,_=a.replace(u,g);n.setState({value:_,dataLoading:!1},function(){var e=n.tokenRegExpEnding.exec(m),t=e?e[0].length:1;n.lastTrigger=h&&h-t,n.textareaRef.value=_,n.textareaRef.selectionEnd=h,n._changeHandler();var r=n.textareaRef.scrollTop;n.setCaretPosition(h),window.chrome&&(n.textareaRef.scrollTop=r)})}},n._getTextToReplace=function(e){var t=n.props.trigger[e];if(!e||!t)return null;var r=t.output;return function(t){if(typeof t==`object`&&(!r||typeof r!=`function`))throw 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(r){var n=r(t,e);if(n===void 0||typeof n==`number`)throw Error(`Output functor should return string or object in shape {text: string, caretPosition: string | number}.
- Got "${String(n)}". Check the implementation for trigger "${e}"
- See https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for more information.
- `);if(n===null)return null;if(typeof n==`string`)return{text:n,caretPosition:qC};if(!n.text&&typeof n.text!=`string`)throw Error(`Output "text" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "${e}"
- `);if(!n.caretPosition)throw Error(`Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "${e}"
- `);return n}if(typeof t!=`string`)throw Error(`Output item should be string
- `);return{text:`${e}${t}${e}`,caretPosition:qC}}},n._getCurrentTriggerSettings=function(){var e=n.state.currentTrigger;return e?n.props.trigger[e]:null},n._getValuesFromProvider=function(){var e=n.state,t=e.currentTrigger,r=e.actualToken,i=n._getCurrentTriggerSettings();if(!(!t||!i)){var a=i.dataProvider,o=i.component;if(typeof a!=`function`)throw Error(`Trigger provider has to be a function!`);n.setState({dataLoading:!0});var s=a(r);s instanceof Promise||(s=Promise.resolve(s)),s.then(function(e){if(!Array.isArray(e))throw Error(`Trigger provider has to provide an array!`);if(typeof o!=`function`)throw Error(`Component should be defined!`);if(t===n.state.currentTrigger){if(!e.length){n._closeAutocomplete();return}n.setState({dataLoading:!1,data:e,component:o})}}).catch(function(e){return YC(e.message)})}},n._getSuggestions=function(){var e=n.state,t=e.currentTrigger,r=e.data;return!t||!r||r&&!r.length?null:r},n._createRegExp=function(){var e=n.props.trigger;n.tokenRegExp=RegExp(`(${Object.keys(e).sort(function(e,t){return e<t?1:e>t?-1:0}).map(function(e){return ZC(e)}).join(`|`)})((?:(?!\\1)[^\\s])*\$)`),n.tokenRegExpEnding=RegExp(`(${Object.keys(e).sort(function(e,t){return e<t?1:e>t?-1:0}).map(function(e){return ZC(e)}).join(`|`)})\$`)},n._closeAutocomplete=function(){var e=n.state.currentTrigger;n.escListenerDestroy(),n.setState({data:null,dataLoading:!1,currentTrigger:null},function(){e&&n._onItemHighlightedHandler(null)})},n._cleanUpProps=function(){var e=DC({},n.props),t=`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`.split(`.`);for(var r in e)t.includes(r)&&delete e[r];return e},n._changeHandler=function(e){var t=n.props,r=t.trigger,i=t.onChange,a=t.minChar,o=t.onCaretPositionChange,s=t.movePopupAsYouType,c=n.state,l=c.top,u=c.left,d=e;d||(d=new uee.default(`change`,{bubbles:!0}),n.textareaRef.dispatchEvent(d));var f=d.target||n.textareaRef,p=f.selectionEnd,m=f.value;n.lastValueBubbledEvent=m,i&&d&&(d.persist&&d.persist(),i(new Proxy(d,{get:function(e,t,n){return t===`target`?f:Reflect.get(e,t,n)}}))),o&&o(n.getCaretPosition()),n.setState({value:m});var h=function(){var e=(0,lee.default)(f,p),t=e.top,r=e.left;n.setState({top:t-n.textareaRef.scrollTop||0,left:r})},g=function(e){n.lastTrigger=p-e,n._closeAutocomplete(),h()};if(p<=n.lastTrigger){var _=m.slice(0,p),v=n.tokenRegExp.exec(_);g(v?v[0].length:0)}var y=m.slice(n.lastTrigger,p),b=n.tokenRegExp.exec(y),x=b&&b[0],S=b&&b[1]||null,C=S?S.length-1:0,w=n.tokenRegExpEnding.exec(y);if(w?g(w[0].length):n._isAutocompleteOpen()||n._closeAutocomplete(),(!x||x.length<=a+C)&&(n.state.currentTrigger&&!r[n.state.currentTrigger].allowWhitespace||!n.state.currentTrigger)){n._closeAutocomplete();return}if(S&&r[S].afterWhitespace&&!/\s/.test(m[p-x.length-1])&&m[p-x.length-1]!==void 0){n._closeAutocomplete();return}if(n.state.currentTrigger&&r[n.state.currentTrigger].allowWhitespace){if(b=RegExp(`${ZC(n.state.currentTrigger)}.*\$`).exec(m.slice(0,p)),x=b&&b[0],!x){n._closeAutocomplete();return}S=Object.keys(r).find(function(e){return e.slice(0,C+1)===x.slice(0,C+1)})||null}var T=x.slice(1);if(S){(s||l===null&&u===null||n.state.currentTrigger!==S)&&h(),n.escListenerInit();var E=n._getTextToReplace(S);n.setState({selectionEnd:p,currentTrigger:S,textToReplace:E,actualToken:T},function(){try{n._getValuesFromProvider()}catch(e){YC(e.message)}})}},n._selectHandler=function(e){var t=n.props,r=t.onCaretPositionChange,i=t.onSelect;r&&r(n.getCaretPosition()),i&&(e.persist(),i(e))},n._shouldStayOpen=function(e){var t=e.relatedTarget;return t===null&&(t=document.activeElement),!!(n.dropdownRef&&t instanceof Node&&n.dropdownRef.contains(t))},n._onClick=function(e){var t=n.props.onClick;t&&(e.persist(),t(e)),!n._shouldStayOpen(e)&&n._closeAutocomplete()},n._onBlur=function(e){var t=n.props.onBlur;t&&(e.persist(),t(e)),!n._shouldStayOpen(e)&&n._closeAutocomplete()},n._onScrollHandler=function(){n._closeAutocomplete()},n._onItemHighlightedHandler=function(e){var t=n.props.onItemHighlighted,r=n.state.currentTrigger;if(t)if(typeof t==`function`)t({currentTrigger:r,item:e});else throw Error("`onItemHighlighted` has to be a function")},n._dropdownScroll=function(e){var t=n.props.scrollToItem;if(t){if(t===!0){KC(n.dropdownRef,e);return}if(typeof t!=`function`||t.length!==2)throw Error("`scrollToItem` has to be boolean (true for default implementation) or function with two parameters: container, item.");t(n.dropdownRef,e)}},n._isAutocompleteOpen=function(){var e=n.state,t=e.dataLoading,r=e.currentTrigger,i=n._getSuggestions();return!!((t||i)&&r)},n._textareaRef=function(e){n.props.innerRef&&n.props.innerRef(e),n.textareaRef=e},n.lastTrigger=0,n.escListener=null;var r=n.props,i=r.loadingComponent,a=r.trigger,o=r.value;if(o&&(n.state.value=o),n._createRegExp(),!i)throw Error(`RTA: loadingComponent is not defined`);if(!a)throw Error(`RTA: trigger is not defined`);return n}return AC(t,[{key:`componentDidMount`,value:function(){UC.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(e){var t=e.trigger,n=e.value,r=this.props,i=r.trigger,a=r.value;Object.keys(i).join(``)!==Object.keys(t).join(``)&&this._createRegExp(),n!==a&&this.lastValueBubbledEvent!==a&&(this.lastTrigger=0,this._changeHandler())}},{key:`componentWillUnmount`,value:function(){this.escListenerDestroy(),UC.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 e=this,t=this.props,n=t.loadingComponent,r=t.style,i=t.className,a=t.listStyle,o=t.itemStyle,s=t.boundariesElement,c=t.movePopupAsYouType,l=t.listClassName,u=t.itemClassName,d=t.dropdownClassName,f=t.dropdownStyle,p=t.containerStyle,m=t.containerClassName,h=t.loaderStyle,g=t.loaderClassName,_=t.textAreaComponent,v=t.renderToBody,y=this.state,b=y.left,x=y.top,S=y.dataLoading,C=y.component,w=y.value,T=y.textToReplace,E=this._isAutocompleteOpen(),D=this._getSuggestions(),O={},k;return _.component?(k=_.component,O[_.ref]=this._textareaRef):(k=_,O.ref=this._textareaRef),U.createElement(`div`,{className:`rta ${S===!0?`rta--loading`:``} ${m||``}`,style:p},U.createElement(k,Object.assign({},this._cleanUpProps(),{className:`rta__textarea ${i||``}`,onChange:this._changeHandler,onSelect:this._selectHandler,onScroll:this._onScrollHandler,onClick:this._onClick,onBlur:this._onBlur,value:w,style:r},O)),E&&U.createElement(QC,{innerRef:function(t){e.dropdownRef=t},top:x,left:b,style:f,className:d,movePopupAsYouType:c,boundariesElement:s,textareaRef:this.textareaRef,renderToBody:v},D&&C&&T&&U.createElement(GC,{values:D,component:C,style:a,className:l,itemClassName:u,itemStyle:o,getTextToReplace:T,onItemHighlighted:this._onItemHighlightedHandler,onSelect:this._onSelect,dropdownScroll:this._dropdownScroll}),S&&U.createElement(`div`,{className:`rta__loader ${D===null?`rta__loader--empty-suggestion-data`:`rta__loader--suggestion-data`} ${g||``}`,style:h},U.createElement(n,{data:D}))))}}],[{key:`getDerivedStateFromProps`,value:function(e){var t=e.value;return t==null?null:{value:t}}}]),t}(U.Component);$C.defaultProps={movePopupAsYouType:!1,value:null,minChar:1,boundariesElement:`body`,scrollToItem:!0,textAreaComponent:`textarea`,renderToBody:!1},Yg(),Ai();var ew=()=>{let{app:e}=L.getState(),t=e.metadataCache.getTags();return[...Object.keys(t)].map(e=>e.split(`#`).pop())},tw=e=>{let t=[],n=L.getState().settings;if(n&&n?.UseVaultTags)t=ew();else{let{tags:e}=V.getState();t=e}let r=e.toLowerCase(),i=[];return t.forEach(e=>{e&&e.toLowerCase().contains(r)&&i.push({name:e,char:e})}),i};Ai();var nw=e=>{let{app:t}=L.getState(),n=t.vault.getAllLoadedFiles(),r=[],i;return n.forEach(t=>{e===`[`?i=``:e.contains(`[`)&&(i=e.slice(1));let n=i.toLowerCase();t instanceof f.TFile&&[`md`,`png`,`jpg`,`canvas`,`jpeg`,`gif`].contains(t.extension)&&t.path.toLowerCase().contains(n)&&r.push({name:t.basename,char:t.name,file:t})}),r},rw=u(s(((e,t)=>{var n=C(),r=function(e){return typeof e==`function`};t.exports=function(e){var t=n.useState(e),i=t[0],a=t[1],o=n.useRef(i);return[i,n.useCallback(function(e){o.current=r(e)?e(o.current):e,a(o.current)},[]),o]}}))());I(),Mi(),H(),li(),fn();var iw=rn(`editor-history-db`,`editor-history-store`),aw=50;function ow(e,t){return`thinoEditorHistory:${e}:${t||`view`}`}async function sw(e,t,n){try{if(!t?.appId)return;let r=ow(t.appId,n),i=await on(r,iw)||[];if(i.some(t=>t.content===e))return;await sn(r,[{content:e,timestamp:Date.now()},...i].slice(0,aw),iw)}catch(e){console.error(`Failed to save editor history:`,e)}}var cw=(0,f.debounce)((e,t,n)=>{sw(e,t,n)},1e3);async function lw(e,t){try{return e?.appId&&await on(ow(e.appId,t),iw)||[]}catch(e){return console.error(`Failed to get editor history:`,e),[]}}async function uw(e,t){try{if(!e?.appId)return;await cn(ow(e.appId,t),iw)}catch(e){console.error(`Failed to clear editor history:`,e)}}function dw(e){return e.containerEl.matches(`.memos-list-view`)}function fw(){}function pw(e){let t=e.app.workspace.getLeavesOfType(`thino_view`)[0];return{app:e.app,showSearch:fw,toggleMode:fw,onMarkdownScroll:fw,getMode:()=>`source`,getViewType:()=>`thino_view`,id:t?.id||N.randomId(6),scroll:0,editMode:null,get file(){return t?.view?.file||null},get path(){return(t?.view)?.file?.path||``}}}var mw=(e,t)=>{let{app:n,plugin:r,view:i,dailyNotes:a}=F(),[o,s]=(0,U.useState)(null),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(``),[p,m]=(0,U.useState)(null),[h,g]=(0,U.useState)(!0),[_,v]=(0,U.useState)(!1),y=(0,U.useRef)(null),b=(0,U.useRef)((0,f.debounce)(async(e,t,n)=>{_w(e,t,n),e.trim()&&!_&&await cw(e,t,n)},100)),x=(0,U.useRef)();(0,U.useEffect)(()=>{if(!p){if(!a&&!(n&&window.app)){let e=(n||window.app)?.vault.getMarkdownFiles();m(e[0]);return}for(let e in a)if(a[e]instanceof f.TFile){m(a[e]);break}}},[a]),(0,U.useEffect)(()=>{if(!r?.MarkdownEditor){console.log(`MarkdownEditor is not available or not a constructor`);return}if(!e)return;class a extends r.MarkdownEditor{updateBottomPadding(){}onUpdate(e,t){super.onUpdate(e,t),C&&C(this.get()),(e.docChanged||e.selectionSet)&&requestAnimationFrame(()=>{try{let t=e.view.dom.closest(`.common-editor-inputer`);if(!t)return;let n=e.view.state.selection.main.head,r=e.view.coordsAtPos(n);if(!r)return;let i=t.getBoundingClientRect();r.bottom>i.bottom?t.scrollTop+=r.bottom-i.bottom+4:r.top<i.top&&(t.scrollTop-=i.top-r.top+4)}catch{}})}}let o=pw(r),c=r.addChild(new a(n,e,o));c&&!t&&i&&R.setInstance(`${i.leaf?.id}`,c),o.editMode=c,c.owner.editor=c.editor;let u=gw(n,t?`modal`:`view`);return c.set&&c.set(u||``,!0),n.workspace.trigger(`thino-editor-created`,e,c.editor),x.current=c.cm,l(!0),s(c),()=>{console.log(`Obsidian-Memos: Removed editor instance.`),l(!1),c?.destroy?.(),r.removeChild(c),x.current=null,y.current=null}},[e,r]),(0,U.useEffect)(()=>{!o||!n||(b.current(u,n,t?`modal`:`view`),h&&g(!1),y.current&&y.current(u))},[u,n]);let S=()=>{o&&o.toggleSource()},C=(0,f.debounce)(e=>w(e),500,!0),w=e=>{d(e)};return{instance:o,value:u,set:e=>{try{o&&(console.log(e),(o?.editor).replaceSelection(e),d(e))}catch(e){console.error(e)}},get:()=>o?o.get():``,append:(e,t)=>{if(!o||t&&t!==i?.leaf?.id)return;let n=(o.get()||``)+e;(o?.editor).replaceSelection(e),d(n)},clear:async(e=!1)=>{o&&(o.clear(),d(``),_w(``,n,t?`modal`:`view`),e&&await uw(n,t?`modal`:`view`))},toggleSource:S,getHistoryEntries:async()=>!o||!n?[]:await lw(n,t?`modal`:`view`),setFullContent:(e,r=!1)=>{o&&(v(r),o.set(e),b.current(e,n,t?`modal`:`view`),v(!1))},editorView:x.current}};function hw(e,t){return`thinoEditorContentCache:${e}:${t||`view`}`}function gw(e,t){try{if(!e?.appId)return``;let n=hw(e.appId,t);return ji.get([n])[n]||``}catch(e){return console.error(e),``}}function _w(e,t,n){try{if(!t?.appId)return;let r=hw(t.appId,n);ji.set({[r]:e})}catch(e){console.error(e)}}li(),M();var vw=(0,U.memo)(({value:e,maxCount:t=100})=>{let[n,r]=(0,U.useState)(0);return(0,U.useEffect)(()=>{let t=e.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,``);r(N.getWordCount(t))},[e]),(0,W.jsxs)(`div`,{className:x_(`thino-editor-word-count`,n>t&&t>0&&`exceeded`),children:[n,` `,t>0&&(0,W.jsxs)(`span`,{children:[` / `,t]}),` `,j(`word`)]})},(e,t)=>e.value===t.value&&e.maxCount===t.maxCount);I(),Mi(),yr(),M(),H();function yw(e,t){return{line:e.line,ch:e.ch+t}}var bw=({entity:{name:e,char:t,file:n}})=>(0,W.jsx)(`div`,{children:`${t}`}),xw=({data:e})=>(0,W.jsx)(`div`,{children:`Loading`}),Sw,Cw=(0,U.forwardRef)((e,t)=>{let{useTinyUndoHistoryCache:n,globalEditorShown:r,memoListView:i}=vi(),{settings:a,app:o}=F(),{SaveMemoButtonLabel:s,SaveMemoButtonIcon:c}=a,{className:l,inputerType:u,initialContent:d,placeholder:p,showConfirmBtn:m,showCancelBtn:h,onConfirmBtnClick:g,onCancelBtnClick:_,onContentChange:v,onCheckCount:y}=e,b=(0,U.useRef)(null),x=(0,U.useRef)(null),S=(0,U.useRef)(null),C=oee(),{instance:w,value:T,set:E,get:D,append:O,clear:k,toggleSource:ee,setFullContent:A}=mw(x.current,e.modal),[,te,ne]=(0,rw.default)(0),[re,ie]=(0,rw.default)(!1);(0,U.useEffect)(()=>{if(a&&a.FocusOnEditor)switch(u){case`minimal`:case`memos`:b.current?.focus();break;case`obsidian`:w&&w.editor?.focus()}},[a,w]),(0,U.useEffect)(()=>{if(!o)return;let e=o.workspace.getLeavesOfType(MW),t,n;e.length>0?(n=e[0].view.containerEl,t=n.offsetHeight):(n=document,t=window.outerHeight),te(t)},[o]),(0,U.useEffect)(()=>{!b.current||u===`obsidian`||d&&(b.current.value=d,C())},[]),(0,U.useEffect)(()=>{if(u!==`obsidian`)if(n){if(!b.current)return;let{tinyUndoActionsCache:e,tinyUndoIndexCache:t}=ji.get([`tinyUndoActionsCache`,`tinyUndoIndexCache`]);return S.current=new aee(b.current,{interval:5e3,initialActions:e,initialIndex:t}),S.current.subscribe((e,t)=>{ji.set({tinyUndoActionsCache:e,tinyUndoIndexCache:t})}),()=>{S.current?.destroy()}}else S.current?.destroy(),S.current=null,ji.remove([`tinyUndoActionsCache`,`tinyUndoIndexCache`])},[n]),(0,U.useEffect)(()=>{b.current&&(b.current.style.height=`auto`,b.current.style.height=(b.current.scrollHeight??0)+`px`)},[b.current?.value]),(0,U.useImperativeHandle)(t,()=>({element:b.current,blur:()=>{switch(u){case`minimal`:case`memos`:b.current?.blur();break;case`obsidian`:w&&w.editor?.blur()}},focus:e=>{switch(u){case`minimal`:case`memos`:b.current?.focus();break;case`obsidian`:if(w){if(console.log(e,e!==w?.owner?.view?.leaf?.id),e&&e!==w?.owner?.view?.leaf?.id)return;w.editor?.focus()}}},insertTag:e=>{switch(u){case`minimal`:case`memos`:{if(!b.current)return;let e=b.current.value;b.current.value=e.slice(0,b.current.selectionStart)+`# `+e.slice(b.current.selectionStart),v(b.current.value),C();break}case`obsidian`:if(e&&e!==w?.owner?.view?.leaf?.id)return;if(w){let e=w.editor,t=e.getCursor(`from`);e.replaceRange(`#`,t),e.setSelection(yw(t,1))}break}},insertText:(e,t)=>{switch(u){case`minimal`:case`memos`:{if(!b.current)return;let t=b.current.value;b.current.value=t.slice(0,b.current.selectionStart)+e+t.slice(b.current.selectionStart),v(b.current.value),C()}break;case`obsidian`:w&&O(e,t);break}},setContent:e=>{switch(u){case`minimal`:case`memos`:b.current&&(b.current.value=e,v(b.current.value),C());break;case`obsidian`:w&&E(e);break}},updateContent:e=>{switch(u){case`minimal`:case`memos`:b.current&&(b.current.value=e);break;case`obsidian`:w&&A(e);break}},getContent:()=>{switch(u){case`minimal`:case`memos`:return b.current?b.current.value:``;case`obsidian`:return D()}},toggleSource:()=>{switch(u){case`minimal`:case`memos`:break;case`obsidian`:ee();break}},clear:(e=!1)=>{switch(u){case`minimal`:case`memos`:b.current&&(b.current.value=``,v(b.current.value),C());break;case`obsidian`:k(e);break}}}),[w,u]);let ae=e=>{if(!b.current)return;let{fileManager:t}=vr.getState().dailyNotesState.app;if(e.currentTrigger===`#`){let t=b.current.value,n;n=Sw==null?0:Sw.length;let r=b.current.selectionStart;for(let e=0;e<t.length;e++)/\s/g.test(t[r])||r++;b.current.value=t.slice(0,b.current.selectionStart-n)+e.item.char+t.slice(r),v(b.current.value),C()}else if(e.currentTrigger===`[[`){let n=t.generateMarkdownLink(e.item.file,e.item.file.path,``,``),r=b.current.value,i;i=Sw==null?2:n.contains(`[[`)?Sw.length+1:e.item.file.extension===`md`?Sw.length+2:Sw.length+1;let a=b.current.selectionStart;for(let e=0;e<r.length;e++)/\s/g.test(r[a])||a++;b.current.value=r.slice(0,b.current.selectionStart-i)+n+r.slice(a),v(b.current.value),C()}},oe=(0,U.useCallback)(()=>{v(b.current?.value||``),C()},[]),se=async()=>{switch(u){case`minimal`:case`memos`:if(!b.current)return;b.current.value=le(),g(b.current.value),b.current.value=``,C(),S.current?.resetState();break;case`obsidian`:await y(D())?(g(D()),k(!0),C()):new f.Notice(j(`Word count exceeded`));break}},ce=(0,U.useCallback)(()=>{switch(u){case`minimal`:case`memos`:b.current&&(b.current.value=``,v(b.current.value),C());break;case`obsidian`:k(!1);break}_()},[u,w,b]),le=()=>ji.get([`thinoEditorContentCache`]).thinoEditorContentCache||``,ue=()=>{if(b.current)return b.current.value=le(),b.current.value};return(0,W.jsxs)(`div`,{className:`common-editor-wrapper `+l,children:[(e=>{switch(e){case`memos`:return(0,W.jsx)($C,{className:`common-editor-inputer scroll ${re?` editing`:``}`,loadingComponent:xw,placeholder:p,movePopupAsYouType:!0,value:ue(),innerRef:e=>{b.current=e},onFocus:()=>{ie(!0)},onBlur:()=>{ie(!1)},onInput:oe,style:{maxHeight:`100%`,minHeight:`100px`},dropdownStyle:{minWidth:180,maxHeight:250,overflowY:`auto`},minChar:0,onItemSelected:ae,scrollToItem:!0,trigger:{"#":{dataProvider:e=>(Sw=e,tw(e).map(({name:e,char:t})=>({name:e,char:t}))),component:bw,afterWhitespace:!0,output:e=>e.char},"[[":{dataProvider:e=>(Sw=e,nw(e).slice(0,10).map(({name:e,char:t,file:n})=>({name:e,char:t,file:n}))),component:bw,afterWhitespace:!0,output:e=>e.char}}});case`minimal`:return(0,W.jsx)(`textarea`,{style:{minHeight:48},className:`common-editor-inputer scroll`,rows:1,placeholder:p,ref:b,onInput:oe});case`obsidian`:return(0,W.jsx)(`div`,{className:`common-editor-inputer common-editor-mod-cm6`,onClick:()=>{w?.editor?.focus()},ref:x});default:return(0,W.jsx)(`div`,{className:`common-editor-inputer common-editor-mod-cm6`,ref:x})}})(u),(0,W.jsxs)(`div`,{className:`common-tools-wrapper`,children:[(0,W.jsx)(`div`,{className:`common-tools-container`,children:(0,W.jsx)(Ov,{when:e.tools!==void 0,children:e.tools})}),(0,W.jsxs)(`div`,{className:`btns-container`,children:[a.enableWordCount&&(0,W.jsx)(vw,{value:T,maxCount:a.maxWordCount}),(0,W.jsx)(Ov,{when:h,children:(0,W.jsx)(`button`,{className:`action-btn cancel-btn`,onClick:()=>{a&&a.DefaultEditorLocation===`Top`&&!r&&ce()},onPointerDown:()=>{(a&&a.DefaultEditorLocation===`Bottom`||r)&&ce()},children:z.getState().pathname===`/`&&i===`chat`&&(a?.chatViewStyle===`fluent`||a?.chatViewStyle===`inline`)?``:j(`CANCEL EDIT`)})}),(0,W.jsx)(Ov,{when:!!e.clipboardText&&m&&!h,children:(0,W.jsx)(`button`,{"aria-label":j(`Paste clipboard content and save as new thino`),className:`action-btn confirm-btn paste-create-btn`,onClick:async()=>{a&&a.DefaultEditorLocation===`Top`&&!r&&e.onPasteAndCreate?.()},onPointerDown:async()=>{(a&&a.DefaultEditorLocation===`Bottom`||r)&&e.onPasteAndCreate?.()},children:j(`Paste`)})}),(0,W.jsx)(Ov,{when:m,children:(0,W.jsxs)(`button`,{"aria-label":j(`Ctrl/Cmd + Enter to save thino`),className:`action-btn confirm-btn`,onClick:async()=>{a&&a.DefaultEditorLocation===`Top`&&!r&&await se()},onPointerDown:async()=>{(a&&a.DefaultEditorLocation===`Bottom`||r)&&await se()},children:[i===`chat`&&(a?.chatViewStyle===`fluent`||a?.chatViewStyle===`inline`)?``:s,(0,W.jsx)(`span`,{className:`icon-text`,children:null})]})})]})]})]})}),ww=(e,t)=>({placement:e,modifiers:[{name:`flip`,options:{allowedAutoPlacements:t,rootBoundary:`document`}},{name:`preventOverflow`,options:{rootBoundary:`document`}}]}),Tw=e=>{let t=(0,U.useRef)(null),[n,r]=(0,U.useState)(null),[i,a]=(0,U.useState)(0),o,s,c=()=>{if(f.Platform.isMobile){o=`right-end`,s=[`bottom`];return}let t=window.innerWidth-i>280*1.2,n=window.innerWidth-i<280,r=window.innerWidth>280*1.5;if(e.DefaultEditorLocation!==`Bottom`){t?(o=`right-end`,s=[`left-end`]):n&&r?(o=`left-end`,s=[`right-end`]):(o=`bottom`,s=[`bottom`]);return}t?(o=`top-end`,s=[`top-start`]):n&&i>280?(o=`top-start`,s=[`top-end`]):(o=`top`,s=[`top`])};return(0,U.useEffect)(()=>{e&&c()},[i,e?.DefaultEditorLocation]),{setPosX:a,popperRef:t,setPopperElement:r,popper:Vb(t.current,n,ww(o,s))}};Ve(),nt(),tn(),bn();var Ew=ze()(Qe(Ye(tt(en(e=>({conversations:[],activeConversationId:null,isProcessing:!1,selectedMessageIds:[],createConversation:(t,n)=>{let r=`inline-conv-${Date.now()}`,i=Date.now();return e(e=>{e.conversations.push({id:r,afterThinoId:t,beforeThinoId:n,messages:[],createdAt:i,updatedAt:i,isActive:!0})}),r},addMessage:(t,n)=>e(e=>{let r=e.conversations.find(e=>e.id===t);r&&(r.messages.push(n),r.updatedAt=Date.now())}),updateMessage:(t,n,r)=>e(e=>{let i=e.conversations.find(e=>e.id===t);if(!i)return;let a=i.messages.find(e=>e.id===n);a&&(Object.assign(a,r),i.updatedAt=Date.now())}),deactivateConversation:t=>e(e=>{let n=e.conversations.find(e=>e.id===t);n&&(n.isActive=!1,n.isCollapsed=!0,n.updatedAt=Date.now())}),reactivateConversation:t=>e(e=>{let n=e.conversations.find(e=>e.id===t);n&&(n.isActive=!0,n.isCollapsed=!1,n.updatedAt=Date.now())}),removeConversation:t=>e(e=>{e.conversations=e.conversations.filter(e=>e.id!==t)}),setActiveConversation:t=>e(e=>{e.activeConversationId=t}),setIsProcessing:t=>e(e=>{e.isProcessing=t}),toggleCollapseConversation:t=>e(e=>{let n=e.conversations.find(e=>e.id===t);n&&(n.isCollapsed=!n.isCollapsed)}),toggleMessageSelection:t=>e(e=>{let n=e.selectedMessageIds.indexOf(t);n>=0?e.selectedMessageIds.splice(n,1):e.selectedMessageIds.push(t)}),selectSingleMessage:t=>e(e=>{e.selectedMessageIds=[t]}),clearMessageSelection:()=>e(e=>{e.selectedMessageIds=[]})})),{name:`inline-super-store-cache`,storage:yn.ui,partialize:e=>({conversations:e.conversations}),version:1}),{name:`inline-super-store`})));I(),H(),li(),Mi(),M(),$r(),Do(),Av(),zv(),Ba(),Rg();var Dw=()=>{let e=new Set,t=z.getState().query.filter,n=z.getState().query.tag,r=Zg.getQueryById(t||``);if(r&&r.querystring){let t=JSON.parse(r.querystring);if(Array.isArray(t))for(let n of t)n.type===`TAG`&&n.value&&n.value.operator===`CONTAIN`&&typeof n.value.value==`string`&&e.add(n.value.value)}return n&&e.add(n),Array.from(e)},Ow=e=>{let{offsetLeft:t,offsetTop:n,offsetHeight:r,offsetWidth:i,selectionEnd:a}=e,o=document.createElement(`div`),s=window.getComputedStyle(e);for(let e of s)o.style.setProperty(e,s.getPropertyValue(e));o.style.position=`fixed`,o.style.visibility=`hidden`,o.style.whiteSpace=`pre-wrap`;let c=e.tagName===`INPUT`?e.value.replace(/ /g,`.`):e.value;o.textContent=c.substring(0,a||0),e.tagName===`TEXTAREA`&&(o.style.height=`auto`);let l=document.createElement(`span`);l.textContent=c.substring(a||0)||`.`,o.appendChild(l),document.body.appendChild(o);let{offsetLeft:u,offsetTop:d,offsetHeight:f,offsetWidth:p}=l;return document.body.removeChild(o),{x:t+u,y:n+d,h:r+f,w:i+p}};function kw(e){if(e)try{return JSON.parse(e)}catch{return}}var Aw=({className:e,editorType:t,destroy:n,modal:r})=>{let i=vi(),{app:a,settings:o,view:s,verifyState:c}=F(),[l,u]=Wb(!0),d=(0,U.useRef)(l),[p,m]=(0,rw.default)(!0),h=(0,U.useRef)(null),g=(0,U.useRef)(null),_=(0,U.useRef)(i),[v,y]=(0,rw.default)(!1),[b,x]=(0,rw.default)(!1),{setPosX:S,popperRef:C,setPopperElement:w,popper:T}=Tw(o),[E]=(0,rw.default)(parseInt((0,f.moment)().format(`x`))),D=(0,U.useRef)(null),O=o?.EnabledLocationList.length===1?o.EnabledLocationList[0].value:o?.MemoSaveLocation||`DAILY`,[k,ee]=(0,rw.default)(O),A=(0,U.useRef)(O),[te,ne]=(0,rw.default)(``);(0,U.useEffect)(()=>{d.current=l},[l]),(0,U.useEffect)(()=>{!g.current||!a||!s||(s.registerEvent(a.workspace.on(`focus-on-textarea`,e=>{g.current?.focus(e?.id)})),s.registerEvent(a.workspace.on(`blur-on-memos`,()=>{g.current?.blur()})),s.registerEvent(a.workspace.on(`send-to-thino`,async(e,t)=>{if(console.log(e),typeof e==`string`)g.current?.insertText(e+`
- `,t.id);else{let n=e.toPNG(),r=new Blob([n],{type:`image/png`}),i=new File([r],`image.png`,{type:`image/png`,lastModified:Date.now()});if(!i)return;let a=await ce(i);a&&g.current?.insertText(a+`
- `,t.id)}})))},[g,s,a]),(0,U.useEffect)(()=>{o&&u(o.DefaultPrefix===`List`)},[o?.DefaultPrefix]),(0,U.useEffect)(()=>{o&&ee(o.EnabledLocationList.length===1?o.EnabledLocationList[0].value:o.MemoSaveLocation||`DAILY`)},[o?.MemoSaveLocation,o?.EnabledLocationList]),(0,U.useEffect)(()=>{if(!o||!D.current)return;let e=Qr.find(e=>e.title===k)?.icon;(0,f.setIcon)(D.current,e),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(D.current,j(`Thino Save To: `)+k),A.current=k;let t=i.manifest;if(t){let e=a?.plugins.getPlugin(t.id);if(e){if(e.settings.MemoSaveLocation===k)return;e.settings.MemoSaveLocation=k,e.saveSettings()}}},[k,p]),(0,U.useEffect)(()=>{g.current&&o&&o.MemoSaveLocation&&o.EnabledLocationList.length!==1&&ee(o.MemoSaveLocation)},[D,o?.MemoSaveLocation,o?.EnabledLocationList]),(0,U.useEffect)(()=>{if(!g.current||!o||f.Platform.isDesktop||i.globalEditorShown)return;let e=o.UseButtonToShowEditor&&o.DefaultEditorLocation===`Bottom`;if(f.Platform.isDesktop){m(!0);return}if(t&&t===`inline`){m(!0);return}if(m(f.Platform.isMobile&&!e),!e||i.memoListView===`chat`)return;let n=document.body.find(`.memolist-scrollview`);n&&(n.onscroll=()=>{if(i.globalEditorShown)return;if(!i.memoListView&&R.getState().memoListView===`chat`){n.onscroll=null;return}let t=g.current.getContent();f.Platform.isMobile&&e&&!t&&m(!1)})},[i.globalEditorShown,t,g]);let re=()=>{x(!1)};(0,U.useEffect)(()=>{if(a&&(i.markMemoId||i.editMemoId?.trim()&&i.editMemoId!==_.current.editMemoId)){let e=a.workspace.getLeavesOfType(`thino_view`);e.length>0&&a.workspace.revealLeaf(e[0])}if(i.markMemoId){let e=V.getMemoById(i.markMemoId);if(e&&e.sourceType===`DAILY`)Ma(e).then(e=>{let t=`${j(`MARK`)}: ${e}`;g.current?.insertText(t),g.current?.focus(),R.setMarkMemoId(``)});else{let e=`${j(`MARK`)}: [@THINO](${i.markMemoId})`;g.current?.insertText(e),g.current?.focus(),R.setMarkMemoId(``)}return}if(i.editMemoId?.trim()&&i.editMemoId!==_.current.editMemoId){let e=V.getMemoById(i.editMemoId);if(e)switch(u(e.thinoType===`JOURNAL`),o.EditorType){case`memos`:g.current?.setContent(e.content.replace(/ \^\S{6}$/,``)||``),g.current?.focus();break;case`obsidian`:g.current?.clear(!1),g.current?.setContent(e.content.replace(/ \^\S{6}$/,``)||``),g.current?.focus();break}}_.current=i},[i.markMemoId,i.editMemoId]),(0,U.useEffect)(()=>{!g.current||v||o.EditorType===`memos`&&(g.current?.element.addEventListener(`paste`,ie),g.current?.element.addEventListener(`drop`,ae),g.current?.element.addEventListener(`click`,oe),y(!0))},[g.current]);let ie=async e=>{if(e.clipboardData&&e.clipboardData.files.length>0){e.preventDefault();let t=e.clipboardData.files;for(let e of t){let t=await ce(e);t&&g.current?.insertText(t)}}},ae=async e=>{if(e.dataTransfer&&e.dataTransfer.files.length>0){e.preventDefault();let t=e.dataTransfer.files;for(let e of t){let t=await ce(e);t&&g.current?.insertText(t)}}},oe=()=>{_e(g.current?.element.value||``)},se=async(e,t)=>{let n=e.ctrlKey||e.metaKey,r=e.altKey;if(e.key===`Escape`&&i.globalEditorShown&&(R.setGlobalEditorShown(!1),e.preventDefault()),n&&e.key===`Enter`){e.preventDefault(),e.stopPropagation(),t?(await de(g.current?.getContent()),g.current?.clear(!0)):await de(g.current?.element.value);return}if(r)for(let t=0;t<o.EnabledLocationList.length;t++)e.key===(t+1).toString()&&ee(o.EnabledLocationList[t].value);setTimeout(()=>{t||_e(g.current?.element.value||``)})},ce=(0,U.useCallback)(async e=>{let{type:t}=e;if(t.startsWith(`image`))try{return`${await t_.upload(e)}`}catch(e){new f.Notice(e)}},[]),le=(0,U.useCallback)(async e=>{if(o.enableWordCount){let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),n=f.Platform.isDesktop?await Pv():t.identifier||t.uuid;if(!(c&&c?.appId===n))return kv(),!1;if(o.maxWordCount===0)return!0;let r=e.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,``),i=N.getWordCount(r),a=o.maxWordCount||1e3;return!(i>a&&a>0)}return!0},[o.enableWordCount,o.maxWordCount]),ue=(0,U.useCallback)(async e=>{let t=Ew.getState(),n=P.getState().memos,r=n.length>0?n[0]:null,i=t.activeConversationId;if(!i||!t.conversations.some(e=>e.id===i&&e.isActive)){let e=t.conversations.find(e=>e.isActive);i=e?e.id:t.createConversation(r?.id??null,null),t.setActiveConversation(i)}let a={id:`inline-msg-${Date.now()}`,role:`user`,content:e,timestamp:Date.now()};t.addMessage(i,a),t.setIsProcessing(!0);let o=`inline-msg-${Date.now()}-a`,s={id:o,role:`assistant`,content:``,timestamp:Date.now(),isStreaming:!0};t.addMessage(i,s);try{let t=(Ew.getState().conversations.find(e=>e.id===i)?.messages??[]).map(e=>({id:e.id,role:e.role,content:e.content,timestamp:e.timestamp})),n=``,r=``,a,s=[],c=0;console.log(`[InlineSuper] streaming started`);for await(let l of fv.chat(e,t)){if(c++,l.toolEvent){let{toolEvent:e}=l;if(e.type===`tool_start`)s.length===0&&(a=n.length),console.log(`[InlineSuper] seq=${c} TOOL_START name=${e.name} id=${e.toolCallId} contentLenAtStart=${a} reasoningLen=${r.length}`),s.push({id:e.toolCallId,name:e.name,arguments:e.arguments||``,parsedArgs:kw(e.arguments),status:`running`}),Ew.getState().updateMessage(i,o,{toolCalls:[...s],toolCallOffset:a});else if(e.type===`tool_result`){console.log(`[InlineSuper] seq=${c} TOOL_RESULT name=${e.name} id=${e.toolCallId}`);let t=s.findIndex(t=>t.id===e.toolCallId);t===-1?console.warn(`[InlineSuper] TOOL_RESULT id=${e.toolCallId} NOT FOUND in toolCalls:`,s.map(e=>e.id)):(s[t]={...s[t],result:e.result,status:`completed`},Ew.getState().updateMessage(i,o,{toolCalls:[...s]}))}}l.reasoning&&(r+=l.reasoning,console.log(`[InlineSuper] seq=${c} REASONING totalLen=${r.length}`),Ew.getState().updateMessage(i,o,{reasoning:r})),l.content&&(n+=l.content,console.log(`[InlineSuper] seq=${c} CONTENT totalLen=${n.length} preview="${l.content.slice(0,40)}"`),Ew.getState().updateMessage(i,o,{content:n}))}console.log(`[InlineSuper] streaming done. contentLen=${n.length} reasoningLen=${r.length} toolCallsCount=${s.length} toolCallOffset=${a} toolStatuses=${s.map(e=>e.status).join(`,`)}`),Ew.getState().updateMessage(i,o,{isStreaming:!1,toolCalls:[...s],reasoning:r||void 0,toolCallOffset:a})}catch(e){Ew.getState().updateMessage(i,o,{content:`Error: ${e.message||`Failed to get response`}`,isStreaming:!1})}finally{Ew.getState().setIsProcessing(!1)}},[]),de=async e=>{if(!e||e.trim()===``){new f.Notice(j(`Content cannot be empty`));return}let t=B.getState().enabled,r=e.trim().match(/^@Super\s+([\s\S]+)/i);if(r&&t&&f.Platform.isDesktop){let e=r[1].trim();g.current?.clear(!0),Mw(``),ue(e);return}let i=Ew.getState();i.activeConversationId&&(i.deactivateConversation(i.activeConversationId),i.setActiveConversation(null));let a=L.getState().settings,o=a?.addTagAutomatically,s=a?.addTagWithNewline,c=a?.addTagPosition,l=(Dw()||[]).filter(t=>!e.includes(`#${t}`)),u=async(e,t)=>{t=t.replaceAll(` `,` `),Mw(``);try{if(!e){let e,n=performance.now();switch(console.log(`[Thino:Perf] saveContent start`),A.current){case`CANVAS`:e=await V.createMemoCanvas({text:t,isList:d.current});break;case`MULTI`:e=await V.createMemoMultiFile({content:t,isList:d.current});break;case`DAILY`:e=await V.createMemoDaily(t,d.current);break;case`FILE`:e=await V.createMemoSingleFile({content:t,isList:d.current});break;case`JOURNAL`:e=await V.createMemoJournalFile({content:t,isList:d.current});break}if(!e)return;console.log(`[Thino:Perf] createMemo done +${(performance.now()-n).toFixed(1)}ms`),V.pushMemo(e),console.log(`[Thino:Perf] pushMemo done +${(performance.now()-n).toFixed(1)}ms`),(!o||l.length===0)&&z.clearQuery(),e&&A.current!==`DAILY`&&setTimeout(async()=>{let n=await Eo.syncCreate(t,A.current,d.current);n&&await V.updateMemoById(e.id,n,!0)},200);return}let n=V.getMemoById(e);if(n&&(n.content!==t||n.thinoType!==(d.current?`JOURNAL`:`TASK-TODO`))){let e=await V.updateMemo(n.id,t,d.current?`JOURNAL`:n.thinoType.startsWith(`TASK`)?n.thinoType:`TASK-TODO`);e.updatedAt=N.getDateTimeString(Date.now()),V.editMemo(e)}R.setEditMemoId(``)}catch(e){new f.Notice(e.message)}};n&&n(),n&&g.current?.clear(!0);let{editMemoId:p}=R.getState();await u(p,l&&l.length>0&&o&&!p?c===`Beginning`?`${l.map(e=>`#${e}`).join(` `)} ${s?`
- `:``}${e}`:`${e} ${s?`
- `:``}${l.map(e=>`#${e}`).join(` `)}`:e),Mw(``)},fe=(0,U.useCallback)(()=>{R.setEditMemoId(``),g.current?.setContent(``),Mw(``)},[]),pe=(0,U.useCallback)(async()=>{if(!o?.ShowClipboardOnFocus){ne(``);return}try{if(!navigator.clipboard?.readText){ne(``);return}ne((await navigator.clipboard.readText())?.trim()||``)}catch{ne(``)}},[o?.ShowClipboardOnFocus]),me=(0,U.useRef)(!1),he=(0,U.useRef)(``),ge=async()=>{if(!(!te||me.current)&&te!==he.current){me.current=!0;try{await de(te),g.current?.clear(!0),he.current=te,ne(``),setTimeout(()=>{he.current=``},5e3)}finally{me.current=!1}}},_e=(0,U.useCallback)(e=>{if(Mw(e??``),!g.current)return;let t=g.current.getContent(),n=g.current.element.selectionStart,r=t.slice(0,n),i=t.slice(n);(r.endsWith(`@`)||r.endsWith(`📆`))&&i.startsWith(` `)||(r.endsWith(`@`)||r.endsWith(`📆`))&&i===``?(we(),x(!0)):x(!1),setTimeout(()=>{g.current?.focus()})},[o.EditorType]),ve=e=>{let t=g.current;if(!t||!o||!e)return;re(),u(!1);let{element:n}=t,{value:r}=n,i=n.selectionStart??r.length,a=n.selectionEnd??i,s=r.slice(0,i),c=r.slice(a),l=s.endsWith(`@`),d=(0,f.moment)(e).format(`YYYY-MM-DD`),p=l?Math.max(i-1,0):i,m=d;if(l)switch(o.InsertDateFormat){case`Dataview`:m=`[due:: ${d}]`;break;case`Tasks`:m=`📅 ${d}`;break}let h=r.slice(0,p)+m+c;n.value=h;let _=p+m.length;n.setSelectionRange(_,_),t.focus(),_e(h)},ye=()=>{g.current&&u()},be=async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),t=f.Platform.isDesktop?await Pv():e.identifier||e.uuid;return!c||c?.appId!==t?(kv(),!1):!0},xe=async e=>{if(!await be())return;let t=new f.Menu;o.EnabledLocationList.forEach(e=>{t.addItem(t=>{t.setTitle(j(e.value)).setIcon(Qr.find(t=>t.title===e.value)?.icon??`file`).setChecked(k===e.value).onClick(()=>{ee(e.value)})})});let n=e.target,r=null;for(;!n.hasClass(`location-wrapper`)&&(r=n.parentElement,r);)n=r;let i=n.getBoundingClientRect();setTimeout(()=>{t.showAtPosition({x:i.x,y:i.bottom,width:i.width,left:!1,overlap:!0})},200)},Se=(0,U.useCallback)(async e=>{let t=await lw(a,r?`modal`:`view`),n=new f.Menu;if(n.dom.addClass(`history-menu`),t.length===0){n.addItem(e=>{e.setTitle(j(`No history`)),e.setIcon(`file-clock`),e.setDisabled(!0)}),n.showAtMouseEvent(e.nativeEvent);return}t.forEach(e=>{n.addItem(t=>{t.titleEl.addClass(`history-item`),t.titleEl.createEl(`span`,{text:`${e.content.length} chars`}),t.titleEl.createEl(`span`,{text:(0,f.moment)(e.timestamp).format(`YYYY-MM-DD HH:mm:ss`)}),t.onClick(()=>{g.current?.updateContent(e.content)}),t.dom.onmouseover=n=>{let r=new f.HoverPopover(s,t.dom,1e3);r.hoverEl.createEl(`div`,{text:`History content:`,cls:`history-popover-title`}),r.hoverEl.createEl(`div`,{cls:`history-popover-content`},t=>{f.MarkdownRenderer.render(a,e.content,t,``,s)}),r.hoverEl.addClass(`history-popover`),r.load(),s.addChild(r),setTimeout(()=>{r.unload()},1e3)}})}),n.showAtMouseEvent(e.nativeEvent)},[a]),Ce=(0,U.useCallback)(()=>{if(!(!g.current&&o.EditorType===`memos`))switch(o.EditorType){case`obsidian`:g.current?.focus(),g.current?.insertTag();break;case`memos`:{let e=g.current.getContent(),t=g.current.element.selectionStart,n=e.slice(0,t),r=e.slice(t),i=n+`# `+r,a=n.length+1;n.endsWith(`#`)&&r.startsWith(` `)&&(i=n.slice(0,n.length-1)+r.slice(1),a=n.length-1),g.current.element.value=i,g.current.element.setSelectionRange(a,a),g.current.focus();let o=new Event(`input`,{bubbles:!0,cancelable:!0});g.current.element.dispatchEvent(o),_e(g.current.element.value)}}},[a]),we=(0,U.useCallback)(()=>{if(!g.current||!C.current||!o||!a)return;a.workspace.getLeavesOfType(MW)[0].view.containerEl.clientWidth;let{x:e,y:t}=Ow(g.current.element),n,r;f.Platform.isMobile?(n=window.innerWidth-e>280?(e+280+16,e+18):window.innerWidth-e<280?(e+280+16,e+34):g.current.element.clientWidth/2,o.DefaultEditorLocation===`Bottom`&&window.innerWidth>875?r=t+4:o.DefaultEditorLocation===`Bottom`&&window.innerWidth<=875?r=t+19:o.DefaultEditorLocation===`Top`&&window.innerWidth<=875&&(r=t+36)):(n=(e+280+16,e+18),r=t+34),S(e),C.current.style.left=`${n}px`,C.current.style.top=`${r}px`},[o,a]),Te=(0,U.useCallback)(()=>{let e=document.createElement(`input`);document.body.appendChild(e),e.type=`file`,e.multiple=!1,e.accept=`image/png, image/gif, image/jpeg`,e.onchange=async()=>{if(!e.files||e.files.length===0)return;let t=e.files[0],n=await ce(t);n&&g.current?.insertText(n),document.body.removeChild(e)},e.click()},[]),Ee=!!i.editMemoId,De=(0,U.useMemo)(()=>({className:`memo-editor`,inputerType:o.EditorType||`obsidian`,modal:r,initialContent:jw(),placeholder:j(`What do you think now...`),showConfirmBtn:!0,showCancelBtn:Ee,showTools:!0,onConfirmBtnClick:de,onCancelBtnClick:fe,onContentChange:_e,onCheckCount:le}),[Ee,o.EditorType]);return i.memoListView===`flow`?null:(0,W.jsxs)(W.Fragment,{children:[!i.globalEditorShown&&t===`block`&&(0,W.jsx)(`div`,{ref:e=>{h.current=e,e&&f.setIcon&&(0,f.setIcon)(e,`plus-circle`)},className:`memo-show-editor-button ${p?`thino-hidden`:``}`,onClick:()=>{h.current.firstElementChild?.toggleClass(`rotate-hidden`,!0),setTimeout(()=>{m(!0),h.current.firstElementChild.toggleClass(`rotate-hidden`,!1)},500),setTimeout(()=>{g.current?.focus()},600)}}),(0,W.jsxs)(`div`,{className:`memo-editor-wrapper ${e||``} ${Ee?`edit-ing`:``} ${i.globalEditorShown?`fullscreen-editor`:``} ${p?``:`thino-hidden`}`,onKeyDownCapture:e=>se(e,!0),onFocusCapture:pe,children:[(0,W.jsx)(`span`,{className:`tip-text ${Ee?``:`thino-hidden`}`,children:`Modifying...`}),(0,W.jsx)(Cw,{ref:g,...De,clipboardText:te,onPasteAndCreate:ge,tools:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`hash`)},className:`btn action-btn add-tag`,onClick:()=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&Ce()},onPointerDown:()=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&Ce()}}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`paperclip`)},className:`btn action-btn file-upload`,onClick:()=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&Te()},onPointerDown:()=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&Te()}}),i.editMemoId===``&&(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,l?`layout-list`:`check-square`)},className:x_(`btn action-btn list-or-task`,l?`list`:`task`),onClick:()=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&ye()},onPointerDown:()=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&ye()}}),(0,W.jsx)(`div`,{ref:e=>{e&&(f.setIcon&&(0,f.setIcon)(e,i.globalEditorShown?`shrink`:`expand`),f.setTooltip&&(0,f.setTooltip)(e,i.globalEditorShown?j(`Exit fullscreen mode`):j(`Enter fullscreen mode`)))},className:`action-btn show-editor pro`,onPointerDown:async()=>{await be()&&(m(!0),R.setGlobalEditorShown(!i.globalEditorShown))}}),(0,W.jsx)(`div`,{className:`action-btn split-line pro`}),(0,W.jsx)(`div`,{className:`action-btn location-wrapper pro`,onClick:async e=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&await xe(e)},onPointerDown:async e=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&await xe(e)},children:(0,W.jsx)(`div`,{ref:D,className:`action-btn file-location-btn`})}),(0,W.jsx)(`div`,{className:`action-btn history-btn`,onClick:e=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&Se(e)},onPointerDown:e=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&Se(e)},ref:e=>{e&&(0,f.setIcon)(e,`file-clock`)}})]})}),(0,W.jsx)(`div`,{ref:C,className:`date-picker`,children:b&&(0,W.jsx)(`div`,{tabIndex:-1,style:T.styles.popper,...T.attributes.popper,ref:w,role:`dialog`,children:(0,W.jsx)(Yb,{className:`editor-date-picker ${b?``:`thino-hidden`}`,datestamp:E,handleDateStampChange:ve})})})]})]})};function jw(){return ji.get([`thinoEditorContentCache`]).thinoEditorContentCache??``}function Mw(e){ji.set({thinoEditorContentCache:e})}I();var Nw=e=>{let t=Di(e=>e.toggleSelection);return{isSelected:Di(t=>t.isSelected(e)),handleClick:(0,U.useCallback)(n=>n.shiftKey?(n.preventDefault(),n.stopPropagation(),t(e),!0):!1,[e,t])}};$r();var Pw={bilibili:{label:`Bilibili`,color:`#00a1d6`,icon:`tv`},youtube:{label:`YouTube`,color:`#ff0000`,icon:`play-circle`},netease:{label:`NetEase Music`,color:`#c20c0c`,icon:`music`},spotify:{label:`Spotify`,color:`#1db954`,icon:`music`},twitter:{label:`Twitter`,color:`#1da1f2`,icon:`message-circle`},general:{label:`Link`,color:`#6c757d`,icon:`external-link`}},Fw=/^https?:\/\/(?:www\.)?bilibili\.com\/video\/(BV[\w]+|av\d+)/i,Iw=/^https?:\/\/b23\.tv\/([\w]+)/i,Lw=/^https?:\/\/(?:www\.)?youtube\.com\/watch\?.*v=([\w-]+)/i,Rw=/^https?:\/\/youtu\.be\/([\w-]+)/i,zw=/^https?:\/\/(?:www\.)?youtube\.com\/shorts\/([\w-]+)/i,Bw=/^https?:\/\/music\.163\.com\/(?:#\/)?song\?id=(\d+)/i,Vw=/^https?:\/\/music\.163\.com\/(?:#\/)?playlist\?id=(\d+)/i,Hw=/^https?:\/\/open\.spotify\.com\/(track|album|playlist)\/([\w]+)/i,Uw=/^https?:\/\/(?:www\.)?(?:twitter|x)\.com\/\w+\/status\/(\d+)/i,Ww=/^(https?:\/\/[^\s]+)$/,Gw=/^\[([^\]]*)\]\((https?:\/\/[^\s)]+)\)$/,Kw=/\s*\^[\w-]+$/,qw=/^(-|\*|\d+\.)\s+(\[.\]\s+)?/;function Jw(e){let t=[],n=e,r,i=new RegExp(Hr.source,`gu`);for(;(r=i.exec(n))!==null;)t.push(r[1]);n=n.replace(new RegExp(Hr.source,`gu`),``);let a=new RegExp(Br.source,`g`);for(;(r=a.exec(n))!==null;)t.push(r[1]);return n=n.replace(new RegExp(Br.source,`g`),``),{tags:t,contentWithoutTags:n.trim()}}function Yw(e){return Fw.test(e)||Iw.test(e)?`bilibili`:Lw.test(e)||Rw.test(e)||zw.test(e)?`youtube`:Bw.test(e)||Vw.test(e)?`netease`:Hw.test(e)?`spotify`:Uw.test(e)?`twitter`:`general`}function Xw(e,t){let n;switch(t){case`bilibili`:if(n=Fw.exec(e),n){let e=n[1];return e.startsWith(`BV`)?`https://player.bilibili.com/player.html?bvid=${e}&autoplay=0&high_quality=1`:`https://player.bilibili.com/player.html?aid=${e.replace(`av`,``)}&autoplay=0&high_quality=1`}return null;case`youtube`:return n=Lw.exec(e),n||=Rw.exec(e),n||=zw.exec(e),n?`https://www.youtube-nocookie.com/embed/${n[1]}`:null;case`netease`:return n=Bw.exec(e),n?`https://music.163.com/outchain/player?type=2&id=${n[1]}&auto=0&height=66`:(n=Vw.exec(e),n?`https://music.163.com/outchain/player?type=0&id=${n[1]}&auto=0&height=430`:null);case`spotify`:return n=Hw.exec(e),n?`https://open.spotify.com/embed/${n[1]}/${n[2]}`:null;default:return null}}function Zw(e){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return e}}function Qw(e){return`https://www.google.com/s2/favicons?domain=${Zw(e)}&sz=32`}var $w=new Map,eT={youtube:e=>`https://www.youtube.com/oembed?url=${encodeURIComponent(e)}&format=json`,twitter:e=>`https://publish.twitter.com/oembed?url=${encodeURIComponent(e)}&format=json`,spotify:e=>`https://open.spotify.com/oembed?url=${encodeURIComponent(e)}`,bilibili:e=>`https://noembed.com/embed?url=${encodeURIComponent(e)}`};async function tT(e,t){let n=eT[t];if(!n)return null;try{let t=await(0,f.requestUrl)({url:n(e),method:`GET`});if(t.status!==200)return null;let r=t.json;return{title:r.title||r.track_name||``,description:r.author_name?`by ${r.author_name}`:``,image:r.thumbnail_url||void 0}}catch{return null}}function nT(e,t){let n=RegExp(`<meta[^>]*(?:property|name)="${t}"[^>]*content="([^"]*)"`,`i`).exec(e);if(n)return iT(n[1]);let r=RegExp(`<meta[^>]*(?:property|name)='${t}'[^>]*content='([^']*)'`,`i`).exec(e);if(r)return iT(r[1]);let i=RegExp(`<meta[^>]*content="([^"]*)"[^>]*(?:property|name)="${t}"`,`i`).exec(e);if(i)return iT(i[1]);let a=RegExp(`<meta[^>]*content='([^']*)'[^>]*(?:property|name)='${t}'`,`i`).exec(e);return a?iT(a[1]):``}function rT(e){let t=/<title[^>]*>([^<]*)<\/title>/i.exec(e);return t?iT(t[1].trim()):``}function iT(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&#x([0-9a-f]+);/gi,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t)))}async function aT(e){try{let t=await(0,f.requestUrl)({url:e,method:`GET`});if(t.status!==200)return null;let n=t.text,r=nT(n,`og:title`),i=nT(n,`og:description`),a=nT(n,`og:image`),o=nT(n,`description`),s=rT(n),c=r||s||``,l=i||o||``;return!c||c.length<=3?null:{title:c,description:l,image:a||void 0}}catch{return null}}async function oT(e,t){if($w.has(e))return $w.get(e);let n=await tT(e,t||Yw(e));if(n&&n.title)return $w.set(e,n),n;let r=await aT(e);return r?($w.set(e,r),r):null}function sT(e){if(!e||e.trim().length===0)return null;let t=e.trim();if(qw.test(t))return null;t=t.replace(Kw,``).trim(),t=t.replace(/\n/g,` `);let{tags:n,contentWithoutTags:r}=Jw(t),i=r.trim();if(!i)return null;let a=Ww.exec(i);if(a){let e=a[1],t=Yw(e);return{url:e,tags:n,platform:t,embedUrl:Xw(e,t)}}let o=Gw.exec(i);if(o){let e=o[1],t=o[2],r=Yw(t);return{url:t,displayText:e||void 0,tags:n,platform:r,embedUrl:Xw(t,r)}}return null}var cT={bilibili:`tv`,youtube:`play-circle`,netease:`headphones`,spotify:`disc`,twitter:`message-circle`,general:`link`},lT=({linkInfo:e,memo:t,onTagClick:n,onContextMenu:r})=>{let{url:i,displayText:a,tags:o,platform:s}=e,c=Pw[s],l=Zw(i),u=Qw(i),d=s===`bilibili`||s===`youtube`?`video`:s===`netease`||s===`spotify`?`audio`:`link`,p=(0,U.useRef)(null),m=(0,U.useRef)(null),[h,g]=(0,U.useState)(null);(0,U.useEffect)(()=>{p.current&&(0,f.setIcon)(p.current,`external-link`),m.current&&(0,f.setIcon)(m.current,cT[s])},[s]),(0,U.useEffect)(()=>{let e=!1;return oT(i,s).then(t=>{!e&&t&&g(t)}),()=>{e=!0}},[i,s]);let _=a||h?.title||c.label,v=h?.description||``,y=(0,U.useCallback)(e=>{e.target.closest(`.enhanced-link-tags`)||(e.preventDefault(),e.stopPropagation(),window.open(i,`_blank`))},[i]),b=(0,U.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),n?.(t)},[n]);return(0,W.jsxs)(`div`,{className:`enhanced-link-card enhanced-link-card--${d}`,"data-platform":s,"aria-label":t.createdAt,onClick:y,onContextMenu:r,children:[(0,W.jsxs)(`div`,{className:`enhanced-link-card-body`,children:[(0,W.jsx)(`div`,{className:`enhanced-link-card-icon-wrapper`,style:{"--card-accent":c.color},children:(0,W.jsx)(`span`,{ref:m,className:`enhanced-link-card-platform-icon`})}),(0,W.jsxs)(`div`,{className:`enhanced-link-card-content`,children:[(0,W.jsx)(`span`,{className:`enhanced-link-card-title`,children:_}),v&&(0,W.jsx)(`span`,{className:`enhanced-link-card-desc`,children:v}),(0,W.jsxs)(`span`,{className:`enhanced-link-card-url`,children:[(0,W.jsx)(`img`,{className:`enhanced-link-card-favicon`,src:u,alt:``,loading:`lazy`}),l]})]}),(0,W.jsx)(`span`,{ref:p,className:`enhanced-link-card-external`})]}),o.length>0&&(0,W.jsx)(`div`,{className:`enhanced-link-tags`,children:o.map(e=>(0,W.jsxs)(`span`,{className:`tag-span`,onClick:t=>b(t,e),children:[`#`,e]},e))})]})};H(),M(),I(),Av(),zv(),$r(),Ba(),li(),Sa();var uT=class extends f.SuggestModal{constructor(e,t){super(e),this.thino=t}sanitisedFileName(e){let t=Xr;return e.replace(t,``).trim().slice(0,255)}ensureUniqueFileNames(e){let t=[];return e.map(e=>{let n=this.sanitisedFileName(e[0]),r=t.filter(e=>e==n);return t.push(n),r.length>=1?`${n}${r.length+1}`:n})}contentSplitByHeading(e,t){let n=e.split(`
- `),r=Array(t).join(`#`)+` `,i=Array(t+1).join(`#`)+` `,a=[],o=[];return n.forEach((e,t)=>{e.startsWith(i)?o.length>0?(a.push(o),o=[],o.push(e)):o.push(e):o.length>0&&!e.startsWith(r)?o.push(e):o.length>0&&(a.push(o),o=[]),t===n.length-1&&o.length>0&&a.push(o)}),a}onChooseSuggestion(e,t){this.selectSuggestion(e,t)}renderSuggestion(e,t){t.setText(e.title)}getSuggestions(){return[{id:`splitByHeading1`,title:j(`Split by Heading 1`)},{id:`splitByHeading2`,title:j(`Split by Heading 2`)},{id:`splitByHeading3`,title:j(`Split by Heading 3`)}]}async selectSuggestion(e,t){let n=[];if(e.id===`splitByHeading1`?n=this.contentSplitByHeading(this.thino.content,1):e.id===`splitByHeading2`?n=this.contentSplitByHeading(this.thino.content,2):e.id===`splitByHeading3`&&(n=this.contentSplitByHeading(this.thino.content,3)),n.length===0){new f.Notice(`No headings found`),this.close();return}let r=this.ensureUniqueFileNames(n);for(let e of n){let t=n.indexOf(e),i=await V.createThino({content:e.join(`
- `),name:r[t],type:`MULTI`,isList:!0});V.pushMemo(i)}let i=this.thino.content;n.forEach((e,t)=>{i=i.replace(e.join(`
- `),`[[${r[t]}]]`)});let a=await V.updateMemo(this.thino.id,i);a&&V.editMemo(a),this.close()}},dT=async(e,t,n)=>{let r=n.getAttribute(`href`),i=n.className;if(i.contains(`tag`))fT(n.innerText.slice(1));else if(i.contains(`internal-link`)){let r=n.getAttribute(`data-href`),i=V.getMemoById(r??``);i?Bx(i):await e.workspace.openLinkText(r,r,!f.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,`_blank`)},fT=e=>{let t=z.getState().query.tag;z.setTagQuery(t.contains(`,`)?t.split(`,`).includes(e)?t.split(`,`).filter(t=>t!==e).join(`,`):t+`,`+e:t===e?``:e)},pT=(e,t)=>{let n=t?.getAttribute(`src`),r=t?.parentElement.getAttribute(`src`),i=[...e?.querySelectorAll(`img`)||[]],a=i.indexOf(t);ZS({imgUrl:n,filepath:n.startsWith(`app`)?r:void 0,otherIMGEls:i,currentIndex:a})},mT=e=>{let t=e.dataset?.value,n=V.getMemoById(t??``);n?Bx(n):(new f.Notice(`Thino Not Found`),e.classList.remove(`memo-link-text`))},hT=async(e,t,n,r)=>{let i=e?.AppendDateWhenTaskDone?` ✅ `+(0,f.moment)().format(`YYYY-MM-DD`):``,a=r.parentElement.dataset?.task===`x`?`DONE`:`TODO`,o=[...n?.querySelectorAll(`li.task-list-item`)||[]];for(let n of o)if(n===r||n===r.closest(`li.task-list-item`)){let r=o.indexOf(n),s=t.content.split(/\n/),c=[];for(let e=0;e<s.length;e++)/^\s*(-|\*|\d+\.)\s\[.\]\s/.test(s[e])&&c.push(e);let l=c[r],u=s[l],d=u.match(/^\s*(-|\*|\d+\.)\s\[.\]\s/)[0],f=u.replace(/^\s*(-|\*|\d+\.)\s\[.\]\s/,d.replace(/\[.\]/,a===`TODO`?`[x]`:`[ ]`))+(a===`TODO`?i:``);e.AppendDateWhenTaskDone&&a!==`TODO`&&(f=f.replace(/ ✅ \d{4}-\d{2}-\d{2}/g,``)),s[l]=f;let p=s.join(`
- `).trim();if(t&&t.content!==p){let e=await V.updateMemo(t.id,p);V.editMemo(e)}}},gT=(0,U.memo)(e=>{let{editMemoId:t,memoListView:n}=vi(),{app:r,view:i,settings:a,verifyState:o}=F(),{pathname:s}=Si(),{memo:c,type:l=`inline`}=e,u=(0,U.useRef)(null),d=(0,U.useRef)(null),[p,m]=(0,U.useState)(!1),h=(0,U.useRef)(null),[g,_]=(0,U.useState)(!1),[v,y]=(0,U.useState)(0),[b,x]=(0,U.useState)(!1),{isSelected:S,handleClick:C}=Nw(c.id),w=(0,U.useMemo)(()=>sT(c.content),[c.content]);(0,U.useEffect)(()=>{p&&setTimeout(()=>{R.setEditMemoId(c.id)},100)},[p]),(0,U.useEffect)(()=>{(s===`/review`||s===`/daily`)&&t!==c.id&&p&&m(!1)},[t]),(0,U.useEffect)(()=>{h.current&&!g&&u.current&&(r.dragManager.handleDrag(h.current,e=>{r.dragManager.updateSource([u.current],`is-dragging`);let t=V.getMemoById(c.id);if(e.dataTransfer.setData(`text/plain`,c.content),e.dataTransfer.setData(`text/uri-list`,c.content),e.dataTransfer.setData(`Text`,c.content),a?.DraggingBehavior===`block-link`)if(t?.sourceType===`DAILY`){let e=r.vault.getFileByPath(t.path),n=t.hasId;return t.hasId||(n=N.randomId(6),_a(t,{id:t.id,hasId:n})),{type:`link`,icon:`lucide-link`,title:e.basename,linktext:`${t.path}#^${n}`,sourcePath:t.path,file:e,memo:t,blockId:n,source:`thino-plugin`}}else return null;else if(a?.DraggingBehavior===`text`)return null}),_(!0))},[h.current,u.current,a?.DraggingBehavior]);let T=e=>{if(!C(e)){if(e.ctrlKey||e.metaKey){let e=(0,f.moment)(c.createdAt,`YYYY/MM/DD HH:mm:ss`);z.setFromAndToQuery(e.startOf(`day`).valueOf(),e.endOf(`day`).valueOf());return}Bx(c)}},E=()=>{if(a?.UseButtonToShowEditor&&a?.DefaultEditorLocation===`Bottom`){let e=document.querySelector(`div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)`);e&&e.trigger(`click`)}R.setMarkMemoId(c.id)},D=async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),t=f.Platform.isDesktop?await Pv():e.identifier||e.uuid;if(!o||o?.appId!==t){kv();return}c.pinned?await V.unpinMemoById(c.id):await V.pinMemoById(c.id)},O=()=>{if(a?.UseButtonToShowEditor&&a?.DefaultEditorLocation===`Bottom`&&f.Platform.isMobile){let e=document.querySelector(`div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)`);e&&e.trigger(`click`)}(s===`/review`||s===`/daily`)&&m(!0),s!==`/review`&&s!==`/daily`&&R.setEditMemoId(c.id)},k=async e=>{e.sourceType===`MULTI`&&e.id.trim()===``&&await V.updateMemoProperty(e)},ee=async e=>{await V.openThinoByID(e.id)},A=async e=>{try{let t=await V.archiveMemo(e);t&&V.editMemo(t)}catch(e){console.error(e),new f.Notice(e.message)}},te=async()=>{try{if(a.DeleteThinoDirectly)await V.deleteMemoById(c.id);else{let e=await V.hideMemoById(c.id);e&&V.editMemo(e)}}catch(e){new f.Notice(e.message)}R.getState().editMemoId===c.id&&R.setEditMemoId(``)},ne=()=>{if(d.current&&!d.current.confirmStatus){d.current&&d.current.toggleConfirm(!1);return}},re=()=>{US(c)},ie=async()=>{let e=await V.updateMemo(c.id,c.content,c.thinoType===`TASK-TODO`?`TASK-DONE`:`TASK-TODO`);e&&V.editMemo(e)},ae=async()=>{navigator.clipboard.writeText(c.content).then(()=>{new f.Notice(j(`COPY SUCCEED`))}).catch(()=>{new f.Notice(j(`COPY FAILED`))})},oe=async()=>{new uT(r,c).open()},se=()=>{Px.delete(c.id),x(!1),y(e=>e+1)},ce=b&&(0,f.requireApiVersion)(`1.11.4`)&&Ix(c.content,a),le=e=>{if(e&&e.target.tagName!==`INPUT`)switch(a?.doubleClickBehavior||`edit-thino`){case`open-thino`:Bx(c);break;case`edit-thino`:O();break;case`go-to-source`:ee(c);break;case`do-nothing`:break;default:O();break}},ue=async(e,t)=>{if(C(e))return;e.preventDefault(),e.stopPropagation();let n=e.target;if(e.ctrlKey||e.metaKey){await ee(t);return}if(n.tagName===`A`){await dT(r,i,n);return}if(n.tagName===`IMG`){pT(u.current,n);return}if(n.tagName===`A`&&n.getAttribute(`href`)){let e=n.getAttribute(`href`);window.open(e,`_blank`);return}if(n.className===`memo-link-text`){mT(n);return}if(n.tagName===`INPUT`&&n.hasClass(`task-list-item-checkbox`)){await hT(a,t,u.current,n);return}},de=async e=>{let t=await Ma(c,e);navigator.clipboard.writeText(t),new f.Notice(j(`COPY SUCCEED`))},fe=e=>{let t=new f.Menu;t.dom.toggleClass(`memo-context-menu`,!0);let i=window.getSelection();i?.toString().length>0&&t.addItem(e=>{e.setIcon(`copy`).setTitle(j(`Copy selected text`)).onClick(()=>{navigator.clipboard.writeText(i.toString()).then(()=>{new f.Notice(j(`COPY SUCCEED`))}).catch(()=>{new f.Notice(j(`COPY FAILED`))})})}).addSeparator(),c.sourceType===`DAILY`&&(t.addItem(e=>{e.setIcon(`link`).setTitle(j(`Copy embed link`)).onClick(()=>{de(!0)})}),t.addItem(e=>{e.setIcon(`link`).setTitle(j(`Copy link`)).onClick(()=>{de(!1)})}),t.addSeparator()),a?.enableReferenceLinksGroup&&n!==`list`&&t.addItem(t=>{t.setIcon(`link`).setTitle(j(`Reference links group`)).onClick(()=>pe(e))}),t.addItem(e=>{e.setIcon(`copy`).setTitle(j(`Copy thino`).toLocaleUpperCase()).onClick(async()=>{await ae(),t.close()})}).addItem(t=>{t.setIcon(`book-open`).setTitle(j(`READ`)).onClick(()=>T(e))}).addItem(e=>{e.setIcon(c.pinned?`pin-off`:`pin`).setTitle(c.pinned?j(`UNPIN`):j(`PIN`)).onClick(D)}).addItem(e=>{e.setIcon(`bookmark`).setTitle(j(`MARK`)).onClick(E)}).addItem(e=>{e.setIcon(`share-2`).setTitle(j(`SHARE`)).onClick(re)}).addItem(e=>{e.setIcon(`pencil`).setTitle(j(`EDIT`)).onClick(O)}).addItem(e=>{e.setIcon(`home`).setTitle(j(`SOURCE`)).onClick(()=>ee(c))}),ce&&t.addItem(e=>{e.setIcon(`lock`).setTitle(j(`Lock`)).onClick(se)}),t.addItem(e=>{e.setIcon(`file-output`).setTitle(j(`Send to file`)).onClick(()=>{bC(r,[c])})}),t.addSeparator().addItem(e=>{e.setIcon(`archive`).setWarning(!0).setTitle(j(`ARCHIVE`).toLocaleUpperCase()).onClick(()=>A(c))}).addItem(e=>{e.setIcon(`trash`).setWarning(!0).setTitle(j(`DELETE`)).onClick(async()=>{await te()})}),t.showAtMouseEvent(e.nativeEvent)},pe=e=>{e.stopPropagation(),e.preventDefault();let t=new f.Menu;(async()=>{try{let n=[],r=[],i=[...c.content.matchAll(Yr)];for(let e of i)if(e&&e.length===3){let t=e[2],r=V.getMemoById(t);r&&n.push({...r,createdAtStr:N.getDateTimeString(r.createdAt),dateStr:N.getDateString(r.createdAt)})}let a=Oa(c.content);for(let e of a){let[t,r]=e.split(`#^`),i=r;if(t&&i){let e=await V.getLinkedMemoByBlockId(i,t);e&&(n.some(t=>t.id===e.id)||n.push({...e,createdAtStr:N.getDateTimeString(e.createdAt),dateStr:N.getDateString(e.createdAt)}))}}let o=await V.getLinkedMemos(c.id),s=[];c.hasId&&c.path&&(s=await V.getLinkedMemosByLinkId(c.hasId,c.path));let l=[...o,...s];Array.from(new Map(l.map(e=>[e.id,e])).values()).sort((e,t)=>N.getTimeStampByDate(t.createdAt)-N.getTimeStampByDate(e.createdAt)).forEach(e=>{r.push({...e,createdAtStr:N.getDateTimeString(e.createdAt),dateStr:N.getDateString(e.createdAt)})}),t.addSections([`Outgoing`,`Incoming`]),n.length>0&&n.forEach(e=>{t.addItem(t=>{let n=e.content.length>10?e.content.substring(0,10)+`...`:e.content;t.setTitle(n).setIcon(`arrow-right`).onClick(()=>{Bx(e)})})}),r.length>0&&r.forEach(e=>{t.addItem(t=>{let n=e.content.length>10?e.content.substring(0,10)+`...`:e.content;t.setTitle(n).setSection(`Incoming`).setIcon(`arrow-left`).onClick(()=>{Bx(e)})})}),n.length===0&&r.length===0&&t.addItem(e=>{e.setDisabled(!0).setTitle(j(`No reference links found`))}),t.showAtMouseEvent(e.nativeEvent)}catch(e){console.error(`Error fetching linked memos:`,e),new f.Notice(j(`Error fetching reference links`))}})()},me=(0,U.useMemo)(()=>({memo:c,memoListView:n,handlePinMemoClick:D,handleFixMemoClick:k,handleSourceMemoClick:ee,handleArchiveMemo:A,handleDeleteMemoClick:te,handleGenMemoImageBtnClick:re,handleMarkMemoClick:E,handleEditMemoClick:O,handleCopyMemoClick:ae,handleShowMemoStoryDialog:T,handleSplitMemoClick:oe,handleCopyEmbedLink:de,handleReferenceLinksGroupClick:pe,handleLockMemo:se,canLockMemo:ce}),[c,ce]),he=(0,U.useMemo)(()=>({memo:c,handleMemoTypeToggle:ie,handleShowMemoStoryDialog:T,settings:a}),[c,a]);return(0,W.jsx)(W.Fragment,{children:(0,U.useMemo)(()=>(window.__THINO_DEBUG_MEMO_RENDER__&&console.log(`[Memo] render`,c?.id),w&&!p?(0,W.jsx)(lT,{linkInfo:w,memo:{createdAt:c.createdAt,pinned:c.pinned},onTagClick:e=>fT(e),onContextMenu:fe}):(0,W.jsxs)(`div`,{ref:u,className:x_(`memo-wrapper`,`memo-container`,{pinned:c.pinned,selected:S}),"data-source-type":c.sourceType,"data-thino-type":c.thinoType,"data-thino-id":c.id,onMouseLeave:ne,onMouseOver:e=>{!e.shiftKey||!i||!r||(e.stopPropagation(),r.workspace.trigger(`hover-link`,{event:e,source:`thino`,hoverParent:i.containerEl,targetEl:u.current,linktext:c.path,sourcePath:c.path,state:{scroll:c.sourceType===`DAILY`?parseInt(c.id.slice(14)):0}}))},onContextMenu:fe,children:[p&&(0,W.jsx)(Aw,{editorType:`inline`}),!p&&(0,W.jsxs)(W.Fragment,{children:[l===`inline`&&(0,W.jsxs)(`div`,{ref:h,className:`memo-top-wrapper`,draggable:!0,children:[(0,W.jsx)(CC,{...he}),(0,W.jsx)(SC,{...me})]}),(0,W.jsx)(Lx,{memo:c,lockVersion:v,onReveal:()=>x(!0),handleMemoContentClick:ue,handleMemoDoubleClick:le})]})]})),[c,p,w,ce,v])})},(e,t)=>{let n=e.memo,r=t.memo;return n.id===r.id&&n.updatedAt===r.updatedAt&&n.content===r.content&&n.pinned===r.pinned&&n.visibility===r.visibility});H(),M(),Av(),zv();var _T=e=>{let{destroy:t,queryId:n,type:r=`dialog`}=e,[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(r===`dialog`?[]:[_v()]),c=Ub(!1),[l,u]=(0,U.useState)(!1),[d,p]=Wb(!1),m=f.Platform.isDesktop,h=(0,U.useRef)(null),g=(0,U.useRef)(null),[_,v]=(0,U.useState)(!0),y=(0,U.useMemo)(()=>V.getState().memos.filter(e=>e.deletedAt!==``&&e.deletedAt||e.rowStatus===`ARCHIVED`?!1:vv(e,o)),[o]),b=y.length,{displayedItems:x,hasMore:S,sentinelRef:C}=sx({allItems:y,initialCount:20,loadMoreCount:20,enabled:m});(0,U.useLayoutEffect)(()=>{if(!m||!h.current)return;let e=h.current.closest(`.dialog-container`);if(!e)return;e.style.transform=`translateX(-${436/2}px)`;let t=()=>{let t=g.current;if(!t)return;let n=e.getBoundingClientRect();t.style.top=`${n.top}px`,t.style.left=`${n.right+16}px`,t.style.maxHeight=`${window.innerHeight-n.top-32}px`};requestAnimationFrame(t);let n=new ResizeObserver(t);return n.observe(e),window.addEventListener(`resize`,t),()=>{e.style.transform=``,n.disconnect(),window.removeEventListener(`resize`,t)}},[m]),(0,U.useEffect)(()=>{if(!m||!h.current)return;let e=h.current.closest(`.dialog-wrapper`);if(!e)return;let t=new MutationObserver(()=>{if(e.classList.contains(`showoff`)){v(!1);let e=h.current?.closest(`.dialog-container`);e&&(e.style.transform=``)}});return t.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[m]),(0,U.useEffect)(()=>()=>{g.current?.remove()},[]),(0,U.useEffect)(()=>{w()},[n]);let w=()=>{let e=Zg.getQueryById(n??``);if(e){a(e.title);let t=JSON.parse(e.querystring);return Array.isArray(t)&&s(t),e}},T=e=>{let t=e.target.value;a(t)},E=async()=>{if(!i)return new f.Notice(j(`TITLE CANNOT BE NULL!`)),null;if(o.length===0)return new f.Notice(j(`FILTER CANNOT BE NULL!`)),null;if(o.length===1&&o[o.length-1].value.value===``)return new f.Notice(j(`Please finish the last filter setting first`)),null;let e,t=Zg.getQueryById(n||``);try{n&&!n.startsWith(`Filter [Temp] `)&&t.title===i?(e=await Zg.updateQuery(n,i,JSON.stringify(o)),Zg.editQuery(e),await Zg.getMyAllQueries()):(e=await Zg.createQuery(i,JSON.stringify(o)),Zg.pushQuery(e),await Zg.getMyAllQueries())}catch(e){new f.Notice(e.message)}return e},D=async()=>{switch(r){case`modal`:case`inline`:if(o.length===0){new f.Notice(j(`FILTER CANNOT BE NULL!`));return}if(o.length===1&&o[o.length-1].value.value===``){new f.Notice(j(`Please finish the last filter setting first`));return}try{let e=Zg.getQueryById(n??``);if(e&&JSON.stringify(o)===e.querystring){z.setMemoFilter(e.id),t();return}let r=Zg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(o));Zg.pushQuery(r),z.setMemoFilter(r.id)}catch(e){new f.Notice(e.message)}t();break;case`dialog`:try{if(!await E())return}catch(e){console.error(e),new f.Notice(e.message)}t();break}},O=()=>{if(o.length===0){new f.Notice(j(`FILTER CANNOT BE NULL!`));return}if(l){z.setMemoFilter(``),u(!1);return}let t=Zg.getQueryById(n??``);if(t&&JSON.stringify(o)===t.querystring){z.setMemoFilter(t.id);return}let r=Zg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(o));Zg.pushQuery(r),z.setMemoFilter(r.id),e.setPreview&&e.setPreview(r.id),u(!0)},k=()=>{if(o.length>0&&o[o.length-1].value.value===``){new f.Notice(j(`Please finish the last filter setting first`));return}s([...o,_v()])},ee=(0,U.useCallback)((e,t)=>{s(n=>{let r=[...n];return r[e]=t,r})},[]),A=(0,U.useCallback)(e=>{s(t=>t.filter((t,n)=>n!==e))},[]);return(0,W.jsxs)(W.Fragment,{children:[r===`dialog`&&(0,W.jsxs)(`div`,{className:`dialog-header-container`,ref:h,children:[(0,W.jsxs)(`span`,{className:`title-text`,children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🔖`}),j(n?`EDIT QUERY`:`CREATE QUERY`)]}),(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`x`)},className:`btn close-btn`,onClick:t})]}),(0,W.jsxs)(`div`,{className:`dialog-content-container`,children:[(r===`dialog`||d)&&(0,W.jsxs)(`div`,{className:`form-item-container input-form-container`,children:[(0,W.jsx)(`span`,{className:`normal-text`,children:j(`TITLE`)}),(0,W.jsx)(`input`,{className:`title-input`,type:`text`,value:i,onChange:T})]}),(0,W.jsxs)(`div`,{className:`form-item-container filter-form-container`,children:[(0,W.jsx)(`span`,{className:`normal-text`,children:j(`FILTER`)}),(0,W.jsxs)(`div`,{className:`filters-wrapper`,children:[o.map((e,t)=>(0,W.jsx)(vT,{index:t,filter:e,handleFilterChange:ee,handleFilterRemove:A},t)),(0,W.jsx)(`div`,{className:`create-filter-btn`,onClick:k,children:j(`ADD FILTER TERMS`)})]})]})]}),(0,W.jsx)(`div`,{className:`dialog-footer-container`,children:(0,W.jsxs)(`div`,{className:`btns-container`,children:[(r===`inline`||r===`modal`)&&(0,W.jsx)(`button`,{className:`btn ${d?`mod-cta`:`save-btn`}`,onClick:async()=>{if(!d)p();else{let e=await E();p(!1),t(),e&&z.setMemoFilter(e.id)}},children:j(d?`Set and save`:`Save`)}),(0,W.jsxs)(`div`,{className:`btns-group-container`,children:[(0,W.jsxs)(`span`,{className:`tip-text ${o.length===0&&`thino-hidden`}`,children:[j(`MATCH`),` Thino `,(0,W.jsx)(`strong`,{children:b}),` `,j(`TIMES`)]}),(0,W.jsx)(W.Fragment,{children:r===`inline`&&(0,W.jsx)(`button`,{className:`btn mod-cta`,onClick:O,children:j(`Preview`)})}),(0,W.jsx)(`button`,{className:`btn save-btn ${c.isLoading?`requesting`:``}`,onClick:D,children:j(r===`inline`||r===`modal`?`Filter`:n?`EDIT`:`Save`)})]})]})}),m&&_&&(0,A_.createPortal)((0,W.jsxs)(`div`,{ref:g,className:`query-preview-floating-panel`,onClick:e=>e.stopPropagation(),children:[(0,W.jsxs)(`div`,{className:`preview-header`,children:[(0,W.jsx)(`span`,{className:`preview-title`,children:j(`Preview`)}),(0,W.jsxs)(`span`,{className:`preview-count`,children:[b,` Thinos`]})]}),(0,W.jsxs)(`div`,{className:`preview-memo-list`,children:[x.length===0&&(0,W.jsx)(`div`,{className:`preview-empty`,children:o.length===0?j(`ADD FILTER TERMS`):`${j(`MATCH`)} 0 ${j(`TIMES`)}`}),x.map(e=>(0,W.jsx)(gT,{memo:e},e.id)),S&&(0,W.jsx)(`div`,{ref:C,className:`preview-sentinel`})]})]}),document.body)]})},vT=(0,U.memo)(e=>{let{index:t,filter:n,handleFilterChange:r,handleFilterRemove:i}=e,{type:a}=n,o=(0,U.useRef)(null),s=(0,U.useRef)(null),c=(0,U.useRef)(n),l=(0,U.useRef)(a);(0,U.useEffect)(()=>{c.current=e.filter},[n]),(0,U.useEffect)(()=>{if(console.log(a!==`TAG`&&s.current),o.current)return a!==`TAG`&&s.current&&(s.current.destroy(),s.current=null,o.current.detach()),a===`TAG`&&!s.current&&(l.current=a,s.current=new ox(o.current,m)),()=>{s.current&&=(s.current.destroy(),null)}},[o,a]);let u=(0,U.useCallback)(e=>{[`AND`,`OR`].includes(e)&&r(t,{...n,relation:e})},[n]),d=(0,U.useCallback)(async e=>{if(n.type!==e){let{verifyState:i}=L.getState(),a=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),o=f.Platform.isDesktop?await Pv():a.identifier||a.uuid,s=i&&i?.appId===o;if((e===`SOURCE`||e===`PATH`||e===`METADATA`||e===`TIME_RANGE`)&&!s){kv();return}let c=Object.values(mv[e].operators);r(t,{...n,type:e,value:{operator:c[0].value,value:e===`METADATA`?{name:``,value:``}:e===`TIME_RANGE`?mv.TIME_RANGE.values[0].value:``}})}},[n]),p=(0,U.useCallback)(e=>{r(t,{...n,value:{...n.value,operator:e}})},[n]),m=(0,U.useCallback)((e,n=`OTHERS`)=>{n===`OTHERS`?r(t,{...c.current,value:{...c.current.value,value:e}}):r(t,{...c.current,value:{...c.current.value,value:{...c.current.value.value,[n===`METADATA_NAME`?`name`:`value`]:e}}})},[n]),h=()=>{i(t)},g={TYPE:(0,W.jsx)(Kb,{className:`value-selector`,dataSource:mv.TYPE.values,value:n.value.value,handleValueChanged:m}),LIST:(0,W.jsx)(Kb,{className:`value-selector`,dataSource:mv.LIST.values,value:n.value.value,handleValueChanged:m}),SOURCE:(0,W.jsx)(Kb,{className:`value-selector`,dataSource:mv.SOURCE.values,value:n.value.value,handleValueChanged:m}),PATH:(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value,onChange:e=>{m(e.target.value)}}),METADATA:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value.name,onChange:e=>{m(e.target.value,`METADATA_NAME`)}}),(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value.value,onChange:e=>{m(e.target.value,`METADATA_VALUE`)}})]}),TAG:(0,W.jsx)(`input`,{type:`text`,id:Math.random().toString(36).substring(7),className:`value-inputer`,ref:o,value:n.value.value,onChange:e=>{m(e.target.value)}}),TEXT:(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value,onChange:e=>{m(e.target.value)}}),DATE:(0,W.jsxs)(`div`,{className:`date-inputer`,children:[(0,W.jsx)(ex,{type:`icon`,handleValueChange:m}),(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value,onChange:e=>{m(e.target.value)}})]}),TIME_RANGE:(0,W.jsx)(Kb,{className:`value-selector`,dataSource:mv.TIME_RANGE.values,value:n.value.value,handleValueChanged:m})};return(0,W.jsxs)(`div`,{className:`memo-filter-input-wrapper`,children:[t>0&&(0,W.jsx)(Kb,{className:`relation-selector`,dataSource:pv,value:n.relation,handleValueChanged:u}),(0,W.jsx)(Kb,{className:`type-selector`,dataSource:Object.values(mv),value:n.type,handleValueChanged:d}),(0,W.jsxs)(W.Fragment,{children:[Object.keys(mv).includes(a)&&(0,W.jsx)(Kb,{className:`operator-selector`,dataSource:Object.values(mv[a].operators),value:n.value.operator,handleValueChanged:p}),g[a]]}),(0,W.jsx)(`div`,{ref:e=>{e&&(0,f.setIcon)(e,`x`)},className:`btn remove-btn`,onClick:h})]})});function yT(e){f_({className:`create-query-dialog`},_T,{queryId:e})}H(),I(),Av(),zv();var bT=e=>{let{app:t,verifyState:n}=F(),{query:r}=Si(),i=U.useRef(null),[a,o]=U.useState(!1),s=U.useRef(null),[c,l]=U.useState(``),u=Vb(i.current,s.current,{placement:`bottom-start`,modifiers:[{name:`offset`,options:{offset:[0,10]}}]});(0,U.useEffect)(()=>{a&&u.update&&u?.update()},[a]),(0,U.useEffect)(()=>{i&&(0,f.setIcon)(i.current,`filter`)},[i]);let d=async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),t=f.Platform.isDesktop?await Pv():e.identifier||e.uuid;return!n||n?.appId!==t?(kv(),!1):!0};return Sv(s,()=>{o(!1),c&&z.getState().query.filter===c&&z.setMemoFilter(``)}),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`thino-inline-filter-wrapper pro`,ref:i,onClick:async()=>{await d()&&(f.Platform.isDesktop?(o(!a),await u?.update()):new xT(L.getState().app,r.filter,e=>{l(e)}).open())}}),(0,W.jsx)(`div`,{ref:s,className:`thino-inline-filter-container ${a?``:`thino-hidden`}`,style:u.styles.popper,children:a&&(0,W.jsx)(_T,{type:`inline`,queryId:r.filter?.startsWith(`Filter [Temp] `)&&!r.filter?.includes(`Filter [Temp]`)?``:r.filter,destroy:()=>{o(!1)},setPreview:e=>{l(e)}})})]})},xT=class extends f.Modal{root;setPreview;constructor(e,t,n){super(e),this.filter=t,this.setPreview=n}onOpen(){let{contentEl:e}=this;this.root=(0,u_.createRoot)(e),this.root.render((0,W.jsx)(`div`,{className:`thino-inline-filter-container`,children:(0,W.jsx)(_T,{type:`modal`,queryId:this.filter?.startsWith(`Filter [Temp] `)&&!this.filter?.includes(`Filter [Temp]`)?``:this.filter,destroy:()=>{this.close()},setPreview:e=>{this.setPreview(e)}})}))}onClose(){this.root?.unmount()}};I(),Ng();var ST=[{field:`createdAt`,label:`Created Time`},{field:`updatedAt`,label:`Updated Time`},{field:`content-length`,label:`Content Length`},{field:`sourceType`,label:`Source Type`},{field:`thinoType`,label:`Thino Type`}],CT=({onSortChange:e,currentSort:t})=>{let{app:n}=F(),r=Mg(e=>e.sort),i=Mg(e=>e.setSort),a=t||r,[o]=(0,U.useState)(U.createRef());(0,U.useEffect)(()=>{o.current&&(0,f.setIcon)(o.current,`arrow-up-down`)},[o.current]);let s=(0,U.useCallback)(t=>{t.stopPropagation();let r=new f.Menu;ST.forEach(({field:t,label:o})=>{r.addItem(r=>{let s=a.field===t&&a.direction===`asc`;r.setTitle(`${o} (Ascending)`).setIcon(s?`check`:``).onClick(()=>{let r={field:t,direction:`asc`,label:o};e&&e(r),i(r),n?.saveLocalStorage(`memoSortConfig`,JSON.stringify(r))})}),r.addItem(r=>{let s=a.field===t&&a.direction===`desc`;r.setTitle(`${o} (Descending)`).setIcon(s?`check`:``).onClick(()=>{let r={field:t,direction:`desc`,label:o};e&&e(r),i(r),n?.saveLocalStorage(`memoSortConfig`,JSON.stringify(r))})})}),r.showAtMouseEvent(t.nativeEvent)},[t,e,n]);return(0,W.jsx)(`div`,{className:`sort-selector-wrapper`,onClick:s,title:(()=>{let e=a;return`${e.label} ${e.direction===`asc`?`↑`:`↓`}`})(),children:(0,W.jsx)(`span`,{ref:o,className:`sort-icon`})})};I(),H(),M();var wT=()=>{let{pathname:e,query:{filter:t}}=Si(),{queries:n}=ui(),[r,i]=(0,U.useState)(()=>Date.now());(0,U.useEffect)(()=>{let e=window.setInterval(()=>i(Date.now()),6e4);return()=>window.clearInterval(e)},[]);let a=(0,U.useMemo)(()=>{if(t){let e=Zg.getQueryById(t);if(e?.title)return e.title}return e===`/recycle`?`Recycle bin`:e===`/archive`?`Archive`:e===`/daily`?`Daily review`:e===`/review`?`Review`:(0,f.moment)(r).calendar(null,{sameDay:`[${j(`Today`)||`Today`}]`,nextDay:`[Tomorrow]`,nextWeek:`dddd`,lastDay:`[Yesterday]`,lastWeek:`[Last] dddd`,sameElse:`LL`})},[t,e,n,r]),o=(0,U.useCallback)(()=>{if(e===`/daily`){z.setPathname(`/`);return}z.setPathname(`/daily`)},[e]);return(0,W.jsxs)(`div`,{className:`thino-focus-breadcrumb`,"aria-label":`Thino breadcrumb`,children:[(0,W.jsx)(`span`,{className:`thino-focus-breadcrumb-title`,children:`Thino`}),(0,W.jsx)(`span`,{className:`thino-focus-breadcrumb-dot`,"aria-hidden":`true`,children:`·`}),(0,W.jsx)(`button`,{type:`button`,className:`thino-focus-breadcrumb-subtitle`,onClick:o,"aria-label":typeof a==`string`?a:void 0,children:(0,W.jsx)(`em`,{children:a})})]})};I(),H(),Do();var TT=()=>{let{isMobileView:e,showSiderbarInMobileView:t}=vi(),[n]=(0,U.useState)(U.createRef());(0,U.useEffect)(()=>{if(!n.current)return;let e=n.current;(0,f.setIcon)(e,`refresh-cw`)},[n.current]);let r=(0,U.useCallback)(async()=>{e&&t||(await Eo.pullFromWeb(Eo.getLastUpdatedTime()),await V.fetchAllMemos())},[]);return(0,W.jsx)(`span`,{className:`refresh-icon`,ref:n,onClick:()=>{r(),n&&n.current.firstElementChild.toggleClass(`rotate-hidden`,!0),setTimeout(()=>{n&&n.current.firstElementChild.toggleClass(`rotate-hidden`,!1)},1e3)}})},ET=({onSortChange:e,currentSort:t})=>{let{query:{filter:n}}=Si(),{isMobileView:r,isPhoneView:i,immersiveMode:a}=vi(),{queries:o}=ui(),{settings:s}=F(),c=s?.DefaultThemeForThino===`focus`,[l,u]=(0,U.useState)(`THINO`);(0,U.useEffect)(()=>{let e=Zg.getQueryById(n);u(e?e.title:`THINO`)},[n,o]);let d=(0,U.useCallback)(e=>{e.stopPropagation(),R.setShowSiderbarInMobileView(!0)},[]),p=(0,U.useCallback)(()=>{R.toggleImmersiveMode()},[]);return c&&i?null:(0,W.jsxs)(`div`,{className:`section-header-container memos-header-container`,children:[(0,W.jsxs)(`div`,{className:`title-text`,children:[(0,W.jsx)(Ov,{when:r,children:(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`panel-left`)},className:`btn action-btn clickable-icon`,onClick:d})}),c&&!i?(0,W.jsx)(wT,{}):(0,W.jsx)(`span`,{className:`normal-text`,children:l}),(0,W.jsx)(TT,{})]}),(0,W.jsxs)(`div`,{className:`memos-header-search-section`,children:[(0,W.jsx)(Hv,{}),(0,W.jsx)(Vv,{}),e&&t&&(0,W.jsx)(CT,{onSortChange:e,currentSort:t}),(0,W.jsx)(bT,{}),(0,W.jsx)(Dv,{}),c&&!i&&(0,W.jsx)(`button`,{type:`button`,className:`btn action-btn clickable-icon thino-focus-immersive-btn ${a?`is-active`:``}`,onClick:p,"aria-pressed":a,title:a?`Exit immersive mode (Esc)`:`Immersive mode (F)`,children:(0,W.jsx)(`span`,{className:`thino-focus-immersive-label`,children:`聚焦`})})]})]})};I(),H(),M();var DT=()=>(0,W.jsxs)(`div`,{className:`user-banner-container user-banner-skeleton`,children:[(0,W.jsxs)(`div`,{className:`userinfo-header-container`,children:[(0,W.jsxs)(`div`,{className:`userinfo-container`,children:[(0,W.jsx)(`div`,{className:`thino-user-icon skeleton-icon`}),(0,W.jsxs)(`div`,{className:`thino-user-info`,children:[(0,W.jsxs)(`span`,{className:`username-container`,children:[(0,W.jsx)(`span`,{className:`username-text skeleton-text skeleton-username`}),(0,W.jsx)(`span`,{className:`user-pro-badge skeleton-badge`})]}),(0,W.jsx)(`span`,{className:`thino-user-quote skeleton-text skeleton-quote`})]})]}),(0,W.jsx)(`span`,{className:`btn-group`,children:(0,W.jsx)(`span`,{className:`btn action-btn menu-popup-btn skeleton-button`})})]}),(0,W.jsx)(`div`,{className:`status-text-container`,children:(0,W.jsxs)(`div`,{className:`status-text`,children:[(0,W.jsx)(`div`,{className:`amount-text skeleton-text skeleton-amount`}),(0,W.jsx)(`div`,{className:`type-text skeleton-text skeleton-type`})]})})]}),OT=()=>{let{settings:e,plugin:t,app:n,verifyState:r}=F(),{manifest:i,showSiderbarInMobileView:a,isMobileView:o}=vi(),[s,c]=(0,U.useState)(`Memos`),[l,u]=(0,U.useState)(``),[d,p]=(0,U.useState)(!1);(0,U.useEffect)(()=>{console.log(`isReady`,n,e,i),p(!!(n&&e&&i))},[n,e,i]),(0,U.useEffect)(()=>{if(!e?.MomentsIcon||!n)return;let t=n.vault.adapter.getResourcePath((0,f.normalizePath)(e.MomentsIcon));t&&!e?.MomentsIcon.startsWith(`http`)?u(t):u(e?.MomentsIcon)},[e?.MomentsIcon,n]),(0,U.useEffect)(()=>{e&&c(e.UserName)},[e]);let m=(0,U.useCallback)(()=>{z.pushHistory(`/`),z.clearQuery()},[]),h=()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},g=()=>{if(e?.needVerify){R.setLocked(!0);return}else new f.Notice(j(`You have not set a password or enable this feature yet`)),n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},_=()=>{__(n)},v=()=>{R.setShowSiderbarInMobileView(!1),t.settingTab.updateSettings(`FirstLoaded`,!0)},y=()=>{new y_(n,t,i.version).open()},b=(0,U.useCallback)(async e=>{let{type:t}=e;if(t.startsWith(`text`))try{return`${await t_.parseHtml(e)}`}catch(e){new f.Notice(e)}},[]),x=(0,U.useCallback)(()=>{let e=document.createElement(`input`);document.body.appendChild(e),e.type=`file`,e.multiple=!1,e.accept=`text/html`,e.onchange=async()=>{if(!e.files||e.files.length===0)return;let t=e.files[0];await b(t),document.body.removeChild(e)},e.click()},[]),S=t=>{let n=new f.Menu;n.addItem(e=>{e.setIcon(`user`).setTitle(j(`Settings`)).onClick(h)}),e?.needVerify&&n.addItem(e=>{e.setIcon(`lock`).setTitle(j(`Lock`)).onClick(g)}),n.addItem(e=>{e.setIcon(`import`).setTitle(j(`Import`)).onClick(x)}),n.addSeparator(),n.addItem(e=>{e.setIcon(`file-text`).setTitle(j(`ChangeLog`)).onClick(_)}),n.addItem(e=>{e.setIcon(`settings`).setTitle(j(`Setting guide`)).onClick(v)}),n.addItem(e=>{e.setIcon(`alert-circle`).setTitle(j(`Submit issue`)).onClick(y)}),n.showAtMouseEvent(t.nativeEvent)};return d?(0,W.jsxs)(`div`,{className:`user-banner-container`,children:[(0,W.jsxs)(`div`,{className:`userinfo-header-container`,children:[(0,W.jsxs)(`div`,{className:`userinfo-container`,onClick:()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},children:[(0,W.jsx)(`div`,{ref:e=>{if(l){e?.empty();return}l||e&&(0,f.setIcon)(e,`Memos`)},className:`thino-user-icon`,style:{backgroundImage:`url("${l}")`}}),(0,W.jsxs)(`div`,{className:`thino-user-info`,children:[(0,W.jsxs)(`span`,{className:`username-container`,children:[(0,W.jsx)(`span`,{"aria-label":s===`MEMO 😉`?`THINO 😉`:s||`THINO`,className:`username-text`,onClick:m,children:s===`MEMO 😉`?`THINO 😉`:s||`THINO`}),(0,W.jsx)(`span`,{className:`user-pro-badge ${r?`activated`:``}`,onClick:()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},children:`PRO`})]}),e?.MomentsQuote&&(0,W.jsx)(`span`,{className:`thino-user-quote`,children:e?.MomentsQuote})]})]}),(0,W.jsxs)(`span`,{className:`btn-group`,children:[e?.DefaultThemeForThino===`modern`&&!o&&(0,W.jsx)(TT,{}),(0,W.jsx)(`span`,{ref:e=>{e&&e.hasChildNodes()||e&&(0,f.setIcon)(e,`more-horizontal`)},className:`btn action-btn menu-popup-btn`,onClick:S}),a&&(0,W.jsx)(`span`,{ref:e=>{e&&e.hasChildNodes()||e&&(0,f.setIcon)(e,`x`)},className:`btn action-btn close-sidebar-btn`,onClick:()=>{R.setShowSiderbarInMobileView(!1)}})]})]}),(0,W.jsx)(E_,{statusType:`banner`})]}):(0,W.jsx)(DT,{})};I();var kT=(0,U.memo)(({query:e,className:t})=>{let{memos:n}=P(),{plugin:r}=F(),[i,a]=(0,U.useState)(null),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),u=(0,U.useRef)(null);return(0,U.useEffect)(()=>{e&&r&&(s(!0),r.thinoWorkerManager.filterMemos(n,{tag:``,duration:null,type:``,text:``,path:``,metadata:{},filter:e.id},{},!0).then(e=>{a(e.length),l(!0)}).catch(e=>{console.error(`Error calculating query count:`,e),a(0)}).finally(()=>{s(!1)}))},[e?.id,e?.updatedAt,e?.querystring,r,n]),(0,W.jsx)(`div`,{className:x_(`query-count`,o?`loading`:`loaded`,t),ref:u,children:c&&i!==null&&(0,W.jsx)(`span`,{className:`count-text`,children:i.toString()||``})})},(e,t)=>e.query.id===t.query.id&&e.query.updatedAt===t.query.updatedAt&&e.query.querystring===t.query.querystring);I(),li(),H(),M();var AT=({useVirtual:e=!1,height:t=400})=>{let{queries:n}=ui(),{app:r}=F(),{settings:i}=vi(),{query:{filter:a}}=Si(),o=Ub(),[s,c]=(0,U.useState)([]),[l,u]=(0,U.useState)(r?.loadLocalStorage(`thino-query-sort-order`)||`byTime`);return(0,U.useEffect)(()=>{c(n.filter(e=>!e.id?.toString().startsWith(`Filter [Temp]`)&&!e.id?.toString().includes(`Filter [Temp]`)).sort((e,t)=>{if(t.pinnedAt&&!e.pinnedAt)return 1;if(e.pinnedAt&&!t.pinnedAt)return-1;switch(l){case`alphabetical`:return e.title.localeCompare(t.title);case`alphabeticalReverse`:return t.title.localeCompare(e.title);case`byTime`:return N.getTimeStampByDate(t.createdAt)-N.getTimeStampByDate(e.createdAt);case`byTimeReverse`:return N.getTimeStampByDate(e.createdAt)-N.getTimeStampByDate(t.createdAt);default:return 0}}))},[n,l]),(0,U.useEffect)(()=>{Zg.getMyAllQueries().catch(()=>{}).finally(()=>{o.setFinish()})},[r]),(0,W.jsxs)(`div`,{className:`queries-wrapper`,children:[(0,W.jsxs)(`div`,{className:`title-text`,children:[(0,W.jsx)(`span`,{className:`normal-text`,children:j(`QUERY`)}),(0,W.jsxs)(`div`,{className:`sort-btn-container`,children:[(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`arrow-down-narrow-wide`)},className:`sort-btn`,onClick:e=>{e.stopPropagation();let t=new f.Menu;for(let e of[`alphabetical`,`alphabeticalReverse`,`byTime`,`byTimeReverse`])t.addItem(t=>{t.setTitle(j(e)).onClick(()=>{u(e),r?.saveLocalStorage(`thino-query-sort-order`,e)}).setChecked(l===e)}),e===`alphabeticalReverse`&&t.addSeparator();t.showAtMouseEvent(e.nativeEvent)}}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`plus`)},className:`btn create-query-btn`,onClick:()=>yT()})]})]}),(0,W.jsx)(Ov,{when:o.isSucceed&&s.length===0,children:(0,W.jsx)(`div`,{className:`create-query-btn-container`,children:(0,W.jsx)(`span`,{className:`btn`,onClick:()=>yT(),children:j(`CREATE FILTER`)})})}),(0,W.jsx)(`div`,{className:`queries-container`,children:s.map(e=>(0,W.jsx)(jT,{query:e,isActive:e.id===a},`${e.id}-${(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`x`)}`))})]})},jT=e=>{let{query:t,isActive:n}=e;return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`query-item-container ${n?`active`:``}`,onClick:()=>{console.log(`ThinoDebug QueryList click`,{from:`QueryList`,queryId:t.id,isActive:n}),z.setMemoFilter(n?``:t.id)},children:[(0,W.jsxs)(`div`,{className:`query-text-container`,children:[(0,W.jsx)(`span`,{ref:e=>{e&&!e.hasChildNodes()&&(0,f.setIcon)(e,`filter`)},className:`icon-text`}),(0,W.jsxs)(`span`,{className:`query-text`,children:[t.title,t.pinnedAt&&` 📌`]})]}),(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(kT,{query:t}),(0,W.jsx)(`span`,{ref:e=>{e&&!e.hasChildNodes()&&(0,f.setIcon)(e,`more-horizontal`)},className:`btn action-btn toggle-btn`,onClick:e=>{e.stopPropagation();let n=new f.Menu;n.addItem(e=>{e.setTitle(t.pinnedAt?j(`UNPIN`):j(`PIN`)).setIcon(t.pinnedAt?`pin-off`:`pin`).onClick(async()=>{try{t.pinnedAt?await Zg.unpinQuery(t.id):await Zg.pinQuery(t.id),Zg.editQuery({...t,pinnedAt:t.pinnedAt?``:N.getDateTimeString(Date.now())})}catch(e){console.error(e)}})}),n.addItem(e=>{e.setTitle(j(`EDIT`)).setIcon(`edit`).onClick(()=>{yT(t.id)})}),n.addItem(e=>{e.setTitle(j(`DUPLICATE`)).setIcon(`copy`).onClick(async()=>{try{let e=Zg.getQueryById(t.id);if(e){let t=`${e.title} ${j(`DUPLICATE`)}`,n=await Zg.createQuery(t,e.querystring);Zg.pushQuery(n),await Zg.getMyAllQueries(),new f.Notice(`Query "${t}" created successfully`)}}catch(e){console.error(e),new f.Notice(`Failed to duplicate query: ${e.message}`)}})}),n.addItem(n=>{n.setTitle(j(`DELETE`)).setIcon(`trash-2`).setWarning(!0).onClick(()=>{let n=new f.Menu;n.addItem(e=>{e.setTitle(j(`CONFIRM!`)).setIcon(`trash-2`).setWarning(!0).onClick(async()=>{try{await Zg.deleteQuery(t.id)}catch(e){new f.Notice(e.message)}})}),n.addItem(e=>{e.setTitle(j(`Cancel`)).setIcon(`x`).onClick(()=>{})}),n.showAtMouseEvent(e.nativeEvent)})}),n.showAtMouseEvent(e.nativeEvent)}})]})]})})};I(),H(),li(),M(),zv(),Av();function MT(e){return(e||window.app)?.loadLocalStorage(`thino-tag-custom`)||{}}function NT(e,t){(e||window.app)?.saveLocalStorage(`thino-tag-custom`,t)}function PT(e){return(e||window.app)?.loadLocalStorage(`thino-pinned-tags`)||[]}function FT(e,t){(e||window.app)?.saveLocalStorage(`thino-pinned-tags`,t)}var IT=[`📌`,`🔥`,`💡`,`⭐`,`❤️`,`🎯`,`📝`,`🚀`,`✅`,`🏷️`,`📚`,`💼`,`🎨`,`🔖`,`⚡`,`🌟`],LT=[`#e53935`,`#d81b60`,`#8e24aa`,`#5e35b1`,`#3949ab`,`#1e88e5`,`#039be5`,`#00acc1`,`#00897b`,`#43a047`,`#7cb342`,`#c0ca33`,`#fdd835`,`#ffb300`,`#fb8c00`,`#f4511e`],RT=8,zT=({useVirtual:e=!1,height:t=400})=>{let n=Si(e=>e.query.tag),r=Si(e=>e.query.filter),i=F(e=>e.app),a=F(e=>e.settings),o=P(e=>e.tags),s=P(e=>e.tagsNum),c=a?.DefaultThemeForThino===`focus`,[l,u]=(0,U.useState)(!1),d=P(e=>e.memosHash),[p,m]=(0,U.useState)(!0),h=(0,U.useMemo)(()=>r&&r?.toString()?.startsWith(`Filter [Temp] `)&&Zg.getQueryById(r),[r]),[g,_]=(0,U.useState)([]),[v,y]=(0,U.useState)(()=>MT(i)),[b,x]=(0,U.useState)(()=>PT(i)),[S,C]=(0,U.useState)((i||window.app)?.loadLocalStorage(`thino-tag-sort-order`)||`alphabetical`);(0,U.useEffect)(()=>{m(!0);let e=(i||window.app)?.loadLocalStorage(`thino-temp-tags`);e?.tags?.length>0&&_(w(e.tags||[],e.tagsNum||{}).subTags),m(!1)},[]),(0,U.useEffect)(()=>{V.initialized&&d&&V.updateTagsState()},[d]),(0,U.useEffect)(()=>{if(!o?.length)return;let e=requestAnimationFrame(()=>{_(w(o,s).subTags),m(!1),(i||window.app)?.saveLocalStorage(`thino-temp-tags`,{tags:o,tagsNum:s})});return()=>cancelAnimationFrame(e)},[o,s]);let w=(0,U.useCallback)((e,t)=>{let n=Array.from(e).sort();if(n.length===0)return{key:``,text:``,count:0,subTags:[]};let r={key:``,text:``,count:0,subTags:[]},i=new Map;for(let e of n){let n=e.split(`/`),a=r,o=``;for(let e=0;e<n.length;e++){let r=n[e];o+=e===0?r:`/`+r;let s=i.get(o);if(s||=a.subTags.find(e=>e.text===o),s||(s={key:r,text:o,count:t[o]||0,subTags:[],parent:a},a.subTags.push(s),i.set(o,s)),e===n.length-1){let e=s.parent;for(;e;)e.count||=0,e.count+=t[o]||0,e=e.parent}a=s}}return r},[]),T=e=>{e.stopPropagation();let t=new f.Menu;for(let e of[`alphabetical`,`alphabeticalReverse`,`byCount`,`byCountReverse`])t.addItem(t=>{t.setTitle(j(e)).onClick(()=>{C(e),i?.saveLocalStorage(`thino-tag-sort-order`,e)}).setChecked(S===e)}),e===`alphabeticalReverse`&&t.addSeparator();t.showAtMouseEvent(e.nativeEvent)},E=(0,U.useMemo)(()=>{let e=[...g].sort(UT(S));if(b.length===0)return e;let t=new Set(b),n=e.filter(e=>t.has(e.text)),r=e.filter(e=>!t.has(e.text));return[...n,...r]},[g,S,b]);return(0,W.jsxs)(`div`,{className:`tags-wrapper`,children:[(0,W.jsxs)(`div`,{className:`tags-header title-text`,children:[(0,W.jsx)(`span`,{className:`normal-text`,children:j(`Frequently Used Tags`)}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`arrow-down-narrow-wide`)},className:`tags-sort-btn`,onClick:T})]}),(0,W.jsx)(`div`,{className:`tags-container`,children:p?(0,W.jsx)(`div`,{className:`tag-loading`,children:`Loading...`}):(0,W.jsxs)(W.Fragment,{children:[(c&&!l?E.slice(0,RT):E).map((e,t)=>(0,W.jsx)(BT,{tag:e,tagQuery:n,filterQuery:h,tagCustom:v,setTagCustom:y,pinnedTags:b,setPinnedTags:x},e.text+`-`+t)),c&&E.length>RT&&(0,W.jsx)(`button`,{type:`button`,className:`tag-list-show-more`,onClick:()=>u(e=>!e),children:l?j(`Collapse tags`)||`Collapse`:`展开剩余 ${E.length-RT} 个…`}),(0,W.jsx)(Ov,{when:g.length<5&&V.initialized,children:(0,W.jsxs)(`span`,{className:`tag-tip-container`,children:[j(`Input`),` `,(0,W.jsxs)(`span`,{className:`code-text`,children:[j(`#Tag`),` `]}),j(`to create tag`),`...`]})})]})})]})},BT=U.memo(e=>{let{tag:t,tagQuery:n,filterQuery:r,tagCustom:i,setTagCustom:a,pinnedTags:o,setPinnedTags:s}=e,c=F(e=>e.app),l=(0,U.useMemo)(()=>n===t.text||r&&JSON.parse(r.querystring).find(e=>e.type===`TAG`&&e.value.value===t.text),[t.text,n,r]),u=t.subTags.length>0,[d,p]=Wb(!1),m=async e=>{if(e.ctrlKey||e.metaKey){let{verifyState:e}=L.getState(),r=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),i=f.Platform.isDesktop?await Pv():r.identifier||r.uuid;if(!(e&&e?.appId===i)){kv();return}let a=z.getState().query.filter;if(a&&a?.startsWith(`Filter [Temp] `)){let e=Zg.getQueryById(a).querystring,n=JSON.parse(e),r;if(n.some(e=>e.type===`TAG`&&e.value.value===t.text)){if(r=n.filter(e=>e.value.value!==t.text),r.length===0){z.setMemoFilter(``);return}let e=Zg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{...r[0],relation:`AND`},...r.slice(1)]));Zg.pushQuery(e),z.setMemoFilter(e.id)}else{r=[...n,{type:`TAG`,value:{value:t.text,operator:`CONTAIN`},relation:`OR`}];let e=Zg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(r));Zg.pushQuery(e),z.setMemoFilter(e.id)}}else if(n){z.setTagQuery(``);let e=Zg.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`}]));Zg.pushQuery(e),z.setMemoFilter(e.id)}else if(!n){let e=Zg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{type:`TAG`,value:{value:t.text,operator:`CONTAIN`},relation:`AND`}]));Zg.pushQuery(e),z.setMemoFilter(e.id)}N.copyTextToClipboard(`#${t.text} `),[`/`,`/recycle`,`/archive`,`/daily`].includes(z.getState().pathname)||z.setPathname(`/`);return}if(l){if(z.setTagQuery(``),r){let e=JSON.parse(r.querystring).filter(e=>e.value.value!==t.text);if(e.length===0){z.setMemoFilter(``);return}let n=Zg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{...e[0],relation:`AND`},...e.slice(1)]));Zg.pushQuery(n),z.setMemoFilter(n.id)}}else await N.copyTextToClipboard(`#${t.text} `),[`/`,`/recycle`,`/archive`,`/daily`].includes(z.getState().pathname)||z.setPathname(`/`),z.setTagQuery(t.text)},h=e=>{e.stopPropagation(),p()},g=i[t.text];return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`tag-item-container ${l?`active`:``}`,onClick:m,onContextMenu:e=>{e.preventDefault(),e.stopPropagation();let n=new f.Menu,r=o.includes(t.text);n.addItem(e=>{e.setIcon(r?`pin-off`:`pin`).setTitle(j(r?`Unpin tag`:`Pin tag`)).onClick(()=>{let e;e=r?o.filter(e=>e!==t.text):[...o,t.text],FT(c,e),s(e)})}),n.addSeparator(),n.addItem(e=>{e.setIcon(`pencil`).setTitle(j(`Rename tag`)).onClick(()=>{let e=new f.Modal(c);e.titleEl.setText(j(`Rename tag`)),e.containerEl.toggleClass(`thino-rename-tag-dialog`,!0),e.contentEl.createEl(`p`,{text:`${j(`Rename all`)} #${t.text} ${j(`to`)}:`,cls:`rename-tag-desc`});let n=t.text;new f.Setting(e.contentEl).setName(j(`New tag name`)).addText(e=>{e.setValue(t.text).onChange(e=>n=e)});let r=e.contentEl.createDiv({cls:`modal-button-container`});r.createEl(`button`,{text:j(`Cancel`)}).addEventListener(`click`,()=>e.close());let o=r.createEl(`button`,{text:j(`Confirm`),cls:`mod-warning`});o.addEventListener(`click`,async()=>{if(!n||n===t.text){e.close();return}o.disabled=!0,o.setText(j(`Processing...`));let{memos:r}=P.getState(),s=t.text,l=s.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),u=RegExp(`(^|\\s|<p>|<br>)#${l}(?=[\\s,;.!?\\)\\]|}]|$)`,`g`),d=0;for(let e of r){if(e.rowStatus===`ARCHIVED`||e.deletedAt)continue;if(!u.test(e.content)){u.lastIndex=0;continue}u.lastIndex=0;let t=e.content.replace(u,`$1#${n}`);t!==e.content&&(await V.updateMemo(e.id,t,e.thinoType),d++)}if(i[s]){let e={...i};e[n]=e[s],delete e[s],NT(c,e),a(e)}V.updateTagsState(),new f.Notice(`${j(`Renamed`)} ${d} thino(s)`),e.close()}),e.open()})}),n.addSeparator(),n.addItem(e=>{e.setIcon(`smile`).setTitle(j(`Set emoji`)).onClick(()=>{let e=new f.Modal(c);e.titleEl.setText(j(`Set emoji for tag`)),e.containerEl.toggleClass(`thino-tag-emoji-dialog`,!0);let n=e.contentEl.createDiv({cls:`emoji-grid`});for(let r of IT)n.createEl(`button`,{text:r,cls:[`emoji-btn`,`clickable-icon`]}).addEventListener(`click`,()=>{let n={...i,[t.text]:{...i[t.text],emoji:r}};NT(c,n),a(n),e.close()});new f.Setting(e.contentEl).setName(j(`Custom emoji`)).addText(n=>{n.setPlaceholder(`🏷️`).onChange(()=>{});let r=n.inputEl;r.addEventListener(`keydown`,n=>{if(n.key===`Enter`){let n=r.value.trim();if(n){let r={...i,[t.text]:{...i[t.text],emoji:n}};NT(c,r),a(r),e.close()}}})}),e.contentEl.createDiv({cls:`modal-button-container`}).createEl(`button`,{text:j(`Clear`)}).addEventListener(`click`,()=>{let n={...i};n[t.text]&&(delete n[t.text].emoji,n[t.text].color||delete n[t.text]),NT(c,n),a(n),e.close()}),e.open()})}),n.addItem(e=>{e.setIcon(`palette`).setTitle(j(`Set color`)).onClick(()=>{let e=new f.Modal(c);e.titleEl.setText(j(`Set color for tag`)),e.containerEl.toggleClass(`thino-tag-color-dialog`,!0);let n=e.contentEl.createDiv({cls:`color-grid`});for(let r of LT){let o=n.createEl(`button`,{cls:[`color-btn`,`clickable-icon`]});o.style.backgroundColor=r,o.addEventListener(`click`,()=>{let n={...i,[t.text]:{...i[t.text],color:r}};NT(c,n),a(n),e.close()})}e.contentEl.createDiv({cls:`modal-button-container`}).createEl(`button`,{text:j(`Clear`)}).addEventListener(`click`,()=>{let n={...i};n[t.text]&&(delete n[t.text].color,n[t.text].emoji||delete n[t.text]),NT(c,n),a(n),e.close()}),e.open()})}),n.showAtMouseEvent(e.nativeEvent)},children:[(0,W.jsxs)(`div`,{className:`tag-text-container`,children:[g?.emoji?(0,W.jsx)(`span`,{className:`btn tag-btn tag-emoji`,children:g.emoji}):(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`hash`)},className:`btn tag-btn`,style:g?.color?{color:g.color}:void 0}),(0,W.jsx)(`span`,{className:`tag-text`,style:g?.color?{color:g.color}:void 0,children:t.key})]}),(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(`span`,{className:`tag-count count-text`,children:t.count}),u?(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn action-btn toggle-btn ${d?`shown`:``}`,onClick:h}):null]})]}),u&&d&&(0,W.jsx)(`div`,{className:`subtags-container`,children:t.subTags.map((e,t)=>(0,W.jsx)(BT,{tag:e,tagQuery:n,filterQuery:r,tagCustom:i,setTagCustom:a,pinnedTags:o,setPinnedTags:s},e.text+`-`+t))})]})}),VT=new Intl.Collator(void 0,{usage:`sort`,sensitivity:`base`,numeric:!0}).compare,HT={alphabetical:(e,t)=>VT(e.text,t.text),alphabeticalReverse:(e,t)=>-VT(e.text,t.text),byCount:(e,t)=>t.count-e.count,byCountReverse:(e,t)=>e.count-t.count},UT=(e=`byCount`)=>HT.hasOwnProperty(e)?HT[e]:HT.alphabetical,G=class extends f.Setting{settingTab;name=``;desc=``;constructor(e,t){super(e),this.settingTab=t}setName(e){return super.setName(e),this.name=e,this}setDesc(e){return super.setDesc(e),this.desc=e,this}setTab(e){let t=typeof this.name==`string`?this.name:this.name.textContent||``,n=typeof this.desc==`string`?this.desc:this.desc.textContent||``;return this.settingTab.addSettingToMasterSettingsList(e,this.settingEl,t,n),this}};I(),M();var WT=class extends f.Modal{plugin;settingTab;target=5;cb;constructor(e,t,n,r,i){super(e),this.app=e,this.settingTab=t,this.plugin=n,this.target=r,this.cb=i}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`memo-save-location-modal`),e.createEl(`h3`,{text:j(`Thino Daily Target`)}),new G(e.createDiv(`modal-setting`),this.settingTab).setName(j(`Target Thino Count`)).addSlider(e=>{e.setDynamicTooltip().setValue(this.target).setLimits(1,30,1).onChange(async e=>{this.target=e})});let t=e.createDiv(`button-group`),n=t.createEl(`button`,{text:j(`Cancel`)}),r=t.createEl(`button`,{text:j(`Save`)});r.onclick=async()=>{this.plugin.settings.MemoDailyTarget=this.target,this.settingTab.applySettingsUpdate(),this.cb(this.target),this.close()},n.onclick=async()=>{this.close()}}onClose(){let{contentEl:e}=this;e.empty()}},GT=({allStat:e,todayTimeStamp:t,calendarType:n,handleCalendarTypeChange:r})=>{let{app:i,settings:a}=F(),{manifest:o}=vi(),[s,c]=(0,U.useState)(),[l,u]=(0,U.useState)(5),[d,p]=(0,U.useState)(0),[m,h]=(0,U.useState)(0),[g,_]=(0,U.useState)(a.HeatmapColorScheme||`default`),v=(0,U.useRef)(null),y=(0,U.useRef)(null);(0,U.useEffect)(()=>{a.HeatmapColorScheme&&_(a.HeatmapColorScheme)},[a.HeatmapColorScheme]),(0,U.useEffect)(()=>{let e,t=5;o&&i&&(e=i?.plugins.getPlugin(o.id),t=e?.settings.MemoDailyTarget,c(e)),u(t)},[o,i]),(0,U.useEffect)(()=>{let n=e.find(e=>e.timestamp===t),r=n?n.count:0;h(r),p(Math.min(100,r/l*100))},[e,l]),(0,U.useEffect)(()=>{(0,f.requireApiVersion)(`1.4.4`)&&((0,f.setTooltip)(y.current,d.toFixed(2)+`%`),(0,f.setTooltip)(v.current,j(`Set daily target`)+` (${m}/${l})`))},[d,m]),(0,U.useEffect)(()=>{v.current&&(v.current.hasChildNodes()||(0,f.setIcon)(v.current,`crosshair`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(y.current,d+`%`))},[v,l]);let b=(0,U.useCallback)(()=>{s&&new WT(i,s?.settingTab,s,l,e=>{u(e)}).open()},[s,l]);return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`usage-daily-progress-wrapper heatmap-${g}`,children:[(0,W.jsx)(`div`,{ref:y,className:`daily-progress-bar`,children:(0,W.jsx)(`div`,{className:`daily-progress-bar-inner`,style:{width:`${d}%`}})}),(0,W.jsx)(`div`,{ref:v,className:`daily-progress-target`,onClick:b}),(0,W.jsx)(`div`,{ref:e=>{e&&(0,f.setIcon)(e,n===`basic`?`layout-grid`:`calendar`),e&&f.setTooltip&&(0,f.setTooltip)(e,j(`Switch calendar type`))},className:`switch-calendar-type-btn`,onClick:()=>r&&r(n===`basic`?`heatmap`:`basic`)})]})})};$r(),M(),ng();var KT=(e,t)=>{let n=[],r=Math.floor((e-t)/zr);for(let e=0;e<=r;e++)n.push({timestamp:t+zr*e,count:0,list:0});return n},qT=e=>{let{className:t,view:n,datestamp:r,handleDateStampChange:i,handleDateItemClick:a,handleMonthChange:o,dailyStat:s}=e,c=Qs(new Date).getTime(),[l,u]=(0,U.useState)(XT(r)),[d,p]=(0,U.useState)(null),[m,h]=(0,U.useState)(e.dailyStat);(0,U.useEffect)(()=>{u(XT(r));let t=KT(ZT(r),XT(r)),n=e.thinos.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`),i=Qs(new Date(l)).getTime();for(let e of n){let n=e.createdAtTs??new Date(e.createdAt.replace(/\//g,`-`)).getTime(),r=Qs(new Date(n)).getTime(),a=Math.round((r-i)/zr);a>=0&&a<t.length&&(t[a].count+=1,e.thinoType===`JOURNAL`&&(t[a].list+=1))}h(t)},[r,e.thinos]);let g=new Date(l),_=g.getDay(),v=[];for(let e=0;e<_;e++)v.push({date:0,datestamp:g.getTime()-zr*(7-e)});let y=YT(l);for(let e=1;e<=y;e++)v.push({date:e,datestamp:g.getTime()+zr*(e-1)});let b=e=>{let t=g.getFullYear(),n=g.getMonth()+1,r=0;r=n===1&&e===-1?new Date(`${t-1}/12/1`).getTime():n===12&&e===1?new Date(`${t+1}/1/1`).getTime():new Date(`${t}/${n+e}/1`).getTime(),u(XT(r)),o&&o(r)};return(0,W.jsxs)(`div`,{className:`heatmap-date-picker-wrapper ${t}`,children:[(0,W.jsxs)(`div`,{className:`date-picker-header`,children:[(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-left`)},className:`btn btn-text`,onClick:()=>b(-1)}),(0,W.jsxs)(`span`,{className:`normal-text`,children:[(0,W.jsx)(qb,{year:g.getFullYear().toString(),handleYearChange:e=>{u(XT(new Date(`${e}/${g.getMonth()+1}/1`).getTime()))}}),(0,W.jsx)(Jb,{month:g.getMonth().toString(),handleMonthChange:e=>{u(XT(new Date(`${g.getFullYear()}/${parseInt(e)}/1`).getTime()))}})]}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn btn-text`,onClick:()=>b(1)})]}),(0,W.jsxs)(`div`,{className:`date-picker-day-container`,children:[(0,W.jsx)(`div`,{className:`date-picker-day-header`,children:j(`weekDaysShort`).map(e=>(0,W.jsx)(`span`,{className:`day-item`,children:e},e))}),(0,W.jsx)(`div`,{className:`date-picker-day-content`,children:v.map(e=>{if(e.date===0)return(0,W.jsx)(`span`,{className:`day-item null`,children:``},e.datestamp);let t=m.find(t=>t.timestamp===e.datestamp)||{count:0,timestamp:e.datestamp,list:0},o=t.count-t.list,s=t.list;return(0,W.jsxs)(`span`,{className:`day-item ${e.datestamp===c?`current`:``} ${e.datestamp===d?`selected`:``} ${QT(t.count)}`,onClick:n=>{i(r,n.nativeEvent),p(e.datestamp===d?null:e.datestamp),a&&a(n,t)},onMouseOver:r=>{!t||!t.count||JT(new f.HoverPopover(n,r.currentTarget,100),{d:e,list:s,task:o})},children:[(0,W.jsx)(`span`,{className:`day-item-text`,children:e.date}),(0,W.jsx)(W.Fragment,{children:t&&t.count!==0&&(0,W.jsxs)(`span`,{className:`day-item-dots`,children:[o>0&&(0,W.jsx)(`div`,{className:`day-item-dot thino-task-dot ${QT(o)}`}),s>0&&(0,W.jsx)(`div`,{className:`day-item-dot thino-list-dot ${QT(s)}`})]})})]},e.datestamp)})})]})]})};function JT(e,{d:t,list:n,task:r}){e.hoverEl.toggleClass(`thino-hover-popover`,!0);let i=e.hoverEl.createDiv({cls:`thino-hover-popover-content`});i.createDiv({cls:`thino-date-item`,text:`${rd(new Date(t.datestamp),`yyyy-MM-dd`)}`});let a=i.createDiv({cls:`thino-task-item`});a.createSpan({cls:`thino-task-item-title-text`,text:`${j(`Task`)}: `}),a.createSpan({cls:`thino-task-item-title-count`,text:`${r}`});let o=i.createDiv({cls:`thino-list-item`});o.createSpan({cls:`thino-list-item-title-text`,text:`${j(`List`)}: `}),o.createSpan({cls:`thino-list-item-title-count`,text:`${n}`})}function YT(e){let 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())/zr}function XT(e){let t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}function ZT(e){let 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()-zr}function QT(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`}I(),H(),$r(),ng(),M(),je();var $T={width:12,height:7},eE=(e,t)=>{let n=[];for(let r=0;r<=e;r++)n.push({timestamp:t+zr*r,count:0,list:0});return n},tE=({initThinos:e,basicType:t})=>{let n=Gc(new Date).getTime();new Date(n).getDay();let r=Qs(new Date).getTime(),i=Array(6-new Date(n).getDay()).fill(0),a=$T.width*$T.height,o=Pm(Qs(new Date),a),s=o.getTime(),{memos:c}=P(),{view:l,app:u,settings:d}=F(),[p,m]=(0,rw.default)(t||rE(u||window.app)||`heatmap`),[h,g]=(0,rw.default)(Qs(new Date).getTime()),[_,v]=(0,rw.default)(d.HeatmapColorScheme||`default`),[y,b]=(0,rw.default)(eE(a,s)),[x,S]=(0,rw.default)(null),[C,w,T]=(0,rw.default)(``),E=(0,U.useRef)(null);(0,U.useEffect)(()=>{let t=eE(a,s),n=(e||c).filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`);for(let e of n){let n=e.createdAtTs??(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).valueOf();if(Number.isNaN(n))continue;let r=Qs(new Date(n)).getTime(),i=Lc(new Date(r),o);i>=0&&i<t.length&&(t[i].count+=1,e.thinoType===`JOURNAL`&&(t[i].list+=1))}b([...t])},[c,e]),(0,U.useEffect)(()=>{d.HeatmapColorScheme&&v(d.HeatmapColorScheme)},[d.HeatmapColorScheme]);let D=(0,U.useCallback)((e,t)=>{if(!t||!t.count)return;let n=t.count-t.list,r=t.list,i={date:t.timestamp,datestamp:t.timestamp};JT(new f.HoverPopover(l,e.currentTarget,100),{d:i,list:r,task:n})},[]),O=()=>{m(p===`heatmap`?`basic`:`heatmap`),nE(u,p===`heatmap`?`basic`:`heatmap`),g(Qs(new Date).getTime())},k=(0,U.useCallback)(async(e,t)=>{if(t.count===0){te(t);return}let n=z.getState().query.duration,r=n?.from,i=n?.to,a=Lc(new Date(r),new Date(i))===0;if(r===t.timestamp&&a){z.setFromAndToQuery(0,0),S(null),w(null);return}if(e.shiftKey){ee(t,r,i,a);return}if(e.ctrlKey||e.metaKey){await A(t.timestamp);return}te(t)},[]),ee=(e,t,n,r)=>{let i=e.timestamp;if(t===0){z.setFromAndToQuery(i,Gc(new Date).getTime()),w(`from`);return}let a=Lc(Gc(new Date(i)),new Date(n));t<i?T.current===`to`?a<0?z.setFromAndToQuery(i,n):(z.setFromAndToQuery(Qs(new Date(n)).getTime(),Gc(new Date(i)).getTime()),w(`from`)):T.current===`from`&&z.setFromAndToQuery(t,Gc(new Date(i)).getTime()):T.current===`to`?z.setFromAndToQuery(i,n):T.current===`from`&&(z.setFromAndToQuery(i,Gc(new Date(t)).getTime()),w(`to`))},A=async e=>{let{app:t,dailyNotes:n}=L.getState(),r=ve((0,f.moment)(e),n);if(r)if(!f.Platform.isMobile)await t.workspace.getLeaf(!0).openFile(r);else{let e=t.workspace.activeLeaf;e===null&&(e=t.workspace.getLeaf(!0)),e.openFile(r)}},te=e=>{[`/`,`/recycle`].includes(z.getState().pathname)||z.setPathname(`/`),z.setFromAndToQuery(e.timestamp,Gc(new Date(e.timestamp)).getTime()),S(e)},ne=(0,U.useMemo)(()=>(0,W.jsx)(qT,{className:`heatmap-${_}`,view:l,datestamp:h,dailyStat:y,thinos:e||c,handleMonthChange:e=>{g(e)},handleDateStampChange:e=>{console.log(e)},handleDateItemClick:(e,t)=>k(e,t)}),[JSON.stringify(y),e,c,l,h,_]);return(0,W.jsxs)(W.Fragment,{children:[p===`basic`&&ne,p===`heatmap`&&(0,W.jsxs)(`div`,{className:`usage-heat-map-wrapper heatmap-${_}`,ref:E,children:[(0,W.jsxs)(`div`,{className:`day-tip-text-container`,children:[(0,W.jsx)(`span`,{className:`tip-text`,children:j(`weekDaysShort`)[0]}),(0,W.jsx)(`span`,{className:`tip-text`}),(0,W.jsx)(`span`,{className:`tip-text`,children:j(`weekDaysShort`)[2]}),(0,W.jsx)(`span`,{className:`tip-text`}),(0,W.jsx)(`span`,{className:`tip-text`,children:j(`weekDaysShort`)[4]}),(0,W.jsx)(`span`,{className:`tip-text`}),(0,W.jsx)(`span`,{className:`tip-text`,children:j(`weekDaysShort`)[6]})]}),(0,W.jsxs)(`div`,{className:`usage-heat-map`,children:[y.slice(y.length-84+i.length,y.length).map((e,t)=>{let n=e.count,i=n<=0?``:n<=1?`stat-day-L1-bg`:n<=2?`stat-day-L2-bg`:n<=4?`stat-day-L3-bg`:`stat-day-L4-bg`;return(0,W.jsx)(`span`,{"data-timestamp":e.timestamp,"data-count":e.count,"data-list-count":e.list,"data-task-count":e.count-e.list,className:`stat-container ${i} ${x===e?`current`:``} ${r===e.timestamp?`today`:``}`,onMouseOver:t=>D(t,e),onClick:t=>k(t,e)},t)}),i.map((e,t)=>(0,W.jsx)(`span`,{className:`stat-container null`},t))]})]}),!t&&(0,W.jsx)(GT,{allStat:y,todayTimeStamp:r,calendarType:p,handleCalendarTypeChange:O})]})};function nE(e,t){try{e?.saveLocalStorage(`calendarType`,t)}catch(e){console.error(e)}}function rE(e){try{return e?.loadLocalStorage(`calendarType`)||`heatmap`}catch(e){return console.error(e),`heatmap`}}H(),M(),I(),Av(),zv();function iE(e){return(e||window.app)?.loadLocalStorage(`thino-hidden-entries`)||[]}function aE(e,t){(e||window.app)?.saveLocalStorage(`thino-hidden-entries`,t)}var oE=()=>{let{app:e,settings:t,verifyState:n}=F(),[r,i]=(0,U.useState)(()=>iE(e)),[a,o]=(0,U.useState)(!1),s=[{name:j(`Random Review`),path:`/review`,iconID:`star`},{name:j(`Daily Review`),path:`/daily-review`,iconID:`gallery-thumbnails`},{name:j(`Gallery`),path:`/gallery`,iconID:`image`},{name:j(`Stat`),path:`/stat`,iconID:`chart-bar`},{name:j(`ARCHIVE`),path:`/archive`,iconID:`archive`},{name:j(`Recycle bin`),path:`/recycle`,iconID:`recycle`}],c=(0,U.useMemo)(()=>new Set(r),[r]),l=(0,U.useMemo)(()=>s.filter(e=>!c.has(e.path)),[c,t]),u=(0,U.useMemo)(()=>s.filter(e=>c.has(e.path)),[c,t]),d=(0,U.useRef)([]),p=(0,U.useRef)(null);(0,U.useEffect)(()=>{d.current.forEach((e,t)=>{if(e){let n=[...l,...a?u:[]];n[t]&&(0,f.setIcon)(e,n[t].iconID)}})},[t,l,u,a]),(0,U.useEffect)(()=>{p.current&&(0,f.setIcon)(p.current,a?`chevron-up`:`more-horizontal`)},[a,p.current]);let m=(0,U.useCallback)(async t=>{let r=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),i=f.Platform.isDesktop?await Pv():r.identifier||r.uuid;if(!n&&n?.appId!==i&&(t.path===`/review`||t.path===`/daily-review`||t.path===`/stat`)){kv();return}if(z.setPathname(t.path),t.path===`/review`&&z.getState().pathname===`/review`){e.workspace.trigger(`refresh-review-memos`);return}z.clearQuery()},[e,n]),h=(0,U.useCallback)((t,n,a)=>{t.preventDefault(),t.stopPropagation();let o=new f.Menu;a?o.addItem(t=>{t.setIcon(`eye`).setTitle(j(`Show entry`)).onClick(()=>{let t=r.filter(e=>e!==n.path);aE(e,t),i(t)})}):o.addItem(t=>{t.setIcon(`eye-off`).setTitle(j(`Hide entry`)).onClick(()=>{let t=[...r,n.path];aE(e,t),i(t)})}),o.showAtMouseEvent(t.nativeEvent)},[e,r]),g=(e,n,r)=>(0,W.jsxs)(`div`,{className:`path-entry-container ${z.getState().pathname===e.path?`active`:``} ${t.DeleteThinoDirectly&&e.path===`/recycle`?`thino-hidden`:``} ${e.path===`/review`||e.path===`/daily-review`||e.path===`/stat`?`pro`:``}`,onClick:()=>m(e),onContextMenu:t=>h(t,e,r),children:[(0,W.jsx)(`span`,{ref:e=>d.current[n]=e,className:`path-entry-icon`}),(0,W.jsx)(`span`,{className:`path-entry-text`,children:e.name})]},e.path);return(0,W.jsxs)(`div`,{className:`path-entry-wrapper`,children:[l.map((e,t)=>g(e,t,!1)),u.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`path-entry-container path-entry-more`,onClick:()=>o(!a),children:[(0,W.jsx)(`span`,{ref:p,className:`path-entry-icon`}),(0,W.jsx)(`span`,{className:`path-entry-text`,children:j(`More`)})]}),a&&u.map((e,t)=>g(e,l.length+t,!0))]})]})};ng(),I();var sE=()=>{let e=P(e=>e.memos),t=P(e=>e.tags),n=(0,U.useMemo)(()=>{if(!e?.length)return 0;let t=e[e.length-1];if(!t?.createdAt)return 0;let n=Xp(t.createdAt,`yyyy/MM/dd HH:mm:ss`,new Date);return Number.isNaN(n.getTime())?0:Lc(new Date,n)+1},[e]),r=(0,U.useMemo)(()=>e?.length?e.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`).length:0,[e]);return!e||e.length===0?null:(0,W.jsxs)(`div`,{className:`thino-focus-heatbox-header`,"aria-hidden":`true`,children:[(0,W.jsxs)(`div`,{className:`thino-focus-heatbox-value`,children:[(0,W.jsx)(`em`,{children:n.toLocaleString()}),(0,W.jsx)(`span`,{className:`thino-focus-heatbox-unit`,children:`天`})]}),(0,W.jsxs)(`div`,{className:`thino-focus-heatbox-subtitle`,children:[r.toLocaleString(),` 想法 · `,t?.length||0,` 标签`]})]})};I(),H(),M(),Av(),zv();var cE=[{name:()=>j(`Random Review`),path:`/review`,icon:`star`,proGated:!0},{name:()=>j(`Daily Review`),path:`/daily-review`,icon:`gallery-thumbnails`,proGated:!0},{name:()=>j(`Gallery`),path:`/gallery`,icon:`image`},{name:()=>j(`Stat`),path:`/stat`,icon:`chart-bar`,proGated:!0},{name:()=>j(`ARCHIVE`),path:`/archive`,icon:`archive`},{name:()=>j(`Recycle bin`),path:`/recycle`,icon:`recycle`}],lE=()=>{let{settings:e,plugin:t,app:n,manifest:r,verifyState:i}=F(),{isPhoneView:a}=vi(),o=(0,U.useRef)(null),s=(0,U.useRef)(null);(0,U.useEffect)(()=>{o.current&&(0,f.setIcon)(o.current,`settings`),s.current&&(0,f.setIcon)(s.current,`more-horizontal`)},[]);let c=()=>{n?.setting?.open?.(),n?.setting?.openTabById?.(r?.id||`obsidian-memos`)},l=async e=>{if(e.proGated){let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),t=f.Platform.isDesktop?await Pv():e?.identifier||e?.uuid;if(!i||i?.appId!==t){kv();return}}z.setPathname(e.path),e.path===`/review`&&n?.workspace?.trigger?.(`refresh-review-memos`),z.clearQuery()},u=i=>{let a=new f.Menu;a.addItem(e=>{e.setIcon(`calendar-check`).setTitle(j(`Daily Memos`)).onClick(()=>{z.setPathname(`/daily`)})}),a.addSeparator();let o=(n||window.app)?.loadLocalStorage(`thino-hidden-entries`)||[],s=cE.filter(t=>!o.includes(t.path)&&!(e?.DeleteThinoDirectly&&t.path===`/recycle`));for(let e of s)a.addItem(t=>{t.setIcon(e.icon).setTitle(e.name()).onClick(()=>{l(e)})});a.addSeparator(),a.addItem(e=>{e.setIcon(`file-text`).setTitle(j(`ChangeLog`)).onClick(()=>__(n))}),a.addItem(e=>{e.setIcon(`settings`).setTitle(j(`Setting guide`)).onClick(()=>{R.setShowSiderbarInMobileView(!1),t?.settingTab?.updateSettings?.(`FirstLoaded`,!0)})}),a.addItem(e=>{e.setIcon(`alert-circle`).setTitle(j(`Submit issue`)).onClick(()=>{new y_(n,t,r?.version).open()})}),e?.needVerify&&(a.addSeparator(),a.addItem(t=>{t.setIcon(`lock`).setTitle(j(`Lock`)).onClick(()=>{e?.needVerify?R.setLocked(!0):new f.Notice(j(`You have not set a password or enable this feature yet`))})})),a.showAtMouseEvent(i.nativeEvent)};return a?null:(0,W.jsx)(`div`,{className:`thino-focus-sidebar-footer`,children:(0,W.jsxs)(`div`,{className:`thino-focus-sidebar-footer-actions`,role:`group`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`thino-focus-sidebar-footer-btn`,onClick:c,children:[(0,W.jsx)(`span`,{className:`thino-focus-sidebar-footer-icon`,ref:o,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`thino-focus-sidebar-footer-label`,children:j(`Settings`)})]}),(0,W.jsxs)(`button`,{type:`button`,className:`thino-focus-sidebar-footer-btn`,onClick:u,children:[(0,W.jsx)(`span`,{className:`thino-focus-sidebar-footer-icon`,ref:s,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`thino-focus-sidebar-footer-label`,children:j(`More`)})]})]})})};I(),M();var uE=()=>{let e=P(e=>e.memos),{activeMemos:t,activeDays:n}=(0,U.useMemo)(()=>{let t=e||[],n=new Set,r=0;for(let e of t){if(e.deletedAt||e.rowStatus===`ARCHIVED`)continue;r++;let t=e.createdAt;if(!t)continue;let i=new Date(t);Number.isNaN(i.getTime())||n.add(`${i.getFullYear()}-${i.getMonth()}-${i.getDate()}`)}return{activeMemos:r,activeDays:n.size}},[e]),r=e=>e.toLocaleString();return(0,W.jsxs)(`div`,{className:`thino-focus-heat-meta`,"aria-hidden":`true`,children:[(0,W.jsxs)(`span`,{className:`thino-focus-heat-meta-item`,children:[r(t),` `,j(`thoughts`)||`想法`]}),(0,W.jsxs)(`span`,{className:`thino-focus-heat-meta-item`,children:[r(n),` `,j(`days`)||`天`]})]})};I(),H(),M();var dE=()=>{let{settings:e}=F(),{isPhoneView:t}=vi(),n=(0,U.useRef)(null),r=e?.DefaultThemeForThino===`focus`;if((0,U.useEffect)(()=>{!r||!t||n.current&&(0,f.setIcon)(n.current,`x`)},[r,t]),!r||!t)return null;let i=()=>{R.setShowSiderbarInMobileView(!1)};return(0,W.jsxs)(`div`,{className:`thino-focus-mobile-menu-header`,role:`banner`,children:[(0,W.jsxs)(`div`,{className:`thino-focus-mobile-menu-brand`,"aria-hidden":`true`,children:[(0,W.jsx)(`span`,{className:`thino-focus-mobile-menu-mark`,children:`t`}),(0,W.jsx)(`span`,{className:`thino-focus-mobile-menu-name`,children:`thino`})]}),(0,W.jsx)(`button`,{type:`button`,className:`thino-focus-mobile-menu-btn`,"aria-label":j(`Close`)||`Close`,onClick:i,children:(0,W.jsx)(`span`,{ref:n,"aria-hidden":`true`})})]})};I(),H(),M();var fE=()=>{let{app:e,manifest:t}=F(),n=(0,U.useRef)(null);return(0,U.useEffect)(()=>{n.current&&(0,f.setIcon)(n.current,`settings`)},[]),(0,W.jsx)(`div`,{className:`thino-focus-mobile-settings`,children:(0,W.jsxs)(`button`,{type:`button`,className:`thino-focus-mobile-settings-btn`,onClick:()=>{R.setShowSiderbarInMobileView(!1),e?.setting?.open?.(),e?.setting?.openTabById?.(t?.id||`obsidian-memos`)},children:[(0,W.jsx)(`span`,{ref:n,className:`thino-focus-mobile-settings-icon`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`thino-focus-mobile-settings-label`,children:j(`Settings`)})]})})};I(),$r(),H();var pE=e=>{let{settings:t}=F(),n=Si(),{isMobileView:r,isPhoneView:i,showSiderbarInMobileView:a}=vi(),o=(0,U.useRef)(null),s=(0,U.useMemo)(()=>e=>{let t=R.getState().showSiderbarInMobileView;if(!t){window.removeEventListener(`click`,s,{capture:!0});return}let n=e.target;!n.closest(`.close-sidebar-btn`)&&n.closest(`.memos-sidebar-wrapper`)||o.current?.contains(e.target)||o.current?.parentNode?.contains(e.target)&&(t&&e.stopPropagation(),R.setShowSiderbarInMobileView(!1),window.removeEventListener(`click`,s,{capture:!0}))},[]);(0,U.useEffect)(()=>{R.setShowSiderbarInMobileView(!1)},[n]),(0,U.useEffect)(()=>{a?document.body.classList.add(Rr):document.body.classList.remove(Rr)},[a]),(0,U.useEffect)(()=>{r&&a&&window.addEventListener(`click`,s,{capture:!0})},[r,a]);let c=t?.DefaultThemeForThino,l=c===`modern`,u=c===`focus`,d=u&&i;return(0,W.jsxs)(`aside`,{className:x_(`memos-sidebar-wrapper`,e.className),ref:o,children:[e.children,d&&(0,W.jsx)(dE,{}),!d&&(0,W.jsx)(OT,{}),l&&!r?e?.sidebarPosition===`right`?(0,W.jsx)(tE,{}):null:u?i?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(sE,{}),(0,W.jsx)(tE,{}),(0,W.jsx)(AT,{}),(0,W.jsx)(zT,{}),(0,W.jsx)(oE,{}),(0,W.jsx)(fE,{})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`thino-focus-sidebar-search-slot`,children:(0,W.jsx)(Dv,{})}),(0,W.jsx)(oE,{}),(0,W.jsx)(AT,{}),(0,W.jsx)(zT,{}),(0,W.jsx)(tE,{}),(0,W.jsx)(uE,{}),(0,W.jsx)(lE,{})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(tE,{}),(0,W.jsx)(oE,{}),(0,W.jsx)(AT,{}),(0,W.jsx)(zT,{})]}),l&&!r&&e?.sidebarPosition===`left`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(oE,{}),(0,W.jsx)(AT,{}),(0,W.jsx)(E_,{statusType:`sidebar`})]}),l&&!r&&e?.sidebarPosition===`right`&&(0,W.jsx)(zT,{})]})},mE=({rows:e=3,className:t=``})=>(0,W.jsx)(`div`,{className:`loading-skeleton-container ${t}`,children:Array.from({length:e}).map((e,t)=>(0,W.jsxs)(`div`,{className:`skeleton-item`,children:[(0,W.jsxs)(`div`,{className:`skeleton-header`,children:[(0,W.jsx)(`div`,{className:`skeleton-avatar`}),(0,W.jsxs)(`div`,{className:`skeleton-meta`,children:[(0,W.jsx)(`div`,{className:`skeleton-line skeleton-line-short`}),(0,W.jsx)(`div`,{className:`skeleton-line skeleton-line-tiny`})]})]}),(0,W.jsxs)(`div`,{className:`skeleton-content`,children:[(0,W.jsx)(`div`,{className:`skeleton-line`}),(0,W.jsx)(`div`,{className:`skeleton-line`}),(0,W.jsx)(`div`,{className:`skeleton-line skeleton-line-medium`})]})]},t))});M(),H(),I();var hE=()=>{let{settings:e}=F(),[t,n]=U.useState(``);return(0,W.jsx)(`div`,{className:`locked-screen-wrapper`,children:(0,W.jsxs)(`div`,{className:`locked-screen-content`,children:[(0,W.jsx)(`div`,{className:`locked-screen-header`,children:(0,W.jsx)(`div`,{className:`locked-screen-header-title`,children:j(`Locked`)})}),(0,W.jsx)(`div`,{className:`locked-screen-body`,children:(0,W.jsxs)(`div`,{className:`locked-screen-body-content`,children:[(0,W.jsxs)(`div`,{className:`locked-screen-body-content-text`,children:[(0,W.jsx)(`div`,{className:`locked-screen-body-content-text-title`,children:j(`Thino is locked`)}),(0,W.jsx)(`div`,{className:`locked-screen-body-content-text-desc`,children:j(`Please unlock Thino by input password`)})]}),(0,W.jsxs)(`div`,{className:`locked-screen-body-content-inputer`,children:[(0,W.jsx)(`input`,{onKeyDown:n=>{n.key===`Enter`&&(e?.password===t?R.setLocked(!1):new f.Notice(j(`Password is incorrect`)))},onChange:e=>{n(e.target.value)},value:t,type:`password`,className:`locked-screen-body-content-input`}),(0,W.jsx)(`button`,{className:`locked-screen-body-content-btn`,onClick:()=>{e?.password===t?R.setLocked(!1):new f.Notice(j(`Password is incorrect`))},children:j(`Unlock`)})]})]})})]})})};H(),M();var gE=()=>{let e=(0,U.useRef)(null);(0,U.useEffect)(()=>{e.current&&(0,f.setIcon)(e.current,`x`)},[]);let t=()=>{R.setGlobalEditorShown(!1)},n=()=>{let e=document.querySelector(`.memo-editor-wrapper.fullscreen-editor .confirm-btn`);if(e){try{e.dispatchEvent(new PointerEvent(`pointerdown`,{bubbles:!0}))}catch{e.dispatchEvent(new MouseEvent(`mousedown`,{bubbles:!0}))}window.setTimeout(()=>{R.setGlobalEditorShown(!1)},250)}};return(0,W.jsxs)(`div`,{className:`thino-focus-mobile-compose-bar`,role:`toolbar`,children:[(0,W.jsx)(`button`,{type:`button`,className:`thino-focus-mobile-compose-close`,onClick:t,"aria-label":j(`Close`)||`Close`,children:(0,W.jsx)(`span`,{ref:e,"aria-hidden":`true`})}),(0,W.jsxs)(`div`,{className:`thino-focus-mobile-compose-title`,"aria-hidden":`true`,children:[j(`New thought`)||`新想法`,(0,W.jsx)(`span`,{className:`thino-focus-mobile-compose-title-sep`,children:` · `}),(0,W.jsx)(`span`,{className:`thino-focus-mobile-compose-title-sub`,children:`Draft`})]}),(0,W.jsx)(`button`,{type:`button`,className:`thino-focus-mobile-compose-save`,onClick:n,children:j(`Save`)})]})};M();var _E=()=>{let[e,t]=(0,U.useState)(()=>Date.now());(0,U.useEffect)(()=>{let e=window.setInterval(()=>t(Date.now()),6e4);return()=>window.clearInterval(e)},[]);let n=(0,f.moment)(e),r=n.format(`dddd`),i=n.format(`HH:mm`),a=(0,f.moment)(),o=n.startOf(`day`).diff(a.startOf(`day`),`days`),s;return s=o===0?j(`Today`):o===1?j(`Tomorrow`):o===-1?j(`Yesterday`):n.format(`LL`),(0,W.jsxs)(`div`,{className:`thino-focus-date-line`,"aria-hidden":`true`,children:[(0,W.jsx)(`span`,{className:`thino-focus-date-dot`}),(0,W.jsxs)(`span`,{className:`thino-focus-date-text`,children:[s,`,`,r]}),(0,W.jsx)(`span`,{className:`thino-focus-date-sep`,children:`·`}),(0,W.jsx)(`span`,{className:`thino-focus-date-time`,children:i})]})},vE=class extends ix{fuzzySearchItemsOptimized(e,t){let n=(0,f.prepareFuzzySearch)(e);return t.map(e=>{let t=n(e.path);return t?{item:e,match:t,score:t.score}:null}).sort((e,t)=>t?.score-e?.score).filter(Boolean)}getSuggestions(e){let t=app.vault.getFiles().filter(e=>[`png`,`jpg`,`jpeg`,`gif`].includes(e.extension)),n=e.toLowerCase();return this.fuzzySearchItemsOptimized(n,t).map(e=>e.item)}renderSuggestion(e,t){let n=e.basename,r=e.parent?.path||``;t.toggleClass(`thino-image-suggest-item`,!0),t.createSpan({cls:`suggestion-name`,text:n}),t.createSpan({cls:`suggestion-path`,text:r})}selectSuggestion(e){this.inputEl.value=e.path,this.inputEl.trigger(`input`),this.close()}};M(),h_(),I(),je(),H();var yE=e=>{let{settings:t,app:n,plugin:r}=F(),{manifest:i}=vi(),[a,o]=U.useState(0),[s,c]=U.useState(``),l=U.useRef(null),u=U.useRef(null),[d,p]=U.useState({enabled:!1,path:``,format:``});(0,U.useEffect)(()=>{if(a===2&&t?.EnabledLocationList.find(e=>e.value===`DAILY`))if(!re())p({enabled:!1,path:``,format:``});else{let e=O().folder,t=O().format;p({enabled:!0,path:e,format:t})}},[a]),(0,U.useEffect)(()=>{if(!t?.MomentsIcon||!n){c(``);return}let e=n.vault.adapter.getResourcePath((0,f.normalizePath)(t.MomentsIcon));e&&!t?.MomentsIcon.startsWith(`http`)?c(e):c(t?.MomentsIcon)},[t?.MomentsIcon,n]),(0,U.useEffect)(()=>{u&&(u.current=null)},[a]),(0,U.useEffect)(()=>{l.current&&(u.current||=new vE(l.current))},[l.current]);let m=(e,t)=>{console.log(`key`,e,`value`,t);let i=r;i||=n.plugins.getPlugin(`obsidian-memos`),i.settingTab.updateSettings(e,t)},h=(0,U.useMemo)(()=>{switch(a){case 0:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:j(`Get started with Thino`)}),(0,W.jsx)(`p`,{children:j(`Set up your user info for Thino.`)})]});case 1:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:j(`Set theme for Thino`)}),(0,W.jsx)(`p`,{children:j(`Choose a theme for Thino.`)})]});case 2:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:j(`Go with daily note plugin`)}),(0,W.jsx)(`p`,{children:j(`If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.`)})]});case 3:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:j(`Set preferences for using Thino`)}),(0,W.jsx)(`p`,{children:j(`Adjust settings that influence your user experience with Thino.`)})]});case 4:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:j(`Congrats! All settings done`)}),(0,W.jsx)(`p`,{children:j(`Go and enjoy Thino`)})]})}},[a]),g=()=>{switch(a){case 0:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`thino-user-preview-wrapper`,children:(0,W.jsxs)(`div`,{className:`userinfo-container`,onClick:()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},children:[(0,W.jsx)(`div`,{ref:e=>{if(t?.MomentsIcon){e?.empty();return}t?.MomentsIcon||e&&(0,f.setIcon)(e,`Memos`)},className:`thino-user-icon`,style:{backgroundImage:`url("${s}")`}}),(0,W.jsxs)(`div`,{className:`thino-user-info`,children:[(0,W.jsx)(`span`,{className:`username-container`,children:(0,W.jsx)(`span`,{"aria-label":t?.UserName===`MEMO 😉`?`THINO 😉`:t?.UserName||`THINO`,className:`username-text`,children:t?.UserName===`MEMO 😉`?`THINO 😉`:t?.UserName||`THINO`})}),t?.MomentsQuote&&(0,W.jsx)(`span`,{className:`thino-user-quote`,children:t?.MomentsQuote})]})]})}),(0,W.jsxs)(`div`,{className:`thino-user-info-wrapper`,children:[(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`User name`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`Set your user name here. 'Memos 😏' By default`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`Thino 😏`,defaultValue:t?.UserName,onInput:e=>m(`UserName`,e.currentTarget.value)})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`User quote`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`Set user quote for thino`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`Share thino with the world`,defaultValue:t?.MomentsQuote,onInput:e=>m(`MomentsQuote`,e.currentTarget.value)})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`User icon`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`Set user icon for thino. You can input http/https link or file path in vault.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,ref:l,placeholder:`Input url or file path`,defaultValue:t?.MomentsIcon,onInput:e=>m(`MomentsIcon`,e.currentTarget.value)})})]})]})]});case 1:return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:x_(`theme-selector-group`,`selected`),children:[(0,W.jsxs)(`div`,{className:x_(`theme-selector`,t?.DefaultThemeForThino===`modern`?`selected`:``),onClick:()=>m(`DefaultThemeForThino`,`modern`),children:[(0,W.jsxs)(`div`,{className:`theme-selector-header-component`,children:[(0,W.jsx)(`div`,{className:`theme-selector-header`,children:j(`Modern`)}),(0,W.jsx)(`div`,{className:`theme-selector-description`,children:j(`A modern theme for Thino with a three-column layout and some unique features.`)})]}),(0,W.jsxs)(`div`,{className:`theme-selector-content`,children:[(0,W.jsx)(`div`,{className:`left-column column-component`}),(0,W.jsx)(`div`,{className:`center-column column-component`}),(0,W.jsx)(`div`,{className:`right-column column-component`})]}),(0,W.jsx)(`div`,{className:`theme-selector-footer`,children:(0,W.jsx)(`button`,{className:`mod-cta`,disabled:t?.DefaultThemeForThino===`modern`,onClick:()=>m(`DefaultThemeForThino`,`modern`),children:t?.DefaultThemeForThino===`modern`?j(`Selected`):j(`Select`)})})]}),(0,W.jsxs)(`div`,{className:x_(`theme-selector`,t?.DefaultThemeForThino===`classic`?`selected`:``),onClick:()=>m(`DefaultThemeForThino`,`classic`),children:[(0,W.jsxs)(`div`,{className:`theme-selector-header-component`,children:[(0,W.jsx)(`div`,{className:`theme-selector-header`,children:j(`Classic`)}),(0,W.jsx)(`div`,{className:`theme-selector-description`,children:j(`A classic theme for Thino with a two-column layout`)})]}),(0,W.jsxs)(`div`,{className:`theme-selector-content`,children:[(0,W.jsx)(`div`,{className:`left-column column-component`}),(0,W.jsx)(`div`,{className:`center-column column-component`})]}),(0,W.jsx)(`div`,{className:`theme-selector-footer`,children:(0,W.jsx)(`button`,{className:`mod-cta`,disabled:t?.DefaultThemeForThino===`classic`,onClick:()=>m(`DefaultThemeForThino`,`classic`),children:t?.DefaultThemeForThino===`classic`?j(`Selected`):j(`Select`)})})]}),(0,W.jsxs)(`div`,{className:x_(`theme-selector`,t?.DefaultThemeForThino===`focus`?`selected`:``),onClick:()=>m(`DefaultThemeForThino`,`focus`),children:[(0,W.jsxs)(`div`,{className:`theme-selector-header-component`,children:[(0,W.jsx)(`div`,{className:`theme-selector-header`,children:j(`Focus`)}),(0,W.jsx)(`div`,{className:`theme-selector-description`,children:j(`A focus-first theme with a serif hero composer and diary-style stream.`)})]}),(0,W.jsxs)(`div`,{className:`theme-selector-content`,children:[(0,W.jsx)(`div`,{className:`left-column column-component`}),(0,W.jsx)(`div`,{className:`center-column column-component`})]}),(0,W.jsx)(`div`,{className:`theme-selector-footer`,children:(0,W.jsx)(`button`,{className:`mod-cta`,disabled:t?.DefaultThemeForThino===`focus`,onClick:()=>m(`DefaultThemeForThino`,`focus`),children:t?.DefaultThemeForThino===`focus`?j(`Selected`):j(`Select`)})})]})]})});case 2:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`daily-note-plugin-status`,children:[(0,W.jsxs)(`div`,{className:`daily-note-plugin-status-header`,children:[(0,W.jsx)(`div`,{className:`plugin-status-header`,children:j(`Daily note plugin`)}),(0,W.jsx)(`div`,{className:`plugin-status-description`,children:j(`Enable daily note plugin`)})]}),(0,W.jsx)(`div`,{className:`daily-note-plugin-status-content`,children:d.enabled&&(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`daily-note-format`,children:[(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Daily note name format`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`Set daily note name format`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`YYYY-MM-DD`,defaultValue:d.format,onInput:e=>{p({...d,format:e.currentTarget.value.trim()});try{let t=n.internalPlugins.getPluginById(`daily-notes`);t.instance.options={...t.instance.options,format:e.currentTarget.value.trim()},t.saveData({...t.instance.options,format:e.currentTarget.value.trim()})}catch(e){console.error(e)}}})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Daily notes folder`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`Set daily notes folder`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`YYYY-MM-DD`,defaultValue:d.path,onInput:e=>{p({...d,path:e.currentTarget.value.trim()});try{let t=n.internalPlugins.getPluginById(`daily-notes`);t.instance.options={...t.instance.options,folder:e.currentTarget.value.trim()},t.saveData({...t.instance.options,folder:e.currentTarget.value.trim()})}catch(e){console.error(e)}}})})]})]})})}),(0,W.jsxs)(`div`,{className:`daily-note-plugin-status-footer`,children:[!d.enabled&&(0,W.jsx)(`div`,{className:`notice-click`,children:j(`Click to enable =>`)}),(0,W.jsx)(`button`,{className:`mod-cta`,disabled:d.enabled,onClick:()=>{if(!d.enabled){n.internalPlugins.getPluginById(`daily-notes`).enable();let e=O().folder,t=O().format;p({enabled:!0,format:t,path:e})}},children:d.enabled?j(`Enabled`):j(`Enable`)})]})]}),(0,W.jsxs)(`div`,{className:`thino-daily-settings-wrapper`,children:[(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Default time prefix`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`Set default time prefix for thino in daily notes.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsxs)(`select`,{className:`dropdown`,defaultValue:t?.DefaultTimePrefix,onChange:e=>m(`DefaultTimePrefix`,e.currentTarget.value),children:[(0,W.jsx)(`option`,{value:`HH:mm`,children:`HH:mm`}),(0,W.jsx)(`option`,{value:`HH:mm:ss`,children:`HH:mm:ss`})]})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Set thino insert place`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`Set where to insert thino content`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsxs)(`select`,{className:`dropdown`,defaultValue:t?.InsertType,onChange:e=>m(`InsertType`,e.currentTarget.value),children:[(0,W.jsx)(`option`,{value:`end`,children:j(`End of the diary`)}),(0,W.jsx)(`option`,{value:`custom`,children:j(`Custom location`)})]})})]}),t?.InsertType===`custom`&&(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Insert after heading`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`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.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`# Heading`,defaultValue:t?.InsertAfter,onInput:e=>m(`InsertAfter`,e.currentTarget.value)})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Set process target`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`You can set whole diary or only part of it`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsxs)(`select`,{className:`dropdown`,defaultValue:t?.ProcessContentTarget,onChange:e=>m(`ProcessContentTarget`,e.currentTarget.value),children:[(0,W.jsx)(`option`,{value:`custom`,children:j(`Custom`)}),(0,W.jsx)(`option`,{value:`whole`,children:j(`Whole diary`)})]})})]}),t?.ProcessContentTarget===`custom`&&(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Process Memos below`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`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.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`# Heading`,defaultValue:t?.ProcessEntriesBelow,onInput:e=>m(`ProcessEntriesBelow`,e.currentTarget.value)})})]})]})]});case 3:return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`thino-custom-settings-wrapper`,children:[(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Default prefix when save thino`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`Set the default prefix when create memo, 'List' by default.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsxs)(`select`,{className:`dropdown`,defaultValue:t?.DefaultPrefix,onChange:e=>m(`DefaultPrefix`,e.currentTarget.value),children:[(0,W.jsx)(`option`,{value:`List`,children:j(`List`)}),(0,W.jsx)(`option`,{value:`Task`,children:j(`Task`)})]})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Use Tags In Vault`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`Use tags in vault rather than only in Memos. False by default.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,ref:e=>{e&&(e.hasChildNodes()||new f.ToggleComponent(e).setValue(t?.UseVaultTags===void 0?!1:t?.UseVaultTags).onChange(e=>{m(`UseVaultTags`,e)}))}})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:j(`Delete Thino Directly`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:j(`When delete thino directly, it will not be moved to trash. False by default.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,ref:e=>{e&&(e.hasChildNodes()||new f.ToggleComponent(e).setValue(t?.DeleteThinoDirectly===void 0?!1:t?.DeleteThinoDirectly).onChange(e=>{m(`DeleteThinoDirectly`,e)}))}})]})]})});case 4:return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`thino-congrats`,children:[(0,W.jsxs)(`div`,{className:`final-congrats-text`,children:[(0,W.jsx)(`p`,{className:`ready-use`,children:j(`Thino is ready to use. `)}),(0,W.jsx)(`p`,{className:`start-to-use`,children:j(`You can start using Thino now. If you want to know more about Thino Pro, click the button below.`)})]}),(0,W.jsxs)(`div`,{className:`next-btns-group`,children:[(0,W.jsx)(`button`,{onClick:()=>{m_()?window.open(`https://pkmer.cn/products/thino`,`_blank`):window.open(`https://thino.pkmer.net/en/#price`,`_blank`)},children:j(`About Thino Pro`)}),(0,W.jsx)(`button`,{className:`mod-cta`,onClick:()=>{m(`FirstLoaded`,!1),R.getState().isMobileView?(setTimeout(()=>{R.setShowSiderbarInMobileView(!0)},500),setTimeout(()=>{R.setExitSteps(!0)},1e3)):setTimeout(()=>{R.setExitSteps(!0)},800)},children:j(`Start Thino`)})]})]})})}};return(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:`onboarding-view-container`,children:(0,W.jsx)(`div`,{className:`onboarding-view-wrapper`,children:(0,W.jsxs)(`div`,{"data-onboarding-step":a,className:`onboarding-view-content`,children:[(0,W.jsxs)(`div`,{className:`onboarding-step-heading`,children:[(0,W.jsxs)(`div`,{className:`onboarding-step-count`,children:[a+1,`/5`]}),(0,W.jsx)(`div`,{className:`close-btn`,children:(0,W.jsx)(`button`,{onClick:()=>{m(`FirstLoaded`,!1)},children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`lucide lucide-x`,children:[(0,W.jsx)(`path`,{d:`M18 6 6 18`}),(0,W.jsx)(`path`,{d:`m6 6 12 12`})]})})})]}),(0,W.jsxs)(`div`,{className:`onboarding-view-details`,children:[(0,W.jsxs)(`div`,{className:`details-content`,children:[(0,W.jsx)(`div`,{className:`onboarding-header-group`,children:h}),(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:`onboarding-form`,children:g()})})]}),(0,W.jsxs)(`div`,{className:`details-footer`,children:[(0,W.jsx)(`div`,{className:`skip-btn`,children:a!==4&&(0,W.jsx)(`button`,{onClick:()=>{m(`FirstLoaded`,!1)},children:j(`Skip and start Thino`)})}),(0,W.jsxs)(`div`,{className:`navigate-btns-group`,children:[a!==0&&(0,W.jsx)(`button`,{onClick:()=>o(a-1),children:j(`Back to previous step`)}),a!==4&&(0,W.jsx)(`button`,{className:`mod-cta`,onClick:()=>o(a+1),children:j(`Next step`)}),a===4&&(0,W.jsx)(`button`,{className:`details-settings-btn`,onClick:()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},children:j(`Details settings`)})]})]})]})]})})})})};function bE(e){return bE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},bE(e)}function xE(e,t,n,r){return new(n||=Promise)((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))}function SE(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function CE(e,t,n){var r,i=((r={})[e]=t,r.path=`/`,r.expires=void 0,r);if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),i.expires=a.toUTCString()}var o=[];for(var s in i)o.push(`${s}=${i[s]}`);return document.cookie=o.join(`; `),wE(e)}function wE(e){return(t={},document.cookie.split(`;`).forEach((function(e){var n=e.split(`=`),r=n[0],i=n[1];t[r.trim()]=i})),t)[e];var t}function TE(e,t){t?CE(e._options.dontShowAgainCookie,`true`,e._options.dontShowAgainCookieDays):CE(e._options.dontShowAgainCookie,``,-1)}var EE,DE=(EE={},function(e,t){return t===void 0&&(t=`introjs-stamp`),EE[t]=EE[t]||0,e[t]===void 0&&(e[t]=EE[t]++),e[t]}),OE=new(function(){function e(){this.events_key=`introjs_event`}return e.prototype._id=function(e,t,n){return e+DE(t)+(n?`_${DE(n)}`:``)},e.prototype.on=function(e,t,n,r,i){var a=this._id(t,n,r),o=function(t){return n(r||e,t||window.event)};`addEventListener`in e?e.addEventListener(t,o,i):`attachEvent`in e&&e.attachEvent(`on${t}`,o),e[this.events_key]=e[this.events_key]||{},e[this.events_key][a]=o},e.prototype.off=function(e,t,n,r,i){var a=this._id(t,n,r),o=e[this.events_key]&&e[this.events_key][a];o&&(`removeEventListener`in e?e.removeEventListener(t,o,i):`detachEvent`in e&&e.detachEvent(`on${t}`,o),e[this.events_key][a]=null)},e}()),kE=function(e){return typeof e==`function`};function AE(e,t){if(e instanceof SVGElement){var n=e.getAttribute(`class`)||``;n.match(t)||e.setAttribute(`class`,`${n} ${t}`)}else if(e.classList!==void 0)for(var r=0,i=t.split(` `);r<i.length;r++){var a=i[r];e.classList.add(a)}else e.className.match(t)||(e.className+=` ${t}`)}function jE(e,t){var n=``;return`currentStyle`in e?n=e.currentStyle[t]:document.defaultView&&document.defaultView.getComputedStyle&&(n=document.defaultView.getComputedStyle(e,null).getPropertyValue(t)),n&&n.toLowerCase?n.toLowerCase():n}function ME(e,t){if(e){var n=function(e){var t=window.getComputedStyle(e),n=t.position===`absolute`,r=/(auto|scroll)/;if(t.position===`fixed`)return document.body;for(var i=e;i=i.parentElement;)if(t=window.getComputedStyle(i),(!n||t.position!==`static`)&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.body}(t);n!==document.body&&(n.scrollTop=t.offsetTop-n.offsetTop)}}function NE(){if(window.innerWidth!==void 0)return{width:window.innerWidth,height:window.innerHeight};var e=document.documentElement;return{width:e.clientWidth,height:e.clientHeight}}function PE(e,t,n,r,i){var a;if(t!==`off`&&e&&(a=t===`tooltip`?i.getBoundingClientRect():r.getBoundingClientRect(),!function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom+80<=window.innerHeight&&t.right<=window.innerWidth}(r))){var o=NE().height;a.bottom-(a.bottom-a.top)<0||r.clientHeight>o?window.scrollBy(0,a.top-(o/2-a.height/2)-n):window.scrollBy(0,a.top-(o/2-a.height/2)+n)}}function FE(e){e.setAttribute(`role`,`button`),e.tabIndex=0}function IE(e){var t=e.parentElement;return!(!t||t.nodeName===`HTML`)&&(jE(e,`position`)===`fixed`||IE(t))}function LE(e,t){var n=document.body,r=document.documentElement,i=window.pageYOffset||r.scrollTop||n.scrollTop,a=window.pageXOffset||r.scrollLeft||n.scrollLeft;t||=n;var o=e.getBoundingClientRect(),s=t.getBoundingClientRect(),c=jE(t,`position`),l={width:o.width,height:o.height};return t.tagName.toLowerCase()!==`body`&&c===`relative`||c===`sticky`?Object.assign(l,{top:o.top-s.top,left:o.left-s.left}):IE(e)?Object.assign(l,{top:o.top,left:o.left}):Object.assign(l,{top:o.top+i,left:o.left+a})}function RE(e,t){if(e instanceof SVGElement){var n=e.getAttribute(`class`)||``;e.setAttribute(`class`,n.replace(t,``).replace(/^\s+|\s+$/g,``))}else e.className=e.className.replace(t,``).replace(/^\s+|\s+$/g,``)}function zE(e,t){var n=``;if(e.style.cssText&&(n+=e.style.cssText),typeof t==`string`)n+=t;else for(var r in t)n+=`${r}:${t[r]};`;e.style.cssText=n}function BE(e,t,n){if(n&&t){var r=LE(t.element,e._targetElement),i=e._options.helperElementPadding;t.element instanceof Element&&IE(t.element)?AE(n,`introjs-fixedTooltip`):RE(n,`introjs-fixedTooltip`),t.position===`floating`&&(i=0),zE(n,{width:`${r.width+i}px`,height:`${r.height+i}px`,top:`${r.top-i/2}px`,left:`${r.left-i/2}px`})}}function VE(e,t,n,r,i){return e.left+t+n.width>r.width?(i.style.left=`${r.width-n.width-e.left}px`,!1):(i.style.left=`${t}px`,!0)}function HE(e,t,n,r){return e.left+e.width-t-n.width<0?(r.style.left=`${-e.left}px`,!1):(r.style.right=`${t}px`,!0)}function UE(e,t){e.includes(t)&&e.splice(e.indexOf(t),1)}function WE(e,t,n,r){var i=e.slice(),a=NE(),o=LE(n).height+10,s=LE(n).width+20,c=t.getBoundingClientRect(),l=`floating`;if(c.bottom+o>a.height&&UE(i,`bottom`),c.top-o<0&&UE(i,`top`),c.right+s>a.width&&UE(i,`right`),c.left-s<0&&UE(i,`left`),r&&=r.split(`-`)[0],i.length&&(l=i[0],i.includes(r)&&(l=r)),l===`top`||l===`bottom`){var u=void 0,d=[];l===`top`?(u=`top-middle-aligned`,d=[`top-left-aligned`,`top-middle-aligned`,`top-right-aligned`]):(u=`bottom-middle-aligned`,d=[`bottom-left-aligned`,`bottom-middle-aligned`,`bottom-right-aligned`]),l=function(e,t,n,r){var i=t/2,a=Math.min(n,window.screen.width);return a-e<t&&(UE(r,`top-left-aligned`),UE(r,`bottom-left-aligned`)),(e<i||a-e<i)&&(UE(r,`top-middle-aligned`),UE(r,`bottom-middle-aligned`)),e<t&&(UE(r,`top-right-aligned`),UE(r,`bottom-right-aligned`)),r.length?r[0]:null}(c.left,s,a.width,d)||u}return l}function GE(e,t,n,r,i){if(i===void 0&&(i=!1),t){var a,o,s,c,l=``;n.style.top=``,n.style.right=``,n.style.bottom=``,n.style.left=``,n.style.marginLeft=``,n.style.marginTop=``,r.style.display=`inherit`,l=typeof t.tooltipClass==`string`?t.tooltipClass:e._options.tooltipClass,n.className=[`introjs-tooltip`,l].filter(Boolean).join(` `),n.setAttribute(`role`,`dialog`),(c=t.position)!==`floating`&&e._options.autoPosition&&(c=WE(e._options.positionPrecedence,t.element,n,c)),o=LE(t.element),a=LE(n),s=NE(),AE(n,`introjs-${c}`);var u=o.width/2-a.width/2;switch(c){case`top-right-aligned`:r.className=`introjs-arrow bottom-right`;var d=0;HE(o,d,a,n),n.style.bottom=`${o.height+20}px`;break;case`top-middle-aligned`:r.className=`introjs-arrow bottom-middle`,i&&(u+=5),HE(o,u,a,n)&&(n.style.right=``,VE(o,u,a,s,n)),n.style.bottom=`${o.height+20}px`;break;case`top-left-aligned`:case`top`:r.className=`introjs-arrow bottom`,VE(o,i?0:15,a,s,n),n.style.bottom=`${o.height+20}px`;break;case`right`:n.style.left=`${o.width+20}px`,o.top+a.height>s.height?(r.className=`introjs-arrow left-bottom`,n.style.top=`-${a.height-o.height-20}px`):r.className=`introjs-arrow left`;break;case`left`:i||!0!==e._options.showStepNumbers||(n.style.top=`15px`),o.top+a.height>s.height?(n.style.top=`-${a.height-o.height-20}px`,r.className=`introjs-arrow right-bottom`):r.className=`introjs-arrow right`,n.style.right=`${o.width+20}px`;break;case`floating`:r.style.display=`none`,n.style.left=`50%`,n.style.top=`50%`,n.style.marginLeft=`-${a.width/2}px`,n.style.marginTop=`-${a.height/2}px`;break;case`bottom-right-aligned`:r.className=`introjs-arrow top-right`,HE(o,d=0,a,n),n.style.top=`${o.height+20}px`;break;case`bottom-middle-aligned`:r.className=`introjs-arrow top-middle`,i&&(u+=5),HE(o,u,a,n)&&(n.style.right=``,VE(o,u,a,s,n)),n.style.top=`${o.height+20}px`;break;default:r.className=`introjs-arrow top`,VE(o,0,a,s,n),n.style.top=`${o.height+20}px`}}}function KE(){for(var e=0,t=Array.from(document.querySelectorAll(`.introjs-showElement`));e<t.length;e++)RE(t[e],/introjs-[a-zA-Z]+/g)}function qE(e,t){var n=document.createElement(e);t||={};var r=/^(?:role|data-|aria-)/;for(var i in t){var a=t[i];i===`style`&&typeof a!=`function`?zE(n,a):typeof a==`string`&&i.match(r)?n.setAttribute(i,a):n[i]=a}return n}function JE(e,t,n){if(n===void 0&&(n=!1),n){var r=t.style.opacity||`1`;zE(t,{opacity:`0`}),window.setTimeout((function(){zE(t,{opacity:r})}),10)}e.appendChild(t)}function YE(e,t){return(e+1)/t*100}function XE(e,t){var n=qE(`div`,{className:`introjs-bullets`});!1===e._options.showBullets&&(n.style.display=`none`);var r=qE(`ul`);r.setAttribute(`role`,`tablist`);for(var i=function(){var t=this.getAttribute(`data-step-number`);t!=null&&e.goToStep(parseInt(t,10))},a=0;a<e._introItems.length;a++){var o=e._introItems[a].step,s=qE(`li`),c=qE(`a`);s.setAttribute(`role`,`presentation`),c.setAttribute(`role`,`tab`),c.onclick=i,a===t.step-1&&(c.className=`active`),FE(c),c.innerHTML=` `,c.setAttribute(`data-step-number`,o.toString()),s.appendChild(c),r.appendChild(s)}return n.appendChild(r),n}function ZE(e,t,n){var r=e.querySelector(`.introjs-progress .introjs-progressbar`);if(r){var i=YE(t,n);r.style.cssText=`width:${i}%;`,r.setAttribute(`aria-valuenow`,i.toString())}}function QE(e,t){return xE(this,void 0,void 0,(function(){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=this;return SE(this,(function(D){switch(D.label){case 0:return kE(e._introChangeCallback)?[4,e._introChangeCallback.call(e,t.element)]:[3,2];case 1:D.sent(),D.label=2;case 2:return n=document.querySelector(`.introjs-helperLayer`),r=document.querySelector(`.introjs-tooltipReferenceLayer`),i=`introjs-helperLayer`,typeof t.highlightClass==`string`&&(i+=` ${t.highlightClass}`),typeof e._options.highlightClass==`string`&&(i+=` ${e._options.highlightClass}`),n!==null&&r!==null?(c=r.querySelector(`.introjs-helperNumberLayer`),l=r.querySelector(`.introjs-tooltiptext`),u=r.querySelector(`.introjs-tooltip-title`),d=r.querySelector(`.introjs-arrow`),f=r.querySelector(`.introjs-tooltip`),s=r.querySelector(`.introjs-skipbutton`),o=r.querySelector(`.introjs-prevbutton`),a=r.querySelector(`.introjs-nextbutton`),n.className=i,f.style.opacity=`0`,f.style.display=`none`,ME(e._options.scrollToElement,t.element),BE(e,t,n),BE(e,t,r),KE(),e._lastShowElementTimer&&window.clearTimeout(e._lastShowElementTimer),e._lastShowElementTimer=window.setTimeout((function(){c!==null&&(c.innerHTML=`${t.step} ${e._options.stepNumbersOfLabel} ${e._introItems.length}`),l.innerHTML=t.intro||``,u.innerHTML=t.title||``,f.style.display=`block`,GE(e,t,f,d),function(e,t,n){if(e){var r=t.querySelector(`.introjs-bullets li > a.active`),i=t.querySelector(`.introjs-bullets li > a[data-step-number="${n.step}"]`);r&&i&&(r.className=``,i.className=`active`)}}(e._options.showBullets,r,t),ZE(r,e._currentStep,e._introItems.length),f.style.opacity=`1`,(a!=null&&/introjs-donebutton/gi.test(a.className)||a!=null)&&a.focus(),PE(e._options.scrollToElement,t.scrollTo,e._options.scrollPadding,t.element,l)}),350)):(p=qE(`div`,{className:i}),m=qE(`div`,{className:`introjs-tooltipReferenceLayer`}),h=qE(`div`,{className:`introjs-arrow`}),g=qE(`div`,{className:`introjs-tooltip`}),_=qE(`div`,{className:`introjs-tooltiptext`}),v=qE(`div`,{className:`introjs-tooltip-header`}),y=qE(`h1`,{className:`introjs-tooltip-title`}),b=qE(`div`),zE(p,{"box-shadow":`0 0 1px 2px rgba(33, 33, 33, 0.8), rgba(33, 33, 33, ${e._options.overlayOpacity.toString()}) 0 0 0 5000px`}),ME(e._options.scrollToElement,t.element),BE(e,t,p),BE(e,t,m),JE(e._targetElement,p,!0),JE(e._targetElement,m),_.innerHTML=t.intro,y.innerHTML=t.title,b.className=`introjs-tooltipbuttons`,!1===e._options.showButtons&&(b.style.display=`none`),v.appendChild(y),g.appendChild(v),g.appendChild(_),e._options.dontShowAgain&&(x=qE(`div`,{className:`introjs-dontShowAgain`}),(S=qE(`input`,{type:`checkbox`,id:`introjs-dontShowAgain`,name:`introjs-dontShowAgain`})).onchange=function(t){e.setDontShowAgain(t.target.checked)},(C=qE(`label`,{htmlFor:`introjs-dontShowAgain`})).innerText=e._options.dontShowAgainLabel,x.appendChild(S),x.appendChild(C),g.appendChild(x)),g.appendChild(XE(e,t)),g.appendChild(function(e){var t=qE(`div`);t.className=`introjs-progress`,!1===e._options.showProgress&&(t.style.display=`none`);var n=qE(`div`,{className:`introjs-progressbar`});e._options.progressBarAdditionalClass&&(n.className+=` `+e._options.progressBarAdditionalClass);var r=YE(e._currentStep,e._introItems.length);return n.setAttribute(`role`,`progress`),n.setAttribute(`aria-valuemin`,`0`),n.setAttribute(`aria-valuemax`,`100`),n.setAttribute(`aria-valuenow`,r.toString()),n.style.cssText=`width:${r}%;`,t.appendChild(n),t}(e)),w=qE(`div`),!0===e._options.showStepNumbers&&(w.className=`introjs-helperNumberLayer`,w.innerHTML=`${t.step} ${e._options.stepNumbersOfLabel} ${e._introItems.length}`,g.appendChild(w)),g.appendChild(h),m.appendChild(g),(a=qE(`a`)).onclick=function(){return xE(E,void 0,void 0,(function(){return SE(this,(function(t){switch(t.label){case 0:return e._introItems.length-1===e._currentStep?[3,2]:[4,tD(e)];case 1:return t.sent(),[3,6];case 2:return/introjs-donebutton/gi.test(a.className)?kE(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,`done`)]:[3,4]:[3,6];case 3:t.sent(),t.label=4;case 4:return[4,xD(e,e._targetElement)];case 5:t.sent(),t.label=6;case 6:return[2]}}))}))},FE(a),a.innerHTML=e._options.nextLabel,(o=qE(`a`)).onclick=function(){return xE(E,void 0,void 0,(function(){return SE(this,(function(t){switch(t.label){case 0:return e._currentStep>0?[4,nD(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},FE(o),o.innerHTML=e._options.prevLabel,FE(s=qE(`a`,{className:`introjs-skipbutton`})),s.innerHTML=e._options.skipLabel,s.onclick=function(){return xE(E,void 0,void 0,(function(){return SE(this,(function(t){switch(t.label){case 0:return e._introItems.length-1===e._currentStep&&kE(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,`skip`)]:[3,2];case 1:t.sent(),t.label=2;case 2:return kE(e._introSkipCallback)?[4,e._introSkipCallback.call(e,e._currentStep)]:[3,4];case 3:t.sent(),t.label=4;case 4:return[4,xD(e,e._targetElement)];case 5:return t.sent(),[2]}}))}))},v.appendChild(s),e._introItems.length>1&&b.appendChild(o),b.appendChild(a),g.appendChild(b),GE(e,t,g,h),PE(e._options.scrollToElement,t.scrollTo,e._options.scrollPadding,t.element,g)),(T=e._targetElement.querySelector(`.introjs-disableInteraction`))&&T.parentNode&&T.parentNode.removeChild(T),t.disableInteraction&&function(e,t){var n=document.querySelector(`.introjs-disableInteraction`);n===null&&(n=qE(`div`,{className:`introjs-disableInteraction`}),e._targetElement.appendChild(n)),BE(e,t,n)}(e,t),e._currentStep===0&&e._introItems.length>1?(a!=null&&(a.className=`${e._options.buttonClass} introjs-nextbutton`,a.innerHTML=e._options.nextLabel),!0===e._options.hidePrev?(o!=null&&(o.className=`${e._options.buttonClass} introjs-prevbutton introjs-hidden`),a!=null&&AE(a,`introjs-fullbutton`)):o!=null&&(o.className=`${e._options.buttonClass} introjs-prevbutton introjs-disabled`)):e._introItems.length-1===e._currentStep||e._introItems.length===1?(o!=null&&(o.className=`${e._options.buttonClass} introjs-prevbutton`),!0===e._options.hideNext?(a!=null&&(a.className=`${e._options.buttonClass} introjs-nextbutton introjs-hidden`),o!=null&&AE(o,`introjs-fullbutton`)):a!=null&&(!0===e._options.nextToDone?(a.innerHTML=e._options.doneLabel,AE(a,`${e._options.buttonClass} introjs-nextbutton introjs-donebutton`)):a.className=`${e._options.buttonClass} introjs-nextbutton introjs-disabled`)):(o!=null&&(o.className=`${e._options.buttonClass} introjs-prevbutton`),a!=null&&(a.className=`${e._options.buttonClass} introjs-nextbutton`,a.innerHTML=e._options.nextLabel)),o?.setAttribute(`role`,`button`),a?.setAttribute(`role`,`button`),s?.setAttribute(`role`,`button`),a?.focus(),function(e){AE(e,`introjs-showElement`);var t=jE(e,`position`);t!==`absolute`&&t!==`relative`&&t!==`sticky`&&t!==`fixed`&&AE(e,`introjs-relativePosition`)}(t.element),kE(e._introAfterChangeCallback)?[4,e._introAfterChangeCallback.call(e,t.element)]:[3,4];case 3:D.sent(),D.label=4;case 4:return[2]}}))}))}function $E(e,t){return xE(this,void 0,void 0,(function(){return SE(this,(function(n){switch(n.label){case 0:return e._currentStep=t-2,e._introItems===void 0?[3,2]:[4,tD(e)];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}function eD(e,t){return xE(this,void 0,void 0,(function(){return SE(this,(function(n){switch(n.label){case 0:return e._currentStepNumber=t,e._introItems===void 0?[3,2]:[4,tD(e)];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}function tD(e){return xE(this,void 0,void 0,(function(){var t,n,r;return SE(this,(function(i){switch(i.label){case 0:if(e._direction=`forward`,e._currentStepNumber!==void 0)for(t=0;t<e._introItems.length;t++)e._introItems[t].step===e._currentStepNumber&&(e._currentStep=t-1,e._currentStepNumber=void 0);return e._currentStep===-1?e._currentStep=0:++e._currentStep,n=e._introItems[e._currentStep],r=!0,kE(e._introBeforeChangeCallback)?[4,e._introBeforeChangeCallback.call(e,n&&n.element,e._currentStep,e._direction)]:[3,2];case 1:r=i.sent(),i.label=2;case 2:return!1===r?(--e._currentStep,[2,!1]):e._introItems.length<=e._currentStep?kE(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,`end`)]:[3,4]:[3,6];case 3:i.sent(),i.label=4;case 4:return[4,xD(e,e._targetElement)];case 5:return i.sent(),[2,!1];case 6:return[4,QE(e,n)];case 7:return i.sent(),[2,!0]}}))}))}function nD(e){return xE(this,void 0,void 0,(function(){var t,n;return SE(this,(function(r){switch(r.label){case 0:return e._direction=`backward`,e._currentStep<=0?[2,!1]:(--e._currentStep,t=e._introItems[e._currentStep],n=!0,kE(e._introBeforeChangeCallback)?[4,e._introBeforeChangeCallback.call(e,t&&t.element,e._currentStep,e._direction)]:[3,2]);case 1:n=r.sent(),r.label=2;case 2:return!1===n?(++e._currentStep,[2,!1]):[4,QE(e,t)];case 3:return r.sent(),[2,!0]}}))}))}function rD(e,t){return xE(this,void 0,void 0,(function(){var n,r;return SE(this,(function(i){switch(i.label){case 0:return(n=t.code===void 0?t.which:t.code)===null&&(n=t.charCode===null?t.keyCode:t.charCode),n!==`Escape`&&n!==27||!0!==e._options.exitOnEsc?[3,2]:[4,xD(e,e._targetElement)];case 1:return i.sent(),[3,16];case 2:return n!==`ArrowLeft`&&n!==37?[3,4]:[4,nD(e)];case 3:return i.sent(),[3,16];case 4:return n!==`ArrowRight`&&n!==39?[3,6]:[4,tD(e)];case 5:return i.sent(),[3,16];case 6:return n!==`Enter`&&n!==`NumpadEnter`&&n!==13?[3,16]:(r=t.target||t.srcElement)&&r.className.match(`introjs-prevbutton`)?[4,nD(e)]:[3,8];case 7:return i.sent(),[3,15];case 8:return r&&r.className.match(`introjs-skipbutton`)?e._introItems.length-1===e._currentStep&&kE(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,`skip`)]:[3,10]:[3,12];case 9:i.sent(),i.label=10;case 10:return[4,xD(e,e._targetElement)];case 11:return i.sent(),[3,15];case 12:return r&&r.getAttribute(`data-step-number`)?(r.click(),[3,15]):[3,13];case 13:return[4,tD(e)];case 14:i.sent(),i.label=15;case 15:t.preventDefault?t.preventDefault():t.returnValue=!1,i.label=16;case 16:return[2]}}))}))}function iD(e){if(e===null||bE(e)!==`object`||`nodeType`in e)return e;var t={};for(var n in e)`jQuery`in window&&e[n]instanceof window.jQuery?t[n]=e[n]:t[n]=iD(e[n]);return t}function aD(e){var t=document.querySelector(`.introjs-hints`);return t?Array.from(t.querySelectorAll(e)):[]}function oD(e,t){return xE(this,void 0,void 0,(function(){var n;return SE(this,(function(r){switch(r.label){case 0:return n=aD(`.introjs-hint[data-step="${t}"]`)[0],mD(),n&&AE(n,`introjs-hidehint`),kE(e._hintCloseCallback)?[4,e._hintCloseCallback.call(e,t)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))}function sD(e){return xE(this,void 0,void 0,(function(){var t,n,r,i,a;return SE(this,(function(o){switch(o.label){case 0:t=aD(`.introjs-hint`),n=0,r=t,o.label=1;case 1:return n<r.length?(i=r[n],(a=i.getAttribute(`data-step`))?[4,oD(e,parseInt(a,10))]:[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))}function cD(e){return xE(this,void 0,void 0,(function(){var t,n,r,i,a;return SE(this,(function(o){switch(o.label){case 0:if(!(t=aD(`.introjs-hint`))||!t.length)return[3,1];for(n=0,r=t;n<r.length;n++)i=r[n],(a=i.getAttribute(`data-step`))&&lD(parseInt(a,10));return[3,3];case 1:return[4,hD(e,e._targetElement)];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))}function lD(e){var t=aD(`.introjs-hint[data-step="${e}"]`)[0];t&&RE(t,/introjs-hidehint/g)}function uD(e){var t=aD(`.introjs-hint[data-step="${e}"]`)[0];t&&t.parentNode&&t.parentNode.removeChild(t)}function dD(e){return xE(this,void 0,void 0,(function(){var t,n,r,i,a,o,s;return SE(this,(function(c){switch(c.label){case 0:for((t=document.querySelector(`.introjs-hints`))===null&&(t=qE(`div`,{className:`introjs-hints`})),n=function(t){return function(n){var r=n||window.event;r&&r.stopPropagation&&r.stopPropagation(),r&&r.cancelBubble!==null&&(r.cancelBubble=!0),pD(e,t)}},r=0;r<e._hintItems.length;r++){if(i=e._hintItems[r],document.querySelector(`.introjs-hint[data-step="${r}"]`))return[2];FE(a=qE(`a`,{className:`introjs-hint`})),a.onclick=n(r),i.hintAnimation||AE(a,`introjs-hint-no-anim`),IE(i.element)&&AE(a,`introjs-fixedhint`),o=qE(`div`,{className:`introjs-hint-dot`}),s=qE(`div`,{className:`introjs-hint-pulse`}),a.appendChild(o),a.appendChild(s),a.setAttribute(`data-step`,r.toString()),i.hintTargetElement=i.element,i.element=a,fD(i.hintPosition,a,i.hintTargetElement),t.appendChild(a)}return document.body.appendChild(t),kE(e._hintsAddedCallback)?[4,e._hintsAddedCallback.call(e)]:[3,2];case 1:c.sent(),c.label=2;case 2:return e._options.hintAutoRefreshInterval>=0&&(e._hintsAutoRefreshFunction=(l=function(){return gD(e)},u=e._options.hintAutoRefreshInterval,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];window.clearTimeout(d),d=window.setTimeout((function(){l(e)}),u)}),OE.on(window,`scroll`,e._hintsAutoRefreshFunction,e,!0)),[2]}var l,u,d}))}))}function fD(e,t,n){if(n!==void 0){var r=LE(n),i=20,a=20;switch(e){default:case`top-left`:t.style.left=`${r.left}px`,t.style.top=`${r.top}px`;break;case`top-right`:t.style.left=`${r.left+r.width-i}px`,t.style.top=`${r.top}px`;break;case`bottom-left`:t.style.left=`${r.left}px`,t.style.top=`${r.top+r.height-a}px`;break;case`bottom-right`:t.style.left=`${r.left+r.width-i}px`,t.style.top=`${r.top+r.height-a}px`;break;case`middle-left`:t.style.left=`${r.left}px`,t.style.top=`${r.top+(r.height-a)/2}px`;break;case`middle-right`:t.style.left=`${r.left+r.width-i}px`,t.style.top=`${r.top+(r.height-a)/2}px`;break;case`middle-middle`:t.style.left=`${r.left+(r.width-i)/2}px`,t.style.top=`${r.top+(r.height-a)/2}px`;break;case`bottom-middle`:t.style.left=`${r.left+(r.width-i)/2}px`,t.style.top=`${r.top+r.height-a}px`;break;case`top-middle`:t.style.left=`${r.left+(r.width-i)/2}px`,t.style.top=`${r.top}px`}}}function pD(e,t){return xE(this,void 0,void 0,(function(){var n,r,i,a,o,s,c,l,u,d,f;return SE(this,(function(p){switch(p.label){case 0:return n=document.querySelector(`.introjs-hint[data-step="${t}"]`),r=e._hintItems[t],kE(e._hintClickCallback)?[4,e._hintClickCallback.call(e,n,r,t)]:[3,2];case 1:p.sent(),p.label=2;case 2:return(i=mD())!==void 0&&parseInt(i,10)===t||(a=qE(`div`,{className:`introjs-tooltip`}),o=qE(`div`),s=qE(`div`),c=qE(`div`),a.onclick=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},o.className=`introjs-tooltiptext`,(l=qE(`p`)).innerHTML=r.hint||``,o.appendChild(l),e._options.hintShowButton&&((u=qE(`a`)).className=e._options.buttonClass,u.setAttribute(`role`,`button`),u.innerHTML=e._options.hintButtonLabel,u.onclick=function(){return oD(e,t)},o.appendChild(u)),s.className=`introjs-arrow`,a.appendChild(s),a.appendChild(o),d=n.getAttribute(`data-step`)||``,e._currentStep=parseInt(d,10),f=e._hintItems[e._currentStep],c.className=`introjs-tooltipReferenceLayer introjs-hintReference`,c.setAttribute(`data-step`,d),BE(e,f,c),c.appendChild(a),document.body.appendChild(c),GE(e,f,a,s,!0)),[2]}}))}))}function mD(){var e=document.querySelector(`.introjs-hintReference`);if(e&&e.parentNode){var t=e.getAttribute(`data-step`);return t?(e.parentNode.removeChild(e),t):void 0}}function hD(e,t){return xE(this,void 0,void 0,(function(){var n,r,i,a,o,s,c,l,u,d;return SE(this,(function(f){switch(f.label){case 0:if(e._hintItems=[],e._options.hints&&e._options.hints.length>0)for(n=0,r=e._options.hints;n<r.length;n++)i=r[n],typeof(a=iD(i)).element==`string`&&(a.element=document.querySelector(a.element)),a.hintPosition=a.hintPosition||e._options.hintPosition,a.hintAnimation=a.hintAnimation||e._options.hintAnimation,a.element!==null&&e._hintItems.push(a);else{if(!(o=Array.from(t.querySelectorAll(`*[data-hint]`)))||!o.length)return[2,!1];for(s=0,c=o;s<c.length;s++)l=c[s],u=l.getAttribute(`data-hint-animation`),d=e._options.hintAnimation,u&&(d=u===`true`),e._hintItems.push({element:l,hint:l.getAttribute(`data-hint`)||``,hintPosition:l.getAttribute(`data-hint-position`)||e._options.hintPosition,hintAnimation:d,tooltipClass:l.getAttribute(`data-tooltip-class`)||void 0,position:l.getAttribute(`data-position`)||e._options.tooltipPosition})}return[4,dD(e)];case 1:return f.sent(),OE.on(document,`click`,mD,e,!1),OE.on(window,`resize`,gD,e,!0),[2,!0]}}))}))}function gD(e){for(var t=0,n=e._hintItems;t<n.length;t++){var r=n[t],i=r.hintTargetElement;fD(r.hintPosition,r.element,i)}}function _D(e,t){var n=Array.from(t.querySelectorAll(`*[data-intro]`)),r=[];if(e._options.steps&&e._options.steps.length)for(var i=0,a=e._options.steps;i<a.length;i++){var o=iD(f=a[i]);if(o.step=r.length+1,o.title=o.title||``,typeof o.element==`string`&&(o.element=document.querySelector(o.element)||void 0),o.element===void 0||o.element===null){var s=document.querySelector(`.introjsFloatingElement`);s===null&&(s=qE(`div`,{className:`introjsFloatingElement`}),document.body.appendChild(s)),o.element=s,o.position=`floating`}o.position=o.position||e._options.tooltipPosition,o.scrollTo=o.scrollTo||e._options.scrollTo,o.disableInteraction===void 0&&(o.disableInteraction=e._options.disableInteraction),o.element!==null&&r.push(o)}else{var c=void 0;if(n.length<1)return[];for(var l=0,u=n;l<u.length;l++){var d=u[l];if((!e._options.group||d.getAttribute(`data-intro-group`)===e._options.group)&&d.style.display!==`none`){var f=parseInt(d.getAttribute(`data-step`)||``,10);c=e._options.disableInteraction,d.hasAttribute(`data-disable-interaction`)&&(c=!!d.getAttribute(`data-disable-interaction`)),f>0&&(r[f-1]={step:f,element:d,title:d.getAttribute(`data-title`)||``,intro:d.getAttribute(`data-intro`)||``,tooltipClass:d.getAttribute(`data-tooltip-class`)||void 0,highlightClass:d.getAttribute(`data-highlight-class`)||void 0,position:d.getAttribute(`data-position`)||e._options.tooltipPosition,scrollTo:d.getAttribute(`data-scroll-to`)||e._options.scrollTo,disableInteraction:c})}}for(var p=0,m=0,h=n;m<h.length;m++)if(d=h[m],(!e._options.group||d.getAttribute(`data-intro-group`)===e._options.group)&&d.getAttribute(`data-step`)===null){for(;r[p]!==void 0;)p++;c=d.hasAttribute(`data-disable-interaction`)?!!d.getAttribute(`data-disable-interaction`):e._options.disableInteraction,r[p]={element:d,title:d.getAttribute(`data-title`)||``,intro:d.getAttribute(`data-intro`)||``,step:p+1,tooltipClass:d.getAttribute(`data-tooltip-class`)||void 0,highlightClass:d.getAttribute(`data-highlight-class`)||void 0,position:d.getAttribute(`data-position`)||e._options.tooltipPosition,scrollTo:d.getAttribute(`data-scroll-to`)||e._options.scrollTo,disableInteraction:c}}}for(var g=[],_=0;_<r.length;_++)r[_]&&g.push(r[_]);return(r=g).sort((function(e,t){return e.step-t.step})),r}function vD(e,t){var n=e._currentStep;if(n!=null&&n!=-1){var r=e._introItems[n],i=document.querySelector(`.introjs-tooltipReferenceLayer`),a=document.querySelector(`.introjs-helperLayer`),o=document.querySelector(`.introjs-disableInteraction`);BE(e,r,a),BE(e,r,i),BE(e,r,o),t&&(e._introItems=_D(e,e._targetElement),function(e,t){if(e._options.showBullets){var n=document.querySelector(`.introjs-bullets`);n&&n.parentNode&&n.parentNode.replaceChild(XE(e,t),n)}}(e,r),ZE(i,n,e._introItems.length));var s=document.querySelector(`.introjs-arrow`),c=document.querySelector(`.introjs-tooltip`);return c&&s&&GE(e,e._introItems[n],c,s),gD(e),e}}function yD(e){vD(e)}function bD(e,t){if(t===void 0&&(t=!1),e&&e.parentElement){var n=e.parentElement;t?(zE(e,{opacity:`0`}),window.setTimeout((function(){try{n.removeChild(e)}catch{}}),500)):n.removeChild(e)}}function xD(e,t,n){return n===void 0&&(n=!1),xE(this,void 0,void 0,(function(){var r,i,a,o;return SE(this,(function(s){switch(s.label){case 0:return r=!0,e._introBeforeExitCallback===void 0?[3,2]:[4,e._introBeforeExitCallback.call(e,t)];case 1:r=s.sent(),s.label=2;case 2:if(!n&&!1===r)return[2];if((i=Array.from(t.querySelectorAll(`.introjs-overlay`)))&&i.length)for(a=0,o=i;a<o.length;a++)bD(o[a]);return bD(t.querySelector(`.introjs-helperLayer`),!0),bD(t.querySelector(`.introjs-tooltipReferenceLayer`)),bD(t.querySelector(`.introjs-disableInteraction`)),bD(document.querySelector(`.introjsFloatingElement`)),KE(),OE.off(window,`keydown`,rD,e,!0),OE.off(window,`resize`,yD,e,!0),kE(e._introExitCallback)?[4,e._introExitCallback.call(e)]:[3,4];case 3:s.sent(),s.label=4;case 4:return e._currentStep=-1,[2]}}))}))}function SD(e,t){return xE(this,void 0,void 0,(function(){var n;return SE(this,(function(r){switch(r.label){case 0:return e.isActive()?kE(e._introStartCallback)?[4,e._introStartCallback.call(e,t)]:[3,2]:[2,!1];case 1:r.sent(),r.label=2;case 2:return(n=_D(e,t)).length===0?[2,!1]:(e._introItems=n,function(e,t){var n=this,r=qE(`div`,{className:`introjs-overlay`});zE(r,{top:0,bottom:0,left:0,right:0,position:`fixed`}),t.appendChild(r),!0===e._options.exitOnOverlayClick&&(zE(r,{cursor:`pointer`}),r.onclick=function(){return xE(n,void 0,void 0,(function(){return SE(this,(function(n){switch(n.label){case 0:return[4,xD(e,t)];case 1:return n.sent(),[2]}}))}))})}(e,t),[4,tD(e)]);case 3:r.sent(),t.addEventListener,e._options.keyboardNavigation&&OE.on(window,`keydown`,rD,e,!0),OE.on(window,`resize`,yD,e,!0),r.label=4;case 4:return[2,!1]}}))}))}function CD(e,t,n){return e[t]=n,e}var wD=function(){function e(e){this._currentStep=-1,this._introItems=[],this._hintItems=[],this._targetElement=e,this._options={steps:[],hints:[],isActive:!0,nextLabel:`Next`,prevLabel:`Back`,skipLabel:`×`,doneLabel:`Done`,hidePrev:!1,hideNext:!1,nextToDone:!0,tooltipPosition:`bottom`,tooltipClass:``,group:``,highlightClass:``,exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!1,stepNumbersOfLabel:`of`,keyboardNavigation:!0,showButtons:!0,showBullets:!0,showProgress:!1,scrollToElement:!0,scrollTo:`element`,scrollPadding:30,overlayOpacity:.5,autoPosition:!0,positionPrecedence:[`bottom`,`top`,`right`,`left`],disableInteraction:!1,dontShowAgain:!1,dontShowAgainLabel:`Don't show this again`,dontShowAgainCookie:`introjs-dontShowAgain`,dontShowAgainCookieDays:365,helperElementPadding:10,hintPosition:`top-middle`,hintButtonLabel:`Got it`,hintShowButton:!0,hintAutoRefreshInterval:10,hintAnimation:!0,buttonClass:`introjs-button`,progressBarAdditionalClass:!1}}return e.prototype.isActive=function(){return(!this._options.dontShowAgain||(e=wE(this._options.dontShowAgainCookie))===``||e!==`true`)&&this._options.isActive;var e},e.prototype.clone=function(){return new e(this._targetElement)},e.prototype.setOption=function(e,t){return this._options=CD(this._options,e,t),this},e.prototype.setOptions=function(e){return this._options=function(e,t){for(var n=0,r=Object.entries(t);n<r.length;n++){var i=r[n];e=CD(e,i[0],i[1])}return e}(this._options,e),this},e.prototype.start=function(){return xE(this,void 0,void 0,(function(){return SE(this,(function(e){switch(e.label){case 0:return[4,SD(this,this._targetElement)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.goToStep=function(e){return xE(this,void 0,void 0,(function(){return SE(this,(function(t){switch(t.label){case 0:return[4,$E(this,e)];case 1:return t.sent(),[2,this]}}))}))},e.prototype.addStep=function(e){return this._options.steps||(this._options.steps=[]),this._options.steps.push(e),this},e.prototype.addSteps=function(e){if(!e.length)return this;for(var t=0;t<e.length;t++)this.addStep(e[t]);return this},e.prototype.goToStepNumber=function(e){return xE(this,void 0,void 0,(function(){return SE(this,(function(t){switch(t.label){case 0:return[4,eD(this,e)];case 1:return t.sent(),[2,this]}}))}))},e.prototype.nextStep=function(){return xE(this,void 0,void 0,(function(){return SE(this,(function(e){switch(e.label){case 0:return[4,tD(this)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.previousStep=function(){return xE(this,void 0,void 0,(function(){return SE(this,(function(e){switch(e.label){case 0:return[4,nD(this)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.currentStep=function(){return this._currentStep},e.prototype.exit=function(e){return xE(this,void 0,void 0,(function(){return SE(this,(function(t){switch(t.label){case 0:return[4,xD(this,this._targetElement,e)];case 1:return t.sent(),[2,this]}}))}))},e.prototype.refresh=function(e){return vD(this,e),this},e.prototype.setDontShowAgain=function(e){return TE(this,e),this},e.prototype.onbeforechange=function(e){if(!kE(e))throw Error(`Provided callback for onbeforechange was not a function`);return this._introBeforeChangeCallback=e,this},e.prototype.onchange=function(e){if(!kE(e))throw Error(`Provided callback for onchange was not a function.`);return this._introChangeCallback=e,this},e.prototype.onafterchange=function(e){if(!kE(e))throw Error(`Provided callback for onafterchange was not a function`);return this._introAfterChangeCallback=e,this},e.prototype.oncomplete=function(e){if(!kE(e))throw Error(`Provided callback for oncomplete was not a function.`);return this._introCompleteCallback=e,this},e.prototype.onhintsadded=function(e){if(!kE(e))throw Error(`Provided callback for onhintsadded was not a function.`);return this._hintsAddedCallback=e,this},e.prototype.onhintclick=function(e){if(!kE(e))throw Error(`Provided callback for onhintclick was not a function.`);return this._hintClickCallback=e,this},e.prototype.onhintclose=function(e){if(!kE(e))throw Error(`Provided callback for onhintclose was not a function.`);return this._hintCloseCallback=e,this},e.prototype.onstart=function(e){if(!kE(e))throw Error(`Provided callback for onstart was not a function.`);return this._introStartCallback=e,this},e.prototype.onexit=function(e){if(!kE(e))throw Error(`Provided callback for onexit was not a function.`);return this._introExitCallback=e,this},e.prototype.onskip=function(e){if(!kE(e))throw Error(`Provided callback for onskip was not a function.`);return this._introSkipCallback=e,this},e.prototype.onbeforeexit=function(e){if(!kE(e))throw Error(`Provided callback for onbeforeexit was not a function.`);return this._introBeforeExitCallback=e,this},e.prototype.addHints=function(){return xE(this,void 0,void 0,(function(){return SE(this,(function(e){switch(e.label){case 0:return[4,hD(this,this._targetElement)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.hideHint=function(e){return xE(this,void 0,void 0,(function(){return SE(this,(function(t){switch(t.label){case 0:return[4,oD(this,e)];case 1:return t.sent(),[2,this]}}))}))},e.prototype.hideHints=function(){return xE(this,void 0,void 0,(function(){return SE(this,(function(e){switch(e.label){case 0:return[4,sD(this)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.showHint=function(e){return lD(e),this},e.prototype.showHints=function(){return xE(this,void 0,void 0,(function(){return SE(this,(function(e){switch(e.label){case 0:return[4,cD(this)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.removeHints=function(){return function(e){for(var t=0,n=aD(`.introjs-hint`);t<n.length;t++){var r=n[t].getAttribute(`data-step`);r&&uD(parseInt(r,10))}OE.off(document,`click`,mD,e,!1),OE.off(window,`resize`,gD,e,!0),e._hintsAutoRefreshFunction&&OE.off(window,`scroll`,e._hintsAutoRefreshFunction,e,!0)}(this),this},e.prototype.removeHint=function(e){return uD(e),this},e.prototype.showHintDialog=function(e){return xE(this,void 0,void 0,(function(){return SE(this,(function(t){switch(t.label){case 0:return[4,pD(this,e)];case 1:return t.sent(),[2,this]}}))}))},e}(),TD=function e(t){var n;if(bE(t)===`object`)n=new wD(t);else if(typeof t==`string`){var r=document.querySelector(t);if(!r)throw Error(`There is no element with given selector.`);n=new wD(r)}else n=new wD(document.body);return e.instances[DE(n,`introjs-instance`)]=n,n};TD.version=`7.2.0`,TD.instances={};var ED=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),DD=s(((e,t)=>{var n=ED();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),OD=s(((e,t)=>{t.exports=DD()()})),kD=s((e=>{var t=C();function n(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var r=Object.prototype.hasOwnProperty,i=/^[: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]*$/,a={},o={};function s(e){return r.call(o,e)?!0:r.call(a,e)?!1:i.test(e)?o[e]=!0:(a[e]=!0,!1)}function c(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var l={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){l[e]=new c(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];l[t]=new c(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){l[e]=new c(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){l[e]=new c(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){l[e]=new c(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){l[e]=new c(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){l[e]=new c(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){l[e]=new c(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){l[e]=new c(e,5,!1,e.toLowerCase(),null,!1,!1)});var u=/[\-:]([a-z])/g;function d(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(u,d);l[t]=new c(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(u,d);l[t]=new c(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(u,d);l[t]=new c(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){l[e]=new c(e,1,!1,e.toLowerCase(),null,!1,!1)}),l.xlinkHref=new c(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){l[e]=new c(e,1,!1,e.toLowerCase(),null,!0,!0)});var f={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},p=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(f).forEach(function(e){p.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),f[t]=f[e]})});var m=/["'&<>]/;function h(e){if(typeof e==`boolean`||typeof e==`number`)return``+e;e=``+e;var t=m.exec(e);if(t){var n=``,r,i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=`"`;break;case 38:t=`&`;break;case 39:t=`'`;break;case 60:t=`<`;break;case 62:t=`>`;break;default:continue}i!==r&&(n+=e.substring(i,r)),i=r+1,n+=t}e=i===r?n:n+e.substring(i,r)}return e}var g=/([A-Z])/g,_=/^ms-/,v=Array.isArray;function y(e,t){return{insertionMode:e,selectedValue:t}}function b(e,t,n){switch(t){case`select`:return y(1,n.value==null?n.defaultValue:n.value);case`svg`:return y(2,null);case`math`:return y(3,null);case`foreignObject`:return y(1,null);case`table`:return y(4,null);case`thead`:case`tbody`:case`tfoot`:return y(5,null);case`colgroup`:return y(7,null);case`tr`:return y(6,null)}return 4<=e.insertionMode||e.insertionMode===0?y(1,null):e}var x=new Map;function S(e,t,i){if(typeof i!=`object`)throw Error(n(62));for(var a in t=!0,i)if(r.call(i,a)){var o=i[a];if(o!=null&&typeof o!=`boolean`&&o!==``){if(a.indexOf(`--`)===0){var s=h(a);o=h((``+o).trim())}else{s=a;var c=x.get(s);c===void 0?(c=h(s.replace(g,`-$1`).toLowerCase().replace(_,`-ms-`)),x.set(s,c),s=c):s=c,o=typeof o==`number`?o===0||r.call(f,a)?``+o:o+`px`:h((``+o).trim())}t?(t=!1,e.push(` style="`,s,`:`,o)):e.push(`;`,s,`:`,o)}}t||e.push(`"`)}function w(e,t,n,r){switch(n){case`style`:S(e,t,r);return;case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:return}if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`){if(t=l.hasOwnProperty(n)?l[n]:null,t!==null){switch(typeof r){case`function`:case`symbol`:return;case`boolean`:if(!t.acceptsBooleans)return}switch(n=t.attributeName,t.type){case 3:r&&e.push(` `,n,`=""`);break;case 4:!0===r?e.push(` `,n,`=""`):!1!==r&&e.push(` `,n,`="`,h(r),`"`);break;case 5:isNaN(r)||e.push(` `,n,`="`,h(r),`"`);break;case 6:!isNaN(r)&&1<=r&&e.push(` `,n,`="`,h(r),`"`);break;default:t.sanitizeURL&&(r=``+r),e.push(` `,n,`="`,h(r),`"`)}}else if(s(n)){switch(typeof r){case`function`:case`symbol`:return;case`boolean`:if(t=n.toLowerCase().slice(0,5),t!==`data-`&&t!==`aria-`)return}e.push(` `,n,`="`,h(r),`"`)}}}function T(e,t,r){if(t!=null){if(r!=null)throw Error(n(60));if(typeof t!=`object`||!(`__html`in t))throw Error(n(61));t=t.__html,t!=null&&e.push(``+t)}}function E(e){var n=``;return t.Children.forEach(e,function(e){e!=null&&(n+=e)}),n}function D(e,t,n,i){e.push(ee(n));var a=n=null,o;for(o in t)if(r.call(t,o)){var s=t[o];if(s!=null)switch(o){case`children`:n=s;break;case`dangerouslySetInnerHTML`:a=s;break;default:w(e,i,o,s)}}return e.push(`>`),T(e,a,n),typeof n==`string`?(e.push(h(n)),null):n}var O=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,k=new Map;function ee(e){var t=k.get(e);if(t===void 0){if(!O.test(e))throw Error(n(65,e));t=`<`+e,k.set(e,t)}return t}function A(e,t,i,a,o){switch(t){case`select`:e.push(ee(`select`));var c=null,l=null;for(p in i)if(r.call(i,p)){var u=i[p];if(u!=null)switch(p){case`children`:c=u;break;case`dangerouslySetInnerHTML`:l=u;break;case`defaultValue`:case`value`:break;default:w(e,a,p,u)}}return e.push(`>`),T(e,l,c),c;case`option`:l=o.selectedValue,e.push(ee(`option`));var d=u=null,f=null,p=null;for(c in i)if(r.call(i,c)){var m=i[c];if(m!=null)switch(c){case`children`:u=m;break;case`selected`:f=m;break;case`dangerouslySetInnerHTML`:p=m;break;case`value`:d=m;default:w(e,a,c,m)}}if(l!=null)if(i=d===null?E(u):``+d,v(l)){for(a=0;a<l.length;a++)if(``+l[a]===i){e.push(` selected=""`);break}}else ``+l===i&&e.push(` selected=""`);else f&&e.push(` selected=""`);return e.push(`>`),T(e,p,u),u;case`textarea`:for(u in e.push(ee(`textarea`)),p=l=c=null,i)if(r.call(i,u)&&(d=i[u],d!=null))switch(u){case`children`:p=d;break;case`value`:c=d;break;case`defaultValue`:l=d;break;case`dangerouslySetInnerHTML`:throw Error(n(91));default:w(e,a,u,d)}if(c===null&&l!==null&&(c=l),e.push(`>`),p!=null){if(c!=null)throw Error(n(92));if(v(p)&&1<p.length)throw Error(n(93));c=``+p}return typeof c==`string`&&c[0]===`
- `&&e.push(`
- `),c!==null&&e.push(h(``+c)),null;case`input`:for(l in e.push(ee(`input`)),d=p=u=c=null,i)if(r.call(i,l)&&(f=i[l],f!=null))switch(l){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(399,`input`));case`defaultChecked`:d=f;break;case`defaultValue`:u=f;break;case`checked`:p=f;break;case`value`:c=f;break;default:w(e,a,l,f)}return p===null?d!==null&&w(e,a,`checked`,d):w(e,a,`checked`,p),c===null?u!==null&&w(e,a,`value`,u):w(e,a,`value`,c),e.push(`/>`),null;case`menuitem`:for(var g in e.push(ee(`menuitem`)),i)if(r.call(i,g)&&(c=i[g],c!=null))switch(g){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(400));default:w(e,a,g,c)}return e.push(`>`),null;case`title`:for(m in e.push(ee(`title`)),c=null,i)if(r.call(i,m)&&(l=i[m],l!=null))switch(m){case`children`:c=l;break;case`dangerouslySetInnerHTML`:throw Error(n(434));default:w(e,a,m,l)}return e.push(`>`),c;case`listing`:case`pre`:for(d in e.push(ee(t)),l=c=null,i)if(r.call(i,d)&&(u=i[d],u!=null))switch(d){case`children`:c=u;break;case`dangerouslySetInnerHTML`:l=u;break;default:w(e,a,d,u)}if(e.push(`>`),l!=null){if(c!=null)throw Error(n(60));if(typeof l!=`object`||!(`__html`in l))throw Error(n(61));i=l.__html,i!=null&&(typeof i==`string`&&0<i.length&&i[0]===`
- `?e.push(`
- `,i):e.push(``+i))}return typeof c==`string`&&c[0]===`
- `&&e.push(`
- `),c;case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:for(var _ in e.push(ee(t)),i)if(r.call(i,_)&&(c=i[_],c!=null))switch(_){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(399,t));default:w(e,a,_,c)}return e.push(`/>`),null;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 D(e,i,t,a);case`html`:return o.insertionMode===0&&e.push(`<!DOCTYPE html>`),D(e,i,t,a);default:if(t.indexOf(`-`)===-1&&typeof i.is!=`string`)return D(e,i,t,a);for(f in e.push(ee(t)),l=c=null,i)if(r.call(i,f)&&(u=i[f],u!=null))switch(f){case`children`:c=u;break;case`dangerouslySetInnerHTML`:l=u;break;case`style`:S(e,a,u);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:break;default:s(f)&&typeof u!=`function`&&typeof u!=`symbol`&&e.push(` `,f,`="`,h(u),`"`)}return e.push(`>`),T(e,l,c),c}}function te(e,t,r){if(e.push(`<!--$?--><template id="`),r===null)throw Error(n(395));return e.push(r),e.push(`"></template>`)}function ne(e,t,r,i){switch(r.insertionMode){case 0:case 1:return e.push(`<div hidden id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 2:return e.push(`<svg aria-hidden="true" style="display:none" id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 3:return e.push(`<math aria-hidden="true" style="display:none" id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 4:return e.push(`<table hidden id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 5:return e.push(`<table hidden><tbody id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 6:return e.push(`<table hidden><tr id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 7:return e.push(`<table hidden><colgroup id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);default:throw Error(n(397))}}function re(e,t){switch(t.insertionMode){case 0:case 1:return e.push(`</div>`);case 2:return e.push(`</svg>`);case 3:return e.push(`</math>`);case 4:return e.push(`</table>`);case 5:return e.push(`</tbody></table>`);case 6:return e.push(`</tr></table>`);case 7:return e.push(`</colgroup></table>`);default:throw Error(n(397))}}var ie=/[<\u2028\u2029]/g;function ae(e){return JSON.stringify(e).replace(ie,function(e){switch(e){case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}function oe(e,t){return t=t===void 0?``:t,{bootstrapChunks:[],startInlineScript:`<script>`,placeholderPrefix:t+`P:`,segmentPrefix:t+`S:`,boundaryPrefix:t+`B:`,idPrefix:t,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:e}}function se(e,t,n,r){return n.generateStaticMarkup?(e.push(h(t)),!1):(t===``?e=r:(r&&e.push(`<!-- -->`),e.push(h(t)),e=!0),e)}var ce=Object.assign,le=Symbol.for(`react.element`),ue=Symbol.for(`react.portal`),de=Symbol.for(`react.fragment`),fe=Symbol.for(`react.strict_mode`),pe=Symbol.for(`react.profiler`),me=Symbol.for(`react.provider`),he=Symbol.for(`react.context`),ge=Symbol.for(`react.forward_ref`),_e=Symbol.for(`react.suspense`),ve=Symbol.for(`react.suspense_list`),ye=Symbol.for(`react.memo`),be=Symbol.for(`react.lazy`),xe=Symbol.for(`react.scope`),Se=Symbol.for(`react.debug_trace_mode`),Ce=Symbol.for(`react.legacy_hidden`),we=Symbol.for(`react.default_value`),Te=Symbol.iterator;function Ee(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case de:return`Fragment`;case ue:return`Portal`;case pe:return`Profiler`;case fe:return`StrictMode`;case _e:return`Suspense`;case ve:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case he:return(e.displayName||`Context`)+`.Consumer`;case me:return(e._context.displayName||`Context`)+`.Provider`;case ge:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ye:return t=e.displayName||null,t===null?Ee(e.type)||`Memo`:t;case be:t=e._payload,e=e._init;try{return Ee(e(t))}catch{}}return null}var De={};function Oe(e,t){if(e=e.contextTypes,!e)return De;var n={},r;for(r in e)n[r]=t[r];return n}var ke=null;function Ae(e,t){if(e!==t){e.context._currentValue2=e.parentValue,e=e.parent;var r=t.parent;if(e===null){if(r!==null)throw Error(n(401))}else{if(r===null)throw Error(n(401));Ae(e,r)}t.context._currentValue2=t.value}}function je(e){e.context._currentValue2=e.parentValue,e=e.parent,e!==null&&je(e)}function Me(e){var t=e.parent;t!==null&&Me(t),e.context._currentValue2=e.value}function Ne(e,t){if(e.context._currentValue2=e.parentValue,e=e.parent,e===null)throw Error(n(402));e.depth===t.depth?Ae(e,t):Ne(e,t)}function Pe(e,t){var r=t.parent;if(r===null)throw Error(n(402));e.depth===r.depth?Ae(e,r):Pe(e,r),t.context._currentValue2=t.value}function Fe(e){var t=ke;t!==e&&(t===null?Me(e):e===null?je(t):t.depth===e.depth?Ae(t,e):t.depth>e.depth?Ne(t,e):Pe(t,e),ke=e)}var Ie={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function Le(e,t,n,r){var i=e.state===void 0?null:e.state;e.updater=Ie,e.props=n,e.state=i;var a={queue:[],replace:!1};e._reactInternals=a;var o=t.contextType;if(e.context=typeof o==`object`&&o?o._currentValue2:r,o=t.getDerivedStateFromProps,typeof o==`function`&&(o=o(n,i),i=o==null?i:ce({},i,o),e.state=i),typeof t.getDerivedStateFromProps!=`function`&&typeof e.getSnapshotBeforeUpdate!=`function`&&(typeof e.UNSAFE_componentWillMount==`function`||typeof e.componentWillMount==`function`))if(t=e.state,typeof e.componentWillMount==`function`&&e.componentWillMount(),typeof e.UNSAFE_componentWillMount==`function`&&e.UNSAFE_componentWillMount(),t!==e.state&&Ie.enqueueReplaceState(e,e.state,null),a.queue!==null&&0<a.queue.length)if(t=a.queue,o=a.replace,a.queue=null,a.replace=!1,o&&t.length===1)e.state=t[0];else{for(a=o?t[0]:e.state,i=!0,o=o?1:0;o<t.length;o++){var s=t[o];s=typeof s==`function`?s.call(e,a,n,r):s,s!=null&&(i?(i=!1,a=ce({},a,s)):ce(a,s))}e.state=a}else a.queue=null}var Re={id:1,overflow:``};function ze(e,t,n){var r=e.id;e=e.overflow;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;return a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,{id:1<<32-Be(t)+i|n<<i|r,overflow:a+e}}return{id:1<<a|n<<i|r,overflow:e}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}function We(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ge=typeof Object.is==`function`?Object.is:We,Ke=null,qe=null,Je=null,Ye=null,Xe=!1,Ze=!1,Qe=0,$e=null,et=0;function tt(){if(Ke===null)throw Error(n(321));return Ke}function nt(){if(0<et)throw Error(n(312));return{memoizedState:null,queue:null,next:null}}function rt(){return Ye===null?Je===null?(Xe=!1,Je=Ye=nt()):(Xe=!0,Ye=Je):Ye.next===null?(Xe=!1,Ye=Ye.next=nt()):(Xe=!0,Ye=Ye.next),Ye}function it(){qe=Ke=null,Ze=!1,Je=null,et=0,Ye=$e=null}function at(e,t){return typeof t==`function`?t(e):t}function ot(e,t,n){if(Ke=tt(),Ye=rt(),Xe){var r=Ye.queue;if(t=r.dispatch,$e!==null&&(n=$e.get(r),n!==void 0)){$e.delete(r),r=Ye.memoizedState;do r=e(r,n.action),n=n.next;while(n!==null);return Ye.memoizedState=r,[r,t]}return[Ye.memoizedState,t]}return e=e===at?typeof t==`function`?t():t:n===void 0?t:n(t),Ye.memoizedState=e,e=Ye.queue={last:null,dispatch:null},e=e.dispatch=ct.bind(null,Ke,e),[Ye.memoizedState,e]}function st(e,t){if(Ke=tt(),Ye=rt(),t=t===void 0?null:t,Ye!==null){var n=Ye.memoizedState;if(n!==null&&t!==null){var r=n[1];a:if(r===null)r=!1;else{for(var i=0;i<r.length&&i<t.length;i++)if(!Ge(t[i],r[i])){r=!1;break a}r=!0}if(r)return n[0]}}return e=e(),Ye.memoizedState=[e,t],e}function ct(e,t,r){if(25<=et)throw Error(n(301));if(e===Ke)if(Ze=!0,e={action:r,next:null},$e===null&&($e=new Map),r=$e.get(t),r===void 0)$e.set(t,e);else{for(t=r;t.next!==null;)t=t.next;t.next=e}}function lt(){throw Error(n(394))}function ut(){}var dt={readContext:function(e){return e._currentValue2},useContext:function(e){return tt(),e._currentValue2},useMemo:st,useReducer:ot,useRef:function(e){Ke=tt(),Ye=rt();var t=Ye.memoizedState;return t===null?(e={current:e},Ye.memoizedState=e):t},useState:function(e){return ot(at,e)},useInsertionEffect:ut,useLayoutEffect:function(){},useCallback:function(e,t){return st(function(){return e},t)},useImperativeHandle:ut,useEffect:ut,useDebugValue:ut,useDeferredValue:function(e){return tt(),e},useTransition:function(){return tt(),[!1,lt]},useId:function(){var e=qe.treeContext,t=e.overflow;e=e.id,e=(e&~(1<<32-Be(e)-1)).toString(32)+t;var r=ft;if(r===null)throw Error(n(404));return t=Qe++,e=`:`+r.idPrefix+`R`+e,0<t&&(e+=`H`+t.toString(32)),e+`:`},useMutableSource:function(e,t){return tt(),t(e._source)},useSyncExternalStore:function(e,t,r){if(r===void 0)throw Error(n(407));return r()}},ft=null,pt=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function mt(e){return console.error(e),null}function ht(){}function gt(e,t,n,r,i,a,o,s,c){var l=[],u=new Set;return t={destination:null,responseState:t,progressiveChunkSize:r===void 0?12800:r,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:u,pingedTasks:l,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:i===void 0?mt:i,onAllReady:a===void 0?ht:a,onShellReady:o===void 0?ht:o,onShellError:s===void 0?ht:s,onFatalError:c===void 0?ht:c},n=vt(t,0,null,n,!1,!1),n.parentFlushed=!0,e=_t(t,e,null,n,u,De,null,Re),l.push(e),t}function _t(e,t,n,r,i,a,o,s){e.allPendingTasks++,n===null?e.pendingRootTasks++:n.pendingTasks++;var c={node:t,ping:function(){var t=e.pingedTasks;t.push(c),t.length===1&&Mt(e)},blockedBoundary:n,blockedSegment:r,abortSet:i,legacyContext:a,context:o,treeContext:s};return i.add(c),c}function vt(e,t,n,r,i,a){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:r,boundary:n,lastPushedText:i,textEmbedded:a}}function yt(e,t){if(e=e.onError(t),e!=null&&typeof e!=`string`)throw Error(`onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "`+typeof e+`" instead`);return e}function bt(e,t){var n=e.onShellError;n(t),n=e.onFatalError,n(t),e.destination===null?(e.status=1,e.fatalError=t):(e.status=2,e.destination.destroy(t))}function xt(e,t,n,r,i){for(Ke={},qe=t,Qe=0,e=n(r,i);Ze;)Ze=!1,Qe=0,et+=1,Ye=null,e=n(r,i);return it(),e}function St(e,t,r,i){var a=r.render(),o=i.childContextTypes;if(o!=null){var s=t.legacyContext;if(typeof r.getChildContext!=`function`)i=s;else{for(var c in r=r.getChildContext(),r)if(!(c in o))throw Error(n(108,Ee(i)||`Unknown`,c));i=ce({},s,r)}t.legacyContext=i,Tt(e,t,a),t.legacyContext=s}else Tt(e,t,a)}function Ct(e,t){if(e&&e.defaultProps){for(var n in t=ce({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function wt(e,t,r,i,a){if(typeof r==`function`)if(r.prototype&&r.prototype.isReactComponent){a=Oe(r,t.legacyContext);var o=r.contextType;o=new r(i,typeof o==`object`&&o?o._currentValue2:a),Le(o,r,i,a),St(e,t,o,r)}else{o=Oe(r,t.legacyContext),a=xt(e,t,r,i,o);var s=Qe!==0;if(typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0)Le(a,r,i,o),St(e,t,a,r);else if(s){i=t.treeContext,t.treeContext=ze(i,1,0);try{Tt(e,t,a)}finally{t.treeContext=i}}else Tt(e,t,a)}else if(typeof r==`string`){switch(a=t.blockedSegment,o=A(a.chunks,r,i,e.responseState,a.formatContext),a.lastPushedText=!1,s=a.formatContext,a.formatContext=b(s,r,i),Dt(e,t,o),a.formatContext=s,r){case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`input`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:break;default:a.chunks.push(`</`,r,`>`)}a.lastPushedText=!1}else{switch(r){case Ce:case Se:case fe:case pe:case de:Tt(e,t,i.children);return;case ve:Tt(e,t,i.children);return;case xe:throw Error(n(343));case _e:a:{r=t.blockedBoundary,a=t.blockedSegment,o=i.fallback,i=i.children,s=new Set;var c={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:s,errorDigest:null},l=vt(e,a.chunks.length,c,a.formatContext,!1,!1);a.children.push(l),a.lastPushedText=!1;var u=vt(e,0,null,a.formatContext,!1,!1);u.parentFlushed=!0,t.blockedBoundary=c,t.blockedSegment=u;try{if(Dt(e,t,i),e.responseState.generateStaticMarkup||u.lastPushedText&&u.textEmbedded&&u.chunks.push(`<!-- -->`),u.status=1,At(c,u),c.pendingTasks===0)break a}catch(t){u.status=4,c.forceClientRender=!0,c.errorDigest=yt(e,t)}finally{t.blockedBoundary=r,t.blockedSegment=a}t=_t(e,o,r,l,s,t.legacyContext,t.context,t.treeContext),e.pingedTasks.push(t)}return}if(typeof r==`object`&&r)switch(r.$$typeof){case ge:if(i=xt(e,t,r.render,i,a),Qe!==0){r=t.treeContext,t.treeContext=ze(r,1,0);try{Tt(e,t,i)}finally{t.treeContext=r}}else Tt(e,t,i);return;case ye:r=r.type,i=Ct(r,i),wt(e,t,r,i,a);return;case me:if(a=i.children,r=r._context,i=i.value,o=r._currentValue2,r._currentValue2=i,s=ke,ke=i={parent:s,depth:s===null?0:s.depth+1,context:r,parentValue:o,value:i},t.context=i,Tt(e,t,a),e=ke,e===null)throw Error(n(403));i=e.parentValue,e.context._currentValue2=i===we?e.context._defaultValue:i,e=ke=e.parent,t.context=e;return;case he:i=i.children,i=i(r._currentValue2),Tt(e,t,i);return;case be:a=r._init,r=a(r._payload),i=Ct(r,i),wt(e,t,r,i,void 0);return}throw Error(n(130,r==null?r:typeof r,``))}}function Tt(e,t,r){if(t.node=r,typeof r==`object`&&r){switch(r.$$typeof){case le:wt(e,t,r.type,r.props,r.ref);return;case ue:throw Error(n(257));case be:var i=r._init;r=i(r._payload),Tt(e,t,r);return}if(v(r)){Et(e,t,r);return}if(typeof r!=`object`||!r?i=null:(i=Te&&r[Te]||r[`@@iterator`],i=typeof i==`function`?i:null),i&&=i.call(r)){if(r=i.next(),!r.done){var a=[];do a.push(r.value),r=i.next();while(!r.done);Et(e,t,a)}return}throw e=Object.prototype.toString.call(r),Error(n(31,e===`[object Object]`?`object with keys {`+Object.keys(r).join(`, `)+`}`:e))}typeof r==`string`?(i=t.blockedSegment,i.lastPushedText=se(t.blockedSegment.chunks,r,e.responseState,i.lastPushedText)):typeof r==`number`&&(i=t.blockedSegment,i.lastPushedText=se(t.blockedSegment.chunks,``+r,e.responseState,i.lastPushedText))}function Et(e,t,n){for(var r=n.length,i=0;i<r;i++){var a=t.treeContext;t.treeContext=ze(a,r,i);try{Dt(e,t,n[i])}finally{t.treeContext=a}}}function Dt(e,t,n){var r=t.blockedSegment.formatContext,i=t.legacyContext,a=t.context;try{return Tt(e,t,n)}catch(c){if(it(),typeof c==`object`&&c&&typeof c.then==`function`){n=c;var o=t.blockedSegment,s=vt(e,o.chunks.length,null,o.formatContext,o.lastPushedText,!0);o.children.push(s),o.lastPushedText=!1,e=_t(e,t.node,t.blockedBoundary,s,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,n.then(e,e),t.blockedSegment.formatContext=r,t.legacyContext=i,t.context=a,Fe(a)}else throw t.blockedSegment.formatContext=r,t.legacyContext=i,t.context=a,Fe(a),c}}function Ot(e){var t=e.blockedBoundary;e=e.blockedSegment,e.status=3,jt(this,t,e)}function kt(e,t,r){var i=e.blockedBoundary;e.blockedSegment.status=3,i===null?(t.allPendingTasks--,t.status!==2&&(t.status=2,t.destination!==null&&t.destination.push(null))):(i.pendingTasks--,i.forceClientRender||(i.forceClientRender=!0,e=r===void 0?Error(n(432)):r,i.errorDigest=t.onError(e),i.parentFlushed&&t.clientRenderedBoundaries.push(i)),i.fallbackAbortableTasks.forEach(function(e){return kt(e,t,r)}),i.fallbackAbortableTasks.clear(),t.allPendingTasks--,t.allPendingTasks===0&&(i=t.onAllReady,i()))}function At(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,n.status===1&&At(e,n)}else e.completedSegments.push(t)}function jt(e,t,r){if(t===null){if(r.parentFlushed){if(e.completedRootSegment!==null)throw Error(n(389));e.completedRootSegment=r}e.pendingRootTasks--,e.pendingRootTasks===0&&(e.onShellError=ht,t=e.onShellReady,t())}else t.pendingTasks--,t.forceClientRender||(t.pendingTasks===0?(r.parentFlushed&&r.status===1&&At(t,r),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(Ot,e),t.fallbackAbortableTasks.clear()):r.parentFlushed&&r.status===1&&(At(t,r),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,e.allPendingTasks===0&&(e=e.onAllReady,e())}function Mt(e){if(e.status!==2){var t=ke,n=pt.current;pt.current=dt;var r=ft;ft=e.responseState;try{var i=e.pingedTasks,a;for(a=0;a<i.length;a++){var o=i[a],s=e,c=o.blockedSegment;if(c.status===0){Fe(o.context);try{Tt(s,o,o.node),s.responseState.generateStaticMarkup||c.lastPushedText&&c.textEmbedded&&c.chunks.push(`<!-- -->`),o.abortSet.delete(o),c.status=1,jt(s,o.blockedBoundary,c)}catch(e){if(it(),typeof e==`object`&&e&&typeof e.then==`function`){var l=o.ping;e.then(l,l)}else{o.abortSet.delete(o),c.status=4;var u=o.blockedBoundary,d=e,f=yt(s,d);if(u===null?bt(s,d):(u.pendingTasks--,u.forceClientRender||(u.forceClientRender=!0,u.errorDigest=f,u.parentFlushed&&s.clientRenderedBoundaries.push(u))),s.allPendingTasks--,s.allPendingTasks===0){var p=s.onAllReady;p()}}}}}i.splice(0,a),e.destination!==null&&Rt(e,e.destination)}catch(t){yt(e,t),bt(e,t)}finally{ft=r,pt.current=n,n===dt&&Fe(t)}}}function Nt(e,t,r){switch(r.parentFlushed=!0,r.status){case 0:var i=r.id=e.nextSegmentId++;return r.lastPushedText=!1,r.textEmbedded=!1,e=e.responseState,t.push(`<template id="`),t.push(e.placeholderPrefix),e=i.toString(16),t.push(e),t.push(`"></template>`);case 1:r.status=2;var a=!0;i=r.chunks;var o=0;r=r.children;for(var s=0;s<r.length;s++){for(a=r[s];o<a.index;o++)t.push(i[o]);a=Pt(e,t,a)}for(;o<i.length-1;o++)t.push(i[o]);return o<i.length&&(a=t.push(i[o])),a;default:throw Error(n(390))}}function Pt(e,t,r){var i=r.boundary;if(i===null)return Nt(e,t,r);if(i.parentFlushed=!0,i.forceClientRender)return e.responseState.generateStaticMarkup||(i=i.errorDigest,t.push(`<!--$!-->`),t.push(`<template`),i&&(t.push(` data-dgst="`),i=h(i),t.push(i),t.push(`"`)),t.push(`></template>`)),Nt(e,t,r),e=e.responseState.generateStaticMarkup?!0:t.push(`<!--/$-->`),e;if(0<i.pendingTasks){i.rootSegmentID=e.nextSegmentId++,0<i.completedSegments.length&&e.partialBoundaries.push(i);var a=e.responseState,o=a.nextSuspenseID++;return a=a.boundaryPrefix+o.toString(16),i=i.id=a,te(t,e.responseState,i),Nt(e,t,r),t.push(`<!--/$-->`)}if(i.byteSize>e.progressiveChunkSize)return i.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(i),te(t,e.responseState,i.id),Nt(e,t,r),t.push(`<!--/$-->`);if(e.responseState.generateStaticMarkup||t.push(`<!--$-->`),r=i.completedSegments,r.length!==1)throw Error(n(391));return Pt(e,t,r[0]),e=e.responseState.generateStaticMarkup?!0:t.push(`<!--/$-->`),e}function Ft(e,t,n){return ne(t,e.responseState,n.formatContext,n.id),Pt(e,t,n),re(t,n.formatContext)}function It(e,t,r){for(var i=r.completedSegments,a=0;a<i.length;a++)Lt(e,t,r,i[a]);if(i.length=0,e=e.responseState,i=r.id,r=r.rootSegmentID,t.push(e.startInlineScript),e.sentCompleteBoundaryFunction?t.push(`$RC("`):(e.sentCompleteBoundaryFunction=!0,t.push(`function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("`)),i===null)throw Error(n(395));return r=r.toString(16),t.push(i),t.push(`","`),t.push(e.segmentPrefix),t.push(r),t.push(`")<\/script>`)}function Lt(e,t,r,i){if(i.status===2)return!0;var a=i.id;if(a===-1){if((i.id=r.rootSegmentID)===-1)throw Error(n(392));return Ft(e,t,i)}return Ft(e,t,i),e=e.responseState,t.push(e.startInlineScript),e.sentCompleteSegmentFunction?t.push(`$RS("`):(e.sentCompleteSegmentFunction=!0,t.push(`function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("`)),t.push(e.segmentPrefix),a=a.toString(16),t.push(a),t.push(`","`),t.push(e.placeholderPrefix),t.push(a),t.push(`")<\/script>`)}function Rt(e,t){try{var r=e.completedRootSegment;if(r!==null&&e.pendingRootTasks===0){Pt(e,t,r),e.completedRootSegment=null;var i=e.responseState.bootstrapChunks;for(r=0;r<i.length-1;r++)t.push(i[r]);r<i.length&&t.push(i[r])}var a=e.clientRenderedBoundaries,o;for(o=0;o<a.length;o++){var s=a[o];i=t;var c=e.responseState,l=s.id,u=s.errorDigest,d=s.errorMessage,f=s.errorComponentStack;if(i.push(c.startInlineScript),c.sentClientRenderFunction?i.push(`$RX("`):(c.sentClientRenderFunction=!0,i.push(`function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("`)),l===null)throw Error(n(395));if(i.push(l),i.push(`"`),u||d||f){i.push(`,`);var p=ae(u||``);i.push(p)}if(d||f){i.push(`,`);var m=ae(d||``);i.push(m)}if(f){i.push(`,`);var h=ae(f);i.push(h)}if(!i.push(`)<\/script>`)){e.destination=null,o++,a.splice(0,o);return}}a.splice(0,o);var g=e.completedBoundaries;for(o=0;o<g.length;o++)if(!It(e,t,g[o])){e.destination=null,o++,g.splice(0,o);return}g.splice(0,o);var _=e.partialBoundaries;for(o=0;o<_.length;o++){var v=_[o];a:{a=e,s=t;var y=v.completedSegments;for(c=0;c<y.length;c++)if(!Lt(a,s,v,y[c])){c++,y.splice(0,c);var b=!1;break a}y.splice(0,c),b=!0}if(!b){e.destination=null,o++,_.splice(0,o);return}}_.splice(0,o);var x=e.completedBoundaries;for(o=0;o<x.length;o++)if(!It(e,t,x[o])){e.destination=null,o++,x.splice(0,o);return}x.splice(0,o)}finally{e.allPendingTasks===0&&e.pingedTasks.length===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0&&t.push(null)}}function zt(e,t){try{var n=e.abortableTasks;n.forEach(function(n){return kt(n,e,t)}),n.clear(),e.destination!==null&&Rt(e,e.destination)}catch(t){yt(e,t),bt(e,t)}}function Bt(){}function Vt(e,t,r,i){var a=!1,o=null,s=``,c={push:function(e){return e!==null&&(s+=e),!0},destroy:function(e){a=!0,o=e}},l=!1;if(e=gt(e,oe(r,t?t.identifierPrefix:void 0),{insertionMode:1,selectedValue:null},1/0,Bt,void 0,function(){l=!0},void 0,void 0),Mt(e),zt(e,i),e.status===1)e.status=2,c.destroy(e.fatalError);else if(e.status!==2&&e.destination===null){e.destination=c;try{Rt(e,c)}catch(t){yt(e,t),bt(e,t)}}if(a)throw o;if(!l)throw Error(n(426));return s}e.renderToNodeStream=function(){throw Error(n(207))},e.renderToStaticMarkup=function(e,t){return Vt(e,t,!0,`The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server`)},e.renderToStaticNodeStream=function(){throw Error(n(208))},e.renderToString=function(e,t){return Vt(e,t,!1,`The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server`)},e.version=`18.3.1`})),AD=s((e=>{var t=C();function n(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var r=null,i=0;function a(e,t){if(t.length!==0)if(512<t.length)0<i&&(e.enqueue(new Uint8Array(r.buffer,0,i)),r=new Uint8Array(512),i=0),e.enqueue(t);else{var n=r.length-i;n<t.length&&(n===0?e.enqueue(r):(r.set(t.subarray(0,n),i),e.enqueue(r),t=t.subarray(n)),r=new Uint8Array(512),i=0),r.set(t,i),i+=t.length}}function o(e,t){return a(e,t),!0}function s(e){r&&0<i&&(e.enqueue(new Uint8Array(r.buffer,0,i)),r=null,i=0)}var c=new TextEncoder;function l(e){return c.encode(e)}function u(e){return c.encode(e)}function d(e,t){typeof e.error==`function`?e.error(t):e.close()}var f=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={},h={};function g(e){return f.call(h,e)?!0:f.call(m,e)?!1:p.test(e)?h[e]=!0:(m[e]=!0,!1)}function _(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var v={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){v[e]=new _(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];v[t]=new _(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){v[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){v[e]=new _(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){v[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){v[e]=new _(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){v[e]=new _(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){v[e]=new _(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){v[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new _(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});var x={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},S=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(x).forEach(function(e){S.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),x[t]=x[e]})});var w=/["'&<>]/;function T(e){if(typeof e==`boolean`||typeof e==`number`)return``+e;e=``+e;var t=w.exec(e);if(t){var n=``,r,i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=`"`;break;case 38:t=`&`;break;case 39:t=`'`;break;case 60:t=`<`;break;case 62:t=`>`;break;default:continue}i!==r&&(n+=e.substring(i,r)),i=r+1,n+=t}e=i===r?n:n+e.substring(i,r)}return e}var E=/([A-Z])/g,D=/^ms-/,O=Array.isArray,k=u(`<script>`),ee=u(`<\/script>`),A=u(`<script src="`),te=u(`<script type="module" src="`),ne=u(`" async=""><\/script>`),re=/(<\/|<)(s)(cript)/gi;function ie(e,t,n,r){return``+t+(n===`s`?`\\u0073`:`\\u0053`)+r}function ae(e,t,n,r,i){e=e===void 0?``:e,t=t===void 0?k:u(`<script nonce="`+T(t)+`">`);var a=[];if(n!==void 0&&a.push(t,l((``+n).replace(re,ie)),ee),r!==void 0)for(n=0;n<r.length;n++)a.push(A,l(T(r[n])),ne);if(i!==void 0)for(r=0;r<i.length;r++)a.push(te,l(T(i[r])),ne);return{bootstrapChunks:a,startInlineScript:t,placeholderPrefix:u(e+`P:`),segmentPrefix:u(e+`S:`),boundaryPrefix:e+`B:`,idPrefix:e,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}function oe(e,t){return{insertionMode:e,selectedValue:t}}function se(e){return oe(e===`http://www.w3.org/2000/svg`?2:e===`http://www.w3.org/1998/Math/MathML`?3:0,null)}function ce(e,t,n){switch(t){case`select`:return oe(1,n.value==null?n.defaultValue:n.value);case`svg`:return oe(2,null);case`math`:return oe(3,null);case`foreignObject`:return oe(1,null);case`table`:return oe(4,null);case`thead`:case`tbody`:case`tfoot`:return oe(5,null);case`colgroup`:return oe(7,null);case`tr`:return oe(6,null)}return 4<=e.insertionMode||e.insertionMode===0?oe(1,null):e}var le=u(`<!-- -->`);function ue(e,t,n,r){return t===``?r:(r&&e.push(le),e.push(l(T(t))),!0)}var de=new Map,fe=u(` style="`),pe=u(`:`),me=u(`;`);function he(e,t,r){if(typeof r!=`object`)throw Error(n(62));for(var i in t=!0,r)if(f.call(r,i)){var a=r[i];if(a!=null&&typeof a!=`boolean`&&a!==``){if(i.indexOf(`--`)===0){var o=l(T(i));a=l(T((``+a).trim()))}else{o=i;var s=de.get(o);s===void 0?(s=u(T(o.replace(E,`-$1`).toLowerCase().replace(D,`-ms-`))),de.set(o,s),o=s):o=s,a=typeof a==`number`?a===0||f.call(x,i)?l(``+a):l(a+`px`):l(T((``+a).trim()))}t?(t=!1,e.push(fe,o,pe,a)):e.push(me,o,pe,a)}}t||e.push(ve)}var ge=u(` `),_e=u(`="`),ve=u(`"`),ye=u(`=""`);function be(e,t,n,r){switch(n){case`style`:he(e,t,r);return;case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:return}if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`){if(t=v.hasOwnProperty(n)?v[n]:null,t!==null){switch(typeof r){case`function`:case`symbol`:return;case`boolean`:if(!t.acceptsBooleans)return}switch(n=l(t.attributeName),t.type){case 3:r&&e.push(ge,n,ye);break;case 4:!0===r?e.push(ge,n,ye):!1!==r&&e.push(ge,n,_e,l(T(r)),ve);break;case 5:isNaN(r)||e.push(ge,n,_e,l(T(r)),ve);break;case 6:!isNaN(r)&&1<=r&&e.push(ge,n,_e,l(T(r)),ve);break;default:t.sanitizeURL&&(r=``+r),e.push(ge,n,_e,l(T(r)),ve)}}else if(g(n)){switch(typeof r){case`function`:case`symbol`:return;case`boolean`:if(t=n.toLowerCase().slice(0,5),t!==`data-`&&t!==`aria-`)return}e.push(ge,l(n),_e,l(T(r)),ve)}}}var xe=u(`>`),Se=u(`/>`);function Ce(e,t,r){if(t!=null){if(r!=null)throw Error(n(60));if(typeof t!=`object`||!(`__html`in t))throw Error(n(61));t=t.__html,t!=null&&e.push(l(``+t))}}function we(e){var n=``;return t.Children.forEach(e,function(e){e!=null&&(n+=e)}),n}var Te=u(` selected=""`);function Ee(e,t,n,r){e.push(Ae(n));var i=n=null,a;for(a in t)if(f.call(t,a)){var o=t[a];if(o!=null)switch(a){case`children`:n=o;break;case`dangerouslySetInnerHTML`:i=o;break;default:be(e,r,a,o)}}return e.push(xe),Ce(e,i,n),typeof n==`string`?(e.push(l(T(n))),null):n}var De=u(`
- `),Oe=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ke=new Map;function Ae(e){var t=ke.get(e);if(t===void 0){if(!Oe.test(e))throw Error(n(65,e));t=u(`<`+e),ke.set(e,t)}return t}var je=u(`<!DOCTYPE html>`);function Me(e,t,r,i,a){switch(t){case`select`:e.push(Ae(`select`));var o=null,s=null;for(p in r)if(f.call(r,p)){var c=r[p];if(c!=null)switch(p){case`children`:o=c;break;case`dangerouslySetInnerHTML`:s=c;break;case`defaultValue`:case`value`:break;default:be(e,i,p,c)}}return e.push(xe),Ce(e,s,o),o;case`option`:s=a.selectedValue,e.push(Ae(`option`));var u=c=null,d=null,p=null;for(o in r)if(f.call(r,o)){var m=r[o];if(m!=null)switch(o){case`children`:c=m;break;case`selected`:d=m;break;case`dangerouslySetInnerHTML`:p=m;break;case`value`:u=m;default:be(e,i,o,m)}}if(s!=null)if(r=u===null?we(c):``+u,O(s)){for(i=0;i<s.length;i++)if(``+s[i]===r){e.push(Te);break}}else ``+s===r&&e.push(Te);else d&&e.push(Te);return e.push(xe),Ce(e,p,c),c;case`textarea`:for(c in e.push(Ae(`textarea`)),p=s=o=null,r)if(f.call(r,c)&&(u=r[c],u!=null))switch(c){case`children`:p=u;break;case`value`:o=u;break;case`defaultValue`:s=u;break;case`dangerouslySetInnerHTML`:throw Error(n(91));default:be(e,i,c,u)}if(o===null&&s!==null&&(o=s),e.push(xe),p!=null){if(o!=null)throw Error(n(92));if(O(p)&&1<p.length)throw Error(n(93));o=``+p}return typeof o==`string`&&o[0]===`
- `&&e.push(De),o!==null&&e.push(l(T(``+o))),null;case`input`:for(s in e.push(Ae(`input`)),u=p=c=o=null,r)if(f.call(r,s)&&(d=r[s],d!=null))switch(s){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(399,`input`));case`defaultChecked`:u=d;break;case`defaultValue`:c=d;break;case`checked`:p=d;break;case`value`:o=d;break;default:be(e,i,s,d)}return p===null?u!==null&&be(e,i,`checked`,u):be(e,i,`checked`,p),o===null?c!==null&&be(e,i,`value`,c):be(e,i,`value`,o),e.push(Se),null;case`menuitem`:for(var h in e.push(Ae(`menuitem`)),r)if(f.call(r,h)&&(o=r[h],o!=null))switch(h){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(400));default:be(e,i,h,o)}return e.push(xe),null;case`title`:for(m in e.push(Ae(`title`)),o=null,r)if(f.call(r,m)&&(s=r[m],s!=null))switch(m){case`children`:o=s;break;case`dangerouslySetInnerHTML`:throw Error(n(434));default:be(e,i,m,s)}return e.push(xe),o;case`listing`:case`pre`:for(u in e.push(Ae(t)),s=o=null,r)if(f.call(r,u)&&(c=r[u],c!=null))switch(u){case`children`:o=c;break;case`dangerouslySetInnerHTML`:s=c;break;default:be(e,i,u,c)}if(e.push(xe),s!=null){if(o!=null)throw Error(n(60));if(typeof s!=`object`||!(`__html`in s))throw Error(n(61));r=s.__html,r!=null&&(typeof r==`string`&&0<r.length&&r[0]===`
- `?e.push(De,l(r)):e.push(l(``+r)))}return typeof o==`string`&&o[0]===`
- `&&e.push(De),o;case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:for(var _ in e.push(Ae(t)),r)if(f.call(r,_)&&(o=r[_],o!=null))switch(_){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(399,t));default:be(e,i,_,o)}return e.push(Se),null;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 Ee(e,r,t,i);case`html`:return a.insertionMode===0&&e.push(je),Ee(e,r,t,i);default:if(t.indexOf(`-`)===-1&&typeof r.is!=`string`)return Ee(e,r,t,i);for(d in e.push(Ae(t)),s=o=null,r)if(f.call(r,d)&&(c=r[d],c!=null))switch(d){case`children`:o=c;break;case`dangerouslySetInnerHTML`:s=c;break;case`style`:he(e,i,c);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:break;default:g(d)&&typeof c!=`function`&&typeof c!=`symbol`&&e.push(ge,l(d),_e,l(T(c)),ve)}return e.push(xe),Ce(e,s,o),o}}var Ne=u(`</`),Pe=u(`>`),Fe=u(`<template id="`),Ie=u(`"></template>`),Le=u(`<!--$-->`),Re=u(`<!--$?--><template id="`),ze=u(`"></template>`),Be=u(`<!--$!-->`),Ve=u(`<!--/$-->`),He=u(`<template`),Ue=u(`"`),We=u(` data-dgst="`);u(` data-msg="`),u(` data-stck="`);var Ge=u(`></template>`);function Ke(e,t,r){if(a(e,Re),r===null)throw Error(n(395));return a(e,r),o(e,ze)}var qe=u(`<div hidden id="`),Je=u(`">`),Ye=u(`</div>`),Xe=u(`<svg aria-hidden="true" style="display:none" id="`),Ze=u(`">`),Qe=u(`</svg>`),$e=u(`<math aria-hidden="true" style="display:none" id="`),et=u(`">`),tt=u(`</math>`),nt=u(`<table hidden id="`),rt=u(`">`),it=u(`</table>`),at=u(`<table hidden><tbody id="`),ot=u(`">`),st=u(`</tbody></table>`),ct=u(`<table hidden><tr id="`),lt=u(`">`),ut=u(`</tr></table>`),dt=u(`<table hidden><colgroup id="`),ft=u(`">`),pt=u(`</colgroup></table>`);function mt(e,t,r,i){switch(r.insertionMode){case 0:case 1:return a(e,qe),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,Je);case 2:return a(e,Xe),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,Ze);case 3:return a(e,$e),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,et);case 4:return a(e,nt),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,rt);case 5:return a(e,at),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,ot);case 6:return a(e,ct),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,lt);case 7:return a(e,dt),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,ft);default:throw Error(n(397))}}function ht(e,t){switch(t.insertionMode){case 0:case 1:return o(e,Ye);case 2:return o(e,Qe);case 3:return o(e,tt);case 4:return o(e,it);case 5:return o(e,st);case 6:return o(e,ut);case 7:return o(e,pt);default:throw Error(n(397))}}var gt=u(`function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("`),_t=u(`$RS("`),vt=u(`","`),yt=u(`")<\/script>`),bt=u(`function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("`),xt=u(`$RC("`),St=u(`","`),Ct=u(`")<\/script>`),wt=u(`function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("`),Tt=u(`$RX("`),Et=u(`"`),Dt=u(`)<\/script>`),Ot=u(`,`),kt=/[<\u2028\u2029]/g;function At(e){return JSON.stringify(e).replace(kt,function(e){switch(e){case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var jt=Object.assign,Mt=Symbol.for(`react.element`),Nt=Symbol.for(`react.portal`),Pt=Symbol.for(`react.fragment`),Ft=Symbol.for(`react.strict_mode`),It=Symbol.for(`react.profiler`),Lt=Symbol.for(`react.provider`),Rt=Symbol.for(`react.context`),zt=Symbol.for(`react.forward_ref`),Bt=Symbol.for(`react.suspense`),Vt=Symbol.for(`react.suspense_list`),Ht=Symbol.for(`react.memo`),Ut=Symbol.for(`react.lazy`),Wt=Symbol.for(`react.scope`),Gt=Symbol.for(`react.debug_trace_mode`),Kt=Symbol.for(`react.legacy_hidden`),qt=Symbol.for(`react.default_value`),Jt=Symbol.iterator;function Yt(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case Pt:return`Fragment`;case Nt:return`Portal`;case It:return`Profiler`;case Ft:return`StrictMode`;case Bt:return`Suspense`;case Vt:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case Rt:return(e.displayName||`Context`)+`.Consumer`;case Lt:return(e._context.displayName||`Context`)+`.Provider`;case zt:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case Ht:return t=e.displayName||null,t===null?Yt(e.type)||`Memo`:t;case Ut:t=e._payload,e=e._init;try{return Yt(e(t))}catch{}}return null}var Xt={};function Zt(e,t){if(e=e.contextTypes,!e)return Xt;var n={},r;for(r in e)n[r]=t[r];return n}var Qt=null;function $t(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var r=t.parent;if(e===null){if(r!==null)throw Error(n(401))}else{if(r===null)throw Error(n(401));$t(e,r)}t.context._currentValue=t.value}}function en(e){e.context._currentValue=e.parentValue,e=e.parent,e!==null&&en(e)}function tn(e){var t=e.parent;t!==null&&tn(t),e.context._currentValue=e.value}function nn(e,t){if(e.context._currentValue=e.parentValue,e=e.parent,e===null)throw Error(n(402));e.depth===t.depth?$t(e,t):nn(e,t)}function rn(e,t){var r=t.parent;if(r===null)throw Error(n(402));e.depth===r.depth?$t(e,r):rn(e,r),t.context._currentValue=t.value}function an(e){var t=Qt;t!==e&&(t===null?tn(e):e===null?en(t):t.depth===e.depth?$t(t,e):t.depth>e.depth?nn(t,e):rn(t,e),Qt=e)}var on={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function sn(e,t,n,r){var i=e.state===void 0?null:e.state;e.updater=on,e.props=n,e.state=i;var a={queue:[],replace:!1};e._reactInternals=a;var o=t.contextType;if(e.context=typeof o==`object`&&o?o._currentValue:r,o=t.getDerivedStateFromProps,typeof o==`function`&&(o=o(n,i),i=o==null?i:jt({},i,o),e.state=i),typeof t.getDerivedStateFromProps!=`function`&&typeof e.getSnapshotBeforeUpdate!=`function`&&(typeof e.UNSAFE_componentWillMount==`function`||typeof e.componentWillMount==`function`))if(t=e.state,typeof e.componentWillMount==`function`&&e.componentWillMount(),typeof e.UNSAFE_componentWillMount==`function`&&e.UNSAFE_componentWillMount(),t!==e.state&&on.enqueueReplaceState(e,e.state,null),a.queue!==null&&0<a.queue.length)if(t=a.queue,o=a.replace,a.queue=null,a.replace=!1,o&&t.length===1)e.state=t[0];else{for(a=o?t[0]:e.state,i=!0,o=o?1:0;o<t.length;o++){var s=t[o];s=typeof s==`function`?s.call(e,a,n,r):s,s!=null&&(i?(i=!1,a=jt({},a,s)):jt(a,s))}e.state=a}else a.queue=null}var cn={id:1,overflow:``};function ln(e,t,n){var r=e.id;e=e.overflow;var i=32-un(r)-1;r&=~(1<<i),n+=1;var a=32-un(t)+i;if(30<a){var o=i-i%5;return a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,{id:1<<32-un(t)+i|n<<i|r,overflow:a+e}}return{id:1<<a|n<<i|r,overflow:e}}var un=Math.clz32?Math.clz32:pn,dn=Math.log,fn=Math.LN2;function pn(e){return e>>>=0,e===0?32:31-(dn(e)/fn|0)|0}function mn(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var hn=typeof Object.is==`function`?Object.is:mn,gn=null,_n=null,vn=null,yn=null,bn=!1,xn=!1,Sn=0,Cn=null,wn=0;function Tn(){if(gn===null)throw Error(n(321));return gn}function En(){if(0<wn)throw Error(n(312));return{memoizedState:null,queue:null,next:null}}function Dn(){return yn===null?vn===null?(bn=!1,vn=yn=En()):(bn=!0,yn=vn):yn.next===null?(bn=!1,yn=yn.next=En()):(bn=!0,yn=yn.next),yn}function On(){_n=gn=null,xn=!1,vn=null,wn=0,yn=Cn=null}function kn(e,t){return typeof t==`function`?t(e):t}function An(e,t,n){if(gn=Tn(),yn=Dn(),bn){var r=yn.queue;if(t=r.dispatch,Cn!==null&&(n=Cn.get(r),n!==void 0)){Cn.delete(r),r=yn.memoizedState;do r=e(r,n.action),n=n.next;while(n!==null);return yn.memoizedState=r,[r,t]}return[yn.memoizedState,t]}return e=e===kn?typeof t==`function`?t():t:n===void 0?t:n(t),yn.memoizedState=e,e=yn.queue={last:null,dispatch:null},e=e.dispatch=Mn.bind(null,gn,e),[yn.memoizedState,e]}function jn(e,t){if(gn=Tn(),yn=Dn(),t=t===void 0?null:t,yn!==null){var n=yn.memoizedState;if(n!==null&&t!==null){var r=n[1];a:if(r===null)r=!1;else{for(var i=0;i<r.length&&i<t.length;i++)if(!hn(t[i],r[i])){r=!1;break a}r=!0}if(r)return n[0]}}return e=e(),yn.memoizedState=[e,t],e}function Mn(e,t,r){if(25<=wn)throw Error(n(301));if(e===gn)if(xn=!0,e={action:r,next:null},Cn===null&&(Cn=new Map),r=Cn.get(t),r===void 0)Cn.set(t,e);else{for(t=r;t.next!==null;)t=t.next;t.next=e}}function Nn(){throw Error(n(394))}function Pn(){}var Fn={readContext:function(e){return e._currentValue},useContext:function(e){return Tn(),e._currentValue},useMemo:jn,useReducer:An,useRef:function(e){gn=Tn(),yn=Dn();var t=yn.memoizedState;return t===null?(e={current:e},yn.memoizedState=e):t},useState:function(e){return An(kn,e)},useInsertionEffect:Pn,useLayoutEffect:function(){},useCallback:function(e,t){return jn(function(){return e},t)},useImperativeHandle:Pn,useEffect:Pn,useDebugValue:Pn,useDeferredValue:function(e){return Tn(),e},useTransition:function(){return Tn(),[!1,Nn]},useId:function(){var e=_n.treeContext,t=e.overflow;e=e.id,e=(e&~(1<<32-un(e)-1)).toString(32)+t;var r=In;if(r===null)throw Error(n(404));return t=Sn++,e=`:`+r.idPrefix+`R`+e,0<t&&(e+=`H`+t.toString(32)),e+`:`},useMutableSource:function(e,t){return Tn(),t(e._source)},useSyncExternalStore:function(e,t,r){if(r===void 0)throw Error(n(407));return r()}},In=null,Ln=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function Rn(e){return console.error(e),null}function zn(){}function Bn(e,t,n,r,i,a,o,s,c){var l=[],u=new Set;return t={destination:null,responseState:t,progressiveChunkSize:r===void 0?12800:r,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:u,pingedTasks:l,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:i===void 0?Rn:i,onAllReady:a===void 0?zn:a,onShellReady:o===void 0?zn:o,onShellError:s===void 0?zn:s,onFatalError:c===void 0?zn:c},n=Hn(t,0,null,n,!1,!1),n.parentFlushed=!0,e=Vn(t,e,null,n,u,Xt,null,cn),l.push(e),t}function Vn(e,t,n,r,i,a,o,s){e.allPendingTasks++,n===null?e.pendingRootTasks++:n.pendingTasks++;var c={node:t,ping:function(){var t=e.pingedTasks;t.push(c),t.length===1&&nr(e)},blockedBoundary:n,blockedSegment:r,abortSet:i,legacyContext:a,context:o,treeContext:s};return i.add(c),c}function Hn(e,t,n,r,i,a){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:r,boundary:n,lastPushedText:i,textEmbedded:a}}function Un(e,t){if(e=e.onError(t),e!=null&&typeof e!=`string`)throw Error(`onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "`+typeof e+`" instead`);return e}function Wn(e,t){var n=e.onShellError;n(t),n=e.onFatalError,n(t),e.destination===null?(e.status=1,e.fatalError=t):(e.status=2,d(e.destination,t))}function Gn(e,t,n,r,i){for(gn={},_n=t,Sn=0,e=n(r,i);xn;)xn=!1,Sn=0,wn+=1,yn=null,e=n(r,i);return On(),e}function Kn(e,t,r,i){var a=r.render(),o=i.childContextTypes;if(o!=null){var s=t.legacyContext;if(typeof r.getChildContext!=`function`)i=s;else{for(var c in r=r.getChildContext(),r)if(!(c in o))throw Error(n(108,Yt(i)||`Unknown`,c));i=jt({},s,r)}t.legacyContext=i,Yn(e,t,a),t.legacyContext=s}else Yn(e,t,a)}function qn(e,t){if(e&&e.defaultProps){for(var n in t=jt({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Jn(e,t,r,i,a){if(typeof r==`function`)if(r.prototype&&r.prototype.isReactComponent){a=Zt(r,t.legacyContext);var o=r.contextType;o=new r(i,typeof o==`object`&&o?o._currentValue:a),sn(o,r,i,a),Kn(e,t,o,r)}else{o=Zt(r,t.legacyContext),a=Gn(e,t,r,i,o);var s=Sn!==0;if(typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0)sn(a,r,i,o),Kn(e,t,a,r);else if(s){i=t.treeContext,t.treeContext=ln(i,1,0);try{Yn(e,t,a)}finally{t.treeContext=i}}else Yn(e,t,a)}else if(typeof r==`string`){switch(a=t.blockedSegment,o=Me(a.chunks,r,i,e.responseState,a.formatContext),a.lastPushedText=!1,s=a.formatContext,a.formatContext=ce(s,r,i),Zn(e,t,o),a.formatContext=s,r){case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`input`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:break;default:a.chunks.push(Ne,l(r),Pe)}a.lastPushedText=!1}else{switch(r){case Kt:case Gt:case Ft:case It:case Pt:Yn(e,t,i.children);return;case Vt:Yn(e,t,i.children);return;case Wt:throw Error(n(343));case Bt:a:{r=t.blockedBoundary,a=t.blockedSegment,o=i.fallback,i=i.children,s=new Set;var c={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:s,errorDigest:null},u=Hn(e,a.chunks.length,c,a.formatContext,!1,!1);a.children.push(u),a.lastPushedText=!1;var d=Hn(e,0,null,a.formatContext,!1,!1);d.parentFlushed=!0,t.blockedBoundary=c,t.blockedSegment=d;try{if(Zn(e,t,i),d.lastPushedText&&d.textEmbedded&&d.chunks.push(le),d.status=1,er(c,d),c.pendingTasks===0)break a}catch(t){d.status=4,c.forceClientRender=!0,c.errorDigest=Un(e,t)}finally{t.blockedBoundary=r,t.blockedSegment=a}t=Vn(e,o,r,u,s,t.legacyContext,t.context,t.treeContext),e.pingedTasks.push(t)}return}if(typeof r==`object`&&r)switch(r.$$typeof){case zt:if(i=Gn(e,t,r.render,i,a),Sn!==0){r=t.treeContext,t.treeContext=ln(r,1,0);try{Yn(e,t,i)}finally{t.treeContext=r}}else Yn(e,t,i);return;case Ht:r=r.type,i=qn(r,i),Jn(e,t,r,i,a);return;case Lt:if(a=i.children,r=r._context,i=i.value,o=r._currentValue,r._currentValue=i,s=Qt,Qt=i={parent:s,depth:s===null?0:s.depth+1,context:r,parentValue:o,value:i},t.context=i,Yn(e,t,a),e=Qt,e===null)throw Error(n(403));i=e.parentValue,e.context._currentValue=i===qt?e.context._defaultValue:i,e=Qt=e.parent,t.context=e;return;case Rt:i=i.children,i=i(r._currentValue),Yn(e,t,i);return;case Ut:a=r._init,r=a(r._payload),i=qn(r,i),Jn(e,t,r,i,void 0);return}throw Error(n(130,r==null?r:typeof r,``))}}function Yn(e,t,r){if(t.node=r,typeof r==`object`&&r){switch(r.$$typeof){case Mt:Jn(e,t,r.type,r.props,r.ref);return;case Nt:throw Error(n(257));case Ut:var i=r._init;r=i(r._payload),Yn(e,t,r);return}if(O(r)){Xn(e,t,r);return}if(typeof r!=`object`||!r?i=null:(i=Jt&&r[Jt]||r[`@@iterator`],i=typeof i==`function`?i:null),i&&=i.call(r)){if(r=i.next(),!r.done){var a=[];do a.push(r.value),r=i.next();while(!r.done);Xn(e,t,a)}return}throw e=Object.prototype.toString.call(r),Error(n(31,e===`[object Object]`?`object with keys {`+Object.keys(r).join(`, `)+`}`:e))}typeof r==`string`?(i=t.blockedSegment,i.lastPushedText=ue(t.blockedSegment.chunks,r,e.responseState,i.lastPushedText)):typeof r==`number`&&(i=t.blockedSegment,i.lastPushedText=ue(t.blockedSegment.chunks,``+r,e.responseState,i.lastPushedText))}function Xn(e,t,n){for(var r=n.length,i=0;i<r;i++){var a=t.treeContext;t.treeContext=ln(a,r,i);try{Zn(e,t,n[i])}finally{t.treeContext=a}}}function Zn(e,t,n){var r=t.blockedSegment.formatContext,i=t.legacyContext,a=t.context;try{return Yn(e,t,n)}catch(c){if(On(),typeof c==`object`&&c&&typeof c.then==`function`){n=c;var o=t.blockedSegment,s=Hn(e,o.chunks.length,null,o.formatContext,o.lastPushedText,!0);o.children.push(s),o.lastPushedText=!1,e=Vn(e,t.node,t.blockedBoundary,s,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,n.then(e,e),t.blockedSegment.formatContext=r,t.legacyContext=i,t.context=a,an(a)}else throw t.blockedSegment.formatContext=r,t.legacyContext=i,t.context=a,an(a),c}}function Qn(e){var t=e.blockedBoundary;e=e.blockedSegment,e.status=3,tr(this,t,e)}function $n(e,t,r){var i=e.blockedBoundary;e.blockedSegment.status=3,i===null?(t.allPendingTasks--,t.status!==2&&(t.status=2,t.destination!==null&&t.destination.close())):(i.pendingTasks--,i.forceClientRender||(i.forceClientRender=!0,e=r===void 0?Error(n(432)):r,i.errorDigest=t.onError(e),i.parentFlushed&&t.clientRenderedBoundaries.push(i)),i.fallbackAbortableTasks.forEach(function(e){return $n(e,t,r)}),i.fallbackAbortableTasks.clear(),t.allPendingTasks--,t.allPendingTasks===0&&(i=t.onAllReady,i()))}function er(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,n.status===1&&er(e,n)}else e.completedSegments.push(t)}function tr(e,t,r){if(t===null){if(r.parentFlushed){if(e.completedRootSegment!==null)throw Error(n(389));e.completedRootSegment=r}e.pendingRootTasks--,e.pendingRootTasks===0&&(e.onShellError=zn,t=e.onShellReady,t())}else t.pendingTasks--,t.forceClientRender||(t.pendingTasks===0?(r.parentFlushed&&r.status===1&&er(t,r),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(Qn,e),t.fallbackAbortableTasks.clear()):r.parentFlushed&&r.status===1&&(er(t,r),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,e.allPendingTasks===0&&(e=e.onAllReady,e())}function nr(e){if(e.status!==2){var t=Qt,n=Ln.current;Ln.current=Fn;var r=In;In=e.responseState;try{var i=e.pingedTasks,a;for(a=0;a<i.length;a++){var o=i[a],s=e,c=o.blockedSegment;if(c.status===0){an(o.context);try{Yn(s,o,o.node),c.lastPushedText&&c.textEmbedded&&c.chunks.push(le),o.abortSet.delete(o),c.status=1,tr(s,o.blockedBoundary,c)}catch(e){if(On(),typeof e==`object`&&e&&typeof e.then==`function`){var l=o.ping;e.then(l,l)}else{o.abortSet.delete(o),c.status=4;var u=o.blockedBoundary,d=e,f=Un(s,d);if(u===null?Wn(s,d):(u.pendingTasks--,u.forceClientRender||(u.forceClientRender=!0,u.errorDigest=f,u.parentFlushed&&s.clientRenderedBoundaries.push(u))),s.allPendingTasks--,s.allPendingTasks===0){var p=s.onAllReady;p()}}}}}i.splice(0,a),e.destination!==null&&cr(e,e.destination)}catch(t){Un(e,t),Wn(e,t)}finally{In=r,Ln.current=n,n===Fn&&an(t)}}}function rr(e,t,r){switch(r.parentFlushed=!0,r.status){case 0:var i=r.id=e.nextSegmentId++;return r.lastPushedText=!1,r.textEmbedded=!1,e=e.responseState,a(t,Fe),a(t,e.placeholderPrefix),e=l(i.toString(16)),a(t,e),o(t,Ie);case 1:r.status=2;var s=!0;i=r.chunks;var c=0;r=r.children;for(var u=0;u<r.length;u++){for(s=r[u];c<s.index;c++)a(t,i[c]);s=ir(e,t,s)}for(;c<i.length-1;c++)a(t,i[c]);return c<i.length&&(s=o(t,i[c])),s;default:throw Error(n(390))}}function ir(e,t,r){var i=r.boundary;if(i===null)return rr(e,t,r);if(i.parentFlushed=!0,i.forceClientRender)i=i.errorDigest,o(t,Be),a(t,He),i&&(a(t,We),a(t,l(T(i))),a(t,Ue)),o(t,Ge),rr(e,t,r);else if(0<i.pendingTasks){i.rootSegmentID=e.nextSegmentId++,0<i.completedSegments.length&&e.partialBoundaries.push(i);var s=e.responseState,c=s.nextSuspenseID++;s=u(s.boundaryPrefix+c.toString(16)),i=i.id=s,Ke(t,e.responseState,i),rr(e,t,r)}else if(i.byteSize>e.progressiveChunkSize)i.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(i),Ke(t,e.responseState,i.id),rr(e,t,r);else{if(o(t,Le),r=i.completedSegments,r.length!==1)throw Error(n(391));ir(e,t,r[0])}return o(t,Ve)}function ar(e,t,n){return mt(t,e.responseState,n.formatContext,n.id),ir(e,t,n),ht(t,n.formatContext)}function or(e,t,r){for(var i=r.completedSegments,s=0;s<i.length;s++)sr(e,t,r,i[s]);if(i.length=0,e=e.responseState,i=r.id,r=r.rootSegmentID,a(t,e.startInlineScript),e.sentCompleteBoundaryFunction?a(t,xt):(e.sentCompleteBoundaryFunction=!0,a(t,bt)),i===null)throw Error(n(395));return r=l(r.toString(16)),a(t,i),a(t,St),a(t,e.segmentPrefix),a(t,r),o(t,Ct)}function sr(e,t,r,i){if(i.status===2)return!0;var s=i.id;if(s===-1){if((i.id=r.rootSegmentID)===-1)throw Error(n(392));return ar(e,t,i)}return ar(e,t,i),e=e.responseState,a(t,e.startInlineScript),e.sentCompleteSegmentFunction?a(t,_t):(e.sentCompleteSegmentFunction=!0,a(t,gt)),a(t,e.segmentPrefix),s=l(s.toString(16)),a(t,s),a(t,vt),a(t,e.placeholderPrefix),a(t,s),o(t,yt)}function cr(e,t){r=new Uint8Array(512),i=0;try{var c=e.completedRootSegment;if(c!==null&&e.pendingRootTasks===0){ir(e,t,c),e.completedRootSegment=null;var u=e.responseState.bootstrapChunks;for(c=0;c<u.length-1;c++)a(t,u[c]);c<u.length&&o(t,u[c])}var d=e.clientRenderedBoundaries,f;for(f=0;f<d.length;f++){var p=d[f];u=t;var m=e.responseState,h=p.id,g=p.errorDigest,_=p.errorMessage,v=p.errorComponentStack;if(a(u,m.startInlineScript),m.sentClientRenderFunction?a(u,Tt):(m.sentClientRenderFunction=!0,a(u,wt)),h===null)throw Error(n(395));if(a(u,h),a(u,Et),(g||_||v)&&(a(u,Ot),a(u,l(At(g||``)))),(_||v)&&(a(u,Ot),a(u,l(At(_||``)))),v&&(a(u,Ot),a(u,l(At(v)))),!o(u,Dt)){e.destination=null,f++,d.splice(0,f);return}}d.splice(0,f);var y=e.completedBoundaries;for(f=0;f<y.length;f++)if(!or(e,t,y[f])){e.destination=null,f++,y.splice(0,f);return}y.splice(0,f),s(t),r=new Uint8Array(512),i=0;var b=e.partialBoundaries;for(f=0;f<b.length;f++){var x=b[f];a:{d=e,p=t;var S=x.completedSegments;for(m=0;m<S.length;m++)if(!sr(d,p,x,S[m])){m++,S.splice(0,m);var C=!1;break a}S.splice(0,m),C=!0}if(!C){e.destination=null,f++,b.splice(0,f);return}}b.splice(0,f);var w=e.completedBoundaries;for(f=0;f<w.length;f++)if(!or(e,t,w[f])){e.destination=null,f++,w.splice(0,f);return}w.splice(0,f)}finally{s(t),e.allPendingTasks===0&&e.pingedTasks.length===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0&&t.close()}}function lr(e,t){try{var n=e.abortableTasks;n.forEach(function(n){return $n(n,e,t)}),n.clear(),e.destination!==null&&cr(e,e.destination)}catch(t){Un(e,t),Wn(e,t)}}e.renderToReadableStream=function(e,t){return new Promise(function(n,r){var i,a,o=new Promise(function(e,t){a=e,i=t}),s=Bn(e,ae(t?t.identifierPrefix:void 0,t?t.nonce:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),se(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,a,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){if(s.status===1)s.status=2,d(e,s.fatalError);else if(s.status!==2&&s.destination===null){s.destination=e;try{cr(s,e)}catch(e){Un(s,e),Wn(s,e)}}},cancel:function(){lr(s)}},{highWaterMark:0});e.allReady=o,n(e)},function(e){o.catch(function(){}),r(e)},i);if(t&&t.signal){var c=t.signal,l=function(){lr(s,c.reason),c.removeEventListener(`abort`,l)};c.addEventListener(`abort`,l)}nr(s)})},e.version=`18.3.1`})),jD=s((e=>{var t=kD(),n=AD();e.version=t.version,e.renderToString=t.renderToString,e.renderToStaticMarkup=t.renderToStaticMarkup,e.renderToNodeStream=t.renderToNodeStream,e.renderToStaticNodeStream=t.renderToStaticNodeStream,e.renderToReadableStream=n.renderToReadableStream}))(),K=u(OD(),1),MD=K.default.oneOf([`top`,`right`,`bottom`,`left`,`bottom-left-aligned`,`bottom-middle-aligned`,`bottom-right-aligned`,`top-left-aligned`,`top-middle-aligned`,`top-right-aligned`,`auto`]),ND=K.default.oneOf([`top-middle`,`top-left`,`top-right`,`bottom-left`,`bottom-right`,`bottom-middle`,`middle-left`,`middle-right`,`middle-middle`]),PD=K.default.shape({nextLabel:K.default.string,prevLabel:K.default.string,skipLabel:K.default.string,doneLabel:K.default.string,hidePrev:K.default.bool,hideNext:K.default.bool,tooltipPosition:MD,tooltipClass:K.default.string,highlightClass:K.default.string,exitOnEsc:K.default.bool,exitOnOverlayClick:K.default.bool,showStepNumbers:K.default.bool,keyboardNavigation:K.default.bool,showButtons:K.default.bool,showBullets:K.default.bool,showProgress:K.default.bool,scrollToElement:K.default.bool,overlayOpacity:K.default.number,scrollPadding:K.default.number,positionPrecedence:K.default.arrayOf(K.default.string),disableInteraction:K.default.bool,hintPosition:ND,hintButtonLabel:K.default.string,hintAnimation:K.default.bool}),FD={hidePrev:!0,hideNext:!0};function ID(){return typeof window>`u`}var LD=class extends U.Component{static propTypes={enabled:K.default.bool,initialStep:K.default.number.isRequired,steps:K.default.arrayOf(K.default.shape({element:K.default.oneOfType([K.default.string,typeof Element>`u`?K.default.any:K.default.instanceOf(Element)]),intro:K.default.node.isRequired,position:MD,tooltipClass:K.default.string,highlightClass:K.default.string})).isRequired,onStart:K.default.func,onExit:K.default.func.isRequired,onBeforeExit:K.default.func,onBeforeChange:K.default.func,onAfterChange:K.default.func,onChange:K.default.func,onPreventChange:K.default.func,onComplete:K.default.func,options:PD};static defaultProps={enabled:!1,onStart:null,onBeforeExit:null,onBeforeChange:null,onAfterChange:null,onChange:null,onPreventChange:null,onComplete:null,options:FD};constructor(e){super(e),this.introJs=null,this.isConfigured=!1,this.isVisible=!1,this.installIntroJs()}componentDidMount(){this.props.enabled&&(this.configureIntroJs(),this.renderSteps())}componentDidUpdate(e){let{enabled:t,steps:n,options:r}=this.props;(!this.isConfigured||e.steps!==n||e.options!==r)&&(this.configureIntroJs(),this.renderSteps()),e.enabled!==t&&this.renderSteps()}componentWillUnmount(){this.introJs.exit()}onExit=()=>{let{onExit:e}=this.props;this.isVisible=!1,e(this.introJs._currentStep)};onBeforeExit=()=>{let{onBeforeExit:e}=this.props;return e?e(this.introJs._currentStep):!0};onBeforeChange=e=>{if(!this.isVisible)return!0;let{onBeforeChange:t,onPreventChange:n}=this.props;if(t){let r=t(this.introJs._currentStep,e);return r===!1&&n&&setTimeout(()=>{n(this.introJs._currentStep)},0),r}return!0};onAfterChange=e=>{if(!this.isVisible)return;let{onAfterChange:t}=this.props;t&&t(this.introJs._currentStep,e)};onChange=e=>{if(!this.isVisible)return;let{onChange:t}=this.props;t&&t(this.introJs._currentStep,e)};onComplete=()=>{let{onComplete:e}=this.props;e&&e()};updateStepElement=e=>{let t=document.querySelector(this.introJs._options.steps[e].element);t&&(this.introJs._introItems[e].element=t,this.introJs._introItems[e].position=this.introJs._options.steps[e].position||`auto`)};installIntroJs(){ID()||(this.introJs=TD(),this.introJs.onexit(this.onExit),this.introJs.onbeforeexit(this.onBeforeExit),this.introJs.onbeforechange(this.onBeforeChange),this.introJs.onafterchange(this.onAfterChange),this.introJs.onchange(this.onChange),this.introJs.oncomplete(this.onComplete))}configureIntroJs(){let{options:e,steps:t}=this.props,n=t.map(e=>(0,U.isValidElement)(e.intro)?{...e,intro:(0,jD.renderToStaticMarkup)(e.intro)}:e);this.introJs.setOptions({...e,steps:n}),this.isConfigured=!0}renderSteps(){let{enabled:e,initialStep:t,steps:n,onStart:r}=this.props;e&&n.length>0&&!this.isVisible?(this.introJs.start(),this.isVisible=!0,this.introJs.goToStepNumber(t+1),r&&r(this.introJs._currentStep)):!e&&this.isVisible&&(this.isVisible=!1,this.introJs.exit())}render(){return null}};(class extends U.Component{static propTypes={enabled:K.default.bool,hints:K.default.arrayOf(K.default.shape({element:K.default.string.isRequired,hint:K.default.string.isRequired,hintPosition:ND})).isRequired,onClick:K.default.func,onClose:K.default.func,options:PD};static defaultProps={enabled:!1,onClick:null,onClose:null,options:FD};constructor(e){super(e),this.introJs=null,this.isConfigured=!1,this.installIntroJs()}componentDidMount(){this.props.enabled&&(this.configureIntroJs(),this.renderHints())}componentDidUpdate(e){let{enabled:t,hints:n,options:r}=this.props;(!this.isConfigured||e.hints!==n||e.options!==r)&&(this.configureIntroJs(),this.renderHints()),e.enabled!==t&&this.renderHints()}componentWillUnmount(){this.introJs.hideHints()}installIntroJs(){if(ID())return;this.introJs=TD();let{onClick:e,onClose:t}=this.props;e&&this.introJs.onhintclick(e),t&&this.introJs.onhintclose(t)}configureIntroJs(){let{options:e,hints:t}=this.props;this.introJs.removeHints(),this.introJs.setOptions({...e,hints:t}),this.isConfigured=!0}renderHints(){let{enabled:e,hints:t}=this.props;e&&t.length>0?this.introJs.showHints():e||this.introJs.hideHints()}render(){return null}}),M();var RD=[{element:`.left-sidebar`,intro:j(`This is Thino's sidebar. Navigate to different path or select query filter.`)},{element:`.user-banner-container`,intro:j(`Click here and go to settings page.`)},{element:`.path-entry-wrapper`,intro:j(`Click here and go to different path.`)},{element:`.queries-wrapper`,intro:j(`Select or create query filter here.`)},{element:`.status-text-container.sidebar`,intro:j(`See the status of Thinos here.`)+j(`It is not available on small view`)},{element:`.heatmap-default`,intro:j(`See your time status of thinos here.`)},{element:`.tags-wrapper`,intro:j(`See your tags here. Tags will be shown when thino contains tags.`)},{element:`.section-header-container.memos-header-container`,intro:j(`Search your thino quickly here.`)},{element:`.memo-editor-wrapper`,intro:j(`Edit or create your thino here.`)},{element:`.memolist-wrapper`,intro:j(`See your thinos here.`)}],zD=[{element:`.memos-sidebar-wrapper.left-sidebar`,intro:j(`This is Thino's sidebar. Navigate to different path or select query filter.`)},{element:`.user-banner-container`,intro:j(`Click here and go to settings page.`)},{element:`.heatmap-default`,intro:j(`See your time status of thinos here.`)},{element:`.path-entry-wrapper`,intro:j(`Click here and go to different path.`)},{element:`.queries-wrapper`,intro:j(`Select or create query filter here.`)},{element:`.tags-wrapper`,intro:j(`See your tags here. Tags will be shown when thino contains tags.`)},{element:`.section-header-container.memos-header-container`,intro:j(`Search your thino quickly here.`)},{element:`.memo-editor-wrapper`,intro:j(`Edit or create your thino here.`)},{element:`.memolist-wrapper`,intro:j(`See your thinos here.`)}],BD={nextLabel:j(`Next`),prevLabel:j(`Previous`),doneLabel:j(`Done`),hideNext:!1};H(),zv(),I();var VD=(e,t)=>{(0,U.useEffect)(()=>{if(!e.needVerify){R.setLocked(!1);return}R.setLocked(!0)},[e?.needVerify]),(0,U.useEffect)(()=>{(async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():e?.identifier||e?.uuid;!t||t?.appId!==n?document.body.toggleClass(`hide-pro`,!0):document.body.toggleClass(`hide-pro`,!1)})()},[t])},HD=({settings:e,exited:t,isMobileView:n})=>{let r=(0,U.useRef)(null);return(0,W.jsx)(LD,{ref:r,enabled:t,steps:e?.DefaultThemeForThino===`modern`?RD:zD,initialStep:0,onExit:()=>{R.setExitSteps(!1)},options:BD,onBeforeChange:t=>{n&&(e?.DefaultThemeForThino===`classic`&&t===6||e?.DefaultThemeForThino===`modern`&&t===7)&&R.setShowSiderbarInMobileView(!1)}})},UD=({settings:e,pathname:t,isMobileView:n,isPhoneView:r,memoListView:i,sectionRef:a})=>{let o=e?.DefaultThemeForThino,s=o===`modern`,c=o===`focus`,l=`memos-${t===`/`?i:`list`}-view`,u=c?x_(`focus`,r&&`focus-mobile`):!s||n?`classic`:`modern`;return(0,W.jsxs)(`section`,{ref:a,id:`page-wrapper`,"data-path":t,className:x_(l,u),children:[(0,W.jsx)(pE,{sidebarPosition:`left`,className:`left-sidebar`}),(0,W.jsx)(`main`,{className:`content-wrapper`,children:gW(t)}),s&&!n&&(0,W.jsx)(pE,{sidebarPosition:`right`,className:`right-sidebar`})]})};function WD(){let{settings:e,verifyState:t}=F(),{pathname:n}=Si(),{isMobileView:r,isPhoneView:i,memoListView:a,globalEditorShown:o,locked:s,exited:c,loaded:l,immersiveMode:u}=vi(),d=(0,U.useRef)(null),f=e?.FirstLoaded||app.plugins.getPlugin(`obsidian-memos`).settings?.FirstLoaded;return VD(e,t),(0,U.useEffect)(()=>{if(e?.DefaultThemeForThino!==`focus`){document.body.classList.remove(`thino-focus-immersive`);return}return document.body.classList.toggle(`thino-focus-immersive`,!!u),()=>{document.body.classList.remove(`thino-focus-immersive`)}},[u,e?.DefaultThemeForThino]),(0,U.useEffect)(()=>{if(e?.DefaultThemeForThino!==`focus`||i)return;let t=e=>{if(e.defaultPrevented)return;let t=e.target,n=t?.tagName?.toLowerCase(),r=n===`input`||n===`textarea`||t?.isContentEditable;if(e.key===`Escape`){R.getState().immersiveMode&&(R.setImmersiveMode(!1),e.preventDefault());return}(e.key===`f`||e.key===`F`)&&!r&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(R.toggleImmersiveMode(),e.preventDefault())};return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[e?.DefaultThemeForThino,i]),f?(0,W.jsx)(yE,{}):!l&&!s&&!o?(0,W.jsxs)(`section`,{className:`memos-list-view`,children:[(0,W.jsx)(pE,{sidebarPosition:`left`,className:`left-sidebar`}),(0,W.jsx)(`main`,{className:`content-wrapper`,children:(0,W.jsx)(mE,{rows:5})})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(HD,{settings:e,exited:c,isMobileView:r}),s&&(0,W.jsx)(hE,{}),!s&&o&&(0,W.jsx)(W.Fragment,{children:e?.DefaultThemeForThino===`focus`&&i?(0,W.jsxs)(`div`,{className:`thino-focus-mobile-fullscreen focus focus-mobile`,children:[(0,W.jsx)(gE,{}),(0,W.jsx)(_E,{}),(0,W.jsx)(Aw,{editorType:`block`})]}):(0,W.jsx)(Aw,{editorType:`block`})}),!s&&!o&&(0,W.jsx)(UD,{settings:e,pathname:n,isMobileView:r,isPhoneView:i,memoListView:a,sectionRef:d})]})}var GD={"*":(0,W.jsx)(WD,{})};H(),M(),I();var KD=()=>{},qD=(0,U.memo)(({memo:e,index:t})=>{let n=t<50,[r,i]=(0,U.useState)(n),a=(0,U.useRef)(),o=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(!(n||r)&&o.current)return a.current=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&i(!0)})},{root:document.querySelector(`.memolist-wrapper`),rootMargin:`300px`,threshold:0}),a.current.observe(o.current),()=>{a.current?.disconnect()}},[n,r]),n?(0,W.jsx)(gT,{memo:e}):(0,W.jsx)(`div`,{ref:o,className:`lazy-memo-container`,children:r?(0,W.jsx)(gT,{memo:e}):(0,W.jsx)(`div`,{className:`memo-skeleton`,style:{minHeight:`80px`}})})},(e,t)=>e.memo.id===t.memo.id&&e.memo.updatedAt===t.memo.updatedAt&&e.memo.content===t.memo.content);qD.displayName=`LazyMemo`;var JD=({dayMark:e,isCollapsed:t,onToggle:n,onJumpToRange:r})=>{let i=(0,U.useRef)(null);(0,U.useEffect)(()=>{!i.current||!f.setTooltip||(0,f.setTooltip)(i.current,j(`Click to expand or fold, Cmd+Click to show all thinos of the day`))},[e]);let a=(0,U.useCallback)(e=>{if(f.Keymap.isModifier(e.nativeEvent,`Mod`)){e.preventDefault(),r&&r();return}n()},[r,n]);return(0,W.jsx)(`div`,{ref:i,className:x_(`day-mark`,e===`PINNED`&&`PINNED`,t&&`folded`),onClick:a,children:(0,W.jsx)(`span`,{className:`day-mark-text`,children:`${t?`▸`:`▾`} ${e===`PINNED`?`${e} 📌`:e}`})})},YD=(0,U.memo)(({item:e,index:t})=>e.type===`daymark`?(0,W.jsx)(JD,{dayMark:e.dayMark??``,isCollapsed:!!e.collapsed,onToggle:e.toggleCollapse??KD,onJumpToRange:e.jumpToRange}):(0,W.jsx)(qD,{memo:e.memo,index:t}));YD.displayName=`ItemRenderer`;var XD=({memos:e,listView:t,className:n=``,showDayMark:r=!1,dayMarkRange:i=`day`,sortConfig:a})=>{let o=F(e=>e.settings?.hidePinnedGroup??!1),s=vi(e=>e.collapsedGroups),c=vi(e=>e.toggleCollapsedGroup),l=vi(e=>e.setCollapsedGroup),u=(0,U.useMemo)(()=>new Set(s),[s]);(0,U.useEffect)(()=>{o&&!u.has(`PINNED`)?l(`PINNED`,!0):!o&&u.has(`PINNED`)&&l(`PINNED`,!1)},[o]);let d=(0,U.useCallback)(e=>{e&&c(e)},[c]),p=(0,U.useCallback)(e=>{if(!i||e===`PINNED`)return;let t={day:`YYYY-MM-DD`,week:`YYYY-[W]WW`,month:`YYYY-MM`,quarter:`YYYY-[Q]Q`,year:`YYYY`}[i],n=(0,f.moment)(e,t);n.isValid()&&z.setFromAndToQuery(n.startOf(i).valueOf(),n.endOf(i).valueOf())},[i]),m=e.length>100,h=(0,U.useDeferredValue)(e),g=m?h:e,{displayedItems:_,hasMore:v,loadingMore:y,sentinelRef:b}=sx({allItems:(0,U.useMemo)(()=>{let e=[];if(r&&i){let t=tH(g,i);Object.keys(t).sort((e,t)=>e===`PINNED`?-1:t===`PINNED`?1:a?.sortOrder===`desc`?t.localeCompare(e):e.localeCompare(t)).forEach(n=>{let r=u.has(n);e.push({type:`daymark`,dayMark:n,id:`dm-${n}`,collapsed:r,toggleCollapse:()=>d(n),jumpToRange:()=>p(n)}),!r&&(t[n]||[]).forEach(t=>{e.push({type:`memo`,memo:t,id:t.id})})})}else g.forEach(t=>{e.push({type:`memo`,memo:t,id:t.id})});return e},[g,r,i,a?.sortOrder,u,d,p]),initialCount:50,loadMoreCount:50,enabled:!0});return(0,W.jsxs)(`div`,{className:x_(`simple-list`,n),children:[_.map((e,t)=>(0,W.jsx)(YD,{item:e,index:t},e.id)),v&&(0,W.jsx)(`div`,{ref:b,className:`infinite-scroll-sentinel`,style:{height:`1px`,margin:`20px 0`},children:y&&(0,W.jsx)(`div`,{className:`loading-indicator`,style:{textAlign:`center`,padding:`20px`,opacity:.6},children:j(`Fetching data...`)})}),!v&&_.length>0&&(0,W.jsx)(`div`,{className:`completion-message`,style:{textAlign:`center`,padding:`20px`,opacity:.6},children:j(`All Data is Loaded 🎉`)}),!v&&_.length===0&&(0,W.jsx)(`div`,{className:`empty-state`,style:{textAlign:`center`,padding:`40px`,opacity:.6},children:j(`Noooop!`)})]})};function ZD(e){"@babel/helpers - typeof";return ZD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ZD(e)}function QD(e,t){if(ZD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ZD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function $D(e){var t=QD(e,`string`);return ZD(t)==`symbol`?t:t+``}function eO(e,t,n){return(t=$D(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tO(Object(n),!0).forEach(function(t){eO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rO(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function iO(e,t){if(e==null)return{};var n,r,i=rO(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aO(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function oO(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,$D(r.key),r)}}function sO(e,t,n){return t&&oO(e.prototype,t),n&&oO(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function cO(e){return cO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cO(e)}function lO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lO=function(){return!!e})()}function uO(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function dO(e,t){if(t&&(ZD(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return uO(e)}function fO(e,t,n){return t=cO(t),dO(e,lO()?Reflect.construct(t,n||[],cO(e).constructor):t.apply(e,n))}function pO(e,t){return pO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pO(e,t)}function mO(e,t){if(typeof t!=`function`&&t!==null)throw 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&&pO(e,t)}function hO(e){if(Array.isArray(e))return e}function gO(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function _O(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vO(e,t){if(e){if(typeof e==`string`)return _O(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_O(e,t):void 0}}function yO(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bO(e,t){return hO(e)||gO(e,t)||vO(e,t)||yO()}function xO(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=xO(e[t]))&&(r&&(r+=` `),r+=n);else for(t in e)e[t]&&(r&&(r+=` `),r+=t);return r}function SO(){for(var e,t,n=0,r=``;n<arguments.length;)(e=arguments[n++])&&(t=xO(e))&&(r&&(r+=` `),r+=t);return r}function CO(){return CO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CO.apply(null,arguments)}var wO=u(s(((e,t)=>{t.exports=function(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}}))()),TO=function(){};function EO(e,t){var n={};return Object.keys(e).forEach(function(e){n[OO(e)]=TO}),n}function DO(e,t){return e[t]!==void 0}function OO(e){return`default`+e.charAt(0).toUpperCase()+e.substr(1)}function kO(e){return!!e&&(typeof e!=`function`||e.prototype&&e.prototype.isReactComponent)}function AO(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,pO(e,t)}function jO(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function MO(e){function t(t){return this.constructor.getDerivedStateFromProps(e,t)??null}this.setState(t.bind(this))}function NO(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}}jO.__suppressDeprecationWarning=!0,MO.__suppressDeprecationWarning=!0,NO.__suppressDeprecationWarning=!0;function PO(e){var t=e.prototype;if(!t||!t.isReactComponent)throw Error(`Can only polyfill class components`);if(typeof e.getDerivedStateFromProps!=`function`&&typeof t.getSnapshotBeforeUpdate!=`function`)return e;var n=null,r=null,i=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`?i=`componentWillUpdate`:typeof t.UNSAFE_componentWillUpdate==`function`&&(i=`UNSAFE_componentWillUpdate`),n!==null||r!==null||i!==null){var a=e.displayName||e.name,o=typeof e.getDerivedStateFromProps==`function`?`getDerivedStateFromProps()`:`getSnapshotBeforeUpdate()`;throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
- `+a+` uses `+o+` but also contains the following legacy lifecycles:`+(n===null?``:`
- `+n)+(r===null?``:`
- `+r)+(i===null?``:`
- `+i)+`
- 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=jO,t.componentWillReceiveProps=MO),typeof t.getSnapshotBeforeUpdate==`function`){if(typeof t.componentDidUpdate!=`function`)throw Error(`Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype`);t.componentWillUpdate=NO;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}var FO=`/Users/jquense/src/uncontrollable/src/uncontrollable.js`;function IO(e,t,n){n===void 0&&(n=[]);var r=e.displayName||e.name||`Component`,i=kO(e),a=Object.keys(t),o=a.map(OO);!(i||!n.length)&&(0,wO.default)(!1);var s=function(r){AO(i,r);function i(){for(var e,i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];e=r.call.apply(r,[this].concat(o))||this,e.handlers=Object.create(null),a.forEach(function(n){var r=t[n],i=function(t){if(e.props[r]){var i;e._notifying=!0;for(var a=arguments.length,o=Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];(i=e.props)[r].apply(i,[t].concat(o)),e._notifying=!1}e.unmounted||e.setState(function(e){var r,i=e.values;return{values:CO(Object.create(null),i,(r={},r[n]=t,r))}})};e.handlers[r]=i}),n.length&&(e.attachRef=function(t){e.inner=t});var c=Object.create(null);return a.forEach(function(t){c[t]=e.props[OO(t)]}),e.state={values:c,prevProps:{}},e}var s=i.prototype;return s.shouldComponentUpdate=function(){return!this._notifying},i.getDerivedStateFromProps=function(e,t){var n=t.values,r=t.prevProps,i={values:CO(Object.create(null),n),prevProps:{}};return a.forEach(function(t){i.prevProps[t]=e[t],!DO(e,t)&&DO(r,t)&&(i.values[t]=e[OO(t)])}),i},s.componentWillUnmount=function(){this.unmounted=!0},s.render=function(){var t=this,n=this.props,r=n.innerRef,i=rO(n,[`innerRef`]);o.forEach(function(e){delete i[e]});var s={};return a.forEach(function(e){var n=t.props[e];s[e]=n===void 0?t.state.values[e]:n}),U.createElement(e,CO({},i,s,this.handlers,{ref:r||this.attachRef}))},i}(U.Component);PO(s),s.displayName=`Uncontrolled(`+r+`)`,s.propTypes=CO({innerRef:function(){}},EO(t,r)),n.forEach(function(e){s.prototype[e]=function(){var t;return(t=this.inner)[e].apply(t,arguments)}});var c=s;return U.forwardRef&&(c=U.forwardRef(function(e,t){return U.createElement(s,CO({},e,{innerRef:t,__source:{fileName:FO,lineNumber:128},__self:this}))}),c.propTypes=s.propTypes),c.ControlledComponent=e,c.deferControlTo=function(e,n,r){return n===void 0&&(n={}),IO(e,CO({},t,n),r)},c}var LO=c({add:()=>QO,century:()=>Ck,date:()=>yk,day:()=>vk,decade:()=>Sk,diff:()=>Tk,endOf:()=>ik,eq:()=>ak,gt:()=>sk,gte:()=>ck,hours:()=>_k,inRange:()=>pk,lt:()=>lk,lte:()=>uk,max:()=>fk,milliseconds:()=>mk,min:()=>dk,minutes:()=>gk,month:()=>bk,neq:()=>ok,seconds:()=>hk,startOf:()=>rk,subtract:()=>nk,weekday:()=>wk,year:()=>xk}),RO=`milliseconds`,zO=`seconds`,BO=`minutes`,VO=`hours`,HO=`day`,UO=`week`,WO=`month`,GO=`year`,KO=`decade`,qO=`century`,JO={milliseconds:1,seconds:1e3,minutes:60*1e3,hours:3600*1e3,day:1440*60*1e3,week:10080*60*1e3},YO={month:1,year:12,decade:120,century:1200};function XO(e){return[31,ZO(e),31,30,31,30,31,31,30,31,30,31]}function ZO(e){return e%4==0&&e%100!=0||e%400==0?29:28}function QO(e,t,n){switch(e=new Date(e),n){case RO:case zO:case BO:case VO:case HO:case UO:return $O(e,t*JO[n]);case WO:case GO:case KO:case qO:return ek(e,t*YO[n])}throw TypeError(`Invalid units: "`+n+`"`)}function $O(e,t){return tk(e,new Date(+e+t))}function ek(e,t){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate(),a=n*12+r+t,o=Math.trunc(a/12),s=a%12,c=Math.min(i,XO(o)[s]),l=new Date(e);return l.setFullYear(o),l.setDate(1),l.setMonth(s),l.setDate(c),l}function tk(e,t){var n=e.getTimezoneOffset(),r=t.getTimezoneOffset()-n;return new Date(+t+r*JO.minutes)}function nk(e,t,n){return QO(e,-t,n)}function rk(e,t,n){switch(e=new Date(e),t){case qO:case KO:case GO:e=bk(e,0);case WO:e=yk(e,1);case UO:case HO:e=_k(e,0);case VO:e=gk(e,0);case BO:e=hk(e,0);case zO:e=mk(e,0)}return t===KO&&(e=nk(e,xk(e)%10,`year`)),t===qO&&(e=nk(e,xk(e)%100,`year`)),t===UO&&(e=wk(e,0,n)),e}function ik(e,t,n){switch(e=new Date(e),e=rk(e,t,n),t){case qO:case KO:case GO:case WO:case UO:e=QO(e,1,t),e=nk(e,1,HO),e.setHours(23,59,59,999);break;case HO:e.setHours(23,59,59,999);break;case VO:case BO:case zO:e=QO(e,1,t),e=nk(e,1,RO)}return e}var ak=Dk(function(e,t){return e===t}),ok=Dk(function(e,t){return e!==t}),sk=Dk(function(e,t){return e>t}),ck=Dk(function(e,t){return e>=t}),lk=Dk(function(e,t){return e<t}),uk=Dk(function(e,t){return e<=t});function dk(){return new Date(Math.min.apply(Math,arguments))}function fk(){return new Date(Math.max.apply(Math,arguments))}function pk(e,t,n,r){return r||=`day`,(!t||ck(e,t,r))&&(!n||uk(e,n,r))}var mk=Ek(`Milliseconds`),hk=Ek(`Seconds`),gk=Ek(`Minutes`),_k=Ek(`Hours`),vk=Ek(`Day`),yk=Ek(`Date`),bk=Ek(`Month`),xk=Ek(`FullYear`);function Sk(e,t){return t===void 0?xk(rk(e,KO)):QO(e,t+10,GO)}function Ck(e,t){return t===void 0?xk(rk(e,qO)):QO(e,t+100,GO)}function wk(e,t,n){var r=(vk(e)+7-(n||0))%7;return t===void 0?r:QO(e,t-r,HO)}function Tk(e,t,n,r){var i,a,o;switch(n){case RO:case zO:case BO:case VO:case HO:case UO:i=t.getTime()-e.getTime();break;case WO:case GO:case KO:case qO:i=(xk(t)-xk(e))*12+bk(t)-bk(e);break;default:throw TypeError(`Invalid units: "`+n+`"`)}switch(n){case RO:a=1;break;case zO:a=1e3;break;case BO:a=1e3*60;break;case VO:a=1e3*60*60;break;case HO:a=1e3*60*60*24;break;case UO:a=1e3*60*60*24*7;break;case WO:a=1;break;case GO:a=12;break;case KO:a=120;break;case qO:a=1200;break;default:throw TypeError(`Invalid units: "`+n+`"`)}return o=i/a,r?o:Math.round(o)}function Ek(e){var t=(function(e){switch(e){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 i=new Date(n);return i[`set`+e](r),t&&i[`get`+e]()!=r&&(e===`Hours`||r>=t&&i.getHours()-n.getHours()<Math.floor(r/t))&&i[`set`+e](r+t),i}}function Dk(e){return function(t,n,r){return e(+rk(t,r),+rk(n,r))}}function Ok(e){if(Array.isArray(e))return _O(e)}function kk(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Ak(){throw TypeError(`Invalid attempt to spread non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jk(e){return Ok(e)||kk(e)||vO(e)||Ak()}var Mk=s(((e,t)=>{function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=n})),Nk=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),Pk=s(((e,t)=>{t.exports=typeof globalThis==`object`&&globalThis&&globalThis.Object===Object&&globalThis})),Fk=s(((e,t)=>{var n=Pk(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),Ik=s(((e,t)=>{t.exports=Fk().Symbol})),Lk=s(((e,t)=>{var n=Ik(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Rk=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),zk=s(((e,t)=>{var n=Ik(),r=Lk(),i=Rk(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Bk=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Vk=s(((e,t)=>{var n=zk(),r=Bk(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Hk=s(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),Uk=s(((e,t)=>{var n=Vk(),r=Hk();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),Wk=s(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),Gk=s(((e,t)=>{var n=Nk(),r=Uk(),i=Wk(),a=Bk();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),Kk=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),qk=s(((e,t)=>{var n=Kk(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),Jk=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),Yk=s(((e,t)=>{var n=zk(),r=Jk(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),Xk=s(((e,t)=>{var n=qk(),r=Bk(),i=Yk(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),Zk=s(((e,t)=>{var n=Xk(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),Qk=s(((e,t)=>{var n=Zk();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),$k=u(s(((e,t)=>{var n=Mk(),r=Gk(),i=Qk(),a=Math.ceil,o=Math.max;function s(e,t,s){t=(s?r(e,t,s):t===void 0)?1:o(i(t),0);var c=e==null?0:e.length;if(!c||t<1)return[];for(var l=0,u=0,d=Array(a(c/t));l<c;)d[u++]=n(e,l,l+=t);return d}t.exports=s}))());function eA(e){return e&&e.ownerDocument||document}function tA(e){var t=eA(e);return t&&t.defaultView||window}function nA(e,t){return tA(e).getComputedStyle(e,t)}var rA=/([A-Z])/g;function iA(e){return e.replace(rA,`-$1`).toLowerCase()}var aA=/^ms-/;function oA(e){return iA(e).replace(aA,`-ms-`)}var sA=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function cA(e){return!!(e&&sA.test(e))}function lA(e,t){var n=``,r=``;if(typeof t==`string`)return e.style.getPropertyValue(oA(t))||nA(e).getPropertyValue(oA(t));Object.keys(t).forEach(function(i){var a=t[i];!a&&a!==0?e.style.removeProperty(oA(i)):cA(i)?r+=i+`(`+a+`) `:n+=oA(i)+`: `+a+`;`}),r&&(n+=`transform: `+r+`;`),e.style.cssText+=`;`+n}function uA(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}function dA(e){return`nodeType`in e&&e.nodeType===document.DOCUMENT_NODE}function fA(e){return`window`in e&&e.window===e?e:dA(e)&&e.defaultView||!1}function pA(e){var t=e===`pageXOffset`?`scrollLeft`:`scrollTop`;function n(n,r){var i=fA(n);if(r===void 0)return i?i[e]:n[t];i?i.scrollTo(i[e],r):n[t]=r}return n}var mA=pA(`pageXOffset`),hA=pA(`pageYOffset`);function gA(e){var t=eA(e),n={top:0,left:0,height:0,width:0},r=t&&t.documentElement;return!r||!uA(r,e)?n:(e.getBoundingClientRect!==void 0&&(n=e.getBoundingClientRect()),n={top:n.top+hA(r)-(r.clientTop||0),left:n.left+mA(r)-(r.clientLeft||0),width:n.width,height:n.height},n)}var _A=function(e){return!!e&&`offsetParent`in e};function vA(e){for(var t=eA(e),n=e&&e.offsetParent;_A(n)&&n.nodeName!==`HTML`&&lA(n,`position`)===`static`;)n=n.offsetParent;return n||t.documentElement}var yA=function(e){return e.nodeName&&e.nodeName.toLowerCase()};function bA(e,t){var n={top:0,left:0},r;if(lA(e,`position`)===`fixed`)r=e.getBoundingClientRect();else{var i=t||vA(e);r=gA(e),yA(i)!==`html`&&(n=gA(i));var a=String(lA(i,`borderTopWidth`)||0);n.top+=parseInt(a,10)-hA(i)||0;var o=String(lA(i,`borderLeftWidth`)||0);n.left+=parseInt(o,10)-mA(i)||0}var s=String(lA(e,`marginTop`)||0),c=String(lA(e,`marginLeft`)||0);return CO({},r,{top:r.top-n.top-(parseInt(s,10)||0),left:r.left-n.left-(parseInt(c,10)||0)})}var xA=!!(typeof window<`u`&&window.document&&window.document.createElement),SA=new Date().getTime();function CA(e){var t=new Date().getTime(),n=Math.max(0,16-(t-SA)),r=setTimeout(e,n);return SA=t,r}var wA=[``,`webkit`,`moz`,`o`,`ms`],TA=`clearTimeout`,EA=CA,DA=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+`AnimationFrame`};xA&&wA.some(function(e){var t=DA(e,`request`);return t in window&&(TA=DA(e,`cancel`),EA=function(e){return window[t](e)}),!!EA});var OA=function(e){typeof window[TA]==`function`&&window[TA](e)},kA=EA,AA;function jA(e,t){if(!AA){var n=document.body,r=n.matches||n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;AA=function(e,t){return r.call(e,t)}}return AA(e,t)}var MA=Function.prototype.bind.call(Function.prototype.call,[].slice);function NA(e,t){return MA(e.querySelectorAll(t))}var PA=!1,FA=!1;try{var IA={get passive(){return PA=!0},get once(){return FA=PA=!0}};xA&&(window.addEventListener(`test`,IA,IA),window.removeEventListener(`test`,IA,!0))}catch{}function LA(e,t,n,r){if(r&&typeof r!=`boolean`&&!FA){var i=r.once,a=r.capture,o=n;!FA&&i&&(o=n.__once||function e(r){this.removeEventListener(t,e,a),n.call(this,r)},n.__once=o),e.addEventListener(t,o,PA?r:a)}e.addEventListener(t,n,r)}function RA(e){let t=(0,U.useRef)(e);return(0,U.useEffect)(()=>{t.current=e},[e]),t}function zA(e){let t=RA(e);return(0,U.useCallback)(function(...e){return t.current&&t.current(...e)},[t])}function BA(){return(0,U.useState)(null)}function VA(){let e=(0,U.useRef)(!0),t=(0,U.useRef)(()=>e.current);return(0,U.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function HA(e){let t=VA();return[e[0],(0,U.useCallback)(n=>{if(t())return e[1](n)},[t,e[1]])]}var UA=Lb({defaultModifiers:[vb,Cb,Uy,Ky,xb,mb,Eb,Ly]}),WA=function(e){return{position:e,top:`0`,left:`0`,opacity:`0`,pointerEvents:`none`}},GA={name:`applyStyles`,enabled:!1},KA={name:`ariaDescribedBy`,enabled:!0,phase:`afterWrite`,effect:function(e){var t=e.state;return function(){var e=t.elements,n=e.reference,r=e.popper;if(`removeAttribute`in n){var i=(n.getAttribute(`aria-describedby`)||``).split(`,`).filter(function(e){return e.trim()!==r.id});i.length?n.setAttribute(`aria-describedby`,i.join(`,`)):n.removeAttribute(`aria-describedby`)}}},fn:function(e){var t=e.state.elements,n=t.popper,r=t.reference,i=n.getAttribute(`role`)?.toLowerCase();if(n.id&&i===`tooltip`&&`setAttribute`in r){var a=r.getAttribute(`aria-describedby`);if(a&&a.split(`,`).indexOf(n.id)!==-1)return;r.setAttribute(`aria-describedby`,a?a+`,`+n.id:n.id)}}},qA=[];function JA(e,t,n){var r=n===void 0?{}:n,i=r.enabled,a=i===void 0?!0:i,o=r.placement,s=o===void 0?`bottom`:o,c=r.strategy,l=c===void 0?`absolute`:c,u=r.modifiers,d=u===void 0?qA:u,f=rO(r,[`enabled`,`placement`,`strategy`,`modifiers`]),p=(0,U.useRef)(),m=(0,U.useCallback)(function(){var e;(e=p.current)==null||e.update()},[]),h=(0,U.useCallback)(function(){var e;(e=p.current)==null||e.forceUpdate()},[]),g=HA((0,U.useState)({placement:s,update:m,forceUpdate:h,attributes:{},styles:{popper:WA(l),arrow:{}}})),_=g[0],v=g[1],y=(0,U.useMemo)(function(){return{name:`updateStateModifier`,enabled:!0,phase:`write`,requires:[`computeStyles`],fn:function(e){var t=e.state,n={},r={};Object.keys(t.elements).forEach(function(e){n[e]=t.styles[e],r[e]=t.attributes[e]}),v({state:t,styles:n,attributes:r,update:m,forceUpdate:h,placement:t.placement})}}},[m,h,v]);return(0,U.useEffect)(function(){!p.current||!a||p.current.setOptions({placement:s,strategy:l,modifiers:[].concat(d,[y,GA])})},[l,s,y,a]),(0,U.useEffect)(function(){if(!(!a||e==null||t==null))return p.current=UA(e,t,CO({},f,{placement:s,strategy:l,modifiers:[].concat(d,[KA,y])})),function(){p.current!=null&&(p.current.destroy(),p.current=void 0,v(function(e){return CO({},e,{attributes:{},styles:{popper:WA(l)}})}))}},[a,e,t]),_}function YA(e,t,n,r){var i=r&&typeof r!=`boolean`?r.capture:r;e.removeEventListener(t,n,i),n.__once&&e.removeEventListener(t,n.__once,i)}function XA(e,t,n,r){return LA(e,t,n,r),function(){YA(e,t,n,r)}}function ZA(e){return e&&`setState`in e?A_.findDOMNode(e):e??null}var QA=(function(e){return eA(ZA(e))}),$A=u(Hb()),ej=27,tj=function(){};function nj(e){return e.button===0}function rj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var ij=function(e){return e&&(`current`in e?e.current:e)};function aj(e,t,n){var r=n===void 0?{}:n,i=r.disabled,a=r.clickTrigger,o=a===void 0?`click`:a,s=(0,U.useRef)(!1),c=t||tj,l=(0,U.useCallback)(function(t){var n=ij(e);(0,$A.default)(!!n,`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`),s.current=!n||rj(t)||!nj(t)||!!uA(n,(t.composedPath==null?void 0:t.composedPath()[0])??t.target)},[e]),u=zA(function(e){s.current||c(e)}),d=zA(function(e){e.keyCode===ej&&c(e)});(0,U.useEffect)(function(){if(!(i||e==null)){var t=window.event,n=QA(ij(e)),r=XA(n,o,l,!0),a=XA(n,o,function(e){if(e===t){t=void 0;return}u(e)}),s=XA(n,`keyup`,function(e){if(e===t){t=void 0;return}d(e)}),c=[];return`ontouchstart`in n.documentElement&&(c=[].slice.call(n.body.children).map(function(e){return XA(e,`mousemove`,tj)})),function(){r(),a(),s(),c.forEach(function(e){return e()})}}},[e,i,o,l,u,d])}function oj(e){var t={};return Array.isArray(e)?(e?.forEach(function(e){t[e.name]=e}),t):e||t}function sj(e){return e===void 0&&(e={}),Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t].name=t,e[t]})}function cj(e){var t=e.enabled,n=e.enableEvents,r=e.placement,i=e.flip,a=e.offset,o=e.fixed,s=e.containerPadding,c=e.arrowElement,l=e.popperConfig,u=l===void 0?{}:l,d=oj(u.modifiers);return CO({},u,{placement:r,enabled:t,strategy:o?`fixed`:u.strategy,modifiers:sj(CO({},d,{eventListeners:{enabled:n},preventOverflow:CO({},d.preventOverflow,{options:s?CO({padding:s},d.preventOverflow?.options):d.preventOverflow?.options}),offset:{options:CO({offset:a},d.offset?.options)},arrow:CO({},d.arrow,{enabled:!!c,options:CO({},d.arrow?.options,{element:c})}),flip:CO({enabled:!!i},d.flip)}))})}function lj(e,t){return e.classList?!!t&&e.classList.contains(t):(` `+(e.className.baseVal||e.className)+` `).indexOf(` `+t+` `)!==-1}function uj(e,t){e.classList?e.classList.add(t):lj(e,t)||(typeof e.className==`string`?e.className=e.className+` `+t:e.setAttribute(`class`,(e.className&&e.className.baseVal||``)+` `+t))}function dj(e,t){return e.replace(RegExp(`(^|\\s)`+t+`(?:\\s|$)`,`g`),`$1`).replace(/\s+/g,` `).replace(/^\s*|\s*$/g,``)}function fj(e,t){e.classList?e.classList.remove(t):typeof e.className==`string`?e.className=dj(e.className,t):e.setAttribute(`class`,dj(e.className&&e.className.baseVal||``,t))}var pj;function mj(e){if((!pj&&pj!==0||e)&&xA){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),pj=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return pj}var hj=function(e){var t;return typeof document>`u`?null:e==null?eA().body:(typeof e==`function`&&(e=e()),e&&`current`in e&&(e=e.current),(t=e)!=null&&t.nodeType&&e||null)};function gj(e,t){var n=(0,U.useState)(function(){return hj(e)}),r=n[0],i=n[1];if(!r){var a=hj(e);a&&i(a)}return(0,U.useEffect)(function(){t&&r&&t(r)},[t,r]),(0,U.useEffect)(function(){var t=hj(e);t!==r&&i(t)},[e,r]),r}var _j=e=>!e||typeof e==`function`?e:t=>{e.current=t};function vj(e,t){let n=_j(e),r=_j(t);return e=>{n&&n(e),r&&r(e)}}function yj(e,t){return(0,U.useMemo)(()=>vj(e,t),[e,t])}var bj=U.forwardRef(function(e,t){var n=e.flip,r=e.offset,i=e.placement,a=e.containerPadding,o=a===void 0?5:a,s=e.popperConfig,c=s===void 0?{}:s,l=e.transition,u=BA(),d=u[0],f=u[1],p=BA(),m=p[0],h=p[1],g=yj(f,t),_=gj(e.container),v=gj(e.target),y=(0,U.useState)(!e.show),b=y[0],x=y[1],S=JA(v,d,cj({placement:i,enableEvents:!!e.show,containerPadding:o||5,flip:n,offset:r,arrowElement:m,popperConfig:c})),C=S.styles,w=S.attributes,T=rO(S,[`styles`,`attributes`]);e.show?b&&x(!1):!e.transition&&!b&&x(!0);var E=function(){x(!0),e.onExited&&e.onExited.apply(e,arguments)},D=e.show||l&&!b;if(aj(d,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!D)return null;var O=e.children(CO({},T,{show:!!e.show,props:CO({},w.popper,{style:C.popper,ref:g}),arrowProps:CO({},w.arrow,{style:C.arrow,ref:h})}));if(l){var k=e.onExit,ee=e.onExiting,A=e.onEnter,te=e.onEntering,ne=e.onEntered;O=U.createElement(l,{in:e.show,appear:!0,onExit:k,onExiting:ee,onExited:E,onEnter:A,onEntering:te,onEntered:ne},O)}return _?A_.createPortal(O,_):null});bj.displayName=`Overlay`,bj.propTypes={show:K.default.bool,placement:K.default.oneOf(ny),target:K.default.any,container:K.default.any,flip:K.default.bool,children:K.default.func.isRequired,containerPadding:K.default.number,popperConfig:K.default.object,rootClose:K.default.bool,rootCloseEvent:K.default.oneOf([`click`,`mousedown`]),rootCloseDisabled:K.default.bool,onHide:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(e.rootClose){var i;return(i=K.default.func).isRequired.apply(i,[e].concat(n))}return K.default.func.apply(K.default,[e].concat(n))},transition:K.default.elementType,onEnter:K.default.func,onEntering:K.default.func,onEntered:K.default.func,onExit:K.default.func,onExiting:K.default.func,onExited:K.default.func};var xj=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Sj=s(((e,t)=>{var n=Nk();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Cj=s(((e,t)=>{var n=Sj(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),wj=s(((e,t)=>{var n=Sj();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Tj=s(((e,t)=>{var n=Sj();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Ej=s(((e,t)=>{var n=Sj();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Dj=s(((e,t)=>{var n=xj(),r=Cj(),i=wj(),a=Tj(),o=Ej();function s(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])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Oj=s(((e,t)=>{var n=Dj();function r(){this.__data__=new n,this.size=0}t.exports=r})),kj=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),Aj=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),jj=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Mj=s(((e,t)=>{t.exports=Fk()[`__core-js_shared__`]})),Nj=s(((e,t)=>{var n=Mj(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Pj=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Fj=s(((e,t)=>{var n=Vk(),r=Nj(),i=Bk(),a=Pj(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Ij=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),Lj=s(((e,t)=>{var n=Fj(),r=Ij();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Rj=s(((e,t)=>{t.exports=Lj()(Fk(),`Map`)})),zj=s(((e,t)=>{t.exports=Lj()(Object,`create`)})),Bj=s(((e,t)=>{var n=zj();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Vj=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),Hj=s(((e,t)=>{var n=zj(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Uj=s(((e,t)=>{var n=zj(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Wj=s(((e,t)=>{var n=zj(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),Gj=s(((e,t)=>{var n=Bj(),r=Vj(),i=Hj(),a=Uj(),o=Wj();function s(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])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Kj=s(((e,t)=>{var n=Gj(),r=Dj(),i=Rj();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),qj=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Jj=s(((e,t)=>{var n=qj();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Yj=s(((e,t)=>{var n=Jj();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),Xj=s(((e,t)=>{var n=Jj();function r(e){return n(this,e).get(e)}t.exports=r})),Zj=s(((e,t)=>{var n=Jj();function r(e){return n(this,e).has(e)}t.exports=r})),Qj=s(((e,t)=>{var n=Jj();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),$j=s(((e,t)=>{var n=Kj(),r=Yj(),i=Xj(),a=Zj(),o=Qj();function s(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])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),eM=s(((e,t)=>{var n=Dj(),r=Rj(),i=$j(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),tM=s(((e,t)=>{var n=Dj(),r=Oj(),i=kj(),a=Aj(),o=jj(),s=eM();function c(e){this.size=(this.__data__=new n(e)).size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),nM=s(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),rM=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),iM=s(((e,t)=>{var n=$j(),r=nM(),i=rM();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),aM=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),oM=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),sM=s(((e,t)=>{var n=iM(),r=aM(),i=oM(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),cM=s(((e,t)=>{t.exports=Fk().Uint8Array})),lM=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),uM=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),dM=s(((e,t)=>{var n=Ik(),r=cM(),i=Nk(),a=sM(),o=lM(),s=uM(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),fM=s(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),pM=s(((e,t)=>{t.exports=Array.isArray})),mM=s(((e,t)=>{var n=fM(),r=pM();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),hM=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),gM=s(((e,t)=>{function n(){return[]}t.exports=n})),_M=s(((e,t)=>{var n=hM(),r=gM(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),vM=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),yM=s(((e,t)=>{var n=zk(),r=Jk(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),bM=s(((e,t)=>{var n=yM(),r=Jk(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),xM=s(((e,t)=>{function n(){return!1}t.exports=n})),SM=s(((e,t)=>{var n=Fk(),r=xM(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),CM=s(((e,t)=>{var n=zk(),r=Hk(),i=Jk(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function ee(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=ee})),wM=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),TM=s(((e,t)=>{var n=Pk(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),EM=s(((e,t)=>{var n=CM(),r=wM(),i=TM(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),DM=s(((e,t)=>{var n=vM(),r=bM(),i=pM(),a=SM(),o=Wk(),s=EM(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),OM=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),kM=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),AM=s(((e,t)=>{t.exports=kM()(Object.keys,Object)})),jM=s(((e,t)=>{var n=OM(),r=AM(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),MM=s(((e,t)=>{var n=DM(),r=jM(),i=Uk();function a(e){return i(e)?n(e):r(e)}t.exports=a})),NM=s(((e,t)=>{var n=mM(),r=_M(),i=MM();function a(e){return n(e,i,r)}t.exports=a})),PM=s(((e,t)=>{var n=NM(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),FM=s(((e,t)=>{t.exports=Lj()(Fk(),`DataView`)})),IM=s(((e,t)=>{t.exports=Lj()(Fk(),`Promise`)})),LM=s(((e,t)=>{t.exports=Lj()(Fk(),`Set`)})),RM=s(((e,t)=>{t.exports=Lj()(Fk(),`WeakMap`)})),zM=s(((e,t)=>{var n=FM(),r=Rj(),i=IM(),a=LM(),o=RM(),s=zk(),c=Pj(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),BM=s(((e,t)=>{var n=tM(),r=sM(),i=dM(),a=PM(),o=zM(),s=pM(),c=SM(),l=EM(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),VM=s(((e,t)=>{var n=BM(),r=Jk();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),HM=u(s(((e,t)=>{var n=VM();function r(e,t){return n(e,t)}t.exports=r}))());function UM(e,t){var n=fA(e);return n?n.innerHeight:t?e.clientHeight:gA(e).height}function WM(e,t,n){e.closest&&!n&&e.closest(t);var r=e;do{if(jA(r,t))return r;r=r.parentElement}while(r&&r!==n&&r.nodeType===document.ELEMENT_NODE);return null}var GM=s(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),KM=s(((e,t)=>{var n=tM(),r=VM(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),qM=s(((e,t)=>{var n=Bk();function r(e){return e===e&&!n(e)}t.exports=r})),JM=s(((e,t)=>{var n=qM(),r=MM();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),YM=s(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),XM=s(((e,t)=>{var n=KM(),r=JM(),i=YM();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),ZM=s(((e,t)=>{var n=pM(),r=Yk(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),QM=s(((e,t)=>{var n=$j(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),$M=s(((e,t)=>{var n=QM(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),eN=s(((e,t)=>{var n=$M(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),tN=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),nN=s(((e,t)=>{var n=Ik(),r=tN(),i=pM(),a=Yk(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),rN=s(((e,t)=>{var n=nN();function r(e){return e==null?``:n(e)}t.exports=r})),iN=s(((e,t)=>{var n=pM(),r=ZM(),i=eN(),a=rN();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),aN=s(((e,t)=>{var n=Yk(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),oN=s(((e,t)=>{var n=iN(),r=aN();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),sN=s(((e,t)=>{var n=oN();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),cN=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),lN=s(((e,t)=>{var n=iN(),r=bM(),i=pM(),a=Wk(),o=Hk(),s=aN();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),uN=s(((e,t)=>{var n=cN(),r=lN();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),dN=s(((e,t)=>{var n=VM(),r=sN(),i=uN(),a=ZM(),o=qM(),s=YM(),c=aN(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),fN=s(((e,t)=>{function n(e){return e}t.exports=n})),pN=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),mN=s(((e,t)=>{var n=oN();function r(e){return function(t){return n(t,e)}}t.exports=r})),hN=s(((e,t)=>{var n=pN(),r=mN(),i=ZM(),a=aN();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),gN=s(((e,t)=>{var n=XM(),r=dN(),i=fN(),a=pM(),o=hN();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),_N=s(((e,t)=>{var n=GM(),r=gN(),i=Qk(),a=Math.max;function o(e,t,o){var s=e==null?0:e.length;if(!s)return-1;var c=o==null?0:i(o);return c<0&&(c=a(s+c,0)),n(e,r(t,3),c)}t.exports=o})),vN=s(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),yN=s(((e,t)=>{var n=vN(),r=Gk(),i=Zk();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t<a?1:-1:i(o),n(t,a,o,e)}}t.exports=a})),bN=u(s(((e,t)=>{t.exports=yN()()}))()),xN=u(_N()),SN=Number.isNaN||function(e){return typeof e==`number`&&e!==e};function CN(e,t){return!!(e===t||SN(e)&&SN(t))}function wN(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!CN(e[n],t[n]))return!1;return!0}function TN(e,t){t===void 0&&(t=wN);var n=null;function r(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return r.clear=function(){n=null},r}function EN(e,t){var n=fA(e);return n?n.innerWidth:t?e.clientWidth:gA(e).width}var DN=s(((e,t)=>{var n=Ik(),r=bM(),i=pM(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),ON=s(((e,t)=>{var n=fM(),r=DN();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),kN=s(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),AN=s(((e,t)=>{t.exports=kN()()})),jN=s(((e,t)=>{var n=AN(),r=MM();function i(e,t){return e&&n(e,t,r)}t.exports=i})),MN=s(((e,t)=>{var n=Uk();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),NN=s(((e,t)=>{var n=jN();t.exports=MN()(n)})),PN=s(((e,t)=>{var n=NN(),r=Uk();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),FN=s(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),IN=s(((e,t)=>{var n=Yk();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),LN=s(((e,t)=>{var n=IN();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),RN=s(((e,t)=>{var n=tN(),r=oN(),i=gN(),a=PN(),o=FN(),s=wM(),c=LN(),l=fN(),u=pM();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),zN=s(((e,t)=>{function n(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)}t.exports=n})),BN=s(((e,t)=>{var n=zN(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),VN=s(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),HN=s(((e,t)=>{var n=Lj();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),UN=s(((e,t)=>{var n=VN(),r=HN(),i=fN();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),WN=s(((e,t)=>{var n=800,r=16,i=Date.now;function a(e){var t=0,a=0;return function(){var o=i(),s=r-(o-a);if(a=o,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a})),GN=s(((e,t)=>{var n=UN();t.exports=WN()(n)})),KN=s(((e,t)=>{var n=fN(),r=BN(),i=GN();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),qN=u(s(((e,t)=>{var n=ON(),r=RN(),i=KN(),a=Gk();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})}))());function JN(e){return hO(e)||kk(e)||vO(e)||yO()}var YN=s(((e,t)=>{function n(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}t.exports=n})),XN=s(((e,t)=>{var n=Bk(),r=OM(),i=YN(),a=Object.prototype.hasOwnProperty;function o(e){if(!n(e))return i(e);var t=r(e),o=[];for(var s in e)s==`constructor`&&(t||!a.call(e,s))||o.push(s);return o}t.exports=o})),ZN=s(((e,t)=>{var n=DM(),r=XN(),i=Uk();function a(e){return i(e)?n(e,!0):r(e)}t.exports=a})),QN=s(((e,t)=>{var n=KN(),r=Nk(),i=Gk(),a=ZN(),o=Object.prototype,s=o.hasOwnProperty;t.exports=n(function(e,t){e=Object(e);var n=-1,c=t.length,l=c>2?t[2]:void 0;for(l&&i(t[0],t[1],l)&&(c=1);++n<c;)for(var u=t[n],d=a(u),f=-1,p=d.length;++f<p;){var m=d[f],h=e[m];(h===void 0||r(h,o[m])&&!s.call(e,m))&&(e[m]=u[m])}return e})})),$N=s(((e,t)=>{var n=HN();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),eP=s(((e,t)=>{var n=$N(),r=jN(),i=gN();function a(e,t){var a={};return t=i(t,3),r(e,function(e,r,i){n(a,r,t(e,r,i))}),a}t.exports=a})),tP=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=n})),nP=s(((e,t)=>{var n=$N(),r=Nk(),i=Object.prototype.hasOwnProperty;function a(e,t,a){var o=e[t];(!(i.call(e,t)&&r(o,a))||a===void 0&&!(t in e))&&n(e,t,a)}t.exports=a})),rP=s(((e,t)=>{var n=nP(),r=$N();function i(e,t,i,a){var o=!i;i||={};for(var s=-1,c=t.length;++s<c;){var l=t[s],u=a?a(i[l],e[l],l,i,e):void 0;u===void 0&&(u=e[l]),o?r(i,l,u):n(i,l,u)}return i}t.exports=i})),iP=s(((e,t)=>{var n=rP(),r=MM();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),aP=s(((e,t)=>{var n=rP(),r=ZN();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),oP=s(((e,t)=>{var n=Fk(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(e,t){if(t)return e.slice();var n=e.length,r=o?o(n):new e.constructor(n);return e.copy(r),r}t.exports=s})),sP=s(((e,t)=>{function n(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}t.exports=n})),cP=s(((e,t)=>{var n=rP(),r=_M();function i(e,t){return n(e,r(e),t)}t.exports=i})),lP=s(((e,t)=>{t.exports=kM()(Object.getPrototypeOf,Object)})),uP=s(((e,t)=>{var n=fM(),r=lP(),i=_M(),a=gM();t.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=r(e);return t}:a})),dP=s(((e,t)=>{var n=rP(),r=uP();function i(e,t){return n(e,r(e),t)}t.exports=i})),fP=s(((e,t)=>{var n=mM(),r=uP(),i=ZN();function a(e){return n(e,i,r)}t.exports=a})),pP=s(((e,t)=>{var n=Object.prototype.hasOwnProperty;function r(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]==`string`&&n.call(e,`index`)&&(r.index=e.index,r.input=e.input),r}t.exports=r})),mP=s(((e,t)=>{var n=cM();function r(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}t.exports=r})),hP=s(((e,t)=>{var n=mP();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}t.exports=r})),gP=s(((e,t)=>{var n=/\w*$/;function r(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}t.exports=r})),_P=s(((e,t)=>{var n=Ik(),r=n?n.prototype:void 0,i=r?r.valueOf:void 0;function a(e){return i?Object(i.call(e)):{}}t.exports=a})),dee=s(((e,t)=>{var n=mP();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}t.exports=r})),vP=s(((e,t)=>{var n=mP(),r=hP(),i=gP(),a=_P(),o=dee(),s=`[object Boolean]`,c=`[object Date]`,l=`[object Map]`,u=`[object Number]`,d=`[object RegExp]`,f=`[object Set]`,p=`[object String]`,m=`[object Symbol]`,h=`[object ArrayBuffer]`,g=`[object DataView]`,_=`[object Float32Array]`,v=`[object Float64Array]`,y=`[object Int8Array]`,b=`[object Int16Array]`,x=`[object Int32Array]`,S=`[object Uint8Array]`,C=`[object Uint8ClampedArray]`,w=`[object Uint16Array]`,T=`[object Uint32Array]`;function E(e,t,E){var D=e.constructor;switch(t){case h:return n(e);case s:case c:return new D(+e);case g:return r(e,E);case _:case v:case y:case b:case x:case S:case C:case w:case T:return o(e,E);case l:return new D;case u:case p:return new D(e);case d:return i(e);case f:return new D;case m:return a(e)}}t.exports=E})),yP=s(((e,t)=>{var n=Bk(),r=Object.create;t.exports=function(){function e(){}return function(t){if(!n(t))return{};if(r)return r(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}()})),bP=s(((e,t)=>{var n=yP(),r=lP(),i=OM();function a(e){return typeof e.constructor==`function`&&!i(e)?n(r(e)):{}}t.exports=a})),xP=s(((e,t)=>{var n=zM(),r=Jk(),i=`[object Map]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),SP=s(((e,t)=>{var n=xP(),r=wM(),i=TM(),a=i&&i.isMap;t.exports=a?r(a):n})),CP=s(((e,t)=>{var n=zM(),r=Jk(),i=`[object Set]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),wP=s(((e,t)=>{var n=CP(),r=wM(),i=TM(),a=i&&i.isSet;t.exports=a?r(a):n})),TP=s(((e,t)=>{var n=tM(),r=tP(),i=nP(),a=iP(),o=aP(),s=oP(),c=sP(),l=cP(),u=dP(),d=NM(),f=fP(),p=zM(),m=pP(),h=vP(),g=bP(),_=pM(),v=SM(),y=SP(),b=Bk(),x=wP(),S=MM(),C=ZN(),w=1,T=2,E=4,D=`[object Arguments]`,O=`[object Array]`,k=`[object Boolean]`,ee=`[object Date]`,A=`[object Error]`,te=`[object Function]`,ne=`[object GeneratorFunction]`,re=`[object Map]`,ie=`[object Number]`,ae=`[object Object]`,oe=`[object RegExp]`,se=`[object Set]`,ce=`[object String]`,le=`[object Symbol]`,ue=`[object WeakMap]`,de=`[object ArrayBuffer]`,fe=`[object DataView]`,pe=`[object Float32Array]`,me=`[object Float64Array]`,he=`[object Int8Array]`,ge=`[object Int16Array]`,_e=`[object Int32Array]`,ve=`[object Uint8Array]`,ye=`[object Uint8ClampedArray]`,be=`[object Uint16Array]`,xe=`[object Uint32Array]`,Se={};Se[D]=Se[O]=Se[de]=Se[fe]=Se[k]=Se[ee]=Se[pe]=Se[me]=Se[he]=Se[ge]=Se[_e]=Se[re]=Se[ie]=Se[ae]=Se[oe]=Se[se]=Se[ce]=Se[le]=Se[ve]=Se[ye]=Se[be]=Se[xe]=!0,Se[A]=Se[te]=Se[ue]=!1;function Ce(e,t,O,k,ee,A){var re,ie=t&w,oe=t&T,se=t&E;if(O&&(re=ee?O(e,k,ee,A):O(e)),re!==void 0)return re;if(!b(e))return e;var ce=_(e);if(ce){if(re=m(e),!ie)return c(e,re)}else{var le=p(e),ue=le==te||le==ne;if(v(e))return s(e,ie);if(le==ae||le==D||ue&&!ee){if(re=oe||ue?{}:g(e),!ie)return oe?u(e,o(re,e)):l(e,a(re,e))}else{if(!Se[le])return ee?e:{};re=h(e,le,ie)}}A||=new n;var de=A.get(e);if(de)return de;A.set(e,re),x(e)?e.forEach(function(n){re.add(Ce(n,t,O,n,e,A))}):y(e)&&e.forEach(function(n,r){re.set(r,Ce(n,t,O,r,e,A))});var fe=ce?void 0:(se?oe?f:d:oe?C:S)(e);return r(fe||e,function(n,r){fe&&(r=n,n=e[r]),i(re,r,Ce(n,t,O,r,e,A))}),re}t.exports=Ce})),EP=s(((e,t)=>{function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}t.exports=n})),DP=s(((e,t)=>{var n=oN(),r=Mk();function i(e,t){return t.length<2?e:n(e,r(t,0,-1))}t.exports=i})),OP=s(((e,t)=>{var n=iN(),r=EP(),i=DP(),a=aN();function o(e,t){return t=n(t,e),e=i(e,t),e==null||delete e[a(r(t))]}t.exports=o})),kP=s(((e,t)=>{var n=zk(),r=lP(),i=Jk(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),AP=s(((e,t)=>{var n=kP();function r(e){return n(e)?void 0:e}t.exports=r})),jP=s(((e,t)=>{var n=ON();function r(e){return e!=null&&e.length?n(e,1):[]}t.exports=r})),MP=s(((e,t)=>{var n=jP(),r=BN(),i=GN();function a(e){return i(r(e,void 0,n),e+``)}t.exports=a})),NP=s(((e,t)=>{var n=tN(),r=TP(),i=OP(),a=iN(),o=rP(),s=AP(),c=MP(),l=fP(),u=1,d=2,f=4;t.exports=c(function(e,t){var c={};if(e==null)return c;var p=!1;t=n(t,function(t){return t=a(t,e),p||=t.length>1,t}),o(e,l(e),c),p&&(c=r(c,u|d|f,s));for(var m=t.length;m--;)i(c,t[m]);return c})})),PP=s(((e,t)=>{var n=tP(),r=yP(),i=jN(),a=gN(),o=lP(),s=pM(),c=SM(),l=Vk(),u=Bk(),d=EM();function f(e,t,f){var p=s(e),m=p||c(e)||d(e);if(t=a(t,4),f==null){var h=e&&e.constructor;f=m?p?new h:[]:u(e)&&l(h)?r(o(e)):{}}return(m?n:i)(e,function(e,n,r){return t(f,e,n,r)}),f}t.exports=f})),FP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isBetween=r()})(e,(function(){"use strict";return function(e,t,n){t.prototype.isBetween=function(e,t,r,i){var a=n(e),o=n(t),s=(i||=`()`)[0]===`(`,c=i[1]===`)`;return(s?this.isAfter(a,r):!this.isBefore(a,r))&&(c?this.isBefore(o,r):!this.isAfter(o,r))||(s?this.isBefore(a,r):!this.isAfter(a,r))&&(c?this.isAfter(o,r):!this.isBefore(o,r))}}}))})),IP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isSameOrAfter=r()})(e,(function(){"use strict";return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}}))})),LP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isSameOrBefore=r()})(e,(function(){"use strict";return function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}}}))})),RP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localeData=r()})(e,(function(){"use strict";return function(e,t,n){var r=t.prototype,i=function(e){return e&&(e.indexOf?e:e.s)},a=function(e,t,n,r,a){var o=e.name?e:e.$locale(),s=i(o[t]),c=i(o[n]),l=s||c.map((function(e){return e.slice(0,r)}));if(!a)return l;var u=o.weekStart;return l.map((function(e,t){return l[(t+(u||0))%7]}))},o=function(){return n.Ls[n.locale()]},s=function(e,t){return e.formats[t]||function(e){return e.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}(e.formats[t.toUpperCase()])},c=function(){var e=this;return{months:function(t){return t?t.format(`MMMM`):a(e,`months`)},monthsShort:function(t){return t?t.format(`MMM`):a(e,`monthsShort`,`months`,3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(t){return t?t.format(`dddd`):a(e,`weekdays`)},weekdaysMin:function(t){return t?t.format(`dd`):a(e,`weekdaysMin`,`weekdays`,2)},weekdaysShort:function(t){return t?t.format(`ddd`):a(e,`weekdaysShort`,`weekdays`,3)},longDateFormat:function(t){return s(e.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return c.bind(this)()},n.localeData=function(){var e=o();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(t){return s(e,t)},meridiem:e.meridiem,ordinal:e.ordinal}},n.months=function(){return a(o(),`months`)},n.monthsShort=function(){return a(o(),`monthsShort`,`months`,3)},n.weekdays=function(e){return a(o(),`weekdays`,null,null,e)},n.weekdaysShort=function(e){return a(o(),`weekdaysShort`,`weekdays`,3,e)},n.weekdaysMin=function(e){return a(o(),`weekdaysMin`,`weekdays`,2,e)}}}))})),zP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(e,(function(){"use strict";var e={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(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),BP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_minMax=r()})(e,(function(){"use strict";return function(e,t,n){var r=function(e,t){if(!t||!t.length||t.length===1&&!t[0]||t.length===1&&Array.isArray(t[0])&&!t[0].length)return null;var n;t.length===1&&t[0].length>0&&(t=t[0]),n=(t=t.filter((function(e){return e})))[0];for(var r=1;r<t.length;r+=1)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n};n.max=function(){return r(`isAfter`,[].slice.call(arguments,0))},n.min=function(){return r(`isBefore`,[].slice.call(arguments,0))}}}))})),VP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(e,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),HP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isLeapYear=r()})(e,(function(){"use strict";return function(e,t){t.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}}))})),UP=u(QN()),WP=u(eP()),GP=u(NP()),KP=u(PP());FP(),IP(),LP(),RP(),zP(),BP(),VP(),HP();function qP(e){return e.children}var JP={PREVIOUS:`PREV`,NEXT:`NEXT`,TODAY:`TODAY`,DATE:`DATE`},YP={MONTH:`month`,WEEK:`week`,WORK_WEEK:`work_week`,DAY:`day`,AGENDA:`agenda`},XP=Object.keys(YP).map(function(e){return YP[e]});K.default.oneOfType([K.default.string,K.default.func]),K.default.any,K.default.func,K.default.oneOfType([K.default.arrayOf(K.default.oneOf(XP)),K.default.objectOf(function(e,t){if(XP.indexOf(t)!==-1&&typeof e[t]==`boolean`)return null;for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return K.default.elementType.apply(K.default,[e,t].concat(r))})]),K.default.oneOfType([K.default.oneOf([`overlap`,`no-overlap`]),K.default.func]);var ZP={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,day:1e3*60*60*24};function QP(e,t){return rk(rk(e,`month`),`week`,t.startOfWeek())}function $P(e,t){return ik(ik(e,`month`),`week`,t.startOfWeek())}function eF(e,t){for(var n=QP(e,t),r=$P(e,t),i=[];uk(n,r,`day`);)i.push(n),n=QO(n,1,`day`);return i}function tF(e,t){var n=rk(e,t);return ak(n,e)?n:QO(n,1,t)}function nF(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`day`,r=e,i=[];uk(r,t,n);)i.push(r),r=QO(r,1,n);return i}function rF(e,t){return t==null&&e==null?null:(t??=new Date,e??=new Date,e=rk(e,`day`),e=_k(e,_k(t)),e=gk(e,gk(t)),e=hk(e,hk(t)),mk(e,mk(t)))}function iF(e){return _k(e)===0&&gk(e)===0&&hk(e)===0&&mk(e)===0}function aF(e,t,n,r){return n===`day`&&(n=`date`),Math.abs(LO[n](e,void 0,r)-LO[n](t,void 0,r))}function oF(e,t,n){return!n||n===`milliseconds`?Math.abs(e-+t):Math.round(Math.abs(+rk(e,n)/ZP[n]-+rk(t,n)/ZP[n]))}var sF=K.default.oneOfType([K.default.string,K.default.func]);function cF(e,t,n,r,i){var a=typeof r==`function`?r(n,i,e):t.call(e,n,r,i);return(0,wO.default)(a==null||typeof a==`string`,"`localizer format(..)` must return a string, null, or undefined"),a}function lF(e,t,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,t+n,0,0)}function uF(e,t){return e.getTimezoneOffset()-t.getTimezoneOffset()}function dF(e,t){return oF(e,t,`minutes`)+uF(e,t)}function fF(e){var t=rk(e,`day`);return oF(t,e,`minutes`)+uF(t,e)}function pF(e,t){return lk(e,t,`day`)}function mF(e,t,n){return ak(e,t,`minutes`)?ck(t,n,`minutes`):sk(t,n,`minutes`)}function hF(e,t){return aF(e,t,`day`)}function gF(e){var t=e.evtA,n=t.start,r=t.end,i=t.allDay,a=e.evtB,o=a.start,s=a.end,c=a.allDay,l=rk(n,`day`)-+rk(o,`day`),u=hF(n,r),d=hF(o,s);return l||d-u||!!c-!!i||n-+o||r-+s}function _F(e){var t=e.event,n=t.start,r=t.end,i=e.range,a=i.start,o=i.end,s=rk(n,`day`),c=uk(s,o,`day`),l=ok(s,r,`minutes`)?sk(r,a,`minutes`):ck(r,a,`minutes`);return c&&l}function vF(e,t){return ak(e,t,`day`)}function yF(e,t){return iF(e)&&iF(t)}var bF=sO(function e(t){var n=this;aO(this,e),(0,wO.default)(typeof t.format==`function`,"date localizer `format(..)` must be a function"),(0,wO.default)(typeof t.firstOfWeek==`function`,"date localizer `firstOfWeek(..)` must be a function"),this.propType=t.propType||sF,this.formats=t.formats,this.format=function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return cF.apply(void 0,[n,t.format].concat(r))},this.startOfWeek=t.firstOfWeek,this.merge=t.merge||rF,this.inRange=t.inRange||pk,this.lt=t.lt||lk,this.lte=t.lte||uk,this.gt=t.gt||sk,this.gte=t.gte||ck,this.eq=t.eq||ak,this.neq=t.neq||ok,this.startOf=t.startOf||rk,this.endOf=t.endOf||ik,this.add=t.add||QO,this.range=t.range||nF,this.diff=t.diff||oF,this.ceil=t.ceil||tF,this.min=t.min||dk,this.max=t.max||fk,this.minutes=t.minutes||gk,this.daySpan=t.daySpan||hF,this.firstVisibleDay=t.firstVisibleDay||QP,this.lastVisibleDay=t.lastVisibleDay||$P,this.visibleDays=t.visibleDays||eF,this.getSlotDate=t.getSlotDate||lF,this.getTimezoneOffset=t.getTimezoneOffset||function(e){return e.getTimezoneOffset()},this.getDstOffset=t.getDstOffset||uF,this.getTotalMin=t.getTotalMin||dF,this.getMinutesFromMidnight=t.getMinutesFromMidnight||fF,this.continuesPrior=t.continuesPrior||pF,this.continuesAfter=t.continuesAfter||mF,this.sortEvents=t.sortEvents||gF,this.inEventRange=t.inEventRange||_F,this.isSameDate=t.isSameDate||vF,this.startAndEndAreDateOnly=t.startAndEndAreDateOnly||yF,this.segmentOffset=t.browserTZOffset?t.browserTZOffset():0});function xF(e,t,n,r){var i=nO(nO({},e.formats),n);return nO(nO({},e),{},{messages:r,startOfWeek:function(){return e.startOfWeek(t)},format:function(n,r){return e.format(n,i[r]||r,t)}})}var SF=function(e){function t(){var e;aO(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=fO(this,t,[].concat(r)),e.navigate=function(t){e.props.onNavigate(t)},e.view=function(t){e.props.onView(t)},e}return mO(t,e),sO(t,[{key:`render`,value:function(){var e=this.props,t=e.localizer.messages,n=e.label;return U.createElement(`div`,{className:`rbc-toolbar`},U.createElement(`span`,{className:`rbc-btn-group`},U.createElement(`button`,{type:`button`,onClick:this.navigate.bind(null,JP.TODAY)},t.today),U.createElement(`button`,{type:`button`,onClick:this.navigate.bind(null,JP.PREVIOUS)},t.previous),U.createElement(`button`,{type:`button`,onClick:this.navigate.bind(null,JP.NEXT)},t.next)),U.createElement(`span`,{className:`rbc-toolbar-label`},n),U.createElement(`span`,{className:`rbc-btn-group`},this.viewNamesGroup(t)))}},{key:`viewNamesGroup`,value:function(e){var t=this,n=this.props.views,r=this.props.view;if(n.length>1)return n.map(function(n){return U.createElement(`button`,{type:`button`,key:n,className:SO({"rbc-active":r===n}),onClick:t.view.bind(null,n)},e[n])})}}])}(U.Component);function CF(e,t){e&&e.apply(null,[].concat(t))}var wF={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(e){return`+${e} more`}};function TF(e){return nO(nO({},wF),e)}function EF(e){var t=e.ref,n=e.callback;(0,U.useEffect)(function(){var e=function(e){t.current&&!t.current.contains(e.target)&&n()};return document.addEventListener(`mousedown`,e),function(){document.removeEventListener(`mousedown`,e)}},[t,n])}var DF=[`style`,`className`,`event`,`selected`,`isAllDay`,`onSelect`,`onDoubleClick`,`onKeyPress`,`localizer`,`continuesPrior`,`continuesAfter`,`accessors`,`getters`,`children`,`components`,`slotStart`,`slotEnd`],OF=function(e){function t(){return aO(this,t),fO(this,t,arguments)}return mO(t,e),sO(t,[{key:`render`,value:function(){var e=this.props,t=e.style,n=e.className,r=e.event,i=e.selected,a=e.isAllDay,o=e.onSelect,s=e.onDoubleClick,c=e.onKeyPress,l=e.localizer,u=e.continuesPrior,d=e.continuesAfter,f=e.accessors,p=e.getters,m=e.children,h=e.components,g=h.event,_=h.eventWrapper,v=e.slotStart,y=e.slotEnd,b=iO(e,DF);delete b.resizable;var x=f.title(r),S=f.tooltip(r),C=f.end(r),w=f.start(r),T=f.allDay(r),E=a||T||l.diff(w,l.ceil(C,`day`),`day`)>1,D=p.eventProp(r,w,C,i),O=U.createElement(`div`,{className:`rbc-event-content`,title:S||void 0},g?U.createElement(g,{event:r,continuesPrior:u,continuesAfter:d,title:x,isAllDay:T,localizer:l,slotStart:v,slotEnd:y}):x);return U.createElement(_,Object.assign({},this.props,{type:`date`}),U.createElement(`div`,Object.assign({},b,{style:nO(nO({},D.style),t),className:SO(`rbc-event`,n,D.className,{"rbc-selected":i,"rbc-event-allday":E,"rbc-event-continues-prior":u,"rbc-event-continues-after":d}),onClick:function(e){return o&&o(r,e)},onDoubleClick:function(e){return s&&s(r,e)},onKeyDown:function(e){return c&&c(r,e)}}),typeof m==`function`?m(O):O))}}])}(U.Component);function kF(e,t){return!e||t==null?!1:(0,HM.default)(e,t)}function AF(e,t){return(e.right-e.left)/t}function jF(e,t,n,r){var i=AF(e,r);return n?r-1-Math.floor((t-e.left)/i):Math.floor((t-e.left)/i)}function MF(e,t){var n=t.x,r=t.y;return r>=e.top&&r<=e.bottom&&n>=e.left&&n<=e.right}function NF(e,t,n,r,i){var a=-1,o=-1,s=r-1,c=AF(t,r),l=jF(t,n.x,i,r),u=t.top<n.y&&t.bottom>n.y,d=t.top<e.y&&t.bottom>e.y,f=e.y>t.bottom,p=t.top>e.y;return n.top<t.top&&n.bottom>t.bottom&&(a=0,o=s),u&&(p?(a=0,o=l):f&&(a=l,o=s)),d&&(a=o=i?s-Math.floor((e.x-t.left)/c):Math.floor((e.x-t.left)/c),u?l<a?a=l:o=l:e.y<n.y?o=s:a=0),{startIdx:a,endIdx:o}}function PF(e){var t=e.target,n=e.offset,r=e.container,i=e.box,a=gA(t),o=a.top,s=a.left,c=a.width,l=a.height,u=gA(r),d=u.top,f=u.left,p=u.width,m=u.height,h=gA(i),g=h.width,_=h.height,v=d+m,y=f+p,b=o+_,x=s+g,S=n.x,C=n.y;return{topOffset:b>v?o-_-C:o+C+l,leftOffset:x>y?s+S-g+c:s+S}}function FF(e){var t=e.containerRef,n=e.accessors,r=e.getters,i=e.selected,a=e.components,o=e.localizer,s=e.position,c=e.show,l=e.events,u=e.slotStart,d=e.slotEnd,f=e.onSelect,p=e.onDoubleClick,m=e.onKeyPress,h=e.handleDragStart,g=e.popperRef,_=e.target,v=e.offset;EF({ref:g,callback:c}),(0,U.useLayoutEffect)(function(){var e=PF({target:_,offset:v,container:t.current,box:g.current}),n=e.topOffset,r=e.leftOffset;g.current.style.top=`${n}px`,g.current.style.left=`${r}px`},[v.x,v.y,_]);var y=s.width,b={minWidth:y+y/2};return U.createElement(`div`,{style:b,className:`rbc-overlay`,ref:g},U.createElement(`div`,{className:`rbc-overlay-header`},o.format(u,`dayHeaderFormat`)),l.map(function(e,t){return U.createElement(OF,{key:t,type:`popup`,localizer:o,event:e,getters:r,onSelect:f,accessors:n,components:a,onDoubleClick:p,onKeyPress:m,continuesPrior:o.lt(n.end(e),u,`day`),continuesAfter:o.gte(n.start(e),d,`day`),slotStart:u,slotEnd:d,selected:kF(e,i),draggable:!0,onDragStart:function(){return h(e)},onDragEnd:function(){return c()}})}))}var IF=U.forwardRef(function(e,t){return U.createElement(FF,Object.assign({},e,{popperRef:t}))});IF.propTypes={accessors:K.default.object.isRequired,getters:K.default.object.isRequired,selected:K.default.object,components:K.default.object.isRequired,localizer:K.default.object.isRequired,position:K.default.object.isRequired,show:K.default.func.isRequired,events:K.default.array.isRequired,slotStart:K.default.instanceOf(Date).isRequired,slotEnd:K.default.instanceOf(Date),onSelect:K.default.func,onDoubleClick:K.default.func,onKeyPress:K.default.func,handleDragStart:K.default.func,style:K.default.object,offset:K.default.shape({x:K.default.number,y:K.default.number})};function LF(e){var t=e.containerRef,n=e.popupOffset,r=n===void 0?5:n,i=e.overlay,a=e.accessors,o=e.localizer,s=e.components,c=e.getters,l=e.selected,u=e.handleSelectEvent,d=e.handleDoubleClickEvent,f=e.handleKeyPressEvent,p=e.handleDragStart,m=e.onHide,h=e.overlayDisplay,g=(0,U.useRef)(null);if(!i.position)return null;var _=r;isNaN(r)||(_={x:r,y:r});var v=i.position,y=i.events,b=i.date,x=i.end;return U.createElement(bj,{rootClose:!0,flip:!0,show:!0,placement:`bottom`,onHide:m,target:i.target},function(e){var n=e.props;return U.createElement(IF,Object.assign({},n,{containerRef:t,ref:g,target:i.target,offset:_,accessors:a,getters:c,selected:l,components:s,localizer:o,position:v,show:h,events:y,slotStart:b,slotEnd:x,onSelect:u,onDoubleClick:d,onKeyPress:f,handleDragStart:p}))})}var RF=U.forwardRef(function(e,t){return U.createElement(LF,Object.assign({},e,{containerRef:t}))});RF.propTypes={popupOffset:K.default.oneOfType([K.default.number,K.default.shape({x:K.default.number,y:K.default.number})]),overlay:K.default.shape({position:K.default.object,events:K.default.array,date:K.default.instanceOf(Date),end:K.default.instanceOf(Date)}),accessors:K.default.object.isRequired,localizer:K.default.object.isRequired,components:K.default.object.isRequired,getters:K.default.object.isRequired,selected:K.default.object,handleSelectEvent:K.default.func,handleDoubleClickEvent:K.default.func,handleKeyPressEvent:K.default.func,handleDragStart:K.default.func,onHide:K.default.func,overlayDisplay:K.default.func};function zF(e,t){return XA(arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,e,t,{passive:!1})}function BF(e,t,n){return!e||uA(e,document.elementFromPoint(t,n))}function VF(e,t){var n=t.clientX,r=t.clientY;return WM(document.elementFromPoint(n,r),`.rbc-event`,e)}function HF(e,t){var n=t.clientX,r=t.clientY;return WM(document.elementFromPoint(n,r),`.rbc-show-more`,e)}function UF(e,t){return!!VF(e,t)}function WF(e,t){return!!HF(e,t)}function GF(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 KF=5,qF=250,JF=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.global,i=r===void 0?!1:r,a=n.longPressThreshold,o=a===void 0?250:a,s=n.validContainers,c=s===void 0?[]:s;aO(this,e),this._initialEvent=null,this.selecting=!1,this.isDetached=!1,this.container=t,this.globalMouse=!t||i,this.longPressThreshold=o,this.validContainers=c,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=zF(`touchmove`,function(){},window),this._removeKeyDownListener=zF(`keydown`,this._keyListener),this._removeKeyUpListener=zF(`keyup`,this._keyListener),this._removeDropFromOutsideListener=zF(`drop`,this._dropFromOutsideListener),this._removeDragOverFromOutsideListener=zF(`dragover`,this._dragOverFromOutsideListener),this._addInitialEventListener()}return sO(e,[{key:`on`,value:function(e,t){var n=this._listeners[e]||(this._listeners[e]=[]);return n.push(t),{remove:function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}},{key:`emit`,value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i;return(this._listeners[e]||[]).forEach(function(e){i===void 0&&(i=e.apply(void 0,n))}),i}},{key:`teardown`,value:function(){this._initialEvent=null,this._initialEventData=null,this._selectRect=null,this.selecting=!1,this._lastClickData=null,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(e){var t=this._selectRect;return!t||!this.selecting?!1:XF(t,ZF(e))}},{key:`filter`,value:function(e){return!this._selectRect||!this.selecting?[]:e.filter(this.isSelected,this)}},{key:`_addLongPressListener`,value:function(e,t){var n=this,r=null,i=null,a=null,o=function(t){r=setTimeout(function(){c(),e(t)},n.longPressThreshold),i=zF(`touchmove`,function(){return c()}),a=zF(`touchend`,function(){return c()})},s=zF(`touchstart`,o),c=function(){r&&clearTimeout(r),i&&i(),a&&a(),r=null,i=null,a=null};return t&&o(t),function(){c(),s()}}},{key:`_addInitialEventListener`,value:function(){var e=this,t=zF(`mousedown`,function(t){e._removeInitialEventListener(),e._handleInitialEvent(t),e._removeInitialEventListener=zF(`mousedown`,e._handleInitialEvent)}),n=zF(`touchstart`,function(t){e._removeInitialEventListener(),e._removeInitialEventListener=e._addLongPressListener(e._handleInitialEvent,t)});this._removeInitialEventListener=function(){t(),n()}}},{key:`_dropFromOutsideListener`,value:function(e){var t=GF(e),n=t.pageX,r=t.pageY,i=t.clientX,a=t.clientY;this.emit(`dropFromOutside`,{x:n,y:r,clientX:i,clientY:a}),e.preventDefault()}},{key:`_dragOverFromOutsideListener`,value:function(e){var t=GF(e),n=t.pageX,r=t.pageY,i=t.clientX,a=t.clientY;this.emit(`dragOverFromOutside`,{x:n,y:r,clientX:i,clientY:a}),e.preventDefault()}},{key:`_handleInitialEvent`,value:function(e){if(this._initialEvent=e,!this.isDetached){var t=GF(e),n=t.clientX,r=t.clientY,i=t.pageX,a=t.pageY,o=this.container(),s,c;if(!(e.which===3||e.button===2||!BF(o,n,r))){if(!this.globalMouse&&o&&!uA(o,e.target)){var l=YF(0),u=l.top,d=l.left,f=l.bottom,p=l.right;if(c=ZF(o),s=XF({top:c.top-u,left:c.left-d,bottom:c.bottom+f,right:c.right+p},{top:a,left:i}),!s)return}if(this.emit(`beforeSelect`,this._initialEventData={isTouch:/^touch/.test(e.type),x:i,y:a,clientX:n,clientY:r})!==!1)switch(e.type){case`mousedown`:this._removeEndListener=zF(`mouseup`,this._handleTerminatingEvent),this._onEscListener=zF(`keydown`,this._handleTerminatingEvent),this._removeMoveListener=zF(`mousemove`,this._handleMoveEvent);break;case`touchstart`:this._handleMoveEvent(e),this._removeEndListener=zF(`touchend`,this._handleTerminatingEvent),this._removeMoveListener=zF(`touchmove`,this._handleMoveEvent);break}}}}},{key:`_isWithinValidContainer`,value:function(e){var t=e.target,n=this.validContainers;return!n||!n.length||!t?!0:n.some(function(e){return!!t.closest(e)})}},{key:`_handleTerminatingEvent`,value:function(e){var t=this.selecting,n=this._selectRect;if(!t&&e.type.includes(`key`)&&(e=this._initialEvent),this.selecting=!1,this._removeEndListener&&this._removeEndListener(),this._removeMoveListener&&this._removeMoveListener(),this._selectRect=null,this._initialEvent=null,this._initialEventData=null,e){var r=!this.container||uA(this.container(),e.target),i=this._isWithinValidContainer(e);return e.key===`Escape`||!i?this.emit(`reset`):!t&&r?this._handleClickEvent(e):t?this.emit(`select`,n):this.emit(`reset`)}}},{key:`_handleClickEvent`,value:function(e){var t=GF(e),n=t.pageX,r=t.pageY,i=t.clientX,a=t.clientY,o=new Date().getTime();return this._lastClickData&&o-this._lastClickData.timestamp<qF?(this._lastClickData=null,this.emit(`doubleClick`,{x:n,y:r,clientX:i,clientY:a})):(this._lastClickData={timestamp:o},this.emit(`click`,{x:n,y:r,clientX:i,clientY:a}))}},{key:`_handleMoveEvent`,value:function(e){if(!(this._initialEventData===null||this.isDetached)){var t=this._initialEventData,n=t.x,r=t.y,i=GF(e),a=i.pageX,o=i.pageY,s=Math.abs(n-a),c=Math.abs(r-o),l=Math.min(a,n),u=Math.min(o,r),d=this.selecting,f=this.isClick(a,o);f&&!d&&!(s||c)||(!d&&!f&&this.emit(`selectStart`,this._initialEventData),f||(this.selecting=!0,this._selectRect={top:u,left:l,x:a,y:o,right:l+s,bottom:u+c},this.emit(`selecting`,this._selectRect)),e.preventDefault())}}},{key:`_keyListener`,value:function(e){this.ctrl=e.metaKey||e.ctrlKey}},{key:`isClick`,value:function(e,t){var n=this._initialEventData,r=n.x,i=n.y;return!n.isTouch&&Math.abs(e-r)<=KF&&Math.abs(t-i)<=KF}}])}();function YF(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return ZD(e)!==`object`&&(e={top:e,left:e,right:e,bottom:e}),e}function XF(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=ZF(e),i=r.top,a=r.left,o=r.right,s=o===void 0?a:o,c=r.bottom,l=c===void 0?i:c,u=ZF(t),d=u.top,f=u.left,p=u.right,m=p===void 0?f:p,h=u.bottom,g=h===void 0?d:h;return!(l-n<d||i+n>g||s-n<f||a+n>m)}function ZF(e){if(!e.getBoundingClientRect)return e;var t=e.getBoundingClientRect(),n=t.left+QF(`left`),r=t.top+QF(`top`);return{top:r,left:n,right:(e.offsetWidth||0)+n,bottom:(e.offsetHeight||0)+r}}function QF(e){if(e===`left`)return window.pageXOffset||document.body.scrollLeft||0;if(e===`top`)return window.pageYOffset||document.body.scrollTop||0}var $F=function(e){function t(e,n){var r;return aO(this,t),r=fO(this,t,[e,n]),r.state={selecting:!1},r.containerRef=(0,U.createRef)(),r}return mO(t,e),sO(t,[{key:`componentDidMount`,value:function(){this.props.selectable&&this._selectable()}},{key:`componentWillUnmount`,value:function(){this._teardownSelectable()}},{key:`componentDidUpdate`,value:function(e){!e.selectable&&this.props.selectable&&this._selectable(),e.selectable&&!this.props.selectable&&this._teardownSelectable()}},{key:`render`,value:function(){var e=this.props,t=e.range,n=e.getNow,r=e.getters,i=e.date,a=e.components.dateCellWrapper,o=e.localizer,s=this.state,c=s.selecting,l=s.startIdx,u=s.endIdx,d=n();return U.createElement(`div`,{className:`rbc-row-bg`,ref:this.containerRef},t.map(function(e,n){var s=c&&n>=l&&n<=u,f=r.dayProp(e),p=f.className,m=f.style;return U.createElement(a,{key:n,value:e,range:t},U.createElement(`div`,{style:m,className:SO(`rbc-day-bg`,p,s&&`rbc-selected-cell`,o.isSameDate(e,d)&&`rbc-today`,i&&o.neq(i,e,`month`)&&`rbc-off-range-bg`)}))}))}},{key:`_selectable`,value:function(){var e=this,t=this.containerRef.current,n=this._selector=new JF(this.props.container,{longPressThreshold:this.props.longPressThreshold}),r=function(n,r){if(!UF(t,n)&&!WF(t,n)){var i=ZF(t),a=e.props,o=a.range,s=a.rtl;if(MF(i,n)){var c=jF(i,n.x,s,o.length);e._selectSlot({startIdx:c,endIdx:c,action:r,box:n})}}e._initial={},e.setState({selecting:!1})};n.on(`selecting`,function(r){var i=e.props,a=i.range,o=i.rtl,s=-1,c=-1;if(e.state.selecting||(CF(e.props.onSelectStart,[r]),e._initial={x:r.x,y:r.y}),n.isSelected(t)){var l=ZF(t),u=NF(e._initial,l,r,a.length,o);s=u.startIdx,c=u.endIdx}e.setState({selecting:!0,startIdx:s,endIdx:c})}),n.on(`beforeSelect`,function(t){if(e.props.selectable===`ignoreEvents`)return!UF(e.containerRef.current,t)}),n.on(`click`,function(e){return r(e,`click`)}),n.on(`doubleClick`,function(e){return r(e,`doubleClick`)}),n.on(`select`,function(t){e._selectSlot(nO(nO({},e.state),{},{action:`select`,bounds:t})),e._initial={},e.setState({selecting:!1}),CF(e.props.onSelectEnd,[e.state])})}},{key:`_teardownSelectable`,value:function(){this._selector&&=(this._selector.teardown(),null)}},{key:`_selectSlot`,value:function(e){var t=e.endIdx,n=e.startIdx,r=e.action,i=e.bounds,a=e.box;t!==-1&&n!==-1&&this.props.onSelectSlot&&this.props.onSelectSlot({start:n,end:t,action:r,bounds:i,box:a,resourceId:this.props.resourceId})}}])}(U.Component),eI={propTypes:{slotMetrics:K.default.object.isRequired,selected:K.default.object,isAllDay:K.default.bool,accessors:K.default.object.isRequired,localizer:K.default.object.isRequired,components:K.default.object.isRequired,getters:K.default.object.isRequired,onSelect:K.default.func,onDoubleClick:K.default.func,onKeyPress:K.default.func},defaultProps:{segments:[],selected:{}},renderEvent:function(e,t){var n=e.selected;e.isAllDay;var r=e.accessors,i=e.getters,a=e.onSelect,o=e.onDoubleClick,s=e.onKeyPress,c=e.localizer,l=e.slotMetrics,u=e.components,d=e.resizable,f=l.continuesPrior(t),p=l.continuesAfter(t);return U.createElement(OF,{event:t,getters:i,localizer:c,accessors:r,components:u,onSelect:a,onDoubleClick:o,onKeyPress:s,continuesPrior:f,continuesAfter:p,slotStart:l.first,slotEnd:l.last,selected:kF(t,n),resizable:d})},renderSpan:function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:` `,i=Math.abs(t)/e*100+`%`;return U.createElement(`div`,{key:n,className:`rbc-row-segment`,style:{WebkitFlexBasis:i,flexBasis:i,maxWidth:i}},r)}},tI=function(e){function t(){return aO(this,t),fO(this,t,arguments)}return mO(t,e),sO(t,[{key:`render`,value:function(){var e=this,t=this.props,n=t.segments,r=t.slotMetrics.slots,i=t.className,a=1;return U.createElement(`div`,{className:SO(i,`rbc-row`)},n.reduce(function(t,n,i){var o=n.event,s=n.left,c=n.right,l=n.span,u=`_lvl_`+i,d=s-a,f=eI.renderEvent(e.props,o);return d&&t.push(eI.renderSpan(r,d,`${u}_gap`)),t.push(eI.renderSpan(r,l,u,f)),a=c+1,t},[]))}}])}(U.Component);tI.defaultProps=nO({},eI.defaultProps);function nI(e){var t=e.dateRange,n=e.unit,r=n===void 0?`day`:n,i=e.localizer;return{first:t[0],last:i.add(t[t.length-1],1,r)}}function rI(e,t,n,r){var i=nI({dateRange:t,localizer:r}),a=i.first,o=i.last,s=r.diff(a,o,`day`),c=r.max(r.startOf(n.start(e),`day`),a),l=r.min(r.ceil(n.end(e),`day`),o),u=(0,xN.default)(t,function(e){return r.isSameDate(e,c)}),d=r.diff(c,l,`day`);return d=Math.min(d,s),d=Math.max(d-r.segmentOffset,1),{event:e,span:d,left:u+1,right:Math.max(u+d,1)}}function iI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0,n,r,i,a=[],o=[];for(n=0;n<e.length;n++){for(i=e[n],r=0;r<a.length&&oI(i,a[r]);r++);r>=t?o.push(i):(a[r]||(a[r]=[])).push(i)}for(n=0;n<a.length;n++)a[n].sort(function(e,t){return e.left-t.left});return{levels:a,extra:o}}function aI(e,t,n,r,i){var a={start:r.start(e),end:r.end(e)},o={start:t,end:n};return i.inEventRange({event:a,range:o})}function oI(e,t){return t.some(function(t){return t.left<=e.right&&t.right>=e.left})}function sI(e,t,n){var r=jk(e),i=[],a=[];r.forEach(function(e){var r=t.start(e),o=t.end(e);n.daySpan(r,o)>1?i.push(e):a.push(e)});var o=i.sort(function(e,r){return cI(e,r,t,n)}),s=a.sort(function(e,r){return cI(e,r,t,n)});return[].concat(jk(o),jk(s))}function cI(e,t,n,r){var i={start:n.start(e),end:n.end(e),allDay:n.allDay(e)},a={start:n.start(t),end:n.end(t),allDay:n.allDay(t)};return r.sortEvents({evtA:i,evtB:a})}var lI=function(e,t){return e.left<=t&&e.right>=t},uI=function(e,t){return e.filter(function(e){return lI(e,t)}).map(function(e){return e.event})},dI=function(e){function t(){return aO(this,t),fO(this,t,arguments)}return mO(t,e),sO(t,[{key:`render`,value:function(){for(var e=this.props,t=e.segments,n=e.slotMetrics.slots,r=iI(t).levels[0],i=1,a=1,o=[];i<=n;){var s=`_lvl_`+i,c=r.filter(function(e){return lI(e,i)})[0]||{},l=c.event,u=c.left,d=c.right,f=c.span;if(!l){if(this.getHiddenEventsForSlot(t,i).length>0){var p=i-a;p&&o.push(eI.renderSpan(n,p,s+`_gap`)),o.push(eI.renderSpan(n,1,s,this.renderShowMore(t,i))),a=i+=1;continue}i++;continue}var m=Math.max(0,u-a);if(this.canRenderSlotEvent(u,f)){var h=eI.renderEvent(this.props,l);m&&o.push(eI.renderSpan(n,m,s+`_gap`)),o.push(eI.renderSpan(n,f,s,h)),a=i=d+1}else m&&o.push(eI.renderSpan(n,m,s+`_gap`)),o.push(eI.renderSpan(n,1,s,this.renderShowMore(t,i))),a=i+=1}return U.createElement(`div`,{className:`rbc-row`},o)}},{key:`getHiddenEventsForSlot`,value:function(e,t){var n=uI(e,t),r=iI(e).levels[0].filter(function(e){return lI(e,t)}).map(function(e){return e.event});return n.filter(function(e){return!r.some(function(t){return t===e})})}},{key:`canRenderSlotEvent`,value:function(e,t){var n=this.props.segments;return(0,bN.default)(e,e+t).every(function(e){return uI(n,e).length===1})}},{key:`renderShowMore`,value:function(e,t){var n=this,r=this.props,i=r.localizer,a=r.slotMetrics,o=r.components,s=a.getEventsForSlot(t),c=uI(e,t),l=c.length;if(o!=null&&o.showMore){var u=o.showMore,d=a.getDateForSlot(t-1);return l?U.createElement(u,{localizer:i,slotDate:d,slot:t,count:l,events:s,remainingEvents:c}):!1}return l?U.createElement(`button`,{type:`button`,key:`sm_`+t,className:SO(`rbc-button-link`,`rbc-show-more`),onClick:function(e){return n.showMore(t,e)}},i.messages.showMore(l,c,s)):!1}},{key:`showMore`,value:function(e,t){t.preventDefault(),t.stopPropagation(),this.props.onShowMore(e,t.target)}}])}(U.Component);dI.defaultProps=nO({},eI.defaultProps);var fI=function(e){var t=e.children;return U.createElement(`div`,{className:`rbc-row-content-scroll-container`},t)},pI=function(e,t){return e.left<=t&&e.right>=t},mI=function(e,t){return e[0].range===t[0].range&&e[0].events===t[0].events};function hI(){return TN(function(e){for(var t=e.range,n=e.events,r=e.maxRows,i=e.minRows,a=e.accessors,o=e.localizer,s=nI({dateRange:t,localizer:o}),c=s.first,l=s.last,u=n.map(function(e){return rI(e,t,a,o)}),d=iI(u,Math.max(r-1,1)),f=d.levels,p=d.extra,m=p.length>0?i-1:i;f.length<m;)f.push([]);return{first:c,last:l,levels:f,extra:p,range:t,slots:t.length,clone:function(t){return hI()(nO(nO({},e),t))},getDateForSlot:function(e){return t[e]},getSlotForDate:function(e){return t.find(function(t){return o.isSameDate(t,e)})},getEventsForSlot:function(e){return u.filter(function(t){return pI(t,e)}).map(function(e){return e.event})},continuesPrior:function(e){return o.continuesPrior(a.start(e),c)},continuesAfter:function(e){var t=a.start(e),n=a.end(e);return o.continuesAfter(t,n,l)}}},mI)}var gI=function(e){function t(){var e;aO(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=fO(this,t,[].concat(r)),e.handleSelectSlot=function(t){var n=e.props,r=n.range,i=n.onSelectSlot;i(r.slice(t.start,t.end+1),t)},e.handleShowMore=function(t,n){var r=e.props,i=r.range,a=r.onShowMore,o=e.slotMetrics(e.props),s=NA(e.containerRef.current,`.rbc-row-bg`)[0],c;s&&(c=s.children[t-1]),a(o.getEventsForSlot(t),i[t-1],c,t,n)},e.getContainer=function(){var t=e.props.container;return t?t():e.containerRef.current},e.renderHeadingCell=function(t,n){var r=e.props,i=r.renderHeader,a=r.getNow,o=r.localizer;return i({date:t,key:`header_${n}`,className:SO(`rbc-date-cell`,o.isSameDate(t,a())&&`rbc-now`)})},e.renderDummy=function(){var t=e.props,n=t.className,r=t.range,i=t.renderHeader,a=t.showAllEvents;return U.createElement(`div`,{className:n,ref:e.containerRef},U.createElement(`div`,{className:SO(`rbc-row-content`,a&&`rbc-row-content-scrollable`)},i&&U.createElement(`div`,{className:`rbc-row`,ref:e.headingRowRef},r.map(e.renderHeadingCell)),U.createElement(`div`,{className:`rbc-row`,ref:e.eventRowRef},U.createElement(`div`,{className:`rbc-row-segment`},U.createElement(`div`,{className:`rbc-event`},U.createElement(`div`,{className:`rbc-event-content`},`\xA0`))))))},e.containerRef=(0,U.createRef)(),e.headingRowRef=(0,U.createRef)(),e.eventRowRef=(0,U.createRef)(),e.slotMetrics=hI(),e}return mO(t,e),sO(t,[{key:`getRowLimit`,value:function(){var e,t=UM(this.eventRowRef.current),n=(e=this.headingRowRef)!=null&&e.current?UM(this.headingRowRef.current):0,r=UM(this.containerRef.current)-n;return Math.max(Math.floor(r/t),1)}},{key:`render`,value:function(){var e=this.props,t=e.date,n=e.rtl,r=e.range,i=e.className,a=e.selected,o=e.selectable,s=e.renderForMeasure,c=e.accessors,l=e.getters,u=e.components,d=e.getNow,f=e.renderHeader,p=e.onSelect,m=e.localizer,h=e.onSelectStart,g=e.onSelectEnd,_=e.onDoubleClick,v=e.onKeyPress,y=e.resourceId,b=e.longPressThreshold,x=e.isAllDay,S=e.resizable,C=e.showAllEvents;if(s)return this.renderDummy();var w=this.slotMetrics(this.props),T=w.levels,E=w.extra,D=C?fI:qP,O=u.weekWrapper,k={selected:a,accessors:c,getters:l,localizer:m,components:u,onSelect:p,onDoubleClick:_,onKeyPress:v,resourceId:y,slotMetrics:w,resizable:S};return U.createElement(`div`,{className:i,role:`rowgroup`,ref:this.containerRef},U.createElement($F,{localizer:m,date:t,getNow:d,rtl:n,range:r,selectable:o,container:this.getContainer,getters:l,onSelectStart:h,onSelectEnd:g,onSelectSlot:this.handleSelectSlot,components:u,longPressThreshold:b,resourceId:y}),U.createElement(`div`,{className:SO(`rbc-row-content`,C&&`rbc-row-content-scrollable`),role:`row`},f&&U.createElement(`div`,{className:`rbc-row `,ref:this.headingRowRef},r.map(this.renderHeadingCell)),U.createElement(D,null,U.createElement(O,Object.assign({isAllDay:x},k,{rtl:this.props.rtl}),T.map(function(e,t){return U.createElement(tI,Object.assign({key:t,segments:e},k))}),!!E.length&&U.createElement(dI,Object.assign({segments:E,onShowMore:this.handleShowMore},k))))))}}])}(U.Component);gI.defaultProps={minRows:0,maxRows:1/0};var _I=function(e){var t=e.label;return U.createElement(`span`,{role:`columnheader`,"aria-sort":`none`},t)},vI=function(e){var t=e.label,n=e.drilldownView,r=e.onDrillDown;return n?U.createElement(`button`,{type:`button`,className:`rbc-button-link`,onClick:r},t):U.createElement(`span`,null,t)},yI=[`date`,`className`],bI=function(e,t,n,r,i){return e.filter(function(e){return aI(e,t,n,r,i)})},xI=function(e){function t(){var e;aO(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=fO(this,t,[].concat(r)),e.getContainer=function(){return e.containerRef.current},e.renderWeek=function(t,n){var r=e.props,i=r.events,a=r.components,o=r.selectable,s=r.getNow,c=r.selected,l=r.date,u=r.localizer,d=r.longPressThreshold,f=r.accessors,p=r.getters,m=r.showAllEvents,h=e.state,g=h.needLimitMeasure,_=h.rowLimit,v=sI(bI(jk(i),t[0],t[t.length-1],f,u),f,u);return U.createElement(gI,{key:n,ref:n===0?e.slotRowRef:void 0,container:e.getContainer,className:`rbc-month-row`,getNow:s,date:l,range:t,events:v,maxRows:m?1/0:_,selected:c,selectable:o,components:a,accessors:f,getters:p,localizer:u,renderHeader:e.readerDateHeading,renderForMeasure:g,onShowMore:e.handleShowMore,onSelect:e.handleSelectEvent,onDoubleClick:e.handleDoubleClickEvent,onKeyPress:e.handleKeyPressEvent,onSelectSlot:e.handleSelectSlot,longPressThreshold:d,rtl:e.props.rtl,resizable:e.props.resizable,showAllEvents:m})},e.readerDateHeading=function(t){var n=t.date,r=t.className,i=iO(t,yI),a=e.props,o=a.date,s=a.getDrilldownView,c=a.localizer,l=c.neq(o,n,`month`),u=c.isSameDate(n,o),d=s(n),f=c.format(n,`dateFormat`),p=e.props.components.dateHeader||vI;return U.createElement(`div`,Object.assign({},i,{className:SO(r,l&&`rbc-off-range`,u&&`rbc-current`),role:`cell`}),U.createElement(p,{label:f,date:n,drilldownView:d,isOffRange:l,onDrillDown:function(t){return e.handleHeadingClick(n,d,t)}}))},e.handleSelectSlot=function(t,n){e._pendingSelection=e._pendingSelection.concat(t),clearTimeout(e._selectTimer),e._selectTimer=setTimeout(function(){return e.selectDates(n)})},e.handleHeadingClick=function(t,n,r){r.preventDefault(),e.clearSelection(),CF(e.props.onDrillDown,[t,n])},e.handleSelectEvent=function(){e.clearSelection();for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];CF(e.props.onSelectEvent,n)},e.handleDoubleClickEvent=function(){e.clearSelection();for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];CF(e.props.onDoubleClickEvent,n)},e.handleKeyPressEvent=function(){e.clearSelection();for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];CF(e.props.onKeyPressEvent,n)},e.handleShowMore=function(t,n,r,i,a){var o=e.props,s=o.popup,c=o.onDrillDown,l=o.onShowMore,u=o.getDrilldownView,d=o.doShowMoreDrillDown;if(e.clearSelection(),s){var f=bA(r,e.containerRef.current);e.setState({overlay:{date:n,events:t,position:f,target:a}})}else d&&CF(c,[n,u(n)||YP.DAY]);CF(l,[t,n,i])},e.overlayDisplay=function(){e.setState({overlay:null})},e.state={rowLimit:5,needLimitMeasure:!0,date:null},e.containerRef=(0,U.createRef)(),e.slotRowRef=(0,U.createRef)(),e._bgRows=[],e._pendingSelection=[],e}return mO(t,e),sO(t,[{key:`componentDidMount`,value:function(){var e=this,t;this.state.needLimitMeasure&&this.measureRowLimit(this.props),window.addEventListener(`resize`,this._resizeListener=function(){t||kA(function(){t=!1,e.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 e=this.props,t=e.date,n=e.localizer,r=e.className,i=(0,$k.default)(n.visibleDays(t,n),7);return this._weekCount=i.length,U.createElement(`div`,{className:SO(`rbc-month-view`,r),role:`table`,"aria-label":`Month View`,ref:this.containerRef},U.createElement(`div`,{className:`rbc-row rbc-month-header`,role:`row`},this.renderHeaders(i[0])),i.map(this.renderWeek),this.props.popup&&this.renderOverlay())}},{key:`renderHeaders`,value:function(e){var t=this.props,n=t.localizer,r=t.components,i=e[0],a=e[e.length-1],o=r.header||_I;return n.range(i,a,`day`).map(function(e,t){return U.createElement(`div`,{key:`header_`+t,className:`rbc-header`},U.createElement(o,{date:e,localizer:n,label:n.format(e,`weekdayFormat`)}))})}},{key:`renderOverlay`,value:function(){var e=this,t=this.state?.overlay??{},n=this.props,r=n.accessors,i=n.localizer,a=n.components,o=n.getters,s=n.selected,c=n.popupOffset,l=n.handleDragStart;return U.createElement(RF,{overlay:t,accessors:r,localizer:i,components:a,getters:o,selected:s,popupOffset:c,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:l,show:!!t.position,overlayDisplay:this.overlayDisplay,onHide:function(){return e.setState({overlay:null})}})}},{key:`measureRowLimit`,value:function(){this.setState({needLimitMeasure:!1,rowLimit:this.slotRowRef.current.getRowLimit()})}},{key:`selectDates`,value:function(e){var t=this._pendingSelection.slice();this._pendingSelection=[],t.sort(function(e,t){return e-+t});var n=new Date(t[0]),r=new Date(t[t.length-1]);r.setDate(t[t.length-1].getDate()+1),CF(this.props.onSelectSlot,{slots:t,start:n,end:r,action:e.action,bounds:e.bounds,box:e.box})}},{key:`clearSelection`,value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}}],[{key:`getDerivedStateFromProps`,value:function(e,t){var n=e.date;return{date:n,needLimitMeasure:e.localizer.neq(n,t.date,`month`)}}}])}(U.Component);xI.range=function(e,t){var n=t.localizer;return{start:n.firstVisibleDay(e,n),end:n.lastVisibleDay(e,n)}},xI.navigate=function(e,t,n){var r=n.localizer;switch(t){case JP.PREVIOUS:return r.add(e,-1,`month`);case JP.NEXT:return r.add(e,1,`month`);default:return e}},xI.title=function(e,t){return t.localizer.format(e,`monthHeaderFormat`)};var SI=function(e){var t=e.min,n=e.max,r=e.step,i=e.slots,a=e.localizer;return`${+a.startOf(t,`minutes`)}${+a.startOf(n,`minutes`)}${r}-${i}`};function CI(e){for(var t=e.min,n=e.max,r=e.step,i=e.timeslots,a=e.localizer,o=SI({start:t,end:n,step:r,timeslots:i,localizer:a}),s=1+a.getTotalMin(t,n),c=a.getMinutesFromMidnight(t),l=Math.ceil((s-1)/(r*i)),u=l*i,d=Array(l),f=Array(u),p=0;p<l;p++){d[p]=Array(i);for(var m=0;m<i;m++){var h=p*i+m,g=h*r;f[h]=d[p][m]=a.getSlotDate(t,c,g)}}var _=f.length*r;f.push(a.getSlotDate(t,c,_));function v(e){var n=a.diff(t,e,`minutes`)+a.getDstOffset(t,e);return Math.min(n,s)}return{groups:d,update:function(e){return SI(e)===o?this:CI(e)},dateIsInGroup:function(e,t){var r=d[t+1];return a.inRange(e,d[t][0],r?r[0]:n,`minutes`)},nextSlot:function(e){var t=f[Math.min(f.findIndex(function(t){return t===e||a.eq(t,e)})+1,f.length-1)];return a.eq(t,e)&&(t=a.add(e,r,`minutes`)),t},closestSlotToPosition:function(e){return f[Math.min(f.length-1,Math.max(0,Math.floor(e*u)))]},closestSlotFromPoint:function(e,t){var n=Math.abs(t.top-t.bottom);return this.closestSlotToPosition((e.y-t.top)/n)},closestSlotFromDate:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(a.lt(e,t,`minutes`))return f[0];if(a.gt(e,n,`minutes`))return f[f.length-1];var o=a.diff(t,e,`minutes`);return f[(o-o%r)/r+i]},startsBeforeDay:function(e){return a.lt(e,t,`day`)},startsAfterDay:function(e){return a.gt(e,n,`day`)},startsBefore:function(e){return a.lt(a.merge(t,e),t,`minutes`)},startsAfter:function(e){return a.gt(a.merge(n,e),n,`minutes`)},getRange:function(e,i,o,s){o||(e=a.min(n,a.max(t,e))),s||(i=a.min(n,a.max(t,i)));var c=v(e),l=v(i),d=l>r*u&&!a.eq(n,i)?(c-r)/(r*u)*100:c/(r*u)*100;return{top:d,height:l/(r*u)*100-d,start:v(e),startDate:e,end:v(i),endDate:i}},getCurrentTimePosition:function(e){return v(e)/(r*u)*100}}}var wI=function(){function e(t,n){var r=n.accessors,i=n.slotMetrics;aO(this,e);var a=i.getRange(r.start(t),r.end(t)),o=a.start,s=a.startDate,c=a.end,l=a.endDate,u=a.top,d=a.height;this.start=o,this.end=c,this.startMs=+s,this.endMs=+l,this.top=u,this.height=d,this.data=t}return sO(e,[{key:`_width`,get:function(){return this.rows?100/(this.rows.reduce(function(e,t){return Math.max(e,t.leaves.length+1)},0)+1):this.leaves?(100-this.container._width)/(this.leaves.length+1):this.row._width}},{key:`width`,get:function(){var e=this._width,t=Math.min(100,this._width*1.7);if(this.rows)return t;if(this.leaves)return this.leaves.length>0?t:e;var n=this.row.leaves;return n.indexOf(this)===n.length-1?e:t}},{key:`xOffset`,get:function(){if(this.rows)return 0;if(this.leaves)return this.container._width;var e=this.row,t=e.leaves,n=e.xOffset,r=e._width;return n+(t.indexOf(this)+1)*r}}])}();function TI(e,t,n){return Math.abs(t.start-e.start)<n||t.start>e.start&&t.start<e.end}function EI(e){for(var t=(0,qN.default)(e,[`startMs`,function(e){return-e.endMs}]),n=[];t.length>0;){var r=t.shift();n.push(r);for(var i=0;i<t.length;i++){var a=t[i];if(!(r.endMs>a.startMs)){if(i>0){var o=t.splice(i,1)[0];n.push(o)}break}}}return n}function DI(e){for(var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,i=e.accessors,a=EI(t.map(function(e){return new wI(e,{slotMetrics:r,accessors:i})})),o=[],s=function(){var e=a[c],t=o.find(function(t){return t.end>e.start||Math.abs(e.start-t.start)<n});if(!t)return e.rows=[],o.push(e),1;e.container=t;for(var r=null,i=t.rows.length-1;!r&&i>=0;i--)TI(t.rows[i],e,n)&&(r=t.rows[i]);r?(r.leaves.push(e),e.row=r):(e.leaves=[],t.rows.push(e))},c=0;c<a.length;c++)if(s())continue;return a.map(function(e){return{event:e.data,style:{top:e.top,height:e.height,width:e.width,xOffset:Math.max(0,e.xOffset)}}})}function OI(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 i=OI(e.friends[r],t,n);t=t>i?t:i}return t}function kI(e){var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,i=e.accessors,a=DI({events:t,minimumStartDifference:n,slotMetrics:r,accessors:i});a.sort(function(e,t){return e=e.style,t=t.style,e.top===t.top?e.height===t.height?0:e.top+e.height<t.top+t.height?1:-1:e.top>t.top?1:-1});for(var o=0;o<a.length;++o)a[o].friends=[],delete a[o].style.left,delete a[o].style.left,delete a[o].idx,delete a[o].size;for(var s=0;s<a.length-1;++s)for(var c=a[s],l=c.style.top,u=c.style.top+c.style.height,d=s+1;d<a.length;++d){var f=a[d],p=f.style.top,m=f.style.top+f.style.height;(p>=l&&m<=u||m>l&&m<=u||p>=l&&p<u)&&(c.friends.push(f),f.friends.push(c))}for(var h=0;h<a.length;++h){for(var g=a[h],_=[],v=0;v<100;++v)_.push(1);for(var y=0;y<g.friends.length;++y)g.friends[y].idx!==void 0&&(_[g.friends[y].idx]=0);g.idx=_.indexOf(1)}for(var b=0;b<a.length;++b){var x=0;if(!a[b].size){var S=[];x=100/(OI(a[b],0,S)+1),a[b].size=x;for(var C=0;C<S.length;++C)S[C].size=x}}for(var w=0;w<a.length;++w){var T=a[w];T.style.left=T.idx*T.size;for(var E=0,D=0;D<T.friends.length;++D){var O=T.friends[D].idx;E=E>O?E:O}E<=T.idx&&(T.size=100-T.idx*T.size);var k=T.idx===0?0:3;T.style.width=`calc(${T.size}% - ${k}px)`,T.style.height=`calc(${T.style.height}% - 2px)`,T.style.xOffset=`calc(${T.style.left}% + ${k}px)`}return a}var AI={overlap:DI,"no-overlap":kI};function jI(e){return!!(e&&e.constructor&&e.call&&e.apply)}function MI(e){e.events,e.minimumStartDifference,e.slotMetrics,e.accessors;var t=e.dayLayoutAlgorithm,n=t;return t in AI&&(n=AI[t]),jI(n)?n.apply(this,arguments):[]}var NI=function(e){function t(){return aO(this,t),fO(this,t,arguments)}return mO(t,e),sO(t,[{key:`render`,value:function(){var e=this.props,t=e.renderSlot,n=e.resource,r=e.group,i=e.getters,a=e.components,o=(a===void 0?{}:a).timeSlotWrapper,s=o===void 0?qP:o,c=i?i.slotGroupProp(r):{};return U.createElement(`div`,Object.assign({className:`rbc-timeslot-group`},c),r.map(function(e,r){var a=i?i.slotProp(e,n):{};return U.createElement(s,{key:r,value:e,resource:n},U.createElement(`div`,Object.assign({},a,{className:SO(`rbc-time-slot`,a.className)}),t&&t(e,r)))}))}}])}(U.Component);function PI(e){return typeof e==`string`?e:e+`%`}function FI(e){var t=e.style,n=e.className,r=e.event,i=e.accessors,a=e.rtl,o=e.selected,s=e.label,c=e.continuesPrior,l=e.continuesAfter,u=e.getters,d=e.onClick,f=e.onDoubleClick,p=e.isBackgroundEvent,m=e.onKeyPress,h=e.components,g=h.event,_=h.eventWrapper,v=i.title(r),y=i.tooltip(r),b=i.end(r),x=i.start(r),S=u.eventProp(r,x,b,o),C=[U.createElement(`div`,{key:`1`,className:`rbc-event-label`},s),U.createElement(`div`,{key:`2`,className:`rbc-event-content`},g?U.createElement(g,{event:r,title:v}):v)],w=t.height,T=t.top,E=t.width,D=t.xOffset,O=nO(nO({},S.style),{},eO({top:PI(T),height:PI(w),width:PI(E)},a?`right`:`left`,PI(D)));return U.createElement(_,Object.assign({type:`time`},e),U.createElement(`div`,{role:`button`,tabIndex:0,onClick:d,onDoubleClick:f,style:O,onKeyDown:m,title:y?(typeof s==`string`?s+`: `:``)+y:void 0,className:SO(p?`rbc-background-event`:`rbc-event`,n,S.className,{"rbc-selected":o,"rbc-event-continues-earlier":c,"rbc-event-continues-later":l})},C))}var II=function(e){var t=e.children,n=e.className,r=e.style,i=e.innerRef;return U.createElement(`div`,{className:n,style:r,ref:i},t)},LI=U.forwardRef(function(e,t){return U.createElement(II,Object.assign({},e,{innerRef:t}))}),RI=[`dayProp`],zI=[`eventContainerWrapper`,`timeIndicatorWrapper`],BI=function(e){function t(){var e;aO(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=fO(this,t,[].concat(r)),e.state={selecting:!1,timeIndicatorPosition:null},e.intervalTriggered=!1,e.renderEvents=function(t){var n=t.events,r=t.isBackgroundEvent,i=e.props,a=i.rtl,o=i.selected,s=i.accessors,c=i.localizer,l=i.getters,u=i.components,d=i.step,f=i.timeslots,p=i.dayLayoutAlgorithm,m=i.resizable,h=e.slotMetrics,g=c.messages;return MI({events:n,accessors:s,slotMetrics:h,minimumStartDifference:Math.ceil(d*f/2),dayLayoutAlgorithm:p}).map(function(t,n){var i=t.event,d=t.style,f=s.end(i),p=s.start(i),_=s.eventId(i)??`evt_`+n,v=`eventTimeRangeFormat`,y,b=h.startsBeforeDay(p),x=h.startsAfterDay(f);b?v=`eventTimeRangeEndFormat`:x&&(v=`eventTimeRangeStartFormat`),y=b&&x?g.allDay:c.format({start:p,end:f},v);var S=b||h.startsBefore(p),C=x||h.startsAfter(f);return U.createElement(FI,{style:d,event:i,label:y,key:_,getters:l,rtl:a,components:u,continuesPrior:S,continuesAfter:C,accessors:s,resource:e.props.resource,selected:kF(i,o),onClick:function(t){return e._select(nO(nO(nO({},i),e.props.resource&&{sourceResource:e.props.resource}),r&&{isBackgroundEvent:!0}),t)},onDoubleClick:function(t){return e._doubleClick(i,t)},isBackgroundEvent:r,onKeyPress:function(t){return e._keyPress(i,t)},resizable:m})})},e._selectable=function(){var t=e.containerRef.current,n=e.props,r=n.longPressThreshold,i=n.localizer,a=e._selector=new JF(function(){return t},{longPressThreshold:r}),o=function(t){var n=e.props.onSelecting,r=e.state||{},a=s(t),o=a.startDate,c=a.endDate;n&&(i.eq(r.startDate,o,`minutes`)&&i.eq(r.endDate,c,`minutes`)||n({start:o,end:c,resourceId:e.props.resource})===!1)||(e.state.start!==a.start||e.state.end!==a.end||e.state.selecting!==a.selecting)&&e.setState(a)},s=function(n){var r=e.slotMetrics.closestSlotFromPoint(n,ZF(t));e.state.selecting||(e._initialSlot=r);var a=e._initialSlot;i.lte(a,r)?r=e.slotMetrics.nextSlot(r):i.gt(a,r)&&(a=e.slotMetrics.nextSlot(a));var o=e.slotMetrics.getRange(i.min(a,r),i.max(a,r));return nO(nO({},o),{},{selecting:!0,top:`${o.top}%`,height:`${o.height}%`})},c=function(t,n){if(!UF(e.containerRef.current,t)){var r=s(t),i=r.startDate,a=r.endDate;e._selectSlot({startDate:i,endDate:a,action:n,box:t})}e.setState({selecting:!1})};a.on(`selecting`,o),a.on(`selectStart`,o),a.on(`beforeSelect`,function(t){if(e.props.selectable===`ignoreEvents`)return!UF(e.containerRef.current,t)}),a.on(`click`,function(e){return c(e,`click`)}),a.on(`doubleClick`,function(e){return c(e,`doubleClick`)}),a.on(`select`,function(t){e.state.selecting&&(e._selectSlot(nO(nO({},e.state),{},{action:`select`,bounds:t})),e.setState({selecting:!1}))}),a.on(`reset`,function(){e.state.selecting&&e.setState({selecting:!1})})},e._teardownSelectable=function(){e._selector&&(e._selector.teardown(),e._selector=null)},e._selectSlot=function(t){for(var n=t.startDate,r=t.endDate,i=t.action,a=t.bounds,o=t.box,s=n,c=[];e.props.localizer.lte(s,r);)c.push(s),s=new Date(+s+e.props.step*60*1e3);CF(e.props.onSelectSlot,{slots:c,start:n,end:r,resourceId:e.props.resource,action:i,bounds:a,box:o})},e._select=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];CF(e.props.onSelectEvent,n)},e._doubleClick=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];CF(e.props.onDoubleClickEvent,n)},e._keyPress=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];CF(e.props.onKeyPressEvent,n)},e.slotMetrics=CI(e.props),e.containerRef=(0,U.createRef)(),e}return mO(t,e),sO(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(e,t){this.props.selectable&&!e.selectable&&this._selectable(),!this.props.selectable&&e.selectable&&this._teardownSelectable();var n=this.props,r=n.getNow,i=n.isNow,a=n.localizer,o=n.date,s=n.min,c=n.max,l=a.neq(e.getNow(),r(),`minutes`);if(e.isNow!==i||l){if(this.clearTimeIndicatorInterval(),i){var u=!l&&a.eq(e.date,o,`minutes`)&&t.timeIndicatorPosition===this.state.timeIndicatorPosition;this.setTimeIndicatorPositionUpdateInterval(u)}}else i&&(a.neq(e.min,s,`minutes`)||a.neq(e.max,c,`minutes`))&&this.positionTimeIndicator()}},{key:`setTimeIndicatorPositionUpdateInterval`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;!this.intervalTriggered&&!t&&this.positionTimeIndicator(),this._timeIndicatorTimeout=window.setTimeout(function(){e.intervalTriggered=!0,e.positionTimeIndicator(),e.setTimeIndicatorPositionUpdateInterval()},6e4)}},{key:`clearTimeIndicatorInterval`,value:function(){this.intervalTriggered=!1,window.clearTimeout(this._timeIndicatorTimeout)}},{key:`positionTimeIndicator`,value:function(){var e=this.props,t=e.min,n=e.max,r=e.getNow,i=r();if(i>=t&&i<=n){var a=this.slotMetrics.getCurrentTimePosition(i);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:a})}else this.clearTimeIndicatorInterval()}},{key:`render`,value:function(){var e=this.props,t=e.date,n=e.max,r=e.rtl,i=e.isNow,a=e.resource,o=e.accessors,s=e.localizer,c=e.getters,l=c.dayProp,u=iO(c,RI),d=e.components,f=d.eventContainerWrapper,p=d.timeIndicatorWrapper,m=iO(d,zI);this.slotMetrics=this.slotMetrics.update(this.props);var h=this.slotMetrics,g=this.state,_=g.selecting,v=g.top,y=g.height,b={start:g.startDate,end:g.endDate},x=l(n,a),S=x.className,C=x.style,w={className:`rbc-current-time-indicator`,style:{top:`${this.state.timeIndicatorPosition}%`}},T=m.dayColumnWrapper||LI;return U.createElement(T,{ref:this.containerRef,date:t,style:C,className:SO(S,`rbc-day-slot`,`rbc-time-column`,i&&`rbc-now`,i&&`rbc-today`,_&&`rbc-slot-selecting`),slotMetrics:h,resource:a},h.groups.map(function(e,t){return U.createElement(NI,{key:t,group:e,resource:a,getters:u,components:m})}),U.createElement(f,{localizer:s,resource:a,accessors:o,getters:u,components:m,slotMetrics:h},U.createElement(`div`,{className:SO(`rbc-events-container`,r&&`rtl`)},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),_&&U.createElement(`div`,{className:`rbc-slot-selection`,style:{top:v,height:y}},U.createElement(`span`,null,s.format(b,`selectRangeFormat`))),i&&this.intervalTriggered&&U.createElement(p,w,U.createElement(`div`,w)))}}])}(U.Component);BI.defaultProps={dragThroughEvents:!0,timeslots:2};var VI=function(e){var t=e.label;return U.createElement(U.Fragment,null,t)},HI=function(e){function t(){var e;aO(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=fO(this,t,[].concat(r)),e.handleHeaderClick=function(t,n,r){r.preventDefault(),CF(e.props.onDrillDown,[t,n])},e.renderRow=function(t){var n=e.props,r=n.events,i=n.rtl,a=n.selectable,o=n.getNow,s=n.range,c=n.getters,l=n.localizer,u=n.accessors,d=n.components,f=n.resizable,p=u.resourceId(t),m=t?r.filter(function(e){return u.resource(e)===p}):r;return U.createElement(gI,{isAllDay:!0,rtl:i,getNow:o,minRows:2,maxRows:e.props.allDayMaxRows+1,range:s,events:m,resourceId:p,className:`rbc-allday-cell`,selectable:a,selected:e.props.selected,components:d,accessors:u,getters:c,localizer:l,onSelect:e.props.onSelectEvent,onShowMore:e.props.onShowMore,onDoubleClick:e.props.onDoubleClickEvent,onKeyPress:e.props.onKeyPressEvent,onSelectSlot:e.props.onSelectSlot,longPressThreshold:e.props.longPressThreshold,resizable:f})},e}return mO(t,e),sO(t,[{key:`renderHeaderCells`,value:function(e){var t=this,n=this.props,r=n.localizer,i=n.getDrilldownView,a=n.getNow,o=n.getters.dayProp,s=n.components.header,c=s===void 0?_I:s,l=a();return e.map(function(e,n){var a=i(e),s=r.format(e,`dayFormat`),u=o(e),d=u.className,f=u.style,p=U.createElement(c,{date:e,label:s,localizer:r});return U.createElement(`div`,{key:n,style:f,className:SO(`rbc-header`,d,r.isSameDate(e,l)&&`rbc-today`)},a?U.createElement(`button`,{type:`button`,className:`rbc-button-link`,onClick:function(n){return t.handleHeaderClick(e,a,n)}},p):U.createElement(`span`,null,p))})}},{key:`render`,value:function(){var e=this,t=this.props,n=t.width,r=t.rtl,i=t.resources,a=t.range,o=t.events,s=t.getNow,c=t.accessors,l=t.selectable,u=t.components,d=t.getters,f=t.scrollRef,p=t.localizer,m=t.isOverflowing,h=t.components,g=h.timeGutterHeader,_=h.resourceHeader,v=_===void 0?VI:_,y=t.resizable,b={};m&&(b[r?`marginLeft`:`marginRight`]=`${mj()-1}px`);var x=i.groupEvents(o);return U.createElement(`div`,{style:b,ref:f,className:SO(`rbc-time-header`,m&&`rbc-overflowing`)},U.createElement(`div`,{className:`rbc-label rbc-time-header-gutter`,style:{width:n,minWidth:n,maxWidth:n}},g&&U.createElement(g,null)),i.map(function(t,n){var i=bO(t,2),o=i[0],f=i[1];return U.createElement(`div`,{className:`rbc-time-header-content`,key:o||n},f&&U.createElement(`div`,{className:`rbc-row rbc-row-resource`,key:`resource_${n}`},U.createElement(`div`,{className:`rbc-header`},U.createElement(v,{index:n,label:c.resourceTitle(f),resource:f}))),U.createElement(`div`,{className:`rbc-row rbc-time-header-cell${a.length<=1?` rbc-time-header-cell-single-day`:``}`},e.renderHeaderCells(a)),U.createElement(gI,{isAllDay:!0,rtl:r,getNow:s,minRows:2,maxRows:e.props.allDayMaxRows+1,range:a,events:x.get(o)||[],resourceId:f&&o,className:`rbc-allday-cell`,selectable:l,selected:e.props.selected,components:u,accessors:c,getters:d,localizer:p,onSelect:e.props.onSelectEvent,onShowMore:e.props.onShowMore,onDoubleClick:e.props.onDoubleClickEvent,onKeyDown:e.props.onKeyPressEvent,onSelectSlot:e.props.onSelectSlot,longPressThreshold:e.props.longPressThreshold,resizable:y}))}))}}])}(U.Component),UI=function(e){function t(){var e;aO(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=fO(this,t,[].concat(r)),e.handleHeaderClick=function(t,n,r){r.preventDefault(),CF(e.props.onDrillDown,[t,n])},e}return mO(t,e),sO(t,[{key:`renderHeaderCells`,value:function(e){var t=this,n=this.props,r=n.localizer,i=n.getDrilldownView,a=n.getNow,o=n.getters.dayProp,s=n.components,c=s.header,l=c===void 0?_I:c,u=s.resourceHeader,d=u===void 0?VI:u,f=n.resources,p=n.accessors,m=n.events,h=n.rtl,g=n.selectable,_=n.components,v=n.getters,y=n.resizable,b=a(),x=f.groupEvents(m);return e.map(function(n,s){var c=i(n),u=r.format(n,`dayFormat`),m=o(n),S=m.className,C=m.style,w=U.createElement(l,{date:n,label:u,localizer:r});return U.createElement(`div`,{key:s,className:`rbc-time-header-content rbc-resource-grouping`},U.createElement(`div`,{className:`rbc-row rbc-time-header-cell${e.length<=1?` rbc-time-header-cell-single-day`:``}`},U.createElement(`div`,{style:C,className:SO(`rbc-header`,S,r.isSameDate(n,b)&&`rbc-today`)},c?U.createElement(`button`,{type:`button`,className:`rbc-button-link`,onClick:function(e){return t.handleHeaderClick(n,c,e)}},w):U.createElement(`span`,null,w))),U.createElement(`div`,{className:`rbc-row`},f.map(function(e,t){var i=bO(e,2),a=i[0],o=i[1];return U.createElement(`div`,{key:`resource_${a}_${t}`,className:SO(`rbc-header`,S,r.isSameDate(n,b)&&`rbc-today`)},U.createElement(d,{index:t,label:p.resourceTitle(o),resource:o}))})),U.createElement(`div`,{className:`rbc-row rbc-m-b-negative-3 rbc-h-full`},f.map(function(e,i){var o=bO(e,2),s=o[0],c=o[1],l=(x.get(s)||[]).filter(function(e){return r.isSameDate(e.start,n)||r.isSameDate(e.end,n)});return U.createElement(gI,{key:`resource_${s}_${i}`,isAllDay:!0,rtl:h,getNow:a,minRows:2,maxRows:t.props.allDayMaxRows+1,range:[n],events:l,resourceId:c&&s,className:`rbc-allday-cell`,selectable:g,selected:t.props.selected,components:_,accessors:p,getters:v,localizer:r,onSelect:t.props.onSelectEvent,onShowMore:t.props.onShowMore,onDoubleClick:t.props.onDoubleClickEvent,onKeyDown:t.props.onKeyPressEvent,onSelectSlot:t.props.onSelectSlot,longPressThreshold:t.props.longPressThreshold,resizable:y})})))})}},{key:`render`,value:function(){var e=this.props,t=e.width,n=e.rtl,r=e.range,i=e.scrollRef,a=e.isOverflowing,o=e.components.timeGutterHeader,s={};return a&&(s[n?`marginLeft`:`marginRight`]=`${mj()-1}px`),U.createElement(`div`,{style:s,ref:i,className:SO(`rbc-time-header`,a&&`rbc-overflowing`)},U.createElement(`div`,{className:`rbc-label rbc-time-header-gutter`,style:{width:t,minWidth:t,maxWidth:t}},o&&U.createElement(o,null)),this.renderHeaderCells(r))}}])}(U.Component);function WI(e){var t=e.min,n=e.max,r=e.localizer;return r.getTimezoneOffset(t)===r.getTimezoneOffset(n)?{start:t,end:n}:{start:r.add(t,-1,`day`),end:r.add(n,-1,`day`)}}var GI=function(e){var t=e.min,n=e.max,r=e.timeslots,i=e.step,a=e.localizer,o=e.getNow,s=e.resource,c=e.components,l=e.getters,u=e.gutterRef,d=c.timeGutterWrapper,f=(0,U.useMemo)(function(){return WI({min:t,max:n,localizer:a})},[t?.toISOString(),n?.toISOString(),a]),p=f.start,m=f.end,h=bO((0,U.useState)(CI({min:p,max:m,timeslots:r,step:i,localizer:a})),2),g=h[0],_=h[1];(0,U.useEffect)(function(){g&&_(g.update({min:p,max:m,timeslots:r,step:i,localizer:a}))},[p?.toISOString(),m?.toISOString(),r,i]);var v=(0,U.useCallback)(function(e,t){if(t)return null;var n=g.dateIsInGroup(o(),t);return U.createElement(`span`,{className:SO(`rbc-label`,n&&`rbc-now`)},a.format(e,`timeGutterFormat`))},[g,a,o]);return U.createElement(d,{slotMetrics:g},U.createElement(`div`,{className:`rbc-time-gutter rbc-time-column`,ref:u},g.groups.map(function(e,t){return U.createElement(NI,{key:t,group:e,resource:s,components:c,renderSlot:v,getters:l})})))},KI=U.forwardRef(function(e,t){return U.createElement(GI,Object.assign({gutterRef:t},e))}),qI={};function JI(e,t){return{map:function(n){return e?e.map(function(e,r){return n([t.resourceId(e),e],r)}):[n([qI,null],0)]},groupEvents:function(n){var r=new Map;return e?(n.forEach(function(e){var n=t.resource(e)||qI;if(Array.isArray(n))n.forEach(function(t){var n=r.get(t)||[];n.push(e),r.set(t,n)});else{var i=r.get(n)||[];i.push(e),r.set(n,i)}}),r):(r.set(qI,n),r)}}}var YI=function(e){function t(e){var n;return aO(this,t),n=fO(this,t,[e]),n.handleScroll=function(e){n.scrollRef.current&&(n.scrollRef.current.scrollLeft=e.target.scrollLeft)},n.handleResize=function(){OA(n.rafHandle),n.rafHandle=kA(n.checkOverflow)},n.handleKeyPressEvent=function(){n.clearSelection();for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];CF(n.props.onKeyPressEvent,t)},n.handleSelectEvent=function(){n.clearSelection();for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];CF(n.props.onSelectEvent,t)},n.handleDoubleClickEvent=function(){n.clearSelection();for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];CF(n.props.onDoubleClickEvent,t)},n.handleShowMore=function(e,t,r,i,a){var o=n.props,s=o.popup,c=o.onDrillDown,l=o.onShowMore,u=o.getDrilldownView,d=o.doShowMoreDrillDown;if(n.clearSelection(),s){var f=bA(r,n.containerRef.current);n.setState({overlay:{date:t,events:e,position:nO(nO({},f),{},{width:`200px`}),target:a}})}else d&&CF(c,[t,u(t)||YP.DAY]);CF(l,[e,t,i])},n.handleSelectAllDaySlot=function(e,t){var r=n.props.onSelectSlot,i=new Date(e[0]),a=new Date(e[e.length-1]);a.setDate(e[e.length-1].getDate()+1),CF(r,{slots:e,start:i,end:a,action:t.action,resourceId:t.resourceId})},n.overlayDisplay=function(){n.setState({overlay:null})},n.checkOverflow=function(){if(!n._updatingOverflow){var e=n.contentRef.current;if(e!=null&&e.scrollHeight){var t=e.scrollHeight>e.clientHeight;n.state.isOverflowing!==t&&(n._updatingOverflow=!0,n.setState({isOverflowing:t},function(){n._updatingOverflow=!1}))}}},n.memoizedResources=TN(function(e,t){return JI(e,t)}),n.state={gutterWidth:void 0,isOverflowing:null},n.scrollRef=U.createRef(),n.contentRef=U.createRef(),n.containerRef=U.createRef(),n._scrollRatio=null,n.gutterRef=(0,U.createRef)(),n}return mO(t,e),sO(t,[{key:`getSnapshotBeforeUpdate`,value:function(){return this.checkOverflow(),null}},{key:`componentDidMount`,value:function(){this.props.width??this.measureGutter(),this.calculateScroll(),this.applyScroll(),window.addEventListener(`resize`,this.handleResize)}},{key:`componentWillUnmount`,value:function(){window.removeEventListener(`resize`,this.handleResize),OA(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)}},{key:`componentDidUpdate`,value:function(){this.applyScroll()}},{key:`renderDayColumn`,value:function(e,t,n,r,i,a,o,s,c,l){var u=this.props,d=u.min,f=u.max,p=(r.get(t)||[]).filter(function(t){return a.inRange(e,o.start(t),o.end(t),`day`)}),m=(i.get(t)||[]).filter(function(t){return a.inRange(e,o.start(t),o.end(t),`day`)});return U.createElement(BI,Object.assign({},this.props,{localizer:a,min:a.merge(e,d),max:a.merge(e,f),resource:n&&t,components:s,isNow:a.isSameDate(e,l),key:`${t}-${e}`,date:e,events:p,backgroundEvents:m,dayLayoutAlgorithm:c}))}},{key:`renderResourcesFirst`,value:function(e,t,n,r,i,a,o,s,c){var l=this;return t.map(function(t){var u=bO(t,2),d=u[0],f=u[1];return e.map(function(e){return l.renderDayColumn(e,d,f,n,r,i,a,s,c,o)})})}},{key:`renderRangeFirst`,value:function(e,t,n,r,i,a,o,s,c){var l=this;return e.map(function(e){return U.createElement(`div`,{style:{display:`flex`,minHeight:`100%`,flex:1},key:e},t.map(function(t){var u=bO(t,2),d=u[0],f=u[1];return U.createElement(`div`,{style:{flex:1},key:a.resourceId(f)},l.renderDayColumn(e,d,f,n,r,i,a,s,c,o))}))})}},{key:`renderEvents`,value:function(e,t,n,r){var i=this.props,a=i.accessors,o=i.localizer,s=i.resourceGroupingLayout,c=i.components,l=i.dayLayoutAlgorithm,u=this.memoizedResources(this.props.resources,a),d=u.groupEvents(t),f=u.groupEvents(n);return s?this.renderRangeFirst(e,u,d,f,o,a,r,c,l):this.renderResourcesFirst(e,u,d,f,o,a,r,c,l)}},{key:`render`,value:function(){var e=this.props,t=e.events,n=e.backgroundEvents,r=e.range,i=e.width,a=e.rtl,o=e.selected,s=e.getNow,c=e.resources,l=e.components,u=e.accessors,d=e.getters,f=e.localizer,p=e.min,m=e.max,h=e.showMultiDayTimes,g=e.longPressThreshold,_=e.resizable,v=e.resourceGroupingLayout;i||=this.state.gutterWidth;var y=r[0],b=r[r.length-1];this.slots=r.length;var x=[],S=[],C=[];t.forEach(function(e){if(aI(e,y,b,u,f)){var t=u.start(e),n=u.end(e);u.allDay(e)||f.startAndEndAreDateOnly(t,n)||!h&&!f.isSameDate(t,n)?x.push(e):S.push(e)}}),n.forEach(function(e){aI(e,y,b,u,f)&&C.push(e)}),x.sort(function(e,t){return cI(e,t,u,f)});var w={range:r,events:x,width:i,rtl:a,getNow:s,localizer:f,selected:o,allDayMaxRows:this.props.showAllEvents?1/0:this.props.allDayMaxRows??1/0,resources:this.memoizedResources(c,u),selectable:this.props.selectable,accessors:u,getters:d,components:l,scrollRef:this.scrollRef,isOverflowing:this.state.isOverflowing,longPressThreshold:g,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:_};return U.createElement(`div`,{className:SO(`rbc-time-view`,c&&`rbc-time-view-resources`),ref:this.containerRef},c&&c.length>1&&v?U.createElement(UI,w):U.createElement(HI,w),this.props.popup&&this.renderOverlay(),U.createElement(`div`,{ref:this.contentRef,className:`rbc-time-content`,onScroll:this.handleScroll},U.createElement(KI,{date:y,ref:this.gutterRef,localizer:f,min:f.merge(y,p),max:f.merge(y,m),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:l,className:`rbc-time-gutter`,getters:d}),this.renderEvents(r,S,C,s())))}},{key:`renderOverlay`,value:function(){var e=this,t=this.state?.overlay??{},n=this.props,r=n.accessors,i=n.localizer,a=n.components,o=n.getters,s=n.selected,c=n.popupOffset,l=n.handleDragStart;return U.createElement(RF,{overlay:t,accessors:r,localizer:i,components:a,getters:o,selected:s,popupOffset:c,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:l,show:!!t.position,overlayDisplay:this.overlayDisplay,onHide:function(){return e.setState({overlay:null})}})}},{key:`clearSelection`,value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}},{key:`measureGutter`,value:function(){var e=this;this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest),this.measureGutterAnimationFrameRequest=window.requestAnimationFrame(function(){var t,n=(t=e.gutterRef)!=null&&t.current?EN(e.gutterRef.current):void 0;n&&e.state.gutterWidth!==n&&e.setState({gutterWidth:n})})}},{key:`applyScroll`,value:function(){if(this._scrollRatio!=null&&this.props.enableAutoScroll===!0){var e=this.contentRef.current;e.scrollTop=e.scrollHeight*this._scrollRatio,this._scrollRatio=null}}},{key:`calculateScroll`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,t=e.min,n=e.max,r=e.scrollToTime,i=e.localizer;this._scrollRatio=i.diff(i.merge(r,t),r,`milliseconds`)/i.diff(t,n,`milliseconds`)}}])}(U.Component);YI.defaultProps={step:30,timeslots:2,resourceGroupingLayout:!1};var XI=[`date`,`localizer`,`min`,`max`,`scrollToTime`,`enableAutoScroll`],ZI=function(e){function t(){return aO(this,t),fO(this,t,arguments)}return mO(t,e),sO(t,[{key:`render`,value:function(){var e=this.props,n=e.date,r=e.localizer,i=e.min,a=i===void 0?r.startOf(new Date,`day`):i,o=e.max,s=o===void 0?r.endOf(new Date,`day`):o,c=e.scrollToTime,l=c===void 0?r.startOf(new Date,`day`):c,u=e.enableAutoScroll,d=u===void 0?!0:u,f=iO(e,XI),p=t.range(n,{localizer:r});return U.createElement(YI,Object.assign({},f,{range:p,eventOffset:10,localizer:r,min:a,max:s,scrollToTime:l,enableAutoScroll:d}))}}])}(U.Component);ZI.range=function(e,t){return[t.localizer.startOf(e,`day`)]},ZI.navigate=function(e,t,n){var r=n.localizer;switch(t){case JP.PREVIOUS:return r.add(e,-1,`day`);case JP.NEXT:return r.add(e,1,`day`);default:return e}},ZI.title=function(e,t){return t.localizer.format(e,`dayHeaderFormat`)};var QI=[`date`,`localizer`,`min`,`max`,`scrollToTime`,`enableAutoScroll`],$I=function(e){function t(){return aO(this,t),fO(this,t,arguments)}return mO(t,e),sO(t,[{key:`render`,value:function(){var e=this.props,n=e.date,r=e.localizer,i=e.min,a=i===void 0?r.startOf(new Date,`day`):i,o=e.max,s=o===void 0?r.endOf(new Date,`day`):o,c=e.scrollToTime,l=c===void 0?r.startOf(new Date,`day`):c,u=e.enableAutoScroll,d=u===void 0?!0:u,f=iO(e,QI),p=t.range(n,this.props);return U.createElement(YI,Object.assign({},f,{range:p,eventOffset:15,localizer:r,min:a,max:s,scrollToTime:l,enableAutoScroll:d}))}}])}(U.Component);$I.defaultProps=YI.defaultProps,$I.navigate=function(e,t,n){var r=n.localizer;switch(t){case JP.PREVIOUS:return r.add(e,-1,`week`);case JP.NEXT:return r.add(e,1,`week`);default:return e}},$I.range=function(e,t){var n=t.localizer,r=n.startOfWeek(),i=n.startOf(e,`week`,r),a=n.endOf(e,`week`,r);return n.range(i,a)},$I.title=function(e,t){var n=t.localizer,r=JN($I.range(e,{localizer:n})),i=r[0],a=r.slice(1);return n.format({start:i,end:a.pop()},`dayRangeHeaderFormat`)};var eL=[`date`,`localizer`,`min`,`max`,`scrollToTime`,`enableAutoScroll`];function tL(e,t){return $I.range(e,t).filter(function(e){return[6,0].indexOf(e.getDay())===-1})}var nL=function(e){function t(){return aO(this,t),fO(this,t,arguments)}return mO(t,e),sO(t,[{key:`render`,value:function(){var e=this.props,t=e.date,n=e.localizer,r=e.min,i=r===void 0?n.startOf(new Date,`day`):r,a=e.max,o=a===void 0?n.endOf(new Date,`day`):a,s=e.scrollToTime,c=s===void 0?n.startOf(new Date,`day`):s,l=e.enableAutoScroll,u=l===void 0?!0:l,d=iO(e,eL),f=tL(t,this.props);return U.createElement(YI,Object.assign({},d,{range:f,eventOffset:15,localizer:n,min:i,max:o,scrollToTime:c,enableAutoScroll:u}))}}])}(U.Component);nL.defaultProps=YI.defaultProps,nL.range=tL,nL.navigate=$I.navigate,nL.title=function(e,t){var n=t.localizer,r=JN(tL(e,{localizer:n})),i=r[0],a=r.slice(1);return n.format({start:i,end:a.pop()},`dayRangeHeaderFormat`)};var rL=30;function iL(e){var t=e.accessors,n=e.components,r=e.date,i=e.events,a=e.getters,o=e.length,s=o===void 0?rL:o,c=e.localizer,l=e.onDoubleClickEvent,u=e.onSelectEvent,d=e.selected,f=(0,U.useRef)(null),p=(0,U.useRef)(null),m=(0,U.useRef)(null),h=(0,U.useRef)(null),g=(0,U.useRef)(null);(0,U.useEffect)(function(){y()});var _=function(e,r,i){var o=n.event,s=n.date;return r=r.filter(function(n){return aI(n,c.startOf(e,`day`),c.endOf(e,`day`),t,c)}),r.map(function(n,f){var p=t.title(n),m=t.end(n),h=t.start(n),g=a.eventProp(n,h,m,kF(n,d)),_=f===0&&c.format(e,`agendaDateFormat`),y=f===0?U.createElement(`td`,{rowSpan:r.length,className:`rbc-agenda-date-cell`},s?U.createElement(s,{day:e,label:_}):_):!1;return U.createElement(`tr`,{key:i+`_`+f,className:g.className,style:g.style},y,U.createElement(`td`,{className:`rbc-agenda-time-cell`},v(e,n)),U.createElement(`td`,{className:`rbc-agenda-event-cell`,onClick:function(e){return u&&u(n,e)},onDoubleClick:function(e){return l&&l(n,e)}},o?U.createElement(o,{event:n,title:p}):p))},[])},v=function(e,r){var i=``,a=n.time,o=c.messages.allDay,s=t.end(r),l=t.start(r);return t.allDay(r)||(c.eq(l,s)?o=c.format(l,`agendaTimeFormat`):c.isSameDate(l,s)?o=c.format({start:l,end:s},`agendaTimeRangeFormat`):c.isSameDate(e,l)?o=c.format(l,`agendaTimeFormat`):c.isSameDate(e,s)&&(o=c.format(s,`agendaTimeFormat`))),c.gt(e,l,`day`)&&(i=`rbc-continues-prior`),c.lt(e,s,`day`)&&(i+=` rbc-continues-after`),U.createElement(`span`,{className:i.trim()},a?U.createElement(a,{event:r,day:e,label:o}):o)},y=function(){if(g.current){var e=f.current,t=g.current.firstChild;if(t){var n=h.current.scrollHeight>h.current.clientHeight,r=[],i=r;r=[EN(t.children[0]),EN(t.children[1])],(i[0]!==r[0]||i[1]!==r[1])&&(p.current.style.width=r[0]+`px`,m.current.style.width=r[1]+`px`),n?(uj(e,`rbc-header-overflowing`),e.style.marginRight=mj()+`px`):fj(e,`rbc-header-overflowing`)}}},b=c.messages,x=c.add(r,s,`day`),S=c.range(r,x,`day`);return i=i.filter(function(e){return aI(e,c.startOf(r,`day`),c.endOf(x,`day`),t,c)}),i.sort(function(e,n){return t.start(e)-+t.start(n)}),U.createElement(`div`,{className:`rbc-agenda-view`},i.length===0?U.createElement(`span`,{className:`rbc-agenda-empty`},b.noEventsInRange):U.createElement(U.Fragment,null,U.createElement(`table`,{ref:f,className:`rbc-agenda-table`},U.createElement(`thead`,null,U.createElement(`tr`,null,U.createElement(`th`,{className:`rbc-header`,ref:p},b.date),U.createElement(`th`,{className:`rbc-header`,ref:m},b.time),U.createElement(`th`,{className:`rbc-header`},b.event)))),U.createElement(`div`,{className:`rbc-agenda-content`,ref:h},U.createElement(`table`,{className:`rbc-agenda-table`},U.createElement(`tbody`,{ref:g},S.map(function(e,t){return _(e,i,t)}))))))}iL.range=function(e,t){var n=t.length,r=n===void 0?rL:n;return{start:e,end:t.localizer.add(e,r,`day`)}},iL.navigate=function(e,t,n){var r=n.length,i=r===void 0?rL:r,a=n.localizer;switch(t){case JP.PREVIOUS:return a.add(e,-i,`day`);case JP.NEXT:return a.add(e,i,`day`);default:return e}},iL.title=function(e,t){var n=t.length,r=n===void 0?rL:n,i=t.localizer,a=i.add(e,r,`day`);return i.format({start:e,end:a},`agendaHeaderFormat`)};var aL=eO(eO(eO(eO(eO({},YP.MONTH,xI),YP.WEEK,$I),YP.WORK_WEEK,nL),YP.DAY,ZI),YP.AGENDA,iL),oL=[`action`,`date`,`today`];function sL(e,t){var n=t.action,r=t.date,i=t.today,a=iO(t,oL);switch(e=typeof e==`string`?aL[e]:e,n){case JP.TODAY:r=i||new Date;break;case JP.DATE:break;default:(0,wO.default)(e&&typeof e.navigate==`function`,"Calendar View components must implement a static `.navigate(date, action)` method.s"),r=e.navigate(r,n,a)}return r}function cL(e,t){var n=null;return typeof t==`function`?n=t(e):typeof t==`string`&&ZD(e)===`object`&&e!=null&&t in e&&(n=e[t]),n}var lL=function(e){return function(t){return cL(t,e)}},uL=[`view`,`date`,`getNow`,`onNavigate`],dL=[`view`,`toolbar`,`events`,`backgroundEvents`,`resourceGroupingLayout`,`style`,`className`,`elementProps`,`date`,`getNow`,`length`,`showMultiDayTimes`,`onShowMore`,`doShowMoreDrillDown`,`components`,`formats`,`messages`,`culture`];function fL(e){if(Array.isArray(e))return e;for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var i=bO(r[n],2),a=i[0];i[1]&&t.push(a)}return t}function pL(e,t){var n=t.views;return fL(n).indexOf(e)!==-1}var mL=function(e){function t(){var e;aO(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=fO(this,t,[].concat(r)),e.getViews=function(){var t=e.props.views;return Array.isArray(t)?(0,KP.default)(t,function(e,t){return e[t]=aL[t]},{}):ZD(t)===`object`?(0,WP.default)(t,function(e,t){return e===!0?aL[t]:e}):aL},e.getView=function(){return e.getViews()[e.props.view]},e.getDrilldownView=function(t){var n=e.props,r=n.view,i=n.drilldownView,a=n.getDrilldownView;return a?a(t,r,Object.keys(e.getViews())):i},e.handleRangeChange=function(t,n,r){var i=e.props,a=i.onRangeChange,o=i.localizer;a&&n.range&&a(n.range(t,{localizer:o}),r)},e.handleNavigate=function(t,n){var r=e.props,i=r.view,a=r.date,o=r.getNow,s=r.onNavigate,c=iO(r,uL),l=e.getView(),u=o();a=sL(l,nO(nO({},c),{},{action:t,date:n||a||u,today:u})),s(a,i,t),e.handleRangeChange(a,l)},e.handleViewChange=function(t){t!==e.props.view&&pL(t,e.props)&&e.props.onView(t);var n=e.getViews();e.handleRangeChange(e.props.date||e.props.getNow(),n[t],t)},e.handleSelectEvent=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];CF(e.props.onSelectEvent,n)},e.handleDoubleClickEvent=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];CF(e.props.onDoubleClickEvent,n)},e.handleKeyPressEvent=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];CF(e.props.onKeyPressEvent,n)},e.handleSelectSlot=function(t){CF(e.props.onSelectSlot,t)},e.handleDrillDown=function(t,n){var r=e.props.onDrillDown;if(r){r(t,n,e.drilldownView);return}n&&e.handleViewChange(n),e.handleNavigate(JP.DATE,t)},e.state={context:t.getContext(e.props)},e}return mO(t,e),sO(t,[{key:`render`,value:function(){var e=this.props,t=e.view,n=e.toolbar,r=e.events,i=e.backgroundEvents,a=e.resourceGroupingLayout,o=e.style,s=e.className,c=e.elementProps,l=e.date,u=e.getNow,d=e.length,f=e.showMultiDayTimes,p=e.onShowMore,m=e.doShowMoreDrillDown;e.components,e.formats,e.messages,e.culture;var h=iO(e,dL);l||=u();var g=this.getView(),_=this.state.context,v=_.accessors,y=_.components,b=_.getters,x=_.localizer,S=_.viewNames,C=y.toolbar||SF,w=g.title(l,{localizer:x,length:d});return U.createElement(`div`,Object.assign({},c,{className:SO(s,`rbc-calendar`,h.rtl&&`rbc-rtl`),style:o}),n&&U.createElement(C,{date:l,view:t,views:S,label:w,onView:this.handleViewChange,onNavigate:this.handleNavigate,localizer:x}),U.createElement(g,Object.assign({},h,{events:r,backgroundEvents:i,date:l,getNow:u,length:d,localizer:x,getters:b,components:y,accessors:v,showMultiDayTimes:f,getDrilldownView:this.getDrilldownView,onNavigate:this.handleNavigate,onDrillDown:this.handleDrillDown,onSelectEvent:this.handleSelectEvent,onDoubleClickEvent:this.handleDoubleClickEvent,onKeyPressEvent:this.handleKeyPressEvent,onSelectSlot:this.handleSelectSlot,onShowMore:p,doShowMoreDrillDown:m,resourceGroupingLayout:a})))}}],[{key:`getDerivedStateFromProps`,value:function(e){return{context:t.getContext(e)}}},{key:`getContext`,value:function(e){var t=e.startAccessor,n=e.endAccessor,r=e.allDayAccessor,i=e.tooltipAccessor,a=e.titleAccessor,o=e.resourceAccessor,s=e.resourceIdAccessor,c=e.resourceTitleAccessor,l=e.eventIdAccessor,u=e.eventPropGetter,d=e.backgroundEventPropGetter,f=e.slotPropGetter,p=e.slotGroupPropGetter,m=e.dayPropGetter,h=e.view,g=e.views,_=e.localizer,v=e.culture,y=e.messages,b=y===void 0?{}:y,x=e.components,S=x===void 0?{}:x,C=e.formats,w=C===void 0?{}:C,T=fL(g);return{viewNames:T,localizer:xF(_,v,w,TF(b)),getters:{eventProp:function(){return u&&u.apply(void 0,arguments)||{}},backgroundEventProp:function(){return d&&d.apply(void 0,arguments)||{}},slotProp:function(){return f&&f.apply(void 0,arguments)||{}},slotGroupProp:function(){return p&&p.apply(void 0,arguments)||{}},dayProp:function(){return m&&m.apply(void 0,arguments)||{}}},components:(0,UP.default)(S[h]||{},(0,GP.default)(S,T),{eventWrapper:qP,backgroundEventWrapper:qP,eventContainerWrapper:qP,dateCellWrapper:qP,weekWrapper:qP,timeSlotWrapper:qP,timeGutterWrapper:qP,timeIndicatorWrapper:qP}),accessors:{start:lL(t),end:lL(n),allDay:lL(r),tooltip:lL(i),title:lL(a),resource:lL(o),resourceId:lL(s),resourceTitle:lL(c),eventId:lL(l)}}}}])}(U.Component);mL.defaultProps={events:[],backgroundEvents:[],elementProps:{},popup:!1,toolbar:!0,view:YP.MONTH,views:[YP.MONTH,YP.WEEK,YP.DAY,YP.AGENDA],step:30,length:30,allDayMaxRows:1/0,doShowMoreDrillDown:!0,drilldownView:YP.DAY,titleAccessor:`title`,tooltipAccessor:`title`,allDayAccessor:`allDay`,startAccessor:`start`,endAccessor:`end`,resourceAccessor:`resourceId`,resourceIdAccessor:`id`,resourceTitleAccessor:`title`,eventIdAccessor:`id`,longPressThreshold:250,getNow:function(){return new Date},dayLayoutAlgorithm:`overlap`};var hL=IO(mL,{view:`onView`,date:`onNavigate`,selected:`onSelectEvent`}),gL=function(e,t,n){var r=e.start,i=e.end;return n.format(r,`MMMM DD`,t)+` – `+n.format(i,n.eq(r,i,`month`)?`DD`:`MMMM DD`,t)},_L=function(e,t,n){var r=e.start,i=e.end;return n.format(r,`L`,t)+` – `+n.format(i,`L`,t)},vL=function(e,t,n){var r=e.start,i=e.end;return n.format(r,`LT`,t)+` – `+n.format(i,`LT`,t)},yL={dateFormat:`DD`,dayFormat:`DD ddd`,weekdayFormat:`ddd`,selectRangeFormat:vL,eventTimeRangeFormat:vL,eventTimeRangeStartFormat:function(e,t,n){var r=e.start;return n.format(r,`LT`,t)+` – `},eventTimeRangeEndFormat:function(e,t,n){var r=e.end;return` – `+n.format(r,`LT`,t)},timeGutterFormat:`LT`,monthHeaderFormat:`MMMM YYYY`,dayHeaderFormat:`dddd MMM DD`,dayRangeHeaderFormat:gL,agendaHeaderFormat:_L,agendaDateFormat:`ddd MMM DD`,agendaTimeFormat:`LT`,agendaTimeRangeFormat:vL};function bL(e){var t=e&&e.toLowerCase();return t===`FullYear`?t=`year`:t||=void 0,t}function xL(e){var t=function(e,t){return t?e.locale(t):e};function n(t){return e(t).toDate().getTimezoneOffset()}function r(t,n){var r=e(t).local(),i=e(n).local();if(!e.tz)return r.toDate().getTimezoneOffset()-i.toDate().getTimezoneOffset();var a=r?._z?.name??e.tz.guess();return e.tz.zone(a).utcOffset(+r)-e.tz.zone(a).utcOffset(+i)}function i(t){return r(e(t).startOf(`day`),t)}function a(t,n,r){var i=bL(r);return[i?e(t).startOf(i):e(t),i?e(n).startOf(i):e(n),i]}function o(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=bL(arguments.length>1?arguments[1]:void 0);return n?e(t).startOf(n).toDate():e(t).toDate()}function s(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=bL(arguments.length>1?arguments[1]:void 0);return n?e(t).endOf(n).toDate():e(t).toDate()}function c(e,t,n){var r=bO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isSame(o,s)}function l(e,t,n){return!c(e,t,n)}function u(e,t,n){var r=bO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isAfter(o,s)}function d(e,t,n){var r=bO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isBefore(o,s)}function f(e,t,n){var r=bO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isSameOrBefore(o,s)}function p(e,t,n){var r=bO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isSameOrBefore(o,s)}function m(t,n,r){var i=bL(arguments.length>3&&arguments[3]!==void 0?arguments[3]:`day`),a=e(t),o=e(n),s=e(r);return a.isBetween(o,s,i,`[]`)}function h(t,n){var r=e(t),i=e(n);return e.min(r,i).toDate()}function g(t,n){var r=e(t),i=e(n);return e.max(r,i).toDate()}function _(t,n){if(!t&&!n)return null;var r=e(n).format(`HH:mm:ss`);return e(`${e(t).startOf(`day`).format(`MM/DD/YYYY`)} ${r}`,`MM/DD/YYYY HH:mm:ss`).toDate()}function v(t,n,r){var i=bL(r);return e(t).add(n,i).toDate()}function y(t,n){for(var r=bL(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`day`),i=e(t).toDate(),a=[];p(i,n);)a.push(i),i=v(i,1,r);return a}function b(e,t){var n=bL(t),r=o(e,n);return c(r,e)?r:v(r,1,n)}function x(t,n){var r=bL(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`day`),i=e(t);return e(n).diff(i,r)}function S(t){return e(t).minutes()}function C(t){var n=t?e.localeData(t):e.localeData();return n?n.firstDayOfWeek():0}function w(t){return e(t).startOf(`month`).startOf(`week`).toDate()}function T(t){return e(t).endOf(`month`).endOf(`week`).toDate()}function E(e){for(var t=w(e),n=T(e),r=[];p(t,n);)r.push(t),t=v(t,1,`d`);return r}function D(t,n,r){return e(t).startOf(`day`).minute(n+r).toDate()}function O(e,t){return x(e,t,`minutes`)}function k(t){var n=e(t).startOf(`day`);return e(t).diff(n,`minutes`)+i(t)}function ee(t,n){var r=e(t),i=e(n);return r.isBefore(i,`day`)}function A(t,n,r){var i=e(n),a=e(r);return i.isSameOrAfter(a,`minutes`)}function te(t,n){var r=e(t),i=e(n);return e.duration(i.diff(r)).days()}function ne(e){var t=e.evtA,n=t.start,r=t.end,i=t.allDay,a=e.evtB,s=a.start,c=a.end,l=a.allDay,u=o(n,`day`)-+o(s,`day`),d=te(n,r),f=te(s,c);return u||f-d||!!l-!!i||n-+s||r-+c}function re(t){var n=t.event,r=n.start,i=n.end,a=t.range,o=a.start,s=a.end,c=e(r).startOf(`day`),l=e(i),u=e(o),d=e(s),f=c.isSameOrBefore(d,`day`),p=c.isSame(l,`minutes`)?l.isSameOrAfter(u,`minutes`):l.isAfter(u,`minutes`);return f&&p}function ie(t,n){var r=e(t),i=e(n);return r.isSame(i,`day`)}function ae(){var t=new Date,n=/-/.test(t.toString())?`-`:``,r=t.getTimezoneOffset(),i=Number(`${n}${Math.abs(r)}`);return e().utcOffset()>i?1:0}return new bF({formats:yL,firstOfWeek:C,firstVisibleDay:w,lastVisibleDay:T,visibleDays:E,format:function(n,r,i){return t(e(n),i).format(r)},lt:d,lte:p,gt:u,gte:f,eq:c,neq:l,merge:_,inRange:m,startOf:o,endOf:s,range:y,add:v,diff:x,ceil:b,min:h,max:g,minutes:S,getSlotDate:D,getTimezoneOffset:n,getDstOffset:r,getTotalMin:O,getMinutesFromMidnight:k,continuesPrior:ee,continuesAfter:A,sortEvents:ne,inEventRange:re,isSameDate:ie,daySpan:te,browserTZOffset:ae})}Xi(),je(),li(),H(),M();function SL(e,t,n,r,i){let a={start:r.start(e),end:r.end(e)},o={start:t,end:n};return i.inEventRange({event:a,range:o})}function CL(e,t){return!e||t==null?!1:Ji(e,t)}var wL={PREVIOUS:`PREV`,NEXT:`NEXT`,TODAY:`TODAY`,DATE:`DATE`};function TL({accessors:e,components:t,date:n,events:r,getters:i,length:a,localizer:o,onDoubleClickEvent:s,onSelectEvent:c,selected:l}){(0,U.useRef)(null);let u=(0,U.useRef)(null),d=(0,U.useRef)(null),p=(0,U.useRef)(null),m=(0,U.useRef)(null),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(!1),y=(n,r,a)=>{let{event:u,date:d}=t;return r=r.filter(t=>SL(t,o.startOf(n,`day`),o.endOf(n,`day`),e,o)),r.map((t,f)=>{let p=e.title(t),m=e.end(t),h=e.start(t),g=i.eventProp(t,h,m,CL(t,l)),_=f===0&&o.format(n,`agendaDateFormat`),v=f===0?(0,W.jsx)(`td`,{rowSpan:r.length,className:`rbc-agenda-date-cell`,children:d?(0,W.jsx)(d,{day:n,label:_}):_}):!1;return(0,W.jsxs)(`tr`,{className:g.className,style:g.style,children:[v,(0,W.jsx)(`td`,{className:`rbc-agenda-time-cell`,children:b(n,t)}),(0,W.jsx)(`td`,{className:`rbc-agenda-event-cell`,onClick:e=>c&&c(t,e),onDoubleClick:e=>s&&s(t,e),children:u?(0,W.jsx)(u,{event:t,title:p}):p})]},a+`_`+f)},[])},b=(n,r)=>{let i=t.time,a=``,s=o.messages.allDay,c=e.end(r),l=e.start(r);return e.allDay(r)||(o.eq(l,c)?s=o.format(l,`agendaTimeFormat`):o.isSameDate(l,c)?s=o.format({start:l,end:c},`agendaTimeRangeFormat`):o.isSameDate(n,l)?s=o.format(l,`agendaTimeFormat`):o.isSameDate(n,c)&&(s=o.format(c,`agendaTimeFormat`))),o.gt(n,l,`day`)&&(a=`rbc-continues-prior`),o.lt(n,c,`day`)&&(a+=` rbc-continues-after`),(0,W.jsx)(`span`,{className:a.trim(),children:i?(0,W.jsx)(i,{event:r,day:n,label:s}):s})},{messages:x}=o,S=o.add(n,-(a/2),`day`),C=o.add(n,a/2,`day`),w=o.range(S,C,`day`);h&&w.reverse(),r=r.filter(t=>SL(t,o.startOf(S,`day`),o.endOf(C,`day`),e,o)),r.sort((t,n)=>e.start(t)-+e.start(n)),_&&r.reverse();let T=(0,U.useCallback)(()=>setTimeout(()=>{m.current&&ES(m.current,{backgroundColor:`#ffffff`,pixelRatio:window.devicePixelRatio*2}).then(e=>{new f.Notice(j(`Image is generating...`));let t=L.getState().settings.AutoSaveWhenOnMobile,n=L.getState().app.vault;if(t&&f.Platform.isMobile){let t=e.split(`base64,`)[1];ci(t,`image/png`).arrayBuffer().then(async e=>{let t,r=ge();for(let e in r)if(r[e]instanceof f.TFile){t=r[e];break}t!==void 0&&await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,`png`,t),e)})}ZS({imgUrl:e})}).catch(e=>{console.error(e)})},0),[m.current,w]),E=(0,U.useCallback)(e=>{let t=new f.Menu;console.log(m.current),t.addItem(e=>{e.setIcon(`share-2`).setTitle(j(`Share`)).onClick(()=>{T()})}),t.showAtMouseEvent(e.nativeEvent)},[m.current,w,T]);return(0,W.jsx)(`div`,{className:`rbc-agenda-view`,children:r.length===0?(0,W.jsx)(`span`,{className:`rbc-agenda-empty`,children:x.noEventsInRange}):(0,W.jsx)(U.Fragment,{children:(0,W.jsxs)(`table`,{ref:m,className:`rbc-agenda-table`,children:[(0,W.jsx)(`thead`,{onContextMenu:E,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`rbc-header`,ref:u,onClick:()=>{g(!h)},children:x.date+(h?` 🔼`:` 🔽`)}),(0,W.jsx)(`th`,{className:`rbc-header`,ref:d,onClick:()=>{v(!_)},children:x.time+(_?` 🔼`:` 🔽`)}),(0,W.jsx)(`th`,{className:`rbc-header`,children:x.event})]})}),(0,W.jsx)(`tbody`,{ref:p,children:w.map((e,t)=>y(e,r,t))})]})})})}TL.propTypes={accessors:K.default.object.isRequired,components:K.default.object.isRequired,date:K.default.instanceOf(Date),events:K.default.array,getters:K.default.object.isRequired,length:K.default.number.isRequired,localizer:K.default.object.isRequired,onSelectEvent:K.default.func,onDoubleClickEvent:K.default.func,selected:K.default.object},TL.defaultProps={length:30},TL.range=(e,{length:t=TL.defaultProps.length,localizer:n})=>({customStart:n.add(e,-(t/2),`day`),customEnd:n.add(e,t/2,`day`)}),TL.navigate=(e,t,{length:n=TL.defaultProps.length,localizer:r})=>{switch(t){case wL.PREVIOUS:return r.add(e,-n,`day`);case wL.NEXT:return r.add(e,n,`day`);default:return e}},TL.title=(e,{length:t=TL.defaultProps.length,localizer:n})=>{let r=n.add(e,-(t/2),`day`),i=n.add(e,t/2,`day`);return n.format({start:r,end:i},`agendaHeaderFormat`)},H();function EL(e,t){e.hoverEl.toggleClass(`thino-hover-popover`,!0);let n=(0,u_.createRoot)(e.hoverEl);return n.render((0,W.jsx)(gT,{memo:t})),n}function DL({event:e}){let t=e.resource,n=t.content.split(`
- `)[0].slice(0,20),r=U.useRef(null),i=U.useRef(null),a=U.useRef(null);(0,U.useEffect)(()=>{if(i.current)return(0,f.setIcon)(i.current,`calendar`),()=>{r.current&&=null}},[r]);let o=(0,U.useCallback)(e=>{a.current&&=(console.log(`unmounting`,a.current),a.current.unmount(),null),a.current=e},[]),s=(0,U.useCallback)(e=>{console.log(`hovering`),r.current&&f.Keymap.isModifier(e.nativeEvent,`Mod`)&&o(EL(new f.HoverPopover(L.getState().view,r.current,100),t))},[r.current]);return(0,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:s,children:[(0,W.jsx)(OL,{event:e}),(0,W.jsx)(`span`,{children:n})]})}var OL=({event:e})=>{let t=U.useRef(null),n=e.resource;return(0,U.useEffect)(()=>{t.current&&(0,f.setIcon)(t.current,n.thinoType===`JOURNAL`?`calendar`:n.thinoType===`TASK-TODO`?`square`:`check-square`)},[n?.thinoType,t]),(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`span`,{className:`rbc-event-icon-group`,children:[(0,W.jsx)(`span`,{className:`rbc-event-icon`,ref:t,onClick:(0,U.useCallback)(async e=>{e.stopPropagation(),e.preventDefault(),await(async()=>{let e=await V.updateMemo(n.id,n.content,n.thinoType===`TASK-TODO`?`TASK-DONE`:`TASK-TODO`);e&&V.editMemo(e)})()},[n?.thinoType,n?.id,n?.content])}),(0,W.jsx)(`span`,{className:x_(`rbc-event-time`,`thino-hidden`),children:(0,W.jsx)(`span`,{className:`rbc-event-time-text`,children:(0,f.moment)(e.start).format(`HH:mm`)})})]})})};function kL({views:e,view:t,messages:n,onView:r}){return e.map(e=>(0,W.jsx)(`button`,{type:`button`,className:x_({"rbc-active":t===e}),onClick:()=>r(e),children:n[e]},e))}kL.propTypes={messages:K.default.object,onView:K.default.func,view:K.default.string,views:K.default.array};function AL({date:e,label:t,localizer:{messages:n},onNavigate:r,onView:i,view:a,views:o}){let s={previous:(0,U.useRef)(null),today:(0,U.useRef)(null),next:(0,U.useRef)(null)};(0,U.useEffect)(()=>{s&&((0,f.setIcon)(s.previous.current,`chevron-left`),(0,f.setIcon)(s.today.current,`dot`),(0,f.setIcon)(s.next.current,`chevron-right`))},[s]);let c=(0,U.useMemo)(()=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{ref:s.previous,type:`button`,onClick:()=>r(wL.PREVIOUS),"aria-label":n.previous,children:`<`}),(0,W.jsx)(`button`,{ref:s.today,type:`button`,onClick:()=>r(wL.TODAY),"aria-label":n.today,children:`•`}),(0,W.jsx)(`button`,{ref:s.next,type:`button`,onClick:()=>r(wL.NEXT),"aria-label":n.next,children:`>`})]}),[n]);return(0,W.jsxs)(`div`,{className:`rbc-toolbar`,children:[(0,W.jsx)(`span`,{className:x_(`rbc-btn-group`,`thino-view-custom-toolbar`),children:c}),(0,W.jsx)(`span`,{className:`rbc-toolbar-label`,children:(0,W.jsx)(ex,{type:`text`,handleValueChange:e=>{r(wL.DATE,(0,f.moment)(e,`YYYY-MM-DD`).format(`YYYY-MM-DDTHH:mm:ssZ`))},defaultText:t+(a===`week`?(0,f.moment)(e.valueOf(),`x`).format(` [W]WW`):``),defaultValue:(0,f.moment)(e.valueOf(),`x`).valueOf()})}),(0,W.jsx)(`span`,{className:`rbc-btn-group`,children:(0,W.jsx)(kL,{view:a,views:o,messages:n,onView:i})})]})}AL.propTypes={date:K.default.instanceOf(Date),label:K.default.string,localizer:K.default.object,messages:K.default.object,onNavigate:K.default.func,onView:K.default.func,view:K.default.string,views:K.default.array};function jL({event:e,children:t,showPopup:n,callRender:r,...i}){let a=(0,U.useRef)(null),o=(0,U.useRef)(null),s=(0,U.useCallback)(t=>{if(!t.isTrusted){r();return}o.current=t.nativeEvent.target,o.current&&(o.current.hasClass(`rbc-event`)||(o.current=o.current.closest(`.rbc-event`)),a.current===null?a.current=window.setTimeout(()=>{n(e,o.current),a.current=null},250):(window.clearTimeout(a.current),a.current=null))},[e,n]);return(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:`rbc-event-wrapper`,"aria-describedby":`thino`,onClick:s,children:t})})}M(),H();var ML=xL(f.moment),NL=({event:e})=>{let t=e.resource;return(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(gT,{memo:t})})},PL=e=>{let{thinos:t}=e,[n,r]=U.useState([]),[i,a]=U.useState(app?.loadLocalStorage(`thino-calendar-view`)||`month`),[o,s]=U.useState(null),c=U.useRef(null),l=U.useRef(null),[u,d]=U.useState(!1),p=(0,U.useRef)(null),[m,h]=(0,U.useState)(new Date);(0,U.useEffect)(()=>()=>{c.current&&=null,l.current&&=null,p.current&&=null},[]),(0,U.useEffect)(()=>{r(t.map(e=>{let t=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`),n=t.clone().add(1,`minute`);return{title:e.content,start:new Date(t.format(`YYYY-MM-DDTHH:mm:ss`)),end:new Date(n.format(`YYYY-MM-DDTHH:mm:ss`)),resource:e}}))},[t]),(0,U.useEffect)(()=>{app?.saveLocalStorage(`thino-calendar-view`,i)},[i]),(0,U.useEffect)(()=>{o&&u&&s(t.find(e=>e.id===o.id))},[t,o,u]),(0,U.useEffect)(()=>{o&&p.current.update()},[o]),p.current=Vb(c.current,l.current,{placement:`bottom-start`,modifiers:[{name:`offset`,options:{offset:[0,4]}}]});let g=(0,U.useCallback)(()=>{p.current.update(),p.current.update()},[]),_=(0,U.useCallback)((e,t)=>{s(null),x(),p.current.state.elements.reference=t,s(e.resource),S()},[]),v=(0,U.useCallback)(()=>{x(),s(null)},[]),y=(0,U.useCallback)((e,t,n)=>{if(b(e),t===`week`||t===`day`){let e=c.current.find(`.rbc-event-wrapper`);if(c.current.closest(`.memolist-wrapper`),e){e.children[0]?.click();return}else{setTimeout(()=>{(c.current.find(`.rbc-event-wrapper`)?.children?.[0])?.click()},0);return}}},[]),b=(0,U.useCallback)(e=>{h(e)},[h]);Sv(l,v);let x=(0,U.useCallback)(()=>{d(!1)},[d]),S=(0,U.useCallback)(()=>{p.current.update(),d(!0)},[d]),C=(0,U.useCallback)(e=>{let t=e.resource;R.setEditMemoId(t.id)},[]),w=(0,U.useCallback)(e=>{a(e)},[a]),{components:T,views:E,messages:D}=(0,U.useMemo)(()=>({components:{toolbar:AL,eventWrapper:e=>(0,W.jsx)(jL,{...e,callRender:g,showPopup:_}),agenda:{event:NL},event:DL},views:{month:!0,agenda:TL,week:!0,day:!0},messages:{month:j(`Month`),day:j(`Day`),next:j(`Next`),previous:j(`Previous`),today:j(`Today`),agenda:j(`Agenda`),week:j(`Week`),yesterday:j(`Yesterday`),tomorrow:j(`Tomorrow`),noEventsInRange:j(`No thinos in range`),date:j(`date`),time:j(`time`),event:j(`event`)}}),[]);return(0,W.jsxs)(`div`,{ref:c,className:`calendar-view`,children:[(0,W.jsx)(hL,{date:m,messages:D,components:T,localizer:ML,events:n,views:E,onView:w,onDoubleClickEvent:C,onNavigate:y,formats:(0,U.useMemo)(()=>({timeGutterFormat:(e,t,n)=>n.format(e,`HH:mm`,t),agendaTimeRangeFormat:({start:e,end:t},n,r)=>r.format(e,`HH:mm`,n)+` — `+r.format(t,`HH:mm`,n),agendaHeaderFormat:({start:e,end:t},n,r)=>r.format(e,`YYYY-MM-DD`)+` — `+r.format(t,`YYYY-MM-DD`)}),[]),defaultView:i,tooltipAccessor:null,startAccessor:`start`,endAccessor:`end`}),(0,W.jsx)(`div`,{ref:l,style:p.current?.styles.popper,className:x_(`thino-popup-container`,u?``:`thino-hidden`),children:o&&(0,W.jsx)(gT,{memo:o})})]})};function FL(e,t){return typeof e==`function`?e(t):e}function IL(e,t){return n=>{t.setState(t=>({...t,[e]:FL(n,t[e])}))}}function LL(e){return e instanceof Function}function RL(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function zL(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function BL(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
- font-size: .6rem;
- font-weight: bold;
- color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return i}}function VL(e,t,n,r){return{debug:()=>e?.debugAll??e[t],key:!1,onChange:r}}function HL(e,t,n,r){let i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>i.getValue()??e.options.renderFallbackValue,getContext:BL(()=>[e,n,t,i],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),VL(e.options,`debugCells`,`cell.getContext`))};return e._features.forEach(r=>{r.createCell==null||r.createCell(i,n,t,e)},{}),i}function UL(e,t,n,r){let i={...e._getDefaultColumnDef(),...t},a=i.accessorKey,o=i.id??(a?typeof String.prototype.replaceAll==`function`?a.replaceAll(`.`,`_`):a.replace(/\./g,`_`):void 0)??(typeof i.header==`string`?i.header:void 0),s;if(i.accessorFn?s=i.accessorFn:a&&(s=a.includes(`.`)?e=>{let t=e;for(let e of a.split(`.`))t=t?.[e];return t}:e=>e[i.accessorKey]),!o)throw Error();let c={id:`${String(o)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:BL(()=>[!0],()=>[c,...c.columns?.flatMap(e=>e.getFlatColumns())],VL(e.options,`debugColumns`,`column.getFlatColumns`)),getLeafColumns:BL(()=>[e._getOrderColumnsFn()],e=>{var t;return(t=c.columns)!=null&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},VL(e.options,`debugColumns`,`column.getLeafColumns`))};for(let t of e._features)t.createColumn==null||t.createColumn(c,e);return c}var WL=`debugHeaders`;function GL(e,t,n){let r={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{t.createHeader==null||t.createHeader(r,e)}),r}var KL={createTable:e=>{e.getHeaderGroups=BL(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{let a=r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],o=i?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],s=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id)));return qL(t,[...a,...s,...o],e)},VL(e.options,WL,`getHeaderGroups`)),e.getCenterHeaderGroups=BL(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id))),qL(t,n,e,`center`)),VL(e.options,WL,`getCenterHeaderGroups`)),e.getLeftHeaderGroups=BL(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>qL(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`left`),VL(e.options,WL,`getLeftHeaderGroups`)),e.getRightHeaderGroups=BL(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>qL(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`right`),VL(e.options,WL,`getRightHeaderGroups`)),e.getFooterGroups=BL(()=>[e.getHeaderGroups()],e=>[...e].reverse(),VL(e.options,WL,`getFooterGroups`)),e.getLeftFooterGroups=BL(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),VL(e.options,WL,`getLeftFooterGroups`)),e.getCenterFooterGroups=BL(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),VL(e.options,WL,`getCenterFooterGroups`)),e.getRightFooterGroups=BL(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),VL(e.options,WL,`getRightFooterGroups`)),e.getFlatHeaders=BL(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),VL(e.options,WL,`getFlatHeaders`)),e.getLeftFlatHeaders=BL(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),VL(e.options,WL,`getLeftFlatHeaders`)),e.getCenterFlatHeaders=BL(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),VL(e.options,WL,`getCenterFlatHeaders`)),e.getRightFlatHeaders=BL(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),VL(e.options,WL,`getRightFlatHeaders`)),e.getCenterLeafHeaders=BL(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),VL(e.options,WL,`getCenterLeafHeaders`)),e.getLeftLeafHeaders=BL(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),VL(e.options,WL,`getLeftLeafHeaders`)),e.getRightLeafHeaders=BL(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),VL(e.options,WL,`getRightLeafHeaders`)),e.getLeafHeaders=BL(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>[...e[0]?.headers??[],...t[0]?.headers??[],...n[0]?.headers??[]].map(e=>e.getLeafHeaders()).flat(),VL(e.options,WL,`getLeafHeaders`))}};function qL(e,t,n,r){let i=0,a=function(e,t){t===void 0&&(t=1),i=Math.max(i,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;(n=e.columns)!=null&&n.length&&a(e.columns,t+1)},0)};a(e);let o=[],s=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join(`_`),headers:[]},a=[];e.forEach(e=>{let o=[...a].reverse()[0],s=e.column.depth===i.depth,c,l=!1;if(s&&e.column.parent?c=e.column.parent:(c=e.column,l=!0),o&&o?.column===c)o.subHeaders.push(e);else{let i=GL(n,c,{id:[r,t,c.id,e?.id].filter(Boolean).join(`_`),isPlaceholder:l,placeholderId:l?`${a.filter(e=>e.column===c).length}`:void 0,depth:t,index:a.length});i.subHeaders.push(e),a.push(i)}i.headers.push(e),e.headerGroup=i}),o.push(i),t>0&&s(a,t-1)};s(t.map((e,t)=>GL(n,e,{depth:i,index:t})),i-1),o.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1;let i=Math.min(...r);return n+=i,e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(o[0]?.headers??[]),o}var JL=(e,t,n,r,i,a,o)=>{let s={id:t,index:r,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,r),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t])},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>zL(s.subRows,e=>e.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:BL(()=>[e.getAllLeafColumns()],t=>t.map(t=>HL(e,s,t,t.id)),VL(e.options,`debugRows`,`getAllCells`)),_getAllCellsByColumnId:BL(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),VL(e.options,`debugRows`,`getAllCellsByColumnId`))};for(let t=0;t<e._features.length;t++){let n=e._features[t];n==null||n.createRow==null||n.createRow(s,e)}return s},YL={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},XL=(e,t,n)=>{var r,i;let a=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(a))};XL.autoRemove=e=>oR(e);var ZL=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};ZL.autoRemove=e=>oR(e);var QL=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};QL.autoRemove=e=>oR(e);var $L=(e,t,n)=>e.getValue(t)?.includes(n);$L.autoRemove=e=>oR(e);var eR=(e,t,n)=>!n.some(n=>{var r;return!((r=e.getValue(t))!=null&&r.includes(n))});eR.autoRemove=e=>oR(e)||!(e!=null&&e.length);var tR=(e,t,n)=>n.some(n=>e.getValue(t)?.includes(n));tR.autoRemove=e=>oR(e)||!(e!=null&&e.length);var nR=(e,t,n)=>e.getValue(t)===n;nR.autoRemove=e=>oR(e);var rR=(e,t,n)=>e.getValue(t)==n;rR.autoRemove=e=>oR(e);var iR=(e,t,n)=>{let[r,i]=n,a=e.getValue(t);return a>=r&&a<=i};iR.resolveFilterValue=e=>{let[t,n]=e,r=typeof t==`number`?t:parseFloat(t),i=typeof n==`number`?n:parseFloat(n),a=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(i)?1/0:i;if(a>o){let e=a;a=o,o=e}return[a,o]},iR.autoRemove=e=>oR(e)||oR(e[0])&&oR(e[1]);var aR={includesString:XL,includesStringSensitive:ZL,equalsString:QL,arrIncludes:$L,arrIncludesAll:eR,arrIncludesSome:tR,equals:nR,weakEquals:rR,inNumberRange:iR};function oR(e){return e==null||e===``}var sR={getDefaultColumnDef:()=>({filterFn:`auto`}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:IL(`columnFilters`,e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);return typeof n==`string`?aR.includesString:typeof n==`number`?aR.inNumberRange:typeof n==`boolean`||typeof n==`object`&&n?aR.equals:Array.isArray(n)?aR.arrIncludes:aR.weakEquals},e.getFilterFn=()=>LL(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn===`auto`?e.getAutoFilterFn():t.options.filterFns?.[e.columnDef.filterFn]??aR[e.columnDef.filterFn],e.getCanFilter=()=>(e.columnDef.enableColumnFilter??!0)&&(t.options.enableColumnFilters??!0)&&(t.options.enableFilters??!0)&&!!e.accessorFn,e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(t=>t.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>t.getState().columnFilters?.findIndex(t=>t.id===e.id)??-1,e.setFilterValue=n=>{t.setColumnFilters(t=>{let r=e.getFilterFn(),i=t?.find(t=>t.id===e.id),a=FL(n,i?i.value:void 0);if(cR(r,a,e))return t?.filter(t=>t.id!==e.id)??[];let o={id:e.id,value:a};return i?t?.map(t=>t.id===e.id?o:t)??[]:t!=null&&t.length?[...t,o]:[o]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(e=>FL(t,e)?.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&cR(t.getFilterFn(),e.value,t))}))},e.resetColumnFilters=t=>{e.setColumnFilters(t?[]:e.initialState?.columnFilters??[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function cR(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||t===void 0||typeof t==`string`&&!t}var lR={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+(typeof r==`number`?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r>n||r===void 0&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r<n||r===void 0&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r===void 0?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!RL(n))return;if(n.length===1)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2==0?(i[r-1]+i[r])/2:i[r]},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},uR={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return((t=e.getValue())==null||t.toString==null?void 0:t.toString())??null},aggregationFn:`auto`}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:IL(`grouping`,e),groupedColumnMode:`reorder`}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(t=>t!==e.id):[...t??[],e.id])},e.getCanGroup=()=>(e.columnDef.enableGrouping??!0)&&(t.options.enableGrouping??!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue),e.getIsGrouped=()=>t.getState().grouping?.includes(e.id),e.getGroupedIndex=()=>t.getState().grouping?.indexOf(e.id),e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);if(typeof n==`number`)return lR.sum;if(Object.prototype.toString.call(n)===`[object Date]`)return lR.extent},e.getAggregationFn=()=>{if(!e)throw Error();return LL(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn===`auto`?e.getAutoAggregationFn():t.options.aggregationFns?.[e.columnDef.aggregationFn]??lR[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{e.setGrouping(t?[]:e.initialState?.grouping??[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let 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 t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((t=n.subRows)!=null&&t.length)}}};function dR(e,t,n){if(!(t!=null&&t.length)||!n)return e;let r=e.filter(e=>!t.includes(e.id));return n===`remove`?r:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...r]}var fR={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:IL(`columnOrder`,e)}),createColumn:(e,t)=>{e.getIndex=BL(e=>[CR(t,e)],t=>t.findIndex(t=>t.id===e.id),VL(t.options,`debugColumns`,`getIndex`)),e.getIsFirstColumn=n=>CR(t,n)[0]?.id===e.id,e.getIsLastColumn=n=>{let r=CR(t,n);return r[r.length-1]?.id===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},e._getOrderColumnsFn=BL(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(!(e!=null&&e.length))i=r;else{let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}return dR(i,t,n)},VL(e.options,`debugTable`,`_getOrderColumnsFn`))}},pR=()=>({left:[],right:[]}),mR={getInitialState:e=>({columnPinning:pR(),...e}),getDefaultOptions:e=>({onColumnPinningChange:IL(`columnPinning`,e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>n===`right`?{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:[...(e?.right??[]).filter(e=>!(r!=null&&r.includes(e))),...r]}:n===`left`?{left:[...(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),...r],right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))}:{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))})},e.getCanPin=()=>e.getLeafColumns().some(e=>(e.columnDef.enablePinning??!0)&&(t.options.enableColumnPinning??t.options.enablePinning??!0)),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`left`:o?`right`:!1},e.getPinnedIndex=()=>{var n;let r=e.getIsPinned();return r?((n=t.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))??-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=BL(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.column.id))},VL(t.options,`debugRows`,`getCenterVisibleCells`)),e.getLeftVisibleCells=BL(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`left`})),VL(t.options,`debugRows`,`getLeftVisibleCells`)),e.getRightVisibleCells=BL(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`right`})),VL(t.options,`debugRows`,`getRightVisibleCells`))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>e.setColumnPinning(t?pR():e.initialState?.columnPinning??pR()),e.getIsSomeColumnsPinned=t=>{let n=e.getState().columnPinning;return t?!!n[t]?.length:!!(n.left?.length||n.right?.length)},e.getLeftLeafColumns=BL(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),VL(e.options,`debugColumns`,`getLeftLeafColumns`)),e.getRightLeafColumns=BL(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),VL(e.options,`debugColumns`,`getRightLeafColumns`)),e.getCenterLeafColumns=BL(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.id))},VL(e.options,`debugColumns`,`getCenterLeafColumns`))}};function hR(e){return e||(typeof document<`u`?document:null)}var gR={size:150,minSize:20,maxSize:2**53-1},_R=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),vR={getDefaultColumnDef:()=>gR,getInitialState:e=>({columnSizing:{},columnSizingInfo:_R(),...e}),getDefaultOptions:e=>({columnResizeMode:`onEnd`,columnResizeDirection:`ltr`,onColumnSizingChange:IL(`columnSizing`,e),onColumnSizingInfoChange:IL(`columnSizingInfo`,e)}),createColumn:(e,t)=>{e.getSize=()=>{let n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??gR.minSize,n??e.columnDef.size??gR.size),e.columnDef.maxSize??gR.maxSize)},e.getStart=BL(e=>[e,CR(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),VL(t.options,`debugColumns`,`getStart`)),e.getAfter=BL(e=>[e,CR(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),VL(t.options,`debugColumns`,`getAfter`)),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=r?.getCanResize();return a=>{if(!r||!i||(a.persist==null||a.persist(),xR(a)&&a.touches&&a.touches.length>1))return;let o=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],c=xR(a)?Math.round(a.touches[0].clientX):a.clientX,l={},u=(e,n)=>{typeof n==`number`&&(t.setColumnSizingInfo(e=>{let r=t.options.columnResizeDirection===`rtl`?-1:1,i=(n-(e?.startOffset??0))*r,a=Math.max(i/(e?.startSize??0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;l[t]=Math.round(Math.max(n+n*a,0)*100)/100}),{...e,deltaOffset:i,deltaPercentage:a}}),(t.options.columnResizeMode===`onChange`||e===`end`)&&t.setColumnSizing(e=>({...e,...l})))},d=e=>u(`move`,e),f=e=>{u(`end`,e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=hR(n),m={moveHandler:e=>d(e.clientX),upHandler:e=>{p?.removeEventListener(`mousemove`,m.moveHandler),p?.removeEventListener(`mouseup`,m.upHandler),f(e.clientX)}},h={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{p?.removeEventListener(`touchmove`,h.moveHandler),p?.removeEventListener(`touchend`,h.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0]?.clientX)}},g=bR()?{passive:!1}:!1;xR(a)?(p?.addEventListener(`touchmove`,h.moveHandler,g),p?.addEventListener(`touchend`,h.upHandler,g)):(p?.addEventListener(`mousemove`,m.moveHandler,g),p?.addEventListener(`mouseup`,m.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,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=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},e.resetHeaderSizeInfo=t=>{e.setColumnSizingInfo(t?_R():e.initialState.columnSizingInfo??_R())},e.getTotalSize=()=>e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getLeftTotalSize=()=>e.getLeftHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getCenterTotalSize=()=>e.getCenterHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getRightTotalSize=()=>e.getRightHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0}},yR=null;function bR(){if(typeof yR==`boolean`)return yR;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test`,n,t),window.removeEventListener(`test`,n)}catch{e=!1}return yR=e,yR}function xR(e){return e.type===`touchstart`}var SR={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:IL(`columnVisibility`,e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{let n=e.columns;return(n.length?n.some(e=>e.getIsVisible()):t.getState().columnVisibility?.[e.id])??!0},e.getCanHide=()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=BL(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),VL(t.options,`debugRows`,`_getAllVisibleCells`)),e.getVisibleCells=BL(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],VL(t.options,`debugRows`,`getVisibleCells`))},createTable:e=>{let t=(t,n)=>BL(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join(`_`)],e=>e.filter(e=>e.getIsVisible==null?void 0:e.getIsVisible()),VL(e.options,`debugColumns`,t));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=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},e.toggleAllColumnsVisible=t=>{t??=!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(n.getCanHide!=null&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(e.getIsVisible!=null&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>e.getIsVisible==null?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{e.toggleAllColumnsVisible(t.target?.checked)}}};function CR(e,t){return t?t===`center`?e.getCenterVisibleLeafColumns():t===`left`?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var wR={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,`__global__`),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,`__global__`),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,`__global__`),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},TR={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:IL(`globalFilter`,e),globalFilterFn:`auto`,getColumnCanGlobalFilter:t=>{var n;let 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.getCanGlobalFilter=()=>(e.columnDef.enableGlobalFilter??!0)&&(t.options.enableGlobalFilter??!0)&&(t.options.enableFilters??!0)&&((t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn},createTable:e=>{e.getGlobalAutoFilterFn=()=>aR.includesString,e.getGlobalFilterFn=()=>{let{globalFilterFn:t}=e.options;return LL(t)?t:t===`auto`?e.getGlobalAutoFilterFn():e.options.filterFns?.[t]??aR[t]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},ER={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:IL(`expanded`,e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{e.setExpanded(t?{}:e.initialState?.expanded??{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{t.persist==null||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return t===!0||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return typeof t==`boolean`?t===!0:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(`.`);t=Math.max(t,n.length)}),t},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=>{let i=r===!0?!0:!!(r!=null&&r[e.id]),a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n??=!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{let n=t.getState().expanded;return!!((t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))??(n===!0||n?.[e.id]))},e.getCanExpand=()=>{var n;return(t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!!((n=e.subRows)!=null&&n.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=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},DR=0,OR=10,kR=()=>({pageIndex:DR,pageSize:OR}),AR={getInitialState:e=>({...e,pagination:{...kR(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:IL(`pagination`,e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(e=>FL(t,e)),e.resetPagination=t=>{e.setPagination(t?kR():e.initialState.pagination??kR())},e.setPageIndex=t=>{e.setPagination(n=>{let r=FL(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n;e.setPageIndex(t?DR:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageIndex)??DR)},e.resetPageSize=t=>{var n;e.setPageSize(t?OR:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageSize)??OR)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,FL(t,e.pageSize)),r=e.pageSize*e.pageIndex,i=Math.floor(r/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{let r=FL(t,e.options.pageCount??-1);return typeof r==`number`&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=BL(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},VL(e.options,`debugTable`,`getPageOptions`)),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return n===-1?!0:n===0?!1:t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+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=()=>e.options.pageCount??Math.ceil(e.getRowCount()/e.getState().pagination.pageSize),e.getRowCount=()=>e.options.rowCount??e.getPrePaginationRowModel().rows.length}},jR=()=>({top:[],bottom:[]}),MR={getInitialState:e=>({rowPinning:jR(),...e}),getDefaultOptions:e=>({onRowPinningChange:IL(`rowPinning`,e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let a=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],o=i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...o,e.id,...a]);t.setRowPinning(e=>n===`bottom`?{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:[...(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)]}:n===`top`?{top:[...(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)],bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))}:{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))})},e.getCanPin=()=>{let{enableRowPinning:n,enablePinning:r}=t.options;return typeof n==`function`?n(e):n??r??!0},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`top`:o?`bottom`:!1},e.getPinnedIndex=()=>{let n=e.getIsPinned();return n?((n===`top`?t.getTopRows():t.getBottomRows())?.map(e=>{let{id:t}=e;return t}))?.indexOf(e.id)??-1:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>e.setRowPinning(t?jR():e.initialState?.rowPinning??jR()),e.getIsSomeRowsPinned=t=>{let n=e.getState().rowPinning;return t?!!n[t]?.length:!!(n.top?.length||n.bottom?.length)},e._getPinnedRows=(t,n,r)=>(e.options.keepPinnedRows??!0?(n??[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(n??[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r})),e.getTopRows=BL(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,`top`),VL(e.options,`debugRows`,`getTopRows`)),e.getBottomRows=BL(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,`bottom`),VL(e.options,`debugRows`,`getBottomRows`)),e.getCenterRows=BL(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...t??[],...n??[]]);return e.filter(e=>!r.has(e.id))},VL(e.options,`debugRows`,`getCenterRows`))}},NR={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:IL(`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=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=t===void 0?!e.getIsAllRowsSelected():t;let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=t===void 0?!e.getIsAllPageRowsSelected():t,i={...n};return e.getRowModel().rows.forEach(t=>{PR(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=BL(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?FR(e,n):{rows:[],flatRows:[],rowsById:{}},VL(e.options,`debugTable`,`getSelectedRowModel`)),e.getFilteredSelectedRowModel=BL(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?FR(e,n):{rows:[],flatRows:[],rowsById:{}},VL(e.options,`debugTable`,`getFilteredSelectedRowModel`)),e.getGroupedSelectedRowModel=BL(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?FR(e,n):{rows:[],flatRows:[],rowsById:{}},VL(e.options,`debugTable`,`getGroupedSelectedRowModel`)),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{let t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(a=>{if(n=n===void 0?!i:n,e.getCanSelect()&&i===n)return a;let o={...a};return PR(o,e.id,n,r?.selectChildren??!0,t),o})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return IR(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return LR(e,n)===`some`},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return LR(e,n)===`all`},e.getCanSelect=()=>typeof t.options.enableRowSelection==`function`?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,e.getCanSelectSubRows=()=>typeof t.options.enableSubRowSelection==`function`?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,e.getCanMultiSelect=()=>typeof t.options.enableMultiRowSelection==`function`?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{t&&e.toggleSelected(n.target?.checked)}}}},PR=(e,t,n,r,i)=>{var a;let o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(t=>PR(e,t.id,n,r,i))};function FR(e,t){let n=e.getState().rowSelection,r=[],i={},a=function(e,t){return e.map(e=>{var t;let o=IR(e,n);if(o&&(r.push(e),i[e.id]=e),(t=e.subRows)!=null&&t.length&&(e={...e,subRows:a(e.subRows)}),o)return e}).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:i}}function IR(e,t){return t[e.id]??!1}function LR(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,a=!1;return e.subRows.forEach(e=>{if(!(a&&!i)&&(e.getCanSelect()&&(IR(e,t)?a=!0:i=!1),e.subRows&&e.subRows.length)){let n=LR(e,t);n===`all`?a=!0:(n===`some`&&(a=!0),i=!1)}}),i?`all`:a?`some`:!1}var RR=/([0-9]+)/gm,zR=(e,t,n)=>qR(KR(e.getValue(n)).toLowerCase(),KR(t.getValue(n)).toLowerCase()),BR=(e,t,n)=>qR(KR(e.getValue(n)),KR(t.getValue(n))),VR=(e,t,n)=>GR(KR(e.getValue(n)).toLowerCase(),KR(t.getValue(n)).toLowerCase()),HR=(e,t,n)=>GR(KR(e.getValue(n)),KR(t.getValue(n))),UR=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},WR=(e,t,n)=>GR(e.getValue(n),t.getValue(n));function GR(e,t){return e===t?0:e>t?1:-1}function KR(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function qR(e,t){let n=e.split(RR).filter(Boolean),r=t.split(RR).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),a=parseInt(t,10),o=[i,a].sort();if(isNaN(o[0])){if(e>t)return 1;if(t>e)return-1;continue}if(isNaN(o[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}var JR={alphanumeric:zR,alphanumericCaseSensitive:BR,text:VR,textCaseSensitive:HR,datetime:UR,basic:WR},YR=[KL,SR,fR,mR,YL,sR,wR,TR,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:`auto`,sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:IL(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=t?.getValue(e.id);if(Object.prototype.toString.call(n)===`[object Date]`)return JR.datetime;if(typeof n==`string`&&(r=!0,n.split(RR).length>1))return JR.alphanumeric}return r?JR.text:JR.basic},e.getAutoSortDir=()=>typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id)==`string`?`asc`:`desc`,e.getSortingFn=()=>{if(!e)throw Error();return LL(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn===`auto`?e.getAutoSortingFn():t.options.sortingFns?.[e.columnDef.sortingFn]??JR[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),a=n!=null;t.setSorting(o=>{let s=o?.find(t=>t.id===e.id),c=o?.findIndex(t=>t.id===e.id),l=[],u,d=a?n:i===`desc`;return u=o!=null&&o.length&&e.getCanMultiSort()&&r?s?`toggle`:`add`:o!=null&&o.length&&c!==o.length-1?`replace`:s?`toggle`:`replace`,u===`toggle`&&(a||i||(u=`remove`)),u===`add`?(l=[...o,{id:e.id,desc:d}],l.splice(0,l.length-(t.options.maxMultiSortColCount??2**53-1))):l=u===`toggle`?o.map(t=>t.id===e.id?{...t,desc:d}:t):u===`remove`?o.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],l})},e.getFirstSortDir=()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??e.getAutoSortDir()===`desc`?`desc`:`asc`,e.getNextSortingOrder=n=>{let r=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==r&&(t.options.enableSortingRemoval??!0)&&(!n||(t.options.enableMultiRemove??!0))?!1:i===`desc`?`asc`:`desc`:r},e.getCanSort=()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,e.getCanMultiSort=()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,e.getIsSorted=()=>{let n=t.getState().sorting?.find(t=>t.id===e.id);return n?n.desc?`desc`:`asc`:!1},e.getSortIndex=()=>t.getState().sorting?.findIndex(t=>t.id===e.id)??-1,e.clearSorting=()=>{t.setSorting(t=>t!=null&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let 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=>{e.setSorting(t?[]:e.initialState?.sorting??[])},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())}},uR,ER,AR,MR,NR,vR];function XR(e){let t=[...YR,...e._features??[]],n={_features:t},r=n._features.reduce((e,t)=>Object.assign(e,t.getDefaultOptions==null?void 0:t.getDefaultOptions(n)),{}),i=e=>n.options.mergeOptions?n.options.mergeOptions(r,e):{...r,...e},a={...e.initialState??{}};n._features.forEach(e=>{a=(e.getInitialState==null?void 0:e.getInitialState(a))??a});let o=[],s=!1,c={_features:t,options:{...r,...e},initialState:a,_queue:e=>{o.push(e),s||(s=!0,Promise.resolve().then(()=>{for(;o.length;)o.shift()();s=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{n.options=i(FL(e,n.options))},getState:()=>n.options.state,setState:e=>{n.options.onStateChange==null||n.options.onStateChange(e)},_getRowId:(e,t,r)=>(n.options.getRowId==null?void 0:n.options.getRowId(e,t,r))??`${r?[r.id,t].join(`.`):t}`,getCoreRowModel:()=>(n._getCoreRowModel||=n.options.getCoreRowModel(n),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw Error();return r},_getDefaultColumnDef:BL(()=>[n.options.defaultColumn],e=>(e??={},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return((t=e.renderValue())==null||t.toString==null?void 0:t.toString())??null},...n._features.reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef==null?void 0:t.getDefaultColumnDef()),{}),...e}),VL(e,`debugColumns`,`_getDefaultColumnDef`)),_getColumnDefs:()=>n.options.columns,getAllColumns:BL(()=>[n._getColumnDefs()],e=>{let t=function(e,r,i){return i===void 0&&(i=0),e.map(e=>{let a=UL(n,e,i,r),o=e;return a.columns=o.columns?t(o.columns,a,i+1):[],a})};return t(e)},VL(e,`debugColumns`,`getAllColumns`)),getAllFlatColumns:BL(()=>[n.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),VL(e,`debugColumns`,`getAllFlatColumns`)),_getAllFlatColumnsById:BL(()=>[n.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),VL(e,`debugColumns`,`getAllFlatColumnsById`)),getAllLeafColumns:BL(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),VL(e,`debugColumns`,`getAllLeafColumns`)),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,c);for(let e=0;e<n._features.length;e++){let t=n._features[e];t==null||t.createTable==null||t.createTable(n)}return n}function ZR(){return e=>BL(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,a){i===void 0&&(i=0);let o=[];for(let c=0;c<t.length;c++){let l=JL(e,e._getRowId(t[c],c,a),t[c],c,i,void 0,a?.id);if(n.flatRows.push(l),n.rowsById[l.id]=l,o.push(l),e.options.getSubRows){var s;l.originalSubRows=e.options.getSubRows(t[c],c),(s=l.originalSubRows)!=null&&s.length&&(l.subRows=r(l.originalSubRows,i+1,l))}}return o};return n.rows=r(t),n},VL(e.options,`debugTable`,`getRowModel`,()=>e._autoResetPageIndex()))}function QR(e){let t=[],n=e=>{var r;t.push(e),(r=e.subRows)!=null&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function $R(){return(e,t)=>BL(()=>[e.getColumn(t)?.getFacetedRowModel()],e=>{if(!e)return;let n=e.flatRows.flatMap(e=>e.getUniqueValues(t)??[]).map(Number).filter(e=>!Number.isNaN(e));if(!n.length)return;let r=n[0],i=n[n.length-1];for(let e of n)e<r?r=e:e>i&&(i=e);return[r,i]},VL(e.options,`debugTable`,`getFacetedMinMaxValues`))}function ez(e,t,n){return n.options.filterFromLeafRows?tz(e,t,n):nz(e,t,n)}function tz(e,t,n){let r=[],i={},a=n.options.maxLeafRowFilterDepth??100,o=function(e,s){s===void 0&&(s=0);let c=[];for(let u=0;u<e.length;u++){var l;let d=e[u],f=JL(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(f.columnFilters=d.columnFilters,(l=d.subRows)!=null&&l.length&&s<a){if(f.subRows=o(d.subRows,s+1),d=f,t(d)&&!f.subRows.length){c.push(d),i[d.id]=d,r.push(d);continue}if(t(d)||f.subRows.length){c.push(d),i[d.id]=d,r.push(d);continue}}else d=f,t(d)&&(c.push(d),i[d.id]=d,r.push(d))}return c};return{rows:o(e),flatRows:r,rowsById:i}}function nz(e,t,n){let r=[],i={},a=n.options.maxLeafRowFilterDepth??100,o=function(e,s){s===void 0&&(s=0);let c=[];for(let u=0;u<e.length;u++){let d=e[u];if(t(d)){var l;if((l=d.subRows)!=null&&l.length&&s<a){let e=JL(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);e.subRows=o(d.subRows,s+1),d=e}c.push(d),r.push(d),i[d.id]=d}}return c};return{rows:o(e),flatRows:r,rowsById:i}}function rz(){return(e,t)=>BL(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,i)=>{if(!n.rows.length||!(r!=null&&r.length)&&!i)return n;let a=[...r.map(e=>e.id).filter(e=>e!==t),i?`__global__`:void 0].filter(Boolean);return ez(n.rows,e=>{for(let t=0;t<a.length;t++)if(e.columnFilters[a[t]]===!1)return!1;return!0},e)},VL(e.options,`debugTable`,`getFacetedRowModel`))}function iz(){return(e,t)=>BL(()=>[e.getColumn(t)?.getFacetedRowModel()],e=>{if(!e)return new Map;let n=new Map;for(let r=0;r<e.flatRows.length;r++){let i=e.flatRows[r].getUniqueValues(t);for(let e=0;e<i.length;e++){let t=i[e];n.has(t)?n.set(t,(n.get(t)??0)+1):n.set(t,1)}}return n},VL(e.options,`debugTable`,`getFacetedUniqueValues_${t}`))}function az(){return e=>BL(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}let i=[],a=[];(n??[]).forEach(t=>{let n=e.getColumn(t.id);if(!n)return;let r=n.getFilterFn();r&&i.push({id:t.id,filterFn:r,resolvedValue:(r.resolveFilterValue==null?void 0:r.resolveFilterValue(t.value))??t.value})});let o=(n??[]).map(e=>e.id),s=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());r&&s&&c.length&&(o.push(`__global__`),c.forEach(e=>{a.push({id:e.id,filterFn:s,resolvedValue:(s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))??r})}));let l,u;for(let e=0;e<t.flatRows.length;e++){let n=t.flatRows[e];if(n.columnFilters={},i.length)for(let e=0;e<i.length;e++){l=i[e];let t=l.id;n.columnFilters[t]=l.filterFn(n,t,l.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(a.length){for(let e=0;e<a.length;e++){u=a[e];let t=u.id;if(u.filterFn(n,t,u.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}n.columnFilters.__global__!==!0&&(n.columnFilters.__global__=!1)}}return ez(t.rows,e=>{for(let t=0;t<o.length;t++)if(e.columnFilters[o[t]]===!1)return!1;return!0},e)},VL(e.options,`debugTable`,`getFilteredRowModel`,()=>e._autoResetPageIndex()))}function oz(e){return e=>BL(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{if(!n.rows.length)return n;let{pageSize:r,pageIndex:i}=t,{rows:a,flatRows:o,rowsById:s}=n,c=r*i,l=c+r;a=a.slice(c,l);let u;u=e.options.paginateExpandedRows?{rows:a,flatRows:o,rowsById:s}:QR({rows:a,flatRows:o,rowsById:s}),u.flatRows=[];let d=e=>{u.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return u.rows.forEach(d),u},VL(e.options,`debugTable`,`getPaginationRowModel`))}function sz(){return e=>BL(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;let r=e.getState().sorting,i=[],a=r.filter(t=>e.getColumn(t.id)?.getCanSort()),o={};a.forEach(t=>{let n=e.getColumn(t.id);n&&(o[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let r=a[n],i=o[r.id],s=i.sortUndefined,c=r?.desc??!1,l=0;if(s){let n=e.getValue(r.id),i=t.getValue(r.id),a=n===void 0,o=i===void 0;if(a||o){if(s===`first`)return a?-1:1;if(s===`last`)return a?1:-1;l=a&&o?0:a?s:-s}}if(l===0&&(l=i.sortingFn(e,t,r.id)),l!==0)return c&&(l*=-1),i.invertSorting&&(l*=-1),l}return e.index-t.index}),t.forEach(e=>{var t;i.push(e),(t=e.subRows)!=null&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},VL(e.options,`debugTable`,`getSortedRowModel`,()=>e._autoResetPageIndex()))}function cz(e,t){return e?lz(e)?U.createElement(e,t):e:null}function lz(e){return uz(e)||typeof e==`function`||dz(e)}function uz(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function dz(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function fz(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=U.useState(()=>({current:XR(t)})),[r,i]=U.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),e.onStateChange==null||e.onStateChange(t)}})),n.current}var pz={À:`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`},mz=Object.keys(pz).join(`|`),hz=new RegExp(mz,`g`);function gz(e){return e.replace(hz,e=>pz[e])}var _z={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function vz(e,t,n){if(n||={},n.threshold=n.threshold??_z.MATCHES,!n.accessors){let r=yz(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}let r=Tz(e,n.accessors),i={rankedValue:e,rank:_z.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let e=0;e<r.length;e++){let a=r[e],o=yz(a.itemValue,t,n),{minRanking:s,maxRanking:c,threshold:l=n.threshold}=a.attributes;o<s&&o>=_z.MATCHES?o=s:o>c&&(o=c),o=Math.min(o,c),o>=l&&o>i.rank&&(i.rank=o,i.passed=!0,i.accessorIndex=e,i.accessorThreshold=l,i.rankedValue=a.itemValue)}return i}function yz(e,t,n){return e=Cz(e,n),t=Cz(t,n),t.length>e.length?_z.NO_MATCH:e===t?_z.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?_z.EQUAL:e.startsWith(t)?_z.STARTS_WITH:e.includes(` ${t}`)?_z.WORD_STARTS_WITH:e.includes(t)?_z.CONTAINS:t.length===1?_z.NO_MATCH:bz(e).includes(t)?_z.ACRONYM:xz(e,t))}function bz(e){let t=``;return e.split(` `).forEach(e=>{e.split(`-`).forEach(e=>{t+=e.substr(0,1)})}),t}function xz(e,t){let n=0,r=0;function i(e,t,r){for(let i=r,a=t.length;i<a;i++)if(t[i]===e)return n+=1,i+1;return-1}function a(e){let r=1/e,i=n/t.length;return _z.MATCHES+i*r}let o=i(t[0],e,0);if(o<0)return _z.NO_MATCH;r=o;for(let n=1,a=t.length;n<a;n++){let a=t[n];if(r=i(a,e,r),!(r>-1))return _z.NO_MATCH}return a(r-o)}function Sz(e,t){return e.rank===t.rank?0:e.rank>t.rank?-1:1}function Cz(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=gz(e)),e}function wz(e,t){let n=t;typeof t==`object`&&(n=t.accessor);let r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function Tz(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r],a=Dz(i),o=wz(e,i);for(let e=0,t=o.length;e<t;e++)n.push({itemValue:o[e],attributes:a})}return n}var Ez={maxRanking:1/0,minRanking:-1/0};function Dz(e){return typeof e==`function`?Ez:{...Ez,...e}}var Oz;(function(e){e.csv=`text/csv`,e.tsv=`text/tab-separated-values`,e.plain=`text/plain`})(Oz||={});var kz=e=>e,Az=e=>e,jz=kz,Mz=kz,Nz=kz,fee=kz,Pz=kz,Fz={fieldSeparator:`,`,decimalSeparator:`.`,quoteStrings:!0,quoteCharacter:`"`,showTitle:!1,title:`My Generated Report`,filename:`generated`,showColumnHeaders:!0,useTextFile:!1,fileExtension:`csv`,mediaType:Oz.csv,useBom:!0,columnHeaders:[],useKeysAsHeaders:!1,boolDisplay:{true:`TRUE`,false:`FALSE`},replaceUndefinedWith:``},Iz=`\r
- `,Lz=``,Rz=e=>Object.assign({},Fz,e),zz=class extends Error{constructor(e){super(e),this.name=`CsvGenerationError`}},Bz=class extends Error{constructor(e){super(e),this.name=`EmptyHeadersError`}},Vz=class extends Error{constructor(e){super(e),this.name=`UnsupportedDataFormatError`}},Hz=function(e,t){return t==`"`&&e.indexOf(`"`)>-1?e.replace(/"/g,`""`):e},Uz=e=>fee(typeof e==`object`?e.key:e),Wz=e=>Pz(typeof e==`object`?e.displayLabel:e),Gz=(e,...t)=>t.reduce((e,t)=>t(e),e),Kz=e=>t=>e.useBom?Mz(Az(t)+Lz):t,qz=e=>t=>e.showTitle?Jz(Mz(Az(t)+e.title))(Nz(``)):t,Jz=e=>t=>Mz(Az(e)+Az(t)+Iz),Yz=e=>(t,n)=>Xz(e)(Nz(Az(t)+Az(n))),Xz=e=>t=>kz(Az(t)+e.fieldSeparator),Zz=(e,t)=>n=>{if(!e.showColumnHeaders)return n;if(t.length<1)throw new Bz(`Option to show headers but none supplied. Make sure there are keys in your collection or that you've supplied headers through the config options.`);let r=Nz(``);for(let n=0;n<t.length;n++){let i=Wz(t[n]);r=Yz(e)(r,aB(e,Az(i)))}return r=Nz(Az(r).slice(0,-1)),Jz(n)(r)},Qz=(e,t,n)=>r=>{let i=r;for(var a=0;a<n.length;a++){let r=Nz(``);for(let i=0;i<t.length;i++){let o=Uz(t[i]),s=n[a][Az(o)];r=Yz(e)(r,aB(e,s))}r=Nz(Az(r).slice(0,-1)),i=Jz(i)(r)}return i},$z=Az,eB=e=>+e===e&&(!isFinite(e)||!!(e%1)),tB=(e,t)=>{if(eB(t)){if(e.decimalSeparator===`locale`)return jz(t.toLocaleString());if(e.decimalSeparator)return jz(t.toString().replace(`.`,e.decimalSeparator))}return jz(t.toString())},nB=(e,t)=>{let n=t;return(e.quoteStrings||e.fieldSeparator&&t.indexOf(e.fieldSeparator)>-1||e.quoteCharacter&&t.indexOf(e.quoteCharacter)>-1||t.indexOf(`
- `)>-1||t.indexOf(`\r`)>-1)&&(n=e.quoteCharacter+Hz(t,e.quoteCharacter)+e.quoteCharacter),jz(n)},rB=(e,t)=>{let n=t?`true`:`false`;return jz(e.boolDisplay[n])},iB=(e,t)=>t===void 0&&e.replaceUndefinedWith!==void 0?nB(e,e.replaceUndefinedWith+``):t===null?nB(e,`null`):nB(e,``),aB=(e,t)=>{if(typeof t==`number`)return tB(e,t);if(typeof t==`string`)return nB(e,t);if(typeof t==`boolean`&&e.boolDisplay)return rB(e,t);if(t==null)return iB(e,t);throw new Vz(`
- typeof ${typeof t} isn't supported. Only number, string, boolean, null and undefined are supported.
- Please convert the data in your object to one of those before generating the CSV.
- `)},oB=e=>t=>{let n=Rz(e),r=n.useKeysAsHeaders?Object.keys(t[0]):n.columnHeaders,i=Gz(Mz(``),Kz(n),qz(n),Zz(n,r),Qz(n,r,t));if(Az(i).length<1)throw new zz(`Output is empty. Is your data formatted correctly?`);return i};M(),H(),$r(),li();var sB=({thino:e})=>{let t=(0,U.useRef)(null);(0,U.useEffect)(()=>(t.current&&(0,f.setIcon)(t.current,`pin`),()=>{t.current&&=null}),[t]);let n=(0,U.useCallback)(async()=>{e.pinned?await V.unpinMemoById(e.id):await V.pinMemoById(e.id)},[e]);return(0,W.jsx)(`span`,{ref:t,className:x_(`pinned-status`,e.pinned?`pinned`:`not-pinned`),onClick:n})},cB=({thino:e})=>{let t=(0,U.useRef)(null);(0,U.useEffect)(()=>(t.current&&(0,f.setIcon)(t.current,e.thinoType===`JOURNAL`?`calendar`:`check-square`),()=>{t.current&&=null}),[t,e?.thinoType]);let n=(0,U.useCallback)(async()=>{if(e.thinoType===`JOURNAL`)return;let t=await V.updateMemo(e.id,e.content,e.thinoType===`TASK-TODO`?`TASK-DONE`:`TASK-TODO`);t&&V.editMemo(t)},[e]);return(0,W.jsx)(W.Fragment,{children:e.thinoType===`JOURNAL`?(0,W.jsx)(`span`,{ref:t,className:`thino-type-status`}):(0,W.jsx)(`input`,{className:x_(`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})})},lB=({id:e,path:t})=>{let n=(0,U.useRef)(null);return(0,U.useEffect)(()=>(n.current&&(0,f.setIcon)(n.current,`link`),()=>{n.current&&=null}),[]),(0,W.jsxs)(`span`,{className:`source-thino`,onClick:(0,U.useCallback)(()=>{!e||!t||V.openThinoByID(e)},[e,t]),children:[(0,W.jsx)(`span`,{children:t}),(0,W.jsx)(`span`,{ref:n,className:`source-thino-icon`})]})},uB=({id:e,sourceType:t})=>{let n=(0,U.useRef)(null);return(0,U.useEffect)(()=>(n.current&&(0,f.setIcon)(n.current,Qr.find(e=>e.title===t)?.icon||`list`),()=>{n.current&&=null}),[]),(0,W.jsx)(`span`,{ref:n,className:`source-type-icon`,onClick:(0,U.useCallback)(async()=>{e&&await V.openThinoByID(e)},[e])})},dB=(e,t,n,r)=>{let i=vz(e.getValue(t),n);return r({itemRank:i}),i.passed},fB=(e,t,n)=>{let r=0;return e.columnFiltersMeta[n]&&(r=Sz(e.columnFiltersMeta[n]?.itemRank,t.columnFiltersMeta[n]?.itemRank)),r===0?JR.alphanumeric(e,t,n):r},pB=Rz({fieldSeparator:`,`,decimalSeparator:`.`,useKeysAsHeaders:!0}),mB=e=>e+`
- `;function hB({thinos:e,isFiltering:t}){U.useReducer(()=>({}),{})[1];let[n,r]=U.useState([]),[i,a]=U.useState(``),o=U.useMemo(()=>[{header:j(`Basic Info`),footer:e=>e.column.id,columns:[{accessorKey:`createdAt`,header:()=>(0,W.jsx)(`span`,{className:`create-at-header-cell`,children:j(`Created At`)}),cell:e=>e.getValue(),footer:e=>e.column.id,enableColumnFilter:!1},{accessorFn:e=>e.content,id:`content`,header:()=>(0,W.jsx)(`span`,{className:`thino-header-cell`,children:j(`Thino`)}),cell:e=>(0,W.jsx)(gT,{memo:e.row.original,type:`table`}),footer:e=>e.column.id,filterFn:`fuzzy`,sortingFn:fB},{accessorFn:e=>e.thinoType,id:`thinoType`,cell:e=>(0,W.jsx)(cB,{thino:e.row.original}),header:()=>(0,W.jsx)(`span`,{children:j(`Thino Type`)}),footer:e=>e.column.id},{accessorFn:e=>e.sourceType,id:`sourceType`,cell:e=>(0,W.jsx)(uB,{id:e.row.original.id,sourceType:e.getValue()}),header:()=>(0,W.jsx)(`span`,{children:j(`Source Type`)}),footer:e=>e.column.id}]},{header:j(`Additional Info`),footer:e=>e.column.id,columns:[{accessorKey:`pinned`,header:()=>(0,W.jsx)(`span`,{children:j(`Pinned Status`)}),cell:e=>(0,W.jsx)(sB,{thino:e.row.original}),footer:e=>e.column.id,filterFn:`fuzzy`,sortingFn:fB},{accessorKey:`rowStatus`,header:()=>(0,W.jsx)(`span`,{children:j(`Row status`)}),cell:e=>(0,W.jsx)(`span`,{children:e.getValue()===`NORMAL`?``:e.getValue()}),footer:e=>e.column.id},{accessorKey:`path`,header:()=>j(`Path`),cell:e=>(0,W.jsx)(lB,{id:e.row.original.id,path:e.getValue()}),footer:e=>e.column.id}]}],[]),[s,c]=U.useState(()=>e),l=()=>c(t=>e);(0,U.useEffect)(()=>{l()},[e]);let u=fz({data:s,columns:o,filterFns:{fuzzy:dB},initialState:{pagination:{pageSize:20}},state:{columnFilters:n,globalFilter:i},onColumnFiltersChange:r,onGlobalFilterChange:a,globalFilterFn:dB,getCoreRowModel:ZR(),getFilteredRowModel:az(),getSortedRowModel:sz(),getPaginationRowModel:oz(),getFacetedRowModel:rz(),getFacetedUniqueValues:iz(),getFacetedMinMaxValues:$R(),debugTable:!1,debugHeaders:!1,debugColumns:!1});U.useEffect(()=>{u.getState().columnFilters[0]?.id===`createdAt`&&u.getState().sorting[0]?.id!==`createdAt`&&u.setSorting([{id:`createdAt`,desc:!1}])},[u.getState().columnFilters[0]?.id]);async function d(e,t){let n=j(`Created At`),r=j(`Updated At`),i=j(`Content`),a=j(`Path`),o=e.map(e=>({[n]:e.createdAt,[r]:e.updatedAt,[i]:e.content,Thino:`=hyperlink("obsidian://thino?openId=${e.id}","${e.id}")`,[a]:`=hyperlink("obsidian://open?path=${(0,f.normalizePath)(e.path)},"${e.path}")`})),s=oB(pB)(o),c=L.getState().app||window.app,l=mB($z(s));return{file:await c.vault.create(`${t}-${N.randomId(6)}.csv`,l),app:c}}async function p(e){let{file:t,app:n}=await d(e.map(e=>e.original),`thino-export`),r=document.createDocumentFragment(),i=r.createEl(`div`,{cls:`export-file-btn-group`});r.createEl(`div`,{cls:`open-file-button`}),new f.Setting(i).setName(j(`Exported CSV file`)).addButton(e=>{e.setButtonText(j(`Open File`)).onClick(()=>{let e=(0,f.normalizePath)(t.path);n.openWithDefaultApp(e)})}),new f.Notice(r)}return(0,W.jsxs)(`div`,{className:`table-view`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(vB,{value:i||``,onChange:e=>a(String(e)),className:`table-search-bar`,placeholder:j(`Search all columns...`)}),f.Platform.isDesktop&&(i||n.length>0||t)&&(0,W.jsx)(`button`,{className:`mod-cta`,disabled:u.getPrePaginationRowModel().rows.length===0,onClick:()=>p(u.getPrePaginationRowModel().rows),children:j(`Export to CSV`)})]}),(0,W.jsxs)(`table`,{className:`thino-table`,children:[(0,W.jsx)(`thead`,{children:u.getHeaderGroups().map(e=>(0,W.jsx)(`tr`,{children:e.headers.map(e=>(0,W.jsx)(`th`,{colSpan:e.colSpan,children:e.isPlaceholder?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:x_(e.column.getCanSort()?`filter-header`:``,`table-header`,e.column.id===`content`?`content-header`:``),onClick:e.column.getToggleSortingHandler(),children:[cz(e.column.columnDef.header,e.getContext()),{asc:` 🔼`,desc:` 🔽`}[e.column.getIsSorted()]??null]}),e.column.getCanFilter()?(0,W.jsx)(_B,{column:e.column,table:u}):null]})},e.id))},e.id))}),(0,W.jsx)(`tbody`,{children:u.getRowModel().rows.map(e=>(0,W.jsx)(`tr`,{className:x_(e.getValue(`pinned`)?`pinned`:``),children:e.getVisibleCells().map(e=>(0,W.jsx)(`td`,{children:cz(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]}),(0,W.jsxs)(`div`,{className:`table-nav-bar`,children:[(0,W.jsx)(`button`,{className:`prev-start-btn`,onClick:()=>u.setPageIndex(0),disabled:!u.getCanPreviousPage(),children:`<<`}),(0,W.jsx)(`button`,{className:`prev-btn`,onClick:()=>u.previousPage(),disabled:!u.getCanPreviousPage(),children:`<`}),(0,W.jsx)(`button`,{className:`next-btn`,onClick:()=>u.nextPage(),disabled:!u.getCanNextPage(),children:`>`}),(0,W.jsx)(`button`,{className:`next-end-btn`,onClick:()=>u.setPageIndex(u.getPageCount()-1),disabled:!u.getCanNextPage(),children:`>>`}),(0,W.jsxs)(`span`,{className:`table-page-info`,children:[(0,W.jsx)(`div`,{children:j(`Page`)}),(0,W.jsxs)(`strong`,{children:[u.getState().pagination.pageIndex+1,` of `,u.getPageCount()]})]}),(0,W.jsxs)(`span`,{className:`table-page-jump`,children:[`| `,j(`Go to page`),`:`,(0,W.jsx)(`input`,{type:`number`,defaultValue:u.getState().pagination.pageIndex+1,onChange:e=>{let t=e.target.value?Number(e.target.value)-1:0;u.setPageIndex(t)},className:`jump-inputer`})]}),(0,W.jsx)(`select`,{value:u.getState().pagination.pageSize,onChange:e=>{u.setPageSize(Number(e.target.value))},children:[10,20,30,40,50].map(e=>(0,W.jsxs)(`option`,{value:e,children:[j(`Show`),` `,e,` `,j(`rows`)]},e))})]})]})}var gB=e=>e===`sourceType`?[`ALL`]:[`ALL`,`ALL-TASK`];function _B({column:e,table:t}){let n=t.getPreFilteredRowModel().flatRows[0]?.getValue(e.id),r=e.getFilterValue(),i=U.useMemo(()=>typeof n==`number`?[]:Array.from(e.getFacetedUniqueValues().keys()).sort(),[e.getFacetedUniqueValues()]);return typeof n==`number`?(0,W.jsx)(`div`,{children:(0,W.jsxs)(`div`,{className:`filter-input-group`,children:[(0,W.jsx)(vB,{type:`number`,min:Number(e.getFacetedMinMaxValues()?.[0]??``),max:Number(e.getFacetedMinMaxValues()?.[1]??``),value:r?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min ${e.getFacetedMinMaxValues()?.[0]?`(${e.getFacetedMinMaxValues()?.[0]})`:``}`,className:`filter-input-short`}),(0,W.jsx)(vB,{type:`number`,min:Number(e.getFacetedMinMaxValues()?.[0]??``),max:Number(e.getFacetedMinMaxValues()?.[1]??``),value:r?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max ${e.getFacetedMinMaxValues()?.[1]?`(${e.getFacetedMinMaxValues()?.[1]})`:``}`,className:`filter-input-short`})]})}):(0,W.jsx)(W.Fragment,{children:i.length>1?(0,W.jsxs)(W.Fragment,{children:[e.id!==`path`&&e.id!==`content`&&e.id!==`thinoType`&&e.id!==`sourceType`&&(0,W.jsx)(`datalist`,{id:e.id+`list`,children:i.slice(0,5e3).map(e=>(0,W.jsx)(`option`,{value:e},e))}),e.id===`thinoType`||e.id===`sourceType`?(0,W.jsx)(`select`,{id:e.id,onChange:t=>e.setFilterValue(t.target.value===`ALL`?``:t.target.value===`ALL-TASK`?`TASK`:t.target.value),children:[...gB(e.id),...i].map(e=>(0,W.jsx)(`option`,{value:e,children:j(e)||e},e))}):``,e.id!==`thinoType`&&e.id!==`sourceType`?(0,W.jsx)(vB,{type:`text`,value:r??``,onChange:t=>e.setFilterValue(t),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,className:`filter-input-long`,list:e.id+`list`}):``]}):``})}function vB({value:e,onChange:t,debounce:n=500,...r}){let[i,a]=U.useState(e);return U.useEffect(()=>{a(e)},[e]),U.useEffect(()=>{let e=setTimeout(()=>{t(i)},n);return()=>clearTimeout(e)},[i]),(0,W.jsx)(`input`,{...r,value:i,onChange:e=>a(e.target.value)})}var yB=(0,U.createContext)(null),bB=()=>{let e=(0,U.useContext)(yB);if(!e)throw Error(`useScroll must be used within ScrollProvider`);return e},xB=({children:e,scrollRef:t})=>{let n=(0,U.useMemo)(()=>({scrollToTop:e=>{t.current?.scrollToTop(e)},scrollToBottom:e=>{t.current?.scrollToBottom(e)},scrollToPosition:(e,n)=>{t.current?.scrollToPosition(e,n)}}),[t]),r=(0,U.useRef)(n),i=(0,U.useCallback)(e=>(r.current={scrollToTop:e.scrollToTop||n.scrollToTop,scrollToBottom:e.scrollToBottom||n.scrollToBottom,scrollToPosition:e.scrollToPosition||n.scrollToPosition},()=>{r.current=n}),[n]),a=(0,U.useCallback)(e=>{r.current.scrollToTop(e)},[]),o=(0,U.useCallback)(e=>{r.current.scrollToBottom(e)},[]),s=(0,U.useCallback)((e,t)=>{r.current.scrollToPosition(e,t)},[]),c=(0,U.useCallback)(()=>t.current?.getScrollElement()||null,[t]),l=(0,U.useMemo)(()=>({scrollRef:t,scrollToTop:a,scrollToBottom:o,scrollToPosition:s,getScrollElement:c,registerScrollController:i}),[t,a,o,s,c,i]);return(0,W.jsx)(yB.Provider,{value:l,children:e})};H(),M();var SB=()=>{let e=Ew(e=>e.selectedMessageIds),t=Ew(e=>e.conversations),n=(0,U.useMemo)(()=>t.flatMap(e=>e.messages).filter(t=>e.includes(t.id)).sort((e,t)=>e.timestamp-t.timestamp),[e,t]),r=(0,U.useCallback)(async()=>{if(n.length===0)return;let e=n.map(e=>e.content).join(`
- ---
- `);try{let t=await V.createMemoDaily(e,!0);t&&(V.pushMemo(t),Ew.getState().clearMessageSelection(),new f.Notice(j(`Thino created from Super messages`)))}catch(e){new f.Notice(`Failed to create thino: ${e.message}`)}},[n]),i=(0,U.useCallback)(()=>{Ew.getState().clearMessageSelection()},[]);return e.length===0?null:(0,W.jsxs)(`div`,{className:`super-selection-toolbar`,children:[(0,W.jsxs)(`span`,{className:`super-selection-count`,children:[e.length,` message`,e.length>1?`s`:``,` selected`]}),(0,W.jsxs)(`div`,{className:`super-selection-actions`,children:[(0,W.jsx)(`button`,{className:`super-create-thino-btn clickable-icon`,onClick:r,children:`Create Thino`}),(0,W.jsx)(`button`,{className:`super-cancel-btn clickable-icon`,onClick:i,children:`Cancel`})]})]})},CB=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),wB=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),TB={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},EB=(0,U.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,U.createElement)(`svg`,{ref:c,...TB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:wB(`lucide`,i),...s},[...o.map(([e,t])=>(0,U.createElement)(e,t)),...Array.isArray(a)?a:[a]])),DB=(e,t)=>{let n=(0,U.forwardRef)(({className:n,...r},i)=>(0,U.createElement)(EB,{ref:i,iconNode:t,className:wB(`lucide-${CB(e)}`,n),...r}));return n.displayName=`${e}`,n},OB=DB(`Brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),kB=DB(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),AB=DB(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),jB=DB(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),MB=DB(`SquarePen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),NB=DB(`TrendingUp`,[[`polyline`,{points:`22 7 13.5 15.5 8.5 10.5 2 17`,key:`126l90`}],[`polyline`,{points:`16 7 22 7 22 13`,key:`kwv8wd`}]]),PB={search_memos:`Searched memos`,filter_memos:`Filtered memos`,get_memo:`Read memo`,get_related_memos:`Found related memos`,generate_image:`Generated image`,summarize_text:`Summarized text`,summarize_url:`Summarized URL`,delegate_fast:`Delegated task`},FB={search_memos:`Searching memos`,filter_memos:`Filtering memos`,get_memo:`Reading memo`,get_related_memos:`Finding related memos`,generate_image:`Generating image`,summarize_text:`Summarizing text`,summarize_url:`Summarizing URL`,delegate_fast:`Delegating task`};function IB(e){let t=[];for(let n of e.matchAll(/!\[([^\]]*)\]\((https?:\/\/[^)]+)\)/g))t.push({url:n[2],alt:n[1]||void 0});if(t.length===0)for(let n of e.matchAll(/(https?:\/\/[^\s"'<>]+\.(?:png|jpe?g|gif|webp|svg|bmp)(?:\?[^\s"'<>]*)?)/gi))t.push({url:n[1]});return t}var LB=({toolCall:e})=>{let[t,n]=(0,U.useState)(e.name===`generate_image`&&e.status===`completed`),r=e.status===`running`||e.status===`pending`,i=r?FB[e.name]||e.name:PB[e.name]||e.name,a=e.parsedArgs?.query?`${e.parsedArgs.query}`:e.parsedArgs?.tag?`${e.parsedArgs.tag}`:e.parsedArgs?.memo_id?`#${e.parsedArgs.memo_id}`:e.parsedArgs?.prompt?`${e.parsedArgs.prompt.slice(0,60)}`:e.parsedArgs?.url?`${e.parsedArgs.url}`:e.parsedArgs?.task?`${e.parsedArgs.task.slice(0,60)}`:null,o=(0,U.useMemo)(()=>e.name!==`generate_image`||!e.result?[]:IB(e.result),[e.name,e.result]),s=e.name===`generate_image`&&o.length>0;(0,U.useEffect)(()=>{s&&!t&&n(!0)},[s]);let c=async(e,t)=>{t.stopPropagation();try{let t=document.createElement(`a`);t.href=e,t.download=`generated-image-${Date.now()}.jpg`,t.target=`_blank`,document.body.appendChild(t),t.click(),document.body.removeChild(t)}catch(e){console.warn(`[ToolCallCard] Download failed:`,e)}};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`super-tool-inline ${e.status}`,onClick:()=>!r&&e.result&&n(!t),children:[(0,W.jsx)(MB,{size:16,className:`super-tool-icon`}),(0,W.jsx)(`span`,{className:x_(`super-tool-label`,r&&`running`),children:i}),a&&(0,W.jsx)(`span`,{className:`super-tool-query`,children:a})]}),t&&e.result&&(s?(0,W.jsx)(`div`,{className:`super-tool-image-result`,children:o.map((e,t)=>(0,W.jsxs)(`div`,{className:`super-tool-image-wrapper`,children:[(0,W.jsx)(`img`,{src:e.url,alt:e.alt||`Generated image`,loading:`lazy`}),(0,W.jsx)(`button`,{className:`super-tool-image-download`,onClick:t=>c(e.url,t),title:`Download image`,children:(0,W.jsx)(jB,{size:16})})]},t))}):(0,W.jsx)(`pre`,{className:`super-tool-result`,children:e.result}))]})},RB=({reasoning:e,isStreaming:t})=>{let[n,r]=(0,U.useState)(!1);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`super-tool-inline ${t?`running`:`completed`}`,onClick:()=>!t&&r(!n),children:[(0,W.jsx)(OB,{size:16,className:`super-tool-icon`}),(0,W.jsx)(`span`,{className:x_(`super-tool-label`,t&&`running`),children:t?`Thinking...`:`Thought`})]}),n&&!t&&(0,W.jsx)(`pre`,{className:`super-tool-result`,children:e})]})};Rg();var zB=()=>{let e=B(e=>e.searchResults),t=B(e=>e.searchQuery),n=B(e=>e.isSearching);return!t.trim()||n?null:e.length===0?(0,W.jsx)(`div`,{className:`super-results super-results-empty`,children:(0,W.jsx)(`span`,{children:`No matching thinos found.`})}):(0,W.jsxs)(`div`,{className:`super-results`,children:[(0,W.jsx)(`div`,{className:`super-results-header`,children:(0,W.jsxs)(`span`,{className:`super-results-count`,children:[e.length,` results`]})}),(0,W.jsx)(`div`,{className:`super-results-list`,children:e.map(e=>(0,W.jsxs)(`div`,{className:`super-result-item`,children:[(0,W.jsx)(`div`,{className:`super-result-score`,children:e.score<0?`text`:`${(e.score*100).toFixed(0)}%`}),(0,W.jsx)(`div`,{className:`super-result-content`,children:e.memo?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`super-result-date`,children:e.memo.createdAt}),(0,W.jsx)(`div`,{className:`super-result-text`,children:e.memo.content.length>200?e.memo.content.slice(0,200)+`...`:e.memo.content})]}):(0,W.jsx)(`div`,{className:`super-result-text`,children:e.entry.content})})]},e.entry.id))})]})};Rg();var BB=()=>{let e=(0,U.useCallback)(()=>{B.getState().setEnabled(!0)},[]);return(0,W.jsxs)(`div`,{className:`super-panel super-enable-prompt`,children:[(0,W.jsx)(`div`,{className:`super-enable-icon`,children:(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`})})}),(0,W.jsx)(`h3`,{className:`super-enable-title`,children:`Thino Super`}),(0,W.jsx)(`p`,{className:`super-enable-desc`,children:`AI-powered semantic search and chat for your thinos. Find memos by meaning, not just keywords.`}),(0,W.jsxs)(`ul`,{className:`super-enable-features`,children:[(0,W.jsx)(`li`,{children:`Semantic search across all your thinos`}),(0,W.jsx)(`li`,{children:`AI chat with context from your notes`}),f.Platform.isDesktop&&(0,W.jsx)(`li`,{children:`Local AI model with WebGPU acceleration`}),(0,W.jsx)(`li`,{children:`API support for OpenAI and Anthropic`})]}),(0,W.jsx)(`button`,{className:`super-enable-btn mod-cta`,onClick:e,children:`Enable Super`})]})};Rg();var VB=({onDownload:e})=>{let t=B(e=>e.assetDownloading),n=B(e=>e.assetDownloadProgress),r=B(e=>e.assetDownloadStatus),i=B(e=>e.assetDownloadError),a=(0,U.useCallback)(()=>{e()},[e]);return(0,W.jsxs)(`div`,{className:`super-panel super-download-prompt`,children:[(0,W.jsx)(`div`,{className:`super-download-icon`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`40`,height:`40`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,W.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,W.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})}),(0,W.jsx)(`h3`,{className:`super-download-title`,children:`Download AI Engine`}),(0,W.jsx)(`p`,{className:`super-download-desc`,children:`Super requires a local AI model to work offline. The following files will be downloaded and stored in the plugin directory (~50 MB total).`}),(0,W.jsxs)(`ul`,{className:`super-download-list`,children:[(0,W.jsx)(`li`,{children:`WASM inference runtime (~22 MB)`}),(0,W.jsx)(`li`,{children:`Embedding model (~25 MB)`})]}),!t&&!i&&(0,W.jsx)(`button`,{className:`super-download-btn mod-cta`,onClick:a,children:`Download to Local`}),t&&(0,W.jsxs)(`div`,{className:`super-download-progress`,children:[(0,W.jsx)(`div`,{className:`super-download-bar-wrapper`,children:(0,W.jsx)(`div`,{className:`super-download-bar`,style:{width:`${n}%`}})}),(0,W.jsxs)(`span`,{className:`super-download-status`,children:[r||`Downloading...`,` (`,n,`%)`]})]}),i&&(0,W.jsxs)(`div`,{className:`super-download-error`,children:[(0,W.jsxs)(`p`,{children:[`Download failed: `,i]}),(0,W.jsx)(`button`,{className:`super-download-btn`,onClick:a,children:`Retry`})]})]})};Rg();function HB(e){let t=e.find(e=>e.role===`user`);return t?t.content.length>40?t.content.slice(0,40)+`...`:t.content:`Inline Chat`}var UB=()=>{let e=B(e=>e.conversations),t=B(e=>e.activeConversationId),n=Ew(e=>e.conversations),r=(0,U.useMemo)(()=>{let t=e.map(e=>({id:e.id,title:e.title,updatedAt:e.updatedAt,source:`super`})),r=n.filter(e=>e.messages.length>0).map(e=>({id:e.id,title:HB(e.messages),updatedAt:e.updatedAt,source:`inline`}));return[...t,...r].sort((e,t)=>t.updatedAt-e.updatedAt)},[e,n]),i=(0,U.useCallback)(e=>{if(e.source===`super`)B.getState().setActiveConversation(e.id);else{let t=Ew.getState().conversations.find(t=>t.id===e.id);if(!t)return;let n=t.messages.map(e=>({id:e.id,role:e.role,content:e.content,timestamp:e.timestamp,isStreaming:!1,toolCalls:e.toolCalls}));B.getState().loadExternalMessages(n)}},[]),a=(0,U.useCallback)((e,t)=>{t.stopPropagation(),e.source===`super`?B.getState().deleteConversation(e.id):Ew.getState().removeConversation(e.id)},[]);return r.length===0?(0,W.jsx)(`div`,{className:`super-conversation-list`,children:(0,W.jsx)(`div`,{className:`super-conversation-empty`,children:`No conversations yet`})}):(0,W.jsx)(`div`,{className:`super-conversation-list`,children:(0,W.jsx)(`div`,{className:`super-conversation-items`,children:r.map(e=>(0,W.jsxs)(`div`,{className:`super-conversation-item ${e.source===`super`&&e.id===t?`active`:``}`,onClick:()=>i(e),children:[(0,W.jsxs)(`span`,{className:`super-conversation-title`,children:[e.source===`inline`&&(0,W.jsx)(`span`,{className:`super-conversation-badge`,children:`Inline`}),e.title]}),(0,W.jsx)(`span`,{className:`super-conversation-date`,children:new Date(e.updatedAt).toLocaleDateString()}),(0,W.jsx)(`button`,{className:`super-conversation-delete clickable-icon`,onClick:t=>a(e,t),"aria-label":`Delete conversation`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M18 6 6 18`}),(0,W.jsx)(`path`,{d:`m6 6 12 12`})]})})]},e.id))})})};Rg(),I(),zv(),M();var WB=({plugin:e})=>{let t=B(e=>e.enabled),n=B(e=>e.wasmReady),r=B(e=>e.modelReady),i=B(e=>e.embeddingReady),a=B(e=>e.activeEmbeddingProvider),o=F(e=>e.verifyState),[s,c]=(0,U.useState)(!1);(0,U.useEffect)(()=>{(async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),t=f.Platform.isDesktop?await Pv():e?.identifier||e?.uuid;c(!!(o&&o?.appId===t))})()},[o]);let l=(0,U.useCallback)(()=>{fv.downloadAssets().catch(console.warn)},[]),[u,d]=(0,U.useState)(!1),p=(0,U.useCallback)(()=>{e.settingTab.openSettingsModal(`super`)},[e]),m=(0,U.useCallback)(()=>{B.getState().createConversation(),d(!1)},[]);return s?t?f.Platform.isDesktop&&a===`local`&&(!n||!r)?(0,W.jsx)(VB,{onDownload:l}):(0,W.jsxs)(`div`,{className:`super-panel`,children:[(0,W.jsxs)(`div`,{className:`super-header`,children:[(0,W.jsx)(`h4`,{className:`super-title`,children:`Super`}),(0,W.jsxs)(`div`,{className:`super-header-actions`,children:[(0,W.jsx)(`button`,{className:`super-chat-history-btn clickable-icon`,onClick:()=>d(!u),"aria-label":`Chat history`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,W.jsx)(`path`,{d:`M3 3v5h5`}),(0,W.jsx)(`path`,{d:`M12 7v5l4 2`})]})}),(0,W.jsx)(`button`,{className:`super-chat-new clickable-icon`,onClick:m,"aria-label":`New chat`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M12 5v14`}),(0,W.jsx)(`path`,{d:`M5 12h14`})]})}),(0,W.jsx)(`button`,{className:`super-settings-btn clickable-icon`,onClick:p,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})})]})]}),u&&(0,W.jsx)(UB,{}),!i&&(0,W.jsx)(GB,{}),(0,W.jsx)(zB,{}),(0,W.jsx)(`div`,{className:`super-divider`}),(0,W.jsx)(bV,{plugin:e,showHistory:u})]}):(0,W.jsx)(BB,{}):(0,W.jsxs)(`div`,{className:`super-panel super-enable-prompt`,children:[(0,W.jsx)(`div`,{className:`super-enable-icon`,children:(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`})})}),(0,W.jsx)(`h3`,{className:`super-enable-title`,children:`Thino Super`}),(0,W.jsx)(`p`,{className:`super-enable-desc`,children:j(`This is a pro feature, please upgrade to pro version to use it.`)})]})},GB=()=>{let e=B(e=>e.loadingStatus),t=B(e=>e.loadingProgress);return(0,W.jsxs)(`div`,{className:`super-model-loading`,children:[(0,W.jsxs)(`div`,{className:`super-model-loading-header`,children:[(0,W.jsx)(`div`,{className:`super-loading-spinner`,style:{width:14,height:14,borderWidth:2}}),(0,W.jsx)(`span`,{children:e||`Loading model...`})]}),t>0&&t<100&&(0,W.jsx)(`div`,{className:`super-loading-bar-wrapper`,children:(0,W.jsx)(`div`,{className:`super-loading-bar`,style:{width:`${t}%`}})})]})},KB=`thino-super-view`,qB=class extends f.ItemView{root=null;plugin;constructor(e,t){super(e),this.plugin=t}getDisplayText(){return`Thino Super`}getIcon(){return`sparkles`}getViewType(){return KB}async onOpen(){let e=this.containerEl.children[1];e.empty(),e.addClass(`thino-super-view`),this.root=u_.createRoot(e),this.root.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(WB,{plugin:this.plugin})}))}async onClose(){this.root?.unmount(),this.root=null}},JB=[KB,`thino_view`],YB=300,XB=({content:e,isStreaming:t,app:n,className:r})=>{let i=(0,U.useRef)(null),a=(0,U.useRef)(null),o=(0,U.useRef)(``);return(0,U.useEffect)(()=>{if(!i.current||!e)return;let r=()=>{if(!i.current||e===o.current)return;let t=null;for(let e of JB)if(t=n.workspace.getLeavesOfType(e)[0]?.view,t)break;if(!t){i.current.textContent=e;return}i.current.empty(),f.MarkdownRenderer.render(n,e,i.current,``,t),i.current.querySelectorAll(`.internal-link`).forEach(e=>{let r=e,i=r.getAttribute(`data-href`);i&&(n.metadataCache.getFirstLinkpathDest(i,``)||e.classList.add(`is-unresolved`),r.addEventListener(`mouseover`,e=>{e.stopPropagation(),n.workspace.trigger(`hover-link`,{event:e,source:`thino-super`,hoverParent:t.containerEl,targetEl:r,linktext:i,sourcePath:``})}))}),i.current.classList.add(`markdown-rendered`),o.current=e};return t?(a.current&&clearTimeout(a.current),a.current=setTimeout(r,YB)):(a.current&&clearTimeout(a.current),r()),()=>{a.current&&clearTimeout(a.current)}},[e,t,n]),(0,W.jsx)(`div`,{ref:i,className:r||`super-chat-message-content`})};fn();var ZB=rn(`thino-image-cache`,`generated-images`),QB=720*60*60*1e3,$B={async put(e){let t=`img-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return await sn(t,{...e,id:t,createdAt:Date.now()},ZB),t},async get(e){return on(e,ZB)},async remove(e){await cn(e,ZB)},createObjectUrl(e){let t=atob(e.base64),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);let r=new Blob([n],{type:e.mimeType});return URL.createObjectURL(r)},toDataUrl(e){return`data:${e.mimeType};base64,${e.base64}`},async evictOld(){let e=Date.now()-QB,t=await un(ZB),n=0;for(let r of t){let t=await on(r,ZB);t&&t.createdAt<e&&(await cn(r,ZB),n++)}return n}},eV=/data:(image\/(?:png|jpe?g|gif|webp|svg\+xml));base64,([A-Za-z0-9+/=\s]+)/g,tV=/!\[([^\]]*)\]\((data:image\/(?:png|jpe?g|gif|webp|svg\+xml);base64,[A-Za-z0-9+/=\s]+)\)/g,nV=/!\[([^\]]*)\]\((https?:\/\/[^\s)]+\.(?:png|jpe?g|gif|webp|svg)(?:\?[^\s)]*)?)\)/g;function rV(e){let t=[],n=e;for(let n of e.matchAll(tV)){let e=n[2].match(/^data:(image\/[^;]+);base64,(.+)$/s);e&&t.push({match:n[0],mimeType:e[1],base64:e[2].replace(/\s/g,``),alt:n[1]||void 0})}if(t.length===0)for(let n of e.matchAll(eV))t.some(e=>e.match.includes(n[0]))||t.push({match:n[0],mimeType:n[1],base64:n[2].replace(/\s/g,``)});for(let e=0;e<t.length;e++)n=n.replace(t[e].match,`[generated-image:${e}]`);return{images:t,cleanContent:n}}function iV(e){let t=[];for(let n of e.matchAll(nV))t.push({url:n[2],alt:n[1]||``});return t}var aV=({images:e})=>{let[t,n]=(0,U.useState)(new Map),[r,i]=(0,U.useState)(null);(0,U.useEffect)(()=>{let t=!1,r=new Map;return(async()=>{for(let n of e){let e=await $B.get(n.cacheId);if(t)break;if(e){let t=$B.createObjectUrl(e);r.set(n.cacheId,t)}}t||n(new Map(r))})(),()=>{t=!0;for(let e of r.values())URL.revokeObjectURL(e)}},[e]);let a=(0,U.useCallback)(e=>{i(e)},[]),o=(0,U.useCallback)(()=>{i(null)},[]),s=(0,U.useCallback)(async e=>{let t=await $B.get(e);if(!t)return;let n=`generated-${e}.${t.mimeType.split(`/`)[1]?.replace(`jpeg`,`jpg`)||`png`}`,r=atob(t.base64),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);let a=new Blob([i],{type:t.mimeType}),o=document.createElement(`a`),s=URL.createObjectURL(a);o.href=s,o.download=n,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(s)},[]);return e.length===0?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`super-generated-images ${e.length===1?`single`:`grid`}`,children:e.map(e=>{let n=t.get(e.cacheId);return(0,W.jsx)(`div`,{className:`super-generated-image-wrap`,children:n?(0,W.jsx)(`img`,{src:n,alt:e.alt||`Generated image`,className:`super-generated-image`,onClick:()=>a(e.cacheId),loading:`lazy`}):(0,W.jsx)(`div`,{className:`super-generated-image-loading`,children:(0,W.jsx)(`span`,{children:`Loading...`})})},e.cacheId)})}),r&&t.get(r)&&(0,W.jsx)(`div`,{className:`super-image-lightbox`,onClick:o,children:(0,W.jsxs)(`div`,{className:`super-image-lightbox-content`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(`img`,{src:t.get(r),alt:`Generated image preview`,className:`super-image-lightbox-img`}),(0,W.jsxs)(`div`,{className:`super-image-lightbox-actions`,children:[(0,W.jsx)(`button`,{className:`clickable-icon super-image-lightbox-btn`,onClick:()=>s(r),"aria-label":`Save image`,children:(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,W.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,W.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})}),(0,W.jsx)(`button`,{className:`clickable-icon super-image-lightbox-btn`,onClick:o,"aria-label":`Close`,children:(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,W.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})]})})]})},oV=({images:e})=>{let[t,n]=(0,U.useState)(null);return e.length===0?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`super-generated-images ${e.length===1?`single`:`grid`}`,children:e.map((e,t)=>(0,W.jsx)(`div`,{className:`super-generated-image-wrap`,children:(0,W.jsx)(`img`,{src:e.url,alt:e.alt||`Generated image`,className:`super-generated-image`,onClick:()=>n(e.url),loading:`lazy`})},t))}),t&&(0,W.jsx)(`div`,{className:`super-image-lightbox`,onClick:()=>n(null),children:(0,W.jsxs)(`div`,{className:`super-image-lightbox-content`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(`img`,{src:t,alt:`Image preview`,className:`super-image-lightbox-img`}),(0,W.jsx)(`div`,{className:`super-image-lightbox-actions`,children:(0,W.jsx)(`button`,{className:`clickable-icon super-image-lightbox-btn`,onClick:()=>n(null),"aria-label":`Close`,children:(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,W.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})})]})})]})};I();var sV=12;function cV(e,t){let n=e.slice(0,t);for(let e=n.length-1;e>=0;e--){let t=n[e];if(t===`
- `)break;if(t===`@`||t===`#`){if(e===0||/\s/.test(n[e-1])){let r=n.slice(e+1);return r.length>60?null:{kind:t===`@`?`thino`:`file`,triggerIndex:e,query:r}}break}}return null}var lV=class extends ix{app;detection=null;onMentionSelect;constructor(e,t,n){super(t),this.app=e,this.onMentionSelect=n,this.placement=`top-start`}getSuggestions(e){let t=this.inputEl.selectionStart??this.inputEl.value.length;return this.detection=cV(this.inputEl.value,t),this.detection?this.detection.kind===`thino`?uV(this.detection.query):fV(this.app,this.detection.query):[]}renderSuggestion(e,t){t.addClass(`super-suggest-item`);let n=t.createSpan({cls:`super-suggest-icon`});n.textContent=e.kind===`thino`?`@`:`#`;let r=t.createDiv({cls:`super-suggest-body`});r.createSpan({cls:`super-suggest-label`,text:e.label}),r.createSpan({cls:`super-suggest-secondary`,text:e.secondary})}selectSuggestion(e){if(!this.detection)return;let t=this.inputEl.value,n=t.slice(0,this.detection.triggerIndex),r=n+t.slice(this.detection.triggerIndex+1+this.detection.query.length),i=n.length;this.onMentionSelect({kind:e.kind,id:e.id,label:e.label,content:e.content},r,i),this.close()}updateOnSelect(e){this.onMentionSelect=e}};function uV(e){let t=P.getState().memos.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`);if(!e)return t.slice(0,sV).map(dV);let n=(0,f.prepareFuzzySearch)(e),r=[];for(let e of t){let t=n(e.content);t&&r.push({item:e,score:t.score})}return r.sort((e,t)=>t.score-e.score),r.slice(0,sV).map(e=>dV(e.item))}function dV(e){let t=e.content.replace(/\n/g,` `).slice(0,60);return{kind:`thino`,id:e.id,label:t,secondary:e.createdAt,content:e.content}}function fV(e,t){let n=e.vault.getAllLoadedFiles().filter(e=>e instanceof f.TFile&&(e.extension===`md`||e.extension===`canvas`));if(!t)return n.slice(0,sV).map(pV);let r=(0,f.prepareFuzzySearch)(t),i=[];for(let e of n){let t=r(e.path);t&&i.push({item:e,score:t.score})}return i.sort((e,t)=>t.score-e.score),i.slice(0,sV).map(e=>pV(e.item))}function pV(e){return{kind:`file`,id:e.path,label:e.basename,secondary:e.parent?.path||`/`,content:e.path}}Rg(),h_();function mV(e){if(e)try{return JSON.parse(e)}catch{return}}var hV=({msg:e,app:t})=>{let n=e.toolCalls&&e.toolCalls.length>0,r=e.toolCallOffset??0,i=n?e.content.slice(0,r):``,a=n?e.content.slice(r):e.content,o=(0,U.useMemo)(()=>e.isStreaming?[]:iV(a),[a,e.isStreaming]),s=(0,U.useMemo)(()=>{if(o.length===0)return a;let e=a;for(let t of o)e=e.replace(``,``);return e.trim()},[a,o]);return(0,W.jsxs)(W.Fragment,{children:[i&&(0,W.jsx)(XB,{content:i,isStreaming:!1,app:t}),n&&(0,W.jsx)(`div`,{className:`super-tool-calls`,children:e.toolCalls.map(e=>(0,W.jsx)(LB,{toolCall:e},e.id))}),e.reasoning&&(0,W.jsx)(RB,{reasoning:e.reasoning,isStreaming:e.isStreaming}),e.generatedImages&&e.generatedImages.length>0&&(0,W.jsx)(aV,{images:e.generatedImages}),o.length>0&&(0,W.jsx)(oV,{images:o}),(s||e.isStreaming)&&(0,W.jsx)(XB,{content:s||`...`,isStreaming:e.isStreaming,app:t})]})},gV=({attachments:e})=>!e||e.length===0?null:(0,W.jsx)(`div`,{className:`super-chat-attachments`,children:e.map(e=>(0,W.jsxs)(`span`,{className:`super-attachment-chip super-attachment-${e.kind}`,children:[(0,W.jsx)(`span`,{className:`super-attachment-icon`,children:e.kind===`thino`?`@`:`#`}),(0,W.jsx)(`span`,{className:`super-attachment-label`,children:e.label})]},e.id))}),_V={openai:`OpenAI`,anthropic:`Anthropic`,pkmer:`PKMer AI`},vV={openai:`gpt-5.2`,anthropic:`claude-sonnet-4-6`,pkmer:`03-agent`},yV=()=>{let e=B(e=>e.activeCompletionProvider),t=B(e=>e.providers),[n,r]=(0,U.useState)(!1),i=(0,U.useRef)(null),a=e===`pkmer`?`PKMer AI`:t[e]?.completionModel||vV[e]||e;(0,U.useEffect)(()=>{if(!n)return;let e=e=>{i.current&&!i.current.contains(e.target)&&r(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]);let o=(0,U.useMemo)(()=>{let e=[`openai`,`anthropic`];return m_()&&t.pkmer?.apiKey&&e.push(`pkmer`),e},[t]),s=(0,U.useCallback)((e,t)=>{let n=B.getState();e!==n.activeCompletionProvider&&n.setActiveCompletionProvider(e),n.updateProvider(e,{completionModel:t}),r(!1)},[]);return(0,W.jsxs)(`div`,{className:`super-model-pill-wrap`,ref:i,children:[(0,W.jsxs)(`button`,{className:`clickable-icon super-pill-btn`,onClick:()=>r(!n),children:[(0,W.jsx)(`span`,{className:`super-pill-label`,children:a}),(0,W.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(`path`,{d:`M2.5 4 5 6.5 7.5 4`})})]}),n&&(0,W.jsx)(`div`,{className:`super-model-dropdown`,children:o.map(n=>{let r=n===e,i=t[n]?.completionModel||vV[n]||``;return(0,W.jsxs)(`button`,{className:`clickable-icon super-model-option ${r?`is-active`:``}`,onClick:()=>s(n,i),children:[(0,W.jsx)(`span`,{className:`super-model-option-name`,children:_V[n]||n}),n!==`pkmer`&&(0,W.jsx)(`span`,{className:`super-model-option-model`,children:i})]},n)})})]})},bV=({plugin:e,showHistory:t})=>{let n=B(e=>e.messages),r=B(e=>e.isProcessing),i=B(e=>e.activeCompletionProvider),a=B(e=>e.providers.pkmer?.quotaInfo),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)([]),u=(0,U.useRef)(null),d=(0,U.useRef)(null),p=(0,U.useRef)(null),m=(0,U.useRef)(null);(0,U.useEffect)(()=>{u.current?.scrollIntoView({behavior:`smooth`})},[n]),(0,U.useEffect)(()=>{let t=d.current;if(!t)return;let n=new lV(e.app,t,(e,n,r)=>{s(n),l(t=>t.some(t=>t.id===e.id)?t:[...t,e]),requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(r,r)})});return m.current=n,()=>{n.destroy(),m.current=null}},[e.app]);let h=(0,U.useCallback)(e=>{s(e.target.value)},[]),g=(0,U.useCallback)(e=>{l(t=>t.filter(t=>t.id!==e))},[]),_=(0,U.useCallback)(e=>{let t=d.current;if(!t)return;let n=t.selectionStart??o.length,r=(n>0&&!/\s/.test(o[n-1])?` `:``)+e;s(o.slice(0,n)+r+o.slice(n));let i=n+r.length;requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(i,i),t.dispatchEvent(new Event(`input`,{bubbles:!0}))})},[o]),v=(0,U.useCallback)(async t=>{if(t.length===0)return``;let n=[];for(let r of t)if(r.kind===`thino`)n.push(`[Referenced Thino] ${r.content}`);else{let t=e.app.vault.getAbstractFileByPath(r.content);if(t instanceof f.TFile)try{let i=await e.app.vault.cachedRead(t),a=i.slice(0,2e3);n.push(`[Referenced File: ${r.label}]\n${a}${i.length>2e3?`
- ...(truncated)`:``}`)}catch{n.push(`[Referenced File: ${r.label}] (could not read)`)}}return n.join(`
- `)},[e.app]),y=(0,U.useCallback)(async()=>{let e=o.trim();if(!e&&c.length===0||r)return;let t=B.getState();t.activeConversationId||t.createConversation();let i=await v(c),a=i?`${i}\n\n---\n\n${e}`:e,u=c.map(e=>({kind:e.kind,id:e.id,label:e.label,content:e.content})),d={id:`msg-${Date.now()}`,role:`user`,content:e,timestamp:Date.now(),attachments:u.length>0?u:void 0};t.addMessage(d),s(``),l([]),t.setIsProcessing(!0);let f=`msg-${Date.now()}-a`,p={id:f,role:`assistant`,content:``,timestamp:Date.now(),isStreaming:!0};t.addMessage(p);try{let e=``,r=``,i,o=[],s=[],c=0;console.log(`[SuperChat] streaming started`);for await(let l of fv.chat(a,n)){if(c++,l.toolEvent){let{toolEvent:n}=l;if(n.type===`tool_start`)o.length===0&&(i=e.length),console.log(`[SuperChat] seq=${c} TOOL_START name=${n.name} id=${n.toolCallId} contentLenAtStart=${i} reasoningLen=${r.length}`),o.push({id:n.toolCallId,name:n.name,arguments:n.arguments||``,parsedArgs:mV(n.arguments),status:`running`}),t.updateMessage(f,{toolCalls:[...o],toolCallOffset:i});else if(n.type===`tool_result`){console.log(`[SuperChat] seq=${c} TOOL_RESULT name=${n.name} id=${n.toolCallId} resultLen=${n.result?.length??0}`);let e=o.findIndex(e=>e.id===n.toolCallId);e!==-1&&(o[e]={...o[e],result:n.result,status:`completed`},t.updateMessage(f,{toolCalls:[...o]}))}}l.reasoning&&(r+=l.reasoning,console.log(`[SuperChat] seq=${c} REASONING totalLen=${r.length} preview="${l.reasoning.slice(0,40)}"`),t.updateMessage(f,{reasoning:r})),l.content&&(e+=l.content,console.log(`[SuperChat] seq=${c} CONTENT totalLen=${e.length} preview="${l.content.slice(0,40)}"`),t.updateMessage(f,{content:e})),l.subagentImages&&l.subagentImages.length>0&&(console.log(`[SuperChat] seq=${c} SUBAGENT_IMAGES count=${l.subagentImages.length}`),s.push(...l.subagentImages),t.updateMessage(f,{generatedImages:[...s]}))}console.log(`[SuperChat] streaming done. contentLen=${e.length} reasoningLen=${r.length} toolCallsCount=${o.length} toolCallOffset=${i} toolStatuses=${o.map(e=>e.status).join(`,`)}`);let l=e,u=s.length>0?[...s]:void 0,{images:d,cleanContent:p}=rV(e);if(d.length>0){console.log(`[SuperChat] Found ${d.length} generated image(s), caching to IndexedDB`);let e=[];for(let t of d)try{let n=await $B.put({messageId:f,mimeType:t.mimeType,base64:t.base64});e.push({cacheId:n,mimeType:t.mimeType,alt:t.alt})}catch(e){console.warn(`[SuperChat] Failed to cache generated image:`,e)}e.length>0&&(u=[...u??[],...e],l=p)}t.updateMessage(f,{content:l,isStreaming:!1,toolCalls:[...o],reasoning:r||void 0,toolCallOffset:i,generatedImages:u});let m=B.getState();if(m.activeConversationId){let e=m.conversations.find(e=>e.id===m.activeConversationId);if(e&&e.title===`New Chat`&&e.messages.length>=2){let t=e.messages.find(e=>e.role===`user`);if(t){let n=t.content.slice(0,50)+(t.content.length>50?`...`:``);m.renameConversation(e.id,n)}}}}catch(e){t.updateMessage(f,{content:`Error: ${e.message||`Failed to get response`}`,isStreaming:!1})}finally{t.setIsProcessing(!1)}},[o,r,n,c,v]),b=(0,U.useCallback)(e=>{m.current?.isOpen||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y())},[y]),x=(o.trim()||c.length>0)&&!r;return(0,W.jsxs)(`div`,{className:`super-chat`,children:[(0,W.jsxs)(`div`,{className:`super-chat-messages`,children:[n.length===0&&!t&&(0,W.jsx)(`div`,{className:`super-chat-empty`,children:`Ask questions about your thinos. The AI will search for relevant thinos and provide answers based on your notes.`}),n.map(t=>(0,W.jsxs)(`div`,{className:`super-chat-message super-chat-${t.role}`,children:[(0,W.jsx)(`div`,{className:`super-chat-message-role`,children:t.role===`user`?`You`:`Super`}),t.role===`user`&&t.attachments&&(0,W.jsx)(gV,{attachments:t.attachments}),t.role===`assistant`?(0,W.jsx)(hV,{msg:t,app:e.app}):(0,W.jsx)(`div`,{className:`super-chat-message-content`,children:t.content})]},t.id)),(0,W.jsx)(`div`,{ref:u})]}),(0,W.jsxs)(`div`,{className:`super-input-card`,ref:p,children:[c.length>0&&(0,W.jsx)(`div`,{className:`super-input-attachments`,children:c.map(e=>(0,W.jsxs)(`span`,{className:`super-attachment-chip super-attachment-${e.kind}`,children:[(0,W.jsx)(`span`,{className:`super-attachment-icon`,children:e.kind===`thino`?`@`:`#`}),(0,W.jsx)(`span`,{className:`super-attachment-label`,children:e.label}),(0,W.jsx)(`button`,{className:`clickable-icon super-attachment-remove`,onClick:()=>g(e.id),"aria-label":`Remove`,children:`×`})]},e.id))}),(0,W.jsx)(`textarea`,{ref:d,className:`super-card-textarea`,placeholder:`Ask about your thinos, @ for context, # for files`,value:o,onChange:h,onKeyDown:b,rows:3,disabled:r}),(0,W.jsxs)(`div`,{className:`super-input-toolbar`,children:[(0,W.jsxs)(`div`,{className:`super-toolbar-left`,children:[(0,W.jsx)(yV,{}),i===`pkmer`&&a&&(0,W.jsxs)(`span`,{className:`super-toolbar-quota`,children:[a.remaining,`/`,a.total]})]}),(0,W.jsxs)(`div`,{className:`super-toolbar-right`,children:[(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-icon`,onClick:()=>_(`@`),"aria-label":`Reference thino`,title:`@ Reference thino`,children:`@`}),(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-icon`,onClick:()=>_(`#`),"aria-label":`Reference file`,title:`# Reference file`,children:`#`}),(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-send ${x?`is-active`:``}`,onClick:y,disabled:!x,"aria-label":`Send`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,W.jsx)(`path`,{d:`M22 2 11 13`})]})})]})]})]})]})};I();var xV=(0,U.memo)(({message:e,isSelected:t,onSelect:n})=>{let{app:r}=F(),i=e.role===`user`;return(0,W.jsxs)(`div`,{className:x_(`thino-super-message`,i?`user`:`assistant`,t&&`selected`,e.isStreaming&&`streaming`),onClick:t=>n(e,t),children:[!i&&(0,W.jsx)(`div`,{className:`super-avatar`,ref:e=>{e&&(0,f.setIcon)(e,`sparkles`)}}),(0,W.jsxs)(`div`,{className:`super-message-content`,children:[(0,W.jsx)(`div`,{className:`super-message-role`,children:i?`You`:`Super`}),i?(0,W.jsx)(`div`,{className:`super-message-text`,children:e.content}):r?(0,W.jsx)(hV,{msg:e,app:r}):(0,W.jsx)(`div`,{className:`super-message-text`,children:e.content||(e.isStreaming?`...`:``)})]})]})},(e,t)=>e.message.id===t.message.id&&e.message.content===t.message.content&&e.message.isStreaming===t.message.isStreaming&&e.isSelected===t.isSelected&&e.message.toolCalls===t.message.toolCalls&&e.message.toolCallOffset===t.message.toolCallOffset&&e.message.reasoning===t.message.reasoning);xV.displayName=`SuperMessageBubble`;function SV(e){if(e)try{return JSON.parse(e)}catch{return}}var CV=({conversationId:e})=>{let{app:t}=F(),n=Ew(e=>e.isProcessing),[r,i]=(0,U.useState)(``),[a,o]=(0,U.useState)([]),s=(0,U.useRef)(null),c=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=s.current;if(!e||!t)return;let n=new lV(t,e,(t,n,r)=>{i(n),o(e=>e.some(e=>e.id===t.id)?e:[...e,t]),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})});return c.current=n,()=>{n.destroy(),c.current=null}},[t]);let l=(0,U.useCallback)(e=>{i(e.target.value)},[]),u=(0,U.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e))},[]),d=(0,U.useCallback)(e=>{let t=s.current;if(!t)return;let n=t.selectionStart??r.length,a=(n>0&&!/\s/.test(r[n-1])?` `:``)+e;i(r.slice(0,n)+a+r.slice(n));let o=n+a.length;requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(o,o),t.dispatchEvent(new Event(`input`,{bubbles:!0}))})},[r]),f=(0,U.useCallback)(async()=>{let s=r.trim();if(!s&&a.length===0||n)return;let c=Ew.getState(),l=``;if(a.length>0&&t){let e=[];for(let n of a)if(n.kind===`thino`)e.push(`[Referenced Thino] ${n.content}`);else{let r=t.vault.getAbstractFileByPath(n.content);if(r&&`extension`in r)try{let i=await t.vault.cachedRead(r),a=i.slice(0,2e3);e.push(`[Referenced File: ${n.label}]\n${a}${i.length>2e3?`
- ...(truncated)`:``}`)}catch{e.push(`[Referenced File: ${n.label}] (could not read)`)}}l=e.join(`
- `)}let u=l?`${l}\n\n---\n\n${s}`:s,d={id:`inline-msg-${Date.now()}`,role:`user`,content:s,timestamp:Date.now()};c.addMessage(e,d),i(``),o([]),c.setIsProcessing(!0);let f=`inline-msg-${Date.now()}-a`,p={id:f,role:`assistant`,content:``,timestamp:Date.now(),isStreaming:!0};c.addMessage(e,p);try{let t=(Ew.getState().conversations.find(t=>t.id===e)?.messages??[]).map(e=>({id:e.id,role:e.role,content:e.content,timestamp:e.timestamp})),n=``,r=``,i,a=[];for await(let o of fv.chat(u,t)){if(o.toolEvent){let{toolEvent:t}=o;if(t.type===`tool_start`)a.length===0&&(i=n.length),a.push({id:t.toolCallId,name:t.name,arguments:t.arguments||``,parsedArgs:SV(t.arguments),status:`running`}),Ew.getState().updateMessage(e,f,{toolCalls:[...a],toolCallOffset:i});else if(t.type===`tool_result`){let n=a.findIndex(e=>e.id===t.toolCallId);n!==-1&&(a[n]={...a[n],result:t.result,status:`completed`},Ew.getState().updateMessage(e,f,{toolCalls:[...a]}))}}o.reasoning&&(r+=o.reasoning,Ew.getState().updateMessage(e,f,{reasoning:r})),o.content&&(n+=o.content,Ew.getState().updateMessage(e,f,{content:n}))}Ew.getState().updateMessage(e,f,{isStreaming:!1,toolCalls:[...a],reasoning:r||void 0,toolCallOffset:i})}catch(t){Ew.getState().updateMessage(e,f,{content:`Error: ${t.message||`Failed to get response`}`,isStreaming:!1})}finally{Ew.getState().setIsProcessing(!1)}},[r,n,a,e,t]),p=(0,U.useCallback)(e=>{c.current?.isOpen||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f())},[f]),m=(r.trim()||a.length>0)&&!n;return(0,W.jsxs)(`div`,{className:`super-inline-input`,children:[a.length>0&&(0,W.jsx)(`div`,{className:`super-input-attachments`,children:a.map(e=>(0,W.jsxs)(`span`,{className:`super-attachment-chip super-attachment-${e.kind}`,children:[(0,W.jsx)(`span`,{className:`super-attachment-icon`,children:e.kind===`thino`?`@`:`#`}),(0,W.jsx)(`span`,{className:`super-attachment-label`,children:e.label}),(0,W.jsx)(`button`,{className:`clickable-icon super-attachment-remove`,onClick:()=>u(e.id),"aria-label":`Remove`,children:`×`})]},e.id))}),(0,W.jsxs)(`div`,{className:`super-inline-input-row`,children:[(0,W.jsx)(`textarea`,{ref:s,className:`super-inline-textarea`,placeholder:`Continue the conversation...`,value:r,onChange:l,onKeyDown:p,rows:1,disabled:n}),(0,W.jsxs)(`div`,{className:`super-inline-actions`,children:[(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-icon`,onClick:()=>d(`@`),"aria-label":`Reference thino`,children:`@`}),(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-icon`,onClick:()=>d(`#`),"aria-label":`Reference file`,children:`#`}),(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-send ${m?`is-active`:``}`,onClick:f,disabled:!m,"aria-label":`Send`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,W.jsx)(`path`,{d:`M22 2 11 13`})]})})]})]})]})},wV=(0,U.memo)(({conversation:e})=>{let t=Ew(e=>e.selectedMessageIds),n=Ew,r=(0,U.useCallback)((e,t)=>{let r=n.getState();t.ctrlKey||t.metaKey?r.toggleMessageSelection(e.id):r.selectSingleMessage(e.id)},[]),i=(0,U.useCallback)(()=>{let t=n.getState();t.deactivateConversation(e.id),t.activeConversationId===e.id&&t.setActiveConversation(null)},[e.id]),a=(0,U.useCallback)(()=>{let t=n.getState(),r=t.conversations.find(t=>t.isActive&&t.id!==e.id);r&&t.deactivateConversation(r.id),t.reactivateConversation(e.id),t.setActiveConversation(e.id)},[e.id]),o=(0,U.useCallback)(()=>{n.getState().toggleCollapseConversation(e.id)},[e.id]),s=(0,U.useCallback)(t=>{t.preventDefault();let r=new f.Menu;r.addItem(t=>{t.setIcon(`trash-2`).setTitle(`Delete conversation`).setWarning(!0).onClick(()=>{n.getState().removeConversation(e.id)})}),r.showAtMouseEvent(t.nativeEvent)},[e.id]),c=(0,U.useMemo)(()=>t.some(t=>e.messages.some(e=>e.id===t)),[t,e.messages]),l=!e.isActive&&e.isCollapsed!==!1,u=e.messages.length;return(0,W.jsxs)(`div`,{className:x_(`thino-super-conversation`,e.isActive&&`active`,l&&`collapsed`),onContextMenu:s,children:[(0,W.jsxs)(`div`,{className:`super-conversation-header`,children:[(0,W.jsx)(`span`,{className:`super-badge`,ref:e=>{e&&(0,f.setIcon)(e,`sparkles`)}}),(0,W.jsx)(`span`,{className:`super-badge-text`,children:`Super`}),l&&(0,W.jsxs)(`span`,{className:`super-collapsed-hint`,children:[u,` message`,u===1?``:`s`]}),(0,W.jsxs)(`div`,{className:`super-conversation-header-right`,children:[e.isActive&&(0,W.jsx)(`button`,{className:`super-end-btn clickable-icon`,onClick:i,children:`End`}),!e.isActive&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:`super-resume-btn clickable-icon`,onClick:a,"aria-label":`Resume conversation`,ref:e=>{e&&(0,f.setIcon)(e,`message-square-plus`)}}),(0,W.jsx)(`button`,{className:`super-collapse-btn clickable-icon`,onClick:o,"aria-label":l?`Expand conversation`:`Collapse conversation`,ref:e=>{e&&(0,f.setIcon)(e,l?`chevron-right`:`chevron-down`)}})]})]})]}),!l&&(0,W.jsx)(`div`,{className:`super-conversation-messages`,children:e.messages.map(e=>(0,W.jsx)(xV,{message:e,isSelected:t.includes(e.id),onSelect:r},e.id))}),e.isActive&&(0,W.jsx)(CV,{conversationId:e.id}),!l&&c&&(0,W.jsx)(SB,{})]})});wV.displayName=`ChatSuperConversation`,I(),H(),Rg();var TV=(0,U.memo)(({memo:e,onDoubleClick:t})=>{let[n,r]=(0,U.useState)(!1),i=(0,U.useRef)(),a=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(!n&&a.current)return i.current=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&r(!0)})},{rootMargin:`200px`,threshold:.01}),i.current.observe(a.current),()=>{i.current?.disconnect()}},[n]),(0,W.jsx)(`div`,{ref:a,className:`chat-memo-wrapper`,onDoubleClick:t,children:n?(0,W.jsx)(gT,{memo:e,type:`inline`}):(0,W.jsx)(`div`,{className:`memo-placeholder`,style:{minHeight:`60px`,padding:`8px`},children:(0,W.jsxs)(`div`,{style:{opacity:.6},children:[e.content.substring(0,100),`...`]})})})},(e,t)=>e.memo.id===t.memo.id&&e.memo.content===t.memo.content);TV.displayName=`ChatMemo`;var EV=(0,U.memo)(({item:e,iconString:t,handleClickTimeStamp:n,handleToggleCheckBox:r,handleDayMarkClick:i})=>{if(e.type===`daymark`)return(0,W.jsx)(`div`,{className:`thino-chat-day-mark day-mark`,onClick:t=>i(e.dayMark,t),children:(0,W.jsx)(`div`,{className:`day-mark-bubble`,children:e.dayMark===`PINNED`?e.dayMark+` 📌`:e.dayMark})});if(e.type===`super`&&e.conversation)return(0,W.jsx)(wV,{conversation:e.conversation});let a=e.memo,o=a.thinoType!==`JOURNAL`,s=(0,U.useMemo)(()=>a.createdAt.substring(11,19),[a.createdAt]),c=(0,U.useCallback)(()=>{Bx(a)},[a]);return(0,W.jsxs)(`div`,{className:`thino-bubble right`,children:[(0,W.jsx)(`div`,{className:`icon-img`,style:{backgroundImage:t?`url("${t}")`:void 0},ref:e=>{e&&!t&&(0,f.setIcon)(e,`Memos`)}}),(0,W.jsx)(`div`,{className:`wrap`,children:(0,W.jsxs)(`div`,{className:o?`content task`:`content`,children:[o&&(0,W.jsx)(`div`,{className:`task-inputer`,children:(0,W.jsx)(`input`,{className:x_(`thino-type-status`,`task-list-item-checkbox`),type:`checkbox`,checked:a.thinoType!==`TASK-TODO`,onClick:()=>r(a)})}),(0,W.jsx)(`div`,{className:`time-stamp`,onClick:()=>n(a),children:s}),(0,W.jsx)(TV,{memo:a,onDoubleClick:c})]})})]})});EV.displayName=`ChatItemRenderer`;var DV=({thinos:e})=>{let{query:t}=Si(),{manifest:n}=vi(),{app:r,settings:i}=F(),[a,o]=(0,U.useState)(i?.MomentsIcon||``),s=(0,U.useRef)(null),c=(0,U.useRef)(null),{registerScrollController:l}=bB(),u=B(e=>e.enabled),d=Ew(e=>e.conversations),p=(0,U.useMemo)(()=>{let t=[],n=tH(e,`day`);if(Object.keys(n).sort((e,t)=>e===`PINNED`?1:t===`PINNED`?-1:e.localeCompare(t)).forEach(e=>{t.push({type:`daymark`,dayMark:e,id:`dm-${e}`}),n[e].forEach((n,r)=>{t.push({type:`thino`,memo:n,dayMark:e,thinoIndex:r,id:`t-${n.id}`})})}),u&&d.length>0){let e=[...d].filter(e=>e.messages.length>0).sort((e,t)=>e.createdAt-t.createdAt);for(let n of e){let e=t.length,r=t.findIndex(e=>e.type===`daymark`&&e.dayMark===`PINNED`),i=r>=0?r:t.length;for(let r=i-1;r>=0;r--){let i=t[r];if(i.type===`thino`&&i.memo&&(i.memo.createdAtTs||new Date(i.memo.createdAt).getTime())<=n.createdAt){e=r+1;break}r===0&&(e=0)}r>=0&&e>r&&(e=r),t.splice(e,0,{type:`super`,dayMark:``,id:`super-${n.id}`,conversation:n})}}return t},[e,u,d]);(0,U.useEffect)(()=>{if(!i?.MomentsIcon||!r)return;let e=r.vault.adapter.getResourcePath((0,f.normalizePath)(i.MomentsIcon));o(e&&!i.MomentsIcon.startsWith(`http`)?e:i.MomentsIcon)},[i?.MomentsIcon,r]),(0,U.useEffect)(()=>{s.current=document.querySelector(`.memolist-wrapper`)},[]);let{displayedItems:m,hasMore:h,sentinelRef:g}=sx({allItems:(0,U.useMemo)(()=>[...p].reverse(),[p]),initialCount:100,loadMoreCount:50,enabled:!0}),_=(0,U.useMemo)(()=>[...m].reverse(),[m]),v=(0,U.useCallback)(e=>{Bx(e)},[]),y=(0,U.useCallback)(async e=>{if(e.thinoType===`JOURNAL`)return;let t=await V.updateMemo(e.id,e.content,e.thinoType===`TASK-TODO`?`TASK-DONE`:`TASK-TODO`);t&&V.editMemo(t)},[]),b=(0,U.useCallback)((e,t)=>{if(f.Keymap.isModifier(t.nativeEvent,`Mod`)){let t=(0,f.moment)(e,`YYYY-MM-DD`);z.setFromAndToQuery(t.startOf(`day`).valueOf(),t.endOf(`day`).valueOf())}},[]),x=(0,U.useCallback)((e=`auto`)=>{let t=s.current;t&&requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e})})},[]);(0,U.useEffect)(()=>l({scrollToTop:e=>{let t=s.current;t&&t.scrollTo({top:0,behavior:e?`smooth`:`auto`})},scrollToBottom:e=>{x(e?`smooth`:`auto`)},scrollToPosition:(e,t)=>{let n=s.current;n&&n.scrollTo({top:e,behavior:t?`smooth`:`auto`})}}),[l,x]);let S=(0,U.useRef)(!1);(0,U.useEffect)(()=>{!S.current&&m.length>0&&(S.current=!0,setTimeout(()=>x(`auto`),100))},[m.length,x]);let C=(0,U.useRef)(0),w=(0,U.useRef)(0);return(0,U.useEffect)(()=>{let e=s.current;if(!e||!S.current)return;let t=_.length,n=C.current;if(t===n)return;let r=e.scrollHeight-e.scrollTop-e.clientHeight<200;if(t>n)if(r)requestAnimationFrame(()=>x(`smooth`));else{let t=w.current,n=e.scrollHeight-t;n>0&&t>0&&(e.scrollTop+=n)}C.current=t,w.current=e.scrollHeight},[_.length,x]),(0,W.jsxs)(`div`,{ref:c,className:x_(`chat-view`,`simple-chat-view`,`${i?.chatViewStyle}-style`),children:[h&&(0,W.jsx)(`div`,{ref:g,className:`chat-load-more-sentinel`,style:{height:`1px`,margin:`10px 0`}}),_.map(e=>(0,W.jsx)(EV,{item:e,iconString:a,handleClickTimeStamp:v,handleToggleCheckBox:y,handleDayMarkClick:b},e.id))]})};I();var OV=({icon:e})=>{let t=(0,U.useRef)(null);return(0,U.useEffect)(()=>{t.current&&(e?(t.current.style.backgroundImage=`url("${e}")`,t.current.empty()):(0,f.setIcon)(t.current,`Memos`))},[e]),(0,W.jsx)(`div`,{ref:t,className:`thino-moment-icon`,style:e?{backgroundImage:`url("${e}")`}:void 0})},kV=(0,U.memo)(({memo:e})=>{let[t,n]=(0,U.useState)(!1),r=(0,U.useRef)(),i=(0,U.useRef)(null),{settings:a,app:o}=F(),[s,c]=(0,U.useState)(``);return(0,U.useEffect)(()=>{if(!t&&i.current)return r.current=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&n(!0)})},{rootMargin:`300px`,threshold:.01}),r.current.observe(i.current),()=>{r.current?.disconnect()}},[t]),(0,U.useEffect)(()=>{if(!a?.MomentsIcon||!o)return;let e=o.vault.adapter.getResourcePath((0,f.normalizePath)(a.MomentsIcon));e&&!a?.MomentsIcon.startsWith(`http`)?c(e):c(a?.MomentsIcon)},[a?.MomentsIcon,o]),(0,W.jsxs)(`div`,{ref:i,className:`thino-moment-wrapper`,children:[(0,W.jsx)(OV,{icon:s}),(0,W.jsxs)(`div`,{className:`thino-moment-container`,children:[(0,W.jsx)(`div`,{className:`thino-moment-user-name`,children:a?.UserName||`Thino`}),(0,W.jsx)(`div`,{className:`thino-moment-user-content`,children:t?(0,W.jsx)(gT,{memo:e}):(0,W.jsx)(`div`,{className:`memo-wrapper`,style:{minHeight:`80px`,paddingTop:`var(--size-2-2)`,opacity:.7},children:(0,W.jsxs)(`div`,{className:`memo-content-text`,style:{fontSize:`0.9em`,color:`var(--thino-modern-text-faint)`},children:[e.content.substring(0,120),`...`]})})})]})]})},(e,t)=>e.memo.id===t.memo.id&&e.memo.content===t.memo.content);kV.displayName=`MomentMemo`;var AV=()=>{let{settings:e,app:t}=F(),[n,r]=(0,U.useState)(``);return(0,U.useEffect)(()=>{if(!e?.MomentsBackgroundImage||!t){r(``);return}let n=t.vault.adapter.getResourcePath((0,f.normalizePath)(e.MomentsBackgroundImage));n&&!e?.MomentsBackgroundImage.startsWith(`http`)?r(n):r(e?.MomentsBackgroundImage)},[e?.MomentsBackgroundImage,t]),(0,W.jsx)(`div`,{className:`moments-view-background`,style:{backgroundImage:n?`url("${n}")`:void 0}})},jV=({userIcon:e})=>{let t=(0,U.useRef)(null);return(0,U.useEffect)(()=>{t.current&&(e?(t.current.style.backgroundImage=`url("${e}")`,t.current.empty()):(0,f.setIcon)(t.current,`Memos`))},[e]),(0,W.jsx)(`div`,{ref:t,className:`moments-view-user-icon`,style:e?{backgroundImage:`url("${e}")`}:void 0})},MV=({thinos:e})=>{let t=(0,U.useRef)(null),n=(0,U.useRef)(null),{registerScrollController:r}=bB(),{settings:i,app:a}=F(),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(``);(0,U.useEffect)(()=>{t.current=document.querySelector(`.memolist-wrapper`)},[]),(0,U.useEffect)(()=>{if(!i?.MomentsIcon||!a)return;let e=a.vault.adapter.getResourcePath((0,f.normalizePath)(i.MomentsIcon));e&&!i?.MomentsIcon.startsWith(`http`)?l(e):l(i?.MomentsIcon)},[i?.MomentsIcon,a]);let{displayedItems:u,hasMore:d,sentinelRef:p,loadingMore:m}=sx({allItems:e,initialCount:50,loadMoreCount:30,enabled:!0});return(0,U.useEffect)(()=>r({scrollToTop:e=>{let n=t.current;n&&n.scrollTo({top:0,behavior:e?`smooth`:`auto`})},scrollToBottom:e=>{let n=t.current;n&&n.scrollTo({top:n.scrollHeight,behavior:e?`smooth`:`auto`})},scrollToPosition:(e,n)=>{let r=t.current;r&&r.scrollTo({top:e,behavior:n?`smooth`:`auto`})}}),[r]),(0,W.jsxs)(`div`,{ref:n,className:x_(`moments-view`,`simple-moments`,o?`show-editor`:``),style:{width:`100%`,height:`100%`,position:`relative`},children:[(0,W.jsxs)(`div`,{className:`moments-view-background-wrapper`,children:[(0,W.jsx)(AV,{}),(0,W.jsx)(`div`,{className:`moments-show-editor-btn`,ref:e=>{e&&(0,f.setIcon)(e,`camera`)},onClick:()=>{s(!o)}}),(0,W.jsxs)(`div`,{className:`moments-view-background-overlay`,children:[(0,W.jsxs)(`div`,{className:`moments-view-user-info`,children:[(0,W.jsx)(`div`,{className:`moments-view-user-name`,children:i?.UserName||`Thino`}),(0,W.jsx)(jV,{userIcon:c})]}),(0,W.jsx)(`div`,{className:`moments-view-user-idea`,children:i?.MomentsQuote||` `})]})]}),(0,W.jsxs)(`div`,{className:`moments-list`,children:[u.map(e=>(0,W.jsx)(kV,{memo:e},e.id)),d&&(0,W.jsx)(`div`,{ref:p,className:`moments-sentinel`,style:{height:`1px`,margin:`20px 0`},children:m&&(0,W.jsx)(`div`,{style:{textAlign:`center`,padding:`20px`,opacity:.6},children:`Loading more...`})})]})]})},NV=(0,U.memo)(({memo:e})=>{let[t,n]=(0,U.useState)(!1),r=(0,U.useRef)(),i=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(!t&&i.current)return r.current=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&n(!0)})},{rootMargin:`300px`,threshold:.01}),r.current.observe(i.current),()=>{r.current?.disconnect()}},[t]),(0,W.jsx)(`div`,{ref:i,className:`waterfall-memo-container`,style:{width:`100%`,maxWidth:`100%`,minWidth:0,overflow:`hidden`},children:t?(0,W.jsx)(gT,{memo:e}):(0,W.jsx)(`div`,{className:`memo-skeleton`,style:{minHeight:`100px`,padding:`12px`,backgroundColor:`var(--background-secondary)`,borderRadius:`8px`,opacity:.7},children:(0,W.jsxs)(`div`,{style:{fontSize:`0.9em`,opacity:.8,overflowWrap:`anywhere`,wordBreak:`break-word`},children:[e.content.substring(0,150),`...`]})})})},(e,t)=>e.memo.id===t.memo.id&&e.memo.content===t.memo.content);NV.displayName=`WaterfallMemo`;var PV=({memos:e,className:t=``,columns:n=3,gap:r=10})=>{let{displayedItems:i,hasMore:a,sentinelRef:o,loadingMore:s}=sx({allItems:e,initialCount:50,loadMoreCount:30,enabled:!0}),c=(0,U.useMemo)(()=>{let e=Array.from({length:n},()=>[]);return i.forEach((t,r)=>{e[r%n].push(t)}),e},[i,n]);return(0,W.jsxs)(`div`,{className:x_(`simple-waterfall-list`,t),style:{width:`100%`,maxWidth:`100%`,minWidth:0,overflowX:`hidden`},children:[(0,W.jsx)(`div`,{className:`waterfall-columns`,style:{display:`grid`,gridTemplateColumns:`repeat(${n}, 1fr)`,gap:`${r}px`,width:`100%`,maxWidth:`100%`,minWidth:0,overflow:`hidden`},children:c.map((e,t)=>(0,W.jsx)(`div`,{className:`waterfall-column`,style:{display:`flex`,flexDirection:`column`,gap:`${r}px`,minWidth:0,maxWidth:`100%`},children:e.map(e=>(0,W.jsx)(NV,{memo:e},e.id))},`col-${t}`))}),a&&(0,W.jsx)(`div`,{ref:o,className:`waterfall-sentinel`,style:{height:`1px`,margin:`20px 0`},children:s&&(0,W.jsx)(`div`,{style:{textAlign:`center`,padding:`20px`,opacity:.6},children:`Loading more...`})})]})},FV=(0,U.forwardRef)(({children:e,className:t,mode:n=`top`,onScroll:r,style:i},a)=>{let o=(0,U.useRef)(null),s=(0,U.useCallback)((e=!1)=>{o.current&&o.current.scrollTo({top:0,behavior:e?`smooth`:`auto`})},[]),c=(0,U.useCallback)((e=!1)=>{o.current&&o.current.scrollTo({top:o.current.scrollHeight,behavior:e?`smooth`:`auto`})},[]),l=(0,U.useCallback)((e,t=!1)=>{o.current&&o.current.scrollTo({top:e,behavior:t?`smooth`:`auto`})},[]),u=(0,U.useCallback)(()=>o.current,[]),d=(0,U.useCallback)(()=>o.current?{top:o.current.scrollTop,height:o.current.clientHeight,scrollHeight:o.current.scrollHeight}:{top:0,height:0,scrollHeight:0},[]);return(0,U.useImperativeHandle)(a,()=>({scrollToTop:s,scrollToBottom:c,scrollToPosition:l,getScrollElement:u,getScrollPosition:d}),[s,c,l,u,d]),U.useLayoutEffect(()=>{n===`bottom`&&c(!1)},[n,c]),(0,W.jsx)(`div`,{ref:o,className:t,onScroll:r,style:{overflowY:`auto`,overflowX:`hidden`,WebkitOverflowScrolling:`touch`,...i},children:e})});FV.displayName=`ScrollContainer`;var IV=({itemId:e,initialContent:t,placeholder:n=``,onContentChange:r,onSubmit:i,onCancel:a})=>{let[o,s]=(0,U.useState)(null),c=(0,U.useRef)(null),l=(0,U.useRef)(!1),u=(0,U.useRef)(t??``),d=(0,U.useRef)(null),{instance:f,value:p,setFullContent:m,get:h,editorView:g}=mw(o,!0),_=(0,U.useCallback)(e=>{s(e)},[]),v=(0,U.useCallback)(()=>{let e=h?.(),t=typeof e==`string`?e:u.current;u.current=t,d.current!==t&&(r(t),d.current=t)},[h,r]);return(0,U.useEffect)(()=>{f&&c.current!==e&&(c.current=e,l.current=!0,u.current=t??``,d.current=null,m(t||``,!0))},[f,e,t,m]),(0,U.useEffect)(()=>{if(f){if(l.current){l.current=!1,u.current=p;return}u.current=p}},[p,f]),(0,U.useEffect)(()=>{let e=g;if(e)return n&&(e.dom.dataset.placeholder=n),e.focus(),()=>{n&&delete e.dom.dataset.placeholder}},[g,n]),(0,U.useEffect)(()=>{g||f?.editor&&f.editor.focus()},[g,f]),(0,U.useEffect)(()=>{let e=g?.dom||o;if(!e)return;let t=e=>{if(e.key===`Escape`&&(e.preventDefault(),a()),e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),v(),i();return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),v(),a())};return e.addEventListener(`keydown`,t,!0),()=>{e.removeEventListener(`keydown`,t,!0)}},[g,o,v,a,i]),(0,W.jsx)(`div`,{ref:_,className:`temp-editor`})};I(),M(),H(),Av(),zv(),$r(),Ba(),li(),Sa();var LV=class extends f.SuggestModal{constructor(e,t){super(e),this.thino=t}sanitisedFileName(e){let t=Xr;return e.replace(t,``).trim().slice(0,255)}ensureUniqueFileNames(e){let t=[];return e.map(e=>{let n=this.sanitisedFileName(e[0]),r=t.filter(e=>e==n);return t.push(n),r.length>=1?`${n}${r.length+1}`:n})}contentSplitByHeading(e,t){let n=e.split(`
- `),r=Array(t).join(`#`)+` `,i=Array(t+1).join(`#`)+` `,a=[],o=[];return n.forEach((e,t)=>{e.startsWith(i)?o.length>0?(a.push(o),o=[],o.push(e)):o.push(e):o.length>0&&!e.startsWith(r)?o.push(e):o.length>0&&(a.push(o),o=[]),t===n.length-1&&o.length>0&&a.push(o)}),a}onChooseSuggestion(e,t){this.selectSuggestion(e,t)}renderSuggestion(e,t){t.setText(e.title)}getSuggestions(){return[{id:`splitByHeading1`,title:j(`Split by Heading 1`)},{id:`splitByHeading2`,title:j(`Split by Heading 2`)},{id:`splitByHeading3`,title:j(`Split by Heading 3`)}]}async selectSuggestion(e,t){let n=[];if(e.id===`splitByHeading1`?n=this.contentSplitByHeading(this.thino.content,1):e.id===`splitByHeading2`?n=this.contentSplitByHeading(this.thino.content,2):e.id===`splitByHeading3`&&(n=this.contentSplitByHeading(this.thino.content,3)),n.length===0){new f.Notice(`No headings found`),this.close();return}let r=this.ensureUniqueFileNames(n);for(let e of n){let t=n.indexOf(e),i=await V.createThino({content:e.join(`
- `),name:r[t],type:`MULTI`,isList:!0});V.pushMemo(i)}let i=this.thino.content;n.forEach((e,t)=>{i=i.replace(e.join(`
- `),`[[${r[t]}]]`)});let a=await V.updateMemo(this.thino.id,i);a&&V.editMemo(a),this.close()}},RV=async(e,t,n)=>{let r=n.getAttribute(`href`),i=n.className;if(i.contains(`tag`))zV(n.innerText.slice(1));else if(i.contains(`internal-link`)){let r=n.getAttribute(`data-href`),i=V.getMemoById(r??``);i?Bx(i):await e.workspace.openLinkText(r,r,!f.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,`_blank`)},zV=e=>{let t=z.getState().query.tag;z.setTagQuery(t.contains(`,`)?t.split(`,`).includes(e)?t.split(`,`).filter(t=>t!==e).join(`,`):t+`,`+e:t===e?``:e)},BV=(e,t)=>{let n=t?.getAttribute(`src`),r=t?.parentElement.getAttribute(`src`),i=[...e?.querySelectorAll(`img`)||[]],a=i.indexOf(t);ZS({imgUrl:n,filepath:n.startsWith(`app`)?r:void 0,otherIMGEls:i,currentIndex:a})},VV=e=>{let t=e.dataset?.value,n=V.getMemoById(t??``);n?Bx(n):(new f.Notice(`Thino Not Found`),e.classList.remove(`memo-link-text`))},HV=async(e,t,n,r)=>{let i=e?.AppendDateWhenTaskDone?` ✅ `+(0,f.moment)().format(`YYYY-MM-DD`):``,a=r.parentElement.dataset?.task===`x`?`DONE`:`TODO`,o=[...n?.querySelectorAll(`li.task-list-item`)||[]];for(let n of o)if(n===r||n===r.closest(`li.task-list-item`)){let r=o.indexOf(n),s=t.content.split(/\n/),c=[];for(let e=0;e<s.length;e++)/^\s*(-|\*|\d+\.)\s\[.\]\s/.test(s[e])&&c.push(e);let l=c[r],u=s[l],d=u.match(/^\s*(-|\*|\d+\.)\s\[.\]\s/)[0],f=u.replace(/^\s*(-|\*|\d+\.)\s\[.\]\s/,d.replace(/\[.\]/,a===`TODO`?`[x]`:`[ ]`))+(a===`TODO`?i:``);e.AppendDateWhenTaskDone&&a!==`TODO`&&(f=f.replace(/ ✅ \d{4}-\d{2}-\d{2}/g,``)),s[l]=f;let p=s.join(`
- `).trim();if(t&&t.content!==p){let e=await V.updateMemo(t.id,p);V.editMemo(e)}}},UV=({item:e,index:t,isFocused:n,isEditing:r,onFocus:i,onEdit:a,onExitEdit:o,onContentChange:s,onCreateNext:c,onDelete:l,itemRef:u})=>{let{app:d,view:p,settings:m,verifyState:h}=F(),g=(0,U.useRef)(null),_=(0,U.useRef)(null),v=(0,U.useRef)(null),y=(0,U.useRef)(null);(0,U.useRef)(null);let b=(0,U.useRef)(null),[x,S]=(0,U.useState)(!1),{isSelected:C,handleClick:w}=Nw(e.id);(0,U.useEffect)(()=>(u(g.current,e.id),()=>u(null,e.id)),[e.id,u]),(0,U.useEffect)(()=>{if(!r&&_.current&&d&&p){let t=e.optimisticContent??e.content??``;_.current.empty(),f.MarkdownRenderer.render(d,t,_.current,e.isPending?``:e.path,p),_.current.classList.add(`markdown-rendered`)}},[e.content,e.optimisticContent,r,d,p,e.isPending]);let T=new Date(e.createdAt),E=!Number.isNaN(T.getTime()),D=E?T.toLocaleString():String(e.createdAt),O=E?(0,f.moment)(T).format(`HH:mm`):D,k=(0,U.useCallback)(t=>{if(!e.isPending){if(t.ctrlKey||t.metaKey){let t=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`);z.setFromAndToQuery(t.startOf(`day`).valueOf(),t.endOf(`day`).valueOf());return}Bx(e)}},[e]),ee=(0,U.useCallback)(()=>{if(!e.isPending){if(m?.UseButtonToShowEditor&&m?.DefaultEditorLocation===`Bottom`){let e=document.querySelector(`div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)`);e&&e.trigger(`click`)}R.setMarkMemoId(e.id)}},[e,m]),A=(0,U.useCallback)(async()=>{if(e.isPending)return;let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),n=f.Platform.isDesktop?await Pv():t.identifier||t.uuid;if(!h||h?.appId!==n){kv();return}let r=e;r.pinned?await V.unpinMemoById(r.id):await V.pinMemoById(r.id)},[e,h]),te=(0,U.useCallback)(()=>{a(t)},[t,a]),ne=(0,U.useCallback)(async()=>{e.isPending||await V.openThinoByID(e.id)},[e]),re=(0,U.useCallback)(async()=>{if(!e.isPending)try{let t=await V.archiveMemo(e);t&&V.editMemo(t)}catch(e){console.error(e),new f.Notice(e.message)}},[e]),ie=(0,U.useCallback)(async()=>{l(e.id)},[e.id,l]),ae=(0,U.useCallback)(()=>{e.isPending||US(e)},[e]),oe=(0,U.useCallback)(async()=>{navigator.clipboard.writeText(e.content).then(()=>{new f.Notice(j(`COPY SUCCEED`))}).catch(()=>{new f.Notice(j(`COPY FAILED`))})},[e.content]),se=(0,U.useCallback)(async t=>{if(e.isPending)return;let n=await Ma(e,t);navigator.clipboard.writeText(n),new f.Notice(j(`COPY SUCCEED`))},[e]);(0,U.useCallback)(async()=>{e.isPending||new LV(d,e).open()},[e,d]),(0,U.useCallback)(async()=>{if(e.isPending)return;let t=e;t.sourceType===`MULTI`&&t.id.trim()===``&&await V.updateMemoProperty(t)},[e]);let ce=(0,U.useCallback)(async t=>{if(e.isPending)return;t.preventDefault(),t.stopPropagation();let n=t.target;if(t.ctrlKey||t.metaKey){await ne();return}if(n.tagName===`A`){await RV(d,p,n);return}if(n.tagName===`IMG`){BV(g.current,n);return}if(n.tagName===`A`&&n.getAttribute(`href`)){let e=n.getAttribute(`href`);window.open(e,`_blank`);return}if(n.className===`memo-link-text`){VV(n);return}if(n.tagName===`INPUT`&&n.hasClass(`task-list-item-checkbox`)){await HV(m,e,g.current,n);return}},[e,d,p,m,ne]),le=(0,U.useCallback)(t=>{if(e.isPending)return;t.stopPropagation(),t.preventDefault();let n=new f.Menu;(async()=>{try{let r=[],i=[],a=[...e.content.matchAll(Yr)];for(let e of a)if(e&&e.length===3){let t=e[2],n=V.getMemoById(t);n&&r.push({...n,createdAtStr:N.getDateTimeString(n.createdAt),dateStr:N.getDateString(n.createdAt)})}let o=Oa(e.content);for(let e of o){let[t,n]=e.split(`#^`),i=n;if(t&&i){let e=await V.getLinkedMemoByBlockId(i,t);e&&!r.some(t=>t.id===e.id)&&r.push({...e,createdAtStr:N.getDateTimeString(e.createdAt),dateStr:N.getDateString(e.createdAt)})}}let s=e,c=await V.getLinkedMemos(s.id),l=[];s.hasId&&s.path&&(l=await V.getLinkedMemosByLinkId(s.hasId,s.path));let u=[...c,...l];Array.from(new Map(u.map(e=>[e.id,e])).values()).sort((e,t)=>N.getTimeStampByDate(t.createdAt)-N.getTimeStampByDate(e.createdAt)).forEach(e=>{i.push({...e,createdAtStr:N.getDateTimeString(e.createdAt),dateStr:N.getDateString(e.createdAt)})}),n.addSections([`Outgoing`,`Incoming`]),r.length>0&&r.forEach(e=>{n.addItem(t=>{let n=e.content.length>10?e.content.substring(0,10)+`...`:e.content;t.setTitle(n).setIcon(`arrow-right`).onClick(()=>{Bx(e)})})}),i.length>0&&i.forEach(e=>{n.addItem(t=>{let n=e.content.length>10?e.content.substring(0,10)+`...`:e.content;t.setTitle(n).setSection(`Incoming`).setIcon(`arrow-left`).onClick(()=>{Bx(e)})})}),r.length===0&&i.length===0&&n.addItem(e=>{e.setDisabled(!0).setTitle(j(`No reference links found`))}),n.showAtMouseEvent(t.nativeEvent)}catch(e){console.error(`Error fetching linked memos:`,e),new f.Notice(j(`Error fetching reference links`))}})()},[e]),ue=(0,U.useCallback)(t=>{t.preventDefault(),t.stopPropagation();let n=new f.Menu;n.dom.toggleClass(`memo-context-menu`,!0);let r=window.getSelection();r?.toString().length>0&&n.addItem(e=>{e.setIcon(`copy`).setTitle(j(`Copy selected text`)).onClick(()=>{navigator.clipboard.writeText(r.toString()).then(()=>{new f.Notice(j(`COPY SUCCEED`))}).catch(()=>{new f.Notice(j(`COPY FAILED`))})})}).addSeparator(),!e.isPending&&e.sourceType===`DAILY`&&(n.addItem(e=>{e.setIcon(`link`).setTitle(j(`Copy embed link`)).onClick(()=>{se(!0)})}),n.addItem(e=>{e.setIcon(`link`).setTitle(j(`Copy link`)).onClick(()=>{se(!1)})}),n.addSeparator()),m?.enableReferenceLinksGroup&&!e.isPending&&n.addItem(e=>{e.setIcon(`link`).setTitle(j(`Reference links group`)).onClick(()=>le(t))}),n.addItem(e=>{e.setIcon(`copy`).setTitle(j(`Copy thino`).toLocaleUpperCase()).onClick(async()=>{await oe(),n.close()})}),n.addItem(e=>{e.setIcon(`book-open`).setTitle(j(`READ`)).onClick(()=>k(t))}),e.isPending||n.addItem(t=>{let n=e.pinned;t.setIcon(n?`pin-off`:`pin`).setTitle(j(n?`UNPIN`:`PIN`)).onClick(A)}),n.addItem(e=>{e.setIcon(`bookmark`).setTitle(j(`MARK`)).onClick(ee)}),e.isPending||n.addItem(e=>{e.setIcon(`share-2`).setTitle(j(`SHARE`)).onClick(ae)}),n.addItem(e=>{e.setIcon(`pencil`).setTitle(j(`EDIT`)).onClick(te)}),e.isPending||n.addItem(e=>{e.setIcon(`home`).setTitle(j(`SOURCE`)).onClick(()=>ne())}),n.addSeparator(),e.isPending||n.addItem(e=>{e.setIcon(`archive`).setWarning(!0).setTitle(j(`ARCHIVE`).toLocaleUpperCase()).onClick(()=>re())}),n.addItem(e=>{e.setIcon(`trash`).setWarning(!0).setTitle(j(`DELETE`)).onClick(async()=>{await ie()})}),n.showAtMouseEvent(t.nativeEvent)},[e,m,se,le,oe,k,A,ee,ae,te,ne,re,ie]),de=(0,U.useCallback)(t=>{if(e.isPending||!t.shiftKey||!p||!d)return;t.stopPropagation();let n=e;d.workspace.trigger(`hover-link`,{event:t,source:`thino`,hoverParent:p.containerEl,targetEl:g.current,linktext:n.path,sourcePath:n.path,state:{scroll:n.sourceType===`DAILY`?parseInt(n.id.slice(14)):0}})},[e,d,p]),fe=()=>{let t=new f.Menu;if(t.dom.toggleClass([`more-action-btns-wrapper`],!0),t.useNativeMenu){if(t.setNoIcon(),r||t.addItem(e=>{e.setTitle(j(`EDIT`)).onClick(te)}),!e.isPending){t.addItem(e=>{e.setTitle(j(`COPY`)).onClick(oe)});let n=e;t.addItem(e=>{e.setTitle(n.pinned?j(`UNPIN`):j(`PIN`)).onClick(A)}),t.addItem(e=>{e.setTitle(j(`SHARE`)).onClick(ae)}),t.addItem(e=>{e.setTitle(j(`SOURCE`)).onClick(ne)}),t.addSeparator(),t.addItem(e=>{e.setTitle(j(`MARK`)).onClick(ee)}),t.addItem(e=>{e.setTitle(j(`ARCHIVE`)).onClick(re)})}t.addSeparator(),t.addItem(e=>{e.setWarning(!0).setTitle(j(`DELETE`)).onClick(ie)})}else{if(t.addItem(n=>{let i=n.dom;if(n.dom.empty(),n.dom.toggleClass([`more-action-btn-group`,`more-action-menu-item`],!0),!r){let e=i.createEl(`span`);e.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),e.onclick=e=>{e.stopPropagation(),e.preventDefault(),te(),t.close()},new f.ExtraButtonComponent(e).setIcon(`pencil`)}if(!e.isPending){let e=i.createEl(`span`);e.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),e.onclick=e=>{e.stopPropagation(),e.preventDefault(),oe(),t.close()},new f.ExtraButtonComponent(e).setIcon(`copy`)}}),!e.isPending){t.addSeparator();let n=e;t.addItem(e=>{e.setIcon(n.pinned?`pin-off`:`pin`).setTitle(n.pinned?j(`UNPIN`):j(`PIN`)).onClick(A)}),t.addItem(e=>{e.setIcon(`share-2`).setTitle(j(`SHARE`)).onClick(ae)}),t.addItem(e=>{e.setIcon(`home`).setTitle(j(`SOURCE`)).onClick(ne)}),t.addSeparator(),t.addItem(e=>{e.setIcon(`bookmark`).setTitle(j(`MARK`)).onClick(ee)}),t.addItem(e=>{e.setIcon(`archive`).setTitle(j(`ARCHIVE`)).onClick(re)})}t.addSeparator(),t.addItem(e=>{e.setWarning(!0).setIcon(`trash`).setTitle(j(`DELETE`)).onClick(e=>{e.stopPropagation(),e.preventDefault(),ie(),t.close()})})}return t.onHide(()=>{y.current=null}),y.current=t,t},pe=e=>{if(e.stopPropagation(),y.current){y.current.close();return}fe().showAtMouseEvent(e.nativeEvent)},me=e=>{w(e)||n||i(t)},he=(0,U.useCallback)(n=>{if(n&&n.target.tagName!==`INPUT`)switch(m?.doubleClickBehavior||`edit-thino`){case`open-thino`:e.isPending||Bx(e);break;case`edit-thino`:r||a(t);break;case`go-to-source`:e.isPending||ne();break;case`do-nothing`:break;default:r||a(t);break}},[e,t,m,r,a,ne]);return(0,U.useEffect)(()=>{e.isPending||!b.current||x||!g.current||(d.dragManager.handleDrag(b.current,t=>{d.dragManager.updateSource([g.current],`is-dragging`);let n=e;if(t.dataTransfer.setData(`text/plain`,e.content),t.dataTransfer.setData(`text/uri-list`,e.content),t.dataTransfer.setData(`Text`,e.content),m?.DraggingBehavior===`block-link`)if(n?.sourceType===`DAILY`){let e=d.vault.getFileByPath(n.path),t=n.hasId;return n.hasId||(t=N.randomId(6),_a(n,{id:n.id,hasId:t})),{type:`link`,icon:`lucide-link`,title:e.basename,linktext:`${n.path}#^${t}`,sourcePath:n.path,file:e,memo:n,blockId:t,source:`thino-plugin`}}else return null;else if(m?.DraggingBehavior===`text`)return null}),S(!0))},[e,b.current,g.current,m?.DraggingBehavior,x]),(0,W.jsxs)(`div`,{ref:g,className:x_(`flow-item`,{focused:n,editing:r,pending:e.isPending,pinned:!e.isPending&&e.pinned,selected:C}),"data-source-type":e.isPending?void 0:e.sourceType,"data-thino-type":e.isPending?void 0:e.thinoType,"data-thino-id":e.id,onClick:me,onDoubleClick:he,onContextMenu:ue,onMouseOver:de,tabIndex:-1,children:[(0,W.jsx)(`div`,{ref:b,className:`flow-item-header`,draggable:!e.isPending,children:(0,W.jsx)(`span`,{ref:v,className:`flow-item-time`,onClick:pe,"aria-label":D,children:O})}),(0,W.jsx)(`div`,{className:`flow-item-content`,onClick:ce,children:r?(0,W.jsx)(`div`,{className:`flow-item-editor-placeholder`,children:(0,W.jsx)(IV,{itemId:e.id,initialContent:e.content,placeholder:`Write your note here... (Shift+Enter for new line, Enter to save, Ctrl+Enter for new note)`,onContentChange:t=>s(e.id,t),onSubmit:()=>c(t),onCancel:o})}):(0,W.jsx)(`div`,{ref:_,className:`flow-item-preview`,children:(e.optimisticContent??e.content)||(0,W.jsx)(`em`,{className:`empty-content`,children:`Empty note`})})})]})};H(),Ng(),jg();var WV=()=>`pending-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,GV=e=>{let[t,n]=(0,U.useState)([]),[r,i]=(0,U.useState)(new Map),a=(0,U.useRef)(new Map),o=(0,U.useRef)(new Map);(0,U.useEffect)(()=>{a.current=r},[r]);let s=Mg(e=>e.sort),c=(0,U.useMemo)(()=>t.slice().sort((e,t)=>t.createdAt-e.createdAt),[t]),l=(0,U.useMemo)(()=>Og(e,s).map(e=>({...e,isPending:!1})),[e,s]),u=(0,U.useMemo)(()=>{let e=new Set(l.map(e=>e.id)),t=c.filter(t=>{let n=o.current.get(t.id);return!(n&&e.has(n))}),n=l.filter(e=>e.pinned),i=l.filter(e=>!e.pinned);return[...n,...t,...i].map(e=>{let t=r.get(e.id);return t===void 0?e:{...e,optimisticContent:t}})},[c,l,r]);(0,U.useEffect)(()=>{r.size!==0&&r.forEach((t,n)=>{if(n.startsWith(`pending-`))return;let r=e.find(e=>e.id===n);r&&r.content===t&&i(e=>{let t=new Map(e);return t.delete(n),t})})},[e,r]);let d=(0,U.useCallback)(e=>{let t=WV(),r={id:t,content:``,isPending:!0,createdAt:Date.now()};return n(t=>{if(e!==void 0&&e>=0){let n=[...t];return n.splice(e,0,r),n}else return[...t,r]}),t},[]),p=(0,U.useCallback)((e,t)=>{o.current.set(e,t.id)},[]);(0,U.useEffect)(()=>{if(t.length===0)return;let r=new Set(e.map(e=>e.id)),a=[];for(let e of t){let t=o.current.get(e.id);t&&r.has(t)&&a.push(e.id)}a.length>0&&(n(e=>e.filter(e=>!a.includes(e.id))),i(e=>{let t=new Map(e);return a.forEach(e=>t.delete(e)),t}),a.forEach(e=>o.current.delete(e)))},[e,t]);let m=(0,U.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e)),i(t=>{let n=new Map(t);return n.delete(e),n})},[]),h=(0,U.useMemo)(()=>(0,f.debounce)(async(e,t)=>{let n=a.current.get(e);if(!n||n!==t)return;let r=e.startsWith(`pending-`);if(!t.trim()){r&&m(e);return}try{if(r){let n=await V.createMemoDaily(t,!0);n&&(o.current.set(e,n.id),p(e,n))}else await V.updateMemo(e,t)}catch(e){console.error(`Failed to save content:`,e)}},1e3),[m,p]),g=(0,U.useCallback)(async e=>{let t=a.current.get(e)??``;if(e.startsWith(`pending-`)&&t.trim())try{let n=await V.createMemoDaily(t,!0);n&&(o.current.set(e,n.id),p(e,n))}catch(e){console.error(`Immediate save failed:`,e)}},[p]);return{allItems:u,addPendingItem:d,confirmPendingItem:p,removePendingItem:m,updateItemContent:(0,U.useCallback)((e,t)=>{i(n=>{let r=new Map(n);return r.set(e,t),r}),n(n=>n.map(n=>n.id===e?{...n,content:t}:n)),h(e,t)},[h]),savePendingImmediately:g}},KV=e=>{let[t,n]=(0,U.useState)(0),[r,i]=(0,U.useState)(null),a=(0,U.useRef)(new Map),o=(0,U.useCallback)(t=>{if(t<0||t>=e.length)return;n(t);let r=e[t].id,i=a.current.get(r);i&&(typeof i.focus==`function`&&i.focus({preventScroll:!0}),i.scrollIntoView({block:`nearest`,behavior:`smooth`}))},[e]);return{focusedIndex:t,editingIndex:r,itemRefs:a,setFocusedIndex:n,setEditingIndex:i,focusItem:o,handleKeyDown:(0,U.useCallback)(e=>{if(r===null)switch(e.key){case`ArrowUp`:e.preventDefault(),o(t-1);break;case`ArrowDown`:e.preventDefault(),o(t+1);break;case`Enter`:e.preventDefault(),i(t);break;case`Escape`:break;default:break}},[r,t,o])}},qV=60,JV=40,YV=({thinos:e})=>{let t=(0,U.useRef)(null),n=(0,U.useRef)(null),r=(0,U.useRef)([]),i=(0,U.useRef)(`top-composer-${Date.now()}`),[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)((0,f.moment)().format(`HH:mm`)),[l,u]=(0,U.useState)(new Date().toLocaleString()),[d,p]=(0,U.useState)(()=>Math.min(qV,e.length)),{getScrollElement:m}=bB(),[h,g]=(0,U.useState)(!1),_=(0,U.useRef)(null),v=(0,U.useRef)(!1);U.useEffect(()=>{let e=window.setInterval(()=>{c((0,f.moment)().format(`HH:mm`)),u(new Date().toLocaleString())},3e4);return()=>window.clearInterval(e)},[]);let{allItems:y,addPendingItem:b,removePendingItem:x,updateItemContent:S,savePendingImmediately:C}=GV(e),{focusedIndex:w,editingIndex:T,itemRefs:E,setEditingIndex:D,focusItem:O,handleKeyDown:k}=KV(y);U.useEffect(()=>{r.current=y},[y]);let ee=U.useMemo(()=>d>=y.length?y:y.slice(0,d),[y,d]),A=d<y.length;U.useEffect(()=>{p(e=>{if(y.length===0)return 0;let t=Math.min(qV,y.length);if(e===0)return t;let n=Math.min(e,y.length);return n<t?t:n})},[y.length]),U.useEffect(()=>{let e=T??w;e>=d&&e<y.length&&p(t=>{let n=Math.max(t,e+1);return Math.min(y.length,n+JV)})},[w,T,d,y.length]),U.useEffect(()=>{if(y.length!==0){if(v.current){v.current=!1;return}O(w)}},[d,y.length,w,O]),U.useEffect(()=>{let e=n.current,t=m()??null;if(!e||!A)return;let r=new IntersectionObserver(e=>{let t=e.some(e=>e.isIntersecting);g(e=>e===t?e:t)},{root:t,rootMargin:`200px`});return r.observe(e),()=>r.disconnect()},[m,A]);let te=(0,U.useCallback)(()=>{let e=m();e?_.current={prevScrollTop:e.scrollTop,prevScrollHeight:e.scrollHeight}:_.current=null,v.current=!0,p(e=>Math.min(y.length,e+JV))},[y.length,m]);(0,U.useLayoutEffect)(()=>{let e=_.current;if(!e)return;let t=m();if(_.current=null,!t)return;let n=t.scrollHeight-e.prevScrollHeight;n!==0&&t.scrollTo({top:e.prevScrollTop+n,behavior:`auto`})},[d,m]);let ne=(0,U.useCallback)(e=>{O(e)},[O]),re=(0,U.useCallback)(e=>{o(e)},[]),ie=(0,U.useCallback)(()=>{let e=a.trim();if(!e)return;let t=b(0);S(t,e),C?.(t),o(``),i.current=`top-composer-${Date.now()}`,setTimeout(()=>{let e=r.current.findIndex(e=>e.id===t);e!==-1&&O(e)},0)},[a,b,S,O]),ae=(0,U.useCallback)(()=>{ie()},[ie]),oe=(0,U.useCallback)(e=>{D(e)},[D]),se=(0,U.useCallback)(()=>{D(null),O(w)},[D,O,w]),ce=(0,U.useCallback)((e,t)=>{S(e,t)},[S]),le=(0,U.useCallback)(e=>{let t=b(e+1);setTimeout(()=>{let e=r.current.findIndex(e=>e.id===t);if(e===-1){D(null);return}D(e),O(e)},0)},[b,D,O]),ue=(0,U.useCallback)(e=>{y.find(t=>t.id===e)?.isPending?x(e):console.log(`Delete real memo:`,e)},[y,x]),de=(0,U.useCallback)((e,t)=>{e?E.current.set(t,e):E.current.delete(t)},[E]);return U.useEffect(()=>{let e=t.current;if(!e)return;let n=e=>{let t=e.target;if(!(t&&t.closest(`.temp-editor`))){if(y.length===0&&e.key===`Enter`){e.preventDefault(),e.stopPropagation();let t=b(0);setTimeout(()=>{let e=r.current.findIndex(e=>e.id===t);e!==-1&&(D(e),O(e))},0);return}T===null&&([`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&e.stopPropagation(),k(e))}};return e.addEventListener(`keydown`,n,{capture:!0}),()=>{e.removeEventListener(`keydown`,n,{capture:!0})}},[T,k]),(0,W.jsxs)(`div`,{ref:t,className:`flow-view`,tabIndex:-1,children:[(0,W.jsxs)(`div`,{className:`flow-list`,children:[(0,W.jsxs)(`div`,{className:`flow-top-composer flow-item`,children:[(0,W.jsx)(`div`,{className:`flow-item-header`,children:(0,W.jsx)(`span`,{className:`flow-item-time`,"aria-label":l,children:s})}),(0,W.jsx)(`div`,{className:`flow-item-content`,children:(0,W.jsx)(`div`,{className:`flow-item-editor-placeholder`,children:(0,W.jsx)(IV,{itemId:i.current,initialContent:a,placeholder:`Start a new note at the top...`,onContentChange:re,onSubmit:ie,onCancel:ae})})})]}),ee.map((e,t)=>(0,W.jsx)(UV,{item:e,index:t,isFocused:w===t,isEditing:T===t,onFocus:ne,onEdit:oe,onExitEdit:se,onContentChange:ce,onCreateNext:le,onDelete:ue,itemRef:de},e.id)),A&&(0,W.jsxs)(`div`,{className:`flow-load-more-region`,children:[(0,W.jsx)(`div`,{ref:n,className:`flow-load-more-sentinel`,"aria-hidden":`true`}),h&&(0,W.jsx)(`button`,{type:`button`,className:`flow-load-more-button`,onClick:te,children:`加载更多`})]})]}),y.length===0&&(0,W.jsx)(`div`,{className:`flow-empty-state`,children:(0,W.jsx)(`p`,{children:`Press Enter to create your first note`})})]})};I(),H(),M();var XV=class extends f.Modal{message;onConfirm;onCancel;constructor(e,t,n,r){super(e),this.message=t,this.onConfirm=n,this.onCancel=r}onOpen(){let{contentEl:e}=this;e.empty(),e.addClass(`thino-confirm-modal`),e.createEl(`h2`,{text:j(`Confirm`)}),e.createEl(`p`,{text:this.message});let t=e.createDiv({cls:`modal-button-container`});t.createEl(`button`,{text:j(`Cancel`)}).addEventListener(`click`,()=>{this.onCancel(),this.close()}),t.createEl(`button`,{text:j(`Confirm`),cls:`mod-warning`}).addEventListener(`click`,()=>{this.onConfirm(),this.close()})}onClose(){let{contentEl:e}=this;e.empty()}},ZV=({app:e})=>{let t=Di(e=>e.getSelectedCount()),n=Di(e=>e.getSelectedIds),r=Di(e=>e.clearSelection),i=P(e=>e.memos),[a,o]=(0,U.useState)(!1),s=(0,U.useCallback)(()=>{let e=n();return i.filter(t=>e.includes(t.id))},[n,i]),c=(0,U.useCallback)(t=>new Promise(n=>{new XV(e,t,()=>n(!0),()=>n(!1)).open()}),[e]),l=(0,U.useCallback)(async()=>{let e=s();if(e.length===0||!await c(`Are you sure you want to delete ${e.length} ${j(`Thinos`)}? This action cannot be undone.`))return;o(!0);let t=new f.Notice(j(`Deleting...`),0),n=0,i=0;for(let t of e)try{await V.deleteMemoById(t.id),n++}catch(e){console.error(`Failed to delete memo:`,t.id,e),i++}o(!1),t.hide(),r(),i===0?new f.Notice(`${j(`Successfully deleted`)} ${n} ${j(`Thinos`)}`):new f.Notice(`${j(`Successfully deleted`)} ${n} ${j(`Thinos`)}, ${j(`failed`)} ${i}`)},[s,c,r]),u=(0,U.useCallback)(async()=>{let e=s();if(e.length===0||!await c(`Are you sure you want to archive ${e.length} ${j(`Thinos`)}?`))return;o(!0);let t=new f.Notice(j(`Archiving...`),0),n=0,i=0;for(let t of e)try{await V.archiveMemo(t)?n++:i++}catch(e){console.error(`Failed to archive memo:`,t.id,e),i++}o(!1),t.hide(),r(),i===0?new f.Notice(`${j(`Successfully archived`)} ${n} ${j(`Thinos`)}`):new f.Notice(`${j(`Successfully archived`)} ${n} ${j(`Thinos`)}, ${j(`failed`)} ${i}`)},[s,c,r]),d=(0,U.useCallback)(async()=>{let e=s();if(e.length===0)return;let t=e.every(e=>e.pinned)?`unpin`:`pin`;if(!await c(t===`pin`?`Are you sure you want to pin ${e.length} ${j(`Thinos`)}?`:`Are you sure you want to unpin ${e.length} ${j(`Thinos`)}?`))return;o(!0);let n=new f.Notice(j(t===`pin`?`Pinning...`:`Unpinning...`),0),i=0,a=0;for(let n of e)try{t===`pin`?await V.pinMemoById(n.id):await V.unpinMemoById(n.id),i++}catch(e){console.error(`Failed to ${t} memo:`,n.id,e),a++}o(!1),n.hide(),r(),a===0?new f.Notice(t===`pin`?`${j(`Successfully pinned`)} ${i} ${j(`Thinos`)}`:`${j(`Successfully unpinned`)} ${i} ${j(`Thinos`)}`):new f.Notice(`${j(`Processed`)} ${i} ${j(`Thinos`)}, ${j(`failed`)} ${a}`)},[s,c,r]),p=(0,U.useCallback)(async()=>{let e=s();if(e.length===0)return;o(!0);let t=e.map(e=>`${`## ${e.createdAt}${e.pinned?` 📌`:``}`}\n\n${e.content}`).join(`
- ---
- `);try{await navigator.clipboard.writeText(t),new f.Notice(`${j(`Successfully copied`)} ${e.length} ${j(`Thinos`)} to clipboard`),r()}catch(e){console.error(`Failed to copy to clipboard:`,e),new f.Notice(j(`Copy to clipboard failed`))}finally{o(!1)}},[s,r]),m=(0,U.useCallback)(()=>{r()},[r]);return t===0?null:(0,W.jsx)(`div`,{className:x_(`selection-toolbar`,{loading:a}),children:(0,W.jsxs)(`div`,{className:`selection-toolbar-content`,children:[(0,W.jsx)(`span`,{className:`selection-toolbar-count`,children:`${t} ${j(`items`)}`}),(0,W.jsxs)(`div`,{className:`selection-toolbar-actions`,children:[(0,W.jsxs)(`div`,{className:`clickable-icon selection-toolbar-btn`,onClick:d,title:j(`Pin/Unpin selected`),children:[(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`pin`)}),j(`Pin/Unpin`)]}),(0,W.jsxs)(`div`,{className:`clickable-icon selection-toolbar-btn`,onClick:u,"aria-label":j(`Archive selected`),children:[(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`archive`)}),j(`Archive`)]}),(0,W.jsxs)(`div`,{className:`clickable-icon selection-toolbar-btn`,onClick:p,"aria-label":j(`Copy to clipboard`),children:[(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`copy`)}),j(`Copy`)]}),(0,W.jsxs)(`div`,{className:`clickable-icon selection-toolbar-btn danger`,onClick:l,"aria-label":j(`Delete selected`),children:[(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`trash`)}),j(`Delete`)]}),(0,W.jsx)(`div`,{className:`clickable-icon selection-toolbar-btn selection-toolbar-clear`,onClick:m,title:j(`Clear selection`),children:(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`x`)})})]})]})})};I(),Hg(),H(),ng(),M(),Mi();var QV=new Map,$V=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function eH(e,t){let n=e.replaceAll(`-`,`/`),r=n.substring(0,4),i=n.substring(5,7),a=n.substring(8,10);switch(t){case`year`:return r;case`month`:return`${r}-${i}`;case`quarter`:return`${r}-Q${Math.ceil(parseInt(i)/3)}`;case`week`:{let e=new Date(parseInt(r),parseInt(i)-1,parseInt(a)),t=Xs(e),n=Eu(e);return`${t}-W${String(n).padStart(2,`0`)}`}case`day`:return`${r}-${i}-${a} ${$V[new Date(parseInt(r),parseInt(i)-1,parseInt(a)).getDay()]}`;default:return e.substring(0,10)}}function tH(e,t){let n={};return e.forEach(e=>{let r;if(e.pinned)r=`PINNED`;else{let n=`${e.createdAt}-${t}`,i=QV.get(n);i||(i=eH(e.createdAt,t),QV.set(n,i),QV.size>1e3&&Array.from(QV.keys()).slice(0,500).forEach(e=>QV.delete(e))),r=i}n[r]||(n[r]=[]),n[r].push(e)}),n}function nH(e){let{tag:t,duration:n,type:r,text:i,filter:a,path:o,metadata:s}=e,c=Zg.getQueryById(a),l=!s||Object.keys(s).length===0;return!(t||n&&n.from<n.to||r||i||!l||o||c?.id||c)}var rH=({updateThinos:e,listView:t,sortConfig:n})=>{let r=Si(e=>e.query),i=P(e=>e.memos),a=i?.length||0,o=F(e=>e.app),s=F(e=>e.settings?.showDayMark),c=F(e=>e.settings?.dayMarkRange),l=F(e=>e.settings?.ShowScrollToTopButton),u=Di(e=>e.getSelectedCount()),[d,p]=(0,U.useState)([]),m=(0,U.useRef)([]),h=(0,U.useMemo)(()=>{if(n)return{sortBy:n.field,sortOrder:n.direction}},[n]),g=(0,U.useRef)(null),[_,v]=(0,U.useState)({showDayMark:o?.loadLocalStorage(`showDayMark`)||!1,dayMarkRange:o?.loadLocalStorage(`dayMarkRange`)||`day`,dayMarkThinos:{}}),y=(0,U.useRef)(null),b=(0,U.useCallback)(()=>{y.current?.scrollToTop()},[]),x=(0,U.useCallback)(()=>{y.current?.scrollToTop()},[]),S=(0,U.useRef)(!1),C=(0,U.useRef)(!1);(0,U.useRef)(!1),(0,U.useEffect)(()=>{t!==`chat`&&x()},[t]),(0,U.useLayoutEffect)(()=>{if(i.length!==0&&S.current===!0)return;let e=aH(o||window.app);if(!e||e.length===0)return;let t=e.slice(0,200);C.current=!0,m.current=t,p(t);let n=o?.loadLocalStorage(`showDayMark`)||!1;v(t=>({...t,showDayMark:n,dayMarkThinos:n?tH(e,o?.loadLocalStorage(`dayMarkRange`)||`day`):t.dayMarkThinos}))},[]);let w=Vg(e=>e.filteredMemos),T=Vg(e=>e.version),E=Vg(e=>e.isCalculating);(0,U.useEffect)(()=>{if(T===0||E)return;let t=a>0,n=!nH(r),i=T===1&&w.length===0&&t&&!n?m.current:w;i!==d&&(0,U.startTransition)(()=>{p(i)}),m.current=i,e?.(i)},[w,T,E,e,a,r,d]),(0,U.useEffect)(()=>{T>0&&oH(d||[],o);let e=s||!1,t=c||`day`;o?.saveLocalStorage(`showDayMark`,e),o?.saveLocalStorage(`dayMarkRange`,t),v(n=>({showDayMark:e,dayMarkRange:t,dayMarkThinos:e?tH(d,t):n.dayMarkThinos}))},[d,s,c,T,o]),(0,U.useEffect)(()=>{E||t!==`chat`&&b()},[r,E,t,b]);let D=()=>V.fetchAllMemos().then(()=>{}).catch(e=>{console.error(`Failed to refresh memos:`,e)}),O=(0,U.useCallback)((0,f.debounce)(async()=>{try{await D(),setTimeout(()=>{t!==`chat`&&b()},100)}catch(e){console.error(`Pull-to-refresh failed:`,e),new f.Notice(`Failed to refresh data`)}},800),[D,b]);(0,U.useMemo)(()=>(0,W.jsx)(`div`,{className:x_(`status-text-container`,`completed`,t===`calendar`||t===`table`?`visually-hidden`:``),children:(0,W.jsx)(`p`,{className:`status-text`,children:d.length===0?j(`Noooop!`):(0,W.jsxs)(W.Fragment,{children:[j(`All Data is Loaded 🎉`),(0,W.jsx)(`span`,{className:`cursor-pointer hover:text-green-600 ml-2`,onClick:O,title:`Refresh to check for new memos`,children:`↻`})]})})}),[t,d,O]);let k=e=>{let{showDayMark:t,dayMarkRange:n}=_;switch(e){case`list`:return(0,W.jsx)(XD,{memos:d,listView:e,className:`${e}-view`,sortConfig:h,showDayMark:t,dayMarkRange:n});case`waterfall`:return(0,W.jsx)(PV,{memos:d,className:`${e}-view waterfall-virtual`,columns:3,gap:10});case`chat`:return(0,W.jsx)(DV,{thinos:d});case`calendar`:return(0,W.jsx)(PL,{thinos:d});case`table`:return(0,W.jsx)(hB,{thinos:d,isFiltering:!nH(r)});case`moments`:return(0,W.jsx)(MV,{thinos:d});case`flow`:return(0,W.jsx)(YV,{thinos:d});default:return(0,W.jsx)(XD,{memos:d,listView:e,className:`${e}-view`,sortConfig:h,showDayMark:_.showDayMark,dayMarkRange:_.dayMarkRange})}};return(0,W.jsxs)(xB,{scrollRef:y,children:[u>0&&o&&(0,W.jsx)(ZV,{app:o}),(0,W.jsx)(FV,{ref:y,className:`memolist-wrapper completed`,mode:t===`chat`?`bottom`:`top`,style:{height:`100%`},children:(0,W.jsx)(`div`,{ref:g,className:`memolist-container`,"data-list-view":t,"data-count":d?.length||0,children:k(t)})}),l&&(0,W.jsx)(`button`,{className:x_(`scroll-to-bottom-button`,t===`chat`?`to-bottom`:`to-top`,t===`flow`&&`thino-hidden`,(t===`table`||t===`calendar`)&&`thino-hidden`),onClick:()=>{t===`chat`?y.current?.scrollToBottom(!0):y.current?.scrollToTop(!0)},children:`↑`})]})};function iH(e){return`memosListCache:${e}`}function aH(e){try{if(!e?.appId)return[];let t=iH(e.appId),n=ji.get([t])[t];return n&&JSON.parse(n)?.memos||[]}catch(e){return console.error(e),[]}}function oH(e,t){try{if(!e)return;let n=(t||window?.app)?.appId;if(!n)return;let r=e?.slice(0,100),i=iH(n);ji.set({[i]:JSON.stringify({memos:r})})}catch(e){console.error(e)}}ng(),I(),M();var sH=864e5,cH=52,lH=7,uH=()=>{let{settings:e}=F(),{isPhoneView:t}=vi(),n=P(e=>e.memos),r=e?.DefaultThemeForThino===`focus`,[i,a]=(0,U.useState)(!1),{totalMemos:o,activeDays:s,heatCells:c}=(0,U.useMemo)(()=>{let e=n||[];if(!e.length)return{totalMemos:0,activeDays:0,heatCells:[]};let t=e.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`),r=new Map,i=1/0;for(let e of t){let t=e.createdAtTs??(e.createdAt?new Date(String(e.createdAt).replace(/\//g,`-`)).getTime():NaN);if(!Number.isFinite(t))continue;t<i&&(i=t);let n=new Date(t),a=`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`;r.set(a,(r.get(a)||0)+1)}let a=new Date,o=Number.isFinite(i)?Lc(Qs(a),Qs(new Date(i)))+1:0,s=[],c=new Date;c.setHours(0,0,0,0);let l=cH*lH;for(let e=l-1;e>=0;e--){let t=new Date(c.getTime()-e*sH),n=`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`,i=r.get(n)||0,a=0;i>=1&&(a=1),i>=3&&(a=2),i>=6&&(a=3),i>=10&&(a=4),s.push(a)}return{totalMemos:t.length,activeDays:Math.max(o,0),heatCells:s}},[n]);if(!r||!t||!n||n.length===0)return null;let l=j(`Today`),u=j(`Thoughts`)||`想法`,d=j(`Day streak`)||`天连续`;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`thino-focus-mobile-meta${i?` is-open`:``}`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`thino-focus-mobile-meta-today`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[l,(0,W.jsxs)(`span`,{className:`thino-focus-mobile-meta-caret`,"aria-hidden":`true`,children:[` `,i?`▴`:`▾`]})]}),(0,W.jsxs)(`span`,{className:`thino-focus-mobile-meta-stats`,"aria-hidden":`true`,children:[(0,W.jsxs)(`span`,{className:`thino-focus-mobile-meta-row`,children:[(0,W.jsx)(`em`,{children:o.toLocaleString()}),` `,u]}),(0,W.jsxs)(`span`,{className:`thino-focus-mobile-meta-row`,children:[(0,W.jsx)(`em`,{children:s.toLocaleString()}),` `,d]})]})]}),i&&(0,W.jsx)(`div`,{className:`thino-focus-mobile-heat`,"aria-hidden":`true`,children:(0,W.jsx)(`div`,{className:`thino-focus-mobile-heat-strip`,children:c.map((e,t)=>(0,W.jsx)(`span`,{className:`thino-focus-mobile-heat-cell${e?` l${e}`:``}`},t))})})]})};I(),H(),M();var dH=()=>{let{showSiderbarInMobileView:e}=vi(),{query:{text:t}}=Si(),n=(0,U.useRef)(null),r=(0,U.useRef)(null),i=(0,U.useRef)(null),[a,o]=(0,U.useState)(!1),[s,c]=(0,U.useState)(t||``);(0,U.useEffect)(()=>{n.current&&(0,f.setIcon)(n.current,`menu`)},[]),(0,U.useEffect)(()=>{!a&&r.current&&(0,f.setIcon)(r.current,`search`)},[a]),(0,U.useEffect)(()=>{c(t||``)},[t]);let l=Cv(e=>{z.setTextQuery(e)},250,[]),u=(0,U.useCallback)(t=>{t.stopPropagation(),R.setShowSiderbarInMobileView(!e)},[e]),d=(0,U.useCallback)(()=>{o(!0),window.setTimeout(()=>i.current?.focus(),30)},[]),p=(0,U.useCallback)(()=>{s.trim()||o(!1)},[s]),m=(0,U.useCallback)(e=>{let t=e.currentTarget.value;c(t),l(t)},[l]),h=(0,U.useCallback)(()=>{c(``),z.setTextQuery(``),i.current?.focus()},[]),g=(0,U.useCallback)(e=>{e.key===`Escape`&&(e.preventDefault(),s?h():(o(!1),i.current?.blur()))},[s,h]);return(0,W.jsxs)(`div`,{className:`thino-focus-mobile-topbar ${a?`is-search-expanded`:``}`,role:`banner`,children:[(0,W.jsx)(`button`,{type:`button`,className:`thino-focus-mobile-topbar-btn is-leading`,"aria-label":j(`Menu`)||`Menu`,onClick:u,children:(0,W.jsx)(`span`,{ref:n,"aria-hidden":`true`})}),!a&&(0,W.jsxs)(`div`,{className:`thino-focus-mobile-topbar-brand`,"aria-hidden":`true`,children:[(0,W.jsx)(`span`,{className:`thino-focus-mobile-topbar-name`,children:`thino`}),(0,W.jsx)(`span`,{className:`thino-focus-mobile-topbar-dot`})]}),a?(0,W.jsxs)(`div`,{className:`thino-focus-mobile-topbar-search`,children:[(0,W.jsx)(`input`,{ref:i,type:`text`,className:`thino-focus-mobile-topbar-search-input`,placeholder:j(`Type here`),value:s,onChange:m,onBlur:p,onKeyDown:g}),s&&(0,W.jsx)(`button`,{type:`button`,className:`thino-focus-mobile-topbar-search-clear`,"aria-label":j(`Clear search`)||`Clear search`,onMouseDown:e=>e.preventDefault(),onClick:h,children:`×`})]}):(0,W.jsx)(`button`,{type:`button`,className:`thino-focus-mobile-topbar-btn is-trailing`,"aria-label":j(`Search`)||`Search`,onClick:d,children:(0,W.jsx)(`span`,{ref:r,"aria-hidden":`true`})})]})};I(),H(),M();var fH=()=>{let{settings:e}=F(),{isPhoneView:t,globalEditorShown:n}=vi(),r=(0,U.useRef)(null),i=e?.DefaultThemeForThino===`focus`&&t&&!n;if((0,U.useEffect)(()=>{i&&r.current&&(0,f.setIcon)(r.current,`arrow-up`)},[i]),!i)return null;let a=()=>{R.setGlobalEditorShown(!0)},o=j(`What's on your mind?`)||`你现在在想什么?`;return(0,W.jsxs)(`button`,{type:`button`,className:`thino-focus-fab`,onClick:a,"aria-label":o,children:[(0,W.jsx)(`span`,{className:`thino-focus-fab-prompt`,children:o}),(0,W.jsx)(`span`,{className:`thino-focus-fab-send`,"aria-hidden":`true`,children:(0,W.jsx)(`span`,{ref:r})})]})};I(),jg(),Do();function pH(){let{settings:e,app:t,view:n}=F(),{loaded:r,memoListView:i,isMobileView:a,isPhoneView:o}=vi(),s=e?.DefaultThemeForThino===`focus`,c=s&&o,l=f.Platform.isMobile&&e?.DefaultEditorLocation===`Bottom`&&!c,[u,d]=U.useState([]),[p,m]=U.useState((window.app||t).loadLocalStorage(`thinoListView`)||`list`),[h,g]=(0,U.useState)(()=>Ag(t||window.app)),_=e=>{g(e)};(0,U.useEffect)(()=>{i===p||!i||(m(i),t&&t?.saveLocalStorage(`thinoListView`,i))},[i]),(0,U.useEffect)(()=>{if(!(!n||!t||!r))return Eo.startPolling(n),()=>Eo.stopPolling()},[n,t,r,e.startSync]);let v=U.useRef(null);(0,U.useEffect)(()=>{if(!s||o||!r)return;let e=null,t=0,n=()=>{!e||!v.current||v.current.classList.toggle(`is-shrunk`,e.scrollTop>40)},i=()=>{if(e=document.querySelector(`div[data-type="thino_view"] .memolist-wrapper`),!e){t=window.requestAnimationFrame(i);return}e.addEventListener(`scroll`,n,{passive:!0}),n()};return i(),()=>{t&&window.cancelAnimationFrame(t),e?.removeEventListener(`scroll`,n),v.current?.classList.remove(`is-shrunk`)}},[s,o,r,p]);let y=[(0,W.jsx)(dC,{thinosCount:u.length,thinos:u},`filter`),(0,W.jsx)(rH,{listView:p,sortConfig:h,updateThinos:e=>{d(e)}},`list`)];return(0,W.jsx)(W.Fragment,{children:i===`chat`?(0,W.jsx)(W.Fragment,{children:[(0,W.jsx)(ET,{onSortChange:_,currentSort:h},`header`),...y.reverse(),s&&!o?(0,W.jsxs)(`div`,{ref:v,className:`thino-focus-hero-wrap`,children:[(0,W.jsx)(_E,{}),(0,W.jsx)(Aw,{className:`mod-editor-bottom`,editorType:`inline`})]},`focus-hero-wrap`):(0,W.jsx)(Aw,{className:`mod-editor-bottom`,editorType:`inline`},`editor`)]}):c?(0,W.jsx)(W.Fragment,{children:[(0,W.jsx)(dH,{},`focus-mobile-topbar`),(0,W.jsx)(uH,{},`focus-mobile-meta`),...y,(0,W.jsx)(fH,{},`focus-mobile-fab`)]}):(0,W.jsx)(W.Fragment,{children:l?[(0,W.jsx)(ET,{onSortChange:_,currentSort:h},`header`),...y,(0,W.jsx)(Aw,{className:`mod-editor-bottom`,editorType:`block`},`editor`)]:[(0,W.jsx)(ET,{onSortChange:_,currentSort:h},`header`),s&&!o?(0,W.jsxs)(`div`,{ref:v,className:`thino-focus-hero-wrap`,children:[(0,W.jsx)(_E,{}),(0,W.jsx)(Aw,{editorType:`block`})]},`focus-hero-wrap`):(0,W.jsx)(Aw,{editorType:`block`},`editor`),...y]})})}li(),H(),M(),gs(),I(),Do();var mH=e=>{let{memo:t,handleDeletedMemoAction:n}=e,r=F(),i={...t,createdAtStr:N.getDateTimeString(t.createdAt),deletedAtStr:N.getDateTimeString(t.deletedAt||t.createdAt)},a=U.useRef(null),o=U.useRef(null),[s,c]=U.useState(``),l=(0,U.useRef)(null);(0,U.useEffect)(()=>{!o||!l.current||(0,f.setIcon)(l.current,`more-horizontal`)},[o]),(0,U.useEffect)(()=>{if(!a.current||!o.current||a.current.hasChildNodes()&&t.content===s)return;let{view:e}=r;if(!e)return;c(t.content),a.current.hasChildNodes()&&a.current.empty();async function n(){await f.MarkdownRenderer.render(r.app,t.content+`
- `,a.current,t.path,e),(a.current?.querySelectorAll(`.internal-link`))?.forEach(n=>{let i=n,a=i.getAttribute(`data-href`);a&&(r.app.metadataCache.getFirstLinkpathDest(a,t.path)||n.classList.add(`is-unresolved`),i.addEventListener(`mouseover`,t=>{t.stopPropagation(),r.app.workspace.trigger(`hover-link`,{event:t,source:`thino`,hoverParent:e.containerEl,targetEl:i,linktext:a,sourcePath:i.href})}))})}n()},[t.content,o]);let u=async()=>{try{await V.deleteMemoById(i.id),n(i.id)}catch(e){new f.Notice(e.message)}},d=async()=>{switch(i.sourceType){case`DAILY`:await ps(i.id,i.path);break;case`CANVAS`:await hs(i.id,i.path);break;case`MULTI`:await fs(i.path);break;case`FILE`:await ms(i.id,i.path);break;case`JOURNAL`:await ps(i.id,i.path);break}},p=async()=>{try{let e=await V.restoreMemoById(i.id);e?.webId&&await Eo.syncRecover(e.webId),e&&V.editMemo(e),n(i.id),new f.Notice(j(`RESTORE SUCCEED`))}catch(e){new f.Notice(e.message)}};return(0,W.jsxs)(`div`,{ref:o,className:`memo-wrapper ${`memos-`+i.id}`,children:[(0,W.jsxs)(`div`,{className:`memo-top-wrapper`,children:[(0,W.jsxs)(`span`,{className:`time-text`,children:[j(`DELETE AT`),` `,i.deletedAtStr]}),(0,W.jsx)(`div`,{className:`btns-container`,children:(0,W.jsx)(`span`,{ref:l,className:`btn more-action-btn`,onClick:e=>{e.stopPropagation();let t=new f.Menu;t.addItem(e=>{e.setTitle(j(`RESTORE`)).setIcon(`archive-restore`).onClick(p)}),t.addItem(e=>{e.setTitle(j(`SOURCE`)).setIcon(`home`).onClick(d)}),t.addItem(t=>{t.setTitle(j(`DELETE`)).setIcon(`trash`).setWarning(!0).onClick(()=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(j(`CONFIRM!`)).setIcon(`trash`).setWarning(!0).onClick(u)}),t.addItem(e=>{e.setTitle(j(`Cancel`)).setIcon(`x`).onClick(()=>{})}),t.showAtMouseEvent(e.nativeEvent)})}),t.showAtMouseEvent(e.nativeEvent)}})})]}),(0,W.jsx)(`div`,{ref:a,className:`memo-content-text`,onContextMenu:e=>{e.preventDefault(),e.stopPropagation()}})]})};M();var hH=({isLoading:e,isEmpty:t,emptyMessage:n=j(`Here is No Memos.`)})=>e?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:j(`Fetching data...`)})}):t?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:n})}):null;I(),H(),Tg(),M(),Av(),Do();var gH=()=>{let{query:e}=Si(),{isMobileView:t}=vi(),{memos:n}=P(),{app:r,plugin:i}=F(),a=Ub(),[o,s]=(0,U.useState)([]),c=U.useRef(null),l=U.useRef(null);(0,U.useEffect)(()=>{l.current&&(0,f.setIcon)(l.current,`more-horizontal`)},[l]),(0,U.useEffect)(()=>{wg({memos:n,query:e,filterOptions:{filterDoneTasks:!1,onlyFilterType:`deleted`},plugin:i}).then(e=>{s(e)}),a.setFinish()},[n,c.current,e]);let u=(0,U.useCallback)(e=>{s(t=>t.filter(t=>t.id!==e))},[]),d=async()=>{if(!(o?.length>0))return;if(!await sC()){kv();return}let e=[...o];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`);for(let e of n){let t=await V.restoreMemoById(e.id);t?.webId&&await Eo.syncRecover(t.webId),t&&V.editMemo(t)}let r=mC(t);for(let{path:e,thinos:t}of r){let n=await V.dealWithDailyThinoBulk(e,t,`restoreFromDelete`);for(let e of n)e?.webId&&await Eo.syncRecover(e.webId)}z.clearQuery(),new f.Notice(j(`RESTORE SUCCEED`))}catch(e){new f.Notice(e.message)}},p=async()=>{if(!(o?.length>0))return;if(!await sC()){kv();return}let e=[...o];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`);for(let e of n)await V.deleteMemoById(e.id);let r=mC(t);for(let{path:e,thinos:t}of r){let n=await V.dealWithDailyThinoBulk(e,t,`deleteForever`);for(let e of n)e?.webId&&await Eo.syncDelete(e.webId)}z.clearQuery(),new f.Notice(j(`DELETE SUCCEED`))}catch(e){console.error(`error`,e),new f.Notice(e.message)}};return(0,W.jsxs)(`div`,{className:`memo-trash-wrapper`,ref:c,children:[(0,W.jsx)(pC,{showSidebar:t,rightContent:(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:`header-right-section`,children:(0,W.jsx)(Dv,{disableSuper:!0})})}),children:(0,W.jsx)(`span`,{ref:l,className:`menu-popup-btn`,onClick:e=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(j(`Bulk restore`)).setIcon(`archive-restore`).onClick(async()=>{new lC(r,j(`RESTORE`),async e=>{e===`confirm`&&await d()}).open()})}).addItem(e=>{e.setTitle(j(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new lC(r,j(`DELETE`),async e=>{e===`confirm`&&await p()}).open()})}),t.showAtMouseEvent(e.nativeEvent)}})}),(0,W.jsx)(dC,{thinosCount:o.length,thinos:o}),(0,W.jsx)(hH,{isLoading:a.isLoading,isEmpty:o.length===0}),!a.isLoading&&o.length>0&&(0,W.jsx)(`div`,{className:`deleted-memos-container`,children:o.map(e=>(0,W.jsx)(mH,{memo:e,handleDeletedMemoAction:u},`${e.id}-${e.updatedAt}`))})]})};I(),H(),Tg();var _H=()=>{let{app:e,plugin:t,settings:n}=F(),{query:r}=Si(),{isMobileView:i,changedByMemos:a}=vi(),{memos:o}=P(),s=Ub(),[c,l]=(0,U.useState)([]),[u,d]=(0,U.useState)([]),p=U.useRef(null),m=U.useRef(null),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)([]),y=U.useRef([]);(0,U.useEffect)(()=>{m.current&&((0,f.setIcon)(m.current,`refresh-cw`),e.workspace.on(`refresh-review-memos`,b))},[m]),(0,U.useEffect)(()=>{if(h){if(r){wg({memos:o,query:r,filterOptions:{filterDoneTasks:!1,filterArchived:!n.ViewArchiveInRandomReview},plugin:t}).then(e=>{l([...e].sort(()=>Math.random()-Math.random()).slice(0,10)),g(!1)});return}l([..._].sort(()=>Math.random()-Math.random()).slice(0,10)),g(!1)}},[h,n.ViewArchiveInRandomReview]),(0,U.useEffect)(()=>{_.length>0&&(l([..._].sort(()=>Math.random()-Math.random()).slice(0,10)),g(!1))},[_]),(0,U.useEffect)(()=>{p.current&&(wg({memos:o,query:r,filterOptions:{filterDoneTasks:!1,filterArchived:!n.ViewArchiveInRandomReview},plugin:t}).then(e=>{v(e.filter(e=>e.rowStatus!==`ARCHIVED`&&!(e.deletedAt!==``&&e.deletedAt)))}),s.setFinish())},[o,p.current,n.ViewArchiveInRandomReview]),(0,U.useEffect)(()=>{if(a&&y.current.length>0){let e=_.filter(e=>y.current.includes(e.id));d(y.current.map(t=>e.find(e=>e.id===t)).filter(e=>e!==void 0));return}y.current=c.map(e=>e.id),d(c)},[c]),(0,U.useEffect)(()=>{o.length!==0&&wg({memos:o,query:r,filterOptions:{filterDoneTasks:!1,filterArchived:!n.ViewArchiveInRandomReview},plugin:t}).then(e=>{let t=[...(Array.isArray(e)?e:[]).filter(e=>e.rowStatus!==`ARCHIVED`&&!(e.deletedAt!==``&&e.deletedAt))].sort(()=>Math.random()-.5).slice(0,10);l(t),d(t)})},[r]),(0,U.useEffect)(()=>()=>z.clearQuery(),[]);let b=()=>{g(!0)};return(0,W.jsxs)(`div`,{className:`memo-review-wrapper`,ref:p,children:[(0,W.jsx)(pC,{showSidebar:i,children:(0,W.jsx)(`span`,{ref:m,onClick:b,className:`refresh-icon`})}),(0,W.jsx)(dC,{}),(0,W.jsx)(hH,{isLoading:s.isLoading,isEmpty:o.length===0}),!s.isLoading&&o.length>0&&(0,W.jsx)(`div`,{className:`review-memos-container`,children:u.map(e=>(0,W.jsx)(gT,{memo:e},`${e?.id}-${e.createdAt}`))})]})},vH=({data:e,dataKey:t=`date`,width:n=400,height:r=200,color:i=`var(--chart-1)`,responsive:a=!0,minLabelGap:o=70})=>{if(!e||e.length===0)return null;let s=(0,U.useRef)(null),[c,l]=(0,U.useState)(null);(0,U.useEffect)(()=>{if(!a)return;let e=s.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e){let e=Math.floor(t.contentRect.width);e>0&&l(e)}});return t.observe(e),()=>t.disconnect()},[a]);let u=a&&c?c:n,d={top:20,right:20,bottom:40,left:40},f=u-d.left-d.right,p=r-d.top-d.bottom,m=e.map(e=>Number(e.count)||0),h=Math.max(...m),g=t=>e.length<=1?f/2:t/(e.length-1)*f,_=e=>h===0?p/2:p-(e-0)/(h-0)*p,v=e.map((e,t)=>{let n=g(t),r=_(Number(e.count)||0);return`${t===0?`M`:`L`} ${n} ${r}`}).join(` `);return(0,W.jsx)(`div`,{ref:s,style:{width:`100%`},children:(0,W.jsx)(`svg`,{width:u,height:r,className:`simple-line-chart`,children:(0,W.jsxs)(`g`,{transform:`translate(${d.left}, ${d.top})`,children:[[0,.25,.5,.75,1].map(e=>(0,W.jsx)(`line`,{x1:0,y1:p*(1-e),x2:f,y2:p*(1-e),stroke:`var(--background-modifier-border)`,strokeDasharray:`2,2`,opacity:.3},e)),(0,W.jsx)(`path`,{d:v,fill:`none`,stroke:i,strokeWidth:2}),e.map((n,r)=>{let i=Math.max(1,Math.floor(f/o));return r%Math.max(1,Math.ceil(e.length/i))!==0&&r!==e.length-1?null:(0,W.jsx)(`text`,{x:g(r),y:p+20,textAnchor:`middle`,fontSize:`12`,fill:`var(--text-muted)`,children:n[t]||``},r)}),[0,.5,1].map(e=>(0,W.jsx)(`text`,{x:-10,y:p*(1-e)+5,textAnchor:`end`,fontSize:`12`,fill:`var(--text-muted)`,children:Math.round(0+(h-0)*e)},e)),e.map((e,n)=>(0,W.jsx)(`circle`,{cx:g(n),cy:_(Number(e.count)||0),r:3,fill:i,opacity:0,className:`hover-point`,children:(0,W.jsx)(`title`,{children:`${e[t]}: ${e.count}`})},n))]})})})},yH=({data:e,dataKey:t,valueKey:n,width:r=400,height:i=200,color:a=`var(--chart-2)`,responsive:o=!0,minLabelGap:s=70})=>{if(!e||e.length===0)return null;let c=(0,U.useRef)(null),[l,u]=(0,U.useState)(null);(0,U.useEffect)(()=>{if(!o)return;let e=c.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e){let e=Math.floor(t.contentRect.width);e>0&&u(e)}});return t.observe(e),()=>t.disconnect()},[o]);let d=o&&l?l:r,f={top:20,right:20,bottom:40,left:40},p=d-f.left-f.right,m=i-f.top-f.bottom,h=Math.max(...e.map(e=>Number(e[n])||0)),g=p/e.length,_=g*.7,v=g*.3,y=e=>e*g+v/2,b=e=>h<=0?m:m-e/h*m,x=Math.max(1,Math.floor(p/s)),S=Math.max(1,Math.ceil(e.length/x));return(0,W.jsx)(`div`,{ref:c,style:{width:`100%`},children:(0,W.jsx)(`svg`,{width:d,height:i,className:`simple-bar-chart`,children:(0,W.jsxs)(`g`,{transform:`translate(${f.left}, ${f.top})`,children:[[0,.25,.5,.75,1].map(e=>(0,W.jsx)(`line`,{x1:0,y1:m*(1-e),x2:p,y2:m*(1-e),stroke:`var(--background-modifier-border)`,strokeDasharray:`2,2`,opacity:.3},e)),e.map((e,r)=>{let i=Number(e[n])||0,o=i/h*m;return(0,W.jsx)(`rect`,{x:y(r),y:b(i),width:_,height:o,fill:a,rx:4,ry:4,className:`bar`,children:(0,W.jsx)(`title`,{children:`${e[t]}: ${i}`})},r)}),e.map((n,r)=>r%S!==0&&r!==e.length-1?null:(0,W.jsx)(`text`,{x:y(r)+_/2,y:m+20,textAnchor:`middle`,fontSize:`12`,fill:`var(--text-muted)`,children:String(n[t]||``)},r)),[0,.5,1].map(e=>(0,W.jsx)(`text`,{x:-10,y:m*(1-e)+5,textAnchor:`end`,fontSize:`12`,fill:`var(--text-muted)`,children:Math.round(h*e)},e))]})})})};M();function bH({memos:e}){let[t,n]=(0,U.useState)([]);return(0,U.useEffect)(()=>{let t=[{period:`00-03`,count:0},{period:`03-06`,count:0},{period:`06-09`,count:0},{period:`09-12`,count:0},{period:`12-15`,count:0},{period:`15-18`,count:0},{period:`18-21`,count:0},{period:`21-24`,count:0}];e.forEach(e=>{let n=new Date(e.createdAt).getHours();n<3?t[0].count++:n<6?t[1].count++:n<9?t[2].count++:n<12?t[3].count++:n<15?t[4].count++:n<18?t[5].count++:n<21?t[6].count++:t[7].count++}),n(t)},[e]),(0,W.jsx)(`div`,{className:`time-distribution-chart`,children:(0,W.jsxs)(`div`,{className:`chart-card`,children:[(0,W.jsxs)(`div`,{className:`chart-header`,children:[(0,W.jsx)(`h3`,{className:`chart-title`,children:j(`Time Distribution`)}),(0,W.jsx)(`p`,{className:`chart-description`,children:j(`When do you write thinos`)})]}),(0,W.jsx)(`div`,{className:`chart-content`,children:(0,W.jsx)(yH,{data:t,dataKey:`period`,valueKey:`count`,width:400,height:200,color:`var(--chart-2)`})})]})})}$r(),li(),I(),M(),je(),Tg();var xH=async e=>{let t=e.querySelectorAll(`img`);for(let e of t)e.src.startsWith(`http://localhost`)?e.src=await Hx(e.getAttribute(`path`)||(0,f.normalizePath)(e?.parentElement?.getAttribute(`src`)||``)):e.src=await Hx(e.src)},SH=(0,U.forwardRef)((e,t)=>{let{currentDate:n,setCurrentDateStamp:r,showTimeDistributionChart:i}=e,[a,o]=(0,U.useState)(!1),s=N.getDateStampByDate(N.getDateString(n)),c=(0,U.useRef)(null);return(0,U.useEffect)(()=>{c.current&&(0,f.setIcon)(c.current,`more-horizontal`)},[c.current]),(0,U.useImperativeHandle)(t,()=>({closeDatePicker:()=>{o(!1)}})),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`date-card-container`,children:[(0,W.jsxs)(`div`,{className:`date-container-details`,children:[(0,W.jsxs)(`div`,{className:`details-text`,children:[(0,f.moment)(s,`x`).format(`dddd`),(0,W.jsx)(`div`,{className:`date-text`,children:(0,f.moment)(s,`x`).format(`MMM`)+(0,f.moment)(s,`x`).format(`DD`)})]}),(0,W.jsx)(`div`,{className:`details-logo-text`,children:j(`Daily Memos`)})]}),(0,W.jsxs)(`div`,{className:`date-container-info`,children:[(0,W.jsxs)(`div`,{className:`date-container-info-text`,children:[`Week `,(0,W.jsx)(`div`,{className:`week-text`,children:(0,f.moment)(s,`x`).format(`ww`)}),`of `,(0,W.jsx)(`div`,{className:`year-text`,children:(0,f.moment)(s,`x`).format(`YYYY`)})]}),(0,W.jsx)(`div`,{ref:c,onClick:e=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(j(`Show Time Distribution`)),e.setIcon(`chart-bar`),e.onClick(()=>{i()})}),t.addItem(e=>{e.setTitle(j(a?`Hide date picker`:`Show date picker`)),e.setIcon(`calendar`),e.onClick(()=>{o(!a)})}),t.showAtMouseEvent(e.nativeEvent)}})]})]}),(0,W.jsx)(Yb,{className:`date-picker ${a?``:`thino-hidden`}`,datestamp:s,handleDateStampChange:e=>{r(e)}})]})}),CH=({thino:e})=>(0,W.jsxs)(`div`,{className:`daily-thino-wrapper`,children:[(0,W.jsx)(`div`,{className:`time-wrapper`,onClick:(0,U.useCallback)(()=>{Bx(e)},[]),children:(0,W.jsx)(`span`,{className:`normal-text`,children:(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`HH:mm`)})}),(0,W.jsx)(`div`,{className:`daily-thino-container`,children:(0,W.jsx)(gT,{memo:e})})]}),wH=()=>{let{query:e}=Si(),{memos:t}=P(),{settings:n,app:r,plugin:i}=F(),a=Ub(),[o,s]=(0,U.useState)([]),[c,l]=(0,U.useState)(N.getDateStampByDate(N.getDateString((0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`)))),[u,d]=(0,U.useState)(!1),p=(0,U.useRef)(),m=(0,U.useRef)(null),h=U.useRef(null),g=(0,U.useRef)(null),[_,v]=(0,U.useState)(!1);return(0,U.useEffect)(()=>{e.duration&&e.duration.from&&e.duration.to&&l(e.duration.from)},[e.duration]),(0,U.useEffect)(()=>{g.current&&(f.setIcon&&g&&!_&&(0,f.setIcon)(g.current,`share`),f.setIcon&&g&&_&&(0,f.setIcon)(g.current,`chrome`))},[g.current,_]),(0,U.useEffect)(()=>{wg({memos:t,query:e,filterOptions:{filterDoneTasks:!1},plugin:i}).then(e=>{s(e.filter(e=>N.getTimeStampByDate(e.createdAt)>=c&&N.getTimeStampByDate(e.createdAt)<c+864e5).filter(e=>e.deletedAt===``).sort((e,t)=>N.getTimeStampByDate(e.createdAt)-N.getTimeStampByDate(t.createdAt)).slice(0,40)),a.setFinish()})},[t,c,h.current,e]),(0,W.jsxs)(`div`,{className:`daily-thinos-list-wrapper`,ref:h,children:[(0,W.jsx)(pC,{rightContent:(0,W.jsxs)(`div`,{className:`header-right-section`,children:[(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(`span`,{ref:e=>{f.setIcon&&e&&(0,f.setIcon)(e,`chevron-left`)},className:`btn btn-text`,onClick:()=>l(e=>e-zr)}),(0,W.jsx)(`span`,{ref:e=>{f.setIcon&&e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn btn-text`,onClick:()=>l(e=>e+zr)}),(0,W.jsx)(`span`,{ref:g,className:x_(`btn btn-text share-btn`,_?`generating`:``),onClick:async()=>{p.current&&p?.current?.closeDatePicker(),v(!0),document.body.toggleClass(`thino-share-page`,!0),setTimeout(async()=>{if(!m.current){v(!1);return}await xH(m.current),ES(m.current,{pixelRatio:window.devicePixelRatio*2}).then(e=>{if(n?.AutoSaveWhenOnMobile&&f.Platform.isMobile){let t=e.split(`base64,`)[1];ci(t,`image/png`).arrayBuffer().then(async e=>{let t,n=ge();for(let e in n)if(n[e]instanceof f.TFile){t=n[e];break}t!==void 0&&await r.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,`png`,t),e)})}document.body.toggleClass(`thino-share-page`,!1),ZS({imgUrl:e}),v(!1)}).catch(()=>{document.body.toggleClass(`thino-share-page`,!1),v(!1)})},0)}})]}),(0,W.jsx)(bT,{}),(0,W.jsx)(Dv,{})]})}),(0,W.jsx)(dC,{thinosCount:o.length,thinos:o}),(0,W.jsx)(`div`,{className:`daily-thinos-view-wrapper thino-stat`,children:(0,W.jsxs)(`div`,{ref:m,className:`daily-thinos-view-container`,children:[(0,W.jsx)(SH,{ref:p,currentDate:new Date(c),setCurrentDateStamp:l,showTimeDistributionChart:()=>d(!u)}),u&&(0,W.jsx)(bH,{memos:o}),(0,W.jsx)(hH,{isLoading:a.isLoading,isEmpty:o.length===0,emptyMessage:j(`Noooop!`)}),!a.isLoading&&o.length>0&&(0,W.jsx)(`div`,{className:`daily-thinos-list-container`,children:o.map(e=>(0,W.jsx)(CH,{thino:e},`${e.id}-${e.updatedAt}`))})]})})]})};function TH(e,t,n){return new Date(n?zH.time(e).getTime()+t*24*60*60*1e3:zH.time(e).getTime()+t*60*1e3)}function EH(e,t,n){if(!e||!t)throw Error(`Invalid date`);let r=zH.time(e).getTime()-zH.time(t).getTime(),i=0;switch(n){case`days`:i=Math.floor(r/(1440*60*1e3));break;case`minutes`:i=Math.floor(r/(60*1e3));break}return i}function DH(e){let t=zH.time(e),n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),a=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return`${n}-${OH(r)}-${OH(i)} ${OH(a)}:${OH(o)}:${OH(s)}`}function OH(e){return e<10?`0${e}`:`${e}`}function kH(e,t,n,r=VH){e=zH.time(e),t=zH.time(t),r.length!==VH.length&&(r=VH);let i=e.getTime()-t.getTime(),a=0;for(i/=1e3,a=0;a<BH.length&&!(i<BH[a]);a++)i/=BH[a];return`${Math.floor(i)}${n?r[a]:``}`}function AH(e,t,n){let r=1;for(let t of UH)r+=t.factor*Math.max(Math.min(e,t.end)-t.start,0);e=Math.min(e,n);let i=Math.max(2,Math.round(e-r)),a=Math.min(Math.round(e+r),n);return e>t&&(i=Math.max(i,t+1)),i=Math.min(i,a),{min_ivl:i,max_ivl:a}}function jH(e,t,n){return Math.min(Math.max(e,t),n)}function MH(e,t){let n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),r=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.floor((r-n)/864e5)}function NH(){return`${this.review_time.getTime()}_${this.current.reps}_${this.current.difficulty*this.current.stability}`}function PH(){let e=4022871197;return function(t){t=String(t);for(let n=0;n<t.length;n++){e+=t.charCodeAt(n);let r=.02519603282416938*e;e=r>>>0,r-=e,r*=e,e=r>>>0,r-=e,e+=r*4294967296}return(e>>>0)*23283064365386963e-26}}function FH(e){let t=new JH(e),n=()=>t.next();return n.int32=()=>t.next()*4294967296|0,n.double=()=>n()+(n()*2097152|0)*11102230246251565e-32,n.state=()=>t.state,n.importState=e=>(t.state=e,n),n}function IH(e,t){let n={due:e?zH.time(e):new Date,stability:0,difficulty:0,elapsed_days:0,scheduled_days:0,reps:0,lapses:0,learning_steps:0,state:RH.New,last_review:void 0};return t&&typeof t==`function`?t(n):n}function LH(e,t,n){let{decay:r,factor:i}=oU(e);return+((1+i*t/n)**+r).toFixed(8)}var RH,q,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU=o((()=>{RH=(e=>(e[e.New=0]=`New`,e[e.Learning=1]=`Learning`,e[e.Review=2]=`Review`,e[e.Relearning=3]=`Relearning`,e))(RH||{}),q=(e=>(e[e.Manual=0]=`Manual`,e[e.Again=1]=`Again`,e[e.Hard=2]=`Hard`,e[e.Good=3]=`Good`,e[e.Easy=4]=`Easy`,e))(q||{}),zH=class e{static card(t){return{...t,state:e.state(t.state),due:e.time(t.due),last_review:t.last_review?e.time(t.last_review):void 0}}static rating(e){if(typeof e==`string`){let t=q[`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`];if(t===void 0)throw Error(`Invalid rating:[${e}]`);return t}else if(typeof e==`number`)return e;throw Error(`Invalid rating:[${e}]`)}static state(e){if(typeof e==`string`){let t=RH[`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`];if(t===void 0)throw Error(`Invalid state:[${e}]`);return t}else if(typeof e==`number`)return e;throw Error(`Invalid state:[${e}]`)}static time(e){let t=new Date(e);if(typeof e==`object`&&e&&!Number.isNaN(Date.parse(e)||+t))return t;if(typeof e==`string`){let t=Date.parse(e);if(Number.isNaN(t))throw Error(`Invalid date:[${e}]`);return new Date(t)}else if(typeof e==`number`)return new Date(e);throw Error(`Invalid date:[${e}]`)}static review_log(t){return{...t,due:e.time(t.due),rating:e.rating(t.rating),state:e.state(t.state),review:e.time(t.review)}}},Date.prototype.scheduler=function(e,t){return TH(this,e,t)},Date.prototype.diff=function(e,t){return EH(this,e,t)},Date.prototype.format=function(){return DH(this)},Date.prototype.dueFormat=function(e,t,n){return kH(this,e,t,n)},BH=[60,60,24,31,12],VH=[`second`,`min`,`hour`,`day`,`month`,`year`],HH=Object.freeze([q.Again,q.Hard,q.Good,q.Easy]),UH=[{start:2.5,end:7,factor:.15},{start:7,end:20,factor:.1},{start:20,end:1/0,factor:.05}],WH=e=>{let t=e.slice(-1),n=parseInt(e.slice(0,-1),10);if(Number.isNaN(n)||!Number.isFinite(n)||n<0)throw Error(`Invalid step value: ${e}`);switch(t){case`m`:return n;case`h`:return n*60;case`d`:return n*1440;default:throw Error(`Invalid step unit: ${e}, expected m/h/d`)}},GH=(e,t,n)=>{let r=t===RH.Relearning||t===RH.Review?e.relearning_steps:e.learning_steps,i=r.length;if(i===0||n>=i)return{};let a=r[0],o=WH,s=()=>o(a),c=()=>{if(i===1)return Math.round(o(a)*1.5);let e=r[1];return Math.round((o(a)+o(e))/2)},l=e=>e<0||e>=i?null:r[e],u=e=>o(e),d={},f=l(Math.max(0,n));if(t===RH.Review)return d[q.Again]={scheduled_minutes:o(f),next_step:0},d;{d[q.Again]={scheduled_minutes:s(),next_step:0},d[q.Hard]={scheduled_minutes:c(),next_step:n};let e=l(n+1);if(e){let t=u(e);t&&(d[q.Good]={scheduled_minutes:Math.round(t),next_step:n+1})}}return d},KH=(e=>(e.SCHEDULER=`Scheduler`,e.LEARNING_STEPS=`LearningSteps`,e.SEED=`Seed`,e))(KH||{}),qH=class{last;current;review_time;next=new Map;algorithm;strategies;elapsed_days=0;constructor(e,t,n,r){this.algorithm=n,this.last=zH.card(e),this.current=zH.card(e),this.review_time=zH.time(t),this.strategies=r,this.init()}checkGrade(e){if(!Number.isFinite(e)||e<0||e>4)throw Error(`Invalid grade "${e}",expected 1-4`)}init(){let{state:e,last_review:t}=this.current,n=0;e!==RH.New&&t&&(n=MH(t,this.review_time)),this.current.last_review=this.review_time,this.elapsed_days=n,this.current.elapsed_days=n,this.current.reps+=1;let r=NH;if(this.strategies){let e=this.strategies.get(KH.SEED);e&&(r=e)}this.algorithm.seed=r.call(this)}preview(){return{[q.Again]:this.review(q.Again),[q.Hard]:this.review(q.Hard),[q.Good]:this.review(q.Good),[q.Easy]:this.review(q.Easy),[Symbol.iterator]:this.previewIterator.bind(this)}}*previewIterator(){for(let e of HH)yield this.review(e)}review(e){let{state:t}=this.last,n;switch(this.checkGrade(e),t){case RH.New:n=this.newState(e);break;case RH.Learning:case RH.Relearning:n=this.learningState(e);break;case RH.Review:n=this.reviewState(e);break}return n}buildLog(e){let{last_review:t,due:n,elapsed_days:r}=this.last;return{rating:e,state:this.current.state,due:t||n,stability:this.current.stability,difficulty:this.current.difficulty,elapsed_days:this.elapsed_days,last_elapsed_days:r,scheduled_days:this.current.scheduled_days,learning_steps:this.current.learning_steps,review:this.review_time}}},JH=class{c;s0;s1;s2;constructor(e){let t=PH();this.c=1,this.s0=t(` `),this.s1=t(` `),this.s2=t(` `),e??=Date.now(),this.s0-=t(e),this.s0<0&&(this.s0+=1),this.s1-=t(e),this.s1<0&&(this.s1+=1),this.s2-=t(e),this.s2<0&&(this.s2+=1)}next(){let e=2091639*this.s0+this.c*23283064365386963e-26;return this.s0=this.s1,this.s1=this.s2,this.c=e|0,this.s2=e-this.c,this.s2}set state(e){this.c=e.c,this.s0=e.s0,this.s1=e.s1,this.s2=e.s2}get state(){return{c:this.c,s0:this.s0,s1:this.s1,s2:this.s2}}},YH=`5.2.3`,XH=Object.freeze([`1m`,`10m`]),ZH=Object.freeze([`10m`]),`${YH}`,QH=.001,$H=.5,eU=.1542,tU=Object.freeze([.212,1.2931,2.3065,8.2956,6.4133,.8334,3.0194,.001,1.8722,.1666,.796,1.4835,.0614,.2629,1.6483,.6014,1.8729,.5425,.0912,.0658,eU]),nU=(e,t=!0)=>[[QH,100],[QH,100],[QH,100],[QH,100],[1,10],[.001,4],[.001,4],[.001,.75],[0,4.5],[0,.8],[.001,3.5],[.001,5],[.001,.25],[.001,.9],[0,4],[0,1],[1,6],[0,e],[0,e],[t?.01:0,.8],[.1,.8]],rU=(e,t,n=!0)=>{let r=2;return Math.max(0,t)>1&&(r=jH(+(-(Math.log(e[11])+Math.log(2**e[13]-1)+e[14]*.3)/t).toFixed(8),.01,2)),nU(r,n).slice(0,e.length).map(([t,n],r)=>jH(e[r]||0,t,n))},iU=(e,t=0,n=!0)=>{if(e===void 0)return[...tU];switch(e.length){case 21:return rU(Array.from(e),t,n);case 19:return console.debug(`[FSRS-6]auto fill w from 19 to 21 length`),rU(Array.from(e),t,n).concat([0,$H]);case 17:{let r=rU(Array.from(e),t,n);return r[4]=+(r[5]*2+r[4]).toFixed(8),r[5]=+(Math.log(r[5]*3+1)/3).toFixed(8),r[6]=+(r[6]+.5).toFixed(8),console.debug(`[FSRS-6]auto fill w from 17 to 21 length`),r.concat([0,0,0,$H])}default:return console.warn(`[FSRS]Invalid parameters length, using default parameters`),[...tU]}},aU=e=>{let t=Array.isArray(e?.learning_steps)?e.learning_steps:XH,n=Array.isArray(e?.relearning_steps)?e.relearning_steps:ZH,r=e?.enable_short_term??!0,i=iU(e?.w,n.length,r);return{request_retention:e?.request_retention||.9,maximum_interval:e?.maximum_interval||36500,w:i,enable_fuzz:e?.enable_fuzz??!1,enable_short_term:r,learning_steps:t,relearning_steps:n}},oU=e=>{let t=typeof e==`number`?-e:-e[20];return{decay:t,factor:+(Math.exp(t**-1*Math.log(.9))-1).toFixed(8)}},sU=class{param;intervalModifier;_seed;constructor(e){this.param=new Proxy(aU(e),this.params_handler_proxy()),this.intervalModifier=this.calculate_interval_modifier(this.param.request_retention),this.forgetting_curve=LH.bind(this,this.param.w)}get interval_modifier(){return this.intervalModifier}set seed(e){this._seed=e}calculate_interval_modifier(e){if(e<=0||e>1)throw Error(`Requested retention rate should be in the range (0,1]`);let{decay:t,factor:n}=oU(this.param.w);return+((e**(1/t)-1)/n).toFixed(8)}get parameters(){return this.param}set parameters(e){this.update_parameters(e)}params_handler_proxy(){let e=this;return{set:function(t,n,r){return n===`request_retention`&&Number.isFinite(r)?e.intervalModifier=e.calculate_interval_modifier(Number(r)):n===`w`&&(r=iU(r,t.relearning_steps.length,t.enable_short_term),e.forgetting_curve=LH.bind(this,r),e.intervalModifier=e.calculate_interval_modifier(Number(t.request_retention))),Reflect.set(t,n,r),!0}}}update_parameters(e){let t=aU(e);for(let e in t){let n=e;this.param[n]=t[n]}}init_stability(e){return Math.max(this.param.w[e-1],.1)}init_difficulty(e){return+(this.param.w[4]-Math.exp((e-1)*this.param.w[5])+1).toFixed(8)}apply_fuzz(e,t){if(!this.param.enable_fuzz||e<2.5)return Math.round(e);let n=FH(this._seed)(),{min_ivl:r,max_ivl:i}=AH(e,t,this.param.maximum_interval);return Math.floor(n*(i-r+1)+r)}next_interval(e,t){let n=Math.min(Math.max(1,Math.round(e*this.intervalModifier)),this.param.maximum_interval);return this.apply_fuzz(n,t)}linear_damping(e,t){return+(e*(10-t)/9).toFixed(8)}next_difficulty(e,t){let n=-this.param.w[6]*(t-3),r=e+this.linear_damping(n,e);return jH(this.mean_reversion(this.init_difficulty(q.Easy),r),1,10)}mean_reversion(e,t){return+(this.param.w[7]*e+(1-this.param.w[7])*t).toFixed(8)}next_recall_stability(e,t,n,r){let i=q.Hard===r?this.param.w[15]:1,a=q.Easy===r?this.param.w[16]:1;return+jH(t*(1+Math.exp(this.param.w[8])*(11-e)*t**+-this.param.w[9]*(Math.exp((1-n)*this.param.w[10])-1)*i*a),QH,36500).toFixed(8)}next_forget_stability(e,t,n){return+jH(this.param.w[11]*e**+-this.param.w[12]*((t+1)**+this.param.w[13]-1)*Math.exp((1-n)*this.param.w[14]),QH,36500).toFixed(8)}next_short_term_stability(e,t){let n=e**+-this.param.w[19]*Math.exp(this.param.w[17]*(t-3+this.param.w[18]));return+jH(e*(t>=3?Math.max(n,1):n),QH,36500).toFixed(8)}forgetting_curve;next_state(e,t,n){let{difficulty:r,stability:i}=e??{difficulty:0,stability:0};if(t<0)throw Error(`Invalid delta_t "${t}"`);if(n<0||n>4)throw Error(`Invalid grade "${n}"`);if(r===0&&i===0)return{difficulty:jH(this.init_difficulty(n),1,10),stability:this.init_stability(n)};if(n===0)return{difficulty:r,stability:i};if(r<1||i<.001)throw Error(`Invalid memory state { difficulty: ${r}, stability: ${i} }`);let a=this.forgetting_curve(t,i),o=this.next_recall_stability(r,i,a,n),s=this.next_forget_stability(r,i,a),c=this.next_short_term_stability(i,n),l=o;if(n===1){let[e,t]=[0,0];this.param.enable_short_term&&(e=this.param.w[17],t=this.param.w[18]),l=jH(+(i/Math.exp(e*t)).toFixed(8),QH,s)}return t===0&&this.param.enable_short_term&&(l=c),{difficulty:this.next_difficulty(r,n),stability:l}}},cU=class extends qH{learningStepsStrategy;constructor(e,t,n,r){super(e,t,n,r);let i=GH;if(this.strategies){let e=this.strategies.get(KH.LEARNING_STEPS);e&&(i=e)}this.learningStepsStrategy=i}getLearningInfo(e,t){let n=this.algorithm.parameters;e.learning_steps=e.learning_steps||0;let r=this.learningStepsStrategy(n,e.state,this.current.state===RH.Learning&&t!==q.Again&&t!==q.Hard?e.learning_steps+1:e.learning_steps);return{scheduled_minutes:Math.max(0,r[t]?.scheduled_minutes??0),next_steps:Math.max(0,r[t]?.next_step??0)}}applyLearningSteps(e,t,n){let{scheduled_minutes:r,next_steps:i}=this.getLearningInfo(this.current,t);if(r>0&&r<1440)e.learning_steps=i,e.scheduled_days=0,e.state=n,e.due=TH(this.review_time,Math.round(r),!1);else if(e.state=RH.Review,r>=1440)e.learning_steps=i,e.due=TH(this.review_time,Math.round(r),!1),e.scheduled_days=Math.floor(r/1440);else{e.learning_steps=0;let t=this.algorithm.next_interval(e.stability,this.elapsed_days);e.scheduled_days=t,e.due=TH(this.review_time,t,!0)}}newState(e){let t=this.next.get(e);if(t)return t;let n=zH.card(this.current);n.difficulty=jH(this.algorithm.init_difficulty(e),1,10),n.stability=this.algorithm.init_stability(e),this.applyLearningSteps(n,e,RH.Learning);let r={card:n,log:this.buildLog(e)};return this.next.set(e,r),r}learningState(e){let t=this.next.get(e);if(t)return t;let{state:n,difficulty:r,stability:i}=this.last,a=zH.card(this.current);a.difficulty=this.algorithm.next_difficulty(r,e),a.stability=this.algorithm.next_short_term_stability(i,e),this.applyLearningSteps(a,e,n);let o={card:a,log:this.buildLog(e)};return this.next.set(e,o),o}reviewState(e){let t=this.next.get(e);if(t)return t;let n=this.elapsed_days,{difficulty:r,stability:i}=this.last,a=this.algorithm.forgetting_curve(n,i),o=zH.card(this.current),s=zH.card(this.current),c=zH.card(this.current),l=zH.card(this.current);this.next_ds(o,s,c,l,r,i,a),this.next_interval(s,c,l,n),this.next_state(s,c,l),this.applyLearningSteps(o,q.Again,RH.Relearning),o.lapses+=1;let u={card:o,log:this.buildLog(q.Again)},d={card:s,log:super.buildLog(q.Hard)},f={card:c,log:super.buildLog(q.Good)},p={card:l,log:super.buildLog(q.Easy)};return this.next.set(q.Again,u),this.next.set(q.Hard,d),this.next.set(q.Good,f),this.next.set(q.Easy,p),this.next.get(e)}next_ds(e,t,n,r,i,a,o){e.difficulty=this.algorithm.next_difficulty(i,q.Again);let s=a/Math.exp(this.algorithm.parameters.w[17]*this.algorithm.parameters.w[18]),c=this.algorithm.next_forget_stability(i,a,o);e.stability=jH(+s.toFixed(8),QH,c),t.difficulty=this.algorithm.next_difficulty(i,q.Hard),t.stability=this.algorithm.next_recall_stability(i,a,o,q.Hard),n.difficulty=this.algorithm.next_difficulty(i,q.Good),n.stability=this.algorithm.next_recall_stability(i,a,o,q.Good),r.difficulty=this.algorithm.next_difficulty(i,q.Easy),r.stability=this.algorithm.next_recall_stability(i,a,o,q.Easy)}next_interval(e,t,n,r){let i,a;i=this.algorithm.next_interval(e.stability,r),a=this.algorithm.next_interval(t.stability,r),i=Math.min(i,a),a=Math.max(a,i+1);let o=Math.max(this.algorithm.next_interval(n.stability,r),a+1);e.scheduled_days=i,e.due=TH(this.review_time,i,!0),t.scheduled_days=a,t.due=TH(this.review_time,a,!0),n.scheduled_days=o,n.due=TH(this.review_time,o,!0)}next_state(e,t,n){e.state=RH.Review,e.learning_steps=0,t.state=RH.Review,t.learning_steps=0,n.state=RH.Review,n.learning_steps=0}},lU=class extends qH{newState(e){let t=this.next.get(e);if(t)return t;this.current.scheduled_days=0,this.current.elapsed_days=0;let n=zH.card(this.current),r=zH.card(this.current),i=zH.card(this.current),a=zH.card(this.current);return this.init_ds(n,r,i,a),this.next_interval(n,r,i,a,0),this.next_state(n,r,i,a),this.update_next(n,r,i,a),this.next.get(e)}init_ds(e,t,n,r){e.difficulty=jH(this.algorithm.init_difficulty(q.Again),1,10),e.stability=this.algorithm.init_stability(q.Again),t.difficulty=jH(this.algorithm.init_difficulty(q.Hard),1,10),t.stability=this.algorithm.init_stability(q.Hard),n.difficulty=jH(this.algorithm.init_difficulty(q.Good),1,10),n.stability=this.algorithm.init_stability(q.Good),r.difficulty=jH(this.algorithm.init_difficulty(q.Easy),1,10),r.stability=this.algorithm.init_stability(q.Easy)}learningState(e){return this.reviewState(e)}reviewState(e){let t=this.next.get(e);if(t)return t;let n=this.elapsed_days,{difficulty:r,stability:i}=this.last,a=this.algorithm.forgetting_curve(n,i),o=zH.card(this.current),s=zH.card(this.current),c=zH.card(this.current),l=zH.card(this.current);return this.next_ds(o,s,c,l,r,i,a),this.next_interval(o,s,c,l,n),this.next_state(o,s,c,l),o.lapses+=1,this.update_next(o,s,c,l),this.next.get(e)}next_ds(e,t,n,r,i,a,o){e.difficulty=this.algorithm.next_difficulty(i,q.Again),e.stability=jH(a,QH,this.algorithm.next_forget_stability(i,a,o)),t.difficulty=this.algorithm.next_difficulty(i,q.Hard),t.stability=this.algorithm.next_recall_stability(i,a,o,q.Hard),n.difficulty=this.algorithm.next_difficulty(i,q.Good),n.stability=this.algorithm.next_recall_stability(i,a,o,q.Good),r.difficulty=this.algorithm.next_difficulty(i,q.Easy),r.stability=this.algorithm.next_recall_stability(i,a,o,q.Easy)}next_interval(e,t,n,r,i){let a,o,s,c;a=this.algorithm.next_interval(e.stability,i),o=this.algorithm.next_interval(t.stability,i),s=this.algorithm.next_interval(n.stability,i),c=this.algorithm.next_interval(r.stability,i),a=Math.min(a,o),o=Math.max(o,a+1),s=Math.max(s,o+1),c=Math.max(c,s+1),e.scheduled_days=a,e.due=TH(this.review_time,a,!0),t.scheduled_days=o,t.due=TH(this.review_time,o,!0),n.scheduled_days=s,n.due=TH(this.review_time,s,!0),r.scheduled_days=c,r.due=TH(this.review_time,c,!0)}next_state(e,t,n,r){e.state=RH.Review,e.learning_steps=0,t.state=RH.Review,t.learning_steps=0,n.state=RH.Review,n.learning_steps=0,r.state=RH.Review,r.learning_steps=0}update_next(e,t,n,r){let i={card:e,log:this.buildLog(q.Again)},a={card:t,log:super.buildLog(q.Hard)},o={card:n,log:super.buildLog(q.Good)},s={card:r,log:super.buildLog(q.Easy)};this.next.set(q.Again,i),this.next.set(q.Hard,a),this.next.set(q.Good,o),this.next.set(q.Easy,s)}},uU=class{fsrs;constructor(e){this.fsrs=e}replay(e,t,n){return this.fsrs.next(e,t,n)}handleManualRating(e,t,n,r,i,a,o){if(t===void 0)throw Error(`reschedule: state is required for manual rating`);let s,c;if(t===RH.New)s={rating:q.Manual,state:t,due:o??n,stability:e.stability,difficulty:e.difficulty,elapsed_days:r,last_elapsed_days:e.elapsed_days,scheduled_days:e.scheduled_days,learning_steps:e.learning_steps,review:n},c=IH(n),c.last_review=n;else{if(o===void 0)throw Error(`reschedule: due is required for manual rating`);let l=EH(o,n,`days`);s={rating:q.Manual,state:e.state,due:e.last_review||e.due,stability:e.stability,difficulty:e.difficulty,elapsed_days:r,last_elapsed_days:e.elapsed_days,scheduled_days:e.scheduled_days,learning_steps:e.learning_steps,review:n},c={...e,state:t,due:o,last_review:n,stability:i||e.stability,difficulty:a||e.difficulty,elapsed_days:r,scheduled_days:l,reps:e.reps+1}}return{card:c,log:s}}reschedule(e,t){let n=[],r=IH(e.due);for(let e of t){let t;if(e.review=zH.time(e.review),e.rating===q.Manual){let n=0;r.state!==RH.New&&r.last_review&&(n=EH(e.review,r.last_review,`days`)),t=this.handleManualRating(r,e.state,e.review,n,e.stability,e.difficulty,e.due?zH.time(e.due):void 0)}else t=this.replay(r,e.review,e.rating);n.push(t),r=t.card}return n}calculateManualRecord(e,t,n,r){if(!n)return null;let{card:i,log:a}=n,o=zH.card(e);return o.due.getTime()===i.due.getTime()?null:(o.scheduled_days=EH(i.due,o.due,`days`),this.handleManualRating(o,i.state,zH.time(t),a.elapsed_days,r?i.stability:void 0,r?i.difficulty:void 0,i.due))}},dU=class extends sU{strategyHandler=new Map;Scheduler;constructor(e){super(e);let{enable_short_term:t}=this.parameters;this.Scheduler=t?cU:lU}params_handler_proxy(){let e=this;return{set:function(t,n,r){return n===`request_retention`&&Number.isFinite(r)?e.intervalModifier=e.calculate_interval_modifier(Number(r)):n===`enable_short_term`?e.Scheduler=r===!0?cU:lU:n===`w`&&(r=iU(r,t.relearning_steps.length,t.enable_short_term),e.forgetting_curve=LH.bind(this,r),e.intervalModifier=e.calculate_interval_modifier(Number(t.request_retention))),Reflect.set(t,n,r),!0}}}useStrategy(e,t){return this.strategyHandler.set(e,t),this}clearStrategy(e){return e?this.strategyHandler.delete(e):this.strategyHandler.clear(),this}getScheduler(e,t){return new((this.strategyHandler.get(KH.SCHEDULER))||this.Scheduler)(e,t,this,this.strategyHandler)}repeat(e,t,n){let r=this.getScheduler(e,t).preview();return n&&typeof n==`function`?n(r):r}next(e,t,n,r){let i=this.getScheduler(e,t),a=zH.rating(n);if(a===q.Manual)throw Error(`Cannot review a manual rating`);let o=i.review(a);return r&&typeof r==`function`?r(o):o}get_retrievability(e,t,n=!0){let r=zH.card(e);t=t?zH.time(t):new Date;let i=r.state===RH.New?0:Math.max(EH(t,r.last_review,`days`),0),a=r.state===RH.New?0:this.forgetting_curve(i,+r.stability.toFixed(8));return n?`${(a*100).toFixed(2)}%`:a}rollback(e,t,n){let r=zH.card(e),i=zH.review_log(t);if(i.rating===q.Manual)throw Error(`Cannot rollback a manual rating`);let a,o,s;switch(i.state){case RH.New:a=i.due,o=void 0,s=0;break;case RH.Learning:case RH.Relearning:case RH.Review:a=i.review,o=i.due,s=r.lapses-(i.rating===q.Again&&i.state===RH.Review?1:0);break}let c={...r,due:a,stability:i.stability,difficulty:i.difficulty,elapsed_days:i.last_elapsed_days,scheduled_days:i.scheduled_days,reps:Math.max(0,r.reps-1),lapses:Math.max(0,s),learning_steps:i.learning_steps,state:i.state,last_review:o};return n&&typeof n==`function`?n(c):c}forget(e,t,n=!1,r){let i=zH.card(e);t=zH.time(t);let a=i.state===RH.New?0:EH(t,i.due,`days`),o={rating:q.Manual,state:i.state,due:i.due,stability:i.stability,difficulty:i.difficulty,elapsed_days:0,last_elapsed_days:i.elapsed_days,scheduled_days:a,learning_steps:i.learning_steps,review:t},s={card:{...i,due:t,stability:0,difficulty:0,elapsed_days:0,scheduled_days:0,reps:n?0:i.reps,lapses:n?0:i.lapses,learning_steps:0,state:RH.New,last_review:i.last_review},log:o};return r&&typeof r==`function`?r(s):s}reschedule(e,t=[],n={}){let{recordLogHandler:r,reviewsOrderBy:i,skipManual:a=!0,now:o=new Date,update_memory_state:s=!1}=n;i&&typeof i==`function`&&t.sort(i),a&&(t=t.filter(e=>e.rating!==q.Manual));let c=new uU(this),l=c.reschedule(n.first_card||IH(),t),u=l.length,d=zH.card(e),f=c.calculateManualRecord(d,o,u?l[u-1]:void 0,s);return r&&typeof r==`function`?{collections:l.map(r),reschedule_item:f?r(f):null}:{collections:l,reschedule_item:f}}},fU=e=>new dU(e||{})})),mU=c({DEFAULT_FSRS_PARAMS:()=>hU,Rating:()=>q,State:()=>RH,createEmptyFSRSCard:()=>bU,defaultFSRSStats:()=>yU,deserializeCard:()=>SU,getFSRSInstance:()=>vU,getNextCardState:()=>CU,getRetrievability:()=>TU,getSchedulingCards:()=>wU,serializeCard:()=>xU,updateFSRSInstance:()=>_U}),hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU=o((()=>{pU(),hU={request_retention:.9,maximum_interval:36500,enable_fuzz:!0,enable_short_term:!0},gU=fU(aU(hU)),_U=e=>{gU=fU(aU(e))},vU=()=>gU,yU=()=>({totalReviews:0,hardCount:0,goodCount:0,easyCount:0,againCount:0,lastReviewDate:Date.now(),reviewHistory:[]}),bU=e=>IH(e),xU=e=>({due:e.due instanceof Date?e.due.toISOString():String(e.due),stability:e.stability,difficulty:e.difficulty,elapsed_days:e.elapsed_days,scheduled_days:e.scheduled_days,learning_steps:e.learning_steps,reps:e.reps,lapses:e.lapses,state:e.state,last_review:e.last_review instanceof Date?e.last_review.toISOString():void 0}),SU=e=>({due:new Date(e.due),stability:e.stability,difficulty:e.difficulty,elapsed_days:e.elapsed_days,scheduled_days:e.scheduled_days,learning_steps:e.learning_steps??0,reps:e.reps,lapses:e.lapses,state:e.state,last_review:e.last_review?new Date(e.last_review):void 0}),CU=(e,t)=>{let n=SU(e);return xU(gU.next(n,new Date,t).card)},wU=e=>{let t=SU(e),n=gU.repeat(t,new Date);return{[q.Again]:{card:xU(n[q.Again].card),log:n[q.Again].log},[q.Hard]:{card:xU(n[q.Hard].card),log:n[q.Hard].log},[q.Good]:{card:xU(n[q.Good].card),log:n[q.Good].log},[q.Easy]:{card:xU(n[q.Easy].card),log:n[q.Easy].log}}},TU=e=>{let t=SU(e);return gU.get_retrievability(t,new Date,!1)}}));pU(),EU(),I();var DU=`thino-review-`,OU=`thino-review-historical-stats`,kU=`thino-review-daily-limit`;function AU(){return F.getState().app}function jU(e){let t=AU();if(!t)return null;try{let n=t.loadLocalStorage(e);return n?JSON.parse(n):null}catch{return null}}function MU(e,t){let n=AU();if(n)try{n.saveLocalStorage(e,JSON.stringify(t))}catch(t){console.error(`Error saving to localStorage:`,e,t)}}function NU(e){let t=AU();t&&t.saveLocalStorage(e,``)}var PU=()=>jU(OU)||{totalReviews:0,againCount:0,hardCount:0,goodCount:0,easyCount:0,lastReviewDate:0,reviewHistory:[]},FU=e=>{let t=PU();switch(t.totalReviews++,t.lastReviewDate=Date.now(),e){case q.Again:t.againCount++;break;case q.Hard:t.hardCount++;break;case q.Good:t.goodCount++;break;case q.Easy:t.easyCount++;break}t.reviewHistory.push({date:Date.now(),rating:e}),t.reviewHistory.length>1e3&&(t.reviewHistory=t.reviewHistory.slice(-1e3)),MU(OU,t)},IU=()=>{let e=new Date().toISOString().split(`T`)[0],t=jU(kU);if(!t||t.date!==e){let t={date:e,reviewed:0,totalCards:0};return MU(kU,t),t}return t},LU=e=>{let t=IU();t.reviewed+=1,e!==void 0&&(t.totalCards=e),MU(kU,t)},RU=e=>{let t=IU();t.totalCards=e,MU(kU,t)},zU=e=>jU(`${DU}${e}`)??void 0,BU=(e,t)=>{MU(`${DU}${e}`,t)},VU=e=>{NU(`${DU}${e}`)},HU=e=>{let t={memoId:e,card:xU(bU()),stats:yU()};return BU(e,t),t},UU=(e,t)=>{let n=zU(e);n||=HU(e);let r=CU(n.card,t),i={...n.stats,totalReviews:n.stats.totalReviews+1,lastReviewDate:Date.now(),reviewHistory:[...n.stats.reviewHistory,{date:Date.now(),rating:t}]};switch(i.reviewHistory.length>200&&(i.reviewHistory=i.reviewHistory.slice(-200)),t){case q.Again:i.againCount++;break;case q.Hard:i.hardCount++;break;case q.Good:i.goodCount++;break;case q.Easy:i.easyCount++;break}let a={...n,card:r,stats:i};return BU(e,a),LU(),FU(t),a},WU=()=>{AU()&&(NU(OU),NU(kU))},GU=e=>{if(!e)return!0;let t=Date.now();return new Date(e.card.due).getTime()<=t};I(),H(),Tg(),EU(),M();function KU(e){let t=Date.now(),n=new Date(e.due).getTime()-t;if(n<0)return j(`now`);let r=Math.round(n/6e4);if(r<1)return`<1m`;if(r<60)return`${r}m`;let i=Math.round(r/60);if(i<24)return`${i}h`;let a=Math.round(i/24);if(a<30)return`${a}d`;let o=Math.round(a/30);return o<12?`${o}mo`:`${(a/365).toFixed(1)}y`}var qU=()=>{let{plugin:e,settings:t}=F(),{memos:n}=P(),{isMobileView:r}=vi(),{query:i}=Si(),a=t?.fsrsDailyLimit??100,o=Ub(),[s,c]=(0,U.useState)(0),[l,u]=(0,U.useState)([]),[d,f]=(0,U.useState)(!1),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(``),_=(0,U.useRef)(null),[v,y]=(0,U.useState)({total:0,reviewed:0,remaining:0,againCount:0,hardCount:0,goodCount:0,easyCount:0,dailyLimit:100,dailyReviewed:0}),[b]=(0,U.useState)(new Map),[x,S]=(0,U.useState)({totalReviews:0,againCount:0,hardCount:0,goodCount:0,easyCount:0,reviewHistory:[]}),C=(0,U.useMemo)(()=>new Set(n.map(e=>e.id)),[n]),w=(0,U.useMemo)(()=>{let e=l[s];if(!e||!d)return null;let t=b.get(e.id)?.card??xU(bU());try{let e=wU(t);return{again:KU(e[q.Again].card),hard:KU(e[q.Hard].card),good:KU(e[q.Good].card),easy:KU(e[q.Easy].card)}}catch{return null}},[l,s,d]);(0,U.useEffect)(()=>{(async()=>{try{let t=IU();if(t.reviewed>=a){u([]),y(e=>({...e,dailyReviewed:t.reviewed,remaining:0,total:t.totalCards})),f(!1),o.setFinish();return}let r=n.filter(e=>e.rowStatus!==`ARCHIVED`&&!(e.deletedAt!==``&&e.deletedAt)),s=r;if(i&&(i.tag||i.text||i.type||i.duration||i.filter||i.path)){let t=await wg({memos:r,query:i,filterOptions:{filterDoneTasks:!1,filterArchived:!0},plugin:e});s=Array.isArray(t)?t:r}let l=[],d=0,p=0,m=0,h=0;b.clear();for(let e of s)try{let t=zU(e.id);if(t){if(!C.has(t.memoId)){VU(t.memoId);continue}b.set(e.id,t)}GU(t)&&(l.push(e),t?.stats&&(d+=t.stats.againCount||0,p+=t.stats.hardCount||0,m+=t.stats.goodCount||0,h+=t.stats.easyCount||0))}catch(t){console.error(`Error fetching review data for memo:`,e.id,t);continue}l.sort((e,t)=>{let n=b.get(e.id),r=b.get(t.id);return(n?new Date(n.card.due).getTime():0)-(r?new Date(r.card.due).getTime():0)});let g=Math.min(l.length,a-t.reviewed);u(l.slice(0,g)),RU(s.length),f(!1),c(0),y({total:s.length,reviewed:0,remaining:g,againCount:d,hardCount:p,goodCount:m,easyCount:h,dailyLimit:a,dailyReviewed:t.reviewed})}catch(e){console.error(`Error in fetchReviewableMemos:`,e)}finally{o.setFinish()}})()},[n,i]),(0,U.useEffect)(()=>{e&&e.addCommand({id:`clear-review-data`,name:j(`Clear all review data`),callback:()=>{WU(),y({total:0,reviewed:0,remaining:0,againCount:0,hardCount:0,goodCount:0,easyCount:0,dailyLimit:a,dailyReviewed:0}),u([]),f(!1),c(0),b.clear()}})},[]),(0,U.useEffect)(()=>{S(PU())},[]),(0,U.useEffect)(()=>()=>z.clearQuery(),[]),(0,U.useCallback)(()=>{R.setShowSiderbarInMobileView(!0)},[]);let T=e=>{let t=l[s];if(!t)return;if(!C.has(t.id)){VU(t.id);let e=l.filter((e,t)=>t!==s);u(e),e.length===0?f(!1):s>=e.length&&c(0);return}let n=UU(t.id,e);b.set(t.id,n),S(PU());let r=IU(),i=l.filter((e,t)=>t!==s);if(e===q.Again||e===q.Hard){let e=i.findIndex(e=>{let t=b.get(e.id);return(t?new Date(t.card.due).getTime():0)>new Date(n.card.due).getTime()});e===-1?i.push(t):i.splice(e,0,t)}u(i),y(t=>({...t,reviewed:t.reviewed+1,remaining:i.length,dailyReviewed:r.reviewed,total:r.totalCards,...e===q.Again?{againCount:t.againCount+1}:e===q.Hard?{hardCount:t.hardCount+1}:e===q.Good?{goodCount:t.goodCount+1}:{easyCount:t.easyCount+1}})),i.length>0?s>=i.length&&c(0):f(!1)},E=e=>{g({[q.Again]:`swipe-left`,[q.Hard]:`swipe-down`,[q.Good]:`swipe-up`,[q.Easy]:`swipe-right`}[e]||``),setTimeout(()=>{T(e),g(``)},250)},D=()=>{l.length>0&&(f(!0),c(0))},O=l[s],k=v.reviewed+v.dailyReviewed,ee=k+v.remaining,A=ee>0?Math.round(k/ee*100):0;return(0,W.jsxs)(`div`,{className:`daily-review-wrapper`,children:[(0,W.jsx)(pC,{showSidebar:r,rightContent:(0,W.jsx)(`div`,{className:`header-right-section`,children:(0,W.jsx)(`button`,{className:`show-stats-btn`,onClick:()=>m(!p),children:j(p?`Hide stats`:`Show stats`)})})}),(0,W.jsx)(dC,{}),d&&(0,W.jsxs)(`div`,{className:`review-progress-bar`,children:[(0,W.jsx)(`div`,{className:`review-progress-track`,children:(0,W.jsx)(`div`,{className:`review-progress-fill`,style:{width:`${A}%`}})}),(0,W.jsxs)(`span`,{className:`review-progress-text`,children:[k,` / `,ee]})]}),p&&(0,W.jsxs)(`div`,{className:`review-stats-banner`,children:[(0,W.jsxs)(`div`,{className:`stats-grid`,children:[(0,W.jsxs)(`div`,{className:`stats-item`,children:[(0,W.jsx)(`span`,{className:`stats-number`,children:k}),(0,W.jsx)(`span`,{className:`stats-label`,children:j(`Daily Progress`)})]}),(0,W.jsxs)(`div`,{className:`stats-item`,children:[(0,W.jsx)(`span`,{className:`stats-number`,children:v.remaining}),(0,W.jsx)(`span`,{className:`stats-label`,children:j(`Today Remaining`)})]}),(0,W.jsxs)(`div`,{className:`stats-item`,children:[(0,W.jsx)(`span`,{className:`stats-number`,children:v.total}),(0,W.jsx)(`span`,{className:`stats-label`,children:j(`Today Total`)})]})]}),(0,W.jsxs)(`div`,{className:`stats-breakdown-row`,children:[(0,W.jsxs)(`span`,{className:`breakdown-item again`,children:[j(`Again`),`: `,x.againCount]}),(0,W.jsxs)(`span`,{className:`breakdown-item hard`,children:[j(`Hard`),`: `,x.hardCount]}),(0,W.jsxs)(`span`,{className:`breakdown-item good`,children:[j(`Good`),`: `,x.goodCount]}),(0,W.jsxs)(`span`,{className:`breakdown-item easy`,children:[j(`Easy`),`: `,x.easyCount]})]}),(0,W.jsxs)(`div`,{className:`stats-total-row`,children:[j(`Total Reviews`),`: `,x.totalReviews]})]}),(0,W.jsx)(`div`,{className:`review-container`,children:o.isLoading?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:j(`Fetching data...`)})}):l.length===0?(0,W.jsxs)(`div`,{className:`review-done-container`,children:[(0,W.jsx)(`div`,{className:`review-done-icon`,children:`✓`}),(0,W.jsx)(`span`,{className:`review-done-text`,children:j(`Today, you have reviewed all your thinos!`)}),v.dailyReviewed>0&&(0,W.jsxs)(`span`,{className:`review-done-count`,children:[j(`Total Reviews`),`: `,v.dailyReviewed]})]}):d?(0,W.jsxs)(`div`,{className:`review-card-stack`,children:[l.length>2&&(0,W.jsx)(`div`,{className:`review-card stacked-card stack-2`}),l.length>1&&(0,W.jsx)(`div`,{className:`review-card stacked-card stack-1`}),(0,W.jsxs)(`div`,{ref:_,className:`review-card active-card ${h}`,children:[(0,W.jsx)(`div`,{className:`review-card-content`,children:(0,W.jsx)(gT,{memo:O})}),(0,W.jsxs)(`div`,{className:`review-buttons`,children:[(0,W.jsxs)(`button`,{className:`review-btn clickable-icon again`,onClick:()=>E(q.Again),children:[(0,W.jsx)(`span`,{className:`review-btn-label`,children:j(`Again`)}),w&&(0,W.jsx)(`span`,{className:`review-btn-interval`,children:w.again})]}),(0,W.jsxs)(`button`,{className:`review-btn clickable-icon hard`,onClick:()=>E(q.Hard),children:[(0,W.jsx)(`span`,{className:`review-btn-label`,children:j(`Hard`)}),w&&(0,W.jsx)(`span`,{className:`review-btn-interval`,children:w.hard})]}),(0,W.jsxs)(`button`,{className:`review-btn clickable-icon good`,onClick:()=>E(q.Good),children:[(0,W.jsx)(`span`,{className:`review-btn-label`,children:j(`Good`)}),w&&(0,W.jsx)(`span`,{className:`review-btn-interval`,children:w.good})]}),(0,W.jsxs)(`button`,{className:`review-btn clickable-icon easy`,onClick:()=>E(q.Easy),children:[(0,W.jsx)(`span`,{className:`review-btn-label`,children:j(`Easy`)}),w&&(0,W.jsx)(`span`,{className:`review-btn-interval`,children:w.easy})]})]})]})]}):(0,W.jsxs)(`div`,{className:`review-start-container`,children:[(0,W.jsx)(`div`,{className:`review-start-count`,children:v.remaining}),(0,W.jsx)(`span`,{className:`review-start-label`,children:j(`Thinos to review`)}),(0,W.jsx)(`button`,{className:`start-review-btn`,onClick:D,children:j(`Start Review`)})]})})]})};I(),M(),H();var JU=()=>{let{tags:e,tagsNum:t,memos:n}=P(),r=vi(e=>e.isMobileView),i=F(e=>e.plugin),a=Ub(),[o,s]=(0,U.useState)([]),[c,l]=(0,U.useState)([]),[u,d]=(0,U.useState)([]),[p,m]=(0,U.useState)([]),[h,g]=(0,U.useState)([]),[_,v]=(0,U.useState)([]),[y,b]=(0,U.useState)(`30days`),[x,S]=(0,U.useState)([]),C=e=>Math.max(r?320:600,e*(r?40:70));(0,U.useEffect)(()=>{!n||n.length===0||(async()=>{a.setLoading();try{let e=await i.thinoWorkerManager.calculateStats(n),r=e=>{let t=parseInt(String(e).replace(/[^0-9]/g,``),10);return isNaN(t)?0:t},a=(e,t)=>(e||[]).slice().sort((e,n)=>{let i=new Date(e[t]),a=new Date(n[t]);return(isNaN(i.getTime())?r(e[t]):i.getTime())-(isNaN(a.getTime())?r(n[t]):a.getTime())}),o=(e,t)=>(e||[]).slice().sort((e,n)=>r(e[t])-r(n[t]));s(a(e.dailyData,`date`)),l(o(e.monthlyData,`date`)),d(a(e.yearlyData,`date`)),m(o(e.hourlyData,`hour`)),g((e=>{let t=[`00-03`,`03-06`,`06-09`,`09-12`,`12-15`,`15-18`,`18-21`,`21-24`];return(e||[]).slice().sort((e,n)=>t.indexOf(e.period)-t.indexOf(n.period))})(e.timeDistData)),v((e=>(e||[]).slice().sort((e,t)=>r(e?.range?.split?.(`-`)?.[0])-r(t?.range?.split?.(`-`)?.[0])))(e.lengthData)),S(Object.entries(t).map(([e,t])=>({tag:e,count:t})).sort((e,t)=>t.count-e.count).slice(0,10))}catch(e){console.error(`Error loading stats:`,e)}finally{a.setFinish()}})()},[n]);let w=(0,U.useMemo)(()=>{switch(y){case`day`:return p;case`month`:return c;case`year`:return u;default:return o}},[y,p,c,u,o]);(0,U.useCallback)(()=>{R.setShowSiderbarInMobileView(!0)},[]);let T=(0,U.useCallback)(e=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(j(`Hourly distribution`)).setChecked(y===`day`).onClick(()=>b(`day`))}),t.addItem(e=>{e.setTitle(j(`Month`)).setChecked(y===`month`).onClick(()=>b(`month`))}),t.addItem(e=>{e.setTitle(j(`30 Days`)).setChecked(y===`30days`).onClick(()=>b(`30days`))}),t.addItem(e=>{e.setTitle(j(`Year`)).setChecked(y===`year`).onClick(()=>b(`year`))}),t.showAtMouseEvent(e.nativeEvent)},[j,y]);return(0,W.jsxs)(`div`,{className:`thino-stat`,children:[(0,W.jsx)(pC,{showSidebar:r,title:j(`Statistics`)}),a.isLoading?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:j(`Fetching data...`)})}):(0,W.jsxs)(`div`,{className:`stats-container`,children:[(0,W.jsxs)(`div`,{className:`stat-card`,children:[(0,W.jsxs)(`div`,{className:`card-header`,children:[(0,W.jsxs)(`div`,{className:`card-title-section`,children:[(0,W.jsx)(`h3`,{className:`card-title`,children:j(`Thino Count`)}),(0,W.jsxs)(`p`,{className:`card-description`,children:[y===`day`&&j(`Hourly distribution`),y===`month`&&j(`Current month`),y===`30days`&&j(`Last 30 days`),y===`year`&&j(`Monthly distribution`)]})]}),(0,W.jsx)(`button`,{className:`view-mode-btn`,onClick:e=>T(e),children:j(`Switch view`)})]}),(0,W.jsx)(`div`,{className:`card-content`,children:(0,W.jsx)(vH,{data:w,dataKey:y===`day`?`hour`:`date`,width:C(w?.length||0),height:200,color:`var(--text-accent)`})}),(0,W.jsx)(`div`,{className:`card-footer`,children:(0,W.jsxs)(`div`,{className:`total-count`,children:[j(`Total`),`: `,n.length,` `,j(`thinos`),(0,W.jsx)(NB,{className:`trend-icon`})]})})]}),(0,W.jsxs)(`div`,{className:`stat-card`,children:[(0,W.jsx)(`div`,{className:`card-header`,children:(0,W.jsxs)(`div`,{className:`card-title-section`,children:[(0,W.jsx)(`h3`,{className:`card-title`,children:j(`Time Distribution`)}),(0,W.jsx)(`p`,{className:`card-description`,children:j(`When do you write thinos`)})]})}),(0,W.jsx)(`div`,{className:`card-content`,children:(0,W.jsx)(yH,{data:h,dataKey:`period`,valueKey:`count`,width:C(h?.length||0),height:200,color:`var(--interactive-accent)`})})]}),(0,W.jsxs)(`div`,{className:`stat-card`,children:[(0,W.jsx)(`div`,{className:`card-header`,children:(0,W.jsxs)(`div`,{className:`card-title-section`,children:[(0,W.jsx)(`h3`,{className:`card-title`,children:j(`Content Length`)}),(0,W.jsx)(`p`,{className:`card-description`,children:j(`Distribution of thino lengths`)})]})}),(0,W.jsx)(`div`,{className:`card-content`,children:(0,W.jsx)(yH,{data:_,dataKey:`range`,valueKey:`count`,width:C(_?.length||0),height:200,color:`var(--text-normal)`})})]}),(0,W.jsxs)(`div`,{className:`stat-card`,children:[(0,W.jsx)(`div`,{className:`card-header`,children:(0,W.jsxs)(`div`,{className:`card-title-section`,children:[(0,W.jsx)(`h3`,{className:`card-title`,children:j(`Popular Tags`)}),(0,W.jsx)(`p`,{className:`card-description`,children:j(`Top 10 most used tags`)})]})}),(0,W.jsx)(`div`,{className:`card-content`,children:(0,W.jsx)(yH,{data:x,dataKey:`tag`,valueKey:`count`,width:C(x?.length||0),height:200,color:`var(--text-selection)`})})]})]})]})};function YU(e,t){if(e==null)return{};var n=XU(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XU(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function ZU(){return ZU=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},ZU.apply(this,arguments)}function QU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $U(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?QU(Object(n),!0).forEach(function(t){eW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eW(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tW={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0},nW=2,rW=class extends U.Component{constructor(e){super(e),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this);let t;t=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||nW,this.state={columnCount:t}}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(){let e=window&&window.innerWidth||1/0,t=this.props.breakpointCols;typeof t!=`object`&&(t={default:parseInt(t)||nW});let n=1/0,r=t.default||nW;for(let i in t){let a=parseInt(i);a>0&&e<=a&&a<n&&(n=a,r=t[i])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){let e=this.state.columnCount,t=Array(e),n=U.Children.toArray(this.props.children);for(let r=0;r<n.length;r++){let i=r%e;t[i]||(t[i]=[]),t[i].push(n[r])}return t}renderColumns(){let{column:e,columnAttrs:t={},columnClassName:n}=this.props,r=this.itemsInColumns(),i=`${100/r.length}%`,a=n;a&&typeof a!=`string`&&(this.logDeprecated(`The property "columnClassName" requires a string`),a===void 0&&(a=`my-masonry-grid_column`));let o=$U($U($U({},e),t),{},{style:$U($U({},t.style),{},{width:i}),className:a});return r.map((e,t)=>U.createElement(`div`,ZU({},o,{key:t}),e))}logDeprecated(e){console.error(`[Masonry]`,e)}render(){let e=this.props,{children:t,breakpointCols:n,columnClassName:r,columnAttrs:i,column:a,className:o}=e,s=YU(e,[`children`,`breakpointCols`,`columnClassName`,`columnAttrs`,`column`,`className`]),c=o;return typeof o!=`string`&&(this.logDeprecated(`The property "className" requires a string`),o===void 0&&(c=`my-masonry-grid`)),U.createElement(`div`,ZU({},s,{className:c}),this.renderColumns())}};rW.defaultProps=tW;var iW=[{name:`All`,value:null,color:`transparent`,border:!0},{name:`Red`,value:`red`,color:`#ef4444`},{name:`Orange`,value:`orange`,color:`#f97316`},{name:`Yellow`,value:`yellow`,color:`#eab308`},{name:`Green`,value:`green`,color:`#22c55e`},{name:`Blue`,value:`blue`,color:`#3b82f6`},{name:`Purple`,value:`purple`,color:`#a855f7`},{name:`Pink`,value:`pink`,color:`#ec4899`},{name:`Brown`,value:`brown`,color:`#a3a3a3`},{name:`Gray`,value:`gray`,color:`#6b7280`},{name:`Black`,value:`black`,color:`#1f2937`},{name:`White`,value:`white`,color:`#f9fafb`}],aW=e=>new Promise(t=>{let n=document.createElement(`canvas`),r=n.getContext(`2d`);if(!r){t(`gray`);return}n.width=50,n.height=50,r.drawImage(e,0,0,50,50);try{let e=r.getImageData(0,0,50,50).data,n={};for(let t=0;t<e.length;t+=4){let r=e[t],i=e[t+1],a=e[t+2];if(e[t+3]<128)continue;let o=oW(r,i,a);n[o]=(n[o]||0)+1}let i=0,a=`gray`;for(let[e,t]of Object.entries(n))t>i&&(i=t,a=e);t(a)}catch(e){console.warn(`Failed to extract color from image:`,e),t(`gray`)}}),oW=(e,t,n)=>{let r=(e*299+t*587+n*114)/1e3;if(r<50)return`black`;if(r>200&&Math.abs(e-t)<30&&Math.abs(t-n)<30&&Math.abs(e-n)<30)return`white`;if(Math.abs(e-t)<30&&Math.abs(t-n)<30&&Math.abs(e-n)<30)return`gray`;let i=Math.max(e,t,n);return i-Math.min(e,t,n)<50?`gray`:e===i?t>n?t-n>50?`yellow`:`orange`:n-t>50?`purple`:`red`:t===i?e>n?`yellow`:n-e>50?`blue`:`green`:e>t&&e-t>50?`purple`:`blue`},sW=({onColorSelect:e,selectedColor:t})=>{let[n,r]=(0,U.useState)(!1),i=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&r(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let a=iW.find(e=>e.value===t)||iW[0];return(0,W.jsxs)(`div`,{className:`color-picker-container`,ref:i,children:[(0,W.jsxs)(`button`,{className:`color-picker-trigger`,onClick:()=>r(!n),"aria-label":`Select color filter`,children:[(0,W.jsxs)(`div`,{className:`color-picker-preview`,children:[(0,W.jsx)(`div`,{className:`color-preview-swatch`,style:{backgroundColor:a.color,border:a.border?`2px solid var(--text-muted)`:`none`}}),(0,W.jsx)(`span`,{className:`color-picker-label`,children:a.name})]}),(0,W.jsx)(`svg`,{className:`color-picker-arrow ${n?`open`:``}`,width:`12`,height:`12`,viewBox:`0 0 12 12`,children:(0,W.jsx)(`path`,{d:`M3 4.5L6 7.5L9 4.5`,stroke:`currentColor`,strokeWidth:`1.5`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),n&&(0,W.jsx)(`div`,{className:`color-picker-dropdown`,children:iW.map(n=>(0,W.jsxs)(`button`,{className:`color-picker-option ${t===n.value?`selected`:``}`,onClick:()=>{e(n.value),r(!1)},children:[(0,W.jsx)(`div`,{className:`color-option-swatch`,style:{backgroundColor:n.color,border:n.border?`2px solid var(--text-muted)`:`none`}}),(0,W.jsx)(`span`,{className:`color-option-label`,children:n.name})]},n.value||`all`))})]})};I(),gs();var cW=/\.(png|jpg|jpeg|gif|bmp|svg|webp)$/i,lW=({link:e,type:t,imagePath:n,altText:r,thinoId:i,sourceType:a,onColorExtracted:o})=>{let{app:s}=F(),[c,l]=(0,U.useState)(null),[u,d]=(0,U.useState)(null),[p,m]=(0,U.useState)(!0),h=e?.startsWith(`http://`)||e?.startsWith(`https://`);(0,U.useEffect)(()=>{if(!s||!e){d(`App context or image link is missing.`),m(!1);return}let r=!0;return m(!0),d(null),l(null),(async()=>{try{let i=null;if(h)i=e;else{let a=n||``,o=decodeURIComponent(e),c=s.metadataCache.getFirstLinkpathDest(o,a);if(!c&&a&&(c=s.metadataCache.getFirstLinkpathDest(o,``)),c instanceof f.TFile&&cW.test(c.path))i=s.vault.getResourcePath(c);else{let a=(0,f.normalizePath)(o),l=s.vault.getAbstractFileByPath(a);if(l instanceof f.TFile&&cW.test(l.path))i=s.vault.getResourcePath(l);else if(r){let r=`Could not resolve ${t} link: "${e}"`;n&&(r+=` (context: "${n}")`),c?r+=` - resolved to "${c.path}" but it's not a valid image.`:l&&(r+=` - resolved to "${l.path}" but it's not a valid image.`),d(r)}}}if(i&&r)l(i);else if(!i&&r&&!u){let r=`Image source for "${e}" (type: ${t}) could not be determined.`;n&&(r+=` Relative to "${n}"`),d(r)}}catch(i){console.error(`Error resolving image path for link "${e}" (type: ${t}, source: ${n||`N/A`}):`,i),r&&d(`Failed to resolve image "${e}": ${i.message}`)}finally{r&&m(!1)}})(),()=>{r=!1}},[s,e,t,n]);let g=()=>{ZS(n?{imgUrl:c,filepath:n}:{imgUrl:c})},_=async()=>{if(!(!i||!n))switch(a){case`DAILY`:await ps(i,n);break;case`CANVAS`:await hs(i,n);break;case`MULTI`:await fs(n);break;case`FILE`:await ms(i,n);break;case`JOURNAL`:await ps(i,n);break}};return p?(0,W.jsx)(`div`,{className:`image-loading-placeholder`,children:`Loading...`}):u?(0,W.jsxs)(`div`,{className:`image-error-placeholder image-error-clickable`,onClick:_,title:`Click to open source location`,children:[`Error: `,u]}):c?(0,W.jsx)(`img`,{src:c,alt:r||e,crossOrigin:h?`anonymous`:void 0,onClick:g,onLoad:e=>{let t=e.currentTarget;o&&t.complete&&!h&&aW(t).then(e=>{o(e)}).catch(e=>{console.warn(`Failed to extract color:`,e)})},onError:()=>{u||d(`Failed to load image from src: ${c||e}`)},loading:`lazy`}):(0,W.jsx)(`div`,{className:`image-error-placeholder image-error-clickable`,onClick:_,title:`Click to open source location`,children:`Image not available`})};I(),H(),$r();var uW=20,dW=10,fW=()=>{let{app:e}=F(),{isMobileView:t}=vi(),[n,r]=(0,U.useState)([]),[i,a]=(0,U.useState)([]),[o,s]=(0,U.useState)(uW),[c,l]=(0,U.useState)(!0),[u,d]=(0,U.useState)(null),[f,p]=(0,U.useState)(null),[m,h]=(0,U.useState)([]);(0,U.useEffect)(()=>{(async()=>{if(!e){l(!1);return}l(!0);try{let e=await V.fetchAllMemos(),t=new Map,n=0;for(let r of e)if(r.content){for(let e of r.content.matchAll(qr)){let i=e[1],a=e[5];if(i){let e=`wiki-${r.path}-${i}`;t.has(e)||t.set(e,{link:i,type:`wiki`,thinoId:r.id,sourceType:r.sourceType,memoPath:r.path,altText:a||i,key:`img-${n++}`})}}for(let e of r.content.matchAll(Jr)){let i=e[3],a=e[2];if(i&&!i.startsWith(`http`)&&/\.(png|jpg|jpeg|gif|bmp|svg|webp)$/i.test(i)){let e=`md-${i}`;t.has(e)||t.set(e,{link:i,type:`markdown`,thinoId:r.id,sourceType:r.sourceType,memoPath:r.path,altText:a||i,key:`img-${n++}`})}}for(let e of r.content.matchAll(Kr)){let i=e[2]+e[3]+e[4]+e[5],a=`http-${i}`;t.has(a)||t.set(a,{link:i,type:`markdown`,thinoId:r.id,sourceType:r.sourceType,memoPath:r.path,altText:i,key:`img-${n++}`})}}r(Array.from(t.values()))}catch(e){console.error(`Failed to fetch image references for gallery:`,e)}finally{l(!1)}})()},[e]),(0,U.useEffect)(()=>{h(f===null?n:n.filter(e=>e.dominantColor===f))},[f,n]),(0,U.useEffect)(()=>{m.length>0?a(m.slice(0,o)):a([])},[o,m]),(0,U.useEffect)(()=>{let e=document.querySelector(`.content-wrapper`);e?d(e):(console.warn(`'.content-wrapper' not found, falling back to window for scroll events. For optimal performance, ensure '.content-wrapper' exists or pass a ref to the scrollable element.`),d(document.documentElement))},[e]);let g=(0,U.useCallback)(()=>{!u||c||o>=m.length||u.scrollTop+u.clientHeight>=u.scrollHeight-300&&s(e=>Math.min(e+dW,m.length))},[c,m,o,u]);(0,U.useEffect)(()=>{if(!u)return;let e=u===document.documentElement?window:u;return e.addEventListener(`scroll`,g),()=>e.removeEventListener(`scroll`,g)},[g,u]);let _=(0,U.useCallback)((e,t)=>{r(n=>n.map(n=>n.key===e?{...n,dominantColor:t}:n))},[]),v=(0,U.useCallback)(e=>{p(e),s(uW)},[]);return c?(0,W.jsxs)(`div`,{className:`gallery-wrapper`,children:[(0,W.jsx)(pC,{showSidebar:t,children:(0,W.jsx)(`div`,{className:`gallery-header`,children:(0,W.jsx)(sW,{onColorSelect:v,selectedColor:f})})}),(0,W.jsx)(`div`,{className:`loading-indicator`,children:`Loading images...`})]}):i.length===0&&f===null?(0,W.jsx)(`div`,{className:`empty-gallery-message`,children:`Try add a image to thino`}):i.length===0&&f!==null?(0,W.jsxs)(`div`,{className:`gallery-wrapper`,children:[(0,W.jsx)(pC,{showSidebar:t,children:(0,W.jsx)(`div`,{className:`gallery-header`,children:(0,W.jsx)(sW,{onColorSelect:v,selectedColor:f})})}),(0,W.jsx)(`div`,{className:`empty-gallery-message`,children:`No images found with the selected color`})]}):(0,W.jsxs)(`div`,{className:`gallery-wrapper`,children:[(0,W.jsx)(pC,{showSidebar:t,children:(0,W.jsxs)(`div`,{className:`gallery-header`,children:[(0,W.jsx)(sW,{onColorSelect:v,selectedColor:f}),(0,W.jsx)(`div`,{className:`gallery-stats`,children:f?(0,W.jsxs)(`span`,{className:`gallery-stats-text`,children:[`Showing `,i.length,` of `,m.length,` `,f,` images`]}):(0,W.jsxs)(`span`,{className:`gallery-stats-text`,children:[`Showing `,i.length,` of `,n.length,` images`]})})]})}),(0,W.jsx)(rW,{breakpointCols:{default:3,1100:2,700:1},className:`gallery-masonry-grid`,columnClassName:`gallery-masonry-grid_column`,children:i.map(e=>(0,W.jsx)(`div`,{className:`gallery-image-item`,children:(0,W.jsx)(lW,{link:e.link,type:e.type,imagePath:e.memoPath,altText:e.altText,thinoId:e.thinoId,sourceType:e.sourceType,onColorExtracted:t=>_(e.key,t)})},e.key))})]})},pW={"/recycle":(0,W.jsx)(gH,{}),"/archive":(0,W.jsx)(hC,{}),"/review":(0,W.jsx)(_H,{}),"/stat":(0,W.jsx)(JU,{}),"/daily-review":(0,W.jsx)(qU,{}),"/daily":(0,W.jsx)(wH,{}),"/gallery":(0,W.jsx)(fW,{}),"*":(0,W.jsx)(pH,{})},mW=e=>t=>{for(let n of Object.keys(e))if(n===t)return e[n];return e[`*`]},hW=mW(GD),gW=mW(pW);hi(),Ci(),Ti(),Hg(),Ng(),Rg();var _W=!1,vW=``,yW=``,bW=``,xW=void 0;function SW(){(0,U.startTransition)(()=>{try{Vg.getState().recompute()}catch{}})}var CW=(0,f.debounce)(()=>{console.log(`ThinoDebug quick recompute triggered`),SW()},20,!0),wW=(0,f.debounce)(()=>{console.log(`ThinoDebug normal recompute triggered`),SW()},100,!0);function TW(){let{query:e}=Si.getState(),{settings:t}=F.getState();e?.tag&&!e.text&&!e.type&&!e.filter&&!e.path&&(!e.metadata||Object.keys(e.metadata).length===0)&&(!e.duration||e.duration.from===0&&e.duration.to===0)&&!t?.HideDoneTasks?(console.log(`ThinoDebug: Using quick recompute for simple tag query`),CW()):wW()}function EW(){console.log(`ThinoDebug initMemoFilterAutoRecompute`),!_W&&(_W=!0,P.subscribe(e=>e.memosHash,e=>{if(e){if(e===vW){console.log(`ThinoDebug memoFilterInit: memos unchanged, skipping recompute`);return}vW=e,TW()}}),Si.subscribe(e=>e.query,(e,t)=>{let n=JSON.stringify({tag:e?.tag||``,dur:e?.duration?[e.duration.from,e.duration.to]:null,type:e?.type||``,text:e?.text||``,filter:e?.filter||``,path:e?.path||``,metadata:e?.metadata||{}});if(n===yW){console.log(`ThinoDebug memoFilterInit: query unchanged, skipping recompute`);return}console.log(`ThinoDebug locationStore.query changed`,{prev:t,next:e}),yW=n,TW()}),F.subscribe(e=>e.settings?.HideDoneTasks,e=>{e!==xW&&(xW=e,TW())}),F.subscribe(e=>e.plugin,()=>TW()),Mg.subscribe(e=>e.sort,e=>{let t=JSON.stringify(e||null);t!==bW&&(bW=t,TW())}),B.subscribe(e=>e.searchResults,e=>{let{query:t}=Si.getState();B.getState().enabled&&t?.text&&wW()}),(P.getState().memos?.length||0)>0&&TW())}je(),M(),H(),Wa(),li(),I();function DW({app:e}){let{pathname:t}=Si(),{settings:n}=F();return(0,U.useEffect)(()=>{EW();let e=()=>{Ua.start(`startup:fetchAllMemos`),V.fetchAllMemos().finally(()=>Ua.end(`startup:fetchAllMemos`))};f.Platform.isIosApp||f.Platform.isSafari?window.setTimeout(e,0):b(e,{timeout:100})},[]),(0,U.useEffect)(()=>{!re()&&!e?.plugins?.getPlugin(`periodic-notes`)&&n?.EnabledLocationList?.find(e=>e.value===`DAILY`)&&new f.Notice(j(`Check if you opened Daily Notes Plugin Or Periodic Notes Plugin`)),!re()&&n?.EnabledLocationList?.find(e=>e.value===`DAILY`)&&!ii()&&new f.Notice(j(`Your daily note folder is not set correctly, please check your settings`))},[e,n]),(0,W.jsx)(W.Fragment,{children:hW(t)})}I(),Tg(),H();function OW(e){let t=e.view.canvas,n=L.getState().settings.EnabledLocationList.find(e=>e.value===`CANVAS`);if(!t||!e.view.file.path.endsWith(`.thino.canvas`)||t.thinoBtn||!n)return;let r=(0,u_.createRoot)(t.wrapperEl.createDiv({cls:`thino-canvas-menu-btn`}));r.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(kW,{leaf:e})})),t.thinoBtn=r,L.getState().view.appendRoot({root:r,canvas:t})}function kW({leaf:e}){let{memos:t}=P(),{query:n}=Si(),{plugin:r}=F(),i=U.useRef(null),a=U.useRef(null),[o,s]=U.useState(!1),[c,l]=U.useState([]),[u,d]=U.useState([]),{tag:p,duration:m,type:h,text:g,filter:_}=n,v=Zg.getQueryById(_),y=!!(p||m&&m.from<m.to||h||g||v);return(0,U.useEffect)(()=>{a.current&&(0,f.setIcon)(a.current,`eraser`)},[a.current]),(0,U.useEffect)(()=>{i.current&&(0,f.setIcon)(i.current,`Memos`)},[i.current]),(0,U.useEffect)(()=>{let n=e.view.file.path;l(t.filter(e=>e.sourceType===`CANVAS`&&e.path===n))},[t,o]),(0,U.useEffect)(()=>{if(c.length!==0){if(!n||!y){d(c);return}wg({memos:c,query:n,filterOptions:{filterDoneTasks:!1},plugin:r}).then(e=>{d(e)})}},[n,c]),(0,U.useEffect)(()=>{if(!n||!y&&u.length===0)return;let t=new Set(u.map(e=>e.id)),r=Array.from(e.view.canvas.nodes.values());r.forEach(t=>{t.nodeEl.toggleVisibility(!0),e.view.canvas.getEdgesForNode(t).forEach(e=>{e.lineGroupEl?.toggleClass(`thino-hidden`,!1),e.lineStartGroupEl?.toggleClass(`thino-hidden`,!1),e.lineEndGroupEl?.toggleClass(`thino-hidden`,!1)})}),r.filter(e=>!t.has(e.id)).forEach(t=>{t.nodeEl.toggleVisibility(!1),e.view.canvas.getEdgesForNode(t).forEach(e=>{e.lineGroupEl?.toggleClass(`thino-hidden`,!0),e.lineStartGroupEl?.toggleClass(`thino-hidden`,!0),e.lineEndGroupEl?.toggleClass(`thino-hidden`,!0)})})},[u]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{ref:i,className:`btn-container`,onClick:()=>s(!o)}),o&&(0,W.jsxs)(`div`,{className:`thino-canvas-menu`,children:[(0,W.jsxs)(`div`,{className:`thino-canvas-filter-group`,children:[(0,W.jsx)(bT,{}),(0,W.jsx)(Dv,{}),y&&(0,W.jsx)(`div`,{ref:a,className:`clear-query`,onClick:()=>{z.clearQuery()}})]}),(0,W.jsx)(tE,{initThinos:u})]})]})}function AW(e,t){let n=Object.keys(t).map(n=>jW(e,n,t[n]));return n.length===1?n[0]:function(){n.forEach(e=>e())}}function jW(e,t,n){let r=e[t],i=e.hasOwnProperty(t),a=n(r);return r&&Object.setPrototypeOf(a,r),Object.setPrototypeOf(o,a),e[t]=o,s;function o(...n){return a===r&&e[t]===o&&s(),a.apply(this,n)}function s(){e[t]===o&&(i?e[t]=r:delete e[t]),a!==r&&(a=r,Object.setPrototypeOf(o,r||Function))}}H(),je(),Fg();var MW=`thino_view`,NW=class{static[Symbol.hasInstance](e){return e instanceof f.TFile}path=`/fake-file-that-generated-for-thino.png`;basename=`fake-file-that-generated-for-thino`;extension=`png`;deleted=!1;name=`fake-file-that-generated-for-thino.png`;parent=null;stat;vault=null;constructor(){}setPath(e){}getNewPathAfterRename(e){}getShortName(){}cache(e){}updateCacheLimit(){}},PW=class e extends f.ItemView{scope=new f.Scope(this.app.scope);root;mobileHeaderRoot;plugin;memosComponent;rootList=[];pendingModifyHandlers=new Map;editor=null;navigation=!1;file=this.app.vault.getMarkdownFiles()[0]||new NW;constructor(e,t){super(e),this.plugin=t,this.registerScope()}getDisplayText(){return`Thino`}getIcon(){return`Memos`}getViewType(){return MW}getMode(){return`source`}canToggleBacklinks(){return!1}registerScope(){let{scope:e}=this;e.register([`Mod`],`Enter`,()=>{}),e.register([],`i`,e=>{let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.hasClass(`cm-line`)||t.hasClass(`cm-content`)||(e.preventDefault(),this.plugin.app.workspace.trigger(`focus-on-textarea`))}),e.register([`Mod`],`f`,e=>{let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.hasClass(`cm-line`)||t.hasClass(`cm-content`)||(e.preventDefault(),this.plugin.app.workspace.trigger(`focus-on-searchBar`))}),e.register([],`o`,e=>{let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.hasClass(`cm-line`)||t.hasClass(`cm-content`)||(e.preventDefault(),this.plugin.app.workspace.trigger(`focus-on-searchBar`))}),e.register([],`Escape`,()=>{this.plugin.app.vault.config?.vimMode!==!0&&setTimeout(()=>{this.plugin.app.workspace.trigger(`blur-on-memos`)},20)})}handleUpdateInstance=e=>{this.editor=e.editor};handleFileModify(e){let t=this.pendingModifyHandlers.get(e.path);t&&t();let n;this.pendingModifyHandlers.set(e.path,()=>{n&&clearTimeout(n)}),n=setTimeout(async()=>{this.pendingModifyHandlers.delete(e.path),await this.onFileModified(e)},2e3)}async onFileDeleted(e){let t=this.pendingModifyHandlers.get(e.path);t&&(console.log(`ThinoDebug: Cancelling pending modify event for deleted file`,e.path),t(),this.pendingModifyHandlers.delete(e.path));let n=de(e,`day`),r=e.path.contains(`.thino`)&&e.path.contains(`.canvas`),i=e.path.contains(`.thino`)&&e.path.contains(`.md`),a=this.plugin.settings?.MemoOtherSaveLocation.MemoDefaultMultiFilePath||`Thino`,o=(e.parent?.path||e.path)?.contains(a?.trim());(n||r&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`CANVAS`))&&(await V.removeMemosInFile(e),V.updateTagsState()),o&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`MULTI`)&&(await V.removeMemosInFile(e,a),V.updateTagsState()),i&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`FILE`)&&(await V.removeMemosInFile(e),V.updateTagsState());let s=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForMultiTypeFiles),c=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForFileTypeFiles);!o&&s&&(await V.removeMemosInFile(e,a),V.updateTagsState()),!i&&c&&(await V.removeMemosInFile(e),V.updateTagsState())}async onFileModified(e){if(V.isPathPending(e.path)){console.log(`[Thino:Perf] onFileModified SKIPPED (locked) ${e.path}`);return}if(!await this.app.vault.adapter.exists(e.path)){console.log(`ThinoDebug onFileModified: file no longer exists, ignoring modify event for`,e.path);return}let t=de(e,`day`),n=e.path.contains(`.thino`)&&e.path.contains(`.canvas`),r=e.path.contains(`.thino`)&&e.path.contains(`.md`),i=this.plugin.settings?.MemoOtherSaveLocation.MemoDefaultMultiFilePath||`Thino`,a=e.parent.path.contains(i?.trim()),o=V.getState().preparingUpdateMemo&&V.getState().preparingUpdateMemo.length>0;if(Pg.getState().clearCache(),(t||n&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`CANVAS`))&&!o){await V.updateMemosInFile(e),V.updateTagsState();return}a&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`MULTI`)&&(await V.updateMemosInFile(e,i),V.updateTagsState()),r&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`FILE`)&&(await V.updateMemosInFile(e),V.updateTagsState());let s=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForMultiTypeFiles),c=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForFileTypeFiles);!a&&s&&(await V.updateMemosInFile(e,i),V.updateTagsState()),!r&&c&&(await V.updateMemosInFile(e),V.updateTagsState())}async onFileCreated(e){if(this.app.workspace.layoutReady&&this.root){let t=de(e,`day`),n=e.path.contains(`.thino`)&&e.path.contains(`.canvas`),r=e.path.contains(`.thino`)&&e.path.contains(`.md`),i=this.plugin.settings?.MemoOtherSaveLocation.MemoDefaultMultiFilePath||`Thino`,a=e.parent.path.contains(i?.trim()),o=V.getState().preparingUpdateMemo&&V.getState().preparingUpdateMemo.length>0;if(t&&!o){if(R.getState().changedByMemos||V.isPathPending(e.path)){console.log(`[Thino:Perf] onFileCreated SKIPPED (locked) ${e.path}`),await L.updateDailyNotes(e,!1);return}console.log(`[Thino:Perf] onFileCreated PROCESSING ${e.path}`),await L.updateDailyNotes(e,!1),await V.updateMemosInFile(e),V.updateTagsState();return}if(n&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`CANVAS`)){await V.updateMemosInFile(e),V.updateTagsState();return}a&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`MULTI`)&&(await V.updateMemosInFile(e,i),V.updateTagsState()),r&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`FILE`)&&(await V.updateMemosInFile(e),V.updateTagsState());let s=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForMultiTypeFiles),c=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForFileTypeFiles);!a&&s&&(await V.updateMemosInFile(e,i),V.updateTagsState()),!r&&c&&(await V.updateMemosInFile(e),V.updateTagsState())}}async onFileRenamed(e,t){if(e instanceof f.TFile){let n=this.pendingModifyHandlers.get(t);n&&(console.log(`ThinoDebug: Cancelling pending modify event for renamed file`,t),n(),this.pendingModifyHandlers.delete(t)),await V.removeThinosByPath(t),await this.onFileCreated(e)}}checkWidth(){let e=this.leaf;if(e&&e.height!==0){if(e.view.containerEl.toggleClass(`tiny-view`,e.width<600),e.view.containerEl.toggleClass(`waterfall-small-group`,e.width<1300),e.view.containerEl.toggleClass(`phone-view`,f.Platform.isMobile),R.setIsPhoneView(f.Platform.isMobile),e.width>1100){e.view.containerEl.classList.toggle(`mobile-view`,!1),R.setIsMobileView(e.width<=1100);return}if(this.plugin.settings?.ShowLeftSideBar&&!f.Platform.isMobile)return;e.view.containerEl.classList.toggle(`mobile-view`,!0),R.setIsMobileView(e.width<=1100)}}async onResize(){super.onResize(),this.checkWidth()}appendToHeader(){if(this.plugin.settings.useMobileViewDefaultHeader){this.containerEl.toggleClass(`using-default-header`,!0);return}let e=this.leaf.view.titleContainerEl;e&&(this.mobileHeaderRoot=u_.createRoot(e),this.mobileHeaderRoot.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(ET,{})})))}appendRoot({root:e,canvas:t}){this.rootList.push({root:e,canvas:t})}updateCacheDebounced=(0,f.debounce)(async e=>{this.app.vault.getFileByPath(e.path)&&await V.updateMemosInFile(e)},1e3);registerPatchWorkspaceLeaf(){let t=this;this.register(AW(f.Workspace.prototype,{getActiveViewOfType:t=>function(n){let r=t.call(this,n);if(!r&&n?.VIEW_TYPE===`markdown`){let t=this.activeLeaf;if(t?.view instanceof e)return t.view}return r},setActiveLeaf:n=>function(r,i){if(dw(r)&&(n.call(this,r,i),r.activeTime=17e11),n.call(this,r,i),r.view instanceof e){let e=R.getState().instances?.[r.id];if(!e)return;t.app.workspace.activeEditor=e.owner,r.view.editor=e.editor}},getActiveFile:n=>function(){let r=n.call(this);return this.activeLeaf?.view instanceof e&&t.file||r}}))}debounceTemplateExecution=(0,f.debounce)(async()=>{console.log(`debounceTemplateExecution`),this.app.workspace.trigger(`templater:all-templates-executed`)},1e3);async registerEventList(){await this.onResize(),this.onFileCreated=this.onFileCreated.bind(this),this.onFileDeleted=this.onFileDeleted.bind(this),this.onFileModified=this.onFileModified.bind(this),this.registerEvent(this.app.vault.on(`create`,this.onFileCreated)),this.registerEvent(this.app.vault.on(`delete`,this.onFileDeleted.bind(this))),this.registerEvent(this.app.vault.on(`modify`,e=>{e instanceof f.TFile&&this.handleFileModify(e)})),this.registerEvent(this.app.vault.on(`rename`,this.onFileRenamed.bind(this))),this.registerEvent(this.app.workspace.on(`active-leaf-change`,e=>{e?.view?.getViewType()===`canvas`&&OW(e)})),this.registerEvent(this.app.metadataCache.on(`changed`,(e,t,n)=>{if(V.getState().preparingUpdateMemo&&V.getState().preparingUpdateMemo.length>0){this.debounceTemplateExecution(),console.log(`templater update`);return}if(!V.initialized)return;let r=de(e,`day`);if(r&&V.isPathPending(e.path)){console.log(`[Thino:Perf] metadataCache SKIPPED (locked) ${e.path}`);return}r&&this.updateCacheDebounced(e)})),this.registerEvent(this.app.workspace.on(`templater:all-templates-executed`,async()=>{await V.finishWaitingForTemplaterThinos()}))}async onOpen(){this.checkWidth(),this.navigation=this.plugin.settings.navigation,f.Platform.isTablet&&document.body.toggleClass(`is-tablet`,!0);try{this.root=u_.createRoot(f.Platform.isDesktop?this.containerEl:this.contentEl),L.setView(this),this.root.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(DW,{app:this.plugin.app})}))}catch(e){console.error(e)}requestAnimationFrame(async()=>{f.Platform.isMobile&&!f.Platform.isTablet&&this.appendToHeader(),await this.registerEventList(),this.registerPatchWorkspaceLeaf()})}onunload(){super.onunload(),this.root.unmount(),this.mobileHeaderRoot?.unmount(),this.rootList.forEach(e=>{e?.root?.unmount(),e?.canvas?.thinoBtn&&(e.canvas.thinoBtn=void 0),e?.canvas?.wrapperEl.find(`.thino-canvas-menu-btn`)&&e.canvas.wrapperEl.find(`.thino-canvas-menu-btn`).detach()})}},FW=class e{app;filePath;leaf=null;canvas=null;file=null;container=null;isReadonly;destroyed=!1;listeners=new Map;originalUnload=null;resizeObserver=null;constructor(e){this.app=e.app,this.filePath=e.filePath,this.container=e.container??null,this.isReadonly=e.readonly??!1}async open(){if(this.destroyed)throw Error(`ManagedCanvas has been destroyed`);await this.ensureFile(),await this.openLeaf(),await this.waitForCanvas(),this.container&&this.embedInContainer(),this.isReadonly&&this.canvas&&this.canvas.setReadonly?.(!0),this.emit(`canvas-ready`)}destroy(){if(!this.destroyed){if(this.destroyed=!0,this.resizeObserver&&=(this.resizeObserver.disconnect(),null),this.originalUnload){try{this.originalUnload()}catch{}this.originalUnload=null}this.leaf&&=(this.leaf.detach(),null),this.canvas=null,this.file=null,this.emit(`canvas-destroyed`),this.listeners.clear()}}get isReady(){return!this.destroyed&&this.canvas!==null}getCanvas(){return this.canvas}getLeaf(){return this.leaf}getWrapperEl(){return this.canvas?.wrapperEl??null}getData(){return this.canvas?.getData()??null}setData(e){this.requireCanvas(),this.canvas.setData(e),this.emit(`data-changed`,e)}importData(e,t=!1){this.requireCanvas(),this.canvas.importData(e,t),this.emit(`data-changed`,this.getData())}save(e=!0){this.requireCanvas(),this.canvas.requestSave(e)}createTextNode(e){this.requireCanvas();let t=this.canvas.createTextNode({pos:e.pos,size:e.size,position:e.position,text:e.text??``,save:e.save??!0,focus:e.focus??!1}).id;return this.emit(`node-added`,t),t}createFileNode(e){this.requireCanvas();let t=this.canvas.createFileNode({pos:e.pos,size:e.size,position:e.position,file:e.file,subpath:e.subpath,save:e.save??!0,focus:e.focus??!1}).id;return this.emit(`node-added`,t),t}createLinkNode(e){this.requireCanvas();let t=this.canvas.createLinkNode({pos:e.pos,size:e.size,position:e.position,url:e.url,save:e.save??!0,focus:e.focus??!1}).id;return this.emit(`node-added`,t),t}createGroupNode(e){this.requireCanvas();let t=this.canvas.createGroupNode({pos:e.pos,size:e.size,position:e.position,label:e.label,save:e.save??!0,focus:e.focus??!1}).id;return this.emit(`node-added`,t),t}removeNode(e){this.requireCanvas();let t=this.canvas.nodes.get(e);return t?(this.canvas.removeNode(t),this.save(),this.emit(`node-removed`,e),!0):!1}getNode(e){return this.canvas?.nodes.get(e)}getNodeIds(){return this.canvas?Array.from(this.canvas.nodes.keys()):[]}selectAndZoom(e){this.requireCanvas();let t=this.canvas.nodes.get(e);return t?(this.canvas.selectOnly(t),this.canvas.zoomToSelection(),!0):!1}selectNode(e){this.requireCanvas();let t=this.canvas.nodes.get(e);return t?(this.canvas.select(t),!0):!1}deselectAll(){this.requireCanvas(),this.canvas.deselectAll()}createEdge(e){this.requireCanvas();let t=this.canvas.nodes.get(e.fromNodeId),n=this.canvas.nodes.get(e.toNodeId);if(!t||!n)return null;let r=this.generateId(),i={id:r,fromNode:e.fromNodeId,fromSide:e.fromSide??`right`,toNode:e.toNodeId,toSide:e.toSide??`left`,label:e.label},a=this.getData();return a?(a.edges=[...a.edges??[],i],this.canvas.importData(a,!0),this.save(),this.emit(`edge-added`,r),r):null}removeEdge(e){this.requireCanvas();let t=this.canvas.edges.get(e);return t?(this.canvas.removeEdge(t),this.save(),this.emit(`edge-removed`,e),!0):!1}getEdgeIds(){return this.canvas?Array.from(this.canvas.edges.keys()):[]}zoomToFit(){this.requireCanvas(),this.canvas.zoomToFit?.()}setViewport(e,t,n){this.requireCanvas(),this.canvas.setViewport?.(e,t,n)}screenToCanvas(e,t){if(!this.canvas)return null;let n=this.canvas.wrapperEl;if(!n)return null;let r=n.getBoundingClientRect(),i=this.canvas.scale??1,a=this.canvas.x??0,o=this.canvas.y??0;return{x:(e-r.left-r.width/2)/i+a,y:(t-r.top-r.height/2)/i+o}}async saveJson(e){let t=this.getData();t&&await this.app.vault.adapter.write(e,JSON.stringify(t,null,2))}static async loadJson(e,t){try{let n=await e.read(t);return JSON.parse(n)}catch{return null}}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set);let n=t;return this.listeners.get(e).add(n),()=>this.listeners.get(e)?.delete(n)}emit(e,...t){this.listeners.get(e)?.forEach(n=>{try{n(...t)}catch(t){console.error(`[ManagedCanvas] Error in "${e}" listener:`,t)}})}async ensureFile(){let e=this.app.vault.getAbstractFileByPath(this.filePath);if(e instanceof f.TFile){this.file=e;return}let t=this.filePath.substring(0,this.filePath.lastIndexOf(`/`));t&&(this.app.vault.getAbstractFileByPath(t)||await this.app.vault.createFolder(t)),this.file=await this.app.vault.create(this.filePath,JSON.stringify({nodes:[],edges:[]},null,2))}async openLeaf(){if(!this.file)throw Error(`Canvas file not initialised`);this.leaf=this.app.workspace.getLeaf(`split`),await this.leaf.openFile(this.file)}waitForCanvas(){return new Promise((e,t)=>{let n=0,r=()=>{n++;let i=this.leaf?.view;if(i?.canvas){this.canvas=i.canvas,e();return}if(n>=50){t(Error(`Timed out waiting for canvas instance`));return}requestAnimationFrame(r)};requestAnimationFrame(r)})}embedInContainer(){if(!this.container||!this.canvas)return;let e=this.canvas.wrapperEl;if(!e)return;this.container.appendChild(e),this.originalUnload=this.canvas.unload.bind(this.canvas),this.canvas.unload=()=>{};let t=this.canvas;t.requestSave=e=>{e===void 0&&(e=!0),t.data=t.getData(),e&&t.requestPushHistory?.(t.data),this.emit(`save-requested`)};let n=t.view,r=n?.file;n&&(n.requestSave=()=>{},n.clear=()=>{},r&&Object.defineProperty(n,`file`,{get:()=>r,set:()=>{},configurable:!0})),this.leaf&&=(this.leaf.detach(),null);let i=this.canvas;this.resizeObserver=new ResizeObserver(()=>{i.onResize?.()}),this.resizeObserver.observe(this.container),requestAnimationFrame(()=>{i.onResize?.(),i.requestFrame?.()})}requireCanvas(){if(!this.canvas||this.destroyed)throw Error(`ManagedCanvas is not ready or has been destroyed`)}generateId(){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}static async create(t){let n=new e(t);return await n.open(),n}static fromLeaf(t,n,r){let i=n.view;if(!i?.canvas||!i?.file)return null;let a=new e({app:t,filePath:i.file.path,container:r});return a.leaf=n,a.canvas=i.canvas,a.file=i.file,r&&a.embedInContainer(),a.emit(`canvas-ready`),a}};I();var IW=100,LW=8;function RW({existingNodeIds:e}){let t=P(e=>e.memos),[n,r]=(0,U.useState)(``),[i,a]=(0,U.useState)(``);(0,U.useEffect)(()=>{let e=window.setTimeout(()=>a(n),250);return()=>clearTimeout(e)},[n]);let o=(0,U.useMemo)(()=>{let e=i.trim().toLowerCase(),n=t.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt);return e&&(n=n.filter(t=>t.content.toLowerCase().includes(e))),n},[t,i]),s=(0,U.useRef)(null),[c,l]=(0,U.useState)(0),[u,d]=(0,U.useState)(600),f=(0,U.useCallback)(()=>{let e=s.current;e&&l(e.scrollTop)},[]);(0,U.useEffect)(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)d(t.contentRect.height)});return t.observe(e),()=>t.disconnect()},[]);let p=o.length*IW,m=Math.max(0,Math.floor(c/IW)-LW),h=Math.min(o.length,Math.ceil((c+u)/IW)+LW),g=o.slice(m,h);return(0,W.jsxs)(`div`,{className:`thino-list-panel`,children:[(0,W.jsx)(`div`,{className:`thino-list-search`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`Search thinos...`,value:n,onChange:e=>r(e.target.value),spellCheck:!1})}),(0,W.jsxs)(`div`,{className:`thino-list-count`,children:[o.length,` thino`,o.length===1?``:`s`]}),(0,W.jsx)(`div`,{className:`thino-list-items`,ref:s,onScroll:f,children:o.length>0?(0,W.jsx)(`div`,{style:{height:p,position:`relative`},children:(0,W.jsx)(`div`,{style:{position:`absolute`,top:m*IW,left:0,right:0},children:g.map(t=>(0,W.jsx)(zW,{memo:t,isOnCanvas:e.has(t.id)},t.id))})}):(0,W.jsx)(`div`,{className:`thino-list-empty`,children:`No thinos found`})})]})}var zW=U.memo(function({memo:e,isOnCanvas:t}){let n=(0,U.useRef)(null),r=t=>{t.dataTransfer.setData(`text/thino-id`,e.id),t.dataTransfer.setData(`text/thino-content`,e.content),t.dataTransfer.effectAllowed=`copy`,n.current&&t.dataTransfer.setDragImage(n.current,10,10)},i=e.content.length>140?e.content.slice(0,140)+`…`:e.content;return(0,W.jsxs)(`div`,{ref:n,className:`thino-list-item ${t?`is-on-canvas`:``}`,style:{height:IW,boxSizing:`border-box`},draggable:!0,onDragStart:r,children:[(0,W.jsx)(`div`,{className:`thino-list-item-content`,children:i}),(0,W.jsxs)(`div`,{className:`thino-list-item-meta`,children:[(0,W.jsx)(`span`,{className:`thino-list-item-date`,children:BW(e.createdAt)}),e.sourceType&&(0,W.jsx)(`span`,{className:`thino-list-item-source`,children:e.sourceType}),t&&(0,W.jsx)(`span`,{className:`thino-list-item-badge`,children:`on canvas`})]})]})});function BW(e){if(!e)return``;let t=new Date(e.replace(/\//g,`-`));return isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function VW({app:e,plugin:t,canvasFilePath:n,onCanvasReady:r}){let i=(0,U.useRef)(null),a=(0,U.useRef)(null),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(0),[u,d]=(0,U.useState)(0),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1);(0,U.useEffect)(()=>{if(!i.current)return;let t=!1;return FW.create({app:e,filePath:n,container:i.current}).then(e=>{if(t){e.destroy();return}a.current=e,s(!0),g(e),e.on(`node-added`,()=>g(e)),e.on(`node-removed`,()=>g(e)),e.on(`edge-added`,()=>g(e)),e.on(`edge-removed`,()=>g(e)),r?.(e)}).catch(e=>{console.error(`[ThinoCanvasOrganizer] Canvas init failed:`,e)}),()=>{t=!0}},[n]);let g=(0,U.useCallback)(e=>{l(e.getNodeIds().length),d(e.getEdgeIds().length)},[]),_=(0,U.useCallback)(e=>{e.dataTransfer.types.includes(`text/thino-id`)&&p(!0)},[]),v=(0,U.useCallback)(e=>{let t=e.relatedTarget;e.currentTarget.contains(t)||p(!1)},[]),y=(0,U.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),p(!1);let t=a.current;if(!t)return;let n=e.dataTransfer.getData(`text/thino-id`),r=e.dataTransfer.getData(`text/thino-content`);if(!n||!r)return;let i=t.screenToCanvas(e.clientX,e.clientY);if(!i)return;let o=t.createTextNode({pos:i,size:{width:300,height:120},text:r,focus:!1,save:!1});try{let e=t.getData();if(e){let r=e.nodes.find(e=>e.id===o);r&&(r.thinoId=n),t.setData(e)}}catch{}t.save()},[]),b=(0,U.useCallback)(()=>{let e=a.current;e&&e.createTextNode({pos:{x:Math.random()*200-100,y:Math.random()*200-100},text:``,focus:!0})},[]),x=(0,U.useCallback)(()=>{a.current?.zoomToFit()},[]),S=(0,U.useCallback)(()=>{a.current?.save()},[]);return(0,W.jsxs)(`div`,{className:`thino-organizer-root`,children:[(0,W.jsxs)(`div`,{className:`thino-organizer-toolbar`,children:[(0,W.jsxs)(`div`,{className:`thino-organizer-toolbar-left`,children:[(0,W.jsx)(UW,{icon:`plus`,label:`Add text node`,onClick:b}),(0,W.jsx)(UW,{icon:`maximize`,label:`Zoom to fit`,onClick:x}),(0,W.jsx)(UW,{icon:`save`,label:`Save`,onClick:S})]}),(0,W.jsxs)(`div`,{className:`thino-organizer-toolbar-right`,children:[(0,W.jsx)(`span`,{className:`thino-organizer-status`,children:o?`${c} node${c===1?``:`s`} \u00b7 ${u} edge${u===1?``:`s`}`:`Loading…`}),(0,W.jsx)(UW,{icon:m?`panel-right-open`:`panel-right-close`,label:m?`Show thino list`:`Hide thino list`,onClick:()=>h(e=>!e)})]})]}),(0,W.jsxs)(`div`,{className:`thino-organizer-body`,children:[(0,W.jsxs)(`div`,{className:`thino-organizer-canvas ${f?`is-drag-over`:``}`,onDragEnter:_,onDragLeave:v,onDragOver:e=>{e.dataTransfer.types.includes(`text/thino-id`)&&e.preventDefault()},children:[(0,W.jsx)(`div`,{ref:i,className:`thino-organizer-canvas-host`}),f&&(0,W.jsx)(`div`,{className:`thino-organizer-drop-overlay`,onDrop:y,onDragOver:e=>e.preventDefault(),children:(0,W.jsx)(`span`,{children:`Drop thino here`})})]}),!m&&(0,W.jsx)(RW,{existingNodeIds:o?HW(a.current):new Set})]})]})}function HW(e){if(!e)return new Set;let t=e.getData();if(!t)return new Set;let n=new Set;for(let e of t.nodes){let t=e.thinoId;t&&n.add(t)}return n}function UW({icon:e,label:t,onClick:n}){let r=(0,U.useRef)(null);return(0,U.useEffect)(()=>{r.current&&(0,f.setIcon)(r.current,e)},[e]),(0,W.jsx)(`button`,{ref:r,className:`thino-organizer-toolbar-btn clickable-icon`,"aria-label":t,title:t,onClick:n})}Yg(),H(),I(),zv(),M();var WW=`thino-canvas-organizer`,GW=`thino-organizer-workspace.canvas`,KW=2e3,qW=class extends f.ItemView{plugin;root=null;managedCanvas=null;autoSaveTimer=null;saveDebounceTimer=null;unsubSaveRequested=null;unsubMemoStore=null;constructor(e,t){super(e),this.plugin=t}getViewType(){return WW}getDisplayText(){return`Thino Canvas`}getIcon(){return`layout-dashboard`}get jsonPath(){return`${this.plugin.manifest.dir}/thino-canvas.json`}async isVerified(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;return!!(e&&e?.appId===n)}renderProGate(e){e.empty(),e.addClass(`thino-canvas-organizer-view`);let t=e.createDiv({cls:`super-panel super-enable-prompt`});t.createDiv({cls:`super-enable-icon`}).innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z" /></svg>`,t.createEl(`h3`,{cls:`super-enable-title`,text:`Thino Canvas`}),t.createEl(`p`,{cls:`super-enable-desc`,text:j(`This is a pro feature, please upgrade to pro version to use it.`)})}async onOpen(){let{containerEl:e}=this;if(e.empty(),e.addClass(`thino-canvas-organizer-view`),!f.Platform.isDesktop){this.renderProGate(e);return}if(!await this.isVerified()){this.renderProGate(e);return}let t=await FW.loadJson(this.app.vault.adapter,this.jsonPath),n=JSON.stringify(t??{nodes:[],edges:[]},null,2),r=this.app.vault.getAbstractFileByPath(GW);r instanceof f.TFile?await this.app.vault.modify(r,n):await this.app.vault.create(GW,n),this.root=u_.createRoot(e),this.root.render(U.createElement(VW,{app:this.app,plugin:this.plugin,canvasFilePath:GW,onCanvasReady:e=>{this.managedCanvas=e,this.hookCanvasEvents(e)}})),this.autoSaveTimer=window.setInterval(()=>this.persistToJson(),3e4)}async onClose(){this.autoSaveTimer!==null&&(clearInterval(this.autoSaveTimer),this.autoSaveTimer=null),this.saveDebounceTimer!==null&&(clearTimeout(this.saveDebounceTimer),this.saveDebounceTimer=null),this.unsubSaveRequested?.(),this.unsubSaveRequested=null,this.unsubMemoStore?.(),this.unsubMemoStore=null,this.syncThinoChanges(),await this.persistToJson(),this.managedCanvas&&=(this.managedCanvas.destroy(),null),this.root?.unmount(),this.root=null;try{let e=this.app.vault.getAbstractFileByPath(GW);e&&await this.app.vault.delete(e)}catch(e){console.warn(`[ThinoCanvasOrganizer] Could not delete working file:`,e)}}hookCanvasEvents(e){this.unsubSaveRequested=e.on(`save-requested`,()=>{this.saveDebounceTimer!==null&&clearTimeout(this.saveDebounceTimer),this.saveDebounceTimer=window.setTimeout(()=>{this.saveDebounceTimer=null,this.syncThinoChanges(),this.persistToJson()},KW)}),this.unsubMemoStore=P.subscribe(e=>e.memos,t=>{this.syncStoreToCanvas(e,t)})}syncThinoChanges(){let e=this.managedCanvas;if(!e?.isReady)return;let t=e.getData();if(!t)return;let n=P.getState().memos;for(let e of t.nodes){let t=e.thinoId;if(!t||typeof e.text!=`string`)continue;let r=n.find(e=>e.id===t);if(!r)continue;let i=e.text.trim();i!==r.content.trim()&&V.updateMemo(t,i).catch(e=>{console.error(`[ThinoCanvasOrganizer] Failed to sync thino ${t}:`,e)})}}syncStoreToCanvas(e,t){if(!e.isReady)return;let n=e.getData();if(!n)return;let r=!1;for(let e of n.nodes){let n=e.thinoId;if(!n||typeof e.text!=`string`)continue;let i=t.find(e=>e.id===n);i&&e.text.trim()!==i.content.trim()&&(e.text=i.content,r=!0)}r&&(e.setData(n),this.persistToJson())}async persistToJson(){if(this.managedCanvas?.isReady)try{await this.managedCanvas.saveJson(this.jsonPath)}catch(e){console.error(`[ThinoCanvasOrganizer] Failed to persist JSON:`,e)}}static async cleanupWorkingFile(e){try{let t=e.vault.getAbstractFileByPath(GW);t&&await e.vault.delete(t)}catch{}}};H(),li(),Sa();var JW=class extends f.EditorSuggest{root;editor;cursor;plugin;memos=[];constructor(e,t){super(e),this.plugin=t,this.memos=V.getState().memos.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`)}checkInMemosView(e){let t=e.containerEl;return t&&(t.parentElement?.parentElement)?.classList.contains(`common-editor-inputer`)||!1}fuzzySearchItemsOptimized(e,t){let n=(0,f.prepareFuzzySearch)(e);return t.map(e=>{let t=n(e.content);return t?{item:e,match:t}:null}).filter(Boolean)}onTrigger(e,t){if(!this.checkInMemosView(t))return null;let n=t.getLine(e.line).slice(0,e.ch);if(n.lastIndexOf(`~`)===-1)return null;let r=n.slice(n.lastIndexOf(`~`)+1,e.ch);if(n[n.lastIndexOf(`~`)-1]!==` `&&n.lastIndexOf(`~`)!==0)return null;let i=r.trim();return this.memos=V.getState().memos.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`),{start:{line:e.line,ch:e.ch-i.length},end:e,query:i}}getSuggestions(e){return e.query?this.fuzzySearchItemsOptimized(e.query,this.memos).sort((e,t)=>t.match.score-e.match.score).map(e=>e.item).map(e=>({time:e.createdAt,id:e.id,content:e.content})):this.memos.map(e=>({time:e.createdAt,id:e.id,content:e.content}))}renderSuggestion(e,t){t.toggleClass(`thino-suggestion`,!0),t.createEl(`div`,{cls:`thino-suggestion-time`,text:e.time}),t.createEl(`div`,{cls:`thino-suggestion-container`}).createEl(`div`,{cls:`thino-suggestion-content`,text:e.content})}async addBlockRefToMemo(e,t){await _a(e,{id:e.id,hasId:t})}selectSuggestion(e){let t=V.getMemoById(e.id);if(!t){this.context.editor.replaceRange(`MARK: [@THINO](`+e.id+`)`,{line:this.context.end.line,ch:this.context.start.ch-1},this.context.end);return}t.sourceType===`DAILY`&&t.path?(this.context.editor.replaceRange(`MARK: [@THINO](`+e.id+`)`,{line:this.context.end.line,ch:this.context.start.ch-1},this.context.end),this.handleDailyNoteMemo(t,e)):this.context.editor.replaceRange(`MARK: [@THINO](`+e.id+`)`,{line:this.context.end.line,ch:this.context.start.ch-1},this.context.end)}async handleDailyNoteMemo(e,t){if(!e.path)return;let n=this.app,r=n.vault.getAbstractFileByPath(e.path);if(!(r instanceof f.TFile))return;let i=e.hasId;i||(i=N.randomId(6),await this.addBlockRefToMemo(e,i));let a=this.context.editor,o=a.getLine(this.context.end.line),s=`MARK: [@THINO](${t.id})`;if(o.includes(s)){let e=o.indexOf(s),c=n.fileManager.generateMarkdownLink(r,``,`#^`+i,t.id);a.replaceRange(`MARK: ${c}`,{line:this.context.end.line,ch:e},{line:this.context.end.line,ch:e+s.length})}}},YW=class extends f.EditorSuggest{root=null;editor=null;cursor=null;plugin;suppressCursor=null;committedSelection=!1;constructor(e,t){super(e),this.plugin=t,this.suggestEl.toggleClass(`thino-date-selector`,!0)}checkInMemosView(e){let t=e.containerEl;return t&&(t.parentElement?.parentElement)?.classList.contains(`common-editor-inputer`)||!1}onTrigger(e,t){if(!this.checkInMemosView(t))return null;if(this.suppressCursor){if(this.isSamePosition(e,this.suppressCursor))return null;this.suppressCursor=null}return t.getLine(e.line)[e.ch-1]===`@`?(this.cursor={...e},this.editor=t,{start:{line:e.line,ch:e.ch-1},end:e,query:``}):null}getSuggestions(){return[parseInt((0,f.moment)().startOf(`day`).format(`x`))]}renderSuggestion(e,t){t.empty();let n=u_.createRoot(t);this.root=n,n.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(Yb,{className:`editor-date-picker`,datestamp:e,handleDateStampChange:this.selectSuggestion.bind(this)})}))}selectSuggestion(e,t){if(t instanceof KeyboardEvent||t instanceof PointerEvent&&!t.target.closest(`.day-item`))return;this.committedSelection=!0,(this.app.workspace.getLeavesOfType(`thino_view`)[0]?.view)?.contentEl.find(`.action-btn.list-or-task.list`)?.click();let n=``,r=``;switch(this.plugin.settings.InsertDateFormat){case`Dataview`:n=`[due:: `,r=`]`;break;case`Tasks`:n=`📅 `;break}if(!this.editor||!this.cursor)return;let i=this.editor,a=this.cursor;i.replaceRange(n+(0,f.moment)(e).format(`YYYY-MM-DD`)+r,{line:a.line,ch:a.ch-1},a),this.close()}onClose(){!this.committedSelection&&this.cursor?this.suppressCursor={...this.cursor}:this.suppressCursor=null,this.committedSelection=!1,this.root?.unmount(),this.root=null,this.cursor=null,this.editor=null}isSamePosition(e,t){return e.line===t.line&&e.ch===t.ch}},XW={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 ZW(){Object.keys(XW).forEach(e=>{(0,f.addIcon)(e,XW[e])})}var QW=typeof Buffer==`function`,$W=typeof TextDecoder==`function`?new TextDecoder:void 0,eG=typeof TextEncoder==`function`?new TextEncoder:void 0,tG=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),nG=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(tG),rG=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,iG=String.fromCharCode.bind(String),aG=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),oG=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),sG=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),cG=typeof btoa==`function`?e=>btoa(e):QW?e=>Buffer.from(e,`binary`).toString(`base64`):e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=tG[t>>18&63]+tG[t>>12&63]+tG[t>>6&63]+tG[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},lG=QW?e=>Buffer.from(e).toString(`base64`):e=>{let t=4096,n=[];for(let r=0,i=e.length;r<i;r+=t)n.push(iG.apply(null,e.subarray(r,r+t)));return cG(n.join(``))},uG=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?iG(192|t>>>6)+iG(128|t&63):iG(224|t>>>12&15)+iG(128|t>>>6&63)+iG(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return iG(240|t>>>18&7)+iG(128|t>>>12&63)+iG(128|t>>>6&63)+iG(128|t&63)}},dG=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,fG=e=>e.replace(dG,uG),pG=QW?e=>Buffer.from(e,`utf8`).toString(`base64`):eG?e=>lG(eG.encode(e)):e=>cG(fG(e)),mG=(e,t=!1)=>t?oG(pG(e)):pG(e),hG=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,gG=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return iG((t>>>10)+55296)+iG((t&1023)+56320);case 3:return iG((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return iG((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},_G=e=>e.replace(hG,gG),vG=typeof atob==`function`?e=>atob(sG(e)):QW?e=>Buffer.from(e,`base64`).toString(`binary`):e=>{if(e=e.replace(/\s+/g,``),!rG.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=nG[e.charAt(a++)]<<18|nG[e.charAt(a++)]<<12|(n=nG[e.charAt(a++)])<<6|(r=nG[e.charAt(a++)]),n===64?i.push(iG(t>>16&255)):r===64?i.push(iG(t>>16&255,t>>8&255)):i.push(iG(t>>16&255,t>>8&255,t&255));return i.join(``)},yG=QW?e=>aG(Buffer.from(e,`base64`)):e=>aG(vG(e).split(``).map(e=>e.charCodeAt(0))),bG=QW?e=>Buffer.from(e,`base64`).toString(`utf8`):$W?e=>$W.decode(yG(e)):e=>_G(vG(e)),xG=e=>sG(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),SG=e=>bG(xG(e));Av(),li(),zv(),H(),M();var CG=class extends f.Modal{plugin;settingTab;LocationList;target=``;insertTarget=``;verified;_forceCustomHeading=!1;constructor(e,t,n,r,i){if(super(e),this.verified=i,this.app=e,this.settingTab=t,this.plugin=n,this.LocationList=r,r.target===`ProcessEntriesBelow`)this.target=n.settings[r.target];else if(r.target===`JournalFolder`){let e=n.settings.JournalSettings;this.target={day:e?.daily,week:e?.weekly,month:e?.monthly,year:e?.yearly}[e?.granularity||`day`]?.folder||``}else this.target=n.settings.MemoOtherSaveLocation[r.target];this.insertTarget=n.settings.InsertAfter}updateValue=(0,f.debounce)(e=>{this.LocationList.value!==`DAILY`&&this.LocationList.value!==`MULTI`?this.target=e.trim()===``?`basic`:e.trim():this.target=e.trim()===``&&this.LocationList.value===`MULTI`?`Memos`:e.trim()},400,!0);onOpen(){this.display()}debounceDisplay=(0,f.debounce)(()=>this.display(),400,!0);async display(){let{contentEl:e}=this;this.contentEl.empty(),e.parentElement?.classList.add(`memo-save-location-modal`),this.titleEl.toggleClass(`modal-title`,!0),this.titleEl.setText(j(`Save type for Thino`)+` [${j(this.LocationList.value)}]`),(this.LocationList.value===`FILE`||this.LocationList.value===`CANVAS`)&&e.createDiv(`modal-desc`,e=>{e.setText(j(`You can set folder name with file name like "folder/file"`))}),this.LocationList.value===`MULTI`&&e.createDiv(`modal-desc`,e=>{e.setText(j(`You can set folder name like "folder1/folder2/folder3" to create sub-folder`))}),this.LocationList.value===`DAILY`&&e.createDiv(`modal-desc`,e=>{e.setText(j(`You can set target heading like "# Heading" to control data location`))}),this.LocationList.value===`JOURNAL`&&e.createDiv(`modal-desc`,e=>{e.setText(j(`Journal mode saves memos into periodic note files (daily/weekly/monthly/yearly)`))});let t=e.createDiv(`modal-setting`),n=this.LocationList.value===`DAILY`?j(`Process Memos below`):this.LocationList.value===`MULTI`?j(`Set the folder name`):j(`Set the filename`);if(this.LocationList.value===`DAILY`&&(new G(t,this.settingTab).setName(j(`Set thino insert place`)).setDesc(j(`Set where to insert thino content`)).addDropdown(async e=>{e.addOption(`end`,j(`End of the diary`)),e.addOption(`custom`,j(`Custom location`)),e.setValue(this.plugin.settings.InsertType).onChange(async e=>{this.plugin.settings.InsertType=e,this.settingTab.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.InsertType===`custom`&&await this.addDailySettings(t),new G(t,this.settingTab).setName(j(`Set process target`)).setDesc(j(`You can set whole diary or only part of it`)).addDropdown(async e=>{e.addOption(`custom`,j(`Custom`)),e.addOption(`whole`,j(`Whole diary`)),e.setValue(this.plugin.settings.ProcessContentTarget).onChange(async e=>{this.plugin.settings.ProcessContentTarget=e,this.settingTab.applySettingsUpdate(),this.debounceDisplay()})})),this.LocationList.value===`JOURNAL`&&await this.addJournalSettings(t),this.LocationList.value!==`DAILY`&&this.LocationList.value!==`JOURNAL`||this.LocationList.value===`DAILY`&&this.plugin.settings.ProcessContentTarget!==`whole`){let e=new G(t,this.settingTab).setName(n).addText(e=>e.setPlaceholder(this.LocationList.value===`DAILY`?j(`# Heading`):j(`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 e=>{let t=this.LocationList.value===`CANVAS`?`.thino.canvas`:this.LocationList.value===`FILE`?`.thino.md`:``;this.updateValue(e.replace(/\.thino\.(canvas|md)/g,``)+t)}));this.LocationList.value===`DAILY`&&e.setDesc(j(`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`&&e.controlEl.createEl(`span`,{text:`${this.LocationList.value===`FILE`?`.thino.md`:`.thino.canvas`}`})}this.LocationList.value===`MULTI`&&new G(t,this.settingTab).setName(j(`Set file name after create thino`)).setDesc(j(`You can set file name after create thino. A input box will show when you create thino.`)).addToggle(e=>{e.setValue(this.plugin.settings.SetFileNameAfterCreate).onChange(async e=>{this.plugin.settings.SetFileNameAfterCreate=e,this.settingTab.debounceApplySettingsUpdate()})}),this.LocationList.value===`FILE`&&new G(t,this.settingTab).setName(j(`Set tag for file type file`)).setDesc(j("When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.")).addText(e=>{new ox(e.inputEl,e=>{this.plugin.settings.TagForFileTypeFiles=e.trim(),this.settingTab.debounceApplySettingsUpdate()}),e.setPlaceholder(j(`Please input the tag`)).setValue(this.plugin.settings.TagForFileTypeFiles).onChange(async e=>{this.plugin.settings.TagForFileTypeFiles=e.trim(),this.settingTab.debounceApplySettingsUpdate(),console.log(this.plugin.settings)})}),this.LocationList.value===`MULTI`&&(new G(t,this.settingTab).setName(j(`Set tag for multi type file`)).setDesc(j("When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.")).addText(e=>{new ox(e.inputEl,e=>{this.plugin.settings.TagForMultiTypeFiles=e.trim(),this.settingTab.debounceApplySettingsUpdate()}),e.setPlaceholder(j(`Please input the tag`)).setValue(this.plugin.settings.TagForMultiTypeFiles).onChange(async e=>{this.plugin.settings.TagForMultiTypeFiles=e.trim(),this.settingTab.debounceApplySettingsUpdate()})}),new G(t,this.settingTab).setName(j(`Ignore folders for multi type`)).setDesc(j(`Set folders to ignore when using multi type. Separate multiple folders with comma (,).`)).addText(e=>{e.setPlaceholder(j(`folder1,folder2/subfolder`)).setValue(this.plugin.settings.IgnoreFolderForMultiType.join(`,`)).onChange(async e=>{this.plugin.settings.IgnoreFolderForMultiType=e.split(`,`).map(e=>e.trim()).filter(e=>e!==``),this.settingTab.debounceApplySettingsUpdate()})}));let r=e.createDiv(`button-group`),i=r.createEl(`button`,{text:j(`Cancel`)}),a=r.createEl(`button`,{text:j(`Save`)});a.onclick=async()=>{if(!this.verified&&this.LocationList.value!==`DAILY`&&this.LocationList.value!==`JOURNAL`){this.close(),kv();return}this.LocationList.target===`JournalFolder`||(this.LocationList.target===`ProcessEntriesBelow`?this.plugin.settings[this.LocationList.target]=this.target:this.plugin.settings.MemoOtherSaveLocation={...this.plugin.settings.MemoOtherSaveLocation,[this.LocationList.target]:this.target}),this.LocationList.value===`MULTI`&&N.checkDailyInMulti(this.plugin.settings),this.LocationList.target===`ProcessEntriesBelow`&&(this.plugin.settings.InsertAfter=this.insertTarget),this.settingTab.applySettingsUpdate(),setTimeout(()=>{V.updateTypeMemos(this.LocationList.value)},1e3),this.close()},i.onclick=async()=>{this.close()}}async addDailySettings(e){let t=L.getState().verifyState,n=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),r=f.Platform.isDesktop?await Pv():n.identifier||n.uuid,i=t&&t?.appId===r,a=(this.plugin.settings?.DifferentInsertTarget?`[${j(`List`)}] `:``)+j(`Insert after heading`);new G(e,this.settingTab).setName(a).setDesc(j(`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(e=>e.setPlaceholder(j(`# Heading`)).setValue(this.insertTarget).onChange(async e=>{this.insertTarget=e})),this.plugin.settings?.DifferentInsertTarget&&new G(e,this.settingTab).setName((this.plugin.settings?.DifferentInsertTarget?`[${j(`Task`)}] `:``)+j(`Insert after heading`)).setDesc(j(`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(e=>{e.setPlaceholder(j(`# Heading`)).setValue(this.plugin.settings.InsertAfterForTask).onChange(async e=>{this.plugin.settings.InsertAfterForTask=e,this.settingTab.applySettingsUpdate()})}),new G(e,this.settingTab).setName(j(`Different insert target for different type`)).setDesc(j(`Toggle this to set different insert target for different type of thino, like task or list type of thino`)).addToggle(e=>e.setValue(this.plugin.settings.DifferentInsertTarget).onChange(async e=>{if(!i){kv();return}this.plugin.settings.DifferentInsertTarget=e,this.settingTab.applySettingsUpdate(),this.debounceDisplay()}))}updateJournalSettings(e){let t=JSON.parse(JSON.stringify(this.plugin.settings.JournalSettings));e(t),this.plugin.settings={...this.plugin.settings,JournalSettings:t}}async addJournalSettings(e){let t=this.plugin.settings.JournalSettings,n=t?.granularity||`day`;new G(e,this.settingTab).setName(j(`Journal granularity`)).setDesc(j(`Choose the period type for journal files`)).addDropdown(e=>{e.addOption(`day`,j(`Daily`)),e.addOption(`week`,j(`Weekly`)),e.addOption(`month`,j(`Monthly`)),e.addOption(`year`,j(`Yearly`)),e.setValue(n).onChange(async e=>{this.updateJournalSettings(t=>{t.granularity=e}),this.settingTab.applySettingsUpdate(),this.debounceDisplay()})});let r=[{value:`YYYY-MM-DD`,label:`2025-04-03`},{value:`YYYY-MM-DD dddd`,label:`2025-04-03 Thursday`},{value:`YYYY-MM-DD ddd`,label:`2025-04-03 Thu`},{value:`YYYY/MM/DD dddd`,label:`2025/04/03 Thursday`},{value:`MM-DD dddd`,label:`04-03 Thursday`},{value:`custom`,label:j(`Custom`)}],i=t?.headingDateFormat||`YYYY-MM-DD`,a=this._forceCustomHeading||!r.some(e=>e.value!==`custom`&&e.value===i),o=a?`custom`:i;if(new G(e,this.settingTab).setName(j(`Heading date format`)).setDesc(j(`Format for date headings in journal files`)).addDropdown(e=>{for(let t of r)e.addOption(t.value,t.label);e.setValue(o).onChange(async e=>{e===`custom`?(this._forceCustomHeading=!0,this.settingTab.applySettingsUpdate(),this.debounceDisplay()):(this._forceCustomHeading=!1,this.updateJournalSettings(t=>{t.headingDateFormat=e}),this.settingTab.applySettingsUpdate(),this.debounceDisplay())})}),a){let t=new G(e,this.settingTab).setName(j(`Custom heading format`)),n=t.descEl;n.addClass(`moment-format-sample`),t.addMomentFormat(e=>{e.setDefaultFormat(`YYYY-MM-DD`).setSampleEl(n).setValue(i).onChange(async e=>{this.updateJournalSettings(t=>{t.headingDateFormat=e.trim()||`YYYY-MM-DD`}),this.settingTab.debounceApplySettingsUpdate()})})}if(new G(e,this.settingTab).setName(j(`Use independent settings`)).setDesc(j(`When enabled, use custom folder/format/template instead of inheriting from daily notes plugin`)).addToggle(e=>{e.setValue(t?.useIndependentSettings||!1).onChange(async e=>{this.updateJournalSettings(t=>{t.useIndependentSettings=e}),this.settingTab.applySettingsUpdate(),this.debounceDisplay()})}),t?.useIndependentSettings){let r={day:{key:`daily`,label:`Daily`,defaultFormat:`YYYY-MM-DD`},week:{key:`weekly`,label:`Weekly`,defaultFormat:`gggg-[W]ww`},month:{key:`monthly`,label:`Monthly`,defaultFormat:`YYYY-MM`},year:{key:`yearly`,label:`Yearly`,defaultFormat:`YYYY`}}[n],i=t[r.key];new G(e,this.settingTab).setName(j(`Folder`)).setDesc(j(`Folder path for`)+` ${j(r.label)} `+j(`notes`)).addText(e=>{e.setPlaceholder(j(`e.g.`)+` Journal/`+r.label).setValue(i?.folder||``).onChange(async e=>{this.updateJournalSettings(t=>{t[r.key].folder=e.trim()}),this.settingTab.debounceApplySettingsUpdate()})}),new G(e,this.settingTab).setName(j(`Date format`)).setDesc(j(`Moment.js format for file names`)+` (${j(`default`)}: ${r.defaultFormat})`).addText(e=>{e.setPlaceholder(r.defaultFormat).setValue(i?.format||``).onChange(async e=>{this.updateJournalSettings(t=>{t[r.key].format=e.trim()}),this.settingTab.debounceApplySettingsUpdate()})}),new G(e,this.settingTab).setName(j(`Template`)).setDesc(j(`Template file path for new notes`)).addText(e=>{e.setPlaceholder(j(`e.g.`)+` Templates/Weekly`).setValue(i?.template||``).onChange(async e=>{this.updateJournalSettings(t=>{t[r.key].template=e.trim()}),this.settingTab.debounceApplySettingsUpdate()})})}}onClose(){let{contentEl:e}=this;e.empty()}};M();var wG=class extends f.Modal{plugin;settingTab;activeTabId=`general`;initialTabId=null;sidebarEl;modalContentEl;mobileTitleEl=null;debouncedSave;tabs=[{id:`general`,name:`General`,icon:`chef-hat`,category:`core`},{id:`thino`,name:`Thino`,icon:`Memos`,category:`core`},{id:`editor`,name:`Editor`,icon:`edit`,category:`core`},{id:`interface`,name:`Interface`,icon:`brush`,category:`appearance`},{id:`share`,name:`Share`,icon:`share-2`,category:`appearance`},{id:`tasks`,name:`Tasks`,icon:`check-square`,category:`features`},{id:`review`,name:`Review`,icon:`brain`,category:`features`},{id:`super`,name:`Super`,icon:`sparkles`,category:`features`},{id:`wechat`,name:`WeChat`,icon:`message-circle`,category:`features`},{id:`pro`,name:`Pro`,icon:`diamond`,category:`pro`},{id:`advanced`,name:`Advanced`,icon:`cog`,category:`pro`},{id:`about`,name:`About`,icon:`info`,category:`info`}];categories=[{id:`core`,name:j(`Core`)},{id:`appearance`,name:j(`Appearance`)},{id:`features`,name:j(`Features`)},{id:`pro`,name:`Pro`},{id:`info`,name:j(`Info`)}];constructor(e,t,n,r){super(e),this.plugin=t,this.settingTab=n,this.initialTabId=r??null,this.debouncedSave=(0,f.debounce)(async()=>{await this.plugin.saveSettings()},100,!0)}saveSettings(){this.debouncedSave()}onOpen(){let{contentEl:e,modalEl:t}=this;t.toggleClass(`mod-settings`,!0),t.toggleClass(`mod-sidebar-layout`,!0),t.toggleClass(`thino-settings-modal`,!0),e.empty(),e.addClass(`vertical-tabs-container`),this.mobileTitleEl=t.querySelector(`.modal-title`),f.Platform.isMobile&&(this.activeTabId=``),this.sidebarEl=e.createDiv({cls:`vertical-tab-header`}),this.modalContentEl=e.createDiv({cls:`vertical-tab-content-container`}),this.renderSidebar(),this.initializeView()}initializeView(){f.Platform.isMobile?this.initialTabId?this.openTab(this.initialTabId):this.updateMobileView():(this.activeTabId=this.initialTabId||`general`,this.renderSidebar(),this.renderContent())}onClose(){this.modalContentEl?.empty(),this.settingTab?.onModalClose()}renderSidebar(){this.sidebarEl.empty(),this.categories.forEach(e=>{let t=!!this.plugin.wechatService,n=this.tabs.filter(n=>n.category===e.id&&(n.id!==`wechat`||t));if(n.length===0)return;let r=this.sidebarEl.createDiv({cls:`vertical-tab-header-group`});r.createDiv({cls:`vertical-tab-header-group-title`,text:e.name});let i=r.createDiv({cls:`vertical-tab-header-group-items`});n.forEach(e=>{let t=i.createDiv({cls:`vertical-tab-nav-item tappable ${this.activeTabId===e.id?`is-active`:``}`});t.setAttribute(`data-tab-id`,e.id),(0,f.setIcon)(t.createDiv({cls:`vertical-tab-nav-item-icon`}),e.icon),t.createDiv({cls:`vertical-tab-nav-item-title`,text:j(e.name)}),(0,f.setIcon)(t.createDiv({cls:`vertical-tab-nav-item-chevron`}),`chevron-right`),t.addEventListener(`click`,()=>{this.openTab(e.id)})})})}openTab(e){this.activeTabId=e,this.sidebarEl.querySelectorAll(`.vertical-tab-nav-item`).forEach(t=>{t.getAttribute(`data-tab-id`)===e?t.addClass(`is-active`):t.removeClass(`is-active`)}),this.renderContent(),f.Platform.isMobile&&this.updateMobileView()}goBackToNavigation(){this.activeTabId=``,this.sidebarEl.querySelectorAll(`.vertical-tab-nav-item`).forEach(e=>{e.removeClass(`is-active`)}),this.modalContentEl.empty(),this.updateMobileView()}updateMobileView(){if(!f.Platform.isMobile)return;let e=this.activeTabId!==``;if(this.sidebarEl.toggleClass(`is-mobile-hidden`,e),this.modalContentEl.toggleClass(`is-mobile-hidden`,!e),this.mobileTitleEl)if(this.mobileTitleEl.empty(),e){let e=this.mobileTitleEl.createDiv({cls:`clickable-icon modal-setting-back-button mod-raised`});(0,f.setIcon)(e,`arrow-left`),e.addEventListener(`click`,()=>{this.goBackToNavigation()});let t=this.tabs.find(e=>e.id===this.activeTabId);this.mobileTitleEl.createSpan({text:t?j(t.name):`Thino`})}else this.mobileTitleEl.createSpan({text:`Thino`})}renderContent(){this.modalContentEl.empty();let e=this.tabs.find(e=>e.id===this.activeTabId);if(!e)return;let t=this.modalContentEl.createDiv({cls:`vertical-tab-content`}).createDiv({cls:`vertical-tab-content-body memos-settings`});this.settingTab.renderTabInModal(e.id,t)}},TG={tokenExpiresAt:0,userInfo:null},EG={accessToken:`pkmer-oauth-access-token`,refreshToken:`pkmer-oauth-refresh-token`,aiToken:`pkmer-oauth-ai-token`},DG={authorizationUrl:`https://api.pkmer.cn/api/v1/oauth/authorize`,tokenUrl:`https://api.pkmer.cn/api/v1/oauth/token`,userinfoUrl:`https://api.pkmer.cn/api/v1/oauth/userinfo`,clientId:`pkmer_832ebb0ff9264f7b3019262b47f625ed`,scopes:`openid profile email ai:token thino`,desktopRedirectUri:`http://localhost:10889/thino/callback`,mobileRedirectUri:`obsidian://thino`,callbackPort:10889};M(),h_(),H();var OG=class{constructor(e){this.props=e}display(){this.renderUserInfo(),this.renderSyncService()}renderUserInfo(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setHeading().setName(`👤 `+j(`User info`)).setTab(r),new G(e,t).setName(j(`User name`)).setDesc(j(`Set your user name here. 'Memos 😏' By default`)).setTab(r).addText(e=>e.setPlaceholder(`THINO 😉`).setValue(n.settings.UserName).onChange(async e=>{n.settings.UserName=e,t.applySettingsUpdate()})),new G(e,t).setTab(r).setName(j(`User icon`)).setDesc(j(`Set user icon for thino. You can input http/https link or file path in vault.`)).addText(e=>{new vE(e.inputEl),e.setPlaceholder(`URL`).setValue(n.settings.MomentsIcon).onChange(async e=>{n.settings.MomentsIcon=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(j(`User quote`)).setDesc(j(`Set user quote for thino`)).addText(e=>e.setPlaceholder(`Input anything here`).setValue(n.settings.MomentsQuote).onChange(async e=>{n.settings.MomentsQuote=e,t.applySettingsUpdate()}))}renderSyncService(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;if(!m_())return;let i=!1,a=document.createDocumentFragment();a.createEl(`span`,{text:j(`Connect to PKMer Sync, you can check it in `)});let o=m_()?`https://pkmer.cn/products/UserProfile/#tab-21&activateSync`:`https://thino.pkmer.net/en/`;a.createEl(`a`,{text:j(`PKMer Sync`),attr:{href:o}}),new G(e,t).setHeading().setName(`☁ `+j(`Sync service`)).setTab(r),new G(e,t).setName(j(`Sync Thino via PKMer`)).setDesc(a).setTab(r).addButton(e=>{let r=n.app?.loadLocalStorage(`tokenForSync`);e.setButtonText(j(r?`Unlink`:`Link`)).onClick(async()=>{if(!r){m_()?window.open(`https://pkmer.cn/products/UserProfile/#tab-21&activateSync`,`_blank`):window.open(`https://thino.pkmer.net/en/`,`_blank`);return}if(!i){e.setButtonText(j(`Confirm?`)),i=!0;return}i=!1,r&&(n.app?.saveLocalStorage(`tokenForSync`,``),new f.Notice(j(`Remove successfully`))),R.setRefresh(!0),setTimeout(()=>{t.display()},20)})}),this.showSyncStatus()}showSyncStatus(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;n.app?.loadLocalStorage(`tokenForSync`)&&(new G(e,t).setName(j(`Save thino type when sync local`)).setDesc(j(`Set the default save thino type when sync local, FILE by default.`)).setTab(r).addDropdown(async e=>{e.addOption(`DAILY`,j(`DAILY`)),e.addOption(`FILE`,j(`FILE`)),e.addOption(`JOURNAL`,j(`JOURNAL`)),e.setValue(n.settings.saveThinoType).onChange(async e=>{n.settings.saveThinoType=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Sync Status`)).setDesc(j(`Start or stop sync`)).setTab(r).addButton(e=>{e.setButtonText(n.settings.startSync?j(`Stop`):j(`Start`)).onClick(async()=>{n.settings.startSync=!n.settings.startSync,await n.saveSettings(),R.setRefresh(!0),new f.Notice(n.settings.startSync?j(`Start sync successfully`):j(`Stop sync successfully`)),setTimeout(()=>{t.display()},200)})}),new G(e,t).setName(j(`Sync manually`)).setTab(r).addToggle(e=>{e.setValue(n.settings.SyncManually).onChange(async e=>{n.settings.SyncManually=e,t.applySettingsUpdate()})}))}};M(),$r(),Yg();var kG=class{constructor(e){this.props=e}async display(){await this.renderDailyNotes(),this.renderFixedStrings(),await this.renderFileNameSettings(),this.renderViewArchiveSettings()}async renderDailyNotes(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props,i;new G(e,t).setHeading().setTab(r).setName(`📅 `+j(`Daily notes`)),new G(e,t).setName(j(`Default prefix when save thino`)).setDesc(j(`Set the default prefix when create memo, 'List' by default.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`List`,j(`List`)),i.addOption(`Task`,j(`Task`)),i.setValue(n.settings.DefaultPrefix).onChange(async e=>{n.settings.DefaultPrefix=e,t.applySettingsUpdate()})}),n.settings.EnabledLocationList.some(e=>e.value===`DAILY`)&&new G(e,t).setName(j(`Default time prefix for thino in daily notes`)).setDesc(j(`Set default time prefix for thino in daily notes.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`HH:mm`,`HH:mm`),i.addOption(`HH:mm:ss`,`HH:mm:ss`),i.setValue(n.settings.DefaultTimePrefix).onChange(async e=>{n.settings.DefaultTimePrefix=e,t.applySettingsUpdate()})})}renderFixedStrings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setHeading().setTab(r).setName(`🔗 `+j(`Fixed strings for thinos`)),new G(e,t).setName(j(`Use fixed strings for thinos`)).setDesc(j(`Enable to add fixed strings at the beginning or end of thinos.`)).setTab(r).addToggle(e=>e.setValue(n.settings.UseMemoFixedStrings).onChange(async e=>{n.settings.UseMemoFixedStrings=e,t.applySettingsUpdate(),setTimeout(()=>{t.display()},200)})),n.settings.UseMemoFixedStrings&&(new G(e,t).setName(j(`Fixed prefix for thinos`)).setDesc(j(`Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`)).setTab(r).addText(e=>e.setValue(n.settings.MemoFixedPrefix).onChange(async e=>{n.settings.MemoFixedPrefix=e,t.applySettingsUpdate()})),new G(e,t).setName(j(`Fixed suffix for thinos`)).setDesc(j(`Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`)).setTab(r).addText(e=>e.setValue(n.settings.MemoFixedSuffix).onChange(async e=>{n.settings.MemoFixedSuffix=e,t.applySettingsUpdate()})))}async renderFileNameSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props,a=[{value:`DAILY`,target:`ProcessEntriesBelow`,insert:`InsertAfter`},{value:`CANVAS`,target:`MemoDefaultCanvasPath`},{value:`MULTI`,target:`MemoDefaultMultiFilePath`},{value:`FILE`,target:`MemoDefaultSingleFilePath`},{value:`JOURNAL`,target:`JournalFolder`}],o=document.createDocumentFragment(),s=o.createEl(`div`,{cls:`memo-save-location-desc`});for(let e of a){let r=s.createEl(`div`,{cls:`memo-save-location-desc-item ${e.value}`});(0,f.setIcon)(r.createEl(`span`,{cls:`memo-save-location-desc-item-icon`}),Qr.find(t=>t.title===e.value)?.icon||``);let a=e.value===`DAILY`?`${j(e.value)} (Deprecated)`:`${j(e.value)}`;r.createEl(`span`,{cls:`memo-save-location-desc-item-desc`,text:a});let o=r.createEl(`span`,{cls:`memo-save-location-desc-item-toggle`}),c=r.createEl(`span`,{cls:`memo-save-location-desc-item-setting`}),l=e.value===`DAILY`||e.value===`JOURNAL`;l||r.createEl(`span`,{cls:[`memo-save-location-desc-item-pro`,`user-pro-badge`],text:`PRO`}),new f.ToggleComponent(o).setValue(this.checkInList(e.value)).onChange(async r=>{if(!i&&!l){new f.Notice(j(`Pro feature, please activate Pro`));return}r?await V.updateTypeMemos(e.value):await V.removeTypeMemos(e.value);let a=r?[...n.settings.EnabledLocationList.filter(t=>t.value!==e.value),e]:n.settings.EnabledLocationList.filter(t=>t.value!==e.value);n.settings.EnabledLocationList=a,a.length===1?n.settings.MemoSaveLocation=a[0].value:r?n.settings.MemoSaveLocation=e.value:a.some(e=>e.value===n.settings.MemoSaveLocation)||(n.settings.MemoSaveLocation=a[0]?.value||`DAILY`),t.applySettingsUpdate(),setTimeout(()=>{t.display()},500)}).setDisabled(n.settings.EnabledLocationList.length===1&&this.checkInList(e.value)),new f.ExtraButtonComponent(c).setIcon(`settings`).onClick(()=>{new CG(t.app,t,n,e,i).open()})}let c=new G(e,t).setName(j(`Save type for Thino`)).setDesc(o).setTab(r);c.settingEl.toggleClass(`memo-save-location-setting`,!0),c.nameEl.toggleClass(`memo-save-location-title`,!0)}renderViewArchiveSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(j(`View archive in random review`)).setDesc(j(`View archived thinos in random review. True by default`)).setTab(r).addToggle(e=>{e.setValue(n.settings.ViewArchiveInRandomReview).onChange(async e=>{n.settings.ViewArchiveInRandomReview=e,t.applySettingsUpdate()})})}checkInList(e){return this.props.plugin.settings.EnabledLocationList.find(t=>t.value===e)!==void 0}};M(),Av();var AG=class{constructor(e){this.props=e}async display(){await this.renderThemeSettings(),this.renderInterfaceDetails(),this.renderHeightSettings(),await this.renderEditorLocation()}async renderThemeSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;new G(e,t).setName(j(`Theme for Thino`)).setDesc(j(`Set the theme for Thino`)).setTab(r).addDropdown(async e=>{e.addOption(`modern`,`Modern`),e.addOption(`classic`,`Classic`),e.addOption(`focus`,`Focus (Pro)`),e.setValue(n.settings.DefaultThemeForThino).onChange(async r=>{if(r===`focus`&&!i){kv(),e.setValue(n.settings.DefaultThemeForThino);return}n.settings.DefaultThemeForThino=r,t.applySettingsUpdate()})})}renderInterfaceDetails(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setTab(r).setHeading().setName(`🎨 `+j(`Interface Details`));let i;new G(e,t).setName(j(`Heatmap Color Scheme`)).setDesc(j(`Set different color scheme for heatmap.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`default`,j(`Default`)),i.addOption(`gray`,j(`Gray`)),i.addOption(`grass`,j(`Grass`)),i.addOption(`flame`,j(`Flame`)),i.addOption(`olive`,j(`Olive`)),i.addOption(`ice`,j(`Ice`)),i.addOption(`magenta`,j(`Magenta`)),i.setValue(n.settings.HeatmapColorScheme).onChange(async e=>{n.settings.HeatmapColorScheme=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Save Memo button label`)).setDesc(j(`The text shown on the save Memo button in the UI. 'NOTEIT' by default.`)).setTab(r).addText(e=>e.setPlaceholder(q6.SaveMemoButtonLabel).setValue(n.settings.SaveMemoButtonLabel).onChange(async e=>{n.settings.SaveMemoButtonLabel=e,t.applySettingsUpdate()})),!f.Platform.isMobile&&new G(e,t).setName(j(`Always Show Leaf Sidebar on PC`)).setDesc(j(`Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.ShowLeftSideBar).onChange(async e=>{n.settings.ShowLeftSideBar=e,t.applySettingsUpdate()})),this.renderUseMobileViewDefaultHeader(),this.renderRememberImageSettings(),this.renderScrollToTopSettings()}renderUseMobileViewDefaultHeader(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(j(`Use default header in mobile view`)).setDesc(j(`Use default header in mobile view of thino rather than custom header.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.useMobileViewDefaultHeader).onChange(async e=>{n.settings.useMobileViewDefaultHeader=e,t.applySettingsUpdate()})})}renderRememberImageSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(j(`Zoom image by default`)).setDesc(j(`Zoom image by default when viewing image.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.ZoomImageWhenViewing).onChange(async e=>{n.settings.ZoomImageWhenViewing=e,t.applySettingsUpdate()})})}renderScrollToTopSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(j(`Show scroll to top button`)).setDesc(j(`Show scroll to top button. True by default`)).setTab(r).addToggle(e=>{e.setValue(n.settings.ShowScrollToTopButton).onChange(async e=>{n.settings.ShowScrollToTopButton=e,t.applySettingsUpdate()})})}renderHeightSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(j(`Max height for collapse`)).setDesc(j(`The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)`)).setTab(r).addText(e=>e.setPlaceholder(q6.ThinoMaxHeight.toString()).setValue(n.settings.ThinoMaxHeight.toString()).onChange(async e=>{if(Number(e)<80&&Number(e)!==0){new f.Notice(j(`The value should be greater than`)+`80`);return}n.settings.ThinoMaxHeight=Number(e),t.debounceApplySettingsUpdate()})),new G(e,t).setName(j(`Thino height when collapsed`)).setDesc(j(`The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)`)).setTab(r).addText(e=>e.setPlaceholder(q6.ThinoCollapsedHeight.toString()).setValue(n.settings.ThinoCollapsedHeight.toString()).onChange(async e=>{if(Number(e)<40&&Number(e)!==0){new f.Notice(j(`The value should be greater than`)+`40`);return}n.settings.ThinoCollapsedHeight=Number(e),t.debounceApplySettingsUpdate()}))}async renderEditorLocation(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props,i;f.Platform.isMobile&&n.settings.DefaultThemeForThino!==`focus`&&(new G(e,t).setName(j(`Default editor position on mobile`)).setDesc(j(`Set the default editor position on Mobile, 'Top' by default.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`Top`,j(`Top`)),i.addOption(`Bottom`,j(`Bottom`)),i.setValue(n.settings.DefaultEditorLocation).onChange(async e=>{n.settings.DefaultEditorLocation=e,t.applySettingsUpdate(),setTimeout(()=>{t.display()},200)})}),n.settings.DefaultEditorLocation!==`Top`&&new G(e,t).setName(j(`Use button to show editor on mobile`)).setDesc(j(`Set a float button to call editor on mobile. Only when editor located at the bottom works.`)).setTab(r).addToggle(e=>e.setValue(n.settings.UseButtonToShowEditor).onChange(async e=>{n.settings.UseButtonToShowEditor=e,t.applySettingsUpdate()})))}};M();var jG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setHeading().setTab(r).setName(`📝 `+j(`Editor`)),new G(e,t).setName(j(`Use Tags In Vault`)).setDesc(j(`Use tags in vault rather than only in Memos. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.UseVaultTags).onChange(async e=>{n.settings.UseVaultTags=e,t.applySettingsUpdate()}));let i;new G(e,t).setName(j(`Default insert date format`)).setDesc(j(`Set the default date format when insert date by @, 'Tasks' by default.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`Tasks`,`Tasks`),i.addOption(`Dataview`,`Dataview`),i.setValue(n.settings.InsertDateFormat).onChange(async e=>{n.settings.InsertDateFormat=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Focus on editor when open`)).setDesc(j(`Focus on editor when open. True by default.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.FocusOnEditor).onChange(async e=>{n.settings.FocusOnEditor=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Show clipboard paste button on focus`)).setDesc(j(`When focusing on the editor, detect clipboard content and show a "Paste as Thino" button. True by default.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.ShowClipboardOnFocus).onChange(async e=>{n.settings.ShowClipboardOnFocus=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Default Editor Mode`)).setDesc(j(`Live-Preview Mode OR Source Mode.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`obsidian`,j(`Live-preview`)),i.addOption(`memos`,j(`Source`)),i.setValue(n.settings.EditorType).onChange(async e=>{n.settings.EditorType=e,t.applySettingsUpdate()})})}};M();var MG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(j(`Show Tasks Label`)).setDesc(j(`Show tasks label near the time text. False by default`)).setTab(r).addToggle(e=>e.setValue(n.settings.ShowTaskLabel).onChange(async e=>{n.settings.ShowTaskLabel=e,t.applySettingsUpdate()})),new G(e,t).setName(j(`Append completed date when task done in thino`)).setDesc(j(`Append completed date when task done in thino. False by default`)).setTab(r).addToggle(e=>e.setValue(n.settings.AppendDateWhenTaskDone).onChange(async e=>{n.settings.AppendDateWhenTaskDone=e,t.applySettingsUpdate()}))}};M(),Av();var NG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,tabName:n}=this.props;new G(e,t).setHeading().setTab(n).setName(`📄 `+j(`Copy filtered results`)),this.renderCopyMemosSettings(),new G(e,t).setHeading().setTab(n).setName(`🖼 `+j(`Share image`)),this.renderShareMemosSettings(),f.Platform.isMobile&&this.renderShareToThinosSettings()}renderCopyMemosSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setTab(r).setName(j(`Show Time When Copy Results`)).setDesc(j(`Show time when you copy results, like 12:00. Copy time by default.`)).addToggle(e=>e.setValue(n.settings.ShowTime).onChange(async e=>{n.settings.ShowTime=e,t.applySettingsUpdate()})),new G(e,t).setTab(r).setName(j(`Show Date When Copy Results`)).setDesc(j(`Show date when you copy results, like [[2022-01-01]]. Copy date by default.`)).addToggle(e=>e.setValue(n.settings.ShowDate).onChange(async e=>{n.settings.ShowDate=e,t.applySettingsUpdate(),t.debounceDisplay()})),n.settings.ShowDate&&new G(e,t).setTab(r).setName(j(`Add Blank Line Between Different Date`)).setDesc(j(`Add blank line when copy result with date. No blank line by default.`)).addToggle(e=>e.setValue(n.settings.AddBlankLineWhenDate).onChange(async e=>{n.settings.AddBlankLineWhenDate=e,t.applySettingsUpdate()}))}renderShareMemosSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setTab(r).setName(j(`Custom height for Thino content`)).setDesc(j(`Set custom height for Thino content. Like 200px or 20rem`)).addText(e=>e.setPlaceholder(j(`Input height`)).setValue(n.settings.MinHeightForShare).onChange(async e=>{n.settings.MinHeightForShare=e,t.debounceApplySettingsUpdate()})),this.renderCustomMemoFooter(),new G(e,t).setName(j(`Custom Background Image`)).setDesc(j(`Set custom background image.`)).setTab(r).addToggle(e=>e.setValue(n.settings.SetCustomBackgroundImage).onChange(async e=>{n.settings.SetCustomBackgroundImage=e,t.applySettingsUpdate(),setTimeout(()=>{t.display()},100)})),n.settings.SetCustomBackgroundImage&&(new G(e,t).setName(j(`Background Image in Light Theme`)+` [${j(`Modern`)}]`).setDesc(j(`Set background image in light theme. Set something like "Daily/one.png"`)).setTab(r).addText(e=>{new vE(e.inputEl),e.setPlaceholder(q6.DefaultLightBackgroundImage).setValue(n.settings.DefaultLightBackgroundImage).onChange(async e=>{n.settings.DefaultLightBackgroundImage=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Background Image in Dark Theme`)+` [${j(`Modern`)}]`).setDesc(j(`Set background image in dark theme. Set something like "Daily/one.png"`)).setTab(r).addText(e=>{new vE(e.inputEl),e.setPlaceholder(q6.DefaultDarkBackgroundImage).setValue(n.settings.DefaultDarkBackgroundImage).onChange(async e=>{n.settings.DefaultDarkBackgroundImage=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Background Image in Light Theme`)+` [${j(`Clean`)}]`).setDesc(j(`Set background image in light theme. Set something like "Daily/one.png"`)).setTab(r).addText(e=>{new vE(e.inputEl),e.setPlaceholder(q6.DefaultLightBackgroundImageForClean).setValue(n.settings.DefaultLightBackgroundImageForClean).onChange(async e=>{n.settings.DefaultLightBackgroundImageForClean=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Background Image in Dark Theme`)+` [${j(`Clean`)}]`).setDesc(j(`Set background image in dark theme. Set something like "Daily/one.png"`)).setTab(r).addText(e=>{new vE(e.inputEl),e.setPlaceholder(q6.DefaultDarkBackgroundImageForClean).setValue(n.settings.DefaultDarkBackgroundImageForClean).onChange(async e=>{n.settings.DefaultDarkBackgroundImageForClean=e,t.applySettingsUpdate()})}))}renderCustomMemoFooter(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(j(`Custom Memo Footer`)).setDesc(j(`Set custom memo footer.`)).setTab(r).addToggle(e=>e.setValue(n.settings.SetCustomMemoFooter).onChange(async e=>{n.settings.SetCustomMemoFooter=e,t.applySettingsUpdate(),setTimeout(()=>{t.display()},100)})),n.settings.SetCustomMemoFooter&&new G(e,t).setName(j(`Share Memos Image Footer Start`)).setDesc(j(`Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default`)).setTab(r).addText(e=>e.setPlaceholder(q6.ShareFooterStart).setValue(n.settings.ShareFooterStart).onChange(async e=>{n.settings.ShareFooterStart=e,t.applySettingsUpdate()}))}renderShareToThinosSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;new G(e,t).setHeading().setTab(r).setName(`💎 `+j(`Pro features`)),new G(e,t).setTab(r).setName(j(`Append/prepend text when share to Thino`)).addToggle(e=>{e.setValue(n.settings.ShareToThinoWithText).onChange(async e=>{if(!i){kv();return}n.settings.ShareToThinoWithText=e,t.applySettingsUpdate(),t.debounceDisplay()})}),n.settings.ShareToThinoWithText&&(new G(e,t).setTab(r).setName(j(`Prepend Text Action`)).addDropdown(e=>{e.addOption(`none`,j(`None`)),e.addOption(`preset`,j(`Preset`)),e.addOption(`input`,j(`Input`)),e.addOption(`selectTags`,j(`Select Tags`)),e.setValue(n.settings.SharePrependType).onChange(async e=>{n.settings.SharePrependType=e,t.applySettingsUpdate(),t.debounceDisplay()})}),n.settings.SharePrependType===`preset`&&new G(e,t).setTab(r).setName(j(`Prepend text when share to Thino`)).addText(e=>{e.setPlaceholder(j(`Input anything here`)).setValue(n.settings.ShareToThinoWithTextPrepend).onChange(async e=>{n.settings.ShareToThinoWithTextPrepend=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(j(`Append Text Action`)).addDropdown(e=>{e.addOption(`none`,j(`None`)),e.addOption(`preset`,j(`Preset`)),e.addOption(`input`,j(`Input`)),e.addOption(`selectTags`,j(`Select Tags`)),e.setValue(n.settings.ShareAppendType).onChange(async e=>{n.settings.ShareAppendType=e,t.applySettingsUpdate(),t.debounceDisplay()})}),n.settings.ShareAppendType===`preset`&&new G(e,t).setTab(r).setName(j(`Append text when share to Thino`)).addText(e=>{e.setPlaceholder(j(`Input anything here`)).setValue(n.settings.ShareToThinoWithTextAppend).onChange(async e=>{n.settings.ShareToThinoWithTextAppend=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(j(`Add newline when append/prepend text`)).addDropdown(async e=>{e.addOption(`prepend`,j(`Prepend`)),e.addOption(`append`,j(`Append`)),e.addOption(`both`,j(`Both`)),e.addOption(`none`,j(`None`)),e.setValue(n.settings.ShareToThinoWithTextNewline).onChange(async e=>{n.settings.ShareToThinoWithTextNewline=e,t.applySettingsUpdate()})}))}};M();var PG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setTab(r).setName(j(`About`)+` Thino`).setHeading(),new G(e,t).setTab(r).setName(j(`Version`)).setDesc(`Thino v${n.manifest.version}`),new G(e,t).setTab(r).setName(j(`Documentation`)).setDesc(j(`View the documentation for this plugin`)).addButton(e=>{e.setButtonText(j(`Open Documentation`)).onClick(()=>{window.open(`https://github.com/quorafind/obsidian-thino/`)})}),new G(e,t).setTab(r).setName(j(`Change log`)).setDesc(j(`View the change log for this plugin`)).addButton(e=>{e.setButtonText(j(`Open change log`)).onClick(()=>{__(t.app)})}),this.renderUpdateMessageSettings()}renderUpdateMessageSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(j(`Show release notes`)).setDesc(j(`Show release notes when Thino is updated. True by default`)).setTab(r).addToggle(e=>e.setValue(n.settings.ShowUpdateMessage).onChange(async e=>{n.settings.ShowUpdateMessage=e,t.applySettingsUpdate()}))}};pU(),EU(),M();var FG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props,i=aU();new G(e,t).setHeading().setName(j(`FSRS Algorithm`)).setTab(r),new G(e,t).setName(j(`Request retention`)).setDesc(j(`Target probability of recall (0.7-0.99). Higher = more reviews, better retention.`)).setTab(r).addText(e=>{e.setPlaceholder(String(i.request_retention)).setValue(String(n.settings.fsrsRequestRetention)),e.inputEl.type=`number`,e.inputEl.step=`0.01`,e.inputEl.min=`0.7`,e.inputEl.max=`0.99`,e.inputEl.addEventListener(`blur`,()=>{let r=parseFloat(e.inputEl.value);!isNaN(r)&&r>=.7&&r<=.99?(n.settings.fsrsRequestRetention=r,t.applySettingsUpdate(),this.rebuildFSRS()):e.setValue(String(n.settings.fsrsRequestRetention))})}),new G(e,t).setName(j(`Maximum interval (days)`)).setDesc(j(`The maximum number of days between reviews. Default: 36500 (100 years).`)).setTab(r).addText(e=>{e.setPlaceholder(String(i.maximum_interval)).setValue(String(n.settings.fsrsMaximumInterval)),e.inputEl.type=`number`,e.inputEl.min=`1`,e.inputEl.max=`36500`,e.inputEl.addEventListener(`blur`,()=>{let r=parseInt(e.inputEl.value);!isNaN(r)&&r>=1&&r<=36500?(n.settings.fsrsMaximumInterval=r,t.applySettingsUpdate(),this.rebuildFSRS()):e.setValue(String(n.settings.fsrsMaximumInterval))})}),new G(e,t).setName(j(`Enable fuzz`)).setDesc(j(`Add small random variation to review intervals to prevent clustering.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.fsrsEnableFuzz).onChange(async e=>{n.settings.fsrsEnableFuzz=e,t.applySettingsUpdate(),this.rebuildFSRS()})}),new G(e,t).setName(j(`Enable short-term scheduling`)).setDesc(j(`Use (re)learning steps for short-term review intervals.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.fsrsEnableShortTerm).onChange(async e=>{n.settings.fsrsEnableShortTerm=e,t.applySettingsUpdate(),this.rebuildFSRS()})}),new G(e,t).setHeading().setName(j(`Review Limits`)).setTab(r),new G(e,t).setName(j(`Daily review limit`)).setDesc(j(`Maximum number of cards to review per day. Default: 100.`)).setTab(r).addText(e=>{e.setPlaceholder(`100`).setValue(String(n.settings.fsrsDailyLimit)),e.inputEl.type=`number`,e.inputEl.min=`1`,e.inputEl.max=`9999`,e.inputEl.addEventListener(`blur`,()=>{let r=parseInt(e.inputEl.value);!isNaN(r)&&r>=1?(n.settings.fsrsDailyLimit=r,t.applySettingsUpdate()):e.setValue(String(n.settings.fsrsDailyLimit))})}),new G(e,t).setHeading().setName(j(`Model Weights`)).setTab(r),new G(e,t).setName(j(`FSRS weights (w)`)).setDesc(j(`Custom FSRS-6 model weights (21 numbers, comma-separated). Leave empty to use defaults.`)).setTab(r).addText(e=>{let r=n.settings.fsrsWeights;e.setPlaceholder(j(`Default FSRS-6 weights`)).setValue(r.length>0?r.join(`, `):``),e.inputEl.style.width=`100%`,e.inputEl.addEventListener(`blur`,()=>{let i=e.inputEl.value.trim();if(!i){n.settings.fsrsWeights=[],t.applySettingsUpdate(),this.rebuildFSRS();return}let a=i.split(`,`).map(e=>parseFloat(e.trim()));a.length===21&&a.every(e=>!isNaN(e))?(n.settings.fsrsWeights=a,t.applySettingsUpdate(),this.rebuildFSRS()):(new f.Notice(j(`Weights must be exactly 21 comma-separated numbers`)),e.setValue(r.length>0?r.join(`, `):``))})}),new G(e,t).setName(j(`Reset to defaults`)).setDesc(j(`Reset all FSRS parameters to their default values`)).setTab(r).addButton(e=>{e.setButtonText(j(`Reset`)).onClick(async()=>{n.settings.fsrsRequestRetention=i.request_retention,n.settings.fsrsMaximumInterval=i.maximum_interval,n.settings.fsrsEnableFuzz=i.enable_fuzz,n.settings.fsrsEnableShortTerm=i.enable_short_term,n.settings.fsrsWeights=[],n.settings.fsrsDailyLimit=100,t.applySettingsUpdate(),this.rebuildFSRS(),t.debounceDisplay()})})}rebuildFSRS(){let{plugin:e}=this.props,t={request_retention:e.settings.fsrsRequestRetention,maximum_interval:e.settings.fsrsMaximumInterval,enable_fuzz:e.settings.fsrsEnableFuzz,enable_short_term:e.settings.fsrsEnableShortTerm};e.settings.fsrsWeights.length===21&&(t.w=e.settings.fsrsWeights),_U(t)}};K_(),M(),Av(),Rg(),h_();var IG=class{constructor(e){this.props=e}async display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props,a=B.getState();if(new G(e,t).setName(j(`Enable Super`)).setDesc(j(`AI-powered semantic search and chat for your thinos`)).setTab(r).addToggle(e=>e.setValue(n.settings.superEnabled).onChange(async r=>{if(r&&!i){kv(),e.setValue(!1);return}n.settings.superEnabled=r,B.getState().setEnabled(r),await n.saveSettings(),t.debounceDisplay()})),n.settings.superEnabled){if(new G(e,t).setHeading().setName(j(`Embedding`)).setTab(r),new G(e,t).setName(j(`Embedding provider`)).setTab(r).addDropdown(e=>{f.Platform.isDesktop&&e.addOption(`local`,`Local (Transformers.js)`),e.addOption(`openai`,`OpenAI`),e.setValue(a.activeEmbeddingProvider).onChange(e=>{B.getState().setActiveEmbeddingProvider(e)})}),a.activeEmbeddingProvider===`local`){new G(e,t).setName(j(`Embedding model`)).setDesc(j(`HuggingFace model name for local embeddings`)).setTab(r).addText(e=>e.setPlaceholder(`Xenova/paraphrase-multilingual-MiniLM-L12-v2`).setValue(a.embeddingModel).onChange(e=>{B.getState().setEmbeddingModel(e)}));let n=`https://huggingface.co/${a.embeddingModel||`Xenova/paraphrase-multilingual-MiniLM-L12-v2`}/tree/main`,i=a.modelReady,o=new G(e,t).setName(j(`Import embedding model`)).setTab(r).addButton(e=>{e.setButtonText(j(`Select folder`)).onClick(async()=>{let n=await this.selectLocalModelFolder();if(n)try{e.setDisabled(!0),e.setButtonText(j(`Importing...`));let r=await fv.importLocalModel(n);r.missing.length===0?new f.Notice(j(`Successfully imported model files`)+` (${r.imported.length} files)`):new f.Notice(j(`Missing model files`)+`: ${r.missing.join(`, `)}`),t.debounceDisplay()}catch(e){new f.Notice(j(`Import failed`)+`: ${e?.message||`Unknown error`}`)}finally{e.setDisabled(!1),e.setButtonText(j(`Select folder`))}})}).descEl;o.empty(),o.createSpan({text:i?`✅ `+j(`Model installed`):`⚠️ `+j(`Model not installed`)}),o.createEl(`br`),o.createSpan({text:j(`Required files`)+`: config.json, tokenizer.json, tokenizer_config.json, onnx/model_quantized.onnx`}),o.createEl(`br`),o.createSpan({text:j(`Download from`)+`: `}),o.createEl(`a`,{text:n,href:n,cls:`external-link`});let s=a.wasmReady,c=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.8.1/dist/`,l=new G(e,t).setName(j(`Import WASM runtime`)).setTab(r).addButton(e=>{e.setButtonText(j(`Select folder`)).onClick(async()=>{let n=await this.selectLocalModelFolder();if(n)try{e.setDisabled(!0),e.setButtonText(j(`Importing...`));let r=await fv.importLocalWasm(n);r.missing.length===0?new f.Notice(j(`Successfully imported WASM runtime`)+` (${r.imported.length} files)`):new f.Notice(j(`Missing WASM files`)+`: ${r.missing.join(`, `)}`),t.debounceDisplay()}catch(e){new f.Notice(j(`Import failed`)+`: ${e?.message||`Unknown error`}`)}finally{e.setDisabled(!1),e.setButtonText(j(`Select folder`))}})}).descEl;l.empty(),l.createSpan({text:s?`✅ `+j(`WASM runtime installed`):`⚠️ `+j(`WASM runtime not installed`)}),l.createEl(`br`),l.createSpan({text:j(`Required files`)+`: ort-wasm-simd-threaded.jsep.mjs, ort-wasm-simd-threaded.jsep.wasm, transformers.min.js`}),l.createEl(`br`),l.createSpan({text:j(`Download from`)+`: `}),l.createEl(`a`,{text:c,href:c,cls:`external-link`})}if(new G(e,t).setHeading().setName(j(`Chat Completion`)).setTab(r),new G(e,t).setName(j(`Chat completion provider`)).setTab(r).addDropdown(e=>{e.addOption(`openai`,`OpenAI / Compatible`),e.addOption(`anthropic`,`Anthropic`),m_()&&e.addOption(`pkmer`,`PKMer AI`),e.setValue(a.activeCompletionProvider).onChange(e=>{B.getState().setActiveCompletionProvider(e),t.debounceDisplay()})}),a.activeCompletionProvider===`pkmer`){let i=!!n.settings.general?.userInfo?.sub;!i&&a.providers.pkmer?.apiKey&&B.getState().updateProvider(`pkmer`,{type:`pkmer`,enabled:!1,apiKey:``,quotaInfo:void 0}),new G(e,t).setHeading().setName(`PKMer AI`).setTab(r);let o=B.getState().providers.pkmer||{},s=i&&!!o.apiKey;s?o.quotaInfo&&new G(e,t).setName(j(`Quota`)).setDesc(`${o.quotaInfo.remaining} / ${o.quotaInfo.total} calls`).setTab(r):new G(e,t).setName(j(`Quota`)).setDesc(j(`Login with PKMer account to activate PKMer AI features`)).setTab(r).addButton(e=>{e.setButtonText(j(`Login with PKMer`)).onClick(async()=>{e.setDisabled(!0);try{if(await n.pkmerAuth.login(),await n.verify()){let e=n.pkmerAuth.aiToken;if(e){let t=5e5,r=n.settings.general?.userInfo?.ai_quota,i=B.getState();i.updateProvider(`pkmer`,{type:`pkmer`,enabled:!0,apiKey:e,baseUrl:`https://newapi.pkmer.cn`,completionModel:i.providers.pkmer?.completionModel||`03-agent`,quotaInfo:r?{remaining:Math.floor(r.remainingQuota/t),total:Math.floor(r.quota/t)}:void 0})}t.debounceDisplay()}}catch(e){new f.Notice(`${e?.message||`Login failed`}`)}finally{e.setDisabled(!1)}})}),new G(e,t).setName(j(`Model`)).setTab(r).addDropdown(e=>{for(let t of sv)e.addOption(t.id,`${t.displayName} \u2014 ${t.description} (${t.price}/call)`);e.setValue(o.completionModel||`03-agent`).onChange(e=>{B.getState().updateProvider(`pkmer`,{completionModel:e})}),s&&cv(o.apiKey,!0).then(t=>{let n=e.getValue();e.selectEl.empty();for(let n of t)e.addOption(n.id,`${n.displayName} \u2014 ${n.description} (${n.price}/call)`);e.setValue(n)})})}else{new G(e,t).setHeading().setName(`OpenAI / Compatible`).setTab(r);let n=a.providers.openai||{};new G(e,t).setName(`API Key`).setTab(r).addText(e=>{e.inputEl.type=`password`,e.setPlaceholder(`sk-...`).setValue(n.apiKey||``).onChange(e=>{B.getState().updateProvider(`openai`,{type:`openai`,enabled:!0,apiKey:e})})}),new G(e,t).setName(`Base URL`).setTab(r).addText(e=>e.setPlaceholder(`https://api.openai.com`).setValue(n.baseUrl||``).onChange(e=>{B.getState().updateProvider(`openai`,{baseUrl:e})})),new G(e,t).setName(j(`Completion model`)).setTab(r).addText(e=>e.setPlaceholder(`gpt-4o-mini`).setValue(n.completionModel||``).onChange(e=>{B.getState().updateProvider(`openai`,{completionModel:e})})),new G(e,t).setHeading().setName(`Anthropic`).setTab(r);let i=a.providers.anthropic||{};new G(e,t).setName(`API Key`).setTab(r).addText(e=>{e.inputEl.type=`password`,e.setPlaceholder(`sk-ant-...`).setValue(i.apiKey||``).onChange(e=>{B.getState().updateProvider(`anthropic`,{type:`anthropic`,enabled:!0,apiKey:e})})}),new G(e,t).setName(j(`Model`)).setTab(r).addText(e=>e.setPlaceholder(`claude-sonnet-4-20250514`).setValue(i.completionModel||``).onChange(e=>{B.getState().updateProvider(`anthropic`,{completionModel:e})}))}}}async selectLocalModelFolder(){try{let e=G_(`electron`)?.remote;if(e?.dialog){let t=await e.dialog.showOpenDialog({properties:[`openDirectory`],title:`Select folder containing model files`});return t.canceled||!t.filePaths?.length?null:t.filePaths[0]}}catch{}return new Promise(e=>{let t=document.createElement(`input`);t.type=`file`,t.setAttribute(`webkitdirectory`,``),t.style.display=`none`,document.body.appendChild(t),t.addEventListener(`change`,()=>{document.body.removeChild(t),t.files&&t.files.length>0?e(t.files[0].path.replace(/[/\\][^/\\]+$/,``)):e(null)}),t.addEventListener(`cancel`,()=>{document.body.removeChild(t),e(null)}),t.click()})}};zv(),K_();var LG=G_(`os`),RG=class{plugin;secretKey;constructor(e){this.plugin=e,this.secretKey=this.generateSecretKey()}async getDeviceId(){let e=``;if(f.Platform.isDesktop)e=await Pv();else{let t=await window.Capacitor?.Plugins.Device.getId();e=t.identifier||t.uuid}return e}async getSystemInfo(){let e=await this.getDeviceId(),t;if(LG)t=JSON.stringify({hostname:LG.hostname(),platform:LG.platform(),machineid:e});else{let n=await window.Capacitor?.Plugins.Device.getInfo(),r=n?.model,i=n?.platform;t=JSON.stringify({hostname:r||(`mobile`+f.Platform.isMobile?Math.random().toString(36).substring(7):``),platform:i||`mobile`,machineid:e})}return mG(t)}generateSecretKey(){let e=this.plugin.manifest.version;return mG(`thino-api-secret-${e}`)}generateSignature(e,t){let n=`${e}-${t}-${this.secretKey}`,r=0;for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);r=(r<<5)-r+t,r&=r}return mG(Math.abs(r).toString(36))}async generateToken(e=1){try{let t=await this.getDeviceId(),n=Date.now(),r=await this.getSystemInfo(),i={appId:t,timestamp:n,signature:this.generateSignature(r,n),version:this.plugin.manifest.version,expiryHours:e};return mG(JSON.stringify(i))}catch(e){throw console.error(`Failed to generate token:`,e),Error(`Token generation failed`)}}async validateToken(e){try{if(!e)return!1;let t=JSON.parse(SG(e)),n=await this.getDeviceId();if(t.appId!==n)return console.warn(`Token validation failed: Invalid app ID`),!1;if(Date.now()-t.timestamp>(t.expiryHours||1)*60*60*1e3)return console.warn(`Token validation failed: Token expired`),!1;if(t.version!==this.plugin.manifest.version)return console.warn(`Token validation failed: Version mismatch`),!1;let r=await this.getSystemInfo(),i=this.generateSignature(r,t.timestamp);return t.signature===i?!0:(console.warn(`Token validation failed: Invalid signature`),!1)}catch(e){return console.error(`Token validation error:`,e),!1}}async isUserVerified(){try{let e=await this.getDeviceId();return!!this.plugin.settings.tokenForVerify[e]}catch(e){return console.error(`User verification check failed:`,e),!1}}async getTokenInfo(e){try{return JSON.parse(SG(e))}catch(e){return console.error(`Failed to parse token info:`,e),null}}async generateAuthHeader(e=1){return`Bearer ${await this.generateToken(e)}`}extractTokenFromHeader(e){return!e||!e.startsWith(`Bearer `)?null:e.substring(7)}};M(),Av(),H(),zv(),li();var zG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;new G(e,t).setHeading().setTab(r).setName(`💎 Thino`),new G(e,t).setName(j(`Default save type`)).setDesc(j(`Set the default save type for thino. "DAILY" by default`)).setTab(r).addDropdown(async e=>{for(let t of n.settings.EnabledLocationList)e.addOption(t.value,j(t.value));e.setValue(n.settings.MemoSaveLocation||n.settings.EnabledLocationList[0].value).onChange(async e=>{if(!i){kv();return}n.settings.MemoSaveLocation=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(j(`Support filter by metadata from file`)).setDesc(j(`When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.`)).addToggle(e=>{e.setValue(n.settings.FilterByMetadata).onChange(async e=>{if(!i){kv();return}n.settings.FilterByMetadata=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(j(`Show source near timestamp in thino`)).setDesc(j(`When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.`)).addToggle(e=>{e.setValue(n.settings.ShowSourcePath).onChange(async e=>{if(!i){kv();return}n.settings.ShowSourcePath=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Add tag automatically`)).setDesc(j(`Add tag to the end or beginning of the thino content when creating a thino and filtering tags`)).setTab(r).addToggle(e=>e.setValue(n.settings.addTagAutomatically).onChange(async e=>{if(!i){kv();return}n.settings.addTagAutomatically=e,t.applySettingsUpdate(),t.debounceDisplay()})),n.settings.addTagAutomatically&&(new G(e,t).setName(j(`Add tag position`)).setDesc(j(`Set the position of the tag when adding tag automatically`)).setTab(r).addDropdown(async e=>{e.addOption(`End`,j(`End`)),e.addOption(`Beginning`,j(`Beginning`)),e.setValue(n.settings.addTagPosition).onChange(async e=>{n.settings.addTagPosition=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Add tag with new line`)).setDesc(j(`Add tag with new line when adding tag automatically`)).setTab(r).addToggle(e=>e.setValue(n.settings.addTagWithNewline).onChange(async e=>{n.settings.addTagWithNewline=e,t.applySettingsUpdate()}))),new G(e,t).setHeading().setTab(r).setName(`💎 `+j(`Interface`)),new G(e,t).setName(j(`Reference links group`)).setDesc(j(`Enable reference links group in thino.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.enableReferenceLinksGroup).onChange(async e=>{if(!i){kv();return}n.settings.enableReferenceLinksGroup=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Word count feature`)).setTab(r).setDesc(j(`Enable real-time word count display in the editor`)).addToggle(e=>{e.setValue(n.settings.enableWordCount).onChange(async e=>{if(!i){kv();return}n.settings.enableWordCount=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Maximum word count`)).setTab(r).setDesc(j(`Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.`)).setDisabled(!i||!n.settings.enableWordCount).addText(e=>{e.inputEl.type=`number`,e.setValue(n.settings.maxWordCount.toString()).onChange(async e=>{let r=parseInt(e);!isNaN(r)&&r>=0&&(n.settings.maxWordCount=r,t.applySettingsUpdate())})}),new G(e,t).setTab(r).setName(j(`Always show status text`)).addToggle(e=>e.setValue(n.settings.AlwaysShowStatusText).onChange(async e=>{n.settings.AlwaysShowStatusText=e,document.body.toggleClass(`thino-show-status`,e),t.applySettingsUpdate()})),f.Platform.isMobile&&new G(e,t).setName(j(`Quick add button on mobile navbar`)).setTab(r).addToggle(e=>{e.setValue(n.settings.NavbarButton).onChange(async e=>{if(!i){kv();return}n.settings.NavbarButton=e,t.applySettingsUpdate()})}),this.addDailyMarkSettings();let a;new G(e,t).setName(j(`Chat view style`)).setDesc(j(`Set the style of chat view`)).setTab(r).addDropdown(async e=>{a=e,a.addOption(`default`,`Default`),a.addOption(`fluent`,`Fluent`),a.addOption(`inline`,`Inline`),a.setValue(n.settings.chatViewStyle).onChange(async e=>{if(!i){kv();return}n.settings.chatViewStyle=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Can select other views when leaf width is not enough`)).setDesc(j(`This option will allow you use other views when leaf width is not enough. False by default.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.SupportSelectOtherView).onChange(async e=>{if(!i){kv();return}n.settings.SupportSelectOtherView=e,t.applySettingsUpdate()})}),this.addMomentsSettings(),new G(e,t).setHeading().setTab(r).setName(`💎 `+j(`Advanced`)),this.addGlobalSettings()}addDailyMarkSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props,a;new G(e,t).setName(j(`Show day mark in thino list`)).setDesc(j(`Show day mark on the top of daily range thino. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.showDayMark).onChange(async e=>{if(!i){kv();return}n.settings.showDayMark=e,t.applySettingsUpdate(),t.debounceDisplay()})),n.settings.showDayMark&&(new G(e,t).setName(j(`Day mark range`)).setDesc(j(`Set the range of day mark. Day by default.`)).setTab(r).addDropdown(async e=>{a=e,a.addOption(`day`,`day`),a.addOption(`week`,`week`),a.addOption(`month`,`month`),a.addOption(`quarter`,`quarter`),a.addOption(`year`,`year`),a.setValue(n.settings.dayMarkRange).onChange(async e=>{n.settings.dayMarkRange=e,t.applySettingsUpdate()})}),new G(e,t).setName(j(`Hide pinned group`)).setDesc(j(`Hide pinned group in thino list. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.hidePinnedGroup).onChange(async e=>{if(!i){kv();return}n.settings.hidePinnedGroup=e,t.applySettingsUpdate()})))}addMomentsSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;new G(e,t).setTab(r).setName(j(`Background image for moments view`)).setDesc(j(`Set the background image for moments view`)).addText(e=>{new vE(e.inputEl),e.setPlaceholder(`URL`).setValue(n.settings.MomentsBackgroundImage).onChange(async e=>{i&&(n.settings.MomentsBackgroundImage=e,t.applySettingsUpdate())})})}addGlobalSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;this.addHttpServerSettings(),new G(e,t).setName(j(`Enable opening thino globally`)).setDesc(j(`Enable opening thino globally. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.CaptureKey.EnableCaptureKey).onChange(async e=>{if(!i){kv();return}n.settings.CaptureKey={...n.settings.CaptureKey,EnableCaptureKey:e},t.applySettingsUpdate(),setTimeout(()=>{t.display()},100)})),n.settings.CaptureKey.EnableCaptureKey&&(new G(e,t).setName(j(`Key for opening thino globally`)).setDesc(j(`Set key for opening thino globally. CTRL + SHIFT + T by default.`)).setTab(r).addText(e=>e.setPlaceholder(q6.CaptureKey.OpenThinoGlobally).setValue(n.settings.CaptureKey.OpenThinoGlobally).onChange(async e=>{if(!i){kv();return}n.settings.CaptureKey={...n.settings.CaptureKey,OpenThinoGlobally:e},t.applySettingsUpdate()})),new G(e,t).setName(j(`Show thino near mouse`)).setTab(r).addToggle(e=>e.setValue(n.settings.CaptureKey.ShowNearMouse).onChange(async e=>{if(!i){kv();return}n.settings.CaptureKey={...n.settings.CaptureKey,ShowNearMouse:e},t.applySettingsUpdate()})))}async addHttpServerSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props,i=L.getState().verifyState,a=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),o=a?a.identifier||a.uuid:await Pv(),s=i&&i?.appId===o;new G(e,t).setName(j(`Enable Local Http Server`)).setTab(r).setDisabled(!s).addToggle(e=>e.setValue(n.settings.EnabledHttpApi).onChange(async e=>{if(!s){kv();return}n.settings.EnabledHttpApi=e,t.applySettingsUpdate(),setTimeout(()=>{n.settings.EnabledHttpApi?n.initServer():n.stopServer(),t.display()},100)})),n.settings.EnabledHttpApi&&(new G(e,t).setName(`API Token Management`).setDesc(`Generate and manage API tokens for external applications`).setTab(r).addButton(e=>{e.setButtonText(`Generate Token`).setTooltip(`Generate a new API token for external access`).onClick(async()=>{if(!s){kv();return}new BG(t.app,n,async e=>{try{let r=new RG(n);if(!await r.isUserVerified()){new f.Notice(`Pro license required to generate API token`);return}let i=await r.generateToken(e),a=await r.generateAuthHeader(e),o=e*3600;new VG(t.app,i,a,o,e).open()}catch(e){console.error(`Token generation error:`,e),new f.Notice(`Failed to generate token: `+e.message)}}).open()})}).addButton(e=>{e.setButtonText(`Test API`).setTooltip(`Test API connection`).onClick(async()=>{if(!s){kv();return}try{let e=new RG(n);if(!await e.isUserVerified()){new f.Notice(`Pro license required for API access`);return}let t=await e.generateAuthHeader(1),r=await fetch(`http://${n.settings.HttpApiIpType}:${n.settings.HttpApiPort}/list?count=1`,{headers:{Authorization:t}});if(r.ok)new f.Notice(`API test successful! Found `+((await r.json()).thinos?.length||0)+` thinos.`);else throw Error(`API test failed: ${r.status}`)}catch(e){console.error(`API test error:`,e),new f.Notice(`API test failed: `+e.message)}})}).addButton(e=>{e.setButtonText(`API Documentation`).setTooltip(`View API documentation and examples`).onClick(async()=>{new HG(t.app,n).open()})}),new G(e,t).setName(j(`Get thino capture extension`)).setDesc(j(`You can capture idea/text from chrome now.`)).setTab(r).addButton(e=>{e.setButtonText(`GitHub`).onClick(()=>{window.open(`https://github.com/quorafind/thino-capture-releases`,`_blank`)})}).addButton(e=>{e.setButtonText(`Chrome Web Store`).onClick(()=>{window.open(`https://chromewebstore.google.com/detail/thino-capture/oppagjehiimpjpjmgbfmanlnbpbcecff`,`_blank`)})}),new G(e,t).setName(j(`Memos Http Server Port`)).setDesc(j(`Set memos http server port to listen. '43999' by default`)).setTab(r).addText(e=>e.setPlaceholder(q6.HttpApiPort).setValue(n.settings.HttpApiPort).onChange(async e=>{if(!s){kv();return}n.settings.HttpApiPort=e,t.applySettingsUpdate(),setTimeout(()=>{n.stopServer(),n.initServer()},1e3)})),new G(e,t).setName(j(`Auto Download Image`)).setDesc(j(`Auto download image when save to thino. 'false' by default`)).setTab(r).setDisabled(!s).addToggle(e=>{e.setValue(n.settings.AutoDownloadImage).onChange(async e=>{if(!s){kv();return}n.settings.AutoDownloadImage=e,t.applySettingsUpdate(),setTimeout(()=>{n.stopServer(),n.initServer()},1e3)})}),new G(e,t).setName(j(`Thino Http IP Type`)).setDesc(j(`Set Thino http server ip to listen. 'localhost' by default`)).setTab(r).addDropdown(e=>{e.addOption(`localhost`,`localhost`),e.addOption(`127.0.0.1`,`127.0.0.1`),e.setValue(n.settings.HttpApiIpType).onChange(async e=>{if(!i||i?.appId!==o){kv();return}n.settings.HttpApiIpType=e,t.applySettingsUpdate(),setTimeout(()=>{n.stopServer(),n.initServer()},1e3)})}),this.addAppendPrependSettings(s))}addAppendPrependSettings(e){let{containerEl:t,settingTab:n,plugin:r,tabName:i}=this.props;new G(t,n).setTab(i).setName(j(`Append/prepend text when share to Thino`)).addToggle(t=>{t.setValue(r.settings.AppendOrPrependTextViaServer).onChange(async t=>{if(!e){kv();return}r.settings.AppendOrPrependTextViaServer=t,n.applySettingsUpdate(),n.debounceDisplay()})}),r.settings.AppendOrPrependTextViaServer&&(new G(t,n).setName(j(`Prepend Text`)).setTab(i).addText(e=>{e.setPlaceholder(j(`Input anything here`)).setValue(r.settings.PrependViaServer).onChange(async e=>{r.settings.PrependViaServer=e,n.applySettingsUpdate()})}),new G(t,n).setName(j(`Append Text`)).setTab(i).addText(e=>{e.setPlaceholder(j(`Input anything here`)).setValue(r.settings.AppendViaServer).onChange(async e=>{r.settings.AppendViaServer=e,n.applySettingsUpdate()})}),new G(t,n).setName(j(`Add newline when append/prepend text`)).addDropdown(async e=>{e.addOption(`prepend`,j(`Prepend`)),e.addOption(`append`,j(`Append`)),e.addOption(`both`,j(`Both`)),e.addOption(`none`,j(`None`)),e.setValue(r.settings.WithNewLineViaServer).onChange(async e=>{r.settings.WithNewLineViaServer=e,n.applySettingsUpdate()})}))}},BG=class extends f.Modal{plugin;onGenerate;constructor(e,t,n){super(e),this.plugin=t,this.onGenerate=n}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`token-generation-modal`),this.titleEl.setText(`Generate API Token`),e.createDiv(`modal-desc`,e=>{e.setText(`Choose the expiration time for your API token. Longer expiration times are less secure but more convenient.`)});let t=e.createDiv(`token-form-container`),n=t.createDiv(`expiry-section`);n.createEl(`h3`,{text:`Token Expiration Time:`});let r=[{value:1,label:`1 Hour (Recommended)`},{value:6,label:`6 Hours`},{value:12,label:`12 Hours`},{value:24,label:`1 Day`},{value:72,label:`3 Days`},{value:168,label:`1 Week`},{value:720,label:`30 Days (Maximum)`}],i=1,a=n.createDiv(`radio-container`);r.forEach(e=>{let t=a.createDiv(`radio-item`),n=t.createEl(`input`,{type:`radio`,attr:{name:`expiry`,value:e.value.toString()}});e.value===1&&(n.checked=!0),n.addEventListener(`change`,()=>{n.checked&&(i=e.value)}),t.createEl(`label`,{text:e.label}).addEventListener(`click`,()=>{n.checked=!0,i=e.value})});let o=t.createDiv(`custom-section`);o.createEl(`h4`,{text:`Or enter custom hours (1-720):`});let s=o.createEl(`input`,{type:`number`,attr:{min:`1`,max:`720`,placeholder:`Custom hours...`}});s.addEventListener(`input`,()=>{let e=parseInt(s.value);e>=1&&e<=720&&(i=e,a.querySelectorAll(`input[type="radio"]`).forEach(e=>{e.checked=!1}))}),t.createDiv(`warning-section`).createEl(`p`,{text:`⚠️ Security Note: Longer expiration times increase security risk. Only use extended periods if necessary.`,cls:`security-warning`});let c=e.createDiv(`button-group`),l=c.createEl(`button`,{text:`Cancel`});l.onclick=()=>this.close();let u=c.createEl(`button`,{text:`Generate Token`,cls:`mod-cta`});u.onclick=()=>{this.onGenerate(i),this.close()}}onClose(){let{contentEl:e}=this;e.empty()}},VG=class extends f.Modal{token;authHeader;expiresIn;expiryHours;constructor(e,t,n,r,i){super(e),this.token=t,this.authHeader=n,this.expiresIn=r,this.expiryHours=i}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`token-display-modal`),this.titleEl.setText(`API Token Generated`),e.createDiv(`modal-desc`,e=>{e.setText(`Your API token has been generated successfully. Copy and save it securely as it will expire in 1 hour.`)});let t=e.createDiv(`token-container`),n=t.createDiv(`token-section`);n.createEl(`h3`,{text:`Token:`});let r=n.createEl(`textarea`,{cls:`token-display`,attr:{readonly:`true`,rows:`3`}});r.value=this.token;let i=t.createDiv(`token-section`);i.createEl(`h3`,{text:`Authorization Header:`});let a=i.createEl(`textarea`,{cls:`token-display`,attr:{readonly:`true`,rows:`2`}});a.value=this.authHeader;let o=t.createDiv(`token-section`);o.createEl(`h3`,{text:`Usage Example:`});let s=o.createEl(`textarea`,{cls:`token-display`,attr:{readonly:`true`,rows:`4`}});s.value=`curl -X POST http://127.0.0.1:43999/create \\
- -H "Authorization: ${this.authHeader}" \\
- -H "Content-Type: application/json" \\
- -d '{"text": "Hello from API", "type": "DAILY"}'`;let c=e.createDiv(`expiry-info`),l=this.expiryHours>=24?`\u23F0 This token will expire in ${Math.floor(this.expiryHours/24)} day(s).`:`\u23F0 This token will expire in ${this.expiryHours} hour(s).`;c.createEl(`p`,{text:l,cls:`expiry-warning`});let u=e.createDiv(`button-group`),d=u.createEl(`button`,{text:`Copy Token`});d.onclick=async()=>{new f.Notice(await N.copyTextToClipboard(this.token)?`Token copied to clipboard`:`Copy failed, please long-press the field above to copy manually`)};let p=u.createEl(`button`,{text:`Copy Auth Header`});p.onclick=async()=>{new f.Notice(await N.copyTextToClipboard(this.authHeader)?`Authorization header copied to clipboard`:`Copy failed, please long-press the field above to copy manually`)};let m=u.createEl(`button`,{text:`Close`});m.onclick=()=>this.close()}onClose(){let{contentEl:e}=this;e.empty()}},HG=class extends f.Modal{plugin;constructor(e,t){super(e),this.plugin=t}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`api-documentation-modal`),this.titleEl.setText(`Thino API Documentation`);let t=e.createDiv(`api-doc-container`),n=t.createDiv(`api-section`);n.createEl(`h2`,{text:`Overview`}),n.createEl(`p`,{text:`The Thino HTTP API allows you to interact with your thinos programmatically. All endpoints require authentication using a Bearer token.`});let r=n.createDiv(`server-info`);r.createEl(`strong`,{text:`Server Address: `}),r.createSpan({text:`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`});let i=t.createDiv(`api-section`);i.createEl(`h2`,{text:`Authentication`}),i.createEl(`p`,{text:`All API requests require a Bearer token in the Authorization header. Generate a token using the "Generate Token" button above.`});let a=i.createDiv(`code-example`);a.createEl(`h4`,{text:`Authorization Header Format:`}),a.createEl(`pre`).createEl(`code`,{text:`Authorization: Bearer <your-token-here>`});let o=t.createDiv(`api-section`);o.createEl(`h2`,{text:`API Endpoints`}),this.createEndpointSection(o,{title:`Create Thino`,method:`POST`,endpoint:`/create`,description:`Create a new thino with text content and optional images`,parameters:[{name:`text`,type:`string`,required:!0,description:`The content of the thino`},{name:`isList`,type:`boolean`,required:!1,description:`Whether to format as list item (default: false)`},{name:`type`,type:`string`,required:!1,description:`Save location type (DAILY, CANVAS, MULTI, FILE)`},{name:`imageList`,type:`array`,required:!1,description:`Array of base64 encoded images`},{name:`sourceLink`,type:`string`,required:!1,description:`Source URL to append to the thino`}],examples:{curl:this.generateCurlExample(`POST`,`/create`,{text:`This is my new thino`,isList:!1,type:`DAILY`}),python:this.generatePythonExample(`POST`,`/create`,{text:`This is my new thino`,isList:!1,type:`DAILY`}),nodejs:this.generateNodeExample(`POST`,`/create`,{text:`This is my new thino`,isList:!1,type:`DAILY`})}}),this.createEndpointSection(o,{title:`Search Thinos`,method:`GET`,endpoint:`/search`,description:`Search for thinos containing specific keywords`,parameters:[{name:`keyword`,type:`string`,required:!0,description:`Search keyword`}],examples:{curl:this.generateCurlExample(`GET`,`/search?keyword=meeting`),python:this.generatePythonExample(`GET`,`/search?keyword=meeting`),nodejs:this.generateNodeExample(`GET`,`/search?keyword=meeting`)}}),this.createEndpointSection(o,{title:`List Thinos`,method:`GET`,endpoint:`/list`,description:`Get a list of recent thinos`,parameters:[{name:`count`,type:`number`,required:!1,description:`Number of thinos to return (1-100, default: 10)`}],examples:{curl:this.generateCurlExample(`GET`,`/list?count=20`),python:this.generatePythonExample(`GET`,`/list?count=20`),nodejs:this.generateNodeExample(`GET`,`/list?count=20`)}}),this.createEndpointSection(o,{title:`Get Settings Info`,method:`GET`,endpoint:`/info`,description:`Get current plugin settings information`,parameters:[{name:`getSettings`,type:`boolean`,required:!0,description:`Must be true to retrieve settings`}],examples:{curl:this.generateCurlExample(`GET`,`/info?getSettings=true`),python:this.generatePythonExample(`GET`,`/info?getSettings=true`),nodejs:this.generateNodeExample(`GET`,`/info?getSettings=true`)}});let s=t.createDiv(`api-section`);s.createEl(`h2`,{text:`Response Format`}),s.createEl(`p`,{text:`All API responses return JSON in the following format:`});let c=s.createDiv(`code-example`),l=c.createDiv();l.createEl(`h4`,{text:`Success Response:`}),l.createEl(`pre`).createEl(`code`,{text:JSON.stringify({status:`success`,data:`...`},null,2)});let u=c.createDiv();u.createEl(`h4`,{text:`Error Response:`}),u.createEl(`pre`).createEl(`code`,{text:JSON.stringify({status:`error`,message:`Error description`},null,2)});let d=t.createDiv(`api-section`);d.createEl(`h2`,{text:`Common Error Codes`});let f=d.createEl(`ul`);f.createEl(`li`,{text:`401 Unauthorized - Missing or invalid token`}),f.createEl(`li`,{text:`403 Forbidden - Pro license required`}),f.createEl(`li`,{text:`404 Not Found - Endpoint not found`}),f.createEl(`li`,{text:`405 Method Not Allowed - Wrong HTTP method`}),f.createEl(`li`,{text:`413 Request Too Large - Request body too large`}),f.createEl(`li`,{text:`429 Too Many Requests - Rate limit exceeded`});let p=e.createDiv(`button-group`).createEl(`button`,{text:`Close`});p.onclick=()=>this.close()}createEndpointSection(e,t){let n=e.createDiv(`endpoint-section`),r=n.createDiv(`endpoint-header`);if(r.createEl(`h3`,{text:t.title}),r.createEl(`span`,{cls:`method-badge method-${t.method.toLowerCase()}`,text:t.method}),r.createEl(`code`,{cls:`endpoint-path`,text:t.endpoint}),n.createEl(`p`,{text:t.description}),t.parameters.length>0){n.createEl(`h4`,{text:`Parameters:`});let e=n.createEl(`table`,{cls:`param-table`}),r=e.createEl(`tr`);r.createEl(`th`,{text:`Name`}),r.createEl(`th`,{text:`Type`}),r.createEl(`th`,{text:`Required`}),r.createEl(`th`,{text:`Description`}),t.parameters.forEach(t=>{let n=e.createEl(`tr`);n.createEl(`td`,{text:t.name}),n.createEl(`td`,{text:t.type}),n.createEl(`td`,{text:t.required?`Yes`:`No`}),n.createEl(`td`,{text:t.description})})}n.createEl(`h4`,{text:`Examples:`});let i=n.createDiv(`example-tabs`),a=i.createDiv(`tab-buttons`),o=a.createEl(`button`,{text:`cURL`,cls:`tab-btn active`}),s=a.createEl(`button`,{text:`Python`,cls:`tab-btn`}),c=a.createEl(`button`,{text:`Node.js`,cls:`tab-btn`}),l=i.createDiv(`tab-contents`),u=l.createDiv(`tab-content active`);u.createEl(`pre`).createEl(`code`,{text:t.examples.curl}),this.addCopyButton(u,t.examples.curl);let d=l.createDiv(`tab-content`);d.createEl(`pre`).createEl(`code`,{text:t.examples.python}),this.addCopyButton(d,t.examples.python);let f=l.createDiv(`tab-content`);f.createEl(`pre`).createEl(`code`,{text:t.examples.nodejs}),this.addCopyButton(f,t.examples.nodejs);let p=(e,t)=>{a.querySelectorAll(`.tab-btn`).forEach(e=>e.removeClass(`active`)),l.querySelectorAll(`.tab-content`).forEach(e=>e.removeClass(`active`)),e.addClass(`active`),t.addClass(`active`)};o.onclick=()=>p(o,u),s.onclick=()=>p(s,d),c.onclick=()=>p(c,f)}addCopyButton(e,t){let n=e.createEl(`button`,{text:`Copy`,cls:`copy-btn`});n.onclick=async()=>{let e=await N.copyTextToClipboard(t);n.setText(e?`Copied!`:`Copy failed`),setTimeout(()=>n.setText(`Copy`),2e3)}}generateCurlExample(e,t,n){let r=`curl -X ${e} ${`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`}${t} \\\n -H "Authorization: Bearer <your-token>"`;return n&&e!==`GET`&&(r+=` \\\n -H "Content-Type: application/json" \\\n -d '${JSON.stringify(n,null,2)}'`),r}generatePythonExample(e,t,n){let r=`import requests
- import json
- url = "${`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`}${t}"
- headers = {
- "Authorization": "Bearer <your-token>"`;return n&&e!==`GET`&&(r+=`,
- "Content-Type": "application/json"`),r+=`
- }`,n&&e!==`GET`?r+=`
- data = ${JSON.stringify(n,null,4)}
- response = requests.${e.toLowerCase()}(url, headers=headers, json=data)`:r+=`
- response = requests.${e.toLowerCase()}(url, headers=headers)`,r+=`
- print(response.json())`,r}generateNodeExample(e,t,n){let r=`const fetch = require('node-fetch');
- const url = '${`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`}${t}';
- const options = {
- method: '${e}',
- headers: {
- 'Authorization': 'Bearer <your-token>'`;return n&&e!==`GET`&&(r+=`,
- 'Content-Type': 'application/json'`),r+=`
- }`,n&&e!==`GET`&&(r+=`,
- body: JSON.stringify(${JSON.stringify(n,null,8)})`),r+=`
- };
- fetch(url, options)
- .then(response => response.json())
- .then(data => console.log(data))
- .catch(error => console.error('Error:', error));`,r}onClose(){let{contentEl:e}=this;e.empty()}},UG,WG,GG,KG,qG=o((()=>{UG={none:`None`,low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra High`},WG={default:`Default`,"accept-edits":`Accept Edits`,"plan-mode":`Plan Mode`,"dont-ask":`Don't Ask`,"bypass-permissions":`Bypass Permissions`},GG=`You are responding via a WeChat bot. Follow these rules for file/media output:
- 1. To send a local file to the user, output its ABSOLUTE path on a single line by itself (e.g. /home/user/project/report.pdf). The bot will automatically upload and send it.
- 2. IMPORTANT: Files can only be sent if they are located within the current working directory (cwd) or the vault directory. If a file is outside these directories, COPY or MOVE it into the cwd first, then output the new path.
- 3. To send an image, use markdown image syntax: . The bot will download and send it as an image message.
- 4. Supported file types for auto-sending: pdf, doc/docx, xls/xlsx, ppt/pptx, zip, txt, csv, png, jpg, gif, webp, mp4, mov.
- 5. For text responses, use plain language. Markdown formatting (headers, bold, lists) will be converted to plain text for WeChat display.`,KG={enabled:!1,defaultAgent:`claude`,agents:{claude:{type:`cli`,command:`claude`,aliases:[`cc`]},codex:{type:`cli`,command:`codex`,aliases:[`cx`]},gemini:{type:`cli`,command:`gemini`,aliases:[`gm`]}}}}));async function JG(e,t=4e4){let n=await(0,f.requestUrl)({url:e,throw:!1});if(n.status>=400)throw Error(`HTTP ${n.status}: ${n.text}`);return n.json}function YG(e,t){return new Promise((n,r)=>{if(t.aborted){r(Error(`Aborted`));return}let i=()=>r(Error(`Aborted`));t.addEventListener(`abort`,i,{once:!0}),e.then(e=>{t.removeEventListener(`abort`,i),n(e)},e=>{t.removeEventListener(`abort`,i),r(e)})})}function XG(){let e=ZG.randomBytes(4).readUInt32LE();return Buffer.from(e.toString()).toString(`base64`)}var ZG,QG,$G,eK,tK,nK=o((()=>{K_(),ZG=G_(`crypto`),QG=`https://ilinkai.weixin.qq.com`,$G=4e4,eK=15e3,tK=class{baseURL;botToken;botId;wechatUIN;constructor(e){this.baseURL=e.baseurl||QG,this.botToken=e.bot_token,this.botId=e.ilink_bot_id,this.wechatUIN=XG()}async getUpdates(e,t){let n={get_updates_buf:e,base_info:{channel_version:`1.0.0`}};return this.post(`/ilink/bot/getupdates`,n,$G,t)}async sendMessage(e){return this.post(`/ilink/bot/sendmessage`,e,eK)}async getConfig(e,t){let n={ilink_user_id:e,context_token:t,base_info:{}};return this.post(`/ilink/bot/getconfig`,n,1e4)}async sendTyping(e,t,n){let r={ilink_user_id:e,typing_ticket:t,status:n,base_info:{}};return this.post(`/ilink/bot/sendtyping`,r,1e4)}async getUploadURL(e){return this.post(`/ilink/bot/getuploadurl`,e,eK)}async post(e,t,n,r){if(r?.aborted)throw Error(`Aborted`);let i=(0,f.requestUrl)({url:this.baseURL+e,method:`POST`,headers:this.headers(),body:JSON.stringify(t),throw:!1}),a=r?await YG(i,r):await i;if(a.status>=400)throw Error(`HTTP ${a.status}: ${a.text}`);return a.json}headers(){return{"Content-Type":`application/json`,AuthorizationType:`ilink_bot_token`,Authorization:`Bearer ${this.botToken}`,"X-WECHAT-UIN":this.wechatUIN}}}}));async function rK(){return JG(oK)}async function iK(e,t,n){let r=sK+encodeURIComponent(e);for(;;){if(n?.aborted)throw Error(`Login cancelled`);let e;try{e=await JG(r,4e4)}catch{if(n?.aborted)throw Error(`Login cancelled`);continue}switch(e.status){case uK:{let n={bot_token:e.bot_token,ilink_bot_id:e.ilink_bot_id,baseurl:e.baseurl,ilink_user_id:e.ilink_user_id};return t?.onConfirmed?.(n),n}case dK:throw Error(`QR code expired`);case lK:t?.onScanned?.();break;case cK:default:break}}}async function aK(e,t){let n=await rK();return e?.onQRCode?.(n.qrcode,n.qrcode_img_content),iK(n.qrcode,e,t)}var oK,sK,cK,lK,uK,dK,fK=o((()=>{nK(),oK=`https://ilinkai.weixin.qq.com/ilink/bot/get_bot_qrcode?bot_type=3`,sK=`https://ilinkai.weixin.qq.com/ilink/bot/get_qrcode_status?qrcode=`,cK=`wait`,lK=`scaned`,uK=`confirmed`,dK=`expired`}));function pK(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(r),n()},{once:!0})})}var mK,hK,gK,_K,vK,yK,bK=o((()=>{mK=5,hK=3e3,gK=6e4,_K=5e3,vK=-14,yK=class{client;handler;getUpdatesBuf;failures=0;abortController=null;running=!1;log;loadBuf;saveBuf;constructor(e,t,n){this.client=e,this.handler=t,this.loadBuf=n.loadBuf,this.saveBuf=n.saveBuf,this.log=n.logger,this.getUpdatesBuf=this.loadBuf()}get isRunning(){return this.running}async run(){if(this.running)return;this.running=!0,this.abortController=new AbortController;let{signal:e}=this.abortController;this.log.info(`[monitor] starting long-poll loop`);try{for(;!e.aborted;)try{let t=await this.client.getUpdates(this.getUpdatesBuf,e);if(this.failures=0,t.errcode===vK){this.log.warn(`[monitor] session expired, resetting sync buf`),this.getUpdatesBuf=``,this.saveBuf(``),await pK(_K,e);continue}if(t.ret!==0&&t.errcode){this.log.warn(`[monitor] server error: ret=${t.ret} errcode=${t.errcode} errmsg=${t.errmsg}`);continue}if(t.get_updates_buf&&(this.getUpdatesBuf=t.get_updates_buf,this.saveBuf(this.getUpdatesBuf)),t.msgs)for(let e of t.msgs)try{this.handler(this.client,e)}catch(e){this.log.error(`[monitor] handler error:`,e)}}catch(t){if(e.aborted)break;this.failures++;let n=this.calcBackoff();this.log.warn(`[monitor] GetUpdates error (${this.failures}/${mK}, backoff=${n}ms):`,t instanceof Error?t.message:t),await pK(n,e)}}finally{this.running=!1,this.log.info(`[monitor] stopped`)}}stop(){this.abortController?.abort()}calcBackoff(){let e=hK;for(let t=1;t<this.failures;t++)if(e*=2,e>gK)return gK;return e}}}));async function xK(e,t,n,r){let i=OK.randomBytes(16),a=OK.randomBytes(16),o=i.toString(`hex`),s=a.toString(`hex`),c=OK.createHash(`md5`).update(t).digest(`hex`),l=DK(t.length),u={filekey:o,media_type:r,to_user_id:n,rawsize:t.length,rawfilemd5:c,filesize:l,no_need_thumb:!0,aeskey:s,base_info:{}},d=await e.getUploadURL(u);if(d.ret!=null&&d.ret!==0)throw Error(`getUploadURL failed: ret=${d.ret} errmsg=${d.errmsg}`);let f=TK(t,a);return{downloadParam:await CK(f,d.upload_param,o),aesKeyHex:s,fileSize:t.length,cipherSize:f.length}}function SK(e){return Buffer.from(e).toString(`base64`)}async function CK(e,t,n){let r=await(0,f.requestUrl)({url:`${kK}/upload?encrypted_query_param=${encodeURIComponent(t)}&filekey=${encodeURIComponent(n)}`,method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),throw:!1});if(r.status>=400)throw Error(`CDN upload HTTP ${r.status}: ${r.text}`);let i=r.headers[`x-encrypted-param`]||r.headers[`X-Encrypted-Param`];if(!i)throw Error(`CDN upload: missing X-Encrypted-Param header`);return i}async function wK(e,t){let n=await(0,f.requestUrl)({url:`${kK}/download?encrypted_query_param=${encodeURIComponent(e)}`,method:`GET`,throw:!1});if(n.status>=400)throw Error(`CDN download HTTP ${n.status}`);let r=Buffer.from(n.arrayBuffer),i=Buffer.from(t,`base64`).toString(`utf-8`);return EK(r,Buffer.from(i,`hex`))}function TK(e,t){let n=16-e.length%16,r=Buffer.alloc(e.length+n);e.copy(r),r.fill(n,e.length);let i=OK.createCipheriv(`aes-128-ecb`,t,null);return i.setAutoPadding(!1),Buffer.concat([i.update(r),i.final()])}function EK(e,t){let n=OK.createDecipheriv(`aes-128-ecb`,t,null);n.setAutoPadding(!1);let r=Buffer.concat([n.update(e),n.final()]);if(r.length===0)return r;let i=r[r.length-1];return i>0&&i<=16?r.subarray(0,r.length-i):r}function DK(e){return(Math.floor((e+1)/16)+1)*16}var OK,kK,AK=o((()=>{K_(),OK=G_(`crypto`),kK=`https://novac2c.cdn.weixin.qq.com/c2c`})),jK,MK=o((()=>{jK=class{handlers=new Map;on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),this}off(e,t){return this.handlers.get(e)?.delete(t),this}emit(e,t){for(let n of this.handlers.get(e)??[])try{n(t)}catch(t){console.error(`[Emitter] handler error on "${e}":`,t)}}removeAllListeners(){this.handlers.clear()}}})),NK,PK,FK,IK,LK,RK=o((()=>{NK={None:0,User:1,Bot:2},PK={New:0,Generating:1,Finish:2},FK={None:0,Text:1,Image:2,Voice:3,File:4,Video:5},IK={Image:1,Video:2,File:3,Voice:4},LK={Typing:1,Cancel:2}}));function zK(e){for(let t of e.item_list||[])if(t.type===FK.Text&&t.text_item)return t.text_item.text;return``}function BK(e,t){let n=e.trim();if(!n.startsWith(`/`))return{command:null,text:n};let r=n.slice(1),i=r.indexOf(` `);if(i<=0){let e=r;return{command:t.get(e)||e,text:``}}let a=r.slice(0,i);return{command:t.get(a)||a,text:r.slice(i+1).trim()}}function VK(e,t){return e.length<=t?e:e.slice(0,t)+`...`}var HK,UK,WK,GK=o((()=>{K_(),nK(),fK(),bK(),AK(),MK(),RK(),HK=G_(`crypto`),UK={info(){},warn(){},error(){}},WK=class extends jK{options;log;storage;client=null;monitor=null;credentials=null;syncBuf=``;commands=new Map;aliases=new Map;defaultHandler=null;contextTokens=new Map;constructor(e,t){super(),this.options={defaultReply:!1,...t},this.log=t?.logger===!1?UK:t?.logger||console,this.storage=e,t?.credentials&&(this.credentials=t.credentials)}command(e,t){let n=Array.isArray(e)?e:[e],r=n[0];this.commands.set(r,t);for(let e of n)this.aliases.set(e,r);return this}onDefault(e){return this.defaultHandler=e,this}async login(e){let t=await aK({onQRCode:(e,t)=>this.emit(`qrcode`,{url:e,imageBase64:t}),onScanned:()=>this.emit(`scanned`,void 0),onConfirmed:e=>{this.storage.saveCredentials(e),this.emit(`login`,e)}},e);return this.credentials=t,t}async start(){this.credentials||=this.storage.loadCredentials(),this.credentials||(this.log.info(`[weclaw] no credentials found, starting login...`),await this.login());let e=this.credentials;this.client=new tK(e),this.syncBuf=await this.storage.loadSyncBuf(),this.monitor=new yK(this.client,this.handleRawMessage.bind(this),{loadBuf:()=>this.syncBuf,saveBuf:e=>{this.syncBuf=e,this.storage.saveSyncBuf(e).catch(e=>this.log.error(`[weclaw] save sync buf error:`,e))},logger:this.log}),this.emit(`ready`,void 0),this.log.info(`[weclaw] ready, monitoring messages...`);try{await this.monitor.run()}catch(e){this.emit(`error`,e)}finally{this.emit(`stopped`,void 0)}}stop(){this.monitor?.stop()}get running(){return this.monitor?.isRunning??!1}getCredentials(){return this.credentials}getClient(){return this.client}logout(){this.stop(),this.credentials=null,this.client=null,this.syncBuf=``,this.storage.clearCredentials()}async sendText(e,t,n){let r=this.requireClient(),i=n||this.contextTokens.get(e)||``;await this.doSendText(r,e,t,i)}async sendMedia(e,t,n,r){let i=this.requireClient(),a=r?.contextToken||this.contextTokens.get(e)||``,o=await xK(i,t,e,n),s={encrypt_query_param:o.downloadParam,aes_key:SK(o.aesKeyHex),encrypt_type:1},c;switch(n){case IK.Image:c={type:FK.Image,image_item:{media:s,mid_size:o.cipherSize}};break;case IK.Video:c={type:FK.Video,video_item:{media:s,video_size:o.cipherSize}};break;default:c={type:FK.File,file_item:{media:s,file_name:r?.fileName||`file`,len:String(o.fileSize)}}}let l={msg:{from_user_id:i.botId,to_user_id:e,client_id:HK.randomUUID(),message_type:NK.Bot,message_state:PK.Finish,item_list:[c],context_token:a},base_info:{}},u=await i.sendMessage(l);if(u.ret!=null&&u.ret!==0)throw Error(`sendMedia failed: ret=${u.ret} errmsg=${u.errmsg}`)}handleRawMessage(e,t){if(t.message_type!==NK.User||t.message_state!==PK.Finish)return;if(this.options.allowedUsers?.length&&!this.options.allowedUsers.includes(t.from_user_id)){this.log.warn(`[weclaw] ignored message from unauthorized user: ${t.from_user_id}`);return}let n=zK(t);this.contextTokens.set(t.from_user_id,t.context_token),this.log.info(`[weclaw] message from ${t.from_user_id}: ${VK(n,80)}`);let{command:r,text:i}=BK(n,this.aliases),a={fromUserId:t.from_user_id,text:i,command:r,fullText:n,contextToken:t.context_token,rawMessage:t,items:t.item_list||[],reply:async n=>{await this.doSendText(e,t.from_user_id,n,t.context_token)}};this.emit(`message`,a),this.routeMessage(e,a).catch(e=>{this.log.error(`[weclaw] handler error:`,e),this.emit(`error`,e)})}async routeMessage(e,t){this.sendTypingIndicator(e,t.fromUserId,t.contextToken);let n;if(t.command){let e=this.commands.get(t.command);n=e?await e(t):await this.runDefaultHandler(t)}else n=await this.runDefaultHandler(t);typeof n==`string`&&n.length>0&&(await this.doSendText(e,t.fromUserId,n,t.contextToken),this.emit(`reply`,{toUserId:t.fromUserId,text:n}))}async runDefaultHandler(e){if(this.defaultHandler)return this.defaultHandler(e);if(this.options.defaultReply!==!1)return this.options.defaultReply;this.emit(`message:unhandled`,e)}async doSendText(e,t,n,r){let i={msg:{from_user_id:e.botId,to_user_id:t,client_id:HK.randomUUID(),message_type:NK.Bot,message_state:PK.Finish,item_list:[{type:FK.Text,text_item:{text:n}}],context_token:r},base_info:{}},a=await e.sendMessage(i);if(a.ret!=null&&a.ret!==0)throw Error(`sendMessage failed: ret=${a.ret} errmsg=${a.errmsg}`);this.log.info(`[weclaw] replied to ${t}: ${VK(n,50)}`)}sendTypingIndicator(e,t,n){(async()=>{try{let r=await e.getConfig(t,n);r.typing_ticket&&await e.sendTyping(t,r.typing_ticket,LK.Typing)}catch{}})()}requireClient(){if(!this.client)throw Error(`WeClaw not started. Call start() first.`);return this.client}}})),KK,qK,JK=o((()=>{KK={botToken:`wechat-bot-token`,botId:`wechat-bot-id`,baseUrl:`wechat-base-url`,userId:`wechat-user-id`},qK=class{app;basePath;adapter;memBotToken=null;memBotId=null;memBaseUrl=null;memUserId=null;constructor(e,t){this.app=e,this.adapter=e.vault.adapter,this.basePath=(0,f.normalizePath)(`${e.vault.configDir}/plugins/${t}/wechat`)}get secrets(){return this.app.secretStorage}loadSecrets(){this.memBotToken=this.secrets.getSecret(KK.botToken)??null,this.memBotId=this.secrets.getSecret(KK.botId)??null,this.memBaseUrl=this.secrets.getSecret(KK.baseUrl)??null,this.memUserId=this.secrets.getSecret(KK.userId)??null}setBotToken(e){this.memBotToken=e,this.secrets.setSecret(KK.botToken,e)}setBotId(e){this.memBotId=e,this.secrets.setSecret(KK.botId,e)}setBaseUrl(e){this.memBaseUrl=e,this.secrets.setSecret(KK.baseUrl,e)}setUserId(e){this.memUserId=e,this.secrets.setSecret(KK.userId,e)}saveCredentials(e){this.setBotToken(e.bot_token),this.setBotId(e.ilink_bot_id),this.setBaseUrl(e.baseurl),this.setUserId(e.ilink_user_id)}loadCredentials(){return this.memBotToken?{bot_token:this.memBotToken,ilink_bot_id:this.memBotId||``,baseurl:this.memBaseUrl||``,ilink_user_id:this.memUserId||``}:null}clearCredentials(){this.memBotToken=null,this.memBotId=null,this.memBaseUrl=null,this.memUserId=null,this.secrets.setSecret(KK.botToken,``),this.secrets.setSecret(KK.botId,``),this.secrets.setSecret(KK.baseUrl,``),this.secrets.setSecret(KK.userId,``)}async ensureDir(){await this.adapter.exists(this.basePath)||await this.adapter.mkdir(this.basePath)}async saveSyncBuf(e){await this.ensureDir();let t=(0,f.normalizePath)(`${this.basePath}/sync.json`);await this.adapter.write(t,JSON.stringify({get_updates_buf:e}))}async loadSyncBuf(){let e=(0,f.normalizePath)(`${this.basePath}/sync.json`);try{if(!await this.adapter.exists(e))return``;let t=await this.adapter.read(e);return JSON.parse(t).get_updates_buf||``}catch{return``}}}})),YK=s(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),XK=s((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),ZK=s((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),QK=s(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),$K=s(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),eq=s((e=>{var t=XK().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),tq=s((e=>{var t=XK().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),nq=s((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),rq=s((e=>{var t=ZK(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),iq=s((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),aq=s((e=>{var t=iq();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),oq=s(((e,t)=>{var n=aq();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),sq=s((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),cq=s((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
- ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),lq=s((e=>{var t=sq(),n=cq();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),uq=s((e=>{var t=XK(),n=rq(),r=ZK(),i=lq(),a=sq(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),dq=s((e=>{var t=XK(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),fq=s(((e,t)=>{var n=lq();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),pq=s(((e,t)=>{var n=lq(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),mq=s(((e,t)=>{var n=lq();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),hq=s(((e,t)=>{var n=lq(),r=XK();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
- Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),gq=s(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),_q=s((e=>{var t=lq(),n=fq(),r=pq(),i=mq(),a=hq(),o=cq(),s=XK(),c=gq();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
- Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),vq=s((e=>{var t=XK(),n=ZK(),r=QK(),i=$K(),a=eq(),o=tq(),s=nq(),c=rq(),l=oq(),u=uq(),d=dq(),f=lq(),p=_q();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
- The chosen QR Code version cannot contain this amount of data.
- Minimum version required to store current data is: `+c+`.
- `);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),yq=s((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[a[t*i+r]?1:0]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),bq=s((e=>{var t=yq();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),xq=s((e=>{var t=yq();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
- `;return typeof a==`function`&&a(null,p),p}})),Sq=s((e=>{var t=YK(),n=vq(),r=bq(),i=xq();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})})),Cq,wq,Tq=o((()=>{Cq=u(Sq()),M(),wq=class extends f.Modal{statusEl;imgEl;onCancel;constructor(e,t){super(e),this.onCancel=t}onOpen(){let{contentEl:e,modalEl:t}=this;t.addClass(`wechat-qr-modal`);let n=e.createDiv({cls:`wechat-qr-header`});(0,f.setIcon)(n.createSpan({cls:`wechat-qr-icon`}),`message-circle`),n.createEl(`h2`,{text:j(`WeChat Login`)}),n.createEl(`p`,{text:j(`Scan the QR code with WeChat to connect`),cls:`wechat-qr-subtitle`}),this.imgEl=e.createDiv({cls:`wechat-qr-img-container`}).createEl(`img`,{cls:`wechat-qr-img`,attr:{alt:`WeChat QR Code`}}),this.statusEl=e.createDiv({cls:`wechat-qr-status`}),this.setStatus(`loading`,j(`Fetching QR code...`))}onClose(){this.onCancel(),this.contentEl.empty()}async setQRCode(e){if(e){try{let t=await Cq.toDataURL(e,{width:280,margin:2,color:{dark:`#000000`,light:`#ffffff`}});this.imgEl.src=t}catch(e){console.error(`[WeChatQRModal] QR generation failed:`,e),this.setStatus(`error`,j(`Failed to generate QR code`));return}this.setStatus(`waiting`,j(`Waiting for scan...`))}}setStatus(e,t){this.statusEl.empty(),this.statusEl.className=`wechat-qr-status wechat-qr-status--${e}`,(0,f.setIcon)(this.statusEl.createSpan({cls:`wechat-qr-status-icon`}),{loading:`loader`,waiting:`scan`,scanned:`check-circle`,confirmed:`check-circle-2`,expired:`alert-circle`,error:`alert-triangle`}[e]||`info`),this.statusEl.createSpan({text:t})}}})),Eq=c({SILK_SAMPLE_RATE:()=>kq,SilkCodec:()=>Pq});function Dq(e,t){let n=e.byteLength,r=44+n,i=Buffer.allocUnsafe(r),a=0;return i.write(`RIFF`,a),a+=4,i.writeUInt32LE(r-8,a),a+=4,i.write(`WAVE`,a),a+=4,i.write(`fmt `,a),a+=4,i.writeUInt32LE(16,a),a+=4,i.writeUInt16LE(1,a),a+=2,i.writeUInt16LE(1,a),a+=2,i.writeUInt32LE(t,a),a+=4,i.writeUInt32LE(t*2,a),a+=4,i.writeUInt16LE(2,a),a+=2,i.writeUInt16LE(16,a),a+=2,i.write(`data`,a),a+=4,i.writeUInt32LE(n,a),a+=4,Buffer.from(e.buffer,e.byteOffset,e.byteLength).copy(i,a),i}var Oq,kq,Aq,jq,Mq,Nq,Pq,Fq=o((()=>{K_(),Oq=G_(`path`),kq=24e3,Aq=`https://cdn.jsdelivr.net/npm/silk-wasm@3.7.1/lib`,jq=[`index.cjs`,`silk.wasm`],Mq=null,Nq=Function(`return require`)(),Pq=class{dir;absDir;adapter;constructor(e,t){this.adapter=e.vault.adapter,this.dir=(0,f.normalizePath)(`${e.vault.configDir}/plugins/${t}/silk-wasm`);let n=this.adapter.getBasePath();this.absDir=Oq.join(n,this.dir)}async isInstalled(){for(let e of jq)if(!await this.adapter.exists((0,f.normalizePath)(`${this.dir}/${e}`)))return!1;return!0}async download(){await this.adapter.exists(this.dir)||await this.adapter.mkdir(this.dir);try{for(let e of jq){let t=await(0,f.requestUrl)({url:`${Aq}/${e}`}),n=(0,f.normalizePath)(`${this.dir}/${e}`);e.endsWith(`.wasm`)?await this.adapter.writeBinary(n,t.arrayBuffer):await this.adapter.write(n,t.text)}}catch(e){throw await this.remove(),e}Mq=null}async remove(){Mq=null;for(let e of jq){let t=(0,f.normalizePath)(`${this.dir}/${e}`);try{await this.adapter.exists(t)&&await this.adapter.remove(t)}catch{}}try{await this.adapter.rmdir(this.dir,!1)}catch{}}async decodeToWav(e){try{let{data:t}=await(await this.loadModule()).decode(e,kq);return Dq(t,kq)}catch{return null}}async loadModule(){if(Mq)return Mq;let e=Oq.join(this.absDir,`index.cjs`);return Nq.cache?.[e]&&delete Nq.cache[e],Mq=Nq(e),Mq}}}));function J(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}function Iq(e){return e&&Object.assign(zq,e),zq}var Lq,Rq,zq,Bq=o((()=>{Object.freeze({status:`aborted`}),Lq=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Rq=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},zq={}}));function Vq(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Hq(e,t=`|`){return e.map(e=>aJ(e)).join(t)}function Uq(e,t){return typeof t==`bigint`?t.toString():t}function Wq(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Gq(e){return e==null}function Kq(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function qq(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}function Jq(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==xJ)return r===void 0&&(r=xJ,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Yq(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Xq(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Zq(e){return JSON.stringify(e)}function Qq(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function $q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function eJ(e){if($q(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!($q(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function tJ(e){return eJ(e)?{...e}:Array.isArray(e)?[...e]:e}function nJ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function rJ(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function iJ(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function aJ(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function oJ(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function sJ(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return rJ(e,Xq(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Yq(this,`shape`,e),e},checks:[]}))}function cJ(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return rJ(e,Xq(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Yq(this,`shape`,r),r},checks:[]}))}function lJ(e,t){if(!eJ(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return rJ(e,Xq(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Yq(this,`shape`,n),n}}))}function uJ(e,t){if(!eJ(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return rJ(e,Xq(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Yq(this,`shape`,n),n}}))}function dJ(e,t){return rJ(e,Xq(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Yq(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function fJ(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return rJ(t,Xq(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Yq(this,`shape`,i),i},checks:[]}))}function pJ(e,t,n){return rJ(t,Xq(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Yq(this,`shape`,i),i}}))}function mJ(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function hJ(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function gJ(e){return typeof e==`string`?e:e?.message}function _J(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=gJ(e.inst?._zod.def?.error?.(e))??gJ(t?.error?.(e))??gJ(n.customError?.(e))??gJ(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function vJ(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function yJ(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function bJ(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var xJ,SJ,CJ,wJ,TJ,EJ=o((()=>{xJ=Symbol(`evaluating`),SJ=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},CJ=Wq(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),wJ=new Set([`string`,`number`,`symbol`]),TJ={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}}));function DJ(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function OJ(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var kJ,AJ,jJ,MJ=o((()=>{Bq(),EJ(),kJ=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Uq,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},AJ=J(`$ZodError`,kJ),jJ=J(`$ZodError`,kJ,{Parent:Error})})),NJ,PJ,FJ,IJ,LJ,RJ,zJ,BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ=o((()=>{Bq(),MJ(),EJ(),NJ=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Lq;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>_J(e,a,Iq())));throw SJ(t,i?.callee),t}return o.value},PJ=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>_J(e,a,Iq())));throw SJ(t,i?.callee),t}return o.value},FJ=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Lq;return a.issues.length?{success:!1,error:new(e??AJ)(a.issues.map(e=>_J(e,i,Iq())))}:{success:!0,data:a.value}},IJ=FJ(jJ),LJ=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>_J(e,i,Iq())))}:{success:!0,data:a.value}},RJ=LJ(jJ),zJ=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return NJ(e)(t,n,i)},BJ=e=>(t,n,r)=>NJ(e)(t,n,r),VJ=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return PJ(e)(t,n,i)},HJ=e=>async(t,n,r)=>PJ(e)(t,n,r),UJ=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return FJ(e)(t,n,i)},WJ=e=>(t,n,r)=>FJ(e)(t,n,r),GJ=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return LJ(e)(t,n,i)},KJ=e=>async(t,n,r)=>LJ(e)(t,n,r)}));function JJ(){return new RegExp(cY,`u`)}function YJ(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function XJ(e){return RegExp(`^${YJ(e)}$`)}function ZJ(e){let t=YJ({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${gY}T(?:${r})$`)}var QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY,cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY=o((()=>{QJ=/^[cC][^\s-]{8,}$/,$J=/^[0-9a-z]+$/,eY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tY=/^[0-9a-vA-V]{20}$/,nY=/^[A-Za-z0-9]{27}$/,rY=/^[a-zA-Z0-9_-]{21}$/,iY=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,aY=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,oY=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,sY=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cY=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,lY=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uY=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,dY=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,fY=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pY=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mY=/^[A-Za-z0-9_-]*$/,hY=/^\+[1-9]\d{6,14}$/,gY=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,_Y=RegExp(`^${gY}$`),vY=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},yY=/^-?\d+$/,bY=/^-?\d+(?:\.\d+)?$/,xY=/^(?:true|false)$/i,SY=/^[^A-Z]*$/,CY=/^[^a-z]*$/})),TY,EY,DY,OY,kY,AY,jY,MY,NY,PY,FY,IY,LY,RY,zY,BY,VY,HY=o((()=>{Bq(),wY(),EJ(),TY=J(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),EY={number:`number`,bigint:`bigint`,object:`date`},DY=J(`$ZodCheckLessThan`,(e,t)=>{TY.init(e,t);let n=EY[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),OY=J(`$ZodCheckGreaterThan`,(e,t)=>{TY.init(e,t);let n=EY[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kY=J(`$ZodCheckMultipleOf`,(e,t)=>{TY.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):qq(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),AY=J(`$ZodCheckNumberFormat`,(e,t)=>{TY.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=TJ[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=yY)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),jY=J(`$ZodCheckMaxLength`,(e,t)=>{var n;TY.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Gq(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=vJ(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),MY=J(`$ZodCheckMinLength`,(e,t)=>{var n;TY.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Gq(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=vJ(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),NY=J(`$ZodCheckLengthEquals`,(e,t)=>{var n;TY.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Gq(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=vJ(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),PY=J(`$ZodCheckStringFormat`,(e,t)=>{var n,r;TY.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),FY=J(`$ZodCheckRegex`,(e,t)=>{PY.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),IY=J(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=SY,PY.init(e,t)}),LY=J(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=CY,PY.init(e,t)}),RY=J(`$ZodCheckIncludes`,(e,t)=>{TY.init(e,t);let n=nJ(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),zY=J(`$ZodCheckStartsWith`,(e,t)=>{TY.init(e,t);let n=RegExp(`^${nJ(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),BY=J(`$ZodCheckEndsWith`,(e,t)=>{TY.init(e,t);let n=RegExp(`.*${nJ(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),VY=J(`$ZodCheckOverwrite`,(e,t)=>{TY.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),UY,WY=o((()=>{UY=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
- `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
- `))}}})),GY,KY=o((()=>{GY={major:4,minor:3,patch:6}}));function qY(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function JY(e){if(!mY.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return qY(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function YY(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function XY(e,t,n){e.issues.length&&t.issues.push(...hJ(n,e.issues)),t.value[n]=e.value}function ZY(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...hJ(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function QY(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=oJ(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function $Y(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ZY(e,n,i,t,u))):ZY(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}function eX(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!mJ(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>_J(e,r,Iq())))}),t)}function tX(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(eJ(e)&&eJ(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=tX(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=tX(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function nX(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),mJ(e))return e;let o=tX(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}function rX(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}function iX(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function aX(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function oX(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function sX(e){return e.value=Object.freeze(e.value),e}function cX(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(bJ(e))}}var lX,uX,dX,fX,pX,mX,hX,gX,_X,vX,yX,bX,xX,SX,CX,wX,TX,EX,DX,OX,kX,AX,jX,MX,NX,PX,FX,IX,LX,RX,zX,BX,VX,HX,UX,WX,GX,KX,qX,JX,YX,XX,ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ=o((()=>{HY(),Bq(),WY(),qJ(),wY(),EJ(),KY(),lX=J(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=GY;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=mJ(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Lq;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=mJ(e,t))});else{if(e.issues.length===t)continue;r||=mJ(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(mJ(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Lq;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Lq;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Jq(e,`~standard`,()=>({validate:t=>{try{let n=IJ(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return RJ(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),uX=J(`$ZodString`,(e,t)=>{lX.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vY(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),dX=J(`$ZodStringFormat`,(e,t)=>{PY.init(e,t),uX.init(e,t)}),fX=J(`$ZodGUID`,(e,t)=>{t.pattern??=aY,dX.init(e,t)}),pX=J(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=oY(e)}else t.pattern??=oY();dX.init(e,t)}),mX=J(`$ZodEmail`,(e,t)=>{t.pattern??=sY,dX.init(e,t)}),hX=J(`$ZodURL`,(e,t)=>{dX.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),gX=J(`$ZodEmoji`,(e,t)=>{t.pattern??=JJ(),dX.init(e,t)}),_X=J(`$ZodNanoID`,(e,t)=>{t.pattern??=rY,dX.init(e,t)}),vX=J(`$ZodCUID`,(e,t)=>{t.pattern??=QJ,dX.init(e,t)}),yX=J(`$ZodCUID2`,(e,t)=>{t.pattern??=$J,dX.init(e,t)}),bX=J(`$ZodULID`,(e,t)=>{t.pattern??=eY,dX.init(e,t)}),xX=J(`$ZodXID`,(e,t)=>{t.pattern??=tY,dX.init(e,t)}),SX=J(`$ZodKSUID`,(e,t)=>{t.pattern??=nY,dX.init(e,t)}),CX=J(`$ZodISODateTime`,(e,t)=>{t.pattern??=ZJ(t),dX.init(e,t)}),wX=J(`$ZodISODate`,(e,t)=>{t.pattern??=_Y,dX.init(e,t)}),TX=J(`$ZodISOTime`,(e,t)=>{t.pattern??=XJ(t),dX.init(e,t)}),EX=J(`$ZodISODuration`,(e,t)=>{t.pattern??=iY,dX.init(e,t)}),DX=J(`$ZodIPv4`,(e,t)=>{t.pattern??=lY,dX.init(e,t),e._zod.bag.format=`ipv4`}),OX=J(`$ZodIPv6`,(e,t)=>{t.pattern??=uY,dX.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),kX=J(`$ZodCIDRv4`,(e,t)=>{t.pattern??=dY,dX.init(e,t)}),AX=J(`$ZodCIDRv6`,(e,t)=>{t.pattern??=fY,dX.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),jX=J(`$ZodBase64`,(e,t)=>{t.pattern??=pY,dX.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{qY(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),MX=J(`$ZodBase64URL`,(e,t)=>{t.pattern??=mY,dX.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{JY(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),NX=J(`$ZodE164`,(e,t)=>{t.pattern??=hY,dX.init(e,t)}),PX=J(`$ZodJWT`,(e,t)=>{dX.init(e,t),e._zod.check=n=>{YY(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),FX=J(`$ZodNumber`,(e,t)=>{lX.init(e,t),e._zod.pattern=e._zod.bag.pattern??bY,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),IX=J(`$ZodNumberFormat`,(e,t)=>{AY.init(e,t),FX.init(e,t)}),LX=J(`$ZodBoolean`,(e,t)=>{lX.init(e,t),e._zod.pattern=xY,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),RX=J(`$ZodUnknown`,(e,t)=>{lX.init(e,t),e._zod.parse=e=>e}),zX=J(`$ZodNever`,(e,t)=>{lX.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),BX=J(`$ZodArray`,(e,t)=>{lX.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>XY(t,n,e))):XY(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),VX=J(`$ZodObject`,(e,t)=>{if(lX.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Wq(()=>QY(t));Jq(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=$q,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>ZY(n,t,e,s,r))):ZY(i,t,e,s,r)}return i?$Y(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),HX=J(`$ZodObjectJIT`,(e,t)=>{VX.init(e,t);let n=e._zod.parse,r=Wq(()=>QY(t)),i=e=>{let t=new UY([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Zq(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Zq(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
- if (${n}.issues.length) {
- if (${o} in input) {
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
- ...iss,
- path: iss.path ? [${o}, ...iss.path] : [${o}]
- })));
- }
- }
-
- if (${n}.value === undefined) {
- if (${o} in input) {
- newResult[${o}] = undefined;
- }
- } else {
- newResult[${o}] = ${n}.value;
- }
-
- `):t.write(`
- if (${n}.issues.length) {
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
- ...iss,
- path: iss.path ? [${o}, ...iss.path] : [${o}]
- })));
- }
-
- if (${n}.value === undefined) {
- if (${o} in input) {
- newResult[${o}] = undefined;
- }
- } else {
- newResult[${o}] = ${n}.value;
- }
-
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=$q,s=!zq.jitless,c=s&&CJ.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?$Y([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}}),UX=J(`$ZodUnion`,(e,t)=>{lX.init(e,t),Jq(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Jq(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Jq(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Jq(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Kq(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>eX(t,i,e,a)):eX(s,i,e,a)}}),WX=J(`$ZodIntersection`,(e,t)=>{lX.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>nX(e,t,n)):nX(e,i,a)}}),GX=J(`$ZodRecord`,(e,t)=>{lX.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!eJ(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...hJ(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...hJ(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&bY.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>_J(e,r,Iq())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...hJ(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...hJ(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),KX=J(`$ZodEnum`,(e,t)=>{lX.init(e,t);let n=Vq(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>wJ.has(typeof e)).map(e=>typeof e==`string`?nJ(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),qX=J(`$ZodLiteral`,(e,t)=>{if(lX.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?nJ(e):e?nJ(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),JX=J(`$ZodTransform`,(e,t)=>{lX.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Rq(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Lq;return n.value=i,n}}),YX=J(`$ZodOptional`,(e,t)=>{lX.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Jq(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Jq(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Kq(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>rX(t,e.value)):rX(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),XX=J(`$ZodExactOptional`,(e,t)=>{YX.init(e,t),Jq(e._zod,`values`,()=>t.innerType._zod.values),Jq(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ZX=J(`$ZodNullable`,(e,t)=>{lX.init(e,t),Jq(e._zod,`optin`,()=>t.innerType._zod.optin),Jq(e._zod,`optout`,()=>t.innerType._zod.optout),Jq(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Kq(e.source)}|null)$`):void 0}),Jq(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),QX=J(`$ZodDefault`,(e,t)=>{lX.init(e,t),e._zod.optin=`optional`,Jq(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>iX(e,t)):iX(r,t)}}),$X=J(`$ZodPrefault`,(e,t)=>{lX.init(e,t),e._zod.optin=`optional`,Jq(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),eZ=J(`$ZodNonOptional`,(e,t)=>{lX.init(e,t),Jq(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>aX(t,e)):aX(i,e)}}),tZ=J(`$ZodCatch`,(e,t)=>{lX.init(e,t),Jq(e._zod,`optin`,()=>t.innerType._zod.optin),Jq(e._zod,`optout`,()=>t.innerType._zod.optout),Jq(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>_J(e,n,Iq()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>_J(e,n,Iq()))},input:e.value}),e.issues=[]),e)}}),nZ=J(`$ZodPipe`,(e,t)=>{lX.init(e,t),Jq(e._zod,`values`,()=>t.in._zod.values),Jq(e._zod,`optin`,()=>t.in._zod.optin),Jq(e._zod,`optout`,()=>t.out._zod.optout),Jq(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>oX(e,t.in,n)):oX(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>oX(e,t.out,n)):oX(r,t.out,n)}}),rZ=J(`$ZodReadonly`,(e,t)=>{lX.init(e,t),Jq(e._zod,`propValues`,()=>t.innerType._zod.propValues),Jq(e._zod,`values`,()=>t.innerType._zod.values),Jq(e._zod,`optin`,()=>t.innerType?._zod?.optin),Jq(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(sX):sX(r)}}),iZ=J(`$ZodCustom`,(e,t)=>{TY.init(e,t),lX.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>cX(t,n,r,e));cX(i,n,r,e)}})}));function oZ(){return{localeError:sZ()}}var sZ,cZ=o((()=>{EJ(),sZ=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=yJ(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${aJ(e.values[0])}`:`Invalid option: expected one of ${Hq(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Hq(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}}}));function lZ(){return new dZ}var uZ,dZ,fZ,pZ=o((()=>{dZ=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}},(uZ=globalThis).__zod_globalRegistry??(uZ.__zod_globalRegistry=lZ()),fZ=globalThis.__zod_globalRegistry}));function mZ(e,t){return new e({type:`string`,...iJ(t)})}function hZ(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...iJ(t)})}function gZ(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...iJ(t)})}function _Z(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...iJ(t)})}function vZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...iJ(t)})}function yZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...iJ(t)})}function bZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...iJ(t)})}function xZ(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...iJ(t)})}function SZ(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...iJ(t)})}function CZ(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...iJ(t)})}function wZ(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...iJ(t)})}function TZ(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...iJ(t)})}function EZ(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...iJ(t)})}function DZ(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...iJ(t)})}function OZ(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...iJ(t)})}function kZ(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...iJ(t)})}function AZ(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...iJ(t)})}function jZ(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...iJ(t)})}function MZ(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...iJ(t)})}function NZ(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...iJ(t)})}function PZ(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...iJ(t)})}function FZ(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...iJ(t)})}function IZ(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...iJ(t)})}function LZ(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...iJ(t)})}function RZ(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...iJ(t)})}function zZ(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...iJ(t)})}function BZ(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...iJ(t)})}function VZ(e,t){return new e({type:`number`,checks:[],...iJ(t)})}function HZ(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...iJ(t)})}function UZ(e,t){return new e({type:`boolean`,...iJ(t)})}function WZ(e){return new e({type:`unknown`})}function GZ(e,t){return new e({type:`never`,...iJ(t)})}function KZ(e,t){return new DY({check:`less_than`,...iJ(t),value:e,inclusive:!1})}function qZ(e,t){return new DY({check:`less_than`,...iJ(t),value:e,inclusive:!0})}function JZ(e,t){return new OY({check:`greater_than`,...iJ(t),value:e,inclusive:!1})}function YZ(e,t){return new OY({check:`greater_than`,...iJ(t),value:e,inclusive:!0})}function XZ(e,t){return new kY({check:`multiple_of`,...iJ(t),value:e})}function ZZ(e,t){return new jY({check:`max_length`,...iJ(t),maximum:e})}function QZ(e,t){return new MY({check:`min_length`,...iJ(t),minimum:e})}function $Z(e,t){return new NY({check:`length_equals`,...iJ(t),length:e})}function eQ(e,t){return new FY({check:`string_format`,format:`regex`,...iJ(t),pattern:e})}function tQ(e){return new IY({check:`string_format`,format:`lowercase`,...iJ(e)})}function nQ(e){return new LY({check:`string_format`,format:`uppercase`,...iJ(e)})}function rQ(e,t){return new RY({check:`string_format`,format:`includes`,...iJ(t),includes:e})}function iQ(e,t){return new zY({check:`string_format`,format:`starts_with`,...iJ(t),prefix:e})}function aQ(e,t){return new BY({check:`string_format`,format:`ends_with`,...iJ(t),suffix:e})}function oQ(e){return new VY({check:`overwrite`,tx:e})}function sQ(e){return oQ(t=>t.normalize(e))}function cQ(){return oQ(e=>e.trim())}function lQ(){return oQ(e=>e.toLowerCase())}function uQ(){return oQ(e=>e.toUpperCase())}function dQ(){return oQ(e=>Qq(e))}function fQ(e,t,n){return new e({type:`array`,element:t,...iJ(n)})}function pQ(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...iJ(n)})}function mQ(e){let t=hQ(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(bJ(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(bJ(r))}},e(n.value,n)));return t}function hQ(e,t){let n=new TY({check:`custom`,...iJ(t)});return n._zod.check=e,n}var gQ=o((()=>{HY(),pZ(),EJ()}));function _Q(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??fZ,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function vQ(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,vQ(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&xQ(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function yQ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function bQ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:CQ(t,`input`,e.processors),output:CQ(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function xQ(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return xQ(r.element,n);if(r.type===`set`)return xQ(r.valueType,n);if(r.type===`lazy`)return xQ(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return xQ(r.innerType,n);if(r.type===`intersection`)return xQ(r.left,n)||xQ(r.right,n);if(r.type===`record`||r.type===`map`)return xQ(r.keyType,n)||xQ(r.valueType,n);if(r.type===`pipe`)return xQ(r.in,n)||xQ(r.out,n);if(r.type===`object`){for(let e in r.shape)if(xQ(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(xQ(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(xQ(e,n))return!0;return!!(r.rest&&xQ(r.rest,n))}return!1}var SQ,CQ,wQ=o((()=>{pZ(),SQ=(e,t={})=>n=>{let r=_Q({...n,processors:t});return vQ(e,r),yQ(r,e),bQ(r,e)},CQ=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=_Q({...i??{},target:a,io:t,processors:n});return vQ(e,o),yQ(o,e),bQ(o,e)}})),TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,zQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ=o((()=>{wQ(),EJ(),TQ={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},EQ=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=TQ[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},DQ=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},OQ=(e,t,n,r)=>{n.type=`boolean`},kQ=(e,t,n,r)=>{n.not={}},AQ=(e,t,n,r)=>{},jQ=(e,t,n,r)=>{let i=e._zod.def,a=Vq(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},MQ=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},NQ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},PQ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},FQ=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=vQ(a.element,t,{...r,path:[...r.path,`items`]})},IQ=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=vQ(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=vQ(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},LQ=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>vQ(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},RQ=(e,t,n,r)=>{let i=e._zod.def,a=vQ(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=vQ(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},zQ=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=vQ(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=vQ(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=vQ(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},BQ=(e,t,n,r)=>{let i=e._zod.def,a=vQ(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},VQ=(e,t,n,r)=>{let i=e._zod.def;vQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},HQ=(e,t,n,r)=>{let i=e._zod.def;vQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},UQ=(e,t,n,r)=>{let i=e._zod.def;vQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},WQ=(e,t,n,r)=>{let i=e._zod.def;vQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},GQ=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;vQ(a,t,r);let o=t.seen.get(e);o.ref=a},KQ=(e,t,n,r)=>{let i=e._zod.def;vQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},qQ=(e,t,n,r)=>{let i=e._zod.def;vQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType}})),YQ=o((()=>{Bq(),qJ(),MJ(),aZ(),HY(),KY(),EJ(),pZ(),WY(),gQ(),wQ()})),XQ=o((()=>{YQ()}));function ZQ(e){return LZ(t$,e)}function QQ(e){return RZ(n$,e)}function $Q(e){return zZ(r$,e)}function e$(e){return BZ(i$,e)}var t$,n$,r$,i$,a$=o((()=>{YQ(),F1(),t$=J(`ZodISODateTime`,(e,t)=>{CX.init(e,t),K$.init(e,t)}),n$=J(`ZodISODate`,(e,t)=>{wX.init(e,t),K$.init(e,t)}),r$=J(`ZodISOTime`,(e,t)=>{TX.init(e,t),K$.init(e,t)}),i$=J(`ZodISODuration`,(e,t)=>{EX.init(e,t),K$.init(e,t)})})),o$,s$,c$,l$=o((()=>{YQ(),EJ(),o$=(e,t)=>{AJ.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>OJ(e,t)},flatten:{value:t=>DJ(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Uq,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Uq,2)}},isEmpty:{get(){return e.issues.length===0}}})},s$=J(`ZodError`,o$),c$=J(`ZodError`,o$,{Parent:Error})})),u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$=o((()=>{YQ(),l$(),u$=NJ(c$),d$=PJ(c$),f$=FJ(c$),p$=LJ(c$),m$=zJ(c$),h$=BJ(c$),g$=VJ(c$),_$=HJ(c$),v$=UJ(c$),y$=WJ(c$),b$=GJ(c$),x$=KJ(c$)}));function Y(e){return mZ(G$,e)}function C$(e){return VZ(f1,e)}function w$(e){return HZ(p1,e)}function T$(e){return UZ(m1,e)}function X(){return WZ(h1)}function E$(e){return GZ(g1,e)}function D$(e,t){return fQ(_1,e,t)}function Z(e,t){return new v1({type:`object`,shape:e,catchall:X(),...iJ(t)})}function O$(e,t){return new y1({type:`union`,options:e,...iJ(t)})}function k$(e,t){return new b1({type:`intersection`,left:e,right:t})}function Q(e,t,n){return new x1({type:`record`,keyType:e,valueType:t,...iJ(n)})}function A$(e,t){return new S1({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...iJ(t)})}function $(e,t){return new C1({type:`literal`,values:Array.isArray(e)?e:[e],...iJ(t)})}function j$(e){return new w1({type:`transform`,transform:e})}function M$(e){return new T1({type:`optional`,innerType:e})}function N$(e){return new E1({type:`optional`,innerType:e})}function P$(e){return new D1({type:`nullable`,innerType:e})}function F$(e,t){return new O1({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():tJ(t)}})}function I$(e,t){return new k1({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():tJ(t)}})}function L$(e,t){return new A1({type:`nonoptional`,innerType:e,...iJ(t)})}function R$(e,t){return new j1({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}function z$(e,t){return new M1({type:`pipe`,in:e,out:t})}function B$(e){return new N1({type:`readonly`,innerType:e})}function V$(e,t={}){return pQ(P1,e,t)}function H$(e){return mQ(e)}var U$,W$,G$,K$,q$,J$,Y$,X$,Z$,Q$,$$,e1,t1,n1,r1,i1,a1,o1,s1,c1,l1,u1,d1,f1,p1,m1,h1,g1,_1,v1,y1,b1,x1,S1,C1,w1,T1,E1,D1,O1,k1,A1,j1,M1,N1,P1,F1=o((()=>{YQ(),JQ(),wQ(),XQ(),a$(),S$(),U$=J(`ZodType`,(e,t)=>(lX.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:CQ(e,`input`),output:CQ(e,`output`)}}),e.toJSONSchema=SQ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Xq(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>rJ(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>u$(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>f$(e,t,n),e.parseAsync=async(t,n)=>d$(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>p$(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>m$(e,t,n),e.decode=(t,n)=>h$(e,t,n),e.encodeAsync=async(t,n)=>g$(e,t,n),e.decodeAsync=async(t,n)=>_$(e,t,n),e.safeEncode=(t,n)=>v$(e,t,n),e.safeDecode=(t,n)=>y$(e,t,n),e.safeEncodeAsync=async(t,n)=>b$(e,t,n),e.safeDecodeAsync=async(t,n)=>x$(e,t,n),e.refine=(t,n)=>e.check(V$(t,n)),e.superRefine=t=>e.check(H$(t)),e.overwrite=t=>e.check(oQ(t)),e.optional=()=>M$(e),e.exactOptional=()=>N$(e),e.nullable=()=>P$(e),e.nullish=()=>M$(P$(e)),e.nonoptional=t=>L$(e,t),e.array=()=>D$(e),e.or=t=>O$([e,t]),e.and=t=>k$(e,t),e.transform=t=>z$(e,j$(t)),e.default=t=>F$(e,t),e.prefault=t=>I$(e,t),e.catch=t=>R$(e,t),e.pipe=t=>z$(e,t),e.readonly=()=>B$(e),e.describe=t=>{let n=e.clone();return fZ.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return fZ.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return fZ.get(e);let n=e.clone();return fZ.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),W$=J(`_ZodString`,(e,t)=>{uX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EQ(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(eQ(...t)),e.includes=(...t)=>e.check(rQ(...t)),e.startsWith=(...t)=>e.check(iQ(...t)),e.endsWith=(...t)=>e.check(aQ(...t)),e.min=(...t)=>e.check(QZ(...t)),e.max=(...t)=>e.check(ZZ(...t)),e.length=(...t)=>e.check($Z(...t)),e.nonempty=(...t)=>e.check(QZ(1,...t)),e.lowercase=t=>e.check(tQ(t)),e.uppercase=t=>e.check(nQ(t)),e.trim=()=>e.check(cQ()),e.normalize=(...t)=>e.check(sQ(...t)),e.toLowerCase=()=>e.check(lQ()),e.toUpperCase=()=>e.check(uQ()),e.slugify=()=>e.check(dQ())}),G$=J(`ZodString`,(e,t)=>{uX.init(e,t),W$.init(e,t),e.email=t=>e.check(hZ(q$,t)),e.url=t=>e.check(xZ(X$,t)),e.jwt=t=>e.check(IZ(d1,t)),e.emoji=t=>e.check(SZ(Z$,t)),e.guid=t=>e.check(gZ(J$,t)),e.uuid=t=>e.check(_Z(Y$,t)),e.uuidv4=t=>e.check(vZ(Y$,t)),e.uuidv6=t=>e.check(yZ(Y$,t)),e.uuidv7=t=>e.check(bZ(Y$,t)),e.nanoid=t=>e.check(CZ(Q$,t)),e.guid=t=>e.check(gZ(J$,t)),e.cuid=t=>e.check(wZ($$,t)),e.cuid2=t=>e.check(TZ(e1,t)),e.ulid=t=>e.check(EZ(t1,t)),e.base64=t=>e.check(NZ(c1,t)),e.base64url=t=>e.check(PZ(l1,t)),e.xid=t=>e.check(DZ(n1,t)),e.ksuid=t=>e.check(OZ(r1,t)),e.ipv4=t=>e.check(kZ(i1,t)),e.ipv6=t=>e.check(AZ(a1,t)),e.cidrv4=t=>e.check(jZ(o1,t)),e.cidrv6=t=>e.check(MZ(s1,t)),e.e164=t=>e.check(FZ(u1,t)),e.datetime=t=>e.check(ZQ(t)),e.date=t=>e.check(QQ(t)),e.time=t=>e.check($Q(t)),e.duration=t=>e.check(e$(t))}),K$=J(`ZodStringFormat`,(e,t)=>{dX.init(e,t),W$.init(e,t)}),q$=J(`ZodEmail`,(e,t)=>{mX.init(e,t),K$.init(e,t)}),J$=J(`ZodGUID`,(e,t)=>{fX.init(e,t),K$.init(e,t)}),Y$=J(`ZodUUID`,(e,t)=>{pX.init(e,t),K$.init(e,t)}),X$=J(`ZodURL`,(e,t)=>{hX.init(e,t),K$.init(e,t)}),Z$=J(`ZodEmoji`,(e,t)=>{gX.init(e,t),K$.init(e,t)}),Q$=J(`ZodNanoID`,(e,t)=>{_X.init(e,t),K$.init(e,t)}),$$=J(`ZodCUID`,(e,t)=>{vX.init(e,t),K$.init(e,t)}),e1=J(`ZodCUID2`,(e,t)=>{yX.init(e,t),K$.init(e,t)}),t1=J(`ZodULID`,(e,t)=>{bX.init(e,t),K$.init(e,t)}),n1=J(`ZodXID`,(e,t)=>{xX.init(e,t),K$.init(e,t)}),r1=J(`ZodKSUID`,(e,t)=>{SX.init(e,t),K$.init(e,t)}),i1=J(`ZodIPv4`,(e,t)=>{DX.init(e,t),K$.init(e,t)}),a1=J(`ZodIPv6`,(e,t)=>{OX.init(e,t),K$.init(e,t)}),o1=J(`ZodCIDRv4`,(e,t)=>{kX.init(e,t),K$.init(e,t)}),s1=J(`ZodCIDRv6`,(e,t)=>{AX.init(e,t),K$.init(e,t)}),c1=J(`ZodBase64`,(e,t)=>{jX.init(e,t),K$.init(e,t)}),l1=J(`ZodBase64URL`,(e,t)=>{MX.init(e,t),K$.init(e,t)}),u1=J(`ZodE164`,(e,t)=>{NX.init(e,t),K$.init(e,t)}),d1=J(`ZodJWT`,(e,t)=>{PX.init(e,t),K$.init(e,t)}),f1=J(`ZodNumber`,(e,t)=>{FX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DQ(e,t,n,r),e.gt=(t,n)=>e.check(JZ(t,n)),e.gte=(t,n)=>e.check(YZ(t,n)),e.min=(t,n)=>e.check(YZ(t,n)),e.lt=(t,n)=>e.check(KZ(t,n)),e.lte=(t,n)=>e.check(qZ(t,n)),e.max=(t,n)=>e.check(qZ(t,n)),e.int=t=>e.check(w$(t)),e.safe=t=>e.check(w$(t)),e.positive=t=>e.check(JZ(0,t)),e.nonnegative=t=>e.check(YZ(0,t)),e.negative=t=>e.check(KZ(0,t)),e.nonpositive=t=>e.check(qZ(0,t)),e.multipleOf=(t,n)=>e.check(XZ(t,n)),e.step=(t,n)=>e.check(XZ(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),p1=J(`ZodNumberFormat`,(e,t)=>{IX.init(e,t),f1.init(e,t)}),m1=J(`ZodBoolean`,(e,t)=>{LX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>OQ(e,t,n,r)}),h1=J(`ZodUnknown`,(e,t)=>{RX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AQ(e,t,n,r)}),g1=J(`ZodNever`,(e,t)=>{zX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kQ(e,t,n,r)}),_1=J(`ZodArray`,(e,t)=>{BX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FQ(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(QZ(t,n)),e.nonempty=t=>e.check(QZ(1,t)),e.max=(t,n)=>e.check(ZZ(t,n)),e.length=(t,n)=>e.check($Z(t,n)),e.unwrap=()=>e.element}),v1=J(`ZodObject`,(e,t)=>{HX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IQ(e,t,n,r),Jq(e,`shape`,()=>t.shape),e.keyof=()=>A$(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:X()}),e.loose=()=>e.clone({...e._zod.def,catchall:X()}),e.strict=()=>e.clone({...e._zod.def,catchall:E$()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>lJ(e,t),e.safeExtend=t=>uJ(e,t),e.merge=t=>dJ(e,t),e.pick=t=>sJ(e,t),e.omit=t=>cJ(e,t),e.partial=(...t)=>fJ(T1,e,t[0]),e.required=(...t)=>pJ(A1,e,t[0])}),y1=J(`ZodUnion`,(e,t)=>{UX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LQ(e,t,n,r),e.options=t.options}),b1=J(`ZodIntersection`,(e,t)=>{WX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RQ(e,t,n,r)}),x1=J(`ZodRecord`,(e,t)=>{GX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zQ(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType}),S1=J(`ZodEnum`,(e,t)=>{KX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jQ(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new S1({...t,checks:[],...iJ(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new S1({...t,checks:[],...iJ(r),entries:i})}}),C1=J(`ZodLiteral`,(e,t)=>{qX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MQ(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),w1=J(`ZodTransform`,(e,t)=>{JX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PQ(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Rq(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(bJ(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(bJ(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),T1=J(`ZodOptional`,(e,t)=>{YX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),E1=J(`ZodExactOptional`,(e,t)=>{XX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),D1=J(`ZodNullable`,(e,t)=>{ZX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),O1=J(`ZodDefault`,(e,t)=>{QX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),k1=J(`ZodPrefault`,(e,t)=>{$X.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),A1=J(`ZodNonOptional`,(e,t)=>{eZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),j1=J(`ZodCatch`,(e,t)=>{tZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),M1=J(`ZodPipe`,(e,t)=>{nZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GQ(e,t,n,r),e.in=t.in,e.out=t.out}),N1=J(`ZodReadonly`,(e,t)=>{rZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),P1=J(`ZodCustom`,(e,t)=>{iZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NQ(e,t,n,r)})})),I1,L1=o((()=>{(function(e){})(I1||={})})),R1=o((()=>{F1(),XQ(),l$(),S$(),L1(),YQ(),cZ(),Iq(oZ())})),z1=o((()=>{R1(),R1()})),B1=o((()=>{z1()})),V1,H1,U1=o((()=>{V1={authenticate:`authenticate`,initialize:`initialize`,logout:`logout`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},H1={fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_elicitation:`session/elicitation`,session_elicitation_complete:`session/elicitation/complete`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`}})),W1,G1,K1,q1,J1,Y1,X1,Z1,Q1,$1,e0,t0,n0,r0,i0,a0,o0,s0,c0,l0,u0,d0,f0,p0,m0,h0,g0,_0,v0,y0,b0,x0,S0,C0,w0,T0,E0,D0,O0,k0,A0,j0,M0,N0,P0,F0,I0,L0,R0,z0,B0,V0,H0,U0,W0,G0,K0,q0,J0,Y0,X0,Z0,Q0,$0,e2,t2,n2,r2,i2,a2,o2,s2,c2,l2,u2,d2,f2,p2,m2,h2,g2,_2,v2,y2,b2,x2,S2,C2,w2,T2,E2,D2,O2,k2,A2,j2,M2,N2,P2,F2,I2,L2,R2,z2,B2,V2,H2,U2,W2,G2,K2,q2,J2,Y2,X2,Z2,Q2,$2,e4,t4,n4,r4,i4,a4,o4,s4,c4,l4,u4,d4,f4,p4,m4,h4,g4,_4,v4,y4,b4,x4,S4,C4,w4,T4,E4,D4,O4,k4,A4,j4,M4,N4,P4,F4,I4,L4,R4,z4,B4,V4,H4,U4,W4,G4,K4=o((()=>{B1(),W1=Z({_meta:Q(Y(),X()).nullish(),terminal:T$().optional().default(!1)}),G1=Z({_meta:Q(Y(),X()).nullish(),label:Y().nullish(),name:Y(),optional:T$().optional().default(!1),secret:T$().optional().default(!0)}),K1=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),id:Y(),name:Y()}),q1=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),id:Y(),link:Y().nullish(),name:Y(),vars:D$(G1)}),J1=Z({_meta:Q(Y(),X()).nullish(),args:D$(Y()).optional(),description:Y().nullish(),env:Q(Y(),Y()).optional(),id:Y(),name:Y()}),Y1=O$([q1.and(Z({type:$(`env_var`)})),J1.and(Z({type:$(`terminal`)})),K1]),X1=Z({_meta:Q(Y(),X()).nullish(),methodId:Y()}),Z1=Z({_meta:Q(Y(),X()).nullish()}),Q1=Z({_meta:Q(Y(),X()).nullish(),blob:Y(),mimeType:Y().nullish(),uri:Y()}),$1=Z({default:T$().nullish(),description:Y().nullish(),title:Y().nullish()}),e0=Z({_meta:Q(Y(),X()).nullish()}),t0=Z({amount:C$(),currency:Y()}),n0=Z({_meta:Q(Y(),X()).nullish(),terminalId:Y()}),r0=Z({_meta:Q(Y(),X()).nullish(),newText:Y(),oldText:Y().nullish(),path:Y()}),i0=O$([Y(),C$(),C$(),T$(),D$(Y())]),a0=Z({content:Q(Y(),i0).nullish()}),o0=O$([a0.and(Z({action:$(`accept`)})),Z({action:$(`decline`)}),Z({action:$(`cancel`)})]),s0=Z({_meta:Q(Y(),X()).nullish()}),c0=Y(),l0=Z({_meta:Q(Y(),X()).nullish(),elicitationId:c0}),u0=Z({_meta:Q(Y(),X()).nullish(),action:o0}),d0=$(`object`),f0=$(`string`),p0=Z({_meta:Q(Y(),X()).nullish()}),m0=Z({_meta:Q(Y(),X()).nullish(),form:s0.nullish(),url:p0.nullish()}),h0=Z({elicitationId:c0,url:Y().url()}),g0=Z({const:Y(),title:Y()}),_0=Z({_meta:Q(Y(),X()).nullish(),name:Y(),value:Y()}),v0=O$([$(-32700),$(-32600),$(-32601),$(-32602),$(-32603),$(-32800),$(-32e3),$(-32002),$(-32042),C$().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),y0=Z({code:v0,data:X().optional(),message:Y()}),b0=X(),x0=X(),S0=X(),C0=Z({_meta:Q(Y(),X()).nullish(),readTextFile:T$().optional().default(!1),writeTextFile:T$().optional().default(!1)}),w0=Z({_meta:Q(Y(),X()).nullish(),auth:W1.optional().default({terminal:!1}),elicitation:m0.nullish(),fs:C0.optional().default({readTextFile:!1,writeTextFile:!1}),terminal:T$().optional().default(!1)}),T0=Z({_meta:Q(Y(),X()).nullish(),name:Y(),value:Y()}),E0=Z({_meta:Q(Y(),X()).nullish(),name:Y(),title:Y().nullish(),version:Y()}),D0=Z({default:C$().nullish(),description:Y().nullish(),maximum:C$().nullish(),minimum:C$().nullish(),title:Y().nullish()}),O0=Z({_meta:Q(Y(),X()).nullish()}),k0=Z({_meta:Q(Y(),X()).nullish(),cursor:Y().nullish(),cwd:Y().nullish()}),A0=Z({_meta:Q(Y(),X()).nullish()}),j0=Z({_meta:Q(Y(),X()).nullish(),logout:A0.nullish()}),M0=Z({_meta:Q(Y(),X()).nullish()}),N0=Z({_meta:Q(Y(),X()).nullish()}),P0=Z({_meta:Q(Y(),X()).nullish(),http:T$().optional().default(!1),sse:T$().optional().default(!1)}),F0=Z({_meta:Q(Y(),X()).nullish(),headers:D$(T0),name:Y(),url:Y()}),I0=Z({_meta:Q(Y(),X()).nullish(),headers:D$(T0),name:Y(),url:Y()}),L0=Z({_meta:Q(Y(),X()).nullish(),args:D$(Y()),command:Y(),env:D$(_0),name:Y()}),R0=O$([F0.and(Z({type:$(`http`)})),I0.and(Z({type:$(`sse`)})),L0]),z0=Y(),B0=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),modelId:z0,name:Y()}),V0=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),mcpServers:D$(R0)}),H0=Z({default:C$().nullish(),description:Y().nullish(),maximum:C$().nullish(),minimum:C$().nullish(),title:Y().nullish()}),U0=Y(),W0=O$([$(`allow_once`),$(`allow_always`),$(`reject_once`),$(`reject_always`)]),G0=Z({_meta:Q(Y(),X()).nullish(),kind:W0,name:Y(),optionId:U0}),K0=O$([$(`high`),$(`medium`),$(`low`)]),q0=O$([$(`pending`),$(`in_progress`),$(`completed`)]),J0=Z({_meta:Q(Y(),X()).nullish(),content:Y(),priority:K0,status:q0}),Y0=Z({_meta:Q(Y(),X()).nullish(),entries:D$(J0)}),X0=Z({_meta:Q(Y(),X()).nullish(),audio:T$().optional().default(!1),embeddedContext:T$().optional().default(!1),image:T$().optional().default(!1)}),Z0=C$().int().gte(0).lte(65535),Q0=Z({_meta:Q(Y(),X()).nullish(),clientCapabilities:w0.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:E0.nullish(),protocolVersion:Z0}),$0=Z({_meta:Q(Y(),X()).nullish(),content:Y()}),e2=Z({_meta:Q(Y(),X()).nullish()}),t2=O$([C$(),Y()]).nullable(),Z({_meta:Q(Y(),X()).nullish(),requestId:t2}),n2=A$([`assistant`,`user`]),r2=Z({_meta:Q(Y(),X()).nullish(),audience:D$(n2).nullish(),lastModified:Y().nullish(),priority:C$().nullish()}),i2=Z({_meta:Q(Y(),X()).nullish(),annotations:r2.nullish(),data:Y(),mimeType:Y()}),a2=Z({_meta:Q(Y(),X()).nullish(),annotations:r2.nullish(),data:Y(),mimeType:Y(),uri:Y().nullish()}),o2=Z({_meta:Q(Y(),X()).nullish(),annotations:r2.nullish(),description:Y().nullish(),mimeType:Y().nullish(),name:Y(),size:C$().nullish(),title:Y().nullish(),uri:Y()}),s2=Z({_meta:Q(Y(),X()).nullish(),optionId:U0}),c2=O$([Z({outcome:$(`cancelled`)}),s2.and(Z({outcome:$(`selected`)}))]),l2=Z({_meta:Q(Y(),X()).nullish(),outcome:c2}),u2=Z({_meta:Q(Y(),X()).nullish()}),d2=Z({currentValue:T$()}),f2=Y(),p2=Y(),m2=O$([$(`mode`),$(`model`),$(`thought_level`),Y()]),h2=Y(),g2=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),name:Y(),value:h2}),_2=Z({_meta:Q(Y(),X()).nullish(),group:f2,name:Y(),options:D$(g2)}),v2=O$([D$(g2),D$(_2)]),y2=Z({currentValue:h2,options:v2}),b2=k$(O$([y2.and(Z({type:$(`select`)})),d2.and(Z({type:$(`boolean`)}))]),Z({_meta:Q(Y(),X()).nullish(),category:m2.nullish(),description:Y().nullish(),id:p2,name:Y()})),x2=Z({_meta:Q(Y(),X()).nullish(),configOptions:D$(b2)}),S2=Z({_meta:Q(Y(),X()).nullish()}),C2=Y(),w2=Z({_meta:Q(Y(),X()).nullish(),sessionId:C2}),Z({method:Y(),params:O$([w2,b0]).nullish()}),T2=Z({_meta:Q(Y(),X()).nullish(),sessionId:C2}),E2=Z({_meta:Q(Y(),X()).nullish(),args:D$(Y()).optional(),command:Y(),cwd:Y().nullish(),env:D$(_0).optional(),outputByteLimit:C$().nullish(),sessionId:C2}),D2=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),mcpServers:D$(R0).optional(),sessionId:C2}),O2=Z({_meta:Q(Y(),X()).nullish(),sessionId:C2,terminalId:Y()}),k2=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),mcpServers:D$(R0),sessionId:C2}),A2=Z({_meta:Q(Y(),X()).nullish(),limit:C$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:C$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:Y(),sessionId:C2}),j2=Z({_meta:Q(Y(),X()).nullish(),sessionId:C2,terminalId:Y()}),M2=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),mcpServers:D$(R0).optional(),sessionId:C2}),N2=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),sessionId:C2,title:Y().nullish(),updatedAt:Y().nullish()}),P2=Z({_meta:Q(Y(),X()).nullish(),nextCursor:Y().nullish(),sessions:D$(N2)}),F2=Z({_meta:Q(Y(),X()).nullish(),title:Y().nullish(),updatedAt:Y().nullish()}),I2=Z({_meta:Q(Y(),X()).nullish()}),L2=Y(),R2=Z({_meta:Q(Y(),X()).nullish(),currentModeId:L2}),z2=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),id:L2,name:Y()}),B2=Z({_meta:Q(Y(),X()).nullish(),availableModes:D$(z2),currentModeId:L2}),V2=Z({_meta:Q(Y(),X()).nullish(),availableModels:D$(B0),currentModelId:z0}),H2=Z({_meta:Q(Y(),X()).nullish(),configOptions:D$(b2).nullish(),models:V2.nullish(),modes:B2.nullish(),sessionId:C2}),U2=Z({_meta:Q(Y(),X()).nullish(),configOptions:D$(b2).nullish(),models:V2.nullish(),modes:B2.nullish()}),W2=Z({_meta:Q(Y(),X()).nullish(),configOptions:D$(b2).nullish(),models:V2.nullish(),modes:B2.nullish(),sessionId:C2}),G2=Z({_meta:Q(Y(),X()).nullish(),configOptions:D$(b2).nullish(),models:V2.nullish(),modes:B2.nullish()}),K2=Z({_meta:Q(Y(),X()).nullish()}),q2=Z({_meta:Q(Y(),X()).nullish(),close:u2.nullish(),fork:S2.nullish(),list:I2.nullish(),resume:K2.nullish()}),J2=Z({_meta:Q(Y(),X()).nullish(),auth:j0.optional().default({}),loadSession:T$().optional().default(!1),mcpCapabilities:P0.optional().default({http:!1,sse:!1}),promptCapabilities:X0.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:q2.optional().default({})}),Y2=Z({_meta:Q(Y(),X()).nullish(),agentCapabilities:J2.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:E0.nullish(),authMethods:D$(Y1).optional().default([]),protocolVersion:Z0}),X2=k$(O$([Z({type:$(`boolean`),value:T$()}),Z({value:h2})]),Z({_meta:Q(Y(),X()).nullish(),configId:p2,sessionId:C2})),Z2=Z({_meta:Q(Y(),X()).nullish(),configOptions:D$(b2)}),Q2=Z({_meta:Q(Y(),X()).nullish(),modeId:L2,sessionId:C2}),$2=Z({_meta:Q(Y(),X()).nullish()}),e4=Z({_meta:Q(Y(),X()).nullish(),modelId:z0,sessionId:C2}),t4=Z({_meta:Q(Y(),X()).nullish()}),n4=O$([$(`end_turn`),$(`max_tokens`),$(`max_turn_requests`),$(`refusal`),$(`cancelled`)]),r4=O$([$(`email`),$(`uri`),$(`date`),$(`date-time`)]),i4=Z({default:Y().nullish(),description:Y().nullish(),enum:D$(Y()).nullish(),format:r4.nullish(),maxLength:C$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:C$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:D$(g0).nullish(),pattern:Y().nullish(),title:Y().nullish()}),a4=Z({_meta:Q(Y(),X()).nullish(),terminalId:Y()}),o4=Z({_meta:Q(Y(),X()).nullish(),exitCode:C$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:Y().nullish()}),s4=Z({_meta:Q(Y(),X()).nullish(),sessionId:C2,terminalId:Y()}),c4=Z({_meta:Q(Y(),X()).nullish(),exitStatus:o4.nullish(),output:Y(),truncated:T$()}),l4=Z({_meta:Q(Y(),X()).nullish(),annotations:r2.nullish(),text:Y()}),u4=Z({_meta:Q(Y(),X()).nullish(),mimeType:Y().nullish(),text:Y(),uri:Y()}),d4=O$([u4,Q1]),f4=Z({_meta:Q(Y(),X()).nullish(),annotations:r2.nullish(),resource:d4}),p4=O$([l4.and(Z({type:$(`text`)})),a2.and(Z({type:$(`image`)})),i2.and(Z({type:$(`audio`)})),o2.and(Z({type:$(`resource_link`)})),f4.and(Z({type:$(`resource`)}))]),m4=Z({_meta:Q(Y(),X()).nullish(),content:p4}),h4=Z({_meta:Q(Y(),X()).nullish(),content:p4,messageId:Y().nullish()}),g4=Z({_meta:Q(Y(),X()).nullish(),messageId:Y().nullish(),prompt:D$(p4),sessionId:C2}),Z({id:t2,method:Y(),params:O$([Q0,X1,M0,V0,k2,k0,D2,M2,T2,Q2,X2,g4,e4,x0]).nullish()}),_4=Z({anyOf:D$(g0)}),v4=O$([m4.and(Z({type:$(`content`)})),r0.and(Z({type:$(`diff`)})),a4.and(Z({type:$(`terminal`)}))]),y4=Y(),b4=Z({_meta:Q(Y(),X()).nullish(),line:C$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:Y()}),x4=O$([$(`pending`),$(`in_progress`),$(`completed`),$(`failed`)]),S4=O$([$(`read`),$(`edit`),$(`delete`),$(`move`),$(`search`),$(`execute`),$(`think`),$(`fetch`),$(`switch_mode`),$(`other`)]),C4=Z({_meta:Q(Y(),X()).nullish(),content:D$(v4).optional(),kind:S4.optional(),locations:D$(b4).optional(),rawInput:X().optional(),rawOutput:X().optional(),status:x4.optional(),title:Y(),toolCallId:y4}),w4=Z({_meta:Q(Y(),X()).nullish(),content:D$(v4).nullish(),kind:S4.nullish(),locations:D$(b4).nullish(),rawInput:X().optional(),rawOutput:X().optional(),status:x4.nullish(),title:Y().nullish(),toolCallId:y4}),T4=Z({_meta:Q(Y(),X()).nullish(),options:D$(G0),sessionId:C2,toolCall:w4}),E4=Z({_meta:Q(Y(),X()).nullish(),hint:Y()}),D4=E4,O4=Z({_meta:Q(Y(),X()).nullish(),description:Y(),input:D4.nullish(),name:Y()}),k4=Z({_meta:Q(Y(),X()).nullish(),availableCommands:D$(O4)}),A4=Z({enum:D$(Y()),type:f0}),j4=O$([A4,_4]),M4=Z({default:D$(Y()).nullish(),description:Y().nullish(),items:j4,maxItems:C$().nullish(),minItems:C$().nullish(),title:Y().nullish()}),N4=O$([i4.and(Z({type:$(`string`)})),H0.and(Z({type:$(`number`)})),D0.and(Z({type:$(`integer`)})),$1.and(Z({type:$(`boolean`)})),M4.and(Z({type:$(`array`)}))]),P4=Z({description:Y().nullish(),properties:Q(Y(),N4).optional().default({}),required:D$(Y()).nullish(),title:Y().nullish(),type:d0.optional().default(`object`)}),F4=Z({requestedSchema:P4}),I4=k$(O$([F4.and(Z({mode:$(`form`)})),h0.and(Z({mode:$(`url`)}))]),Z({_meta:Q(Y(),X()).nullish(),message:Y(),sessionId:C2})),L4=Z({cachedReadTokens:C$().nullish(),cachedWriteTokens:C$().nullish(),inputTokens:C$(),outputTokens:C$(),thoughtTokens:C$().nullish(),totalTokens:C$()}),R4=Z({_meta:Q(Y(),X()).nullish(),stopReason:n4,usage:L4.nullish(),userMessageId:Y().nullish()}),O$([Z({id:t2,result:O$([Y2,Z1,N0,W2,U2,P2,H2,G2,e0,$2,Z2,R4,t4,S0])}),Z({error:y0,id:t2})]),z4=Z({_meta:Q(Y(),X()).nullish(),cost:t0.nullish(),size:C$(),used:C$()}),B4=O$([h4.and(Z({sessionUpdate:$(`user_message_chunk`)})),h4.and(Z({sessionUpdate:$(`agent_message_chunk`)})),h4.and(Z({sessionUpdate:$(`agent_thought_chunk`)})),C4.and(Z({sessionUpdate:$(`tool_call`)})),w4.and(Z({sessionUpdate:$(`tool_call_update`)})),Y0.and(Z({sessionUpdate:$(`plan`)})),k4.and(Z({sessionUpdate:$(`available_commands_update`)})),R2.and(Z({sessionUpdate:$(`current_mode_update`)})),x2.and(Z({sessionUpdate:$(`config_option_update`)})),F2.and(Z({sessionUpdate:$(`session_info_update`)})),z4.and(Z({sessionUpdate:$(`usage_update`)}))]),V4=Z({_meta:Q(Y(),X()).nullish(),sessionId:C2,update:B4}),Z({method:Y(),params:O$([V4,l0,b0]).nullish()}),H4=Z({_meta:Q(Y(),X()).nullish(),sessionId:C2,terminalId:Y()}),U4=Z({_meta:Q(Y(),X()).nullish(),exitCode:C$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:Y().nullish()}),W4=Z({_meta:Q(Y(),X()).nullish(),content:Y(),path:Y(),sessionId:C2}),Z({id:t2,method:Y(),params:O$([W4,A2,T4,E2,s4,j2,H4,O2,I4,x0]).nullish()}),G4=Z({_meta:Q(Y(),X()).nullish()}),O$([Z({id:t2,result:O$([G4,$0,l2,n0,c4,e2,U4,O0,u0,S0])}),Z({error:y0,id:t2})])}));function q4(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
- `);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}}finally{i.releaseLock(),e.close()}}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
- `,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}var J4=o((()=>{})),Y4,X4,Z4,Q4=o((()=>{B1(),U1(),K4(),U1(),J4(),Y4=class{#e;constructor(e,t){let n=e(this);this.#e=new X4(async(e,t)=>{switch(e){case H1.fs_write_text_file:{let e=W4.parse(t);return n.writeTextFile?.(e)}case H1.fs_read_text_file:{let e=A2.parse(t);return n.readTextFile?.(e)}case H1.session_request_permission:{let e=T4.parse(t);return n.requestPermission(e)}case H1.terminal_create:{let e=E2.parse(t);return n.createTerminal?.(e)}case H1.terminal_output:{let e=s4.parse(t);return n.terminalOutput?.(e)}case H1.terminal_release:{let e=j2.parse(t);return await n.releaseTerminal?.(e)??{}}case H1.terminal_wait_for_exit:{let e=H4.parse(t);return n.waitForTerminalExit?.(e)}case H1.terminal_kill:{let e=O2.parse(t);return await n.killTerminal?.(e)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw Z4.methodNotFound(e)}},async(e,t)=>{switch(e){case H1.session_update:{let e=V4.parse(t);return n.sessionUpdate(e)}default:if(n.extNotification)return n.extNotification(e,t);throw Z4.methodNotFound(e)}},t)}async initialize(e){return await this.#e.sendRequest(V1.initialize,e)}async newSession(e){return await this.#e.sendRequest(V1.session_new,e)}async loadSession(e){return await this.#e.sendRequest(V1.session_load,e)??{}}async unstable_forkSession(e){return await this.#e.sendRequest(V1.session_fork,e)}async listSessions(e){return await this.#e.sendRequest(V1.session_list,e)}async unstable_resumeSession(e){return await this.#e.sendRequest(V1.session_resume,e)}async unstable_closeSession(e){return await this.#e.sendRequest(V1.session_close,e)}async setSessionMode(e){return await this.#e.sendRequest(V1.session_set_mode,e)??{}}async unstable_setSessionModel(e){return await this.#e.sendRequest(V1.session_set_model,e)??{}}async setSessionConfigOption(e){return await this.#e.sendRequest(V1.session_set_config_option,e)}async authenticate(e){return await this.#e.sendRequest(V1.authenticate,e)??{}}async unstable_logout(e){return await this.#e.sendRequest(V1.logout,e)??{}}async prompt(e){return await this.#e.sendRequest(V1.session_prompt,e)}async cancel(e){return await this.#e.sendNotification(V1.session_cancel,e)}async extMethod(e,t){return await this.#e.sendRequest(e,t)}async extNotification(e,t){return await this.#e.sendNotification(e,t)}get signal(){return this.#e.signal}get closed(){return this.#e.closed}},X4=class{#e=new Map;#t=0;#n;#r;#i;#a=Promise.resolve();#o=new AbortController;#s;constructor(e,t,n){this.#n=e,this.#r=t,this.#i=n,this.#s=new Promise(e=>{this.#o.signal.addEventListener(`abort`,()=>e())}),this.#c()}get signal(){return this.#o.signal}get closed(){return this.#s}async#c(){let e=this.#i.readable.getReader();try{for(;;){let{value:t,done:n}=await e.read();if(n)break;if(t)try{this.#l(t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&this.#p({jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock(),this.#o.abort()}}async#l(e){if(`method`in e&&`id`in e){let t=await this.#u(e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await this.#p({jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await this.#d(e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?this.#f(e):console.error(`Invalid message`,{message:e})}async#u(e,t){try{return{result:await this.#n(e,t)??null}}catch(e){if(e instanceof Z4)return e.toResult();if(e instanceof s$)return Z4.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z4.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z4.internalError({details:t}).toResult()}}}async#d(e,t){try{return await this.#r(e,t),{result:null}}catch(e){if(e instanceof Z4)return e.toResult();if(e instanceof s$)return Z4.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z4.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z4.internalError({details:t}).toResult()}}}#f(e){let t=this.#e.get(e.id);t?(`result`in e?t.resolve(e.result):`error`in e&&t.reject(e.error),this.#e.delete(e.id)):console.error(`Got response to unknown request`,e.id)}async sendRequest(e,t){let n=this.#t++,r=new Promise((e,t)=>{this.#e.set(n,{resolve:e,reject:t})});return await this.#p({jsonrpc:`2.0`,id:n,method:e,params:t}),r}async sendNotification(e,t){await this.#p({jsonrpc:`2.0`,method:e,params:t})}async#p(e){return this.#a=this.#a.then(async()=>{let t=this.#i.writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{console.error(`ACP write error:`,e)}),this.#a}},Z4=class e extends Error{code;data;constructor(e,t,n){super(t),this.code=e,this.name=`RequestError`,this.data=n}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}})),$4,e3,t3,n3,r3,i3=o((()=>{K_(),Q4(),{spawn:$4}=G_(`child_process`),{Writable:e3,Readable:t3}=G_(`stream`),n3={info(){},warn(){},error(){}},r3=class{name;config;cwd;log;proc=null;connection=null;sessions=new Map;sessionMetas=new Map;agentTitle=``;started=!1;chunkCollector=null;constructor(e,t,n,r){this.name=e,this.config=t,this.cwd=n,this.log=r??n3}async start(){if(this.started)return;let e=this.config.command||`claude-agent-acp`,t=this.config.args??[];this.log.info(`[acp] starting subprocess: ${e} ${t.join(` `)}`),this.proc=$4(e,t,{cwd:this.cwd,stdio:[`pipe`,`pipe`,`pipe`],env:{...process.env,...this.config.env}}),this.proc.stderr?.on(`data`,e=>{let t=e.toString().trim();t&&this.log.warn(`[acp-stderr] ${t}`)}),this.proc.on(`exit`,e=>{this.log.info(`[acp] subprocess exited (code=${e})`),this.started=!1});let n=q4(e3.toWeb(this.proc.stdin),t3.toWeb(this.proc.stdout));this.connection=new Y4(()=>({requestPermission:async e=>{let t=e.options.find(e=>e.kind===`allow`)?.optionId??e.options[0]?.optionId??`allow`;return this.log.info(`[acp] auto-allowed permission request`),{outcome:{outcome:`selected`,optionId:t}}},sessionUpdate:async e=>{this.handleSessionUpdate(e)},readTextFile:async()=>({content:``}),writeTextFile:async()=>({})}),n);let r=await this.connection.initialize({protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}});this.agentTitle=r.agentInfo?.title||r.agentInfo?.name||this.name,this.started=!0,this.log.info(`[acp] initialized: ${this.agentTitle} v${r.agentInfo?.version??`?`} (pid=${this.proc.pid})`)}async chat(e,t,n){this.started||await this.start();let r=this.sessions.get(e);r?this.log.info(`[acp] reusing session (session=${r}, conversation=${e})`):r=await this.createSession(e);let i=[];this.chunkCollector=i;try{await this.connection.prompt({sessionId:r,prompt:[{type:`text`,text:t}]})}finally{this.chunkCollector=null}let a=i.join(``).trim();if(!a)throw Error(`agent returned empty response`);return a}async createSession(e){let t=await this.connection.newSession({cwd:this.cwd,mcpServers:[]}),n=t.sessionId;this.sessions.set(e,n);let r={};if(t.models&&(r.models={current:t.models.currentModelId,available:t.models.availableModels.map(e=>({id:e.modelId,name:e.name}))}),t.modes&&(r.modes={current:t.modes.currentModeId,available:t.modes.availableModes.map(e=>({id:e.id,name:e.name}))}),t.configOptions&&(r.configOptions=t.configOptions.map(e=>({id:e.id,name:e.name,type:e.type,current:(e.type,e.currentValue)}))),this.sessionMetas.set(e,r),this.config.model&&r.models){let e=r.models.available.find(e=>e.id===this.config.model||e.name.toLowerCase().includes(this.config.model.toLowerCase()));if(e&&e.id!==r.models.current)try{await this.connection.unstable_setSessionModel({sessionId:n,modelId:e.id}),r.models.current=e.id,this.log.info(`[acp] set default model to ${e.id}`)}catch(e){this.log.warn(`[acp] failed to set default model: ${e}`)}}return this.log.info(`[acp] new session (session=${n}, conversation=${e})`),n}hasSession(e){return this.sessions.has(e)}cancelPrompt(e){let t=this.sessions.get(e);!t||!this.connection||(this.log.info(`[acp] cancelling prompt (session=${t})`),this.connection.cancel({sessionId:t}))}async resetSession(e){return this.sessions.delete(e),this.sessionMetas.delete(e),this.log.info(`[acp] session reset (conversation=${e})`),this.started||await this.start(),this.createSession(e)}getSessionMeta(e){return this.sessionMetas.get(e)??null}async setModel(e,t){let n=this.sessions.get(e);if(!n||!this.connection)throw Error(`No active session`);await this.connection.unstable_setSessionModel({sessionId:n,modelId:t});let r=this.sessionMetas.get(e);r?.models&&(r.models.current=t),this.log.info(`[acp] model switched to ${t} (session=${n})`)}async setMode(e,t){let n=this.sessions.get(e);if(!n||!this.connection)throw Error(`No active session`);await this.connection.setSessionMode({sessionId:n,modeId:t});let r=this.sessionMetas.get(e);r?.modes&&(r.modes.current=t),this.log.info(`[acp] mode switched to ${t} (session=${n})`)}async setConfigOption(e,t,n){let r=this.sessions.get(e);if(!r||!this.connection)throw Error(`No active session`);await this.connection.setSessionConfigOption({sessionId:r,configOptionId:t,value:n});let i=this.sessionMetas.get(e);if(i?.configOptions){let e=i.configOptions.find(e=>e.id===t);e&&(e.current=n)}this.log.info(`[acp] config ${t} = ${n} (session=${r})`)}info(){return{name:this.agentTitle||this.name,type:`acp`,model:this.config.model||``,command:this.config.command||`claude-agent-acp`,pid:this.proc?.pid}}stop(){this.proc&&=(this.log.info(`[acp] stopping subprocess (pid=${this.proc.pid})`),this.proc.kill(),null),this.connection=null,this.started=!1,this.sessions.clear(),this.sessionMetas.clear()}handleSessionUpdate(e){let t=e.update;t.sessionUpdate===`agent_message_chunk`&&t.content.type===`text`&&this.chunkCollector?.push(t.content.text)}}}));function a3(){return f.Platform.isDesktop&&process.platform===`win32`&&typeof U3.statSync==`function`&&typeof U3.readdirSync==`function`&&typeof U3.realpathSync==`function`&&typeof W3.join==`function`&&typeof W3.isAbsolute==`function`}function o3(e){let t=e.trim();if(!t)return``;if(/^[a-zA-Z]:\//.test(t))return t.replace(/\//g,`\\`);let n=t.match(/^\/([a-zA-Z])\/(.*)$/);return n?`${n[1].toUpperCase()}:\\${n[2].replace(/\//g,`\\`)}`:t}function s3(e,t){if(!a3())return null;let n=o3(e);if(!n)return null;try{let e=U3.statSync(n);return(t===`file`?!e.isFile():!e.isDirectory())?null:U3.realpathSync(n)}catch{return null}}function c3(e){return s3(e,`file`)}function l3(e){return s3(e,`directory`)}function u3(e){return[...new Set(e)]}function d3(e){return[...e].sort((e,t)=>t.localeCompare(e,void 0,{numeric:!0,sensitivity:`base`}))}function f3(e,t){let n=l3(e);if(!n)return[];try{return d3(U3.readdirSync(n)).flatMap(e=>{if(!t.test(e))return[];let r=W3.join(n,e);return l3(r)?[r]:[]})}catch{return[]}}function p3(e){let t=e?.trim()||``;if(!t)return[];let n=t.includes(`;`)?`;`:`:`;return u3(t.split(n).map(e=>o3(e)).filter(Boolean))}function m3(e){let t=o3(e||``).trim();return t?K3.test(t):!0}function h3(e){if(!a3())return!1;let t=o3(e||``);return!!t&&W3.isAbsolute(t)}function g3(e){if(!a3())return!1;let t=o3(e||``).trim();if(!t)return!1;let n=W3.basename(t).toLowerCase();return n===`codex`||n===`codex.cmd`||n===`codex.bat`}function _3(e){return{command:e,argsPrefix:[],displayCommand:e}}function v3(e,t){let n=(t?c3(W3.join(t,`node.exe`)):null)||`node`;return{command:n,argsPrefix:[e],displayCommand:`${n} ${e}`}}function y3(e){let t=l3(e);if(!t)return null;let n=c3(W3.join(t,`codex`));return n?v3(n,t):null}function b3(e){let t=l3(e);if(!t)return null;let n=c3(W3.join(t,`codex.cmd`));return n?y3(t)||_3(n):null}function x3(e){for(let t of I3(e)){let e=b3(t);if(e)return e}return null}function S3(e){let t=o3(e.LOCALAPPDATA||``);if(!t)return null;let n=l3(W3.join(t,`Codex`));if(!n)return null;for(let e of f3(n,q3)){let t=b3(W3.join(e,`resources`));if(t)return t}return null}function C3(e){let t=o3(e.USERPROFILE||``);return t?b3(W3.join(t,`.codex`,`.sandbox-bin`)):null}function w3(e){return!!e&&e.command.toLowerCase()===`node`}function T3(e){return w3(e)?typeof V3==`function`?e:null:e}function E3(e){return T3(S3(e))||T3(C3(e))||T3(x3(e))}function D3(e){return m3(e)||h3(e)&&g3(e)}function O3(e,t){return process.platform===`win32`&&!t&&D3(e)}function k3(){return Error(`Windows auto-detection could not find a usable Codex executable. Set the WeChat agent Command to an absolute codex.exe path.`)}function A3(e){return process.platform===`win32`&&e instanceof Error&&e.code===`ENOENT`?Error(`${e.message}. Windows shell shims are not directly spawnable here; set the WeChat agent Command to an absolute codex.exe path.`):e instanceof Error?e:Error(String(e))}function j3(e){let t=l3(e);if(!t)return null;let n=W3.dirname(t);return W3.basename(t).toLowerCase()===`codex`&&W3.basename(n).toLowerCase()===`@openai`?t:l3(W3.join(t,`node_modules`,`@openai`,`codex`))}function M3(){let e=W3.join(`node_modules`,`@openai`,`codex-win32-x64`,`vendor`,`x86_64-pc-windows-msvc`,`codex`,`codex.exe`),t=W3.join(`node_modules`,`@openai`,`codex-win32-arm64`,`vendor`,`aarch64-pc-windows-msvc`,`codex`,`codex.exe`);return process.arch===`arm64`?[t,e]:[e,t]}function N3(e){let t=l3(e);if(!t)return null;let n=[W3.join(t,`codex.exe`),W3.join(t,`resources`,`codex.exe`)];for(let e of n){let t=c3(e);if(t)return t}let r=j3(t);if(!r)return null;for(let e of M3()){let t=c3(W3.join(r,e));if(t)return t}return null}function P3(e){let t=l3(e);if(!t)return null;let n=j3(t);if(!n)return null;let r=c3(W3.join(n,`bin`,`codex.js`));return r?v3(r,t):null}function F3(e){for(let t of e){let e=N3(t);if(e)return _3(e)}for(let t of e){let e=P3(t);if(e)return e}return null}function I3(e){let t=p3(e.PATH),n=t.flatMap(e=>e.toLowerCase().includes(`\\nvm`)?f3(e,/^v\d/i):[]);return u3([...t,...n]).flatMap(e=>{let t=l3(e);return t?[t]:[]})}function L3(e){let t=o3(e.LOCALAPPDATA||``);if(!t)return null;let n=l3(W3.join(t,`Codex`));if(!n)return null;for(let e of f3(n,q3)){let t=c3(W3.join(e,`resources`,`codex.exe`));if(t)return _3(t)}return null}function R3(e){let t=o3(e.USERPROFILE||``);if(!t)return null;let n=c3(W3.join(t,`.codex`,`.sandbox-bin`,`codex.exe`));return n?_3(n):null}function z3(e){let t=o3(e.USERPROFILE||``);if(!t)return null;let n=[W3.join(t,`.vscode`,`extensions`),W3.join(t,`.cursor`,`extensions`)],r=process.arch===`arm64`?[`windows-arm64`,`windows-x86_64`]:[`windows-x86_64`,`windows-arm64`];for(let e of n)for(let t of f3(e,J3))for(let e of r){let n=c3(W3.join(t,`bin`,e,`codex.exe`));if(n)return _3(n)}return null}function B3(e,t){if(!a3())return null;let n=o3(e||``).trim();if(n&&W3.isAbsolute(n)){let e=c3(n);if(!e)return null;let t=W3.basename(e).toLowerCase();return t===`codex.exe`?_3(e):t===`codex.cmd`||t===`codex.bat`||t===`codex`?F3([W3.dirname(e)])||b3(W3.dirname(e)):_3(e)}if(!m3(n))return null;let r=[L3(t),R3(t),z3(t)];for(let e of r)if(e)return e;return F3(I3(t))||E3(t)}var V3,H3,U3,W3,G3,K3,q3,J3,Y3,X3=o((()=>{K_(),{spawn:V3}=G_(`child_process`),{createInterface:H3}=G_(`readline`),U3=G_(`fs`),W3=G_(`path`),G3={info(){},warn(){},error(){}},K3=/^codex(?:\.(?:cmd|bat|exe))?$/i,q3=/^app-/i,J3=/^openai\.chatgpt-/i,Y3=class{agentName;config;cwd;log;sessions=new Map;cachedCodexLaunch=null;constructor(e,t,n,r){this.agentName=e,this.config=t,this.cwd=n,this.log=r??G3}async chat(e,t,n){switch(this.agentName){case`codex`:return this.chatCodex(t,n);case`gemini`:return this.chatGemini(t,n);default:return this.chatClaude(e,t,n)}}getCachedCodexLaunch(e,t){let n=[process.platform,e,t.PATH||``,t.LOCALAPPDATA||``,t.USERPROFILE||``].join(`|`);if(this.cachedCodexLaunch?.key===n)return this.cachedCodexLaunch.spec;let r=B3(e,t);return this.cachedCodexLaunch={key:n,spec:r},r}async chatClaude(e,t,n){let r=this.config.command||`claude`,i=[`-p`,t,`--output-format`,`stream-json`,`--verbose`];switch(this.config.model&&i.push(`--model`,this.config.model),this.config.systemPrompt&&i.push(`--append-system-prompt`,this.config.systemPrompt),this.config.permissionMode){case`bypass-permissions`:i.push(`--permission-mode`,`bypassPermissions`);break;case`dont-ask`:i.push(`--permission-mode`,`dontAsk`);break;case`plan-mode`:i.push(`--permission-mode`,`plan`);break;case`accept-edits`:i.push(`--permission-mode`,`acceptEdits`);break}this.config.args&&i.push(...this.config.args);let a=this.sessions.get(e);a?(i.push(`--resume`,a),this.log.info(`[cli] resuming session (session=${a}, conversation=${e})`)):this.log.info(`[cli] starting new conversation (command=${r}, conversation=${e})`);let o=V3(r,i,{cwd:this.cwd,stdio:[`pipe`,`pipe`,`pipe`],env:{...process.env,...this.config.env}});n&&n.addEventListener(`abort`,()=>o.kill(),{once:!0}),this.log.info(`[cli] spawned process (command=${r}, pid=${o.pid})`);let s=``,c=``,l=[],u=H3({input:o.stdout});for await(let e of u)if(e.trim())try{let t=JSON.parse(e);if(t.session_id&&(c=t.session_id),t.type===`result`){if(t.is_error)throw Error(`${this.agentName} error: ${t.result}`);s=t.result||``}else if(t.type===`assistant`&&t.message?.content)for(let e of t.message.content)e.type===`text`&&e.text&&l.push(e.text)}catch(e){if(e instanceof SyntaxError)continue;throw e}if(await new Promise((e,t)=>{o.on(`exit`,n=>{n!==0&&!s&&l.length===0?t(Error(`${this.agentName} exited with code ${n}`)):e()}),o.on(`error`,t)}),!s&&l.length>0&&(s=l.join(``)),c&&(this.sessions.set(e,c),this.log.info(`[cli] saved session (session=${c}, conversation=${e})`)),s=s.trim(),!s)throw Error(`${this.agentName} returned empty response`);return s}async chatCodex(e,t){let n=this.config.command||`codex`,r=[`exec`,e];switch(this.config.model&&r.push(`--model`,this.config.model),this.config.permissionMode){case`bypass-permissions`:r.push(`--dangerously-bypass-approvals-and-sandbox`);break;case`dont-ask`:r.push(`--full-auto`);break;case`plan-mode`:r.push(`-s`,`read-only`);break;case`accept-edits`:r.push(`-a`,`untrusted`,`-s`,`workspace-write`);break}this.config.reasoningEffort&&this.config.reasoningEffort!==`medium`&&r.push(`--reasoning-effort`,this.config.reasoningEffort),this.config.args&&r.push(...this.config.args);let i={...process.env,...this.config.env},a=this.getCachedCodexLaunch(n,i),o=a?.command||n,s=[...a?.argsPrefix||[],...r];if(O3(n,a))throw k3();this.log.info(`[cli] running codex exec (command=${a?.displayCommand||o})`);let c=V3(o,s,{cwd:this.cwd,stdio:[`pipe`,`pipe`,`pipe`],env:i});t&&t.addEventListener(`abort`,()=>c.kill(),{once:!0});let l=[];c.stdout?.on(`data`,e=>l.push(e));let u=[];c.stderr?.on(`data`,e=>u.push(e));let d=await new Promise((e,t)=>{c.on(`exit`,e),c.on(`error`,e=>{t(A3(e))})}),f=Buffer.concat(l).toString().trim();if(d!==0&&!f){let e=Buffer.concat(u).toString().trim();throw Error(`codex error (code=${d}): ${e||`unknown`}`)}if(!f)throw Error(`codex returned empty response`);return f}async chatGemini(e,t){let n=this.config.command||`gemini`,r=[`prompt`,e];switch(this.config.model&&r.push(`--model`,this.config.model),this.config.permissionMode){case`bypass-permissions`:case`dont-ask`:r.push(`--yolo`);break;case`plan-mode`:r.push(`--approval-mode`,`plan`);break;case`accept-edits`:r.push(`--approval-mode`,`auto_edit`);break}this.config.args&&r.push(...this.config.args),this.log.info(`[cli] running ${this.agentName} (command=${n})`);let i=V3(n,r,{cwd:this.cwd,stdio:[`pipe`,`pipe`,`pipe`],env:{...process.env,...this.config.env}});t&&t.addEventListener(`abort`,()=>i.kill(),{once:!0});let a=[];i.stdout?.on(`data`,e=>a.push(e));let o=[];i.stderr?.on(`data`,e=>o.push(e));let s=await new Promise((e,t)=>{i.on(`exit`,e),i.on(`error`,t)}),c=Buffer.concat(a).toString().trim();if(s!==0&&!c){let e=Buffer.concat(o).toString().trim();throw Error(`${this.agentName} error (code=${s}): ${e||`unknown`}`)}if(!c)throw Error(`${this.agentName} returned empty response`);return c}hasSession(e){return this.sessions.has(e)}cancelPrompt(){}async resetSession(e){return this.sessions.delete(e),this.log.info(`[cli] session reset (conversation=${e})`),``}info(){return{name:this.agentName,type:`cli`,model:this.config.model||``,command:this.cachedCodexLaunch?.spec?.displayCommand||this.config.command||this.agentName}}stop(){this.sessions.clear(),this.cachedCodexLaunch=null}}})),Z3,Q3,$3=o((()=>{Z3={info(){},warn(){},error(){}},Q3=class{agentName;config;log;history=new Map;maxHistory;constructor(e,t,n){this.agentName=e,this.config=t,this.log=n??Z3,this.maxHistory=t.maxHistory||20}async chat(e,t,n){let r=this.config.endpoint;if(!r)throw Error(`HTTP agent requires endpoint`);let i=this.buildMessages(e,t),a=JSON.stringify({model:this.config.model||`gpt-5.4-mini`,messages:i});this.log.info(`[http] sending to ${r} (conversation=${e})`);let o=await(0,f.requestUrl)({url:r,method:`POST`,headers:{"Content-Type":`application/json`,...this.config.apiKey?{Authorization:`Bearer ${this.config.apiKey}`}:{},...this.config.headers},body:a});if(o.status!==200)throw Error(`HTTP agent error ${o.status}: ${o.text}`);let s=o.json?.choices?.[0]?.message?.content;if(!s)throw Error(`HTTP agent: no content in response`);let c=this.history.get(e)??[];c.push({role:`user`,content:t},{role:`assistant`,content:s});let l=this.maxHistory*2;return c.length>l&&c.splice(0,c.length-l),this.history.set(e,c),this.log.info(`[http] reply received (conversation=${e}, len=${s.length})`),s}hasSession(e){return this.history.has(e)}cancelPrompt(){}async resetSession(e){return this.history.delete(e),this.log.info(`[http] session reset (conversation=${e})`),``}info(){return{name:this.agentName,type:`http`,model:this.config.model||`gpt-5.4-mini`,command:this.config.endpoint||``}}stop(){this.history.clear()}buildMessages(e,t){let n=[];this.config.systemPrompt&&n.push({role:`system`,content:this.config.systemPrompt});let r=this.history.get(e);return r&&n.push(...r),n.push({role:`user`,content:t}),n}}}));function e6(e,t,n,r,i){let a=t.cwd||n,o={...t};switch(i&&(o.systemPrompt=i+`\nYour current working directory is: ${a}\nFiles must be within this directory to be sent automatically.`+(t.systemPrompt?`
- `+t.systemPrompt:``)),o.type){case`acp`:return new r3(e,o,a,r);case`cli`:return new Y3(e,o,a,r);case`http`:return new Q3(e,o,r);default:throw Error(`Unknown agent type: ${o.type}`)}}var t6=o((()=>{i3(),X3(),$3()}));function n6(e,t){return t?.[e]?t[e]:o6[e]?o6[e]:e}function r6(e,t,n){let r=e.trim();if(!r.startsWith(`/`)&&!r.startsWith(`@`))return null;let i=[],a=r;for(;a.length>0&&(a=a.trimStart(),!(!a.startsWith(`/`)&&!a.startsWith(`@`)));){let e=a.slice(1),t=e.search(/[\s/@]/),r;if(t<0?(r=e,a=``):e[t]===`/`||e[t]===`@`?(r=e.slice(0,t),a=e.slice(t)):(r=e.slice(0,t),a=e.slice(t).trimStart()),r){let e=n6(r,n);if(s6.has(r))return null;i.push(e)}if(!a)break}if(i.length===0)return null;let o=new Set,s=i.filter(e=>o.has(e)?!1:(o.add(e),!0)).filter(e=>t.has(e));return s.length===0?null:{agents:s,message:a}}function i6(e,t){let n=[`Available commands:`,`@agent or /agent - Switch default agent`,`@agent msg or /agent msg - Send to a specific agent`,`@a @b msg - Broadcast to multiple agents`,`/new or /clear - Start a new session`,`/info - Show current agent info`,`/help - Show this help message`,``,`Default agent: ${t||`none`}`,``,`Configured agents:`];for(let[t,r]of Object.entries(e)){let e=r.aliases?.length?` (aliases: ${r.aliases.join(`, `)})`:``;n.push(` ${t} [${r.type}]${e}`)}n.push(``,`Built-in aliases:`);let r=Object.entries(o6).filter(([,t])=>e[t]).map(([e,t])=>`/${e}(${t})`);return r.length>0?n.push(` ${r.join(` `)}`):n.push(` (none active — configure agents to enable aliases)`),n.join(`
- `)}var a6,o6,s6,c6,l6=o((()=>{t6(),a6={info(){},warn(){},error(){}},o6={cc:`claude`,cx:`codex`,cs:`cursor`,km:`kimi`,gm:`gemini`,oc:`openclaw`,ocd:`opencode`,pi:`pi`,cp:`copilot`,dr:`droid`,if:`iflow`,kr:`kiro`,qw:`qwen`},s6=new Set([`info`,`help`,`new`,`clear`]),c6=class{agents=new Map;configs;_defaultAgent;cwd;log;customAliases;baseSystemPrompt;activeAgent=new Map;userLock=new Map;inFlight=new Map;constructor(e,t,n,r){this.configs=e,this._defaultAgent=t,this.cwd=n,this.log=r?.logger??a6,this.customAliases=r?.customAliases,this.baseSystemPrompt=r?.baseSystemPrompt}get defaultAgent(){return this._defaultAgent}set defaultAgent(e){this._defaultAgent=e}get knownAgents(){return new Set(Object.keys(this.configs))}async getOrCreateAgent(e){let t=this.agents.get(e);if(t)return t;let n=this.configs[e];if(!n)throw Error(`Agent "${e}" not configured`);return this.log.info(`[router] starting agent "${e}" on demand...`),t=e6(e,n,this.cwd,this.log,this.baseSystemPrompt),this.agents.set(e,t),t}async chat(e,t,n){let r=this.userLock.get(t)??Promise.resolve(),i,a=new Promise(e=>{i=e});this.userLock.set(t,a);try{await r;let i=await this.getOrCreateAgent(e),a=i.info();this.log.info(`[router] dispatching to ${a.name} for ${t}`);let o=n.length>30?n.slice(0,30)+`...`:n;this.inFlight.set(t,{agent:e,startedAt:Date.now(),message:o});try{let e=await i.chat(t,n),r=Date.now()-(this.inFlight.get(t)?.startedAt??Date.now());return this.log.info(`[router] ${a.name} replied (elapsed=${r}ms, len=${e.length})`),e}finally{this.inFlight.delete(t)}}finally{i(),this.userLock.get(t)===a&&this.userLock.delete(t)}}async broadcast(e,t,n){let r=e.map(async e=>{try{return{name:e,reply:await this.chat(e,t,n)}}catch(t){return{name:e,reply:`Error: ${t instanceof Error?t.message:String(t)}`}}});return Promise.all(r)}async resetSession(e,t){let n=this.agents.get(e);return n?n.resetSession(t):``}cancelActivePrompt(e){let t=this.activeAgent.get(e)||this._defaultAgent;if(!t)return`No agent active.`;let n=this.agents.get(t);return n?(n.cancelPrompt(e),`Cancelled ${n.info().name}`):`Agent not started.`}getActiveAgent(e){return this.activeAgent.get(e)??null}setActiveAgent(e,t){this.activeAgent.set(e,t),this.log.info(`[router] active agent for ${e} → ${t}`)}clearActiveAgent(e){this.activeAgent.delete(e),this.log.info(`[router] active agent cleared for ${e}`)}async resetActiveSession(e){let t=this.activeAgent.get(e)||this._defaultAgent;if(!t)return`No agent active.`;let n=this.agents.get(t);if(!n)return`Agent not started.`;n.cancelPrompt(e),this.activeAgent.delete(e);let r=await n.resetSession(e),i=n.info().name;return this.log.info(`[router] /new: reset ${i} for ${e}`),r?`${i} session reset\n${r}`:`${i} session reset`}listUserSessions(e){let t=[],n=this.activeAgent.get(e),r=1;for(let[i,a]of this.agents)a.hasSession(e)&&t.push({index:r++,name:i,active:i===n});return t}formatSessionList(e){let t=this.listUserSessions(e);if(t.length===0)return`No active sessions.`;let n=[`Sessions:`,``];for(let e of t){let t=e.active?` *`:``;n.push(` ${e.index}. ${e.name}${t}`)}return n.push(``,`Reply /resume <number> to switch.`),n.join(`
- `)}resumeByIndex(e,t){let n=this.listUserSessions(e).find(e=>e.index===t);return n?(this.activeAgent.set(e,n.name),this.log.info(`[router] /resume: ${e} → ${n.name}`),`Resumed ${n.name}`):`Invalid session number: ${t}`}resumeByName(e,t){let n=this.resolveAlias(t),r=this.agents.get(n);return!r||!r.hasSession(e)?`No session found for "${n}"`:(this.activeAgent.set(e,n),this.log.info(`[router] /resume: ${e} → ${n}`),`Resumed ${n}`)}resolveAlias(e){return this.customAliases?.[e]?this.customAliases[e]:o6[e]?o6[e]:e}getAgentInfo(e){let t=this.activeAgent.get(e),n=[];if(t){let r=this.agents.get(t),i=r?.info();n.push(`active: ${t}${i?` [${i.type}]`:``}`);let a=r?.getSessionMeta?.(e);if(a?.models){let e=a.models.available.find(e=>e.id===a.models.current);n.push(`model: ${e?.name||a.models.current}`)}else i?.model&&n.push(`model: ${i.model}`);if(a?.modes){let e=a.modes.available.find(e=>e.id===a.modes.current);n.push(`mode: ${e?.name||a.modes.current}`)}}else n.push(`active: none (thino mode)`);return this._defaultAgent&&n.push(`default: ${this._defaultAgent}`),n.join(`
- `)}getActiveHelp(e){let t=this.activeAgent.get(e),n=[];if(t){let r=this.agents.get(t),i=r?.info();n.push(`Current: ${t} [${i?.type||`?`}]`);let a=r?.getSessionMeta?.(e);if(a?.models){let e=a.models.available.find(e=>e.id===a.models.current);n.push(`Model: ${e?.name||a.models.current}`),n.push(` /model <id> to switch. Available:`);for(let e of a.models.available){let t=e.id===a.models.current?` *`:``;n.push(` - ${e.id} (${e.name})${t}`)}}if(a?.modes){let e=a.modes.available.find(e=>e.id===a.modes.current);n.push(`Mode: ${e?.name||a.modes.current}`),n.push(` /mode <id> to switch. Available:`);for(let e of a.modes.available){let t=e.id===a.modes.current?` *`:``;n.push(` - ${e.id} (${e.name})${t}`)}}n.push(``)}else n.push(`No active agent (thino mode)`),n.push(``);n.push(`Commands:`),n.push(` @agent msg - Send to agent`),n.push(` @a @b msg - Broadcast`),n.push(` /thino <text> - Save as thino`),n.push(` /d, /t, /n - Diary/Todo/Note`),t?(n.push(` /info - Agent info`),n.push(` /new - Reset session`),n.push(` /cancel - Stop generation`),n.push(` /resume - Switch session`),meta?.models&&n.push(` /model <id> - Switch model`),meta?.modes&&n.push(` /mode <id> - Switch mode`),meta?.configOptions?.length&&n.push(` /config <id> <val> - Set config`)):n.push(` /resume - Resume a previous session`),n.push(` /status - Running tasks`);let r=Object.entries(o6).filter(([,e])=>this.configs[e]).map(([e,t])=>`/${e}(${t})`);return r.length>0&&n.push(``,`Aliases: ${r.join(` `)}`),n.join(`
- `)}async setActiveModel(e,t){let n=this.activeAgent.get(e);if(!n)return`No active agent. Use @agent first.`;let r=this.agents.get(n);if(!r)return`Agent not started.`;if(!r.setModel)return`${n} does not support model switching.`;let i=r.getSessionMeta?.(e),a=t;if(i?.models&&!i.models.available.find(e=>e.id===t)){let e=i.models.available.find(e=>e.id.toLowerCase().includes(t.toLowerCase())||e.name.toLowerCase().includes(t.toLowerCase()));if(e)a=e.id;else return`Model "${t}" not found. Available:\n${i.models.available.map(e=>` - ${e.id} (${e.name})`).join(`
- `)}`}try{return await r.setModel(e,a),`Model switched to ${a}`}catch(e){return`Failed: ${e instanceof Error?e.message:String(e)}`}}async setActiveMode(e,t){let n=this.activeAgent.get(e);if(!n)return`No active agent. Use @agent first.`;let r=this.agents.get(n);if(!r)return`Agent not started.`;if(!r.setMode)return`${n} does not support mode switching.`;let i=r.getSessionMeta?.(e),a=t;if(i?.modes&&!i.modes.available.find(e=>e.id===t)){let e=i.modes.available.find(e=>e.id.toLowerCase().includes(t.toLowerCase())||e.name.toLowerCase().includes(t.toLowerCase()));if(e)a=e.id;else return`Mode "${t}" not found. Available:\n${i.modes.available.map(e=>` - ${e.id} (${e.name})`).join(`
- `)}`}try{return await r.setMode(e,a),`Mode switched to ${a}`}catch(e){return`Failed: ${e instanceof Error?e.message:String(e)}`}}listModels(e){let t=this.activeAgent.get(e);if(!t)return`No active agent.`;let n=this.agents.get(t)?.getSessionMeta?.(e);if(!n?.models)return`${t} does not expose model list.`;let r=[`Models (${t}):`];for(let e of n.models.available){let t=e.id===n.models.current?` *`:``;r.push(` ${e.id} - ${e.name}${t}`)}return r.join(`
- `)}listModes(e){let t=this.activeAgent.get(e);if(!t)return`No active agent.`;let n=this.agents.get(t)?.getSessionMeta?.(e);if(!n?.modes)return`${t} does not expose mode list.`;let r=[`Modes (${t}):`];for(let e of n.modes.available){let t=e.id===n.modes.current?` *`:``;r.push(` ${e.id} - ${e.name}${t}`)}return r.join(`
- `)}listConfig(e){let t=this.activeAgent.get(e);if(!t)return`No active agent.`;let n=this.agents.get(t)?.getSessionMeta?.(e);if(!n?.configOptions?.length)return`${t} has no config options.`;let r=[`Config (${t}):`];for(let e of n.configOptions)r.push(` ${e.id}: ${e.current} [${e.type}] - ${e.name}`);return r.push(``,`/config <id> <value> to change.`),r.join(`
- `)}async setActiveConfig(e,t,n){let r=this.activeAgent.get(e);if(!r)return`No active agent.`;let i=this.agents.get(r);if(!i)return`Agent not started.`;if(!i.setConfigOption)return`${r} does not support config options.`;let a=n;n===`true`?a=!0:n===`false`&&(a=!1);try{return await i.setConfigOption(e,t,a),`${t} = ${n}`}catch(e){return`Failed: ${e instanceof Error?e.message:String(e)}`}}getStatus(){let e=[],t=[...this.agents.entries()].map(([e,t])=>{let n=t.info(),r=n.pid?` pid=${n.pid}`:``;return` ${e} [${n.type}]${r}`});e.push(`Running agents (${t.length}):`),t.length>0?e.push(...t):e.push(` (none)`),e.push(``);let n=[...this.inFlight.entries()].map(([e,t])=>{let n=Math.round((Date.now()-t.startedAt)/1e3);return` [${t.agent}] ${e} (${n}s) "${t.message}"`});e.push(`In-flight tasks (${n.length}):`),n.length>0?e.push(...n):e.push(` (none)`);let r=[...this.activeAgent.entries()];if(r.length>0){e.push(``),e.push(`Active sessions (${r.length}):`);for(let[t,n]of r)e.push(` ${t} → ${n}`)}return e.join(`
- `)}async switchDefault(e){return this.configs[e]?(await this.getOrCreateAgent(e),this._defaultAgent=e,`Switched to ${e}`):`Agent "${e}" not configured`}parseCommand(e){return r6(e,this.knownAgents,this.customAliases)}helpText(){return i6(this.configs,this._defaultAgent)}stopAll(){for(let[e,t]of this.agents)this.log.info(`[router] stopping agent "${e}"`),t.stop();this.agents.clear()}}}));function u6(e){let t=e;return t=t.replace(y6,(e,t)=>t?t.trim():``),t=t.replace(x6,``),t=t.replace(S6,`$1`),t=t.replace(C6,``),t=t.replace(w6,(e,t)=>t.split(`|`).map(e=>e.trim()).join(` `)),t=t.replace(T6,``),t=t.replace(E6,(e,t,n)=>t||n),t=t.replace(D6,`$1`),t=t.replace(O6,``),t=t.replace(k6,``),t=t.replace(A6,`$1• `),t=t.replace(b6,`$1`),t=t.replace(j6,`
- `),t.trim()}function d6(e){let t=[];for(let n of e.matchAll(M6)){let e=n[1].trim();(e.startsWith(`http://`)||e.startsWith(`https://`))&&t.push(e)}return t}function f6(e){let t=[],n=new Set;for(let r of e.split(`
- `)){let e=r.trim();if(!e||!v6.isAbsolute(e))continue;let i=v6.extname(e).toLowerCase();if(F6.has(i)){try{if(_6.statSync(e).isDirectory())continue}catch{continue}n.has(e)||(n.add(e),t.push(e))}}return t}function p6(e,t){if(t.includes(``))return!0;let n;try{n=_6.realpathSync(e)}catch{try{n=v6.resolve(e)}catch{return!1}}for(let e of t){if(!e)continue;let t;try{t=_6.realpathSync(e)}catch{t=v6.resolve(e)}let r=v6.relative(t,n);if(r===`.`||!r.startsWith(`..`)&&!v6.isAbsolute(r))return!0}return!1}function m6(e,t,n){let r=new Map(t.map(e=>[e,`已发送附件:${v6.basename(e)}`])),i=e.split(`
- `).map(e=>{let t=e.trim();return r.get(t)??e}).join(`
- `),a=[...new Set(n)];if(a.length>0){let e=a.map(e=>`附件发送失败:${v6.basename(e)}`);i=i.trim()?i+`
- `+e.join(`
- `):e.join(`
- `)}return i}function h6(e){let t=v6.extname(e).toLowerCase();return N6.has(t)?IK.Image:P6.has(t)?IK.Video:IK.File}async function g6(e){let{weclaw:t,toUserId:n,contextToken:r,allowedRoots:i,log:a}=e,{reply:o}=e,s=f6(o),c=[],l=[];for(let e of s){if(!p6(e,i)){a?.warn(`[media] rejected attachment outside allowed roots: ${e}`),l.push(e);continue}try{let i=_6.readFileSync(e),o=h6(e);await t.sendMedia(n,Buffer.from(i),o,{fileName:v6.basename(e),contextToken:r}),c.push(e),a?.info(`[media] sent attachment: ${e}`)}catch(t){a?.error(`[media] failed to send attachment ${e}:`,t),l.push(e)}}o=m6(o,c,l);let u=d6(o),d=u6(o);d&&await t.sendText(n,d,r);for(let e of u)try{let i=await(0,f.requestUrl)({url:e,method:`GET`});if(i.status!==200){a?.warn(`[media] failed to download image ${e}: HTTP ${i.status}`);continue}let o=Buffer.from(i.arrayBuffer);await t.sendMedia(n,o,IK.Image,{contextToken:r}),a?.info(`[media] sent image from URL: ${e}`)}catch(t){a?.error(`[media] failed to send image ${e}:`,t)}}var _6,v6,y6,b6,x6,S6,C6,w6,T6,E6,D6,O6,k6,A6,j6,M6,N6,P6,F6,I6=o((()=>{K_(),RK(),_6=G_(`fs`),v6=G_(`path`),y6=/```[^\n]*\n?([\s\S]*?)```/g,b6=/`([^`]+)`/g,x6=/!\[[^\]]*\]\([^)]*\)/g,S6=/\[([^\]]+)\]\([^)]*\)/g,C6=/^\|[\s:|-]+\|$/gm,w6=/^\|(.+)\|$/gm,T6=/^#{1,6}\s+/gm,E6=/\*\*(.+?)\*\*|__(.+?)__/g,D6=/~~(.+?)~~/g,O6=/^>\s?/gm,k6=/^[-*_]{3,}\s*$/gm,A6=/^(\s*)[-*+]\s+/gm,j6=/\n{3,}/g,M6=/!\[[^\]]*\]\(([^)]+)\)/g,N6=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`]),P6=new Set([`.mp4`,`.mov`,`.webm`,`.mkv`,`.avi`]),F6=new Set([...N6,...P6,`.pdf`,`.doc`,`.docx`,`.xls`,`.xlsx`,`.ppt`,`.pptx`,`.zip`,`.txt`,`.csv`])})),L6=c({WeChatService:()=>z6});function R6(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}var z6,B6=o((()=>{GK(),JK(),Tq(),AK(),Fq(),M(),H(),Yg(),zv(),Av(),RK(),l6(),I6(),qG(),z6=class{plugin;weclaw=null;storage;silkCodec;qrModal=null;loginAbort=null;router=null;constructor(e){this.plugin=e,this.storage=new qK(e.app,e.manifest.id),this.silkCodec=new Pq(e.app,e.manifest.id)}async isVerified(){let e=L.getState()?.verifyState;if(!e)return!1;let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;return e.appId===n}async start(){if(!f.Platform.isDesktop){new f.Notice(j(`WeChat integration is only available on desktop`));return}if(!await this.isVerified()){kv();return}if(this.weclaw?.running){new f.Notice(j(`WeChat is already running`));return}this.storage.loadSecrets();let e=this.plugin.settings.wechat,t={info:(e,...t)=>console.log(e,...t),warn:(e,...t)=>console.warn(e,...t),error:(e,...t)=>console.error(e,...t)};this.initRouter(t),this.weclaw=new WK(this.storage,{defaultReply:e.defaultReply||!1,logger:t}),this.registerCommands(),this.weclaw.on(`qrcode`,({imageBase64:e})=>{this.qrModal&&this.qrModal.setQRCode(e)}),this.weclaw.on(`scanned`,()=>{this.qrModal?.setStatus(`scanned`,j(`Scanned! Please confirm on your phone.`))}),this.weclaw.on(`login`,()=>{this.qrModal?.setStatus(`confirmed`,j(`Login successful!`)),setTimeout(()=>this.qrModal?.close(),1500)}),this.weclaw.on(`ready`,()=>{new f.Notice(j(`WeChat connected`))}),this.weclaw.on(`error`,e=>{console.error(`[WeChatService] error:`,e)}),this.weclaw.on(`stopped`,()=>{new f.Notice(j(`WeChat disconnected`))}),this.storage.loadCredentials()||this.showQRModal(),this.weclaw.start().catch(e=>{console.error(`[WeChatService] start failed:`,e),e.message===`QR code expired`?this.qrModal?.setStatus(`expired`,j(`QR code expired. Please restart.`)):new f.Notice(`WeChat: ${e.message}`)})}stop(){this.loginAbort?.abort(),this.loginAbort=null,this.weclaw?.stop(),this.qrModal?.close(),this.qrModal=null,this.router?.stopAll(),this.router=null}logout(){this.router?.stopAll(),this.router=null,this.weclaw?.logout(),this.weclaw=null,new f.Notice(j(`WeChat logged out`))}get running(){return this.weclaw?.running??!1}hasCredentials(){return this.storage.loadCredentials()!==null}onunload(){this.stop(),this.weclaw?.removeAllListeners(),this.weclaw=null}showQRModal(){this.qrModal=new wq(this.plugin.app,()=>{this.loginAbort?.abort()}),this.qrModal.open()}initRouter(e){let t=this.plugin.settings.wechat.agentRouting;if(!t?.enabled){this.router=null;return}let n=t.agents??{};if(Object.keys(n).length===0){console.warn(`[WeChatService] agent routing enabled but no agents configured`),this.router=null;return}let r=this.plugin.app.vault.adapter.basePath||process.cwd(),i=t.cwd||r;this.router=new c6(n,t.defaultAgent||``,i,{logger:e,customAliases:t.customAliases,baseSystemPrompt:t.baseSystemPrompt??GG}),console.log(`[WeChatService] agent router initialized (default=${t.defaultAgent}, agents=${Object.keys(n).join(`,`)})`)}registerCommands(){if(!this.weclaw)return;let e=()=>this.plugin.settings.MemoSaveLocation||`DAILY`;this.weclaw.onDefault(async t=>this.handleDefaultMessage(t,e())),this.weclaw.command([`d`,`diary`],async e=>this.handleMessage(e,`DAILY`)),this.weclaw.command([`t`,`todo`],async t=>this.handleMessage(t,e(),!0)),this.weclaw.command([`n`,`note`],async e=>this.handleMessage(e,`MULTI`)),this.router&&(this.weclaw.command(`info`,async e=>this.router.getAgentInfo(e.fromUserId)),this.weclaw.command([`new`,`clear`],async e=>this.router.resetActiveSession(e.fromUserId)),this.weclaw.command(`help`,async e=>this.router.getActiveHelp(e.fromUserId)),this.weclaw.command(`model`,async e=>{let t=e.text.trim();return t?this.router.setActiveModel(e.fromUserId,t):this.router.listModels(e.fromUserId)}),this.weclaw.command(`mode`,async e=>{let t=e.text.trim();return t?this.router.setActiveMode(e.fromUserId,t):this.router.listModes(e.fromUserId)}),this.weclaw.command(`config`,async e=>{let t=e.text.trim();if(!t)return this.router.listConfig(e.fromUserId);let n=t.indexOf(` `);if(n<0)return this.router.listConfig(e.fromUserId);let r=t.slice(0,n),i=t.slice(n+1).trim();return this.router.setActiveConfig(e.fromUserId,r,i)}),this.weclaw.command(`status`,async()=>this.router.getStatus()),this.weclaw.command([`cancel`,`stop`],async e=>this.router.cancelActivePrompt(e.fromUserId)),this.weclaw.command(`resume`,async e=>{let t=e.text.trim();if(!t)return this.router.formatSessionList(e.fromUserId);let n=parseInt(t,10);return isNaN(n)?this.router.resumeByName(e.fromUserId,t):this.router.resumeByIndex(e.fromUserId,n)}),this.weclaw.command(`thino`,async t=>t.text?this.handleMessage(t,e()):j(`Usage: /thino <content>`)))}async handleDefaultMessage(e,t){if(!this.router||!this.weclaw)return this.handleMessage(e,t);try{let t=this.router.parseCommand(e.fullText);if(t){if(t.agents.length===1&&!t.message)return this.router.setActiveAgent(e.fromUserId,t.agents[0]),await this.router.switchDefault(t.agents[0]);let n=t.message||e.text||e.fullText;if(t.agents.length===1){this.router.setActiveAgent(e.fromUserId,t.agents[0]);let r=await this.router.chat(t.agents[0],e.fromUserId,n);await this.sendAgentReply(e,r);return}let r=(await this.router.broadcast(t.agents,e.fromUserId,n)).map(e=>`[${e.name}] ${e.reply}`).join(`
- `);await this.sendAgentReply(e,r);return}let n=this.router.getActiveAgent(e.fromUserId);if(n){let t=await this.router.chat(n,e.fromUserId,e.text||e.fullText);await this.sendAgentReply(e,t);return}}catch(e){return console.error(`[WeChatService] agent routing error:`,e),`Agent error: ${e instanceof Error?e.message:String(e)}`}return this.handleMessage(e,t)}async sendAgentReply(e,t){if(!this.weclaw)return;let n=this.plugin.settings.wechat.agentRouting,r=this.plugin.app.vault.adapter.basePath||process.cwd(),i;i=n?.allowAllPaths?[process.platform===`win32`?``:`/`]:[r,n?.cwd,process.cwd(),...n?.allowedFileRoots??[]].filter(Boolean),await g6({weclaw:this.weclaw,toUserId:e.fromUserId,contextToken:e.contextToken,reply:t,allowedRoots:i,log:{info:(...e)=>console.log(...e),warn:(...e)=>console.warn(...e),error:(...e)=>console.error(...e)}})}async handleMessage(e,t,n=!1){try{let r=this.plugin.settings.wechat.voiceSaveMode??`both`,i=await this.saveMediaItems(e.items,r),a=e.text||e.fullText||``;if(r===`text`||r===`both`){let t=[];for(let n of e.items)n.type===FK.Voice&&n.voice_item?.text&&t.push(n.voice_item.text);if(t.length>0){let e=t.join(`
- `);a=a.trim()?`${a.trim()}\n${e}`:e}}else if(!a.trim()){for(let t of e.items)if(t.type===FK.Voice&&t.voice_item?.text){a=t.voice_item.text;break}}let o=[];a.trim()&&o.push(n?`- [ ] ${a.trim()}`:a.trim()),i.length>0&&o.push(...i);let s=o.join(`
- `);return s?(await V.createThino({content:s,type:t,isList:!0}),this.plugin.settings.wechat.defaultReply||j(`Saved`)):j(`Empty message, not saved`)}catch(e){return console.error(`[WeChatService] save thino error:`,e),j(`Failed to save`)}}async saveMediaItems(e,t=`both`){let n=[];for(let r of e)try{if(r.type===FK.Image&&r.image_item?.media){let e=r.image_item.media,t=await wK(e.encrypt_query_param,e.aes_key),i=`wechat-${(0,f.moment)().format(`YYYYMMDDHHmmss`)}-${R6(4)}.png`,a=await this.saveToVault(i,t);a&&n.push(`![[${a.name}]]`)}else if(r.type===FK.Voice&&r.voice_item?.media){if(t===`text`)continue;let e=r.voice_item.media,i=await wK(e.encrypt_query_param,e.aes_key),a=await this.silkCodec.decodeToWav(i),o=a?`wav`:`silk`,s=a??i,c=`wechat-${(0,f.moment)().format(`YYYYMMDDHHmmss`)}-${R6(4)}.${o}`,l=await this.saveToVault(c,s);l&&n.push(`![[${l.name}]]`)}else if(r.type===FK.Video&&r.video_item?.media){let e=r.video_item.media,t=await wK(e.encrypt_query_param,e.aes_key),i=`wechat-${(0,f.moment)().format(`YYYYMMDDHHmmss`)}-${R6(4)}.mp4`,a=await this.saveToVault(i,t);a&&n.push(`![[${a.name}]]`)}else if(r.type===FK.File&&r.file_item?.media){let e=r.file_item.media,t=await wK(e.encrypt_query_param,e.aes_key),i=r.file_item.file_name||`file`,a=i.includes(`.`)?``:`.bin`,o=`wechat-${(0,f.moment)().format(`YYYYMMDDHHmmss`)}-${i}${a}`,s=await this.saveToVault(o,t);s&&n.push(`![[${s.name}]]`)}}catch(e){console.error(`[WeChatService] media download error:`,e)}return n}async saveToVault(e,t){let n=this.plugin.app.vault,r=e.split(`.`).pop()||`bin`,i=e.replace(/\.[^.]+$/,``),a=await n.getAvailablePathForAttachments(i,r),o=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return await n.createBinary(a,o)}}}));M(),Av(),qG();var V6=(0,f.requireApiVersion)(`1.11.0`),H6=class{constructor(e){this.props=e}async display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;new G(e,t).setHeading().setTab(r).setName(j(`WeChat Integration`)),new G(e,t).setTab(r).setDesc(j(`Receive WeChat messages and save them as Thino memos. Desktop only. Requires Pro.`)),new G(e,t).setName(j(`Enable WeChat`)).setDesc(j(`Enable WeChat message receiver`)).setTab(r).addToggle(e=>e.setValue(n.settings.wechat.enabled).onChange(async r=>{if(r&&!i){kv(),e.setValue(!1);return}if(r&&!f.Platform.isDesktop){new f.Notice(j(`WeChat integration is only available on desktop`)),e.setValue(!1);return}n.settings.wechat={...n.settings.wechat,enabled:r},t.applySettingsUpdate()})),new G(e,t).setName(j(`Auto start`)).setDesc(j(`Automatically start WeChat receiver when Obsidian opens`)).setTab(r).addToggle(e=>e.setValue(n.settings.wechat.autoStart).onChange(async r=>{if(!i){kv(),e.setValue(!1);return}n.settings.wechat={...n.settings.wechat,autoStart:r},t.applySettingsUpdate()})),new G(e,t).setName(j(`Default reply`)).setDesc(j(`Auto-reply text when a message is saved. Leave empty to disable.`)).setTab(r).addText(e=>e.setPlaceholder(j(`Saved`)).setValue(n.settings.wechat.defaultReply).onChange(async e=>{n.settings.wechat={...n.settings.wechat,defaultReply:e},t.applySettingsUpdate()})),new G(e,t).setName(j(`Voice save mode`)).setDesc(j(`How to save voice messages: transcription text, audio file, or both`)).setTab(r).addDropdown(e=>e.addOptions({both:j(`Text + Audio`),text:j(`Text only`),voice:j(`Audio only`)}).setValue(n.settings.wechat.voiceSaveMode??`both`).onChange(async e=>{n.settings.wechat={...n.settings.wechat,voiceSaveMode:e},t.applySettingsUpdate()})),new G(e,t).setHeading().setTab(r).setName(j(`Connection`));let a=n.wechatService?.running??!1,o=n.wechatService?.hasCredentials()??!1;new G(e,t).setName(j(a?`WeChat is running`:`WeChat is stopped`)).setDesc(j(o?`Credentials found. Click Start to connect.`:`No credentials. Will show QR code on start.`)).setTab(r).addButton(e=>{e.setButtonText(j(a?`Stop`:`Start`)).setCta().onClick(async()=>{if(!i){kv();return}if(a)n.wechatService?.stop();else{if(!n.wechatService){let{WeChatService:e}=await Promise.resolve().then(()=>(B6(),L6));n.wechatService=new e(n)}await n.wechatService.start()}setTimeout(()=>t.debounceApplySettingsUpdate(),500)})}),o&&new G(e,t).setName(j(`Logout`)).setDesc(j(`Clear stored credentials and disconnect`)).setTab(r).addButton(e=>{e.setButtonText(j(`Logout`)).setWarning().onClick(async()=>{n.wechatService?.logout(),setTimeout(()=>t.debounceApplySettingsUpdate(),500)})}),new G(e,t).setHeading().setTab(r).setName(j(`Voice Codec`));let{SilkCodec:s}=await Promise.resolve().then(()=>(Fq(),Eq)),c=new s(n.app,n.manifest.id),l=await c.isInstalled();new G(e,t).setName(j(`SILK Decoder`)).setDesc(j(l?`Installed. Voice messages will be converted to playable WAV files.`:`Not installed. Download to enable voice message playback in Obsidian.`)).setTab(r).addButton(e=>{l?e.setButtonText(j(`Remove`)).setWarning().onClick(async()=>{await c.remove(),new f.Notice(j(`Voice codec removed`)),t.display()}):e.setButtonText(j(`Download`)).setCta().onClick(async()=>{e.setButtonText(j(`Downloading...`)).setDisabled(!0);try{await c.download(),new f.Notice(j(`Voice codec downloaded`))}catch(e){new f.Notice(`${j(`Download failed`)}: ${e.message}`)}t.display()})}),new G(e,t).setHeading().setTab(r).setName(j(`Commands`));let u=e.createDiv({cls:`wechat-commands-help`});u.innerHTML=[`<p>${j(`Send messages to the WeChat bot with these command prefixes:`)}</p>`,`<ul>`,`<li><code>/d</code> ${j(`or`)} <code>/diary</code> - ${j(`Save to daily note`)}</li>`,`<li><code>/t</code> ${j(`or`)} <code>/todo</code> - ${j(`Save as task`)}</li>`,`<li><code>/n</code> ${j(`or`)} <code>/note</code> - ${j(`Save as multi-file note`)}</li>`,`<li>${j(`No prefix`)} - ${j(`Save using default save type`)}</li>`,`</ul>`].join(``),this.displayAgentRouting(e,t,n,r)}displayAgentRouting(e,t,n,r){let i=n.settings.wechat.agentRouting??{...KG};new G(e,t).setHeading().setTab(r).setName(j(`Agent Routing`)),new G(e,t).setTab(r).setDesc(j(`Route incoming WeChat messages to AI agents (ACP/CLI/HTTP). When enabled, messages with @agent or /agent prefix are forwarded to the specified agent.`)),new G(e,t).setName(j(`Enable Agent Routing`)).setDesc(j(`Forward messages to AI agents instead of saving as memos`)).setTab(r).addToggle(e=>e.setValue(i.enabled).onChange(async e=>{n.settings.wechat={...n.settings.wechat,agentRouting:{...i,enabled:e}},t.applySettingsUpdate()}));let a=Object.keys(i.agents??{}),o={"":j(`None (save as memo)`)};for(let e of a)o[e]=e;new G(e,t).setName(j(`Default Agent`)).setDesc(j(`Agent used when message has no @agent prefix`)).setTab(r).addDropdown(e=>e.addOptions(o).setValue(i.defaultAgent||``).onChange(async e=>{n.settings.wechat={...n.settings.wechat,agentRouting:{...i,defaultAgent:e}},t.applySettingsUpdate()})),new G(e,t).setName(j(`Working Directory`)).setDesc(j(`Default working directory for all agents. Leave empty to use vault root.`)).setTab(r).addText(e=>e.setPlaceholder(j(`Vault root`)).setValue(i.cwd||``).onChange(async e=>{n.settings.wechat={...n.settings.wechat,agentRouting:{...i,cwd:e||void 0}},t.applySettingsUpdate()})),new G(e,t).setName(j(`Allow All File Paths`)).setDesc(j(`Skip path restriction when sending files. Enable if agents need to send files from any directory.`)).setTab(r).addToggle(e=>e.setValue(i.allowAllPaths??!1).onChange(async e=>{n.settings.wechat={...n.settings.wechat,agentRouting:{...i,allowAllPaths:e}},t.applySettingsUpdate()})),new G(e,t).setName(j(`Agents`)).setDesc(j(`Configure AI agents`)).setTab(r).addButton(e=>e.setButtonText(j(`Add Agent`)).setCta().onClick(async()=>{let e=`agent-`+Date.now().toString(36),r={...i.agents??{},[e]:{type:`acp`}};n.settings.wechat={...n.settings.wechat,agentRouting:{...i,agents:r}},t.applySettingsUpdate(),t.display()}));for(let[a,o]of Object.entries(i.agents??{}))V6?this.displayAgentGroup(e,t,n,r,a,o,i):this.displayAgentFlat(e,t,n,r,a,o,i);if(i.enabled&&a.length>0){let n=e.createDiv({cls:`wechat-commands-help`});t.addSettingToMasterSettingsList(r,n,`agent commands`),n.innerHTML=[`<p><strong>${j(`Agent Commands`)}:</strong></p>`,`<ul>`,`<li><code>@agent msg</code> or <code>/agent msg</code> - ${j(`Send to specific agent`)}</li>`,`<li><code>@a @b msg</code> - ${j(`Broadcast to multiple agents`)}</li>`,`<li><code>/agent</code> (${j(`no message`)}) - ${j(`Switch default agent`)}</li>`,`<li><code>/new</code> or <code>/clear</code> - ${j(`Reset agent session`)}</li>`,`<li><code>/info</code> - ${j(`Show current agent info`)}</li>`,`</ul>`,`<p><strong>${j(`Built-in aliases`)}:</strong> /cc(claude) /cx(codex) /cs(cursor) /km(kimi) /gm(gemini) /oc(openclaw)</p>`].join(``)}}displayAgentGroup(e,t,n,r,i,a,o){let s=`${i} [${a.type.toUpperCase()}]`,c=new f.SettingGroup(e).setHeading(s).addExtraButton(e=>{e.setIcon(`trash-2`).setTooltip(j(`Delete`)).onClick(async()=>{let e={...o.agents??{}};delete e[i],n.settings.wechat={...n.settings.wechat,agentRouting:{...o,agents:e}},t.applySettingsUpdate(),t.display()})}),l=e=>{let r={...o.agents??{}};r[i]={...a,...e},n.settings.wechat={...n.settings.wechat,agentRouting:{...o,agents:r}},t.applySettingsUpdate()};if(c.addSetting(e=>{e.setName(j(`Type`)).addDropdown(e=>e.addOptions({acp:`ACP`,cli:`CLI`,http:`HTTP`}).setValue(a.type||`acp`).onChange(e=>{l({type:e}),t.display()}))}),a.type===`http`?(c.addSetting(e=>{e.setName(j(`Endpoint`)).setDesc(j(`OpenAI-compatible API endpoint URL`)).addText(e=>e.setPlaceholder(`https://api.openai.com/v1/chat/completions`).setValue(a.endpoint||``).onChange(e=>l({endpoint:e})))}),c.addSetting(e=>{e.setName(j(`API Key`)).addText(e=>e.setPlaceholder(`sk-...`).setValue(a.apiKey||``).onChange(e=>l({apiKey:e})))})):(c.addSetting(e=>{let t=a.type===`cli`&&i===`codex`;e.setName(j(`Command`)).setDesc(j(t?`Path to agent binary. Leave empty or use codex to auto-detect codex.exe on Windows.`:`Path to agent binary`)).addText(e=>e.setPlaceholder(t?`codex`:a.type===`acp`?`claude-agent-acp`:`claude`).setValue(a.command||``).onChange(e=>l({command:e})))}),c.addSetting(e=>{e.setName(j(`Args`)).setDesc(j(`Extra command-line arguments (space-separated)`)).addText(e=>e.setValue((a.args??[]).join(` `)).onChange(e=>l({args:e.trim()?e.trim().split(/\s+/):[]})))})),c.addSetting(e=>{e.setName(j(`Model`)).addText(e=>e.setPlaceholder(a.type===`http`?`gpt-5.4-mini`:`claude-sonnet-4-6`).setValue(a.model||``).onChange(e=>l({model:e})))}),a.type!==`http`){let e={};for(let[t,n]of Object.entries(WG))e[t]=j(n);c.addSetting(t=>{t.setName(j(`Permission Mode`)).setDesc(j(`Approval policy for agent tool calls`)).addDropdown(t=>t.addOptions(e).setValue(a.permissionMode||`default`).onChange(e=>l({permissionMode:e})))});let t={};for(let[e,n]of Object.entries(UG))t[e]=j(n);c.addSetting(e=>{e.setName(j(`Reasoning Effort`)).setDesc(j(`Thinking budget level (codex/ACP agents)`)).addDropdown(e=>e.addOptions(t).setValue(a.reasoningEffort||`medium`).onChange(e=>l({reasoningEffort:e})))}),c.addSetting(e=>{e.setName(j(`Working Directory`)).setDesc(j(`Override global working directory for this agent`)).addText(e=>e.setPlaceholder(j(`Use global`)).setValue(a.cwd||``).onChange(e=>l({cwd:e||void 0})))})}c.addSetting(e=>{e.setName(j(`System Prompt`)).setDesc(j(`Optional system prompt for the agent`)).addText(e=>e.setValue(a.systemPrompt||``).onChange(e=>l({systemPrompt:e})))})}displayAgentFlat(e,t,n,r,i,a,o){let s=e=>{let r={...o.agents??{}};r[i]={...a,...e},n.settings.wechat={...n.settings.wechat,agentRouting:{...o,agents:r}},t.applySettingsUpdate()},c=new G(e,t).setTab(r).setName(i);if(c.addDropdown(e=>e.addOptions({acp:`ACP`,cli:`CLI`,http:`HTTP`}).setValue(a.type||`acp`).onChange(e=>{s({type:e}),t.display()})),c.addButton(e=>e.setButtonText(j(`Delete`)).setWarning().onClick(async()=>{let e={...o.agents??{}};delete e[i],n.settings.wechat={...n.settings.wechat,agentRouting:{...o,agents:e}},t.applySettingsUpdate(),t.display()})),a.type===`http`)new G(e,t).setName(j(`Endpoint`)).setTab(r).addText(e=>e.setPlaceholder(`https://api.openai.com/v1/chat/completions`).setValue(a.endpoint||``).onChange(e=>s({endpoint:e}))),new G(e,t).setName(j(`API Key`)).setTab(r).addText(e=>e.setPlaceholder(`sk-...`).setValue(a.apiKey||``).onChange(e=>s({apiKey:e})));else{let n=a.type===`cli`&&i===`codex`;new G(e,t).setName(j(`Command`)).setDesc(j(n?`Path to agent binary. Leave empty or use codex to auto-detect codex.exe on Windows.`:`Path to agent binary`)).setTab(r).addText(e=>e.setPlaceholder(n?`codex`:a.type===`acp`?`claude-agent-acp`:`claude`).setValue(a.command||``).onChange(e=>s({command:e}))),new G(e,t).setName(j(`Args`)).setTab(r).addText(e=>e.setValue((a.args??[]).join(` `)).onChange(e=>s({args:e.trim()?e.trim().split(/\s+/):[]})))}if(new G(e,t).setName(j(`Model`)).setTab(r).addText(e=>e.setPlaceholder(a.type===`http`?`gpt-5.4-mini`:`claude-sonnet-4-6`).setValue(a.model||``).onChange(e=>s({model:e}))),a.type!==`http`){let n={};for(let[e,t]of Object.entries(WG))n[e]=j(t);new G(e,t).setName(j(`Permission Mode`)).setTab(r).addDropdown(e=>e.addOptions(n).setValue(a.permissionMode||`default`).onChange(e=>s({permissionMode:e})));let i={};for(let[e,t]of Object.entries(UG))i[e]=j(t);new G(e,t).setName(j(`Reasoning Effort`)).setDesc(j(`Thinking budget level (codex/ACP agents)`)).setTab(r).addDropdown(e=>e.addOptions(i).setValue(a.reasoningEffort||`medium`).onChange(e=>s({reasoningEffort:e}))),new G(e,t).setName(j(`Working Directory`)).setTab(r).addText(e=>e.setPlaceholder(j(`Use global`)).setValue(a.cwd||``).onChange(e=>s({cwd:e||void 0})))}new G(e,t).setName(j(`System Prompt`)).setTab(r).addText(e=>e.setValue(a.systemPrompt||``).onChange(e=>s({systemPrompt:e})))}};Yg(),M(),$r(),H(),I(),Av(),zv(),h_(),Rg(),li(),K_();var U6=G_(`os`),W6=async()=>{let e=``;if(f.Platform.isDesktop)e=await Pv();else{let t=await window.Capacitor?.Plugins?.Device?.getId?.();e=t?.identifier||t?.uuid||``}let t;if(f.Platform.isDesktop&&typeof U6?.hostname==`function`&&typeof U6?.platform==`function`)t=JSON.stringify({hostname:U6.hostname(),platform:U6.platform(),machineid:e});else{let n=await window.Capacitor?.Plugins?.Device?.getInfo?.(),r=n?.model,i=n?.platform;t=JSON.stringify({hostname:r||(`mobile`+f.Platform.isMobile?Math.random().toString(36).substring(7):``),platform:i||`mobile`,machineid:e})}return mG(t)},G6={General:`chef-hat`,Thino:`Memos`,Interface:`brush`,Share:`share-2`,Advanced:`cog`,About:`info`,Blank:`home`,Editor:`edit`,Tasks:`check-square`,Super:`sparkles`,Pro:`diamond`},K6=[{value:`DAILY`,target:`ProcessEntriesBelow`,insert:`InsertAfter`},{value:`CANVAS`,target:`MemoDefaultCanvasPath`},{value:`MULTI`,target:`MemoDefaultMultiFilePath`},{value:`FILE`,target:`MemoDefaultSingleFilePath`},{value:`JOURNAL`,target:`JournalFolder`}],q6={FirstLoaded:!0,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,ShowClipboardOnFocus:!0,OpenDailyMemosWithMemos:!0,HideDoneTasks:!1,ShowTaskLabel:!0,AppendDateWhenTaskDone:!1,MobileAndDesktop:`All`,OpenMemosAutomatically:!1,ShowScrollbar:!1,ShowTime:!0,ShowDate:!0,AddBlankLineWhenDate:!1,AutoSaveWhenOnMobile:!1,DeleteFileName:`delete`,QueryFileName:`query`,UseVaultTags:!1,SetCustomBackgroundImage:!1,SetCustomMemoFooter:!1,DefaultLightBackgroundImage:``,DefaultDarkBackgroundImage:``,DefaultLightBackgroundImageForClean:``,DefaultDarkBackgroundImageForClean:``,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`},JournalSettings:{granularity:`day`,useIndependentSettings:!1,headingDateFormat:`YYYY-MM-DD`,daily:{folder:``,format:`YYYY-MM-DD`,template:``},weekly:{folder:``,format:`gggg-[W]ww`,template:``},monthly:{folder:``,format:`YYYY-MM`,template:``},yearly:{folder:``,format:`YYYY`,template:``}},MemoDailyTarget:5,HeatmapColorScheme:`default`,EnabledHttpApi:!1,HttpApiIpType:`127.0.0.1`,HttpApiPort:`43999`,AutoDownloadImage:!1,EditorType:`obsidian`,EnabledLocationList:[{value:`DAILY`,target:`ProcessEntriesBelow`,insert:`InsertAfter`}],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`,ShareAppendType:`preset`,SharePrependType:`preset`,SetFileNameAfterCreate:!1,TagForFileTypeFiles:`thino/file`,TagForMultiTypeFiles:`thino/multi`,MinHeightForShare:`200px`,ThinoMaxHeight:0,ThinoCollapsedHeight:100,OptimizeForCallout:!0,AppendOrPrependTextViaServer:!1,AppendViaServer:``,PrependViaServer:``,WithNewLineViaServer:`none`,SupportSelectOtherView:!1,WaitTemplaterToFinishParse:!1,NavbarButton:!1,AlwaysShowStatusText:!1,FilterByMetadata:!1,ShowSourcePath:!1,ShowUpdateMessage:!0,SyncManually:!1,MemoFixedPrefix:``,MemoFixedSuffix:``,UseMemoFixedStrings:!1,enableWordCount:!1,maxWordCount:0,enableReferenceLinksGroup:!1,doubleClickBehavior:`edit-thino`,useMobileViewDefaultHeader:!1,IgnoreFolderForMultiType:[],UseBlockLinkWhenDragging:!1,ShowScrollToTopButton:!0,ZoomImageWhenViewing:!1,ViewArchiveInRandomReview:!1,DraggingBehavior:`block-link`,superEnabled:!1,enableSecretMasking:!1,secretContentRegex:``,secretMaskingStyle:`blur`,fsrsRequestRetention:.9,fsrsMaximumInterval:36500,fsrsEnableFuzz:!0,fsrsEnableShortTerm:!0,fsrsWeights:[],fsrsDailyLimit:100,wechat:{enabled:!1,autoStart:!1,defaultReply:``,voiceSaveMode:`both`,agentRouting:{enabled:!1,defaultAgent:`claude`,agents:{claude:{type:`cli`,command:`claude`,aliases:[`cc`]},codex:{type:`cli`,command:`codex`,aliases:[`cx`]},gemini:{type:`cli`,command:`gemini`,aliases:[`gm`]}}}},general:{...TG}};function J6({plugin:e}){let[t,n]=(0,U.useState)(!1),[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(``),l=U.useRef(null),u=async()=>{let t=a,r=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),i=r?r.identifier||r.uuid:await Pv();t&&(e.settingTab.updateSettings(`tokenForVerify`,{...e.settings.tokenForVerify,[i]:t}),e.verify().then(t=>{t&&(n(!0),R.setRefresh(!0),setTimeout(()=>{e.settingTab.display()},200),e.registerToolbarCheck()),new f.Notice(j(t?`Verify successfully`:`Failed to verify`))}).catch(()=>{new f.Notice(j(`Failed to verify`))}))};return(0,W.jsxs)(`div`,{className:`thino-verify-content`,children:[(0,W.jsxs)(`div`,{className:`thino-description-link`,children:[j(`You can buy a license from`)+`->`,(0,W.jsxs)(`span`,{className:`thino-url`,onClick:()=>{m_()?window.open(`https://pkmer.cn/products/thino`,`_blank`):window.open(`https://thino.pkmer.net/en/#price`,`_blank`)},children:[` `,`PKMer`]})]}),(0,W.jsx)(`textarea`,{className:`thino-verify-textarea`,value:a,onChange:e=>o(e.target.value),placeholder:j(`Input activation code here`)}),(0,W.jsxs)(`div`,{className:`thino-button-container`,children:[(0,W.jsxs)(`div`,{className:`thino-button-group`,children:[!a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{onClick:async()=>{let e=``;try{e=await W6()}catch(e){console.error(e),new f.Notice(j(`Copy to clipboard failed`));return}let t=!1;try{t=await N.copyTextToClipboard(e)}catch(e){console.error(e),t=!1}if(t){i(!0),c(``),new f.Notice(j(`Copied to clipboard Successfully`));return}c(e),i(!0),new f.Notice(j(`Copy to clipboard failed`)),setTimeout(()=>{let t=l.current;if(t){t.focus(),t.select();try{t.setSelectionRange(0,e.length)}catch{}}},0)},children:j(`Copy Thino id`)}),(0,W.jsx)(`button`,{onClick:()=>{if(!r){new f.Notice(j(`Please copy Thino id first`));return}m_()?window.open(`https://pkmer.cn/products/UserProfile/#tab-21&getCode`,`_blank`):window.open(`https://pkmer.net/en/userprofile/#tab-21&getCode`,`_blank`),n(!0)},children:j(`Get activation code`)})]}),a&&(0,W.jsx)(`button`,{onClick:async()=>await u(),children:j(`Verify`)})]}),s?(0,W.jsxs)(`div`,{className:`thino-manual-copy`,children:[(0,W.jsx)(`p`,{className:`thino-manual-copy-hint`,children:j(`Auto-copy was blocked. Long-press the box below to select and copy your Thino id manually.`)}),(0,W.jsx)(`textarea`,{ref:l,className:`thino-manual-copy-textarea`,value:s,readOnly:!0,rows:3,onFocus:e=>{e.currentTarget.select();try{e.currentTarget.setSelectionRange(0,s.length)}catch{}},onClick:e=>{e.currentTarget.select();try{e.currentTarget.setSelectionRange(0,s.length)}catch{}}})]}):null,t?(0,W.jsx)(`p`,{children:j(`After you verify your account, please refresh this page.`)}):``]})]})}function Y6({plugin:e}){let[t,n]=(0,U.useState)(!1),[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(e.settings.general?.userInfo);(0,U.useEffect)(()=>{f.Platform.isMobile&&(a?.sub||e.pkmerAuth.prepareMobileAuthUrl().catch(e=>{console.error(`Failed to pre-compute PKMer OAuth URL:`,e)}))},[a?.sub]),(0,U.useEffect)(()=>{if(!r)return;let t=setInterval(()=>{let t=e.settings.general?.userInfo;t?.sub&&(o(t),i(!1),n(!1))},1e3),a=setTimeout(()=>{i(!1),n(!1)},300*1e3);return()=>{clearInterval(t),clearTimeout(a)}},[r]);let s=async()=>{if(f.Platform.isMobile){let t=e.pkmerAuth.consumeMobileAuthUrl();if(t){window.open(t,`_blank`),n(!0),i(!0),e.pkmerAuth.prepareMobileAuthUrl().catch(()=>{});return}n(!0);try{await e.pkmerAuth.login(),i(!0)}catch{n(!1)}return}n(!0);try{if(await e.pkmerAuth.login(),await e.verify()){R.setRefresh(!0);let t=e.pkmerAuth.aiToken;if(t){let n=e.settings.general?.userInfo?.ai_quota;X6(t,n)}e.registerToolbarCheck()}o(e.settings.general?.userInfo??null)}finally{n(!1)}},c=async()=>{await e.pkmerAuth.logout(),L.setVerifyState(null),R.setRefresh(!0),o(null);let t=B.getState();t.updateProvider(`pkmer`,{type:`pkmer`,enabled:!1,apiKey:``,quotaInfo:void 0}),t.activeCompletionProvider===`pkmer`&&t.setActiveCompletionProvider(`openai`)},l=()=>{e.settingTab?.activeModal?.close(),setTimeout(()=>e.settingTab?.openSettingsModal(`super`),100)};if(a?.sub){let e=a.ai_quota?Math.floor(a.ai_quota.remainingQuota/5e5):0,t=a.ai_quota?Math.floor(a.ai_quota.quota/5e5):0;return(0,W.jsxs)(`div`,{className:`thino-oauth-card`,children:[(0,W.jsxs)(`div`,{className:`thino-oauth-header`,children:[(0,W.jsx)(`span`,{className:`thino-oauth-username`,children:a.name||a.email||a.sub}),(0,W.jsx)(`button`,{className:`thino-oauth-logout clickable-icon`,onClick:c,children:j(`Logout`)})]}),a.ai_quota&&(0,W.jsxs)(`div`,{className:`thino-oauth-quota`,onClick:l,children:[(0,W.jsxs)(`div`,{className:`thino-oauth-quota-label`,children:[(0,W.jsx)(`span`,{children:j(`Thino Copilot quota`)}),(0,W.jsxs)(`span`,{className:`thino-oauth-quota-value`,children:[e,` / `,t]})]}),(0,W.jsx)(`div`,{className:`thino-oauth-quota-bar`,children:(0,W.jsx)(`div`,{className:`thino-oauth-quota-fill`,style:{width:t>0?`${e/t*100}%`:`0%`}})}),(0,W.jsx)(`span`,{className:`thino-oauth-quota-hint`,children:j(`Click to manage in Super settings`)})]})]})}return(0,W.jsxs)(`div`,{className:`thino-verify-content`,children:[(0,W.jsx)(`div`,{className:`thino-description-link`,children:j(`Login with PKMer account to activate Pro features`)}),(0,W.jsx)(`div`,{className:`thino-button-container`,children:(0,W.jsx)(`button`,{onClick:s,disabled:t,children:r?j(`Waiting for browser login...`):t?`...`:j(`Login with PKMer`)})})]})}function X6(e,t){let n=B.getState(),r=5e5;n.updateProvider(`pkmer`,{type:`pkmer`,enabled:!0,apiKey:e,baseUrl:`https://newapi.pkmer.cn`,completionModel:n.providers.pkmer?.completionModel||`03-agent`,quotaInfo:t?{remaining:Math.floor(t.remainingQuota/r),total:Math.floor(t.quota/r)}:void 0});let i=n.activeCompletionProvider;(!i||i===`local`||!n.providers[i]?.apiKey)&&n.setActiveCompletionProvider(`pkmer`)}function Z6({plugin:e}){let{verifyState:t}=F(),[n,r]=(0,U.useState)(!1),i=m_();return t?(0,W.jsx)(`div`,{className:`thino-verify-component`,children:(0,W.jsxs)(`div`,{className:`thino-verify-content verified`,children:[(0,W.jsxs)(`div`,{className:`thino-verified-badge`,children:[(0,W.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,children:(0,W.jsx)(`path`,{d:`M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm3.78 5.97-4.5 5a.75.75 0 0 1-1.06.02l-2-2a.75.75 0 1 1 1.06-1.06l1.46 1.46 3.97-4.42a.75.75 0 1 1 1.12 1Z`,fill:`currentColor`})}),(0,W.jsx)(`span`,{children:j(`Pro activated`)})]}),i&&(0,W.jsx)(Y6,{plugin:e}),(0,W.jsx)(`div`,{className:`thino-description-link`,children:(0,W.jsxs)(`span`,{className:`thino-url`,onClick:()=>{i?window.open(`https://pkmer.cn`,`_blank`):window.open(`https://thino.pkmer.net/en/`,`_blank`)},children:[j(`Contact support`),` →`]})})]})}):(0,W.jsxs)(`div`,{className:`thino-verify-component`,children:[i?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Y6,{plugin:e}),(0,W.jsxs)(`details`,{className:`thino-legacy-verify`,children:[(0,W.jsx)(`summary`,{children:j(`Legacy activation (deprecated)`)}),(0,W.jsx)(J6,{plugin:e})]})]}):(0,W.jsx)(J6,{plugin:e}),(0,W.jsxs)(`div`,{className:`thino-description-link`,children:[j(`If you have any questions, please contact us.`),(0,W.jsx)(`span`,{className:`thino-url`,onClick:()=>{i?window.open(`https://pkmer.cn`,`_blank`):window.open(`https://thino.pkmer.net/en/`,`_blank`)},children:`@ PKMer`})]})]})}var Q6=class extends f.PluginSettingTab{plugin;applyDebounceTimer=0;tabContent=new Map;selectedTab=`Blank`;search;searchSettingInfo=new Map;searchZeroState;navigateEl;settingsEl;passwordMatched=!1;root;activeModal=null;icon=`file`;constructor(e,t){super(e,t),this.plugin=t}updateSettings(e,t){this.plugin.settings={...this.plugin.settings,[e]:t},this.applySettingsUpdate()}debounceApplySettingsUpdate=(0,f.debounce)(async()=>{await this.plugin.saveSettings()},100,!0);debounceDisplay=(0,f.debounce)(async()=>{if(this.activeModal){this.activeModal.openTab(this.activeModal.activeTabId);return}await this.display()},300,!0);applySettingsUpdate(){this.debounceApplySettingsUpdate(),V.updateTagsState()}async hide(){this.root?.unmount(),this.passwordMatched=!1}openSettingsModal(e){let t=new wG(this.app,this.plugin,this,e);this.activeModal=t,t.open()}onModalClose(){this.root?.unmount(),this.activeModal=null,this.passwordMatched=!1}renderTabInModal(e,t){switch(this.searchSettingInfo=new Map,e){case`general`:this.generateGeneralSettings(e,t);break;case`thino`:this.generateMemosSettings(e,t);break;case`interface`:this.generateThemeSettings(e,t);break;case`editor`:this.generateEditorSettings(e,t);break;case`tasks`:this.generateTasksSettings(e,t);break;case`share`:this.generateShareSettings(e,t);break;case`super`:this.generateSuperSettings(e,t);break;case`pro`:this.customProSettings(e,t);break;case`review`:this.generateReviewSettings(e,t);break;case`advanced`:this.generateAdvancedSettings(e,t);break;case`wechat`:this.generateWeChatSettings(e,t);break;case`about`:this.generateAboutSettings(e,t);break}}async display(){await this.plugin.loadSettings(),this.root&&this.root?.unmount(),this.containerEl.empty(),this.containerEl.toggleClass(`memos-settings`,!0),this.containerEl.toggleClass(`thino-settings-entry`,!0),f.Platform.isMobile&&this.containerEl.toggleClass(`memos-mobile`,!0),this.generateEntryPage()}generateEntryPage(){let{containerEl:e}=this,t=e.createDiv({cls:`settings-entry-header`}),n=t.createDiv({cls:`settings-entry-title-container`});(0,f.setIcon)(n.createSpan({cls:`settings-entry-logo`}),`Memos`);let r=n.createDiv({cls:`settings-entry-title-text`});r.createEl(`h2`,{text:`Thino`}),r.createEl(`span`,{cls:`settings-entry-version`,text:`v${this.plugin.manifest.version}`}),t.createDiv({cls:`settings-entry-desc`}).createEl(`p`,{text:j(`Quick capture tool that allows you to create and manage your ideas, tasks, and more.`)}),new f.Setting(e).setName(j(`Open Settings`)).setDesc(j(`Configure all Thino settings in a dedicated window`)).addButton(e=>{e.setButtonText(j(`Open Settings`)).setCta().onClick(()=>{this.openSettingsModal()})});let i=e.createDiv({cls:`settings-entry-links`});i.createEl(`h3`,{text:j(`Quick Links`)});let a=i.createDiv({cls:`settings-entry-links-grid`}),o=[{icon:`book`,text:j(`Documentation`),url:`https://github.com/quorafind/obsidian-thino/`},{icon:`github`,text:`GitHub`,url:`https://github.com/quorafind/obsidian-thino/`},{icon:`heart`,text:j(`Support`),url:m_()?`https://pkmer.cn/products/thino`:`https://thino.pkmer.net/en/#price`}];m_()&&o.push({icon:`clipboard-list`,text:`Thino Web 问卷`,url:`https://memos.pkmer.cn:6002/s/cmkev0bdr0000o201ckgbarid`}),o.forEach(e=>{let t=a.createEl(`a`,{cls:`settings-entry-link`,href:e.url});t.setAttr(`target`,`_blank`),(0,f.setIcon)(t.createSpan({cls:`settings-entry-link-icon`}),e.icon),t.createSpan({text:e.text})});let s=e.createDiv({cls:`settings-entry-features`});s.createEl(`h3`,{text:j(`Features`)});let c=[{icon:`chef-hat`,title:j(`General`),desc:j(`User info and sync`),tabId:`general`},{icon:`Memos`,title:`Thino`,desc:j(`Memo save locations and format`),tabId:`thino`},{icon:`brush`,title:j(`Interface`),desc:j(`Theme and display options`),tabId:`interface`},{icon:`edit`,title:j(`Editor`),desc:j(`Editor behavior settings`),tabId:`editor`},{icon:`diamond`,title:`Pro`,desc:j(`Pro features and activation`),tabId:`pro`},{icon:`sparkles`,title:`Super`,desc:j(`AI-powered features`),tabId:`super`}],l=s.createDiv({cls:`settings-entry-features-grid`});c.forEach(e=>{let t=l.createDiv({cls:`settings-entry-feature`});e.tabId&&(t.addClass(`is-clickable`),t.addEventListener(`click`,()=>{this.openSettingsModal(e.tabId)})),(0,f.setIcon)(t.createDiv({cls:`settings-entry-feature-icon`}),e.icon);let n=t.createDiv({cls:`settings-entry-feature-text`});n.createEl(`strong`,{text:e.title}),n.createEl(`span`,{text:e.desc})})}generateSettingsTitle(){new f.Setting(this.containerEl).setName(`Thino`).setDesc(j(`Quick capture tool that allows you to create and manage your ideas, tasks, and more.`)).setHeading().addButton(e=>{e.buttonEl.addClass(`setting-home-nav-button`),e.setIcon(`home`),e.setTooltip(`Back to home`),e.onClick(()=>{this.triggerTabChange(null,`Blank`)})}).addSearch(e=>{this.search=e,e.setPlaceholder(j(`Search all settings`)),e.inputEl.oninput=()=>{if(e.inputEl.value===``){this.triggerTabChange(null,`Blank`),this.navigateEl.toggleClass(`memos-setting-searching`,!1),this.containerEl.toggleClass(`setting-searching`,!1);return}for(let t of this.tabContent){let n=t[1];n.navButton.removeClass(`memos-navigation-item-selected`),n.content.show(),n.heading.show();let r=e.getValue();this.selectedTab==``&&r.trim()!=``&&this.searchSettings(r.toLowerCase()),this.selectedTab=``}this.navigateEl.toggleClass(`memos-setting-searching`,!0),this.containerEl.toggleClass(`setting-searching`,!0)},e.onChange(e=>{if(e===``){this.triggerTabChange(null,`Blank`),this.navigateEl.toggleClass(`memos-setting-searching`,!1),this.containerEl.toggleClass(`setting-searching`,!1);return}this.searchSettings(e.toLowerCase())})})}addTabHeader(){this.navigateEl=this.containerEl.createEl(`nav`,{cls:`memos-setting-header`}).createDiv(`memos-setting-tab-group`),this.settingsEl=this.containerEl.createEl(`div`,{cls:`memos-setting-content`,attr:{"data-tab-id":this.selectedTab}}),this.updateOldData(),this.createTabAndContent(`General`,this.navigateEl,this.settingsEl,(e,t)=>this.generateGeneralSettings(t,e)),this.createTabAndContent(`Thino`,this.navigateEl,this.settingsEl,(e,t)=>this.generateMemosSettings(t,e)),this.createTabAndContent(`Interface`,this.navigateEl,this.settingsEl,(e,t)=>this.generateThemeSettings(t,e)),this.createTabAndContent(`Editor`,this.navigateEl,this.settingsEl,(e,t)=>this.generateEditorSettings(t,e)),this.createTabAndContent(`Tasks`,this.navigateEl,this.settingsEl,(e,t)=>this.generateTasksSettings(t,e)),this.createTabAndContent(`Share`,this.navigateEl,this.settingsEl,(e,t)=>this.generateShareSettings(t,e)),this.createTabAndContent(`Super`,this.navigateEl,this.settingsEl,(e,t)=>this.generateSuperSettings(t,e)),this.createTabAndContent(`Pro`,this.navigateEl,this.settingsEl,(e,t)=>this.customProSettings(t,e)),this.createTabAndContent(`Advanced`,this.navigateEl,this.settingsEl,(e,t)=>this.generateAdvancedSettings(t,e)),this.createTabAndContent(`About`,this.navigateEl,this.settingsEl,(e,t)=>this.generateAboutSettings(t,e)),this.createSearchZeroState(this.settingsEl)}searchAndUpdateTabList(){this.checkVerified().then(e=>{e&&this.navEl.toggleClass(`thino-pro-activated`,!0)})}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()}triggerTabChange(e,t){if(t===`Blank`){this.selectedTab=t;for(let e of this.tabContent){let t=e[1];t.content.hide(),t.heading.hide()}this.settingsEl?.setAttribute(`data-tab-id`,`Blank`),this.navigateEl.querySelector(`.memos-navigation-item-selected`)?.toggleClass(`memos-navigation-item-selected`,!1),this.searchZeroState.hide();return}if(this.selectedTab==t)return;this.settingsEl?.setAttribute(`data-tab-id`,t);let n=this.navigateEl.querySelector(`.memos-navigation-item-selected`);if(n&&n.toggleClass(`memos-navigation-item-selected`,!1),e.toggleClass(`memos-navigation-item-selected`,!0),(this.tabContent.get(t)?.content).show(),this.selectedTab!=``&&this.selectedTab!==`Blank`)(this.tabContent.get(n?.getAttribute(`data-tab-id`))?.content).hide();else{this.searchZeroState.hide();for(let e of this.searchSettingInfo)for(let t of e[1])t.containerEl.show();for(let e of this.tabContent){let n=e[1];n.heading.hide(),t!==e[0]&&n.content.hide()}}this.selectedTab=t}async createTabAndContent(e,t,n,r){let i=this.selectedTab===e,a=t.createEl(`div`,{cls:`memos-navigation-item`,attr:{"data-tab-id":e}}),o=await this.checkVerified();(0,f.setIcon)(a.createEl(`div`,{cls:`memos-navigation-item-icon`}),G6[e]),a.createSpan({text:j(e)},t=>{e===`About`&&t.createEl(`span`,{cls:[`thino-pro-text`,o?`thino-pro-activated`:``],text:o?` & ${j(`Activated Pro`)} 💎`:` & ${j(`Activate Pro`)}`})}),a.onclick=()=>{this.triggerTabChange(a,e)};let s=n.createDiv(`memos-tab-settings`),c=s.createEl(`h2`,{cls:`memos-setting-heading`,text:e+` Settings`});c.hide(),s.id=e.toLowerCase().replace(` `,`-`),i?a.addClass(`memos-navigation-item-selected`):s.hide(),r&&r(s,e),this.tabContent.set(e,{content:s,heading:c,navButton:a})}searchSettings(e){let t=new Set,n=(e,n)=>{e.show(),t.has(n)||t.add(n)};for(let t of this.searchSettingInfo){let r=t[0],i=t[1];for(let t of i)if(e.trim()===``||t.alias?.includes(e)||t.description.includes(e)||t.name.includes(e))n(t.containerEl,r);else if(t.options&&t.options.length>0)for(let i of t.options){if(i.description.toLowerCase().includes(e)||i.name.toLowerCase().includes(e)){n(t.containerEl,r);break}else if(i.options){for(let a of i.options)if(a.description.toLowerCase().includes(e)||a.value.toLowerCase().includes(e)){n(t.containerEl,r);break}}t.containerEl.hide()}else t.containerEl.hide()}for(let e of this.tabContent)t.has(e[0])?e[1].heading.show():e[1].heading.hide();t.size===0?this.searchZeroState.show():this.searchZeroState.hide()}addSettingToMasterSettingsList(e,t,n=``,r=``,i=[],a=``){let o={containerEl:t,name:n.toLowerCase(),description:r.toLowerCase(),options:i,alias:a};this.searchSettingInfo.has(e)?this.searchSettingInfo.get(e)?.push(o):this.searchSettingInfo.set(e,[o])}createSearchZeroState(e){this.searchZeroState=e.createDiv(),this.searchZeroState.hide(),this.searchZeroState.createEl(f.Platform.isMobile?`h3`:`h2`,{text:`No settings match search`}).style.textAlign=`center`}async checkVerified(){let e=L.getState().verifyState,t=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),n=t?t.identifier||t.uuid:await Pv();return e&&e?.appId===n}generateProSettings(e,t){new G(t,this).setClass(`thino-pro-setting`).setHeading().setName(`🏆 `+j(`Pro verification status`)).setTab(e);let n=document.createDocumentFragment(),r=n.createEl(`div`,{cls:`thino-activation`}),i=new G(t,this).setName(j(`Activate Pro Version`)).setClass(`thino-pro-setting`).setDesc(n).setTab(e);if(i.settingEl.toggleClass(`thino-activation-setting`,!0),i.nameEl.toggleClass(`thino-activation-title`,!0),this.root=u_.createRoot(r),this.root.render((0,W.jsx)(Z6,{plugin:this.plugin})),!this.plugin.settings.general?.userInfo?.sub){let n=!1;new G(t,this).setName(j(`Deactivate`)).setClass(`thino-pro-setting`).setTab(e).addButton(e=>{e.setWarning().setButtonText(j(`Remove`)).onClick(async()=>{if(!n){e.setButtonText(j(`Confirm?`)),n=!0;return}n=!1;let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins?.Device?.getId(),r=f.Platform.isDesktop?await Pv():t.identifier||t.uuid;if(this.plugin.settings.tokenForVerify[r]){let{[r]:e,...t}=this.plugin.settings.tokenForVerify;this.plugin.settings.tokenForVerify=t,await this.plugin.saveSettings(),new f.Notice(j(`Remove successfully`))}await this.plugin.verify(),R.setRefresh(!0),setTimeout(()=>{this.display()},20)})})}}generateGeneralSettings(e,t){new OG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async generateThemeSettings(e,t){let n=await this.checkVerified();await new AG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:n}).display()}async generateEditorSettings(e,t){new jG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async generateTasksSettings(e,t){new MG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async generateMemosSettings(e,t){let n=L.getState().verifyState,r=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),i=r?r.identifier||r.uuid:await Pv(),a=n&&n?.appId===i;await new kG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:a}).display()}async generateShareSettings(e,t){let n=L.getState().verifyState,r=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),i=r?r.identifier||r.uuid:await Pv(),a=n&&n?.appId===i;new NG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:a}).display()}async generateSuperSettings(e,t){let n=await this.checkVerified();await new IG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:n}).display()}generateReviewSettings(e,t){new FG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async generateAdvancedSettings(e,t){this.addAutoOpenMemosSettings(e,t),this.setPasswordSettings(e,t),this.addDoubleClickBehaviorSettings(e,t),this.addDraggingBehaviorSettings(e,t),this.saveDataSettings(e,t),this.fetchDataSettings(e,t),this.navigationSettings(e,t),this.optimizeForCalloutSettings(e,t),this.addSecretMaskingSettings(e,t),this.clearConfigSettings(e,t)}addSecretMaskingSettings(e,t){if(!(0,f.requireApiVersion)(`1.11.4`)){new G(t,this).setName(j(`Secret Content Masking`)).setDesc(j(`Requires Obsidian API 1.11.4+`)).setTab(e);return}(0,f.requireApiVersion)(`1.11.4`)&&new G(t,this).setName(j(`Enable secret masking`)).setDesc(j(`Mask memo content matching a regex pattern`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.enableSecretMasking).onChange(async e=>{this.plugin.settings.enableSecretMasking=e,this.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.enableSecretMasking&&(new G(t,this).setName(j(`Secret content regex`)).setDesc(j(`Regex pattern to match content that should be masked`)).setTab(e).addText(e=>{e.setPlaceholder(`#secret`).setValue(this.plugin.settings.secretContentRegex),e.inputEl.addEventListener(`blur`,()=>{this.plugin.settings.secretContentRegex=e.inputEl.value,this.applySettingsUpdate()})}),new G(t,this).setName(j(`Masking style`)).setDesc(j(`Choose between blur effect or block character replacement`)).setTab(e).addDropdown(async e=>{e.addOption(`blur`,`Blur`),e.addOption(`block`,`Block characters`),e.setValue(this.plugin.settings.secretMaskingStyle).onChange(async e=>{this.plugin.settings.secretMaskingStyle=e,this.applySettingsUpdate()})}),new G(t,this).setName(j(`Set secret password`)).setDesc(j(`Set or update the password used to reveal masked content`)).setTab(e).addButton(e=>{e.setButtonText(j(`Set secret password`)).onClick(()=>{new e8(this.app).open()})}))}async generateWeChatSettings(e,t){let n=await this.checkVerified();await new H6({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:n}).display()}async generateAboutSettings(e,t){new PG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async customProSettings(e,t){this.generateProSettings(e,t);let n=await this.checkVerified();new zG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:n}).display()}addDoubleClickBehaviorSettings(e,t){new G(t,this).setName(j(`Double click behavior`)).setDesc(j(`Set the behavior when double click on a thino.`)).setTab(e).addDropdown(async e=>{e.addOption(`open-thino`,j(`Open thino`)),e.addOption(`edit-thino`,j(`Edit thino`)),e.addOption(`go-to-source`,j(`Go to source`)),e.addOption(`do-nothing`,j(`Do nothing`)),e.setValue(this.plugin.settings.doubleClickBehavior).onChange(async e=>{this.plugin.settings.doubleClickBehavior=e,this.applySettingsUpdate()})})}addDraggingBehaviorSettings(e,t){new G(t,this).setName(j(`Dragging behavior`)).setDesc(j(`Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.`)).setTab(e).addDropdown(async e=>{e.addOption(`block-link`,j(`Block link`)),e.addOption(`text`,j(`Text`)),e.setValue(this.plugin.settings.DraggingBehavior).onChange(async e=>{this.plugin.settings.DraggingBehavior=e,this.applySettingsUpdate()})})}addUseMobileViewDefaultHeaderSettings(e,t){new G(t,this).setName(j(`Use default header in mobile view`)).setDesc(j(`Use default header in mobile view of thino rather than custom header.`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.useMobileViewDefaultHeader).onChange(async e=>{this.plugin.settings.useMobileViewDefaultHeader=e,this.applySettingsUpdate()})})}async customNameAndTheme(e,t,n){new G(t,this).setName(j(`Theme for Thino`)).setDesc(j(`Set the theme for Thino`)).setTab(e).addDropdown(async e=>{e.addOption(`modern`,`Modern`),e.addOption(`classic`,`Classic`),e.addOption(`focus`,`Focus`),e.setValue(this.plugin.settings.DefaultThemeForThino).onChange(async e=>{this.plugin.settings.DefaultThemeForThino=e,this.applySettingsUpdate()})}),new G(t,this).setTab(e).setHeading().setName(`🎨 `+j(`Interface Details`));let r;new G(t,this).setName(j(`Heatmap Color Scheme`)).setDesc(j(`Set different color scheme for heatmap.`)).setTab(e).addDropdown(async e=>{r=e,r.addOption(`default`,j(`Default`)),r.addOption(`gray`,j(`Gray`)),r.addOption(`grass`,j(`Grass`)),r.addOption(`flame`,j(`Flame`)),r.addOption(`olive`,j(`Olive`)),r.addOption(`ice`,j(`Ice`)),r.addOption(`magenta`,j(`Magenta`)),r.setValue(this.plugin.settings.HeatmapColorScheme).onChange(async e=>{this.plugin.settings.HeatmapColorScheme=e,this.applySettingsUpdate()})}),new G(t,this).setName(j(`Save Memo button label`)).setDesc(j(`The text shown on the save Memo button in the UI. 'NOTEIT' by default.`)).setTab(e).addText(e=>e.setPlaceholder(q6.SaveMemoButtonLabel).setValue(this.plugin.settings.SaveMemoButtonLabel).onChange(async e=>{this.plugin.settings.SaveMemoButtonLabel=e,this.applySettingsUpdate()})),!f.Platform.isMobile&&new G(t,this).setName(j(`Always Show Leaf Sidebar on PC`)).setDesc(j(`Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.ShowLeftSideBar).onChange(async e=>{this.plugin.settings.ShowLeftSideBar=e,this.applySettingsUpdate()})),this.addUseMobileViewDefaultHeaderSettings(e,t),this.addRememberImageSettings(e,t),this.addScrollToTopSettings(e,t),new G(t,this).setName(j(`Max height for collapse`)).setDesc(j(`The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)`)).setTab(e).addText(e=>e.setPlaceholder(q6.ThinoMaxHeight.toString()).setValue(this.plugin.settings.ThinoMaxHeight.toString()).onChange(async e=>{if(Number(e)<80&&Number(e)!==0){new f.Notice(j(`The value should be greater than`)+`80`);return}this.plugin.settings.ThinoMaxHeight=Number(e),this.debounceApplySettingsUpdate()})),new G(t,this).setName(j(`Thino height when collapsed`)).setDesc(j(`The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)`)).setTab(e).addText(e=>e.setPlaceholder(q6.ThinoCollapsedHeight.toString()).setValue(this.plugin.settings.ThinoCollapsedHeight.toString()).onChange(async e=>{if(Number(e)<40&&Number(e)!==0){new f.Notice(j(`The value should be greater than`)+`40`);return}this.plugin.settings.ThinoCollapsedHeight=Number(e),this.debounceApplySettingsUpdate()})),await this.getEditorLocation(t,e)}customEditorSettings(e,t){new G(t,this).setHeading().setTab(e).setName(`📝 `+j(`Editor`)),new G(t,this).setName(j(`Use Tags In Vault`)).setDesc(j(`Use tags in vault rather than only in Memos. False by default.`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.UseVaultTags).onChange(async e=>{this.plugin.settings.UseVaultTags=e,this.applySettingsUpdate()}));let n;new G(t,this).setName(j(`Default insert date format`)).setDesc(j(`Set the default date format when insert date by @, 'Tasks' by default.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`Tasks`,`Tasks`),n.addOption(`Dataview`,`Dataview`),n.setValue(this.plugin.settings.InsertDateFormat).onChange(async e=>{this.plugin.settings.InsertDateFormat=e,this.applySettingsUpdate()})}),new G(t,this).setName(j(`Focus on editor when open`)).setDesc(j(`Focus on editor when open. True by default.`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.FocusOnEditor).onChange(async e=>{this.plugin.settings.FocusOnEditor=e,this.applySettingsUpdate()})}),new G(t,this).setName(j(`Default Editor Mode`)).setDesc(j(`Live-Preview Mode OR Source Mode.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`obsidian`,j(`Live-preview`)),n.addOption(`memos`,j(`Source`)),n.setValue(this.plugin.settings.EditorType).onChange(async e=>{this.plugin.settings.EditorType=e,this.applySettingsUpdate()})})}customTasksSettings(e,t){this.addTaskRelatedSettings(e,t)}async getEditorLocation(e,t){let n;f.Platform.isMobile&&(new G(e,this).setName(j(`Default editor position on mobile`)).setDesc(j(`Set the default editor position on Mobile, 'Top' by default.`)).setTab(t).addDropdown(async e=>{n=e,n.addOption(`Top`,j(`Top`)),n.addOption(`Bottom`,j(`Bottom`)),n.setValue(this.plugin.settings.DefaultEditorLocation).onChange(async e=>{this.plugin.settings.DefaultEditorLocation=e,this.applySettingsUpdate(),setTimeout(()=>{this.display()},200)})}),this.plugin.settings.DefaultEditorLocation!==`Top`&&new G(e,this).setName(j(`Use button to show editor on mobile`)).setDesc(j(`Set a float button to call editor on mobile. Only when editor located at the bottom works.`)).setTab(t).addToggle(e=>e.setValue(this.plugin.settings.UseButtonToShowEditor).onChange(async e=>{this.plugin.settings.UseButtonToShowEditor=e,this.applySettingsUpdate()})))}customHeading(e,t){new G(t,this).setHeading().setName(`👤 `+j(`User info`)).setTab(e),new G(t,this).setName(j(`User name`)).setDesc(j(`Set your user name here. 'Memos 😏' By default`)).setTab(e).addText(e=>e.setPlaceholder(q6.UserName).setValue(this.plugin.settings.UserName).onChange(async e=>{this.plugin.settings.UserName=e,this.applySettingsUpdate()})),new G(t,this).setTab(e).setName(j(`User icon`)).setDesc(j(`Set user icon for thino. You can input http/https link or file path in vault.`)).addText(e=>{new vE(e.inputEl),e.setPlaceholder(`URL`).setValue(this.plugin.settings.MomentsIcon).onChange(async e=>{this.plugin.settings.MomentsIcon=e,this.applySettingsUpdate()})}),new G(t,this).setTab(e).setName(j(`User quote`)).setDesc(j(`Set user quote for thino`)).addText(e=>e.setPlaceholder(`Input anything here`).setValue(this.plugin.settings.MomentsQuote).onChange(async e=>{this.plugin.settings.MomentsQuote=e,this.applySettingsUpdate()}));let n=!1,r=document.createDocumentFragment();r.createEl(`span`,{text:j(`Connect to PKMer Sync, you can check it in `)});let i=m_()?`https://pkmer.cn/products/UserProfile/#tab-21&activateSync`:`https://thino.pkmer.net/en/`;r.createEl(`a`,{text:j(`PKMer Sync`),attr:{href:i}}),m_()&&new G(t,this).setHeading().setName(`☁ `+j(`Sync service`)).setTab(e),m_()&&new G(t,this).setName(j(`Sync Thino via PKMer`)).setDesc(r).setTab(e).addButton(e=>{let t=this.plugin.app?.loadLocalStorage(`tokenForSync`);e.setButtonText(j(t?`Unlink`:`Link`)).onClick(async()=>{if(!t){m_()?window.open(`https://pkmer.cn/products/UserProfile/#tab-21&activateSync`,`_blank`):window.open(`https://thino.pkmer.net/en/`,`_blank`);return}if(!n){e.setButtonText(j(`Confirm?`)),n=!0;return}n=!1,t&&(this.plugin.app?.saveLocalStorage(`tokenForSync`,``),new f.Notice(j(`Remove successfully`))),R.setRefresh(!0),setTimeout(()=>{this.display()},20)})}),m_()&&this.showSyncStatus(t,e)}showSyncStatus(e,t){this.plugin.app?.loadLocalStorage(`tokenForSync`)&&(new G(e,this).setName(j(`Save thino type when sync local`)).setDesc(j(`Set the default save thino type when sync local, FILE by default.`)).setTab(t).addDropdown(async e=>{e.addOption(`DAILY`,j(`DAILY`)),e.addOption(`FILE`,j(`FILE`)),e.addOption(`JOURNAL`,j(`JOURNAL`)),e.setValue(this.plugin.settings.saveThinoType).onChange(async e=>{this.plugin.settings.saveThinoType=e,this.applySettingsUpdate()})}),new G(e,this).setName(j(`Sync Status`)).setDesc(j(`Start or stop sync`)).setTab(t).addButton(e=>{e.setButtonText(this.plugin.settings.startSync?j(`Stop`):j(`Start`)).onClick(async()=>{this.plugin.settings.startSync=!this.plugin.settings.startSync,await this.plugin.saveSettings(),R.setRefresh(!0),new f.Notice(this.plugin.settings.startSync?j(`Start sync successfully`):j(`Stop sync successfully`)),setTimeout(()=>{this.display()},200)})}),new G(e,this).setName(j(`Sync manually`)).setTab(t).addToggle(e=>{e.setValue(this.plugin.settings.SyncManually).onChange(async e=>{this.plugin.settings.SyncManually=e,this.applySettingsUpdate()})}))}addMemoSettings(e,t){let n;new G(t,this).setHeading().setTab(e).setName(`📅 `+j(`Daily notes`)),new G(t,this).setName(j(`Default prefix when save thino`)).setDesc(j(`Set the default prefix when create memo, 'List' by default.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`List`,j(`List`)),n.addOption(`Task`,j(`Task`)),n.setValue(this.plugin.settings.DefaultPrefix).onChange(async e=>{this.plugin.settings.DefaultPrefix=e,this.applySettingsUpdate()})}),this.plugin.settings.EnabledLocationList.some(e=>e.value===`DAILY`)&&new G(t,this).setName(j(`Default time prefix for thino in daily notes`)).setDesc(j(`Set default time prefix for thino in daily notes.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`HH:mm`,`HH:mm`),n.addOption(`HH:mm:ss`,`HH:mm:ss`),n.setValue(this.plugin.settings.DefaultTimePrefix).onChange(async e=>{this.plugin.settings.DefaultTimePrefix=e,this.applySettingsUpdate()})}),new G(t,this).setHeading().setTab(e).setName(`🔗 `+j(`Fixed strings for thinos`)),new G(t,this).setName(j(`Use fixed strings for thinos`)).setDesc(j(`Enable to add fixed strings at the beginning or end of thinos.`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.UseMemoFixedStrings).onChange(async e=>{this.plugin.settings.UseMemoFixedStrings=e,this.applySettingsUpdate(),setTimeout(()=>{this.display()},200)})),this.plugin.settings.UseMemoFixedStrings&&(new G(t,this).setName(j(`Fixed prefix for thinos`)).setDesc(j(`Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`)).setTab(e).addText(e=>e.setValue(this.plugin.settings.MemoFixedPrefix).onChange(async e=>{this.plugin.settings.MemoFixedPrefix=e,this.applySettingsUpdate()})),new G(t,this).setName(j(`Fixed suffix for thinos`)).setDesc(j(`Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`)).setTab(e).addText(e=>e.setValue(this.plugin.settings.MemoFixedSuffix).onChange(async e=>{this.plugin.settings.MemoFixedSuffix=e,this.applySettingsUpdate()})))}customMemoFooter(e,t){new G(t,this).setName(j(`Custom Memo Footer`)).setDesc(j(`Set custom memo footer.`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.SetCustomMemoFooter).onChange(async e=>{this.plugin.settings.SetCustomMemoFooter=e,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomMemoFooter&&new G(t,this).setName(j(`Share Memos Image Footer Start`)).setDesc(j(`Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default`)).setTab(e).addText(e=>e.setPlaceholder(q6.ShareFooterStart).setValue(this.plugin.settings.ShareFooterStart).onChange(async e=>{this.plugin.settings.ShareFooterStart=e,this.applySettingsUpdate()}))}saveDataSettings(e,t){new G(t,this).setName(j(`Delete Thino Directly`)).setDesc(j(`When delete thino directly, it will not be moved to trash. False by default.`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.DeleteThinoDirectly).onChange(async e=>{this.plugin.settings.DeleteThinoDirectly=e,this.applySettingsUpdate()})})}fetchDataSettings(e,t){let n;new G(t,this).setName(j(`Use which plugin's default configuration`)).setDesc(j(`Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`Daily`,j(`Daily`)),n.addOption(`Periodic`,`Periodic`).setDisabled(!this.app.plugins.getPlugin(`periodic-notes`)),n.setValue(this.plugin.settings.UseDailyOrPeriodic).onChange(async e=>{this.plugin.settings.UseDailyOrPeriodic=e,this.applySettingsUpdate()})}).addExtraButton(e=>{e.setIcon(`settings`).onClick(()=>{if(this.plugin.settings.UseDailyOrPeriodic===`Daily`){if(!this.app.internalPlugins.plugins[`daily-notes`]||!this.app.internalPlugins.plugins[`daily-notes`].enabled){new f.Notice(`Daily Notes plugin is not installed`);return}this.app.setting.open(),this.app.setting.openTabById(`daily-notes`)}else{if(!this.app.plugins.getPlugin(`periodic-notes`)||!this.app.plugins.getPlugin(`periodic-notes`)._loaded){new f.Notice(`Periodic Notes plugin is not installed`);return}this.app.setting.open(),this.app.setting.openTabById(`periodic-notes`)}})})}navigationSettings(e,t){new G(t,this).setName(j(`Open link directly in Thino view`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.navigation).onChange(async e=>{this.plugin.settings.navigation=e,this.applySettingsUpdate()}))}optimizeForCalloutSettings(e,t){new G(t,this).setName(j(`Optimize for Callout`)).setDesc(j(`Won't render content contains more than 3 callouts automatically. True by default`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.OptimizeForCallout).onChange(async e=>{this.plugin.settings.OptimizeForCallout=e,this.applySettingsUpdate()}))}addUpdateMessageSettings(e,t){new G(t,this).setName(j(`Show release notes`)).setDesc(j(`Show release notes when Thino is updated. True by default`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.ShowUpdateMessage).onChange(async e=>{this.plugin.settings.ShowUpdateMessage=e,this.applySettingsUpdate()}))}clearConfigSettings(e,t){new G(t,this).setName(j(`Reset all Thino settings`)).setDesc(j(`Reset Thino settings to default settings.`)).setTab(e).addButton(e=>{e.setWarning().setButtonText(j(`Reset settings`)).onClick(async()=>{new lC(this.app,j(`Reset all Thino settings`),async()=>{this.plugin.settings={...q6,tokenForVerify:this.plugin.settings.tokenForVerify,password:this.plugin.settings.password,needVerify:this.plugin.settings.needVerify},this.debounceApplySettingsUpdate(),await V.fetchAllMemos(),V.updateTagsState(),this.plugin.app?.saveLocalStorage(`tokenForSync`,``),R.setRefresh(!0),R.setMemoListView(`list`),new f.Notice(j(`All settings have been reset to default.`)),this.debounceDisplay()}).open()})})}addAutoOpenMemosSettings(e,t){new G(t,this).setName(j(`Open Memos when obsidian opens`)).setDesc(j(`When enable this, Memos will open when Obsidian opens. False by default.`)).setTab(e).addDropdown(e=>{e.addOption(`Desktop`,`Desktop`),e.addOption(`Mobile`,`Mobile`),e.addOption(`All`,`All`),e.setValue(this.plugin.settings.MobileAndDesktop).onChange(async e=>{this.plugin.settings.MobileAndDesktop=e,this.applySettingsUpdate()})}).addToggle(e=>e.setValue(this.plugin.settings.OpenMemosAutomatically).onChange(async e=>{this.plugin.settings.OpenMemosAutomatically=e,this.applySettingsUpdate()}))}setPasswordSettings(e,t){new G(t,this).setName(j(`Need password to unlock Thino`)).setTab(e).addToggle(e=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(e.toggleEl.onclick=t=>{this.passwordMatched||(t.preventDefault(),new $6(this.app,this,this.plugin,t=>{e.setDisabled(!t),this.passwordMatched=t,this.debounceDisplay()}).open(),new f.Notice(j(`Please input your password to change password settings`)))}),e.setDisabled(this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched).setValue(this.plugin.settings.needVerify).onChange(async e=>{this.plugin.settings.needVerify=e,e&&(this.passwordMatched=!1),this.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.needVerify&&new G(t,this).setName(j(`Password to lock Thino`)).setTab(e).addText(e=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(e.inputEl.onclick=t=>{this.passwordMatched||(t.preventDefault(),new $6(this.app,this,this.plugin,t=>{e.inputEl.readOnly=!t,this.passwordMatched=t,this.debounceDisplay()}).open(),new f.Notice(j(`Please input your password to change password settings`)))}),e.inputEl.readOnly=this.plugin.settings.password&&this.plugin.settings.needVerify&&!this.passwordMatched,e.inputEl.oncopy=()=>!1,e.inputEl.type=`password`,e.setValue(this.plugin.settings.password).onChange(async e=>{this.plugin.settings.password=e,this.applySettingsUpdate()})})}checkInList(e){return this.plugin.settings.EnabledLocationList.find(t=>t.value===e)!==void 0}customFileNameSettings(e,t,n){let r=document.createDocumentFragment(),i=r.createEl(`div`,{cls:`memo-save-location-desc`});for(let e of K6){let t=i.createEl(`div`,{cls:`memo-save-location-desc-item ${e.value}`});(0,f.setIcon)(t.createEl(`span`,{cls:`memo-save-location-desc-item-icon`}),Qr.find(t=>t.title===e.value)?.icon||``);let r=e.value===`DAILY`?`${j(e.value)} (Deprecated)`:`${j(e.value)}`;t.createEl(`span`,{cls:`memo-save-location-desc-item-desc`,text:r});let a=t.createEl(`span`,{cls:`memo-save-location-desc-item-toggle`}),o=t.createEl(`span`,{cls:`memo-save-location-desc-item-setting`}),s=e.value===`DAILY`||e.value===`JOURNAL`;s||t.createEl(`span`,{cls:[`memo-save-location-desc-item-pro`,`user-pro-badge`],text:`PRO`}),new f.ToggleComponent(a).setValue(this.checkInList(e.value)).onChange(async t=>{if(!n&&!s){kv();return}t?(await V.updateTypeMemos(e.value),this.plugin.settings.EnabledLocationList=[...this.plugin.settings.EnabledLocationList,e]):(await V.removeTypeMemos(e.value),this.plugin.settings.EnabledLocationList=this.plugin.settings.EnabledLocationList.filter(t=>t.value!==e.value)),this.plugin.settings.EnabledLocationList.length===1&&(this.plugin.settings.MemoSaveLocation=e.value),this.applySettingsUpdate(),setTimeout(()=>{this.display()},500)}).setDisabled(this.plugin.settings.EnabledLocationList.length===1&&this.checkInList(e.value)),new f.ExtraButtonComponent(o).setIcon(`settings`).onClick(()=>{new CG(this.app,this,this.plugin,e,n).open()})}let a=new G(t,this).setName(j(`Save type for Thino`)).setDesc(r).setTab(e);a.settingEl.toggleClass(`memo-save-location-setting`,!0),a.nameEl.toggleClass(`memo-save-location-title`,!0)}addScrollToTopSettings(e,t){new G(t,this).setName(j(`Show scroll to top button`)).setDesc(j(`Show scroll to top button. True by default`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.ShowScrollToTopButton).onChange(async e=>{this.plugin.settings.ShowScrollToTopButton=e,this.applySettingsUpdate()})})}addRememberImageSettings(e,t){new G(t,this).setName(j(`Zoom image by default`)).setDesc(j(`Zoom image by default when viewing image.`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.ZoomImageWhenViewing).onChange(async e=>{this.plugin.settings.ZoomImageWhenViewing=e,this.applySettingsUpdate()})})}addViewArchiveInRandomReviewSettings(e,t){new G(t,this).setName(j(`View archive in random review`)).setDesc(j(`View archived thinos in random review. True by default`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.ViewArchiveInRandomReview).onChange(async e=>{this.plugin.settings.ViewArchiveInRandomReview=e,this.applySettingsUpdate()})})}addTaskRelatedSettings(e,t){new G(t,this).setHeading().setName(`📃 `+j(`Task Management`)).setTab(e),new G(t,this).setName(j(`Show Tasks Label`)).setDesc(j(`Show tasks label near the time text. False by default`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.ShowTaskLabel).onChange(async e=>{this.plugin.settings.ShowTaskLabel=e,this.applySettingsUpdate()})),new G(t,this).setName(j(`Append completed date when task done in thino`)).setDesc(j(`Append completed date when task done in thino. False by default`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.AppendDateWhenTaskDone).onChange(async e=>{this.plugin.settings.AppendDateWhenTaskDone=e,this.applySettingsUpdate()}))}},$6=class extends f.Modal{plugin;settingTab;constructor(e,t,n,r){super(e),this.cb=r,this.app=e,this.settingTab=t,this.plugin=n}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`memo-save-location-modal`),this.titleEl.toggleClass(`modal-title`,!0),this.titleEl.setText(j(`Password for Thino`)),e.createDiv(`modal-desc`,e=>{e.setText(j(`Please input your password to change password settings`))});let t=new G(e.createDiv(`modal-setting`),this.settingTab).setName(j(`Password`)).addText(e=>{e.setPlaceholder(j(`Please input your password`)).inputEl.type=`password`}),n=e.createDiv(`button-group`),r=n.createEl(`button`,{text:j(`Cancel`)}),i=n.createEl(`button`,{cls:`thino-password-confirm-btn`,text:j(`Confirm?`).replace(/(\?|?)/g,``)});i.onclick=async()=>{t.controlEl.querySelector(`input`).value===this.plugin.settings.password?(this.cb?.(!0),this.close()):new f.Notice(j(`Password is incorrect`))},r.onclick=async()=>{this.close()}}onClose(){let{contentEl:e}=this;e.empty()}},e8=class extends f.Modal{constructor(e){super(e)}onOpen(){let{contentEl:e}=this;this.titleEl.setText(j(`Set secret password`));let t=e.createEl(`input`,{type:`password`,placeholder:j(`Enter password`),cls:`thino-secret-password-input`});t.style.width=`100%`,t.style.marginBottom=`12px`;let n=e.createEl(`input`,{type:`password`,placeholder:j(`Confirm password`),cls:`thino-secret-password-input`});n.style.width=`100%`,n.style.marginBottom=`12px`;let r=e.createDiv(`button-group`),i=r.createEl(`button`,{text:j(`Cancel`)}),a=r.createEl(`button`,{text:j(`Confirm`),cls:`mod-cta`});i.onclick=()=>this.close(),a.onclick=()=>{let e=t.value,r=n.value;if(e){if(e!==r){new f.Notice(j(`Passwords do not match`));return}this.app.secretStorage.setSecret(`thino-secret-masking-password`,e),new f.Notice(j(`Password set successfully`)),this.close()}}}onClose(){this.contentEl.empty()}};function t8(e){return e.split(`-`)[0]}function n8(e){return e.split(`-`)[1]}function r8(e){return[`top`,`bottom`].includes(t8(e))?`x`:`y`}function i8(e){return e===`y`?`height`:`width`}function a8(e){let{reference:t,floating:n,placement:r}=e,i=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,o;switch(t8(r)){case`top`:o={x:i,y:t.y-n.height};break;case`bottom`:o={x:i,y:t.y+t.height};break;case`right`:o={x:t.x+t.width,y:a};break;case`left`:o={x:t.x-n.width,y:a};break;default:o={x:t.x,y:t.y}}let s=r8(r),c=i8(s);switch(n8(r)){case`start`:o[s]=o[s]-(t[c]/2-n[c]/2);break;case`end`:o[s]=o[s]+(t[c]/2-n[c]/2);break}return o}var o8=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:l}=a8({...s,placement:r}),u=r,d={};for(let n=0;n<a.length;n++){let{name:f,fn:p}=a[n],{x:m,y:h,data:g,reset:_}=await p({x:c,y:l,initialPlacement:r,placement:u,strategy:i,middlewareData:d,rects:s,platform:o,elements:{reference:e,floating:t}});if(c=m??c,l=h??l,d={...d,[f]:g??{}},_){typeof _==`object`&&(_.placement&&(u=_.placement),_.rects&&(s=_.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):_.rects),{x:c,y:l}=a8({...s,placement:u})),n=-1;continue}}return{x:c,y:l,placement:u,strategy:i,middlewareData:d}};function s8(e){return{top:0,right:0,bottom:0,left:0,...e}}function c8(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:s8(e)}function l8(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function u8(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingParents`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=t,p=c8(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=await i.getClippingClientRect({element:await i.isElement(m)?m:m.contextElement||await i.getDocumentElement({element:o.floating}),boundary:c,rootBoundary:l}),g=l8(await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:u===`floating`?{...a.floating,x:n,y:r}:a.reference,offsetParent:await i.getOffsetParent({element:o.floating}),strategy:s}));return{top:h.top-g.top+p.top,bottom:g.bottom-h.bottom+p.bottom,left:h.left-g.left+p.left,right:g.right-h.right+p.right}}var d8={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function f8(e){return e.replace(/left|right|bottom|top/g,e=>d8[e])}function p8(e,t){let n=n8(e)===`start`,r=r8(e),i=i8(r),a=r===`x`?n?`right`:`left`:n?`bottom`:`top`;return t.reference[i]>t.floating[i]&&(a=f8(a)),{main:a,cross:f8(a)}}var m8={start:`end`,end:`start`};function h8(e){return e.replace(/start|end/g,e=>m8[e])}function g8(e){let t=f8(e);return[h8(e),t,h8(t)]}var _8=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o}=t;if((n=i.flip)!=null&&n.skip)return{};let{mainAxis:s=!0,crossAxis:c=!0,fallbackPlacements:l,fallbackStrategy:u=`bestFit`,flipAlignment:d=!0,...f}=e,p=t8(r),m=[o,...l||(p===o||!d?[f8(o)]:g8(o))],h=await u8(t,f),g=[],_=i.flip?.overflows||[];if(s&&g.push(h[p]),c){let{main:e,cross:t}=p8(r,a);g.push(h[e],h[t])}if(_=[..._,{placement:r,overflows:g}],!g.every(e=>e<=0)){let e=(i.flip?.index??0)+1,t=m[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=`bottom`;switch(u){case`bestFit`:{let e=_.slice().sort((e,t)=>e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)-t.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0))[0]?.placement;e&&(n=e);break}case`initialPlacement`:n=o;break}return{data:{skip:!0},reset:{placement:n}}}return{}}}};function v8(e){let{placement:t,rects:n,value:r}=e,i=t8(t),a=[`left`,`top`].includes(i)?-1:1,o=typeof r==`function`?r({...n,placement:t}):r,{mainAxis:s,crossAxis:c}=typeof o==`number`?{mainAxis:o,crossAxis:0}:{mainAxis:0,crossAxis:0,...o};return r8(i)===`x`?{x:c,y:s*a}:{x:s*a,y:c}}var y8=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,fn(t){let{x:n,y:r,placement:i,rects:a}=t,o=v8({placement:i,rects:a,value:e});return{x:n+o.x,y:r+o.y,data:o}}}};function b8(e){return e?.toString()===`[object Window]`}function x8(e){if(e==null)return window;if(!b8(e)){let t=e.ownerDocument;return t&&t.defaultView||window}return e}function S8(e){return x8(e).getComputedStyle(e)}function C8(e){return b8(e)?``:e?(e.nodeName||``).toLowerCase():``}function w8(e){return e instanceof x8(e).HTMLElement}function T8(e){return e instanceof x8(e).Element}function E8(e){return e instanceof x8(e).Node}function D8(e){return e instanceof x8(e).ShadowRoot||e instanceof ShadowRoot}function O8(e){let{overflow:t,overflowX:n,overflowY:r}=S8(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function k8(e){return[`table`,`td`,`th`].includes(C8(e))}function A8(e){let t=navigator.userAgent.toLowerCase().includes(`firefox`),n=S8(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)}var j8=Math.min,M8=Math.max,N8=Math.round;function P8(e,t){t===void 0&&(t=!1);let n=e.getBoundingClientRect(),r=1,i=1;return t&&w8(e)&&(r=e.offsetWidth>0&&N8(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&N8(n.height)/e.offsetHeight||1),{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function F8(e){return((E8(e)?e.ownerDocument:e.document)||window.document).documentElement}function I8(e){return b8(e)?{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}:{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function L8(e){return P8(F8(e)).left+I8(e).scrollLeft}function R8(e){let t=P8(e);return N8(t.width)!==e.offsetWidth||N8(t.height)!==e.offsetHeight}function z8(e,t,n){let r=w8(t),i=F8(t),a=P8(e,r&&R8(t)),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&n!==`fixed`)if((C8(t)!==`body`||O8(i))&&(o=I8(t)),w8(t)){let e=P8(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=L8(i));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}function B8(e){return C8(e)===`html`?e:e.assignedSlot||e.parentNode||(D8(e)?e.host:null)||F8(e)}function V8(e){return!w8(e)||getComputedStyle(e).position===`fixed`?null:e.offsetParent}function H8(e){let t=B8(e);for(;w8(t)&&![`html`,`body`].includes(C8(t));)if(A8(t))return t;else t=t.parentNode;return null}function U8(e){let t=x8(e),n=V8(e);for(;n&&k8(n)&&getComputedStyle(n).position===`static`;)n=V8(n);return n&&(C8(n)===`html`||C8(n)===`body`&&getComputedStyle(n).position===`static`&&!A8(n))?t:n||H8(e)||t}function W8(e){return{width:e.offsetWidth,height:e.offsetHeight}}function G8(e){let{rect:t,offsetParent:n,strategy:r}=e,i=w8(n),a=F8(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((i||!i&&r!==`fixed`)&&((C8(n)!==`body`||O8(a))&&(o=I8(n)),w8(n))){let e=P8(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-o.scrollLeft+s.x,y:t.y-o.scrollTop+s.y}}function K8(e){let t=x8(e),n=F8(e),r=t.visualViewport,i=n.clientWidth,a=n.clientHeight,o=0,s=0;return r&&(i=r.width,a=r.height,Math.abs(t.innerWidth/r.scale-r.width)<.01&&(o=r.offsetLeft,s=r.offsetTop)),{width:i,height:a,x:o,y:s}}function q8(e){let t=F8(e),n=I8(e),r=e.ownerDocument?.body,i=M8(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=M8(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+L8(e),s=-n.scrollTop;return S8(r||t).direction===`rtl`&&(o+=M8(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function J8(e){return[`html`,`body`,`#document`].includes(C8(e))?e.ownerDocument.body:w8(e)&&O8(e)?e:J8(B8(e))}function Y8(e,t){t===void 0&&(t=[]);let n=J8(e),r=n===e.ownerDocument?.body,i=x8(n),a=r?[i].concat(i.visualViewport||[],O8(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(Y8(B8(a)))}function X8(e,t){let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&D8(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function Z8(e){let t=P8(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 Q8(e,t){return t===`viewport`?l8(K8(e)):T8(t)?Z8(t):l8(q8(F8(e)))}function $8(e){let t=Y8(B8(e)),n=[`absolute`,`fixed`].includes(S8(e).position)&&w8(e)?U8(e):e;return T8(n)?t.filter(e=>T8(e)&&X8(e,n)&&C8(e)!==`body`):[]}function e5(e){let{element:t,boundary:n,rootBoundary:r}=e,i=[...n===`clippingParents`?$8(t):[].concat(n),r],a=i[0],o=i.reduce((e,n)=>{let r=Q8(t,n);return e.top=M8(r.top,e.top),e.right=j8(r.right,e.right),e.bottom=j8(r.bottom,e.bottom),e.left=M8(r.left,e.left),e},Q8(t,a));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var t5={getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:z8(t,U8(n),r),floating:{...W8(n),x:0,y:0}}},convertOffsetParentRelativeRectToViewportRelativeRect:e=>G8(e),getOffsetParent:e=>{let{element:t}=e;return U8(t)},isElement:e=>T8(e),getDocumentElement:e=>{let{element:t}=e;return F8(t)},getClippingClientRect:e=>e5(e),getDimensions:e=>{let{element:t}=e;return W8(t)},getClientRects:e=>{let{element:t}=e;return t.getClientRects()}},n5=(e,t,n)=>o8(e,t,{platform:t5,...n}),r5=u(s(((e,t)=>{t.exports=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,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))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(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}))()),i5=m.Facet.define({combine:e=>({defaultPlacement:e.find(e=>e.defaultPlacement)?.defaultPlacement||`top`,padding:e.find(e=>e.padding)?.padding||8})}),a5=e=>e.split(`-`)[0],o5=e=>e===`x`?`y`:`x`,s5=e=>[`top`,`bottom`].includes(a5(e))?`x`:`y`,c5=(e,t,n)=>Math.max(e,Math.min(t,n)),l5=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n],r)=>[e,t(n,e,r)])),u5=e=>e===void 0?e:typeof e==`number`?-e:l5(e,e=>e===void 0?e:-e),d5=(e={})=>({name:`shift`,fn:async t=>{let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s=({x:e,y:t})=>({x:e,y:t}),editorMenu:c,...l}=e,u={x:n,y:r},d=await u8(t,l),f=s5(a5(i)),p=o5(f),m=u[f],h=u[p];if(a){let e=f===`y`?`top`:`left`,n=f===`y`?`bottom`:`right`,r=m+d[e],i=m-d[n];if(c){let a=await u8(t,{...l,boundary:c.dom,padding:u5(l.padding)});if((p===`y`?[`top`,`bottom`]:[`left`,`right`]).every(e=>a[e]<=0)){let o=t.rects.floating.width,s=m+a[e]-o,c=m-a[n]+o,l=Math.abs(d[e]-a[e]),u=Math.abs(d[n]-a[n]);m=l>=o||u<l?c5(r,m,s):c5(c,m,i)}else m=c5(r,m,i)}else m=c5(r,m,i)}if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=c5(n,h,r)}return s({...t,[f]:m,[p]:h})}}),f5=`thino-mini-toolbar`,p5=(e=0,t=0)=>({width:0,height:0,top:t,left:e,bottom:t,right:e,x:e,y:t}),m5=(e,t)=>{if(!e)return null;let n=Math.min(e.left,t?.left??e.left),r=Math.max(e.right,t?.right??e.right),i=Math.max(e.bottom,t?.bottom??e.bottom)-Math.min(e.top,t?.top??e.top),a=Math.min(e.top,t?.top??e.top),o={left:n,right:r,top:a,bottom:a+i,width:0,height:i,x:a,y:n};return t&&(o.width=Math.abs(r-n)),o},h5=p5(),g5=class{containerEl;virtualEl;toolbar=null;isThinoView;get workspace(){return this.view.state.field(f.editorInfoField).app.workspace}tooltipInfo;inView=!0;defaultPlacement;editorMenu;constructor(e){this.view=e,this.containerEl=this.view.dom.parentElement,this.defaultPlacement=this.view.state.facet(i5).defaultPlacement,this.tooltipInfo=e.state.facet(v5),this.virtualEl={rect:h5,getBoundingClientRect(){return this.rect}},this.maybeMeasure(),this.editorMenu={currMenu:null,evtRef:e.state.field(f.editorInfoField)},console.log(`check thino view`),this.isThinoView=this.checkThinoView()}checkThinoView(){return this.view.state.field(f.editorInfoField)?this.view.state.field(f.editorInfoField)&&this.view.state.field(f.editorInfoField)?.getViewType?.()===`thino_view`:!1}shouldRemoveToolbar(e){return!((e??this.tooltipInfo)?.end||this.editorMenu.currMenu)}onEditorMenuOpen(e){this.editorMenu.currMenu||(this.editorMenu.currMenu=e,this.cachedRefRect?this.computePosition(this.cachedRefRect):this.maybeMeasure(),!f.Platform.isMacOS&&this.tooltipInfo&&(this.createToolbar(),this.maybeMeasure()))}onEditorMenuClose(e){this.editorMenu.currMenu===e&&(this.editorMenu.currMenu=null),!f.Platform.isMacOS&&this.toolbar&&this.shouldRemoveToolbar()&&this.removeToolbar()}createToolbar(e){let t=e??this.tooltipInfo;if(!t)return;this.removeToolbar();let n=t.create(this.containerEl),r=this.view.state.field(f.editorInfoField);if(!r||!r?.editor)return;let i=r.editor.offsetToPos(t.start),a=t.end?r.editor.offsetToPos(t.end):i;this.workspace.trigger(f5,n,{from:i,to:a},r.editor,r),this.toolbar=n}removeToolbar(){this.toolbar&&=(this.toolbar.hide(),null)}update(e){if(!this.isThinoView)return;let t=e.state.facet(v5),n=t!==this.tooltipInfo&&!(0,r5.default)(t,this.tooltipInfo);n&&(this.tooltipInfo=t,this.shouldRemoveToolbar()?this.removeToolbar():t&&!this.toolbar&&this.createToolbar(t));let r=n||e.geometryChanged,i=e.state.facet(i5);i.defaultPlacement!=this.defaultPlacement&&(i.defaultPlacement=this.defaultPlacement),r&&this.maybeMeasure()}destroy(){this.editorMenu.currMenu=null,this.removeToolbar(),this.toolbar=null,this.view.state.field(f.editorInfoField).app.workspace.offref(this.editorMenu.evtRef)}cachedRefRect=null;readFromDOM=()=>{if(this.tooltipInfo){let{start:e}=this.tooltipInfo,{end:t}=this.tooltipInfo;t&&e===t&&(t=void 0);let n=this.view.coordsAtPos(e),r=t?this.view.coordsAtPos(t):null;if(n&&r&&n.top!==r.top){let e=this.view.contentDOM.getBoundingClientRect();r={left:e.right,right:e.right,top:n.top,bottom:n.bottom}}let i=m5(n,r);i&&(this.cachedRefRect=i,this.computePosition(i))}};async computePosition(e){if(!this.toolbar)return;this.virtualEl.rect=e;let{padding:t}=this.view.state.facet(i5),{x:n,y:r}=await n5(this.virtualEl,this.toolbar.dom,{placement:this.defaultPlacement,middleware:[y8({mainAxis:5}),_8({padding:t,boundary:this.view.scrollDOM}),d5({padding:t,boundary:this.view.scrollDOM,editorMenu:this.editorMenu.currMenu})]});Object.assign(this.toolbar.dom.style,{top:`0`,left:`0`,transform:`translate(${Math.round(n)}px,${Math.round(r)}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())}},_5=h.ViewPlugin.fromClass(g5,{eventHandlers:{scroll(){this.maybeMeasure()}}}),v5=m.Facet.define({enables:[_5],combine:e=>e.filter(e=>e!=null).first()??null}),y5=e=>{let t=w5(e);t&&window.navigator.clipboard.writeText(t?.getSelection())},b5=e=>{e.commands.executeCommandById(`editor:toggle-bold`,e)},x5=e=>{e.commands.executeCommandById(`editor:toggle-strikethrough`,e)},S5=e=>{e.commands.executeCommandById(`editor:toggle-highlight`,e)},C5=e=>{e.commands.executeCommandById(`editor:toggle-italics`,e)},w5=e=>{let{editor:t}=e.field(f.editorInfoField);return t},T5=(e,t)=>{let n=e.selection.ranges[0];if(!n)return null;let{anchor:r,head:i,empty:a}=n,[o,s]=[r,i].sort();return{start:o,end:a?void 0:s,create:n=>new k5(n).addSmallButton(t=>t.setClass(`clickable-icon`).setIcon(`copy`).onClick(()=>y5(e))).addSmallButton(e=>e.setClass(`clickable-icon`).setIcon(`bold`).onClick(()=>b5(t))).addSmallButton(e=>e.setClass(`clickable-icon`).setIcon(`italic`).onClick(()=>C5(t))).addSmallButton(e=>e.setClass(`clickable-icon`).setIcon(`strikethrough`).onClick(()=>x5(t))).addSmallButton(e=>e.setClass(`clickable-icon`).setIcon(`highlighter`).onClick(()=>S5(t)))}},E5=e=>m.StateField.define({create:t=>T5(t,e),update:(t,n)=>!n.docChanged&&!n.selection?t:T5(n.state,e),provide:e=>v5.from(e)}),D5=e=>[E5(e)],O5=class extends f.BaseComponent{button;disabled=!1;dropdownOptions=[];menu;menuOpened=!1;constructor(e){super(),this.button=new f.ButtonComponent(e)}setDisabled(e){return this.button.setDisabled(e),this.disabled=e,this}setIcon(e){return this.button.setIcon(e),this}setClass(e){return this.button.setClass(e),this}setDropdownText(e){let t=this.button.buttonEl.createDiv(`mini-toolbar-text`);(0,f.setIcon)(this.button.buttonEl.createDiv(`mini-toolbar-icon-with-text`),`chevron-down`);let n=e.doc.lineAt(e.selection.ranges[0].from)?.from,r=(0,p.syntaxTree)(e).resolveInner(n+1),i=r.type.prop(p.tokenClassNodeProp);return t.setText(this.detectFormat(i,r)||`Text`),this}setDropdownIcon(){let e=this.button.buttonEl.createDiv(`mini-toolbar-highlight-icon`),t=this.button.buttonEl.createDiv(`mini-toolbar-icon-with-icon`);return(0,f.setIcon)(e,`highlighter`),(0,f.setIcon)(t,`chevron-down`),this}detectFormat(e,t){if(!e)return`Text`;if(e.includes(`strong`))return`Bold`;if(e.includes(`em`))return`Italic`;if(e.includes(`strikethrough`))return`Strike`;if(e.contains(`hmd-codeblock`))return`CodeBlock`;if(e.contains(`hmd-inline-code`))return`Code`;if(e.contains(`formatting-header`)){let t=e.match(/header-\d{1,}/);if(t)return`Heading `+t[0].slice(-1)}if(e.contains(`formatting-list`)||e.contains(`hmd-list-indent`)){if(t?.parent&&(t.parent?.type.prop(p.lineClassNodeProp))?.contains(`HyperMD-task-line`))return`To-do list`;if(e.contains(`formatting-list-ol`))return`Numbered list`;if(e.contains(`formatting-list-ul`))return`Bulleted list`}}setTooltip(e){return this.button.setTooltip(e),this}setOptionsList(e){return this.dropdownOptions=e,this}onClick(e){return this.dropdownOptions.length>0?(this.button.onClick(e=>this.showEditMenu(e)),this):(this.button.onClick(e),this)}showEditMenu(e){if(this.menuOpened=!this.menuOpened,!this.menuOpened)return;this.menu=new f.Menu,this.menu.onHide(()=>{this.menuOpened=!1});let t=e.currentTarget,n=e.currentTarget?.getBoundingClientRect(),r={x:n.left-6,y:n.bottom+6};for(let e=0;e<this.dropdownOptions?.length;e++)this.menu.addItem(t=>{t.setIcon(`zap`).setTitle(this.dropdownOptions[e]).onClick(()=>{console.log(`Hellow`)})});this.menu.setParentElement(t).showAtPosition(r)}then(e){return e(this),this}},k5=class extends f.Component{dom;smallBtnContainer;constructor(e){super(),this.dom=(e?.closest(`.memo-editor-wrapper`)||e?.closest(`.temp-editor`)).createDiv({cls:`cm-mini-toolbar`},e=>e.style.position=`absolute`),this.smallBtnContainer=this.dom}addSmallButton(e){return e(new O5(this.smallBtnContainer)),this}unloading=!1;hide(){return this.unload(),this.unloading?this:(this.unloading=!0,this.dom.detach(),this.unloading=!1,this)}};M();var A5=h.Decoration.line({attributes:{"data-ph":j(`What do you think now...`)},class:`thino-editor-placeholder`}),j5=m.StateField.define({create(){return h.Decoration.none},update(e,t){let n=t.state.field(f.editorInfoField);if(!n||n.getViewType&&n.getViewType()!==`thino_view`)return e;let r=new m.RangeSetBuilder,i=t.state.doc.toString(),a=t.state.doc.lineAt(0);return i?.length==0&&r.add(a.from,a.from,A5),r.finish()},provide:e=>h.EditorView.decorations.from(e)});Mi();function M5(e){return`userId:${e}`}function N5(e,t){return`expiryDate:${t}:${e}`}function P5(e){try{if(!e?.appId)return``;let t=M5(e.appId);return ji.get([t])[t]||``}catch(e){return console.error(e),``}}function F5(e,t){try{if(!t?.appId)return;let n=M5(t.appId);return ji.set({[n]:e}),{userId:e,key:n}}catch(e){console.error(e)}}function I5(e,t){try{if(!t?.appId)return;let n=N5(P5(t),t.appId);ji.set({[n]:e})}catch(e){console.error(e)}}H(),$r(),li(),M(),K_();var L5=G_(`http`),R5=G_(`url`),z5=class{worker=null;server=null;isServerRunning=!1;plugin;settings;messageHandlers=new Map;tokenManager;constructor(e,t){this.plugin=e,this.settings=t,this.tokenManager=new RG(e)}async initializeWorker(){if(!this.worker)try{this.createSecureServer()}catch(e){throw console.error(`Failed to initialize worker:`,e),e}}createSecureServer(){this.server=L5.createServer(async(e,t)=>{t.setHeader(`Access-Control-Allow-Origin`,`*`),t.setHeader(`Access-Control-Allow-Methods`,`GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE`),t.setHeader(`Access-Control-Allow-Headers`,`Origin, X-Requested-With, Content-Type, Accept, Authorization, Cache-Control, Pragma`),t.setHeader(`Access-Control-Allow-Credentials`,`false`),t.setHeader(`Access-Control-Max-Age`,`86400`),t.setHeader(`X-Content-Type-Options`,`nosniff`),t.setHeader(`X-Frame-Options`,`DENY`),t.setHeader(`X-XSS-Protection`,`1; mode=block`),t.setHeader(`Strict-Transport-Security`,`max-age=31536000; includeSubDomains`);try{await this.handleRequest(e,t)}catch(e){console.error(`Request handling error:`,e),this.sendErrorResponse(t,500,`Internal server error`)}}),this.server.on(`error`,e=>{console.error(`Server error:`,e),new f.Notice(`Thino - Server error: `+e.message)}),this.server.on(`clientError`,(e,t)=>{console.error(`Client error:`,e),t.end(`HTTP/1.1 400 Bad Request\r
- \r
- `)})}async handleRequest(e,t){if(!e.url){this.sendErrorResponse(t,400,`Invalid request`);return}let n=R5.parse(e.url,!0),r=n.pathname;if(e.method===`OPTIONS`){t.statusCode=200,t.setHeader(`Content-Length`,`0`),t.end();return}let i=e.headers.authorization;if(!i){this.sendErrorResponse(t,401,`Missing authorization header`);return}let a=this.tokenManager.extractTokenFromHeader(i);if(!a){this.sendErrorResponse(t,401,`Invalid authorization format`);return}if(!await this.tokenManager.validateToken(a)){this.sendErrorResponse(t,401,`Invalid or expired token`);return}if(!await this.tokenManager.isUserVerified()){this.sendErrorResponse(t,403,`Pro license required`);return}let o=e.socket.remoteAddress||`unknown`;if(!this.checkRateLimit(o)){this.sendErrorResponse(t,429,`Too many requests`);return}try{switch(r){case`/create`:await this.handleCreateRequest(e,t);break;case`/search`:await this.handleSearchRequest(e,t,n.query);break;case`/list`:await this.handleListRequest(e,t,n.query);break;case`/info`:await this.handleInfoRequest(e,t,n.query);break;default:this.sendErrorResponse(t,404,`Not found`);break}}catch(e){console.error(`Route handling error:`,e),this.sendErrorResponse(t,500,`Internal server error`)}}async handleCreateRequest(e,t){if(e.method!==`POST`){this.sendErrorResponse(t,405,`Method not allowed`);return}let n=``,r=0;e.on(`data`,e=>{if(r+=e.length,r>10485760){this.sendErrorResponse(t,413,`Request too large`);return}n+=e.toString()}),e.on(`end`,async()=>{try{let e=this.validateAndSanitizeInput(JSON.parse(n)),r=await this.processCreateRequest(e);t.statusCode=200,t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify(r))}catch(e){console.error(`Create request error:`,e),this.sendErrorResponse(t,400,`Invalid request data`)}}),e.on(`error`,e=>{console.error(`Request stream error:`,e),this.sendErrorResponse(t,400,`Request error`)})}async handleSearchRequest(e,t,n){if(e.method!==`GET`){this.sendErrorResponse(t,405,`Method not allowed`);return}let r=this.sanitizeInput(n.keyword);if(!r){this.sendErrorResponse(t,400,`Invalid keyword`);return}try{let e=V.getThinoViaKeyword(r);t.statusCode=200,t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify({status:`success`,thinos:e}))}catch(e){console.error(`Search error:`,e),this.sendErrorResponse(t,500,`Search failed`)}}async handleListRequest(e,t,n){if(e.method!==`GET`){this.sendErrorResponse(t,405,`Method not allowed`);return}let r=n.count,i=Math.min(Math.max(parseInt(r)||10,1),100);try{let e=V.getState().memos.slice(0,i);t.statusCode=200,t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify({status:`success`,thinos:e}))}catch(e){console.error(`List error:`,e),this.sendErrorResponse(t,500,`List failed`)}}async handleInfoRequest(e,t,n){if(e.method!==`GET`){this.sendErrorResponse(t,405,`Method not allowed`);return}if(!n.getSettings){this.sendErrorResponse(t,400,`Missing getSettings parameter`);return}try{let e=L.getState().settings;t.statusCode=200,t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify({status:`success`,infoSettings:e}))}catch(e){console.error(`Info error:`,e),this.sendErrorResponse(t,500,`Info retrieval failed`)}}validateAndSanitizeInput(e){if(!e||typeof e!=`object`)throw Error(`Invalid request data`);return{text:this.sanitizeInput(e.text||``),isList:!!e.isList,type:this.sanitizeInput(e.type||``),imageList:Array.isArray(e.imageList)?e.imageList.slice(0,10):[],sourceLink:this.sanitizeInput(e.sourceLink||``)}}sanitizeInput(e){return typeof e==`string`?e.replace(/[<>]/g,``).replace(/javascript:/gi,``).replace(/data:/gi,``).substring(0,1e4):``}async processCreateRequest(e){let{text:t,isList:n,type:r,imageList:i,sourceLink:a}=e;if(!t)return{status:`success`,thino:null,link:null};let o=t;if(/<[a-zA-Z][^>]*>/g.test(t)&&(o=(0,f.htmlToMarkdown)(t)),a)try{o=`${o} [source](<${decodeURIComponent(a)}>)`}catch(e){console.warn(`Failed to decode source link:`,e)}this.settings.AutoDownloadImage&&i.length>0&&(o=await this.processImages(o,i)),this.plugin.settings?.AppendOrPrependTextViaServer&&(o=this.formatText(o));let s=r||this.settings.MemoSaveLocation,c=await V.createThino({content:o,isList:n,type:s});return c&&(V.pushMemo(c),z.clearQuery()),{status:`success`,thino:c,link:c?`obsidian://thino?openId=${c.id}`:null}}async processImages(e,t){try{let n=e.match(Gr)||[],r=[];for(let e of n.slice(0,5))try{let t=await N.grabImageFromUrl(e);if(t.size===0)continue;let n=new File([t],`image.png`,{type:`image/png`}),i=await this.handleUploadFile(n);i&&r.push({oldUrl:e,newUrl:i})}catch(e){console.error(`Error processing image URL:`,e)}r.forEach(t=>{e=e.replace(t.oldUrl,t.newUrl)});let i=[];for(let e of t.slice(0,5))try{if(typeof e==`string`&&e.startsWith(`data:image/`)){let t=this.base64ImageToBlob(e),n=new File([t],`image.png`,{type:`image/png`}),r=await this.handleUploadFile(n);r&&i.push(r)}}catch(e){console.error(`Error processing base64 image:`,e)}i.length>0&&(e+=`
- `+i.join(`
- `))}catch(e){console.error(`Error processing images:`,e)}return e}base64ImageToBlob(e){let t=e.indexOf(`;base64,`);if(t===-1)throw Error(`Invalid base64 image format`);let n=e.substring(5,t),r=e.substr(t+8);if(!/^[A-Za-z0-9+/]*={0,2}$/.test(r))throw Error(`Invalid base64 characters`);let i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return new Blob([a],{type:n})}async handleUploadFile(e){let{type:t}=e;if(!t.startsWith(`image`))return null;try{return`${await t_.upload(e)}`}catch(e){return console.error(`Upload error:`,e),new f.Notice(e),null}}formatText(e){let t=this.settings;return`${t?.PrependViaServer||``}${t?.WithNewLineViaServer===`prepend`||t?.WithNewLineViaServer===`both`?`
- `:``}${e}${t?.WithNewLineViaServer===`append`||t?.WithNewLineViaServer===`both`?`
- `:``}${t?.AppendViaServer||``}`}sendErrorResponse(e,t,n){e.statusCode=t,e.setHeader(`Content-Type`,`application/json`),e.setHeader(`Access-Control-Allow-Origin`,`*`),e.setHeader(`Access-Control-Allow-Methods`,`GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE`),e.setHeader(`Access-Control-Allow-Headers`,`Origin, X-Requested-With, Content-Type, Accept, Authorization, Cache-Control, Pragma`),e.end(JSON.stringify({status:`error`,message:n}))}rateLimitMap=new Map;checkRateLimit(e){let t=Date.now(),n=this.rateLimitMap.get(e);return!n||t>n.resetTime?(this.rateLimitMap.set(e,{count:1,resetTime:t+6e4}),!0):n.count>=100?!1:(n.count++,!0)}async listen(e,t){try{await this.initializeWorker(),console.log(`Thino - Starting HTTP server on port ${t}`),this.server.listen({port:parseInt(t),host:e},()=>{this.isServerRunning=!0,console.log(`Thino - Started HTTP server on port ${t}`),new f.Notice(`${j(`Thino - Started HTTP server on port`)} ${t}`)})}catch(e){throw console.error(`Failed to start server:`,e),new f.Notice(j(`Thino - Failed to start HTTP server, please check the port is available.`)),e}}close(){this.server&&this.isServerRunning&&this.server.close(()=>{this.isServerRunning=!1,console.log(`Thino - Terminated HTTP server`),new f.Notice(j(`Thino - Terminated HTTP server`))}),this.worker&&=(this.worker.terminate(),null)}isRunning(){return this.isServerRunning}};function B5(e,t){let n=new z5(e,t);return{listen(e,t){n.listen(e,t)},close(){n.close()}}}K_();var{clipboard:V5}=G_(`electron`),H5=new class{eventListeners;constructor(){this.eventListeners={}}on(e,t){this.eventListeners[e]=this.eventListeners[e]||[],this.eventListeners[e].push(t)}once(e,t){t.$emitOnce=!0,this.on(e,t)}removeListener(e,t){if(this.eventListeners[e]){let n=this.eventListeners[e].findIndex(e=>e===t);n>=0&&this.eventListeners[e].splice(n,1)}}removeAllListeners(e){this.eventListeners[e]&&(this.eventListeners[e].length=0)}emit(e,...t){this.eventListeners[e]&&this.eventListeners[e].forEach(n=>{n.call(this,...t),n.$emitOnce&&this.removeListener(e,n)})}},U5=null,W5=V5?.readText(),G5=V5?.readImage();V5&&(V5.on=(e,t)=>(H5.on(e,t),V5),V5.once=(e,t)=>(H5.once(e,t),V5),V5.off=(e,t)=>(t?H5.removeListener(e,t):H5.removeAllListeners(e),V5),V5.startWatching=()=>(U5||=setInterval(()=>{K5(W5,W5=V5?.readText())&&H5.emit(`text-changed`),q5(G5,G5=V5?.readImage())&&H5.emit(`image-changed`)},500),V5),V5.stopWatching=()=>(U5&&clearInterval(U5),U5=null,V5));function K5(e,t){return t&&e!==t}function q5(e,t){return!t.isEmpty()&&e.toDataURL()!==t.toDataURL()}M(),K_();var J5=G_(`electron`)?.remote,Y5=G_(`electron`)?.remote?.screen,X5=class{isRegisted;leaf;clipboard;isScreenTop=!1;currentSplitWindow;intervalNum;allowsCopy=!1;plugin;actionEl=null;constructor(e,t){this.app=e,this.plugin=t,this.isRegisted=!1,this.leaf=null,this.clipboard=V5}async onload(){f.Platform.isDesktop&&(this.initGlobalCopyEvents(),await this.registerAllShortcuts(),this.registerEvents())}registerEvents(){this.plugin.registerEvent(this.app.workspace.on(`quit`,()=>{J5.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally)}))}initGlobalCopyEvents(){this.plugin.addCommand({id:`init-global-copy-events`,name:j(`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`,()=>{this.allowsCopy=!1,this.clipboard.stopWatching(),this.actionEl?.remove()}))}})}onunload(){this.isRegisted&&(J5.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(){return this.leaf?this.app.workspace.getLeavesOfType(`thino_view`).length>0&&this.app.workspace.getLeafById(this.leaf.id)?!0:(this.leaf?.detach(),this.currentSplitWindow.close(),this.currentSplitWindow=null,this.leaf=null,this.isScreenTop=!1,!1):!1}async registerAllShortcuts(){J5?.globalShortcut?.register(this.plugin.settings.CaptureKey.OpenThinoGlobally,()=>{this.getCurrentLeaf()?this.showThinoView():this.openThinoView()}),this.isRegisted=!0}showThinoView(){let e=Y5.getCursorScreenPoint(),t=this.leaf?.parent?.parent?.win?.electronWindow;if(t){if(t.setAlwaysOnTop(!this.isScreenTop,`screen`),this.leaf.setPinned(!this.isScreenTop),this.leaf.view.containerEl.toggleClass(`thino-float-window`,!0),t.isMinimized()&&t.restore(),t.focus(),this.plugin.settings.CaptureKey.ShowNearMouse){let{width:n,height:r}=t.getBounds();t.setBounds({x:e.x,y:e.y,width:n,height:r})}if(this.app.workspace.trigger(`focus-on-textarea`),this.isScreenTop){this.isScreenTop=!1,setTimeout(()=>{t.setAlwaysOnTop(!1,`screen`)},200);return}this.isScreenTop=!0}}openThinoView(){this.leaf=this.app.workspace.openPopoutLeaf({size:{width:400,height:400}});let e=this.leaf;this.leaf.view.containerEl.toggleClass(`thino-float-window`,!0),this.leaf.setViewState({type:`thino_view`}),setTimeout(()=>{e.view.containerEl.classList.toggle(`mobile-view`,!0)},0),this.currentSplitWindow=this.leaf?.parent?.parent;let t=this.leaf?.parent?.parent?.win.electronWindow;if(!t)return;t.setAlwaysOnTop(!this.isScreenTop,`screen`),this.leaf.setPinned(!this.isScreenTop),this.isScreenTop=!0;let n=this.app,r=t=>{let r=Y5.getCursorScreenPoint(),i=e?.parent?.parent?.win?.electronWindow;if(i){if(i.isMinimized()&&i.restore(),!this.isScreenTop&&this.plugin.settings.CaptureKey.ShowNearMouse){let{width:e,height:t}=i.getBounds();i.setBounds({x:r.x,y:r.y-200,width:e,height:t})}i.setAlwaysOnTop(!0,`screen`),n.workspace.trigger(`focus-on-textarea`),n.workspace.trigger(`send-to-thino`,t,e)}};this.clipboard.on(`text-changed`,()=>{let e=this.clipboard.readText();console.log(this.clipboard),r(e)}).on(`image-changed`,()=>{r(this.clipboard.readImage())})}};I();var Z5=()=>Si(e=>{let{tag:t,duration:n,type:r,text:i,path:a,filter:o}=e.query;return!!(t||n&&n.from<n.to||r||i||a||o)});I(),Hg(),M();var Q5=({type:e,timestamp:t,useVirtual:n=!1,height:r=400})=>{let{memos:i}=P();vi(e=>e.useVirtualScrolling);let a=Z5(),o=Vg(e=>e.filteredMemos),s=Vg(e=>e.version),[c,l]=(0,U.useState)([]),u=U.useRef(null);return(0,U.useEffect)(()=>{let n=a?o:i;if(e===`daily`){let e=n;if(t){l(e.filter(e=>(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isSame((0,f.moment)(t,`YYYY/MM/DD HH:mm:ss`),`day`)));return}l(e.filter(e=>(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isSame((0,f.moment)(),`day`)))}else if(e===`latest`){let e=n.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`),t=e.filter(e=>e.pinned),r=e.filter(e=>!e.pinned);l([...t,...r])}},[i,o,s,a,e,t]),(0,U.useEffect)(()=>{u.current&&(u.current.scrollTop=0)},[c]),c.length>0?(0,W.jsx)(`div`,{ref:u,className:`thino-list-container`,children:c.map(e=>(0,W.jsx)(gT,{memo:e},e.id))}):(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:j(`Here is No Memos.`)})})};li(),Tg(),ng();var $5=/[-ヿ㐀-䶿一-鿿豈-가-]/u,e7=new Set(`the.and.for.are.but.not.you.all.any.can.her.was.one.our.out.day.get.has.him.his.how.man.new.now.old.see.two.way.who.did.its.let.put.say.she.too.use.this.that.with.have.from.they.will.your.what.when.make.like.time.just.know.take.into.than.then.them.some.could.about.there.their.would.which.were.been.http.https.www.的.了.和.是.在.我.有.他.这.中.来.上.个.到.说.们.为.你.出.时.年.得.就.那.要.下.以.会.自.着.去.之.过.家.对.可.她.里.后.么.多.天.而.能.好.都.然.没.日.于.起.发`.split(`.`));function t7(e){if(!e)return null;let t=new Date,n=/^(\d+)d$/.exec(e);if(n)return{from:Pm(t,Number(n[1])).getTime(),to:t.getTime()};switch(e){case`thisweek`:return{from:Ks(t).getTime(),to:xl(t).getTime()};case`thismonth`:return{from:ul(t).getTime(),to:qc(t).getTime()};case`thisyear`:return{from:hl(t).getTime(),to:pl(t).getTime()};case`lastweek`:{let e=Pm(t,7);return{from:Ks(e).getTime(),to:xl(e).getTime()}}case`lastmonth`:{let e=Bh(t,1);return{from:ul(e).getTime(),to:qc(e).getTime()}}case`lastyear`:{let e=Xh(t,1);return{from:hl(e).getTime(),to:pl(e).getTime()}}default:return null}}function n7(e){let t=bg(e.content),n=e.fileInfo?.tags;return Array.isArray(n)&&n.forEach(e=>{typeof e==`string`&&t.add(e.replace(/^#/,``))}),t}function r7(e,t){let{terms:n,tag:r,source:i,path:a,includeArchived:o,includeDeleted:s}=t,c=t7(t.range),l=a.toLowerCase(),u=e.filter(e=>{if(!o&&e.rowStatus===`ARCHIVED`||!s&&e.deletedAt||e.content.includes(`comment:`)||i&&e.sourceType!==i||a&&!(e.path??``).toLowerCase().includes(l))return!1;if(r){let t=n7(e);if(!Array.from(t).some(e=>e===r||typeof e==`string`&&e.startsWith(`${r}/`)))return!1}if(n.length>0){let t=e.content.toLowerCase();if(!n.every(e=>t.includes(e)))return!1}if(c){let t=N.getMemoTimestamp(e);if(t<c.from||t>c.to)return!1}return!0});return u.sort((e,n)=>{let r=N.getMemoTimestamp(e)-N.getMemoTimestamp(n);return t.sort===`asc`?r:-r}),t.limit>0?u.slice(0,t.limit):u}function i7(e){return e.replace(/```[\s\S]*?```/g,` `).replace(/`[^`]*`/g,` `).replace(/!\[\[[^\]]*\]\]/g,` `).replace(/!\[[^\]]*\]\([^)]*\)/g,` `).replace(/\[\[(?:[^\]|]*\|)?([^\]]*)\]\]/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/^\s*>+\s?/gm,``).replace(/^\s*[-*+]\s+(\[.\]\s+)?/gm,``).replace(/[*_~]+/g,``).replace(/\s+/g,` `).trim()}function a7(e,t,n){let r=e.match(/[##]?[\p{L}\p{N}_/-]+/gu);if(r)for(let e of r){let r=/^[##]/.test(e),i=e.replace(/^[##]/,``);if(i){if(r){let e=`#${i.toLowerCase()}`;t.set(e,(t.get(e)??0)+3),n.add(e);continue}if($5.test(i)){let e=Array.from(i);if(e.length<2)continue;for(let n=0;n<e.length-1;n++){let r=e[n]+e[n+1];e7.has(r)||t.set(r,(t.get(r)??0)+1)}}else{let e=i.toLowerCase();if(e.length<2||/^[\d/-]+$/.test(e)||e7.has(e))continue;t.set(e,(t.get(e)??0)+1)}}}}function o7(e,t){let n=new Map,r=new Set;for(let t of e)a7(i7(t.content),n,r);return Array.from(n.entries()).filter(([,e])=>e>1||n.size<=t).sort((e,t)=>t[1]-e[1]).slice(0,t).map(([e,t])=>({text:e,value:t,isTag:r.has(e)}))}var s7=60;function c7(e){switch(e){case`week`:return`GGGG-[W]WW`;case`month`:return`YYYY-MM`;default:return`YYYY-MM-DD`}}function l7(e,t,n){if(t===`tag`){let t=new Map;for(let n of e)bg(n.content).forEach(e=>{let n=String(e);t.set(n,(t.get(n)??0)+1)});return Array.from(t.entries()).sort((e,t)=>t[1]-e[1]).slice(0,n).map(([e,t])=>({key:e,label:`#${e}`,value:t}))}if(t===`source`){let t=new Map;for(let n of e){let e=n.sourceType||`UNKNOWN`;t.set(e,(t.get(e)??0)+1)}return Array.from(t.entries()).sort((e,t)=>t[1]-e[1]).map(([e,t])=>({key:e,label:e,value:t}))}let r=c7(t),i=new Map;for(let t of e){let e=(0,f.moment)(N.getMemoTimestamp(t)).format(r);i.set(e,(i.get(e)??0)+1)}return Array.from(i.entries()).sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0).slice(-s7).map(([e,t])=>({key:e,label:e,value:t}))}I();function u7(e){let t=P(e=>e.memos);return(0,U.useMemo)(()=>r7(t,e),[P(e=>e.memosHash),e])}M();var d7=e=>j(e);function f7(e,t){let n=t>0,r=n?Math.max(1,Math.ceil(e.length/t)):1,[i,a]=(0,U.useState)(0);(0,U.useEffect)(()=>{i>r-1&&a(r-1)},[i,r]);let o=Math.min(i,r-1);return{pageItems:(0,U.useMemo)(()=>{if(!n)return e;let r=o*t;return e.slice(r,r+t)},[e,o,t,n]),page:o,pageCount:r,setPage:a}}var p7=U.memo(({page:e,pageCount:t,onChange:n})=>t<=1?null:(0,W.jsxs)(`div`,{className:`thino-cb-pager`,children:[(0,W.jsx)(`button`,{type:`button`,className:`thino-cb-pager-btn`,disabled:e<=0,"aria-label":d7(`Previous page`),onClick:()=>n(e-1),children:(0,W.jsx)(kB,{size:16})}),(0,W.jsx)(`span`,{className:`thino-cb-pager-info`,children:`${e+1} / ${t}`}),(0,W.jsx)(`button`,{type:`button`,className:`thino-cb-pager-btn`,disabled:e>=t-1,"aria-label":d7(`Next page`),onClick:()=>n(e+1),children:(0,W.jsx)(AB,{size:16})})]})),m7=U.memo(({message:e})=>(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:e??d7(`Here is No Memos.`)})})),h7=U.memo(({memos:e,pageSize:t})=>{let{pageItems:n,page:r,pageCount:i,setPage:a}=f7(e,t),o=(0,U.useRef)(null),s=(0,U.useCallback)(e=>{a(e),o.current?.closest(`.thino-cb-query`)?.scrollTo({top:0})},[a]);return e.length===0?(0,W.jsx)(m7,{}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{ref:o,className:`thino-embed-container thino-cb-list`,children:(0,W.jsx)(`div`,{className:`thino-list-container`,children:n.map(e=>(0,W.jsx)(gT,{memo:e},e.id))})}),(0,W.jsx)(p7,{page:r,pageCount:i,onChange:s})]})});li();var g7=U.memo(({memos:e,pageSize:t})=>{let{pageItems:n,page:r,pageCount:i,setPage:a}=f7(e,t),o=(0,U.useRef)(null),s=(0,U.useMemo)(()=>{let e=``;return n.map(t=>{let n=(0,f.moment)(N.getMemoTimestamp(t)),r=n.format(`YYYY-MM-DD`),i=r!==e;return e=r,{id:t.id,date:r,time:n.format(`HH:mm`),showDate:i,preview:i7(t.content)||d7(`(empty)`),memo:t}})},[n]),c=(0,U.useCallback)(e=>{a(e),o.current?.closest(`.thino-cb-query`)?.scrollTo({top:0})},[a]);return e.length===0?(0,W.jsx)(m7,{}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{ref:o,className:`thino-cb-table`,role:`table`,children:[(0,W.jsxs)(`div`,{className:`thino-cb-table-head`,role:`row`,children:[(0,W.jsx)(`div`,{className:`thino-cb-col-date`,role:`columnheader`,children:d7(`Date`)}),(0,W.jsx)(`div`,{className:`thino-cb-col-content`,role:`columnheader`,children:d7(`Content`)})]}),(0,W.jsx)(`div`,{className:`thino-cb-table-body`,children:s.map(e=>(0,W.jsxs)(`div`,{className:`thino-cb-table-row`,role:`row`,onClick:()=>Bx(e.memo),children:[(0,W.jsxs)(`div`,{className:`thino-cb-col-date`,role:`cell`,children:[e.showDate?(0,W.jsx)(`span`,{className:`thino-cb-date`,children:e.date}):null,(0,W.jsx)(`span`,{className:`thino-cb-time`,children:e.time})]}),(0,W.jsx)(`div`,{className:`thino-cb-col-content`,role:`cell`,children:e.preview})]},e.id))})]}),(0,W.jsx)(p7,{page:r,pageCount:i,onChange:c})]})});H(),Hg();var _7=12,v7=30;function y7(e,t,n){if(n<=t)return(_7+v7)/2;let r=(Math.sqrt(e)-Math.sqrt(t))/(Math.sqrt(n)-Math.sqrt(t));return Math.round(_7+r*(v7-_7))}function b7(e){e.isTag?z.setTagQuery(e.text.replace(/^#/,``)):z.setTextQuery(e.text),Vg.getState().recompute()}var x7=U.memo(({memos:e,top:t})=>{let n=(0,U.useMemo)(()=>o7(e,t),[e,t]);if(n.length===0)return(0,W.jsx)(m7,{message:d7(`No keywords found`)});let r=n[0].value,i=n[n.length-1].value;return(0,W.jsx)(`div`,{className:`thino-cb-cloud`,children:n.map(e=>(0,W.jsx)(`button`,{type:`button`,className:`thino-cb-cloud-term${e.isTag?` is-tag`:``}`,style:{fontSize:`${y7(e.value,i,r)}px`},title:`${e.text} · ${e.value}`,onClick:()=>b7(e),children:e.text},e.text))})});H(),Hg();function S7(e,t){e===`tag`&&(z.setTagQuery(t.key),Vg.getState().recompute())}var C7=U.memo(({memos:e,groupBy:t,top:n})=>{let r=(0,U.useMemo)(()=>l7(e,t,n),[e,t,n]);if(r.length===0)return(0,W.jsx)(m7,{message:d7(`No data to chart`)});let i=r.reduce((e,t)=>Math.max(e,t.value),0)||1,a=t===`tag`;return(0,W.jsx)(`div`,{className:`thino-cb-chart`,"data-group-by":t,children:r.map(e=>(0,W.jsxs)(`div`,{className:`thino-cb-chart-row${a?` is-interactive`:``}`,onClick:a?()=>S7(t,e):void 0,title:`${e.label} · ${e.value}`,children:[(0,W.jsx)(`div`,{className:`thino-cb-chart-label`,children:e.label}),(0,W.jsx)(`div`,{className:`thino-cb-chart-track`,children:(0,W.jsx)(`div`,{className:`thino-cb-chart-bar`,style:{width:`${e.value/i*100}%`}})}),(0,W.jsx)(`div`,{className:`thino-cb-chart-value`,children:e.value})]},e.key))})}),w7=({config:e,count:t})=>{let n=[];e.keyword&&n.push(e.keyword),e.tag&&n.push(`#${e.tag}`),e.source&&n.push(e.source),e.range&&n.push(e.range);let r=e.title||n.join(` · `);return!r&&t===0?null:(0,W.jsxs)(`div`,{className:`thino-cb-header`,children:[r?(0,W.jsx)(`span`,{className:`thino-cb-title`,children:r}):null,(0,W.jsx)(`span`,{className:`thino-cb-count`,children:`${t} ${d7(`results`)}`})]})},T7=U.memo(({config:e})=>{let t=u7(e),n=(0,U.useMemo)(()=>{switch(e.view){case`table`:return(0,W.jsx)(g7,{memos:t,pageSize:e.pageSize});case`cloud`:return(0,W.jsx)(x7,{memos:t,top:e.top});case`chart`:return(0,W.jsx)(C7,{memos:t,groupBy:e.groupBy,top:e.top});default:return(0,W.jsx)(h7,{memos:t,pageSize:e.pageSize})}},[e.view,e.top,e.groupBy,e.pageSize,t]);return(0,W.jsxs)(`div`,{className:`thino-cb-query`,"data-view":e.view,children:[(0,W.jsx)(w7,{config:e,count:t.length}),n]})}),E7={list:`list`,table:`table`,cloud:`cloud`,wordcloud:`cloud`,"word-cloud":`cloud`,chart:`chart`,bar:`chart`,barchart:`chart`},D7={day:`day`,daily:`day`,week:`week`,weekly:`week`,month:`month`,monthly:`month`,tag:`tag`,tags:`tag`,source:`source`};function O7(e){return e===!0||e===`true`||e===1||e===`1`}function k7(e,t){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`){let t=Number(e.trim());if(Number.isFinite(t))return t}return t}function A7(e){if(!e)return[];let t=[],n=/"([^"]+)"|'([^']+)'|(\S+)/g,r;for(;(r=n.exec(e))!==null;){let e=(r[1]??r[2]??r[3]??``).trim().toLowerCase();e&&t.push(e)}return t}function j7(e){if(typeof e.view==`string`){let t=E7[e.view.trim().toLowerCase()];if(t)return t}return O7(e.table)?`table`:O7(e.cloud)||O7(e.wordcloud)?`cloud`:O7(e.chart)?`chart`:typeof e.keyword==`string`||typeof e.query==`string`||typeof e.search==`string`||typeof e.text==`string`?`list`:null}function M7(e){if(!e||typeof e!=`object`)return null;let t=j7(e);if(!t)return null;let n=String(e.keyword??e.query??e.search??e.text??``).trim(),r=typeof e.groupBy==`string`?e.groupBy.trim().toLowerCase():``;return{view:t,keyword:n,terms:A7(n),tag:String(e.tag??``).trim(),source:String(e.source??``).trim().toUpperCase(),path:String(e.path??``).trim(),range:String(e.range??``).trim().toLowerCase(),limit:Math.max(0,Math.floor(k7(e.limit,0))),pageSize:Math.max(0,Math.floor(k7(e.pageSize,10))),sort:e.sort===`asc`?`asc`:`desc`,includeArchived:O7(e.includeArchived),includeDeleted:O7(e.includeDeleted),groupBy:D7[r]??`day`,top:Math.max(1,Math.floor(k7(e.top,50))),title:String(e.title??``).trim()}}function N7(e){return[`editor`,`heatmap`,`calendar`,`daily`,`list`,`status`].filter(t=>O7(e[t])||t===`daily`&&typeof e.daily==`string`)}M();var P7=(e,t)=>{u_.createRoot(e).render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(F7,{plugin:t})}))},F7=({plugin:e})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`thino-error-code-block`,children:j(`Please open thino first`)}),(0,W.jsx)(`button`,{className:`thino-open-view`,onClick:()=>e.openMemos(`center`),children:j(`Open thino in center window`)})]}),I7=(e,t)=>{u_.createRoot(e).render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(R7,{yaml:t})}))},L7={editor:()=>z7(),heatmap:()=>V7(),calendar:()=>H7(),daily:e=>W7(e),list:()=>G7(),status:()=>U7()},R7=U.memo(({yaml:e})=>{let t=U.useMemo(()=>M7(e),[e]),n=U.useMemo(()=>N7(e),[e]);if(t)return(0,W.jsx)(T7,{config:t});let r=typeof e.daily==`string`?e.daily:``;return(0,W.jsx)(W.Fragment,{children:n.map(e=>(0,W.jsx)(`div`,{"data-embed-type":e,className:x_(`thino-embed-container`,e===`editor`?`thino-editor-modal`:``),children:L7[e](e===`daily`?r:void 0)},e))})});function z7(){return(0,W.jsx)(Aw,{editorType:`inline`,modal:!0})}function B7(e,t,n){try{let r=u_.createRoot(e);return r.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(Aw,{editorType:`inline`,destroy:t,modal:n})})),r}catch(e){console.error(e)}}function V7(){return(0,W.jsx)(tE,{basicType:`heatmap`})}function H7(){return(0,W.jsx)(tE,{basicType:`basic`})}function U7(){return(0,W.jsx)(E_,{statusType:`banner`})}function W7(e){return(0,W.jsx)(Q5,{type:`daily`,timestamp:e})}function G7(){return(0,W.jsx)(Q5,{type:`latest`})}var K7=class extends f.Modal{root;constructor(e){super(e)}getViewType(){return`thino_view`}onOpen(){let{contentEl:e,modalEl:t}=this;try{this.root=B7(e,this.close.bind(this),this),t.toggleClass(`thino-editor-modal`,!0),setTimeout(()=>{e.querySelector(`textarea`)?.focus(),this.app.workspace.trigger(`focus-on-textarea`)},10)}catch(e){console.error(e)}}onClose(){this.root.unmount(),this.containerEl&&this.containerEl.empty()}};H();var q7=class extends f.EditorSuggest{root;editor;cursor;plugin;tags;type=`customTag`;HASHTAG_REGEX=/(^|\s)#[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]*$/g;constructor(e,t){super(e),this.plugin=t}checkSettings(){return this.plugin.settings.UseVaultTags}checkInMemosView(e){let t=e.containerEl;return t&&(t.parentElement?.parentElement)?.classList.contains(`common-editor-inputer`)||!1}fuzzySearchItemsOptimized(e,t){let n=(0,f.prepareFuzzySearch)(e);return t.map(e=>{let t=n(e);return t?{item:e,match:t}:null}).filter(Boolean)}onTrigger(e,t){if(!this.checkInMemosView(t)||this.checkSettings())return null;this.tags=V.getState().tags,this.cursor=e,this.editor=t;let n=e.line,r=t.getLine(n),i=r.substr(0,e.ch);if(i.match(this.HASHTAG_REGEX)&&r.substr(e.ch,1)!==`#`){let t=i.lastIndexOf(`#`),r=i.substr(t+1);return{start:{line:n,ch:t},end:{line:n,ch:e.ch},query:r}}return null}getSuggestions(e){return this.fuzzySearchItemsOptimized(e.query,this.tags).map(e=>e.item).sort((e,t)=>e.localeCompare(t))||[]}renderSuggestion(e,t){t.setText(e)}selectSuggestion(e){if(this.context){let t=this.context.editor,n=this.context.start,r=this.context.end;t.transaction({changes:[{from:n,to:r,text:`#`+e+` `}]}),setTimeout(function(){return t.focus()})}this.close()}},J7=crypto,Y7=e=>e instanceof CryptoKey,X7=new TextEncoder,Z7=new TextDecoder;function Q7(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}var $7=e=>{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},e9=e=>{let t=e;t instanceof Uint8Array&&(t=Z7.decode(t)),t=t.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``);try{return $7(t)}catch{throw TypeError(`The input to be decoded is not correctly encoded.`)}},t9=class extends Error{constructor(e,t){super(e,t),this.code=`ERR_JOSE_GENERIC`,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};t9.code=`ERR_JOSE_GENERIC`;var n9=class extends t9{constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.code=`ERR_JWT_CLAIM_VALIDATION_FAILED`,this.claim=n,this.reason=r,this.payload=t}};n9.code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;var r9=class extends t9{constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.code=`ERR_JWT_EXPIRED`,this.claim=n,this.reason=r,this.payload=t}};r9.code=`ERR_JWT_EXPIRED`;var i9=class extends t9{constructor(){super(...arguments),this.code=`ERR_JOSE_ALG_NOT_ALLOWED`}};i9.code=`ERR_JOSE_ALG_NOT_ALLOWED`;var a9=class extends t9{constructor(){super(...arguments),this.code=`ERR_JOSE_NOT_SUPPORTED`}};a9.code=`ERR_JOSE_NOT_SUPPORTED`;var o9=class extends t9{constructor(e=`decryption operation failed`,t){super(e,t),this.code=`ERR_JWE_DECRYPTION_FAILED`}};o9.code=`ERR_JWE_DECRYPTION_FAILED`;var s9=class extends t9{constructor(){super(...arguments),this.code=`ERR_JWE_INVALID`}};s9.code=`ERR_JWE_INVALID`;var c9=class extends t9{constructor(){super(...arguments),this.code=`ERR_JWS_INVALID`}};c9.code=`ERR_JWS_INVALID`;var l9=class extends t9{constructor(){super(...arguments),this.code=`ERR_JWT_INVALID`}};l9.code=`ERR_JWT_INVALID`;var u9=class extends t9{constructor(){super(...arguments),this.code=`ERR_JWK_INVALID`}};u9.code=`ERR_JWK_INVALID`;var d9=class extends t9{constructor(){super(...arguments),this.code=`ERR_JWKS_INVALID`}};d9.code=`ERR_JWKS_INVALID`;var f9=class extends t9{constructor(e=`no applicable key found in the JSON Web Key Set`,t){super(e,t),this.code=`ERR_JWKS_NO_MATCHING_KEY`}};f9.code=`ERR_JWKS_NO_MATCHING_KEY`;var p9=class extends t9{constructor(e=`multiple matching keys found in the JSON Web Key Set`,t){super(e,t),this.code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`}};p9.code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;var m9=class extends t9{constructor(e=`request timed out`,t){super(e,t),this.code=`ERR_JWKS_TIMEOUT`}};m9.code=`ERR_JWKS_TIMEOUT`;var h9=class extends t9{constructor(e=`signature verification failed`,t){super(e,t),this.code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`}};h9.code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;function g9(e,t=`algorithm.name`){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function _9(e,t){return e.name===t}function v9(e){return parseInt(e.name.slice(4),10)}function y9(e){switch(e){case`ES256`:return`P-256`;case`ES384`:return`P-384`;case`ES512`:return`P-521`;default:throw Error(`unreachable`)}}function b9(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e=`CryptoKey does not support this operation, its usages must include `;if(t.length>2){let n=t.pop();e+=`one of ${t.join(`, `)}, or ${n}.`}else t.length===2?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}function x9(e,t,...n){switch(t){case`HS256`:case`HS384`:case`HS512`:{if(!_9(e.algorithm,`HMAC`))throw g9(`HMAC`);let n=parseInt(t.slice(2),10);if(v9(e.algorithm.hash)!==n)throw g9(`SHA-${n}`,`algorithm.hash`);break}case`RS256`:case`RS384`:case`RS512`:{if(!_9(e.algorithm,`RSASSA-PKCS1-v1_5`))throw g9(`RSASSA-PKCS1-v1_5`);let n=parseInt(t.slice(2),10);if(v9(e.algorithm.hash)!==n)throw g9(`SHA-${n}`,`algorithm.hash`);break}case`PS256`:case`PS384`:case`PS512`:{if(!_9(e.algorithm,`RSA-PSS`))throw g9(`RSA-PSS`);let n=parseInt(t.slice(2),10);if(v9(e.algorithm.hash)!==n)throw g9(`SHA-${n}`,`algorithm.hash`);break}case`EdDSA`:if(e.algorithm.name!==`Ed25519`&&e.algorithm.name!==`Ed448`)throw g9(`Ed25519 or Ed448`);break;case`Ed25519`:if(!_9(e.algorithm,`Ed25519`))throw g9(`Ed25519`);break;case`ES256`:case`ES384`:case`ES512`:{if(!_9(e.algorithm,`ECDSA`))throw g9(`ECDSA`);let n=y9(t);if(e.algorithm.namedCurve!==n)throw g9(n,`algorithm.namedCurve`);break}default:throw TypeError(`CryptoKey does not support this operation`)}b9(e,n)}function S9(e,t,...n){if(n=n.filter(Boolean),n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}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&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var C9=(e,...t)=>S9(`Key must be `,e,...t);function w9(e,t,...n){return S9(`Key for the ${e} algorithm must be `,t,...n)}var T9=e=>Y7(e)?!0:e?.[Symbol.toStringTag]===`KeyObject`,E9=[`CryptoKey`],D9=(...e)=>{let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(let e of t){let t=Object.keys(e);if(!n||n.size===0){n=new Set(t);continue}for(let e of t){if(n.has(e))return!1;n.add(e)}}return!0};function O9(e){return typeof e==`object`&&!!e}function k9(e){if(!O9(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}var A9=(e,t)=>{if(e.startsWith(`RS`)||e.startsWith(`PS`)){let{modulusLength:n}=t.algorithm;if(typeof n!=`number`||n<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};function j9(e){return k9(e)&&typeof e.kty==`string`}function M9(e){return e.kty!==`oct`&&typeof e.d==`string`}function N9(e){return e.kty!==`oct`&&e.d===void 0}function P9(e){return j9(e)&&e.kty===`oct`&&typeof e.k==`string`}function F9(e){let t,n;switch(e.kty){case`RSA`:switch(e.alg){case`PS256`:case`PS384`:case`PS512`:t={name:`RSA-PSS`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RS256`:case`RS384`:case`RS512`:t={name:`RSASSA-PKCS1-v1_5`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:t={name:`RSA-OAEP`,hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?[`decrypt`,`unwrapKey`]:[`encrypt`,`wrapKey`];break;default:throw new a9(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;case`EC`:switch(e.alg){case`ES256`:t={name:`ECDSA`,namedCurve:`P-256`},n=e.d?[`sign`]:[`verify`];break;case`ES384`:t={name:`ECDSA`,namedCurve:`P-384`},n=e.d?[`sign`]:[`verify`];break;case`ES512`:t={name:`ECDSA`,namedCurve:`P-521`},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:`ECDH`,namedCurve:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new a9(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;case`OKP`:switch(e.alg){case`Ed25519`:t={name:`Ed25519`},n=e.d?[`sign`]:[`verify`];break;case`EdDSA`:t={name:e.crv},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new a9(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;default:throw new a9(`Invalid or unsupported JWK "kty" (Key Type) Parameter value`)}return{algorithm:t,keyUsages:n}}var I9=async e=>{if(!e.alg)throw TypeError(`"alg" argument is required when "jwk.alg" is not present`);let{algorithm:t,keyUsages:n}=F9(e),r=[t,e.ext??!1,e.key_ops??n],i={...e};return delete i.alg,delete i.use,J7.subtle.importKey(`jwk`,i,...r)},L9=e=>e9(e),R9,z9,B9=e=>e?.[Symbol.toStringTag]===`KeyObject`,V9=async(e,t,n,r,i=!1)=>{let a=e.get(t);if(a?.[r])return a[r];let o=await I9({...n,alg:r});return i&&Object.freeze(t),a?a[r]=o:e.set(t,{[r]:o}),o},H9={normalizePublicKey:(e,t)=>{if(B9(e)){let n=e.export({format:`jwk`});return delete n.d,delete n.dp,delete n.dq,delete n.p,delete n.q,delete n.qi,n.k?L9(n.k):(z9||=new WeakMap,V9(z9,e,n,t))}return j9(e)?e.k?e9(e.k):(z9||=new WeakMap,V9(z9,e,e,t,!0)):e},normalizePrivateKey:(e,t)=>{if(B9(e)){let n=e.export({format:`jwk`});return n.k?L9(n.k):(R9||=new WeakMap,V9(R9,e,n,t))}return j9(e)?e.k?e9(e.k):(R9||=new WeakMap,V9(R9,e,e,t,!0)):e}},U9=(e,t,n=0)=>{n===0&&(t.unshift(t.length),t.unshift(6));let r=e.indexOf(t[0],n);if(r===-1)return!1;let i=e.subarray(r,r+t.length);return i.length===t.length?i.every((e,n)=>e===t[n])||U9(e,t,r+1):!1},W9=e=>{switch(!0){case U9(e,[42,134,72,206,61,3,1,7]):return`P-256`;case U9(e,[43,129,4,0,34]):return`P-384`;case U9(e,[43,129,4,0,35]):return`P-521`;case U9(e,[43,101,110]):return`X25519`;case U9(e,[43,101,111]):return`X448`;case U9(e,[43,101,112]):return`Ed25519`;case U9(e,[43,101,113]):return`Ed448`;default:throw new a9(`Invalid or unsupported EC Key Curve or OKP Key Sub Type`)}},pee=async(e,t,n,r,i)=>{let a,o,s=new Uint8Array(atob(n.replace(e,``)).split(``).map(e=>e.charCodeAt(0))),c=t===`spki`;switch(r){case`PS256`:case`PS384`:case`PS512`:a={name:`RSA-PSS`,hash:`SHA-${r.slice(-3)}`},o=c?[`verify`]:[`sign`];break;case`RS256`:case`RS384`:case`RS512`:a={name:`RSASSA-PKCS1-v1_5`,hash:`SHA-${r.slice(-3)}`},o=c?[`verify`]:[`sign`];break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:a={name:`RSA-OAEP`,hash:`SHA-${parseInt(r.slice(-3),10)||1}`},o=c?[`encrypt`,`wrapKey`]:[`decrypt`,`unwrapKey`];break;case`ES256`:a={name:`ECDSA`,namedCurve:`P-256`},o=c?[`verify`]:[`sign`];break;case`ES384`:a={name:`ECDSA`,namedCurve:`P-384`},o=c?[`verify`]:[`sign`];break;case`ES512`:a={name:`ECDSA`,namedCurve:`P-521`},o=c?[`verify`]:[`sign`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{let e=W9(s);a=e.startsWith(`P-`)?{name:`ECDH`,namedCurve:e}:{name:e},o=c?[]:[`deriveBits`];break}case`Ed25519`:a={name:`Ed25519`},o=c?[`verify`]:[`sign`];break;case`EdDSA`:a={name:W9(s)},o=c?[`verify`]:[`sign`];break;default:throw new a9(`Invalid or unsupported "alg" (Algorithm) value`)}return J7.subtle.importKey(t,s,a,i?.extractable??!1,o)},mee=(e,t,n)=>pee(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,`spki`,e,t,n);async function hee(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PUBLIC KEY-----`)!==0)throw TypeError(`"spki" must be SPKI formatted string`);return mee(e,t,n)}async function gee(e,t){if(!k9(e))throw TypeError(`JWK must be an object`);switch(t||=e.alg,e.kty){case`oct`:if(typeof e.k!=`string`||!e.k)throw TypeError(`missing "k" (Key Value) Parameter value`);return e9(e.k);case`RSA`:if(`oth`in e&&e.oth!==void 0)throw new a9(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`);case`EC`:case`OKP`:return I9({...e,alg:t});default:throw new a9(`Unsupported "kty" (Key Type) Parameter value`)}}var G9=e=>e?.[Symbol.toStringTag],K9=(e,t,n)=>{if(t.use!==void 0&&t.use!==`sig`)throw TypeError(`Invalid key for this operation, when present its use must be sig`);if(t.key_ops!==void 0&&t.key_ops.includes?.(n)!==!0)throw TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`);if(t.alg!==void 0&&t.alg!==e)throw TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},_ee=(e,t,n,r)=>{if(!(t instanceof Uint8Array)){if(r&&j9(t)){if(P9(t)&&K9(e,t,n))return;throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!T9(t))throw TypeError(w9(e,t,...E9,`Uint8Array`,r?`JSON Web Key`:null));if(t.type!==`secret`)throw TypeError(`${G9(t)} instances for symmetric algorithms must be of type "secret"`)}},vee=(e,t,n,r)=>{if(r&&j9(t))switch(n){case`sign`:if(M9(t)&&K9(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a private JWK`);case`verify`:if(N9(t)&&K9(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a public JWK`)}if(!T9(t))throw TypeError(w9(e,t,...E9,r?`JSON Web Key`:null));if(t.type===`secret`)throw TypeError(`${G9(t)} instances for asymmetric algorithms must not be of type "secret"`);if(n===`sign`&&t.type===`public`)throw TypeError(`${G9(t)} instances for asymmetric algorithm signing must be of type "private"`);if(n===`decrypt`&&t.type===`public`)throw TypeError(`${G9(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n===`verify`&&t.type===`private`)throw TypeError(`${G9(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n===`encrypt`&&t.type===`private`)throw TypeError(`${G9(t)} instances for asymmetric algorithm encryption must be of type "public"`)};function q9(e,t,n,r){t.startsWith(`HS`)||t===`dir`||t.startsWith(`PBES2`)||/^A\d{3}(?:GCM)?KW$/.test(t)?_ee(t,n,r,e):vee(t,n,r,e)}q9.bind(void 0,!1);var J9=q9.bind(void 0,!0);function yee(e,t,n,r,i){if(i.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(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a;a=n===void 0?t:new Map([...Object.entries(n),...t.entries()]);for(let t of r.crit){if(!a.has(t))throw new a9(`Extension Header Parameter "${t}" is not recognized`);if(i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&r[t]===void 0)throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)}var bee=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(e=>typeof e!=`string`)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};function xee(e,t){let 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`Ed25519`:return{name:`Ed25519`};case`EdDSA`:return{name:t.name};default:throw new a9(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}async function See(e,t,n){if(n===`sign`&&(t=await H9.normalizePrivateKey(t,e)),n===`verify`&&(t=await H9.normalizePublicKey(t,e)),Y7(t))return x9(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith(`HS`))throw TypeError(C9(t,...E9));return J7.subtle.importKey(`raw`,t,{hash:`SHA-${e.slice(-3)}`,name:`HMAC`},!1,[n])}throw TypeError(C9(t,...E9,`Uint8Array`,`JSON Web Key`))}var Cee=async(e,t,n,r)=>{let i=await See(e,t,`verify`);A9(e,i);let a=xee(e,i.algorithm);try{return await J7.subtle.verify(a,i,n,r)}catch{return!1}};async function wee(e,t,n){if(!k9(e))throw new c9(`Flattened JWS must be an object`);if(e.protected===void 0&&e.header===void 0)throw new c9(`Flattened JWS must have either of the "protected" or "header" members`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new c9(`JWS Protected Header incorrect type`);if(e.payload===void 0)throw new c9(`JWS Payload missing`);if(typeof e.signature!=`string`)throw new c9(`JWS Signature missing or incorrect type`);if(e.header!==void 0&&!k9(e.header))throw new c9(`JWS Unprotected Header incorrect type`);let r={};if(e.protected)try{let t=e9(e.protected);r=JSON.parse(Z7.decode(t))}catch{throw new c9(`JWS Protected Header is invalid`)}if(!D9(r,e.header))throw new c9(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header},a=yee(c9,new Map([[`b64`,!0]]),n?.crit,r,i),o=!0;if(a.has(`b64`)&&(o=r.b64,typeof o!=`boolean`))throw new c9(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:s}=i;if(typeof s!=`string`||!s)throw new c9(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);let c=n&&bee(`algorithms`,n.algorithms);if(c&&!c.has(s))throw new i9(`"alg" (Algorithm) Header Parameter value not allowed`);if(o){if(typeof e.payload!=`string`)throw new c9(`JWS Payload must be a string`)}else if(typeof e.payload!=`string`&&!(e.payload instanceof Uint8Array))throw new c9(`JWS Payload must be a string or an Uint8Array instance`);let l=!1;typeof t==`function`?(t=await t(r,e),l=!0,J9(s,t,`verify`),j9(t)&&(t=await gee(t,s))):J9(s,t,`verify`);let u=Q7(X7.encode(e.protected??``),X7.encode(`.`),typeof e.payload==`string`?X7.encode(e.payload):e.payload),d;try{d=e9(e.signature)}catch{throw new c9(`Failed to base64url decode the signature`)}if(!await Cee(s,t,d,u))throw new h9;let f;if(o)try{f=e9(e.payload)}catch{throw new c9(`Failed to base64url decode the payload`)}else f=typeof e.payload==`string`?X7.encode(e.payload):e.payload;let p={payload:f};return e.protected!==void 0&&(p.protectedHeader=r),e.header!==void 0&&(p.unprotectedHeader=e.header),l?{...p,key:t}:p}async function Tee(e,t,n){if(e instanceof Uint8Array&&(e=Z7.decode(e)),typeof e!=`string`)throw new c9(`Compact JWS must be a string or Uint8Array`);let{0:r,1:i,2:a,length:o}=e.split(`.`);if(o!==3)throw new c9(`Invalid Compact JWS`);let s=await wee({payload:i,protected:r,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t==`function`?{...c,key:s.key}:c}var Eee={webId:`globe-2`,pinned:`pin`,archived:`archive`,visibility:`eye`,deleted:`trash`},Dee=class extends h.WidgetType{error=!1;constructor(e,t,n,r,i){super(),this.view=e,this.plugin=t,this.target=n,this.type=r,this.to=i}eq(e){return this.target===e.target}toDOM(){let e=createSpan();return e.toggleClass(`thino-inline-widget`,!0),(0,f.setIcon)(e,Eee[this.type]||`help-circle`),f.setTooltip&&(0,f.setTooltip)(e,this.target),e}};function Oee(e){class t{view;match=new h.MatchDecorator({regexp:/\[(webId|pinned|archived|visibility|deleted)::([^\]]+)\]/g,decorate:(t,n,r,i,a)=>{this.shouldRender(a,n,r)&&t(n,r,h.Decoration.replace({widget:new Dee(a,e,i[0],i[1],r)}))}});decorations=h.Decoration.none;constructor(e){this.view=e,this.updateDecorations(e)}update(e){this.updateDecorations(e.view,e)}destroy(){this.decorations=h.Decoration.none}updateDecorations(e,t){!t||this.decorations.size===0?this.decorations=this.match.createDeco(e):this.decorations=this.match.updateDeco(t,this.decorations)}isLivePreview(e){return e.field(f.editorLivePreviewField)}shouldRender(e,t,n){return!e.state.selection.ranges.some(e=>e.from<=t?e.to>=t:e.from<=n)&&this.isLivePreview(e.state)}}return h.ViewPlugin.fromClass(t,{decorations:e=>e.decorations.update({filter:(t,n,r)=>{let i=r.spec.widget;return i&&i.error?!1:t===n||!e.view.state.selection.ranges.filter(e=>{let r=e.from,i=e.to;return r<=t?i>=t:r<=n}).length}})})}function kee(e){let t=new Uint8Array(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var Aee=class{plugin;cachedVerified=null;refreshPromise=null;callbackServer=null;pendingCodeVerifier=null;pendingState=null;preparedMobileAuthUrl=null;preparedMobileState=null;preparedMobileVerifier=null;preparedMobileExpireTimer=null;memAccessToken=null;memRefreshToken=null;memAiToken=null;constructor(e){this.plugin=e}get secrets(){return this.plugin.app.secretStorage}loadSecrets(){this.memAccessToken=this.secrets.getSecret(EG.accessToken)??null,this.memRefreshToken=this.secrets.getSecret(EG.refreshToken)??null,this.memAiToken=this.secrets.getSecret(EG.aiToken)??null}setAccessToken(e){this.memAccessToken=e,this.secrets.setSecret(EG.accessToken,e)}setRefreshToken(e){this.memRefreshToken=e,this.secrets.setSecret(EG.refreshToken,e)}setAiToken(e){this.memAiToken=e,this.secrets.setSecret(EG.aiToken,e)}clearSecrets(){this.memAccessToken=null,this.memRefreshToken=null,this.memAiToken=null,this.secrets.setSecret(EG.accessToken,``),this.secrets.setSecret(EG.refreshToken,``),this.secrets.setSecret(EG.aiToken,``)}get accessToken(){return this.memAccessToken??``}get aiToken(){return this.memAiToken??``}async migrateFromSettings(){let e=this.plugin.settings.general;if(!e)return;let t=!1,n={...e};if(e.accessToken&&(await this.setAccessToken(e.accessToken),n={...n,accessToken:void 0},t=!0),e.refreshToken&&(this.setRefreshToken(e.refreshToken),n={...n,refreshToken:void 0},t=!0),e.userInfo?.ai_token){this.setAiToken(e.userInfo.ai_token);let{ai_token:r,...i}=e.userInfo;n={...n,userInfo:i},t=!0}t&&(this.plugin.settings.general=n,await this.plugin.saveSettings(),console.log(`[PKMerAuth] Migrated tokens from settings to secretStorage`))}async verify(){let e=this.plugin.settings.general;if(!this.memAccessToken)return this.cachedVerified=!1,!1;if(e.tokenExpiresAt&&Date.now()<e.tokenExpiresAt)return this.cachedVerified=!0,!0;if(this.memRefreshToken){let e=await this.refreshTokens();return this.cachedVerified=e,e}return this.cachedVerified=!1,!1}async verifyWithResult(){return{verified:await this.verify(),userInfo:this.plugin.settings.general.userInfo??null,expiresAt:this.plugin.settings.general.tokenExpiresAt??0}}async prepareMobileAuthUrl(){if(!f.Platform.isMobile)return null;if(this.preparedMobileAuthUrl)return this.preparedMobileAuthUrl;let e=this.generateRandom(),t=this.generateRandom(),n=await this.computeCodeChallenge(t),r=new URLSearchParams({response_type:`code`,client_id:DG.clientId,redirect_uri:DG.mobileRedirectUri,scope:DG.scopes,state:e,code_challenge:n,code_challenge_method:`S256`});return this.preparedMobileVerifier=t,this.preparedMobileState=e,this.preparedMobileAuthUrl=`${DG.authorizationUrl}?${r.toString()}`,this.preparedMobileExpireTimer&&clearTimeout(this.preparedMobileExpireTimer),this.preparedMobileExpireTimer=setTimeout(()=>{this.preparedMobileAuthUrl=null,this.preparedMobileState=null,this.preparedMobileVerifier=null,this.preparedMobileExpireTimer=null},300*1e3),this.preparedMobileAuthUrl}consumeMobileAuthUrl(){if(!f.Platform.isMobile)return null;let e=this.preparedMobileAuthUrl;if(!e||!this.preparedMobileState||!this.preparedMobileVerifier)return null;this.pendingState=this.preparedMobileState,this.pendingCodeVerifier=this.preparedMobileVerifier,this.preparedMobileAuthUrl=null,this.preparedMobileState=null,this.preparedMobileVerifier=null,this.preparedMobileExpireTimer&&=(clearTimeout(this.preparedMobileExpireTimer),null);let t=this.pendingState;return setTimeout(()=>{this.pendingState===t&&(this.pendingState=null,this.pendingCodeVerifier=null)},300*1e3),e}async login(){let e=this.generateRandom(),t=this.generateRandom();this.pendingCodeVerifier=t,this.pendingState=e;let n=await this.computeCodeChallenge(t);if(f.Platform.isMobile){let t=new URLSearchParams({response_type:`code`,client_id:DG.clientId,redirect_uri:DG.mobileRedirectUri,scope:DG.scopes,state:e,code_challenge:n,code_challenge_method:`S256`}),r=`${DG.authorizationUrl}?${t.toString()}`;window.open(r,`_blank`),setTimeout(()=>{this.pendingState===e&&(this.pendingState=null,this.pendingCodeVerifier=null)},300*1e3);return}let r=this.startCallbackServer(e),i=new URLSearchParams({response_type:`code`,client_id:DG.clientId,redirect_uri:DG.desktopRedirectUri,scope:DG.scopes,state:e,code_challenge:n,code_challenge_method:`S256`}),a=`${DG.authorizationUrl}?${i.toString()}`;window.open(a,`_blank`);try{let e=await r;if(!e){this.pendingCodeVerifier=null,this.pendingState=null,new f.Notice(`Login cancelled or timed out.`);return}await this.exchangeCodeForTokens(e,DG.desktopRedirectUri)?(await this.fetchUserInfo(),new f.Notice(`Successfully logged in to PKMer!`)):new f.Notice(`Failed to complete login. Please try again.`)}catch(e){console.error(`PKMer OAuth login error:`,e),new f.Notice(`Login failed. Please try again.`)}finally{this.pendingCodeVerifier=null,this.pendingState=null}}async handleOAuthCallback(e,t){if(!this.pendingState||t!==this.pendingState)return new f.Notice(`OAuth state mismatch. Please try logging in again.`),this.pendingState=null,this.pendingCodeVerifier=null,!1;try{return await this.exchangeCodeForTokens(e,DG.mobileRedirectUri)?(await this.fetchUserInfo(),new f.Notice(`Successfully logged in to PKMer!`),!0):(new f.Notice(`Failed to complete login. Please try again.`),!1)}catch(e){return console.error(`PKMer OAuth callback error:`,e),new f.Notice(`Login failed. Please try again.`),!1}finally{this.pendingState=null,this.pendingCodeVerifier=null}}async logout(){await this.clearSecrets(),this.plugin.settings.general={...this.plugin.settings.general,tokenExpiresAt:0,userInfo:null},this.cachedVerified=!1,await this.plugin.saveSettings(),new f.Notice(`Logged out from PKMer.`)}async refreshQuota(){return await this.verify()?(await this.fetchUserInfo(),this.plugin.settings.general?.userInfo?.ai_quota??null):null}async reloadVerifyID(){this.cachedVerified=null}onunload(){this.closeCallbackServer()}async computeCodeChallenge(e){let t=new TextEncoder().encode(e);return kee(await crypto.subtle.digest(`SHA-256`,t))}startCallbackServer(e){return new Promise(t=>{try{if(!f.Platform.isDesktop){t(null);return}let n=window.require(`node:http`).createServer((n,r)=>{let i=new URL(n.url,`http://localhost:${DG.callbackPort}`);if(i.pathname===`/thino/callback`){let n=i.searchParams.get(`code`);if(i.searchParams.get(`state`)!==e)r.writeHead(400,{"Content-Type":`text/html; charset=utf-8`}),r.end(`<html><body><h2>State mismatch. Please try again.</h2></body></html>`),t(null);else if(n)r.writeHead(200,{"Content-Type":`text/html; charset=utf-8`}),r.end(`<html><body><h2>Login successful!</h2><p>You can close this window and return to Obsidian.</p><script>window.close()<\/script></body></html>`),t(n);else{let e=i.searchParams.get(`error`)||`unknown error`;r.writeHead(400,{"Content-Type":`text/html; charset=utf-8`}),r.end(`<html><body><h2>Login failed: ${e}</h2></body></html>`),t(null)}setTimeout(()=>this.closeCallbackServer(),500)}else r.writeHead(404),r.end()});n.on(`error`,e=>{console.error(`Callback server error:`,e),new f.Notice(`Failed to start login server: ${e.message}`),t(null)}),n.listen(DG.callbackPort,`127.0.0.1`,()=>{console.log(`PKMer OAuth callback server listening on port ${DG.callbackPort}`)}),this.callbackServer=n,setTimeout(()=>{this.callbackServer===n&&(this.closeCallbackServer(),t(null))},300*1e3)}catch(e){console.error(`Failed to start callback server:`,e),t(null)}})}closeCallbackServer(){if(this.callbackServer){try{this.callbackServer.close()}catch{}this.callbackServer=null}}async exchangeCodeForTokens(e,t){try{let n={grant_type:`authorization_code`,code:e,redirect_uri:t,client_id:DG.clientId};this.pendingCodeVerifier&&(n.code_verifier=this.pendingCodeVerifier);let r=(await(0,f.requestUrl)({url:DG.tokenUrl,method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams(n).toString()})).json;return r.access_token?(await this.setAccessToken(r.access_token),await this.setRefreshToken(r.refresh_token||``),this.plugin.settings.general={...this.plugin.settings.general,tokenExpiresAt:Date.now()+(r.expires_in??3600)*1e3},await this.plugin.saveSettings(),this.cachedVerified=!0,!0):!1}catch(e){return console.error(`Token exchange failed:`,e),!1}}async refreshTokens(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=(async()=>{try{let e=(await(0,f.requestUrl)({url:DG.tokenUrl,method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`refresh_token`,refresh_token:this.memRefreshToken||``,client_id:DG.clientId}).toString()})).json;return e.access_token?(await this.setAccessToken(e.access_token),e.refresh_token&&await this.setRefreshToken(e.refresh_token),this.plugin.settings.general={...this.plugin.settings.general,tokenExpiresAt:Date.now()+(e.expires_in??3600)*1e3},await this.plugin.saveSettings(),!0):!1}catch(e){return console.error(`Token refresh failed:`,e),await this.clearSecrets(),this.plugin.settings.general={...this.plugin.settings.general,tokenExpiresAt:0},await this.plugin.saveSettings(),!1}})();try{return await this.refreshPromise}finally{this.refreshPromise=null}}async fetchUserInfo(){try{let e=(await(0,f.requestUrl)({url:DG.userinfoUrl,method:`GET`,headers:{Authorization:`Bearer ${this.memAccessToken}`}})).json;e.ai_token&&await this.setAiToken(e.ai_token),this.plugin.settings.general={...this.plugin.settings.general,userInfo:{sub:e.sub||e.id||``,name:e.name||e.preferred_username||e.username||void 0,email:e.email||void 0,avatar:e.picture||e.avatar||void 0,ai_quota:e.ai_quota||void 0,device_count:e.device_count??void 0,thino:e.thino??void 0,thinoWebExpir:e.thinoWebExpir??void 0,supporter:e.supporter??void 0}},await this.plugin.saveSettings()}catch(e){console.error(`Failed to fetch user info:`,e)}}generateRandom(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}};Rg(),M(),H(),Av(),I(),Do(),zv(),gg(),h_(),li();var jee=e=>e.ctrlKey!==void 0||e.metaKey!==void 0||e.shiftKey!==void 0||e.altKey!==void 0,Y9=()=>{new f.Notice(j(`Open Memos Successfully`))},X9=[{id:`open-thino-in-left-sidebar`,shortName:j(`Left sidebar`),name:j(`Open thino in left sidebar`),icon:`arrow-left`,location:`left`,cb:Y9,modKeys:`shift`},{id:`open-thino-in-right-sidebar`,shortName:j(`Right sidebar`),name:j(`Open thino in right sidebar`),icon:`arrow-right`,location:`right`,cb:Y9,modKeys:[`ctrl`,`meta`]},{id:`open-thino-in-float`,shortName:j(`Float window`),name:j(`Open thino in float window`),icon:`layout`,location:`float`,cb:Y9,modKeys:`alt`},{id:`open-thino-in-center`,shortName:j(`Center window`),name:j(`Open thino in center window`),icon:`tv-2`,location:`center`,cb:Y9,modKeys:void 0}];function Z9(e,t,n){return new Promise((r,i)=>{let a=``,o=``,s=n=>new Promise((r,i)=>{let s=t.ShareToThinoWithTextNewline===n||t.ShareToThinoWithTextNewline===`both`?`
- `:` `;switch(t[n===`prepend`?`SharePrependType`:`ShareAppendType`]){case`none`:r();break;case`preset`:t.ShareToThinoWithText&&(n===`prepend`?a=t.ShareToThinoWithTextPrepend+s:o=s+t.ShareToThinoWithTextAppend),r();break;case`input`:new $9(e,`Thino `+j(n===`prepend`?`Prepend text`:`Append text`),e=>{n===`prepend`?a=e.trim()+(e.trim()?s:``):o=(e.trim()?s:``)+e,r()}).open();break;case`selectTags`:new rC(e,e=>{let t=e.length>0?e.map(e=>`#`+e).join(` `):``;n===`prepend`?a=t.trim()+(t.trim()?s:``):o=(t.trim()?s:``)+t.trim(),r()}).open();break;default:i(Error(`Invalid configuration type.`))}});Promise.all([s(`append`),s(`prepend`)]).then(()=>n(a,o)).then(()=>r()).catch(i)})}var Mee=e=>{let t=e.embedRegistry;if(!t)return!1;let n=t.embedByExtension.md,r=n({app:e,containerEl:createDiv()},null,null);return r.editable=!0,r.set(``),r.showEditor(),Object.getPrototypeOf(Object.getPrototypeOf(r.editMode)).constructor};async function Q9(e){try{let t=e.app.internalPlugins.plugins[`daily-notes`],n;n={settings:{...e.settings,tokenForVerify:`***`},plugins:Object.keys(e.app.plugins.plugins),manifest:e.manifest,platform:f.Platform.resourcePathPrefix},t&&(n={...n,dailyNotePluginInfo:{options:t.instance.options}}),await navigator.clipboard.writeText(`\`\`\`json\n${JSON.stringify(n,null,2)}\n\`\`\``),new f.Notice(j(`Debug info copied to clipboard`))}catch(e){console.error(e)}}var Nee=class extends f.Plugin{settings;settingTab;thinoWorkerManager;triggerBySelf=!1;updatedID=``;debounceTimer=0;apiHttpServer=null;captureService=null;loaded=!1;MarkdownEditor;pkmerAuth;wechatService=null;async debug(e){let t=L.getState()?.verifyState,n=await Pv();if(!t||t?.appId!==n){console.error(`[thino:debug] Pro verification required.`);return}switch(e){case`wechat`:{if(this.wechatService){console.log(`[thino:debug] WeChat service already running, stopping...`),this.wechatService.onunload(),this.wechatService=null,console.log(`[thino:debug] WeChat stopped.`);return}console.log(`[thino:debug] Starting WeChat service...`);let{WeChatService:e}=await Promise.resolve().then(()=>(B6(),L6));this.wechatService=new e(this),await this.wechatService.start(),console.log(`[thino:debug] WeChat service started.`);break}default:console.log(`[thino:debug] Unknown feature: ${e}. Available: wechat`)}}async onload(){this.MarkdownEditor=Mee(this.app),L.setPlugin(this),console.log(`obsidian-memos loading...`),await this.loadSettings(),ZW(),this.registerRibbon(),this.pkmerAuth=new Aee(this),await this.pkmerAuth.loadSecrets(),await this.pkmerAuth.migrateFromSettings(),await this.verify(),this.settings.ShowUpdateMessage&&this.app.workspace.onLayoutReady(()=>{this.checkVersionAndShowChangeLog().catch(e=>console.error(e))}),this.settingTab=new Q6(this.app,this),this.addSettingTab(this.settingTab),this.initApp(),this.initEditor(),this.initURIHandler(),this.registerMobileEvent(),this.registerCommands(),(0,f.requireApiVersion)(`1.12.0`)&&this.registerCliHandlers(),this.registerCanvasNodeMemos(),this.registerHoverEvent(),this.registerLinkOpen(),this.registerCodeBlocks(),f.Platform.isMobile&&this.registerMobileNavbar(),this.updateLayoutSettings(),this.registerEditorContextMenu(),this.registerEditorSuggest(new YW(this.app,this)),this.registerEditorExtension([j5]),this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this)),this.registerView(MW,e=>new PW(e,this)),this.registerView(g_,e=>new v_(e,this.manifest.version)),this.registerView(KB,e=>new qB(e,this)),this.registerView(WW,e=>new qW(e,this)),qW.cleanupWorkingFile(this.app),this.addCommand({id:`open-thino-canvas-organizer`,name:`Open Thino Canvas Organizer`,callback:()=>this.openThinoCanvasOrganizer()}),this.thinoWorkerManager=new hg(this.app,this),this.addChild(this.thinoWorkerManager)}async loadSettings(){let e=await this.loadData();this.settings=JSON.parse(JSON.stringify(Object.assign({},q6,e))),L.setSettings(this.settings),this.settings.MemoListView&&R.setMemoListView(this.settings.MemoListView),this.initFSRS()}initFSRS(){let{updateFSRSInstance:e}=(EU(),d(mU)),t={request_retention:this.settings.fsrsRequestRetention??.9,maximum_interval:this.settings.fsrsMaximumInterval??36500,enable_fuzz:this.settings.fsrsEnableFuzz??!0,enable_short_term:this.settings.fsrsEnableShortTerm??!0};this.settings.fsrsWeights?.length===21&&(t.w=this.settings.fsrsWeights),e(t)}async saveSettings(){await this.saveData(this.settings),L.setSettings(this.settings)}async openThinoCanvasOrganizer(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;if(!e||e?.appId!==n){kv();return}let r=this.app.workspace.getLeavesOfType(WW);if(r.length>0){this.app.workspace.revealLeaf(r[0]);return}let i=this.app.workspace.getLeaf();await i.setViewState({type:WW,active:!0}),this.app.workspace.revealLeaf(i)}onunload(){this.app.workspace.detachLeavesOfType(MW),this.app.workspace.detachLeavesOfType(KB),this.app.workspace.detachLeavesOfType(WW),F.getState().clearFiles(),F.getState().clearView();let e=document.body.find(`.dialog-wrapper`);if(e&&e.parentElement?.detach(),this.apiHttpServer&&=(this.apiHttpServer.close(),null),this.captureService&&this.captureService.onunload(),this.pkmerAuth?.onunload(),this.wechatService?.onunload(),this.wechatService=null,f.Platform.isMobile){let e=this.app.mobileNavbar;e&&e.showThinoBtnEl&&this.settings?.NavbarButton&&(e.showThinoBtnEl.detach(),e.showThinoBtnEl=null)}new f.Notice(j(`Close Memos Successfully`))}initEditor(){this.register(AW(f.MetadataCache.prototype,{getFileCache:e=>function(t){return!t?.path&&!t?null:e.call(this,t)}})),(e=>{let t=e.app.embedRegistry.embedByExtension.md({app:e.app,containerEl:document.createElement(`div`)},null,``);t.editable=!0,t.showEditor();let n=AW(Object.getPrototypeOf(Object.getPrototypeOf(t.editMode)).constructor.prototype,{triggerClickableToken:e=>async function(...t){if(t[0].type===`internal-link`){if(this.editorEl.closest(`.memo-editor-wrapper`)){let n=V.getMemoById(t[0].text??``);if(n){Bx(n);return}return e.apply(this,t)}return e.apply(this,t)}return e.apply(this,t)}});this.register(n),t.unload()})(this)}initApp(){L.setApp(this.app)}initURIHandler(){this.registerObsidianProtocolHandler(`thino`,async e=>{if(!e)return;e.openSettings&&(this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||`obsidian-memos`));let t=e.pkmer_code||e.code,n=e.pkmer_state||e.state;if(t&&n){await this.pkmerAuth.handleOAuthCallback(t,n)&&(await this.verify(),R.setRefresh(!0));return}if(e.userid)try{let t=e.userid;F5(t,this.app),I5((0,f.moment)().add(30,`days`).valueOf(),this.app),R.setRefresh(!0)}catch(e){console.error(e),new f.Notice(j(`Failed to verify`))}if(e.token)try{let t=e.token;this.app?.saveLocalStorage(`tokenForSync`,t),setTimeout(()=>{this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||`obsidian-memos`),this.settingTab.display()},200),new f.Notice(j(`Saved sync token successfully`))}catch(e){console.error(e),new f.Notice(j(`Failed to save`))}if(e.copyToken){this.app.setting.open(),this.app.setting.openTabById(this.manifest.id??`obsidian-memos`);let e=await W6();new f.Notice(j(await N.copyTextToClipboard(e)?`Copied app id successfully`:`Copy to clipboard failed`))}let r=L.getState()?.verifyState,i=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),a=f.Platform.isDesktop?await Pv():i?.identifier||i?.uuid;if(!(!r||r?.appId!==a)){if(e.content){let t=e.type,n=decodeURI(e.content)===e.content?e.content:decodeURI(e.content),r=e.task,i=await V.createThino({content:n,type:t,isList:!!r});if(!i)return;V.pushMemo(i),z.clearQuery()}e.openId&&await V.openThinoByID(e.openId)}})}initGlobalManifest(){R.setPluginManifest(this.manifest)}stopServer(){this.apiHttpServer&&=(this.apiHttpServer.close(),null)}async stopEnableList(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;if(!e||e?.appId!==n){this.settings={...this.settings,EnabledLocationList:[{value:`DAILY`,target:`ProcessEntriesBelow`,insert:`InsertAfter`}]},this.settingTab.debounceApplySettingsUpdate();return}}async initServer(){if(f.Platform.isMobile||!this.settings.EnabledHttpApi)return;let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;!e||e?.appId!==n||(this.apiHttpServer=B5(this,this.settings),this.initServerPort())}initServerPort(){this.apiHttpServer&&this.settings.EnabledHttpApi&&this.apiHttpServer.listen(this.settings.HttpApiIpType,this.settings.HttpApiPort)}async initCaptureService(){if(f.Platform.isMobile||!this.settings.CaptureKey.EnableCaptureKey)return;let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;!e||e?.appId!==n||(this.captureService=new X5(this.app,this),await this.captureService.onload())}registerMobileEvent(){f.Platform.isMobile&&(this.registerEvent(this.app.workspace.on(`receive-text-menu`,(e,t)=>{e.addItem(e=>{e.setSection(`options`).setIcon(`popup-open`).setTitle(j(`Insert as Memo`)).onClick(async()=>{let e=t;try{await Z9(this.app,this.settings,async(t,n)=>{e=t+e+n;let r=await V.createThino({content:e,type:this.settings.MemoSaveLocation||`DAILY`,isList:!0});V.pushMemo(r)})}catch(e){console.error(`Configuration failed:`,e);return}})})})),this.registerEvent(this.app.workspace.on(`receive-files-menu`,(e,t)=>{e.addItem(e=>{e.setIcon(`popup-open`).setTitle(j(`Insert file as memo content`)).onClick(async()=>{let e=t.map(e=>this.app.fileManager.generateMarkdownLink(e,e.path)).join(`
- `);try{await Z9(this.app,this.settings,async(t,n)=>{e=t+e+n;let r=await V.createThino({content:e,type:this.settings.MemoSaveLocation||`DAILY`,isList:!0});V.pushMemo(r)})}catch(e){console.error(`Configuration failed:`,e);return}})})})))}registerCliHandlers(){let e=()=>(0,f.moment)().format(`YYYY/MM/DD`),t=e=>(0,f.moment)(e,[`YYYY/MM/DD`,`YYYY-MM-DD`],!0).format(`YYYY/MM/DD`);this.registerCliHandler(`thino`,`Create or manage a single thino`,{add:{description:`Add a new thino`},content:{value:`<text>`,description:`Thino content (required for add)`},location:{value:`daily|file|multi|canvas`,description:`Save location (default: daily)`},type:{value:`task|journal`,description:`Save type — task: checkbox [ ], journal: list item - (default: task)`},name:{value:`<filename>`,description:`File name, only used with location=multi`}},async e=>{if(e.add===`true`){let t=e.content;if(!t)return`Missing required: content=<text>`;let n=(e.location??`daily`).toUpperCase(),r=(e.type??`task`)===`journal`,i=await V.createThino({content:t,isList:r,type:n,name:e.name});return`Thino added [${n.toLowerCase()}/${r?`journal`:`task`}]: ${i.id}`}return`Usage: obsidian thino:<add> [options]
- Run: obsidian help thino`}),this.registerCliHandler(`thinos`,`Search and list thinos`,{date:{value:`<YYYY/MM/DD>`,description:`Filter by exact date (default: today)`},start:{value:`<YYYY/MM/DD>`,description:`Range start date (inclusive); implies all-dates mode`},end:{value:`<YYYY/MM/DD>`,description:`Range end date (inclusive); implies all-dates mode`},all:{description:`Disable date filter — show thinos from all dates`},query:{value:`<text>`,description:`Filter by content (case-insensitive substring)`},tag:{value:`<tag>`,description:`Filter by tag (#tag in content or frontmatter)`},location:{value:`daily|file|multi|canvas`,description:`Filter by save location`},type:{value:`task|journal`,description:`Filter by save type`},archived:{description:`Show archived thinos instead of normal ones`},total:{description:`Return count only`},format:{value:`text|json`,description:`Output format (default: text)`}},async n=>{let r=V.getState().memos,i=n.archived===`true`;if(r=r.filter(e=>e.rowStatus===(i?`ARCHIVED`:`NORMAL`)),n.start||n.end){let e=n.start?t(n.start):null,i=n.end?t(n.end):null;r=r.filter(t=>{let n=t.createdAt.slice(0,10);return!(e&&n<e||i&&n>i)})}else if(n.all!==`true`){let i=n.date?t(n.date):e();r=r.filter(e=>e.createdAt.slice(0,10)===i)}if(n.query){let e=n.query.toLowerCase();r=r.filter(t=>t.content.toLowerCase().includes(e))}if(n.tag){let e=n.tag.startsWith(`#`)?n.tag:`#${n.tag}`,t=n.tag.startsWith(`#`)?n.tag.slice(1):n.tag;r=r.filter(n=>n.content.includes(e)||n.fileInfo?.tags?.some(n=>n===t||n===e))}if(n.location){let e=n.location.toUpperCase();r=r.filter(t=>t.sourceType===e)}if(n.type){let e=n.type===`journal`?`JOURNAL`:`TASK-TODO`;r=r.filter(t=>t.thinoType===e)}if(n.total===`true`)return String(r.length);if(r.length===0)return`No thinos found.`;if(n.format===`json`)return JSON.stringify(r,null,2);let a=e=>e.replace(/^-\s+\[.\]\s*/,``).replace(/^-\s+/,``).trim();return r.map(e=>`${e.createdAt.slice(0,16)} ${`${e.sourceType.toLowerCase()}/${e.thinoType===`JOURNAL`?`journal`:`task`}`.padEnd(14)}${a(e.content)}`).join(`
- `)}),this.registerCliHandler(`thinos:search`,`Search thinos using Super semantic search or text matching`,{query:{value:`<text>`,description:`Search query (required)`},top:{value:`<number>`,description:`Max results to return (default: 20)`},format:{value:`text|json`,description:`Output format (default: text)`}},async e=>{let t=e.query;if(!t)return`Missing required: query=<text>`;let n=e.top?parseInt(e.top,10):20,r=B.getState();if(r.enabled&&r.embeddingReady)try{let r=await fv.hybridSearch(t,n);if(r.length===0)return`No results found.`;if(e.format===`json`)return JSON.stringify(r.map(e=>({score:e.score,memoId:e.entry.memoId,content:e.memo?.content??``,createdAt:e.memo?.createdAt??``})),null,2);let i=e=>e.replace(/^-\s+\[.\]\s*/,``).replace(/^-\s+/,``).trim();return r.map(e=>{let t=e.memo;return t?`${t.createdAt.slice(0,16)} [${e.score.toFixed(2)}] ${i(t.content)}`:`[score:${e.score.toFixed(2)}] (memo not found: ${e.entry.memoId})`}).join(`
- `)}catch(e){console.warn(`[CLI search] Super search failed, falling back to text:`,e)}let i=t.toLowerCase(),a=V.getState().memos.filter(e=>e.rowStatus===`NORMAL`&&e.content.toLowerCase().includes(i));if(a=a.slice(0,n),a.length===0)return`No results found.`;if(e.format===`json`)return JSON.stringify(a,null,2);let o=e=>e.replace(/^-\s+\[.\]\s*/,``).replace(/^-\s+/,``).trim();return a.map(e=>`${e.createdAt.slice(0,16)} ${o(e.content)}`).join(`
- `)}),f.Platform.isDesktop&&process&&process.env.mode!==`production`&&this.registerCliHandler(`thino:debug`,`Live integration tests for sync operations`,{status:{description:`Show sync status (enabled, token, last updated)`},"sync-cycle":{description:`Run full create -> edit -> delete cycle with sync verification`},multiline:{description:`Test multi-line DAILY thino create, sync, edit, and delete`},pull:{description:`Trigger pullFromWeb`},push:{description:`Trigger pushToWeb`},format:{value:`text|json`,description:`Output format (default: text)`}},async e=>{let t=e.format===`json`,n=[],r=e=>n.push(`[PASS] ${e}`),i=e=>n.push(`[FAIL] ${e}`),a=e=>n.push(`[INFO] ${e}`);if(e.status===`true`){let e=Eo.isSyncEnabled(),n=Eo.getToken(),r=Eo.getLastUpdatedTime();return t?JSON.stringify({enabled:e,hasToken:!!n,tokenPreview:n?n.slice(0,8)+`...`:``,lastUpdatedTime:r},null,2):[`Sync enabled : ${e}`,`Token : ${n?n.slice(0,8)+`...`:`(none)`}`,`Last updated : ${r} (${(0,f.moment)(Number(r)).format(`YYYY-MM-DD HH:mm:ss`)})`].join(`
- `)}if(e.pull===`true`){if(!Eo.isSyncEnabled())return`Sync is disabled. Enable sync first.`;a(`Triggering pullFromWeb...`);try{await Eo.pullFromWeb(Eo.getLastUpdatedTime()),r(`pullFromWeb completed`)}catch(e){i(`pullFromWeb threw: ${e.message}`)}return n.join(`
- `)}if(e.push===`true`){if(!Eo.isSyncEnabled())return`Sync is disabled. Enable sync first.`;a(`Triggering pushToWeb...`);try{await Eo.pushToWeb(),r(`pushToWeb completed`)}catch(e){i(`pushToWeb threw: ${e.message}`)}return n.join(`
- `)}if(e.multiline===`true`){if(!Eo.isSyncEnabled())return`Sync is disabled. Enable sync first.`;let e=`debug-ml-${Date.now()}`,o=[{label:`A`,lines:[`aaa-line-1`,`aaa-line-2`,`aaa-line-3`]},{label:`B`,lines:[`bbb-line-1`,`bbb-line-2`,`bbb-line-3`,`bbb-line-4`]},{label:`C`,lines:[`ccc-line-1`,`ccc-line-2`]}],s=[];a(`[ML] ══ Phase 1: Create 3 multi-line DAILY thinoes ══`);for(let t of o){let n=`${t.label}-${e}`,o=[...t.lines,`#${n}`].join(`
- `);a(`[ML:${t.label}] Creating (${t.lines.length} lines)...`);try{let e=await V.createThino({content:o,isList:!0,type:`DAILY`});if(!e?.id){i(`[ML:${t.label}] createThino returned no memo`);continue}r(`[ML:${t.label}] Created: id=${e.id}`),V.pushMemo(e);let c=V.getMemoById(e.id);c?c.content.split(`
- `).length>=t.lines.length?r(`[ML:${t.label}] In store, ${c.content.split(`
- `).length} lines`):i(`[ML:${t.label}] Store content line count mismatch`):i(`[ML:${t.label}] Not in store`),e.webId?r(`[ML:${t.label}] Synced: webId=${e.webId}`):a(`[ML:${t.label}] No webId yet`),s.push({label:t.label,memo:e,marker:n})}catch(e){i(`[ML:${t.label}] createThino threw: ${e.message}`)}}if(s.length===0)return i(`[ML] No memos created, aborting`),n.join(`
- `);n.push(``),a(`[ML] ══ Phase 2: Verify all coexist in daily note file ══`);try{let e=L.getState().app||window.app,t=s[0].memo.path,n=e.vault.getAbstractFileByPath(t);if(!n)i(`[ML] Daily note not found: ${t}`);else{let t=await e.vault.read(n);for(let e of s){let n=t.includes(`#${e.marker}`),a=t.includes(o.find(t=>t.label===e.label).lines[0]);n&&a?r(`[ML:${e.label}] Found on disk`):i(`[ML:${e.label}] Missing on disk (marker=${n}, firstLine=${a})`)}}}catch(e){i(`[ML] Disk check threw: ${e.message}`)}n.push(``),a(`[ML] ══ Phase 3: Delete one-by-one, verify siblings ══`);let c=[...s];for(let e=0;e<s.length;e++){let e=c.shift();a(`[ML:${e.label}] Deleting (${c.length} should remain)...`);try{await V.deleteMemoById(e.memo.id),r(`[ML:${e.label}] deleteMemoById OK`)}catch(t){i(`[ML:${e.label}] deleteMemoById threw: ${t.message}`);continue}try{V.getMemoById(e.memo.id)?i(`[ML:${e.label}] Still in store`):r(`[ML:${e.label}] Removed from store`)}catch{r(`[ML:${e.label}] Removed from store`)}try{let t=L.getState().app||window.app,n=t.vault.getAbstractFileByPath(e.memo.path);if(n){let a=await t.vault.read(n);a.includes(`#${e.marker}`)?i(`[ML:${e.label}] Content still in file`):r(`[ML:${e.label}] Content removed from file`);for(let t of c)a.includes(`#${t.marker}`)?r(`[ML:${e.label}] Sibling ${t.label} survived on disk`):i(`[ML:${e.label}] Sibling ${t.label} corrupted/lost on disk`)}else c.length===0?a(`[ML:${e.label}] File removed (OK, was last memo)`):i(`[ML:${e.label}] File gone but ${c.length} memos should remain`)}catch(t){i(`[ML:${e.label}] Post-delete disk check threw: ${t.message}`)}c.length>0&&n.push(``)}let l=n.filter(e=>e.startsWith(`[PASS]`)).length,u=n.filter(e=>e.startsWith(`[FAIL]`)).length;return n.push(``),n.push(`--- ${l} passed, ${u} failed ---`),t?JSON.stringify({log:n,passes:l,fails:u},null,2):n.join(`
- `)}if(e[`sync-cycle`]===`true`){if(!Eo.isSyncEnabled())return`Sync is disabled. Enable sync first.`;let e=`debug-${Date.now()}`,o=async t=>{let n=t.padEnd(5),o=`e2e-create-${t} #${e}`,s=`e2e-edited-${t} #${e}`;a(`[${n}] Creating thino...`);let c;try{if(c=await V.createThino({content:o,isList:!0,type:t}),!c?.id){i(`[${n}] createThino returned no memo`);return}r(`[${n}] Created: id=${c.id}`)}catch(e){i(`[${n}] createThino threw: ${e.message}`);return}try{V.pushMemo(c),V.getMemoById(c.id)?r(`[${n}] pushMemo OK, in store`):i(`[${n}] pushMemo called but not in store`)}catch(e){i(`[${n}] pushMemo threw: ${e.message}`)}t!==`DAILY`&&await new Promise(e=>setTimeout(e,1500));let l=V.getMemoById(c.id);l?.webId?r(`[${n}] Synced to server: webId=${l.webId}`):a(`[${n}] No webId (DAILY syncs before file write, so expected here)`),a(`[${n}] Editing...`);try{let e=await V.updateMemo(c.id,s);e?(V.editMemo(e),r(`[${n}] editMemo OK`)):i(`[${n}] updateMemo returned null`)}catch(e){i(`[${n}] edit threw: ${e.message}`)}a(`[${n}] Deleting...`);try{await V.deleteMemoById(c.id),r(`[${n}] deleteMemoById OK`)}catch(e){i(`[${n}] deleteMemoById threw: ${e.message}`)}try{V.getMemoById(c.id)?i(`[${n}] Still in store after delete`):r(`[${n}] Removed from store`)}catch{r(`[${n}] Removed from store`)}};await o(`FILE`),n.push(``),await o(`DAILY`),n.push(``),await o(`MULTI`),n.push(``),a(`[GUARD] Testing empty/null webId...`);try{await Eo.syncDelete(``),r(`[GUARD] syncDelete("") no-op`),await Eo.syncEdit({content:`x`}),r(`[GUARD] syncEdit(no webId) no-op`);let e=await Eo.syncPin(``,!0);e===null?r(`[GUARD] syncPin("") returned null`):i(`[GUARD] syncPin("") returned ${JSON.stringify(e)}`)}catch(e){i(`[GUARD] threw: ${e.message}`)}n.push(``),a(`[PIN] Testing pin/unpin...`);try{let t=await Eo.syncCreate(`pin-test #${e}`,`FILE`,!0);t?.id?((await Eo.syncPin(t.id,!0))?.pinned===!0?r(`[PIN] pin=true OK`):i(`[PIN] pin=true unexpected result`),(await Eo.syncPin(t.id,!1))?.pinned===!1?r(`[PIN] pin=false OK`):i(`[PIN] pin=false unexpected result`),await Eo.syncDelete(t.id),r(`[PIN] Cleaned up`)):i(`[PIN] syncCreate returned null`)}catch(e){i(`[PIN] threw: ${e.message}`)}let s=n.filter(e=>e.startsWith(`[PASS]`)).length,c=n.filter(e=>e.startsWith(`[FAIL]`)).length;return n.push(``),n.push(`--- ${s} passed, ${c} failed ---`),t?JSON.stringify({log:n,passes:s,fails:c},null,2):n.join(`
- `)}return`Usage: obsidian thino:debug <status|sync-cycle|multiline|pull|push>
- Run: obsidian help thino:debug`})}registerCommands(){X9.forEach(e=>{this.addCommand({id:e.id,name:e.name,callback:()=>this.openMemos(e.location,e.cb),hotkeys:[]})}),this.addCommand({id:`open-super-sidebar`,name:`Open Super sidebar`,callback:()=>this.openSuperSidebar()}),[`Modern`,`Clean`,`Minimal`,`Gradient`].forEach(e=>{this.addCommand({id:`share-thino-via-${e.toLowerCase()}`,name:j(`Share thino`)+` [${j(e)}]`,editorCallback:(t,n)=>{let r=t.getSelection();r.length!==0&&US({id:`temp-${Date.now()}`,content:r,createdAt:(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),updatedAt:(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),deletedAt:``,pinned:!1,visibility:`PUBLIC`,rowStatus:`NORMAL`,thinoType:`JOURNAL`,hasId:``,linkId:[],resourceList:[],creatorName:`thino`,sourceType:`DAILY`,path:n.file.path,fileInfo:{tags:[],frontmatter:{}}},e.toLowerCase(),n)}})}),this.addCommand({id:`focus-mode`,name:`Focus mode`,callback:()=>{let e=document.body.hasClass(`thino-focus`);document.body.toggleClass(`thino-focus`,!e)}}),this.addCommand({id:`hide-side-bar`,name:j(`Toggle sidebar visibility`),callback:()=>{let e=R.getState().isMobileView,t=document.body.hasClass(`thino-hide-side-bar`);document.body.toggleClass(`thino-hide-side-bar`,e?!1:!t)}}),this.addCommand({id:`hide-tags`,name:j(`Toggle tags visibility`),callback:()=>{let e=document.body.hasClass(`thino-hide-tags`);document.body.toggleClass(`thino-hide-tags`,!e)}}),this.addCommand({id:`hide-query-list`,name:j(`Toggle query list visibility`),callback:()=>{let e=document.body.hasClass(`thino-hide-query-list`);document.body.toggleClass(`thino-hide-query-list`,!e)}}),this.addCommand({id:`insert-task`,name:j(`Insert task`),checkCallback:e=>{let t=this.app.plugins.getPlugin(`obsidian-tasks-plugin`),n=this.app.workspace.getLeavesOfType(`thino_view`).first();if(t&&n)return e||this.app.plugins.plugins[`obsidian-tasks-plugin`].apiV1.createTaskLineModal().then(e=>{let t=this.app.workspace.activeEditor;t&&t.editor?.insertText(e)}),!0}}),this.addCommand({id:`show-thino-editor`,name:j(`Show thino editor`),checkCallback:e=>{if(V.initialized&&L.initialized){if(!e){if(!L.getState().view){new f.Notice(j(`Please open thino first`));return}new K7(this.app).open()}return!0}}}),this.addCommand({id:`lock-thino`,name:j(`Lock thino`),checkCallback:e=>{if(this.app.workspace.getActiveViewOfType(PW)&&this.settings.needVerify)return e||R.setLocked(!0),!0}}),this.addCommand({id:`copy-debug-info`,name:j(`Copy debug info`),callback:async()=>{await Q9(this)}}),this.addCommand({id:`insert-editor`,name:j(`Insert editor`),checkCallback:e=>{let t=this.app.workspace.getActiveViewOfType(f.MarkdownView);if(t&&t?.getViewType()===`markdown`)return e||t.editor.replaceSelection(`
- \`\`\`thino
- {
- editor: false
- }
- \`\`\`
- `),!0}}),this.addCommand({id:`toggle-minimal-thino`,name:j(`Toggle minimal mode`),callback:()=>{let e=document.body.hasClass(`minimal-thino`);document.body.toggleClass(`minimal-thino`,!e)}}),this.addCommand({id:`focus-on-thino-editor`,name:j(`Focus on thino editor`),callback:()=>this.focusOnEditor(),hotkeys:[]}),this.addCommand({id:`reinit-thino-sync`,name:j(`ReSync web thinos to local`),callback:()=>{Eo.resetLastUpdatedTime()}}),this.addCommand({id:`init-thino-sync`,name:j(`Sync local thinos to web`),callback:async()=>{if(!Eo.isSyncEnabled()){new f.Notice(j(Eo.getToken()?`Please enable sync first`:`Please input token first`));return}try{await Eo.pushToWeb()}catch(e){console.error(e),new f.Notice(j(`Init Failed`))}}}),this.addCommand({id:`show-daily-thino`,name:j(`Show daily thino`),callback:()=>this.openDailyMemo(),hotkeys:[]}),this.addCommand({id:`focus-on-search-bar`,name:j(`Focus on search bar`),callback:()=>this.searchIt(),hotkeys:[]}),this.addCommand({id:`show-thino-in-popover`,name:j(`Show-thino in popover(Hover editor)`),callback:()=>this.showInPopover(),hotkeys:[]})}async onLayoutReady(){await this.stopEnableList(),await this.initServer(),this.initGlobalManifest(),await this.initMemos(),this.autoOpenMemos(),this.registerThinoWidget(),await this.registerToolbarCheck(),await this.initCaptureService();let e=this.app.workspace.editorSuggest.suggests.findIndex(e=>e.type===`customTag`);e===-1||this.app.workspace.editorSuggest.suggests.splice(e,1),this.app.workspace.editorSuggest.suggests.unshift(new q7(this.app,this)),this.initSuper()}async initSuper(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;!e||e?.appId!==n||B.getState().enabled&&(fv.initialize(this.app,this).then(()=>{let e=B.getState();if(!(!e.wasmReady||!e.modelReady)){if(e.activeEmbeddingProvider===`local`&&f.Platform.isDesktop)return fv.initializeEmbeddingAndIndex().then(()=>B.getState().setEmbeddingReady(!0));e.setEmbeddingReady(!0)}}).catch(e=>console.error(`[MemosPlugin] Super init failed:`,e)),this.register(B.subscribe(e=>e.enabled,e=>{e&&this.initSuper()})))}async initWeChat(){if(!f.Platform.isDesktop||!this.settings.wechat?.enabled)return;let e=L.getState()?.verifyState,t=await Pv();if(!e||e?.appId!==t)return;let{WeChatService:n}=await Promise.resolve().then(()=>(B6(),L6));this.wechatService=new n(this),this.settings.wechat.autoStart&&this.wechatService.start().catch(e=>{console.error(`[MemosPlugin] WeChat auto-start failed:`,e)})}async initMemos(){try{await this.initDailyNotes()}catch(e){console.error(e)}L.getState(),V.getState(),await V.fetchAllMemos()}async initDailyNotes(){this.settings.EnabledLocationList.find(e=>e.value===`DAILY`)&&await L.fechLocalDailyNotes()}registerCanvasNodeMemos(){if(!(0,f.requireApiVersion)(`1.2.0`)||!this.settings.EnabledLocationList.find(e=>e.value===`CANVAS`))return;let e=e=>{clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{setTimeout(async()=>{let n=e.canvas.getData(),r=n.nodes.find(t=>t.id===e.id);if(r&&(t(r),e.canvas.setData(n),V.getMemoById(e.id))){let t=await V.updateMemo(e.id,r.text,r.thinoType);V.editMemo(t)}e.canvas.requestSave(!0)},0)},800)},t=e=>{e.createdAt||=(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),e.updatedAt=(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),e.deletedAt=e.deletedAt?e.deletedAt:``,e.pinned=e.pinned?e.pinned:!1,e.visibility=e.visibility?e.visibility:`PUBLIC`,e.rowStatus=e.rowStatus?e.rowStatus:`NORMAL`,e.thinoType=e.thinoType?e.thinoType:`JOURNAL`,e.hasId=e.hasId?e.hasId:``,e.linkId=e.linkId?e.linkId:``,e.resourceList=[]},n=()=>{let t=this.app.workspace.getLeavesOfType(`canvas`).first()?.view;if(!t||!t?.canvas)return!1;let n=(this.app.workspace.getLeavesOfType(`canvas`).first()?.view).canvas.nodes.values(),r=Array.from(n).filter(e=>e.text!==void 0);if(!r||r.length===0)return!1;let i=r[0].child;if(!i)return!1;let a=AW(i.constructor.prototype,{save:t=>function(...n){t.call(this,...n),this.node.isEditing&&e(this.node)}});return this.register(a),console.log(`Obsidian-Memos: canvas node patched`),!0};this.app.workspace.onLayoutReady(()=>{if(!n()){let e=this.app.workspace.on(`layout-change`,()=>{n()&&this.app.workspace.offref(e)});this.registerEvent(e)}})}registerLinkOpen(){AW(f.Workspace.prototype,{openLinkText:e=>async function(...t){let n=V.getState().memos;if(n.find(e=>e.id===t[0]||e.id===t[1])){let e=n.find(e=>e.id===t[0]||e.id===t[1]);if(e){Bx(e);return}}await e.call(this,...t)}})}registerHoverEvent(){this.registerHoverLinkSource(`thino`,{defaultMod:!0,display:`Thino`})}registerCodeBlocks(){this.registerMarkdownCodeBlockProcessor(`thino`,async(e,t)=>{if(!e)return;let n;try{n=(0,f.parseYaml)(e)}catch(e){console.error(`[Thino] Failed to parse codeblock yaml`,e);return}if(!M7(n)&&!this.app.workspace.getLeavesOfType(`thino_view`)?.length){t.toggleClass([`thino-editor-codeblock`,`view-error`],!0),P7(t,this);return}I7(t,n)})}registerMobileNavbar(){if(!this.settings?.NavbarButton)return;let e=this.app.mobileNavbar;if(!e||e.showThinoBtnEl)return;let t=e.containerEl.find(`.mobile-navbar-actions`).createEl(`div`,{cls:`mobile-navbar-action mod-tappable`});new f.ExtraButtonComponent(t).setIcon(`Memos`).onClick(()=>{document.body.find(`.thino-editor-modal`)||new K7(this.app).open()}),e.showThinoBtnEl=t}updateLayoutSettings(){document.body.toggleClass(`thino-show-status`,!!this.settings.AlwaysShowStatusText)}registerEditorContextMenu(){this.registerEvent(this.app.workspace.on(`editor-menu`,(e,t,n)=>{let r=t.getSelection();if(r.length===0)return;let i={id:`temp-${Date.now()}`,content:r,createdAt:(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),updatedAt:(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),deletedAt:``,pinned:!1,visibility:`PUBLIC`,rowStatus:`NORMAL`,thinoType:`JOURNAL`,hasId:``,linkId:[],resourceList:[],creatorName:`thino`,sourceType:`DAILY`,path:n.file.path,fileInfo:{tags:[],frontmatter:{}}},a=(e,t)=>{e.addItem(e=>{e.setSection(`selection`).setTitle(t+j(`Modern`)).setIcon(`palette`).onClick(async()=>{US(i,`modern`,n)})}).addItem(e=>{e.setSection(`selection`).setTitle(t+j(`Clean`)).setIcon(`palette`).onClick(async()=>{US(i,`clean`,n)})}).addItem(e=>{e.setSection(`selection`).setTitle(t+j(`Minimal`)).setIcon(`palette`).onClick(async()=>{US(i,`minimal`,n)})}).addItem(e=>{e.setSection(`selection`).setTitle(j(`Gradient`)).setIcon(`palette`).onClick(async()=>{US(i,`gradient`,n)})})};f.Platform.isDesktop&&e.addItem(e=>{a(e.setIcon(`Memos`).setSection(`selection`).setTitle(j(`Thino share`)).setSubmenu(),``)}),f.Platform.isMobile&&a(e,j(`Thino share`)+` `)}))}registerRibbon(){this.addRibbonIcon(`Memos`,j(`ribbonIconTitle`),async e=>{if(e.button===2){e.preventDefault();let t=new f.Menu;X9.forEach(e=>{t.addItem(t=>{t.setTitle(e.shortName).setIcon(e.icon).onClick(async()=>{await this.openMemos(e.location,e.cb)})})}),t.showAtMouseEvent(e);return}for(let t=0;t<X9.length;t++){let n=X9[t];if(!n.modKeys){await this.openMemos(n.location,n.cb);break}if(!jee(e))continue;let r=t=>e[`${t}Key`];if(typeof n.modKeys==`string`&&r(n.modKeys)||Array.isArray(n.modKeys)&&n.modKeys.some(r)){await this.openMemos(n.location,n.cb);break}}}),this.addRibbonIcon(`sparkles`,`Thino Super`,()=>this.openSuperSidebar())}registerThinoWidget(){this.registerEditorExtension([Oee(this)])}async registerToolbarCheck(){if(this.loaded)return;let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;!e||e?.appId!==n||(this.registerEditorExtension([D5(this.app)]),this.registerEditorSuggest(new JW(this.app,this)),this.loaded=!0)}async verify(){return m_()&&await this.verifyViaPKMerOAuth()?!0:await this.verifyViaLegacyJWT()}async verifyViaPKMerOAuth(){if(!await this.pkmerAuth.verify())return!1;let e=this.settings.general.userInfo;if(!e?.sub||!e.thino)return!1;let t=``;if(f.Platform.isDesktop)t=await Pv();else{let e=await window.Capacitor.Plugins.Device?.getId();if(!e)return!1;t=e?.identifier||e?.uuid}return L.setVerifyState({appId:t,iss:`pkmer`,type:`thino`,sub:e.sub,method:`oauth`}),!0}async verifyViaLegacyJWT(){let e=``;if(f.Platform.isDesktop)e=await Pv();else{let t=await window.Capacitor.Plugins.Device?.getId();if(!t)return;e=t?.identifier||t?.uuid}let t=this.settings.tokenForVerify[e];if(!t)return L.setVerifyState(null),!1;let n=await hee(`-----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{let{payload:r}=await Tee(t,n),i=JSON.parse(new TextDecoder().decode(r));return!i||i.iss!==`pkmer`||i.type!==`thino`||i.appId!==e?!1:(L.setVerifyState(i),!0)}catch(e){console.error(e)}return!1}async checkVersionAndShowChangeLog(){let e=this.manifest.version;e!==this.settings.LastUpdatedVersion&&(this.settings={...this.settings,LastUpdatedVersion:e},await this.saveSettings(),this.showChangeLog())}async showChangeLog(){await __(this.app)}autoOpenMemos(){this.app.workspace.getLeavesOfType(`thino_view`).length>0||this.settings.MobileAndDesktop===`Mobile`&&f.Platform.isDesktop||this.settings.MobileAndDesktop===`Desktop`&&f.Platform.isMobile||this.settings.OpenMemosAutomatically&&this.openMemos()}async openDailyMemo(){if(this.app.workspace.getLeavesOfType(`thino_view`).length>0){z.setPathname(`/daily`);return}await this.openMemos(),z.setPathname(`/daily`)}async openMemos(e=`center`,t){let n=this.app.workspace;if(n.getLeavesOfType(`thino_view`).length>0){let e=n.getLeavesOfType(MW)[0];return n.setActiveLeaf(e),n.revealLeaf(e),e}n.detachLeavesOfType(MW);let r;switch(e){case`left`:r=n.getLeftLeaf(!1);break;case`right`:r=n.getRightLeaf(!1);break;case`float`:r=n.getLeaf(`window`);break;default:r=n.getLeaf(!0);break}if(r)return await r.setViewState({type:MW}),n.revealLeaf(r),r;let i=r.view.containerEl.querySelector(`textarea`);return i?(i.focus(),r):(t?.(),r)}async openSuperSidebar(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Pv():t?.identifier||t?.uuid;if(!e||e?.appId!==n){kv();return}let r=this.app.workspace,i=r.getLeavesOfType(KB);if(i.length>0){r.revealLeaf(i[0]);return}let a=r.getRightLeaf(!1);await a.setViewState({type:KB,active:!0}),r.revealLeaf(a)}async searchIt(){let e=this.app.workspace,t=e.getLeavesOfType(MW);if(!(t.length>0)){let e=await this.openMemos();setTimeout(()=>{e.view.containerEl.find(`.search-bar-inputer .text-input`).focus(),this.app.workspace.trigger(`focus-on-searchbar`)},300);return}let n=t[0];e.revealLeaf(n),setTimeout(()=>{n.view.containerEl.find(`.search-bar-inputer .text-input`).focus(),this.app.workspace.trigger(`focus-on-searchbar`)},300)}async focusOnEditor(){if(!(this.app.workspace.getLeavesOfType(`thino_view`).length>0)){await this.openMemos();return}this.app.workspace.trigger(`focus-on-textarea`)}changeStatus(){let e=this.app.workspace,t=e.getLeavesOfType(MW);if(!(t.length>0)){new f.Notice(j(`Please Open Memos First`));return}let n=t[0];e.setActiveLeaf(n),n.view.containerEl.querySelector(`.list-or-task`).click()}async showInPopover(){let e=this.app.workspace;if(e.detachLeavesOfType(MW),!this.app.plugins.getPlugin(`obsidian-hover-editor`)){new f.Notice(j(`Please install obsidian-hover-editor plugin first`));return}let t=await this.app.plugins.getPlugin(`obsidian-hover-editor`)?.spawnPopover();t&&(await t.setViewState({type:MW}),e.revealLeaf(t),t.view.containerEl.classList.add(`mobile-view`),this.settings?.FocusOnEditor&&t.view.containerEl.querySelector(`textarea`)!==void 0&&t.view.containerEl.querySelector(`textarea`)?.focus())}},$9=class extends f.Modal{inputEl;callback;constructor(e,t,n){super(e),this.title=t,this.callback=n}onOpen(){let{contentEl:e}=this;this.setTitle(this.title),this.containerEl.toggleClass([`thino-input-dialog`,`thino-bulk-action-dialog`,`tag-actions`],!0),this.inputEl=e.createEl(`input`,{attr:{type:`text`}}),this.inputEl.focus(),new f.Setting(e).addButton(e=>{e.setButtonText(j(`OK`)).onClick(()=>{this.close()})})}onClose(){this.contentEl.empty(),this.callback(this.inputEl.value)}};exports.InputModal=$9,exports.default=Nee,exports.getCurrentDebugInfo=Q9;
|