volute 0.37.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/{chunk-UQFYNZKT.js → chunk-2TR2OPVA.js} +1 -1
  2. package/dist/chunk-JOJT34M2.js +109 -0
  3. package/dist/{chunk-Z6TIXE77.js → chunk-NGXQ2ESO.js} +9 -8
  4. package/dist/{chunk-QQQI6ISK.js → chunk-PLL2FM7A.js} +35 -20
  5. package/dist/{chunk-KBRGHKVU.js → chunk-TEZRVSSB.js} +58 -29
  6. package/dist/{chunk-NYP3LBIV.js → chunk-VUM2K6EN.js} +1 -1
  7. package/dist/cli.js +12 -12
  8. package/dist/{cloud-sync-OIX576NA.js → cloud-sync-PEM3IVI4.js} +8 -8
  9. package/dist/{daemon-restart-L2O6L7NR.js → daemon-restart-6QONRBTK.js} +6 -6
  10. package/dist/daemon.js +146 -76
  11. package/dist/{delivery-manager-4PVBUZJB.js → delivery-manager-IMCRV6A3.js} +5 -5
  12. package/dist/{down-25L2RKCQ.js → down-5XZWH4ZP.js} +2 -2
  13. package/dist/{echo-text-T5ZLGMA7.js → echo-text-ADKLNTIA.js} +6 -6
  14. package/dist/{extensions-CLYXNGYB.js → extensions-P477XR46.js} +5 -5
  15. package/dist/{message-delivery-N2V5APCS.js → message-delivery-54IXVE5H.js} +5 -5
  16. package/dist/{mind-M57ET546.js → mind-G5HDKBKL.js} +2 -2
  17. package/dist/{mind-manager-LS2AIXHQ.js → mind-manager-5G6P2EAT.js} +5 -5
  18. package/dist/{mind-service-UDXF5WC2.js → mind-service-FDATHL6X.js} +5 -5
  19. package/dist/{package-5FGU5QNP.js → package-LYQHSDPG.js} +27 -27
  20. package/dist/{scheduler-NTC74JYH.js → scheduler-ZRUZNQI5.js} +5 -5
  21. package/dist/{seed-55VC3A57.js → seed-3KH4ZRJL.js} +1 -1
  22. package/dist/{seed-cmd-2KOEQZK6.js → seed-cmd-6A76SSAA.js} +2 -2
  23. package/dist/{seed-create-Y2Z5JWBB.js → seed-create-XXRRGZCO.js} +1 -1
  24. package/dist/{seed-sprout-OLSIWXZN.js → seed-sprout-HLMUH2AI.js} +2 -2
  25. package/dist/service-install-AIQBLE6P.js +17 -0
  26. package/dist/setup-NPAZXBIJ.js +454 -0
  27. package/dist/{skills-FDMLJGZ3.js → skills-NVOWS5NY.js} +1 -1
  28. package/dist/{sleep-manager-TQP5ZJI5.js → sleep-manager-VPPQXBPH.js} +5 -5
  29. package/dist/{spirit-SM6ARJ2N.js → spirit-ZFYG4JOH.js} +2 -2
  30. package/dist/{sprout-G6G57IOY.js → sprout-FLBCETYG.js} +1 -1
  31. package/dist/{src-LT6ZBYYX.js → src-6Z4XYDH5.js} +200 -169
  32. package/dist/{system-chat-NNXYCSVL.js → system-chat-YUIT7RA6.js} +5 -5
  33. package/dist/{up-5JXV6BZS.js → up-YRZAEZ3Z.js} +2 -2
  34. package/dist/{version-notify-CSE4NBYM.js → version-notify-764EXVQQ.js} +5 -5
  35. package/dist/web-assets/assets/index-BI7hUTBr.js +73 -0
  36. package/dist/web-assets/assets/index-BJifO9h_.css +1 -0
  37. package/dist/web-assets/index.html +2 -2
  38. package/package.json +27 -27
  39. package/packages/extensions/notes/dist/ui/assets/index-D3cdui42.css +1 -0
  40. package/packages/extensions/notes/dist/ui/assets/index-Dsua7alJ.js +61 -0
  41. package/packages/extensions/notes/dist/ui/index.html +2 -2
  42. package/packages/extensions/pages/dist/ui/assets/index-BM7gRdg7.js +2 -0
  43. package/packages/extensions/pages/dist/ui/assets/index-BcY6lnq4.css +1 -0
  44. package/packages/extensions/pages/dist/ui/index.html +2 -2
  45. package/packages/extensions/plan/dist/ui/assets/index-DWiqtzBv.js +61 -0
  46. package/packages/extensions/plan/dist/ui/assets/index-jIkrt-vI.css +1 -0
  47. package/packages/extensions/plan/dist/ui/index.html +2 -2
  48. package/templates/_base/src/lib/startup.ts +2 -0
  49. package/templates/_base/tsconfig.json +3 -1
  50. package/templates/claude/package.json.tmpl +5 -5
  51. package/templates/claude/src/agent.ts +1 -0
  52. package/templates/codex/package.json.tmpl +4 -4
  53. package/templates/pi/package.json.tmpl +5 -5
  54. package/templates/pi/src/agent.ts +2 -1
  55. package/dist/setup-6Z34JJEB.js +0 -425
  56. package/dist/web-assets/assets/index-B3xLeex8.js +0 -75
  57. package/dist/web-assets/assets/index-Dr4A90Lo.css +0 -1
  58. package/packages/extensions/notes/dist/ui/assets/index-8jWEv9SA.js +0 -61
  59. package/packages/extensions/notes/dist/ui/assets/index-DkaB7Ytd.css +0 -1
  60. package/packages/extensions/pages/dist/ui/assets/index-D0HyS-xQ.css +0 -1
  61. package/packages/extensions/pages/dist/ui/assets/index-DKZLNMED.js +0 -2
  62. package/packages/extensions/plan/dist/ui/assets/index-CJj2gZnZ.css +0 -1
  63. package/packages/extensions/plan/dist/ui/assets/index-FMEJmvQz.js +0 -61
  64. package/dist/{chat-5Y4FD77E.js → chat-XL7CVWVJ.js} +0 -0
  65. package/dist/{chunk-MQRS4J24.js → chunk-LN67VPZJ.js} +3 -3
  66. package/dist/{service-YMHWPDXW.js → service-RH6Q2XWR.js} +4 -4
  67. package/dist/{status-MC2P7DBG.js → status-TGOKAFW3.js} +4 -4
  68. package/dist/{update-UOP2INF2.js → update-ZCTQ6UGY.js} +4 -4
@@ -0,0 +1,61 @@
1
+ (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible,d=()=>{};function f(e){for(var t=0;t<e.length;t++)e[t]()}function p(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var m=1024,h=2048,g=4096,_=8192,v=16384,y=32768,b=1<<25,x=65536,S=1<<19,ee=1<<20,te=1<<25,ne=65536,re=1<<21,C=1<<22,ie=1<<23,ae=Symbol(`$state`),oe=Symbol(`legacy props`),se=Symbol(``),ce=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},le=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ue(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function de(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function fe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function w(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function pe(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function T(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function me(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function E(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function he(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function ge(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function _e(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ve(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var ye={},D=Symbol(),be=`http://www.w3.org/1999/xhtml`,xe=`http://www.w3.org/2000/svg`,Se=`http://www.w3.org/1998/Math/MathML`;function Ce(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function we(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var O=!1;function Te(e){O=e}var k;function A(e){if(e===null)throw Ce(),ye;return k=e}function Ee(){return A(Xt(k))}function j(e){if(O){if(Xt(k)!==null)throw Ce(),ye;k=e}}function De(e=1){if(O){for(var t=e,n=k;t--;)n=Xt(n);k=n}}function Oe(e=!0){for(var t=0,n=k;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Xt(n);e&&n.remove(),n=i}}function ke(e){if(!e||e.nodeType!==8)throw Ce(),ye;return e.data}function Ae(e){return e===this.v}function je(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Me(e){return!je(e,this.v)}var Ne=!1,Pe=!1,M=null;function Fe(e){M=e}function Ie(e,t=!1,n){M={p:M,i:!1,c:null,e:null,s:e,x:null,r:W,l:Pe&&!t?{s:null,u:null,$:[]}:null}}function N(e){var t=M,n=t.e;if(n!==null){t.e=null;for(var r of n)mn(r)}return e!==void 0&&(t.x=e),t.i=!0,M=t.p,e??{}}function Le(){return!Pe||M!==null&&M.l===null}var Re=[];function ze(){var e=Re;Re=[],f(e)}function Be(e){if(Re.length===0&&!$e){var t=Re;queueMicrotask(()=>{t===Re&&ze()})}Re.push(e)}function Ve(){for(;Re.length>0;)ze()}function He(e){var t=W;if(t===null)return U.f|=ie,e;if(!(t.f&32768)&&!(t.f&4))throw e;Ue(e,t)}function Ue(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var We=~(h|g|m);function P(e,t){e.f=e.f&We|t}function F(e){e.f&512||e.deps===null?P(e,m):P(e,g)}function Ge(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ne,Ge(t.deps))}function Ke(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Ge(e.deps),P(e,m)}var qe=!1,Je=!1;function Ye(e){var t=Je;try{return Je=!1,[e(),Je]}finally{Je=t}}var Xe=new Set,I=null,Ze=null,L=null,Qe=null,$e=!1,et=!1,tt=null,nt=null,rt=0,it=1,at=class e{id=it++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=[];#s=new Set;#c=new Set;#l=new Map;is_fork=!1;#u=!1;#d=new Set;#f(){return this.is_fork||this.#r.size>0}#p(){for(let n of this.#d)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#l.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#l.get(e);if(t){this.#l.delete(e);for(var n of t.d)P(n,h),this.schedule(n);for(n of t.m)P(n,g),this.schedule(n)}}#m(){if(rt++>1e3&&(Xe.delete(this),st()),!this.#f()){for(let e of this.#s)this.#c.delete(e),P(e,h),this.schedule(e);for(let e of this.#c)P(e,g),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=tt=[],r=[],i=nt=[];for(let e of t)try{this.#h(e,n,r)}catch(t){throw mt(e),t}if(I=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(tt=null,nt=null,this.#f()||this.#p()){this.#g(r),this.#g(n);for(let[e,t]of this.#l)pt(e,t)}else{this.#n.size===0&&Xe.delete(this),this.#s.clear(),this.#c.clear();for(let e of this.#e)e(this);this.#e.clear(),Ze=this,lt(r),lt(n),Ze=null,this.#i?.resolve()}var o=I;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(Xe.add(o),o.#m()),Xe.has(this)||this.#_()}#h(e,t,n){e.f^=m;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#l.has(r))&&r.fn!==null){a?r.f^=m:i&4?t.push(r):Ne&&i&16777224?n.push(r):Yn(r)&&(i&16&&this.#c.add(r),er(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#g(e){for(var t=0;t<e.length;t+=1)Ke(e[t],this.#s,this.#c)}capture(e,t,n=!1){t!==D&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,[e.v,n]),L?.set(e,e.v))}activate(){I=this}deactivate(){I=null,L=null}flush(){try{et=!0,I=this,this.#m()}finally{rt=0,Qe=null,tt=null,nt=null,et=!1,I=null,L=null,Pt.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),Xe.delete(this)}register_created_effect(e){this.#o.push(e)}#_(){for(let l of Xe){var e=l.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(l.current.has(r)){var n=l.current.get(r)[0];if(e&&i!==n)l.current.set(r,[i,a]);else continue}t.push(r)}var r=[...l.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){l.activate();var i=new Set,a=new Map;for(var o of t)ut(o,r,i,a);a=new Map;var s=[...l.current.keys()].filter(e=>this.current.has(e)?this.current.get(e)[0]!==e:!0);for(let e of this.#o)!(e.f&155648)&&dt(e,s,a)&&(e.f&4194320?(P(e,h),l.schedule(e)):l.#s.add(e));if(l.#a.length>0){l.apply();for(var c of l.#a)l.#h(c,[],[]);l.#a=[]}l.deactivate()}}for(let e of Xe)e.#d.has(this)&&(e.#d.delete(this),e.#d.size===0&&!e.#f()&&(e.activate(),e.#m()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#u||n||(this.#u=!0,Be(()=>{this.#u=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#s.add(t);for(let e of t)this.#c.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=p()).promise}static ensure(){if(I===null){let t=I=new e;et||(Xe.add(I),$e||Be(()=>{I===t&&t.flush()}))}return I}apply(){if(!Ne||!this.is_fork&&Xe.size===1){L=null;return}L=new Map;for(let[e,[t]]of this.current)L.set(e,t);for(let n of Xe)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#d.add(n);else for(let[e,t]of n.previous)L.has(e)||L.set(e,t)}}schedule(e){if(Qe=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(tt!==null&&t===W&&(Ne||(U===null||!(U.f&2))&&!qe))return;if(n&96){if(!(n&1024))return;t.f^=m}}this.#a.push(t)}};function ot(e){var t=$e;$e=!0;try{var n;for(e&&(I!==null&&!I.is_fork&&I.flush(),n=e());;){if(Ve(),I===null)return n;I.flush()}}finally{$e=t}}function st(){try{me()}catch(e){Ue(e,Qe)}}var ct=null;function lt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Yn(r)&&(ct=new Set,er(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Tn(r),ct?.size>0)){Pt.clear();for(let e of ct){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)ct.has(n)&&(ct.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||er(n)}}ct.clear()}}ct=null}}function ut(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?ut(i,t,n,r):e&4194320&&!(e&2048)&&dt(i,t,r)&&(P(i,h),ft(i))}}function dt(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&dt(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function ft(e){I.schedule(e)}function pt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),P(e,m);for(var n=e.first;n!==null;)pt(n,t),n=n.next}}function mt(e){P(e,m);for(var t=e.first;t!==null;)mt(t),t=t.next}function ht(e){let t=0,n=It(0),r;return()=>{dn()&&(G(n),_n(()=>(t===0&&(r=ir(()=>e(()=>Bt(n)))),t+=1,()=>{Be(()=>{--t,t===0&&(r?.(),r=void 0,Bt(n))})})))}}var gt=x|S;function _t(e,t,n,r){new vt(e,t,n,r)}var vt=class{parent;is_pending=!1;transform_error;#e;#t=O?k:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=ht(()=>(this.#m=It(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=W;t.b=this,t.f|=128,n(e)},this.parent=W.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=vn(()=>{if(O){let e=this.#t;Ee();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},gt),O&&(this.#e=k)}#g(){try{this.#a=yn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=yn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=yn(()=>e(this.#e)),Be(()=>{var e=this.#c=document.createDocumentFragment(),t=Jt();e.append(t),this.#a=this.#x(()=>yn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,En(this.#o,()=>{this.#o=null}),this.#b(I))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=yn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();An(this.#a,e);let t=this.#n.pending;this.#o=yn(()=>t(this.#e))}else this.#b(I)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Ke(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=W,n=U,r=M;Ln(this.#i),In(this.#i),Fe(this.#i.ctx);try{return at.ensure(),e()}catch(e){return He(e),null}finally{Ln(t),In(n),Fe(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&En(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Be(()=>{this.#d=!1,this.#m&&Rt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),G(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(Cn(this.#a),null),this.#o&&=(Cn(this.#o),null),this.#s&&=(Cn(this.#s),null),O&&(A(this.#t),De(),A(Oe()));var r=!1,i=!1;let a=()=>{if(r){we();return}r=!0,i&&ve(),this.#s!==null&&En(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){Ue(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return yn(()=>{var t=W;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return Ue(e,this.#i.parent),null}}))};Be(()=>{var t;try{t=this.transform_error(e)}catch(e){Ue(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>Ue(e,this.#i&&this.#i.parent)):o(t)})}};function yt(e,t,n,r){let i=Le()?Ct:Et;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=W,s=bt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||Ue(e,o)}xt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=St();function d(){Promise.all(n.map(e=>wt(e))).then(e=>l([...t.map(i),...e])).catch(e=>Ue(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),xt()}):d()}function bt(){var e=W,t=U,n=M,r=I;return function(i=!0){Ln(e),In(t),Fe(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function xt(e=!0){Ln(null),In(null),Fe(null),e&&I?.deactivate()}function St(){var e=W,t=e.b,n=I,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function Ct(e){var t=2|h,n=U!==null&&U.f&2?U:null;return W!==null&&(W.f|=S),{ctx:M,deps:null,effects:null,equals:Ae,f:t,fn:e,reactions:null,rv:0,v:D,wv:0,parent:n??W,ac:null}}function wt(e,t,n){let r=W;r===null&&de();var i=void 0,a=It(D),o=!U,s=new Map;return gn(()=>{var t=W,n=p();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(xt)}catch(e){n.reject(e),xt()}var c=I;if(o){if(t.f&32768)var l=St();if(r.b.is_rendered())s.get(c)?.reject(ce),s.delete(c);else{for(let e of s.values())e.reject(ce);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===ce),!(n===ce||t.f&16384)){if(c.activate(),n)a.f|=ie,Rt(a,n);else{a.f&8388608&&(a.f^=ie),Rt(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(ce)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),fn(()=>{for(let e of s.values())e.reject(ce)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function Tt(e){let t=Ct(e);return Ne||zn(t),t}function Et(e){let t=Ct(e);return t.equals=Me,t}function Dt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Cn(t[n])}}function Ot(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function kt(e){var t,n=W;Ln(Ot(e));try{e.f&=~ne,Dt(e),t=Zn(e)}finally{Ln(n)}return t}function At(e){var t=e.v,n=kt(e);if(!e.equals(n)&&(e.wv=Jn(),(!I?.is_fork||e.deps===null)&&(e.v=n,I?.capture(e,t,!0),e.deps===null))){P(e,m);return}Nn||(L===null?F(e):(dn()||I?.is_fork)&&L.set(e,n))}function jt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(ce),t.teardown=d,t.ac=null,$n(t,0),xn(t))}function Mt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&er(t)}var Nt=new Set,Pt=new Map,Ft=!1;function It(e,t){return{f:0,v:e,reactions:null,equals:Ae,rv:0,wv:0}}function R(e,t){let n=It(e,t);return zn(n),n}function Lt(e,t=!1,n=!0){let r=It(e);return t||(r.equals=Me),Pe&&n&&M!==null&&M.l!==null&&(M.l.s??=[]).push(r),r}function z(e,t,r=!1){return U!==null&&(!Fn||U.f&131072)&&Le()&&U.f&4325394&&(Rn===null||!n.call(Rn,e))&&_e(),Rt(e,r?Ht(t):t,nt)}function Rt(e,t,n=null){if(!e.equals(t)){var r=e.v;Nn?Pt.set(e,t):Pt.set(e,r),e.v=t;var i=at.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&kt(t),L===null&&F(t)}e.wv=Jn(),Vt(e,h,n),Le()&&W!==null&&W.f&1024&&!(W.f&96)&&(Hn===null?Un([e]):Hn.push(e)),!i.is_fork&&Nt.size>0&&!Ft&&zt()}return t}function zt(){Ft=!1;for(let e of Nt)e.f&1024&&P(e,g),Yn(e)&&er(e);Nt.clear()}function Bt(e){z(e,e.v+1)}function Vt(e,t,n){var r=e.reactions;if(r!==null)for(var i=Le(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===W)){var l=(c&h)===0;if(l&&P(s,t),c&2){var u=s;L?.delete(u),c&65536||(c&512&&(s.f|=ne),Vt(u,g,n))}else if(l){var d=s;c&16&&ct!==null&&ct.add(d),n===null?ft(d):n.push(d)}}}}function Ht(t){if(typeof t!=`object`||!t||ae in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=R(0),u=null,d=Kn,f=e=>{if(Kn===d)return e();var t=U,n=Kn;In(null),qn(d);var r=e();return In(t),qn(n),r};return i&&r.set(`length`,R(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&he();var i=r.get(t);return i===void 0?f(()=>{var e=R(n.value,u);return r.set(t,e),e}):z(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>R(D,u));r.set(t,e),Bt(o)}}else z(n,D),Bt(o);return!0},get(e,n,i){if(n===ae)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>R(Ht(s?e[n]:D),u)),r.set(n,o)),o!==void 0){var c=G(o);return c===D?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=G(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==D)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===ae)return!0;var n=r.get(t),i=n!==void 0&&n.v!==D||Reflect.has(e,t);return(n!==void 0||W!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>R(i?Ht(e[t]):D,u)),r.set(t,n)),G(n)===D)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>R(D,u)),r.set(d+``,p)):z(p,D)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>R(void 0,u)),z(c,Ht(n)),r.set(t,c));else{l=c.v!==D;var m=f(()=>Ht(n));z(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&z(g,_+1)}Bt(o)}return!0},ownKeys(e){G(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==D});for(var[n,i]of r)i.v!==D&&!(n in e)&&t.push(n);return t},setPrototypeOf(){ge()}})}var Ut,Wt,Gt,Kt;function qt(){if(Ut===void 0){Ut=window,Wt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Gt=a(t,`firstChild`).get,Kt=a(t,`nextSibling`).get,u(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),u(n)&&(n.__t=void 0)}}function Jt(e=``){return document.createTextNode(e)}function Yt(e){return Gt.call(e)}function Xt(e){return Kt.call(e)}function B(e,t){if(!O)return Yt(e);var n=Yt(k);if(n===null)n=k.appendChild(Jt());else if(t&&n.nodeType!==3){var r=Jt();return n?.before(r),A(r),r}return t&&tn(n),A(n),n}function Zt(e,t=!1){if(!O){var n=Yt(e);return n instanceof Comment&&n.data===``?Xt(n):n}if(t){if(k?.nodeType!==3){var r=Jt();return k?.before(r),A(r),r}tn(k)}return k}function V(e,t=1,n=!1){let r=O?k:e;for(var i;t--;)i=r,r=Xt(r);if(!O)return r;if(n){if(r?.nodeType!==3){var a=Jt();return r===null?i?.after(a):r.before(a),A(a),a}tn(r)}return A(r),r}function Qt(e){e.textContent=``}function $t(){return!Ne||ct!==null?!1:(W.f&y)!==0}function en(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function tn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function nn(e){O&&Yt(e)!==null&&Qt(e)}var rn=!1;function an(){rn||(rn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function on(e){var t=U,n=W;In(null),Ln(null);try{return e()}finally{In(t),Ln(n)}}function sn(e,t,n,r=n){e.addEventListener(t,()=>on(n));let i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),an()}function cn(e){W===null&&(U===null&&T(e),pe()),Nn&&w(e)}function ln(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function un(e,t){var n=W;n!==null&&n.f&8192&&(e|=_);var r={ctx:M,deps:null,nodes:null,f:e|h|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};I?.register_created_effect(r);var i=r;if(e&4)tt===null?at.ensure().schedule(r):tt.push(r);else if(t!==null){try{er(r)}catch(e){throw Cn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=x))}if(i!==null&&(i.parent=n,n!==null&&ln(i,n),U!==null&&U.f&2&&!(e&64))){var a=U;(a.effects??=[]).push(i)}return r}function dn(){return U!==null&&!Fn}function fn(e){let t=un(8,null);return P(t,m),t.teardown=e,t}function pn(e){cn(`$effect`);var t=W.f;if(!U&&t&32&&!(t&32768)){var n=M;(n.e??=[]).push(e)}else return mn(e)}function mn(e){return un(4|ee,e)}function hn(e){at.ensure();let t=un(64|S,e);return(e={})=>new Promise(n=>{e.outro?En(t,()=>{Cn(t),n(void 0)}):(Cn(t),n(void 0))})}function gn(e){return un(C|S,e)}function _n(e,t=0){return un(8|t,e)}function H(e,t=[],n=[],r=[]){yt(r,t,n,t=>{un(8,()=>e(...t.map(G)))})}function vn(e,t=0){return un(16|t,e)}function yn(e){return un(32|S,e)}function bn(e){var t=e.teardown;if(t!==null){let e=Nn,n=U;Pn(!0),In(null);try{t.call(null)}finally{Pn(e),In(n)}}}function xn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&on(()=>{e.abort(ce)});var r=n.next;n.f&64?n.parent=null:Cn(n,t),n=r}}function Sn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Cn(t),t=n}}function Cn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(wn(e.nodes.start,e.nodes.end),n=!0),P(e,b),xn(e,t&&!n),$n(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();bn(e),e.f^=b,e.f|=v;var i=e.parent;i!==null&&i.first!==null&&Tn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function wn(e,t){for(;e!==null;){var n=e===t?null:Xt(e);e.remove(),e=n}}function Tn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function En(e,t,n=!0){var r=[];Dn(e,r,!0);var i=()=>{n&&Cn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Dn(e,t,n){if(!(e.f&8192)){e.f^=_;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Dn(i,t,o?n:!1),i=a}}}function On(e){kn(e,!0)}function kn(e,t){if(e.f&8192){e.f^=_,e.f&1024||(P(e,h),at.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;kn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function An(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Xt(n);t.append(n),n=i}}var jn=null,Mn=!1,Nn=!1;function Pn(e){Nn=e}var U=null,Fn=!1;function In(e){U=e}var W=null;function Ln(e){W=e}var Rn=null;function zn(e){U!==null&&(!Ne||U.f&2)&&(Rn===null?Rn=[e]:Rn.push(e))}var Bn=null,Vn=0,Hn=null;function Un(e){Hn=e}var Wn=1,Gn=0,Kn=Gn;function qn(e){Kn=e}function Jn(){return++Wn}function Yn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ne),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Yn(a)&&At(a),a.wv>e.wv)return!0}t&512&&L===null&&P(e,m)}return!1}function Xn(e,t,r=!0){var i=e.reactions;if(i!==null&&!(!Ne&&Rn!==null&&n.call(Rn,e)))for(var a=0;a<i.length;a++){var o=i[a];o.f&2?Xn(o,t,!1):t===o&&(r?P(o,h):o.f&1024&&P(o,g),ft(o))}}function Zn(e){var t=Bn,n=Vn,r=Hn,i=U,a=Rn,o=M,s=Fn,c=Kn,l=e.f;Bn=null,Vn=0,Hn=null,U=l&96?null:e,Rn=null,Fe(e.ctx),Fn=!1,Kn=++Gn,e.ac!==null&&(on(()=>{e.ac.abort(ce)}),e.ac=null);try{e.f|=re;var u=e.fn,d=u();e.f|=y;var f=e.deps,p=I?.is_fork;if(Bn!==null){var m;if(p||$n(e,Vn),f!==null&&Vn>0)for(f.length=Vn+Bn.length,m=0;m<Bn.length;m++)f[Vn+m]=Bn[m];else e.deps=f=Bn;if(dn()&&e.f&512)for(m=Vn;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&Vn<f.length&&($n(e,Vn),f.length=Vn);if(Le()&&Hn!==null&&!Fn&&f!==null&&!(e.f&6146))for(m=0;m<Hn.length;m++)Xn(Hn[m],e);if(i!==null&&i!==e){if(Gn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Gn;if(t!==null)for(let e of t)e.rv=Gn;Hn!==null&&(r===null?r=Hn:r.push(...Hn))}return e.f&8388608&&(e.f^=ie),d}catch(e){return He(e)}finally{e.f^=re,Bn=t,Vn=n,Hn=r,U=i,Rn=a,Fe(o),Fn=s,Kn=c}}function Qn(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(Bn===null||!n.call(Bn,r))){var s=r;s.f&512&&(s.f^=512,s.f&=~ne),F(s),jt(s),$n(s,0)}}function $n(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Qn(e,n[r])}function er(e){var t=e.f;if(!(t&16384)){P(e,m);var n=W,r=Mn;W=e,Mn=!0;try{t&16777232?Sn(e):xn(e),bn(e);var i=Zn(e);e.teardown=typeof i==`function`?i:null,e.wv=Wn}finally{Mn=r,W=n}}}async function tr(){if(Ne)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),ot()}function G(e){var t=(e.f&2)!=0;if(jn?.add(e),U!==null&&!Fn&&!(W!==null&&W.f&16384)&&(Rn===null||!n.call(Rn,e))){var r=U.deps;if(U.f&2097152)e.rv<Gn&&(e.rv=Gn,Bn===null&&r!==null&&r[Vn]===e?Vn++:Bn===null?Bn=[e]:Bn.push(e));else{(U.deps??=[]).push(e);var i=e.reactions;i===null?e.reactions=[U]:n.call(i,U)||i.push(U)}}if(Nn&&Pt.has(e))return Pt.get(e);if(t){var a=e;if(Nn){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||rr(a))&&(o=kt(a)),Pt.set(a,o),o}var s=(a.f&512)==0&&!Fn&&U!==null&&(Mn||(U.f&512)!=0),c=(a.f&y)===0;Yn(a)&&(s&&(a.f|=512),At(a)),s&&!c&&(Mt(a),nr(a))}if(L?.has(e))return L.get(e);if(e.f&8388608)throw e.v;return e.v}function nr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Mt(t),nr(t))}function rr(e){if(e.v===D)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Pt.has(t)||t.f&2&&rr(t))return!0;return!1}function ir(e){var t=Fn;try{return Fn=!0,e()}finally{Fn=t}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var ar=[`touchstart`,`touchmove`];function or(e){return ar.includes(e)}var sr=Symbol(`events`),cr=new Set,lr=new Set;function ur(e,t,n,r={}){function i(e){if(r.capture||hr.call(t,e),!e.cancelBubble)return on(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?Be(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function dr(e,t,n,r,i){var a={capture:r,passive:i},o=ur(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&fn(()=>{t.removeEventListener(e,o,a)})}function fr(e,t,n){(t[sr]??={})[e]=n}function pr(e){for(var t=0;t<e.length;t++)cr.add(e[t]);for(var n of lr)n(e)}var mr=null;function hr(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;mr=e;var s=0,c=mr===e&&e[sr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[sr]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=U,f=W;In(null),Ln(null);try{for(var p,m=[];o!==null;){var h=o.assignedSlot||o.parentNode||o.host||null;try{var g=o[sr]?.[r];g!=null&&(!o.disabled||e.target===o)&&g.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;o=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[sr]=t,delete e.currentTarget,In(d),Ln(f)}}}var gr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function _r(e){return gr?.createHTML(e)??e}function vr(e){var t=en(`template`);return t.innerHTML=_r(e.replaceAll(`<!>`,`<!---->`)),t.content}function yr(e,t){var n=W;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function K(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(O)return yr(k,null),k;i===void 0&&(i=vr(a?e:`<!>`+e),n||(i=Yt(i)));var t=r||Wt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Yt(t),s=t.lastChild;yr(o,s)}else yr(t,t);return t}}function br(){if(O)return yr(k,null),k;var e=document.createDocumentFragment(),t=document.createComment(``),n=Jt();return e.append(t,n),yr(t,n),e}function q(e,t){if(O){var n=W;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=k),Ee();return}e!==null&&e.before(t)}function J(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function xr(e,t){return Cr(e,t)}var Sr=new Map;function Cr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){qt();var l=void 0,u=hn(()=>{var s=n??t.appendChild(Jt());_t(s,{pending:()=>{}},t=>{Ie({});var n=M;if(o&&(n.c=o),a&&(i.$$events=a),O&&yr(t,null),l=e(t,i)||{},O&&(W.nodes.end=k,k===null||k.nodeType!==8||k.data!==`]`))throw Ce(),ye;N()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=or(r);for(let e of[t,document]){var a=Sr.get(e);a===void 0&&(a=new Map,Sr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,hr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(cr)),lr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=Sr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,hr),r.delete(e),r.size===0&&Sr.delete(n)):r.set(e,i)}lr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return wr.set(l,u),l}var wr=new WeakMap,Tr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)On(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Cn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();An(r,t),t.append(Jt()),this.#n.set(e,{effect:r,fragment:t})}else Cn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),En(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Cn(n.effect),this.#n.delete(e))};ensure(e,t){var n=I,r=$t();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Jt();i.append(a),this.#n.set(e,{effect:yn(()=>t(a)),fragment:i})}else this.#t.set(e,yn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else O&&(this.anchor=k),this.#a(n)}};function Y(e,t,n=!1){var r;O&&(r=k,Ee());var i=new Tr(e),a=n?x:0;function o(e,t){if(O){var n=ke(r);if(e!==parseInt(n.substring(1))){var a=Oe();A(a),i.anchor=a,Te(!1),i.ensure(e,t),Te(!0);return}}i.ensure(e,t)}vn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Er(e,t){return t}function Dr(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];En(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;Or(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=i.length===0&&n!==null;if(l){var u=n,d=u.parentNode;Qt(d),d.append(u),e.items.clear()}Or(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Or(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=te,An(a,document.createDocumentFragment())):Cn(t[i],n)}}var kr;function Ar(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=O?A(Yt(u)):u.appendChild(Jt())}O&&Ee();var d=null,f=Et(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,Mr(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=te,Pr(d,null,c)):On(d):En(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:vn(()=>{p=G(f);var e=p.length;let t=!1;O&&ke(c)===`[!`!=(e===0)&&(c=Oe(),A(c),Te(!1),t=!0);for(var r=new Set,u=I,v=$t(),y=0;y<e;y+=1){O&&k.nodeType===8&&k.data===`]`&&(c=k,t=!0,Te(!1));var b=p[y],x=a(b,y),S=h?null:l.get(x);S?(S.v&&Rt(S.v,b),S.i&&Rt(S.i,y),v&&u.unskip_effect(S.e)):(S=Nr(l,h?c:kr??=Jt(),b,x,y,o,n,i),h||(S.e.f|=te),l.set(x,S)),r.add(x)}if(e===0&&s&&!d&&(h?d=yn(()=>s(c)):(d=yn(()=>s(kr??=Jt())),d.f|=te)),e>r.size&&fe(``,``,``),O&&e>0&&A(Oe()),!h)if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);t&&Te(!0),G(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,O&&(c=k)}function jr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Mr(e,t,n,i,a){var o=(i&8)!=0,s=t.length,c=e.items,l=jr(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(On(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=te,_===l)Pr(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Fr(e,d,_),Fr(e,_,y),Pr(_,y,n),d=_,p=[],m=[],l=jr(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],ee=p[p.length-1];for(x=0;x<p.length;x+=1)Pr(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);Fr(e,S.prev,ee.next),Fr(e,d,S),Fr(e,ee,b),l=b,d=ee,--v,p=[],m=[]}else u.delete(_),Pr(_,l,n),Fr(e,_.prev,_.next),Fr(e,_,d===null?e.effect.first:d.next),Fr(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=jr(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=jr(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Or(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var ne=[];if(u!==void 0)for(_ of u)_.f&8192||ne.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&ne.push(l),l=jr(l.next);var re=ne.length;if(re>0){var C=i&4&&s===0?n:null;if(o){for(v=0;v<re;v+=1)ne[v].nodes?.a?.measure();for(v=0;v<re;v+=1)ne[v].nodes?.a?.fix()}Dr(e,ne,C)}}o&&Be(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Nr(e,t,n,r,i,a,o,s){var c=o&1?o&16?It(n):Lt(n,!1,!1):null,l=o&2?It(i):null;return{v:c,i:l,e:yn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Pr(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Xt(r);if(a.before(r),r===i)return;r=o}}function Fr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ir(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;O&&(o=A(Yt(c)))}H(()=>{var e=W;if(s===(s=t()??``)){O&&Ee();return}if(n&&!O){e.nodes=null,c.innerHTML=s,s!==``&&yr(Yt(c),c.lastChild);return}if(e.nodes!==null&&(wn(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(O){for(var a=k.data,l=Ee(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=Xt(l);if(l===null)throw Ce(),ye;yr(k,u),o=A(l);return}var d=en(r?`svg`:i?`math`:`template`,r?xe:i?Se:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(yr(Yt(f),f.lastChild),r||i)for(;Yt(f);)o.before(Yt(f));else o.before(f)}})}var Lr=[...`
2
+ \r\f\xA0\v`];function Rr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Lr.includes(r[o-1]))&&(s===r.length||Lr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function zr(e,t,n,r,i,a){var o=e.__className;if(O||o!==n||o===void 0){var s=Rr(n,r,a);(!O||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}var Br=Symbol(`is custom element`),Vr=Symbol(`is html`),Hr=le?`link`:`LINK`;function Ur(e){if(O){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Wr(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Wr(e,`checked`,null),e.checked=r}}};e.__on_r=n,Be(n),an()}}function Wr(e,t,n,r){var i=Gr(e);O&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Hr)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[se]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&qr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Gr(e){return e.__attributes??={[Br]:e.nodeName.includes(`-`),[Vr]:e.namespaceURI===be}}var Kr=new Map;function qr(e){var t=e.getAttribute(`is`)||e.nodeName,n=Kr.get(t);if(n)return n;Kr.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&n.push(s);i=l(i)}return n}function Jr(e,t,n=t){var r=new WeakSet;sn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Yr(e)?Xr(a):a,n(a),I!==null&&r.add(I),await tr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(O&&e.defaultValue!==e.value||ir(t)==null&&e.value)&&(n(Yr(e)?Xr(e.value):e.value),I!==null&&r.add(I)),_n(()=>{var n=t();if(e===document.activeElement){var i=Ne?Ze:I;if(r.has(i))return}Yr(e)&&n===Xr(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function Yr(e){var t=e.type;return t===`number`||t===`range`}function Xr(e){return e===``?null:+e}function Zr(e,t,n,r){var i=!Pe||(n&2)!=0,o=(n&8)!=0,s=(n&16)!=0,c=r,l=!0,u=()=>(l&&(l=!1,c=s?ir(r):r),c);let d;if(o){var f=ae in e||oe in e;d=a(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;o?[p,m]=Ye(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&E(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?Ct:Et)(()=>(_=!1,h()));o&&G(v);var y=W;return(function(e,t){if(arguments.length>0){let n=t?G(v):i&&o?Ht(e):e;return z(v,n),_=!0,c!==void 0&&(c=n),e}return Nn&&_||y.f&16384?v.v:G(v)})}function Qr(e){M===null&&ue(`onMount`),Pe&&M.l!==null?$r(M).m.push(e):pn(()=>{let t=ir(e);if(typeof t==`function`)return t})}function $r(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var ei=`/api/ext/notes`;async function ti(e){let t=new URLSearchParams;e?.author&&t.set(`author`,e.author),e?.limit&&t.set(`limit`,String(e.limit)),e?.offset&&t.set(`offset`,String(e.offset));let n=t.toString(),r=await fetch(`${ei}${n?`?${n}`:``}`);if(!r.ok)throw Error(`Failed to load notes`);return r.json()}async function ni(e,t){let n=await fetch(`${ei}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`);if(n.status===404)return null;if(!n.ok)throw Error(`Failed to load note (${n.status})`);return n.json()}async function ri(e,t){let n=await fetch(ei,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:e,content:t})});if(!n.ok)throw Error(`Failed to create note`);return n.json()}async function ii(e,t,n){let r=await fetch(`${ei}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:n})});if(!r.ok)throw Error(`Failed to add comment (${r.status})`)}async function ai(e,t,n){let r=await fetch(`${ei}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/comments/${n}`,{method:`DELETE`});if(!r.ok)throw Error(`Failed to delete comment (${r.status})`)}async function oi(e,t,n){if(!(await fetch(`${ei}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/reactions`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({emoji:n})})).ok)throw Error(`Failed to toggle reaction`)}async function si(){try{let e=await fetch(`/api/auth/me`);if(!e.ok)return console.warn(`Failed to fetch current user: HTTP ${e.status}`),{username:``,avatarUrl:null};let t=await e.json();return{username:t?.username??``,avatarUrl:t?.avatar?`/api/auth/avatars/${encodeURIComponent(t.avatar)}`:null}}catch(e){return console.warn(`Failed to fetch current user:`,e),{username:``,avatarUrl:null}}}var{entries:ci,setPrototypeOf:li,isFrozen:ui,getPrototypeOf:di,getOwnPropertyDescriptor:fi}=Object,{freeze:pi,seal:mi,create:hi}=Object,{apply:gi,construct:_i}=typeof Reflect<`u`&&Reflect;pi||=function(e){return e},mi||=function(e){return e},gi||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},_i||=function(e){return new e(...[...arguments].slice(1))};var vi=ji(Array.prototype.forEach),yi=ji(Array.prototype.lastIndexOf),bi=ji(Array.prototype.pop),xi=ji(Array.prototype.push),Si=ji(Array.prototype.splice),Ci=ji(String.prototype.toLowerCase),wi=ji(String.prototype.toString),Ti=ji(String.prototype.match),Ei=ji(String.prototype.replace),Di=ji(String.prototype.indexOf),Oi=ji(String.prototype.trim),ki=ji(Object.prototype.hasOwnProperty),X=ji(RegExp.prototype.test),Ai=Mi(TypeError);function ji(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return gi(e,t,n)}}function Mi(e){return function(){return _i(e,[...arguments])}}function Z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ci;li&&li(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ui(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ni(e){for(let t=0;t<e.length;t++)ki(e,t)||(e[t]=null);return e}function Pi(e){let t=hi(null);for(let[n,r]of ci(e))ki(e,n)&&(Array.isArray(r)?t[n]=Ni(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=Pi(r):t[n]=r);return t}function Fi(e,t){for(;e!==null;){let n=fi(e,t);if(n){if(n.get)return ji(n.get);if(typeof n.value==`function`)return ji(n.value)}e=di(e)}function n(){return null}return n}var Ii=pi(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Li=pi(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ri=pi([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),zi=pi([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Bi=pi(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Vi=pi([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Hi=pi([`#text`]),Ui=pi(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),Wi=pi(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Gi=pi(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Ki=pi([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),qi=mi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ji=mi(/<%[\w\W]*|[\w\W]*%>/gm),Yi=mi(/\$\{[\w\W]*/gm),Xi=mi(/^data-[\-\w.\u00B7-\uFFFF]+$/),Zi=mi(/^aria-[\-\w]+$/),Qi=mi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$i=mi(/^(?:\w+script|data):/i),ea=mi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ta=mi(/^html$/i),na=mi(/^[a-z][.\w]*(-[.\w]+)+$/i),ra=Object.freeze({__proto__:null,ARIA_ATTR:Zi,ATTR_WHITESPACE:ea,CUSTOM_ELEMENT:na,DATA_ATTR:Xi,DOCTYPE_NAME:ta,ERB_EXPR:Ji,IS_ALLOWED_URI:Qi,IS_SCRIPT_OR_DATA:$i,MUSTACHE_EXPR:qi,TMPLIT_EXPR:Yi}),ia={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},aa=function(){return typeof window>`u`?null:window},oa=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},sa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ca(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:aa(),t=e=>ca(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==ia.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Fi(m,`cloneNode`),g=Fi(m,`remove`),_=Fi(m,`nextSibling`),v=Fi(m,`childNodes`),y=Fi(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:ee,createDocumentFragment:te,getElementsByTagName:ne}=n,{importNode:re}=r,C=sa();t.isSupported=typeof ci==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ie,ERB_EXPR:ae,TMPLIT_EXPR:oe,DATA_ATTR:se,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:le,ATTR_WHITESPACE:ue,CUSTOM_ELEMENT:de}=ra,{IS_ALLOWED_URI:fe}=ra,w=null,pe=Z({},[...Ii,...Li,...Ri,...Bi,...Hi]),T=null,me=Z({},[...Ui,...Wi,...Gi,...Ki]),E=Object.seal(hi(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,ge=null,_e=Object.seal(hi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ve=!0,ye=!0,D=!1,be=!0,xe=!1,Se=!0,Ce=!1,we=!1,O=!1,Te=!1,k=!1,A=!1,Ee=!0,j=!1,De=!0,Oe=!1,ke={},Ae=null,je=Z({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Me=null,Ne=Z({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Pe=null,M=Z({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Fe=`http://www.w3.org/1998/Math/MathML`,Ie=`http://www.w3.org/2000/svg`,N=`http://www.w3.org/1999/xhtml`,Le=N,Re=!1,ze=null,Be=Z({},[Fe,Ie,N],wi),Ve=Z({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),He=Z({},[`annotation-xml`]),Ue=Z({},[`title`,`style`,`font`,`a`,`script`]),We=null,P=[`application/xhtml+xml`,`text/html`],F=null,Ge=null,Ke=n.createElement(`form`),qe=function(e){return e instanceof RegExp||e instanceof Function},Je=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ge&&Ge===e)){if((!e||typeof e!=`object`)&&(e={}),e=Pi(e),We=P.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,F=We===`application/xhtml+xml`?wi:Ci,w=ki(e,`ALLOWED_TAGS`)?Z({},e.ALLOWED_TAGS,F):pe,T=ki(e,`ALLOWED_ATTR`)?Z({},e.ALLOWED_ATTR,F):me,ze=ki(e,`ALLOWED_NAMESPACES`)?Z({},e.ALLOWED_NAMESPACES,wi):Be,Pe=ki(e,`ADD_URI_SAFE_ATTR`)?Z(Pi(M),e.ADD_URI_SAFE_ATTR,F):M,Me=ki(e,`ADD_DATA_URI_TAGS`)?Z(Pi(Ne),e.ADD_DATA_URI_TAGS,F):Ne,Ae=ki(e,`FORBID_CONTENTS`)?Z({},e.FORBID_CONTENTS,F):je,he=ki(e,`FORBID_TAGS`)?Z({},e.FORBID_TAGS,F):Pi({}),ge=ki(e,`FORBID_ATTR`)?Z({},e.FORBID_ATTR,F):Pi({}),ke=ki(e,`USE_PROFILES`)?e.USE_PROFILES:!1,ve=e.ALLOW_ARIA_ATTR!==!1,ye=e.ALLOW_DATA_ATTR!==!1,D=e.ALLOW_UNKNOWN_PROTOCOLS||!1,be=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=e.SAFE_FOR_TEMPLATES||!1,Se=e.SAFE_FOR_XML!==!1,Ce=e.WHOLE_DOCUMENT||!1,Te=e.RETURN_DOM||!1,k=e.RETURN_DOM_FRAGMENT||!1,A=e.RETURN_TRUSTED_TYPE||!1,O=e.FORCE_BODY||!1,Ee=e.SANITIZE_DOM!==!1,j=e.SANITIZE_NAMED_PROPS||!1,De=e.KEEP_CONTENT!==!1,Oe=e.IN_PLACE||!1,fe=e.ALLOWED_URI_REGEXP||Qi,Le=e.NAMESPACE||N,Ve=e.MATHML_TEXT_INTEGRATION_POINTS||Ve,He=e.HTML_INTEGRATION_POINTS||He,E=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&qe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(E.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&qe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(E.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(E.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(ye=!1),k&&(Te=!0),ke&&(w=Z({},Hi),T=hi(null),ke.html===!0&&(Z(w,Ii),Z(T,Ui)),ke.svg===!0&&(Z(w,Li),Z(T,Wi),Z(T,Ki)),ke.svgFilters===!0&&(Z(w,Ri),Z(T,Wi),Z(T,Ki)),ke.mathMl===!0&&(Z(w,Bi),Z(T,Gi),Z(T,Ki))),ki(e,`ADD_TAGS`)||(_e.tagCheck=null),ki(e,`ADD_ATTR`)||(_e.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?_e.tagCheck=e.ADD_TAGS:(w===pe&&(w=Pi(w)),Z(w,e.ADD_TAGS,F))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?_e.attributeCheck=e.ADD_ATTR:(T===me&&(T=Pi(T)),Z(T,e.ADD_ATTR,F))),e.ADD_URI_SAFE_ATTR&&Z(Pe,e.ADD_URI_SAFE_ATTR,F),e.FORBID_CONTENTS&&(Ae===je&&(Ae=Pi(Ae)),Z(Ae,e.FORBID_CONTENTS,F)),e.ADD_FORBID_CONTENTS&&(Ae===je&&(Ae=Pi(Ae)),Z(Ae,e.ADD_FORBID_CONTENTS,F)),De&&(w[`#text`]=!0),Ce&&Z(w,[`html`,`head`,`body`]),w.table&&(Z(w,[`tbody`]),delete he.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Ai(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Ai(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=oa(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));pi&&pi(e),Ge=e}},Ye=Z({},[...Li,...Ri,...zi]),Xe=Z({},[...Bi,...Vi]),I=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Le,tagName:`template`});let n=Ci(e.tagName),r=Ci(t.tagName);return ze[e.namespaceURI]?e.namespaceURI===Ie?t.namespaceURI===N?n===`svg`:t.namespaceURI===Fe?n===`svg`&&(r===`annotation-xml`||Ve[r]):!!Ye[n]:e.namespaceURI===Fe?t.namespaceURI===N?n===`math`:t.namespaceURI===Ie?n===`math`&&He[r]:!!Xe[n]:e.namespaceURI===N?t.namespaceURI===Ie&&!He[r]||t.namespaceURI===Fe&&!Ve[r]?!1:!Xe[n]&&(Ue[n]||!Ye[n]):!!(We===`application/xhtml+xml`&&ze[e.namespaceURI]):!1},Ze=function(e){xi(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},L=function(e,n){try{xi(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{xi(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Te||k)try{Ze(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Qe=function(e){let t=null,r=null;if(O)e=`<remove></remove>`+e;else{let t=Ti(e,/^[\r\n\t ]+/);r=t&&t[0]}We===`application/xhtml+xml`&&Le===N&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Le===N)try{t=new f().parseFromString(i,We)}catch{}if(!t||!t.documentElement){t=S.createDocument(Le,`template`,null);try{t.documentElement.innerHTML=Re?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Le===N?ne.call(t,Ce?`html`:`body`)[0]:Ce?t.documentElement:a},$e=function(e){return ee.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},et=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},tt=function(e){return typeof s==`function`&&e instanceof s};function nt(e,n,r){vi(e,e=>{e.call(t,n,r,Ge)})}let rt=function(e){let n=null;if(nt(C.beforeSanitizeElements,e,null),et(e))return Ze(e),!0;let r=F(e.nodeName);if(nt(C.uponSanitizeElement,e,{tagName:r,allowedTags:w}),Se&&e.hasChildNodes()&&!tt(e.firstElementChild)&&X(/<[/\w!]/g,e.innerHTML)&&X(/<[/\w!]/g,e.textContent)||e.nodeType===ia.progressingInstruction||Se&&e.nodeType===ia.comment&&X(/<[/\w]/g,e.data))return Ze(e),!0;if(!(_e.tagCheck instanceof Function&&_e.tagCheck(r))&&(!w[r]||he[r])){if(!he[r]&&at(r)&&(E.tagNameCheck instanceof RegExp&&X(E.tagNameCheck,r)||E.tagNameCheck instanceof Function&&E.tagNameCheck(r)))return!1;if(De&&!Ae[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,_(e))}}}return Ze(e),!0}return e instanceof c&&!I(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&X(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ze(e),!0):(xe&&e.nodeType===ia.text&&(n=e.textContent,vi([ie,ae,oe],e=>{n=Ei(n,e,` `)}),e.textContent!==n&&(xi(t.removed,{element:e.cloneNode()}),e.textContent=n)),nt(C.afterSanitizeElements,e,null),!1)},it=function(e,t,r){if(ge[t]||Ee&&(t===`id`||t===`name`)&&(r in n||r in Ke))return!1;if(!(ye&&!ge[t]&&X(se,t))&&!(ve&&X(ce,t))&&!(_e.attributeCheck instanceof Function&&_e.attributeCheck(t,e))){if(!T[t]||ge[t]){if(!(at(e)&&(E.tagNameCheck instanceof RegExp&&X(E.tagNameCheck,e)||E.tagNameCheck instanceof Function&&E.tagNameCheck(e))&&(E.attributeNameCheck instanceof RegExp&&X(E.attributeNameCheck,t)||E.attributeNameCheck instanceof Function&&E.attributeNameCheck(t,e))||t===`is`&&E.allowCustomizedBuiltInElements&&(E.tagNameCheck instanceof RegExp&&X(E.tagNameCheck,r)||E.tagNameCheck instanceof Function&&E.tagNameCheck(r))))return!1}else if(!Pe[t]&&!X(fe,Ei(r,ue,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Di(r,`data:`)===0&&Me[e])&&!(D&&!X(le,Ei(r,ue,``)))&&r)return!1}return!0},at=function(e){return e!==`annotation-xml`&&Ti(e,de)},ot=function(e){nt(C.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||et(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:T,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=F(a),l=s,u=a===`value`?l:Oi(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,nt(C.uponSanitizeAttribute,e,r),u=r.attrValue,j&&(c===`id`||c===`name`)&&(L(a,e),u=`user-content-`+u),Se&&X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){L(a,e);continue}if(c===`attributename`&&Ti(u,`href`)){L(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){L(a,e);continue}if(!be&&X(/\/>/i,u)){L(a,e);continue}xe&&vi([ie,ae,oe],e=>{u=Ei(u,e,` `)});let d=F(e.nodeName);if(!it(d,c,u)){L(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),et(e)?Ze(e):bi(t.removed)}catch{L(a,e)}}nt(C.afterSanitizeAttributes,e,null)},st=function e(t){let n=null,r=$e(t);for(nt(C.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)nt(C.uponSanitizeShadowNode,n,null),rt(n),ot(n),n.content instanceof a&&e(n.content);nt(C.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Re=!e,Re&&(e=`<!-->`),typeof e!=`string`&&!tt(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw Ai(`dirty is not a string, aborting`)}else throw Ai(`toString is not a function`);if(!t.isSupported)return e;if(we||Je(n),t.removed=[],typeof e==`string`&&(Oe=!1),Oe){if(e.nodeName){let t=F(e.nodeName);if(!w[t]||he[t])throw Ai(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=Qe(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===ia.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!Te&&!xe&&!Ce&&e.indexOf(`<`)===-1)return b&&A?b.createHTML(e):e;if(i=Qe(e),!i)return Te?null:A?x:``}i&&O&&Ze(i.firstChild);let u=$e(Oe?e:i);for(;c=u.nextNode();)rt(c),ot(c),c.content instanceof a&&st(c.content);if(Oe)return e;if(Te){if(k)for(l=te.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(T.shadowroot||T.shadowrootmode)&&(l=re.call(r,l,!0)),l}let d=Ce?i.outerHTML:i.innerHTML;return Ce&&w[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&X(ta,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
+ `+d),xe&&vi([ie,ae,oe],e=>{d=Ei(d,e,` `)}),b&&A?b.createHTML(d):d},t.setConfig=function(){Je(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),we=!0},t.clearConfig=function(){Ge=null,we=!1},t.isValidAttribute=function(e,t,n){return Ge||Je({}),it(F(e),F(t),n)},t.addHook=function(e,t){typeof t==`function`&&xi(C[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=yi(C[e],t);return n===-1?void 0:Si(C[e],n,1)[0]}return bi(C[e])},t.removeHooks=function(e){C[e]=[]},t.removeAllHooks=function(){C=sa()},t}var la=ca();function ua(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var da=ua();function fa(e){da=e}var pa={exec:()=>null};function Q(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(ha.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ma=(()=>{try{return!0}catch{return!1}})(),ha={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},ga=/^(?:[ \t]*(?:\n|$))+/,_a=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,va=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ya=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ba=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,xa=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Sa=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ca=Q(Sa).replace(/bull/g,xa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),wa=Q(Sa).replace(/bull/g,xa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ta=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ea=/^[^\n]+/,Da=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Oa=Q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Da).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ka=Q(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xa).getRegex(),Aa=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,ja=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ma=Q(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,ja).replace(`tag`,Aa).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Na=Q(Ta).replace(`hr`,ya).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Aa).getRegex(),Pa={blockquote:Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Na).getRegex(),code:_a,def:Oa,fences:va,heading:ba,hr:ya,html:Ma,lheading:Ca,list:ka,newline:ga,paragraph:Na,table:pa,text:Ea},Fa=Q(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,ya).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Aa).getRegex(),Ia={...Pa,lheading:wa,table:Fa,paragraph:Q(Ta).replace(`hr`,ya).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Fa).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Aa).getRegex()},La={...Pa,html:Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,ja).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:pa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Q(Ta).replace(`hr`,ya).replace(`heading`,` *#{1,6} *[^
4
+ ]`).replace(`lheading`,Ca).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ra=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,za=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ba=/^( {2,}|\\)\n(?!\s*$)/,Va=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ha=/[\p{P}\p{S}]/u,Ua=/[\s\p{P}\p{S}]/u,Wa=/[^\s\p{P}\p{S}]/u,Ga=Q(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Ua).getRegex(),Ka=/(?!~)[\p{P}\p{S}]/u,qa=/(?!~)[\s\p{P}\p{S}]/u,Ja=/(?:[^\s\p{P}\p{S}]|~)/u,Ya=Q(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ma?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Xa=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Za=Q(Xa,`u`).replace(/punct/g,Ha).getRegex(),Qa=Q(Xa,`u`).replace(/punct/g,Ka).getRegex(),$a=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,eo=Q($a,`gu`).replace(/notPunctSpace/g,Wa).replace(/punctSpace/g,Ua).replace(/punct/g,Ha).getRegex(),to=Q($a,`gu`).replace(/notPunctSpace/g,Ja).replace(/punctSpace/g,qa).replace(/punct/g,Ka).getRegex(),no=Q(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Wa).replace(/punctSpace/g,Ua).replace(/punct/g,Ha).getRegex(),ro=Q(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Ha).getRegex(),io=Q(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Wa).replace(/punctSpace/g,Ua).replace(/punct/g,Ha).getRegex(),ao=Q(/\\(punct)/,`gu`).replace(/punct/g,Ha).getRegex(),oo=Q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),so=Q(ja).replace(`(?:-->|$)`,`-->`).getRegex(),co=Q(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,so).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),lo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,uo=Q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,lo).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fo=Q(/^!?\[(label)\]\[(ref)\]/).replace(`label`,lo).replace(`ref`,Da).getRegex(),po=Q(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Da).getRegex(),mo=Q(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,fo).replace(`nolink`,po).getRegex(),ho=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,go={_backpedal:pa,anyPunctuation:ao,autolink:oo,blockSkip:Ya,br:Ba,code:za,del:pa,delLDelim:pa,delRDelim:pa,emStrongLDelim:Za,emStrongRDelimAst:eo,emStrongRDelimUnd:no,escape:Ra,link:uo,nolink:po,punctuation:Ga,reflink:fo,reflinkSearch:mo,tag:co,text:Va,url:pa},_o={...go,link:Q(/^!?\[(label)\]\((.*?)\)/).replace(`label`,lo).getRegex(),reflink:Q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,lo).getRegex()},vo={...go,emStrongRDelimAst:to,emStrongLDelim:Qa,delLDelim:ro,delRDelim:io,url:Q(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,ho).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Q(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,ho).getRegex()},yo={...vo,br:Q(Ba).replace(`{2,}`,`*`).getRegex(),text:Q(vo.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},bo={normal:Pa,gfm:Ia,pedantic:La},xo={normal:go,gfm:vo,breaks:yo,pedantic:_o},So={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Co=e=>So[e];function wo(e,t){if(t){if(ha.escapeTest.test(e))return e.replace(ha.escapeReplace,Co)}else if(ha.escapeTestNoEncode.test(e))return e.replace(ha.escapeReplaceNoEncode,Co);return e}function To(e){try{e=encodeURI(e).replace(ha.percentDecode,`%`)}catch{return null}return e}function Eo(e,t){let n=e.replace(ha.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(ha.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(ha.slashPipe,`|`);return n}function Do(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Oo(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function ko(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Ao(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function jo(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
5
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
6
+ `)}var Mo=class{options;rules;lexer;constructor(e){this.options=e||da}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Do(e,`
7
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=jo(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Do(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Do(t[0],`
8
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Do(t[0],`
9
+ `).split(`
10
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
11
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
12
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
13
+ ${s}`:s,r=r?`${r}
14
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
15
+ `+e.join(`
16
+ `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
17
+ `+e.join(`
18
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
19
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=ko(t[2].split(`
20
+ `,1)[0],t[1].length),l=e.split(`
21
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
22
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
23
+ `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
24
+ `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
25
+ `+l}u=!l.trim(),r+=p+`
26
+ `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Eo(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
27
+ `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Eo(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
28
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Do(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Oo(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Ao(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Ao(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},No=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||da,this.options.tokenizer=this.options.tokenizer||new Mo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:ha,block:bo.normal,inline:xo.normal};this.options.pedantic?(t.block=bo.pedantic,t.inline=xo.pedantic):this.options.gfm&&(t.block=bo.gfm,this.options.breaks?t.inline=xo.breaks:t.inline=xo.gfm),this.tokenizer.rules=t}static get rules(){return{block:bo,inline:xo}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(ha.carriageReturn,`
29
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ha.tabCharGlobal,` `).replace(ha.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
30
+ `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
31
+ `)?``:`
32
+ `)+r.raw,n.text+=`
33
+ `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
34
+ `)?``:`
35
+ `)+r.raw,n.text+=`
36
+ `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
37
+ `)?``:`
38
+ `)+r.raw,a.text+=`
39
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
40
+ `)?``:`
41
+ `)+r.raw,n.text+=`
42
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},Po=class{options;parser;constructor(e){this.options=e||da}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(ha.notSpaceStart)?.[0],i=e.replace(ha.endingNewline,``)+`
43
+ `;return r?`<pre><code class="language-`+wo(r)+`">`+(n?i:wo(i,!0))+`</code></pre>
44
+ `:`<pre><code>`+(n?i:wo(i,!0))+`</code></pre>
45
+ `}blockquote({tokens:e}){return`<blockquote>
46
+ ${this.parser.parse(e)}</blockquote>
47
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
48
+ `}hr(e){return`<hr>
49
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
50
+ `+r+`</`+i+`>
51
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
52
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
53
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
54
+ <thead>
55
+ `+t+`</thead>
56
+ `+r+`</table>
57
+ `}tablerow({text:e}){return`<tr>
58
+ ${e}</tr>
59
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
60
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${wo(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=To(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+wo(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=To(e);if(i===null)return wo(n);e=i;let a=`<img src="${e}" alt="${wo(n)}"`;return t&&(a+=` title="${wo(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:wo(e.text)}},Fo=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Io=class e{options;renderer;textRenderer;constructor(e){this.options=e||da,this.options.renderer=this.options.renderer||new Po,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Fo}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Lo=class{options;block;constructor(e){this.options=e||da}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?No.lex:No.lexInline}provideParser(){return this.block?Io.parse:Io.parseInline}},Ro=class{defaults=ua();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Io;Renderer=Po;TextRenderer=Fo;Lexer=No;Tokenizer=Mo;Hooks=Lo;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Po(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Mo(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Lo;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];Lo.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Lo.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return No.lex(e,t??this.defaults)}parser(e,t){return Io.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?No.lex:No.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?Io.parse:Io.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?No.lex:No.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?Io.parse:Io.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
61
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+wo(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},zo=new Ro;function $(e,t){return zo.parse(e,t)}$.options=$.setOptions=function(e){return zo.setOptions(e),$.defaults=zo.defaults,fa($.defaults),$},$.getDefaults=ua,$.defaults=da,$.use=function(...e){return zo.use(...e),$.defaults=zo.defaults,fa($.defaults),$},$.walkTokens=function(e,t){return zo.walkTokens(e,t)},$.parseInline=zo.parseInline,$.Parser=Io,$.parser=Io.parse,$.Renderer=Po,$.TextRenderer=Fo,$.Lexer=No,$.lexer=No.lex,$.Tokenizer=Mo,$.Hooks=Lo,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,Io.parse,No.lex;var Bo=new Ro({breaks:!0,gfm:!0});function Vo(e){return la.sanitize(Bo.parse(e))}var Ho=K(`<button class="delete-btn svelte-1ku848x">delete</button>`),Uo=K(`<div class="comment svelte-1ku848x"><div class="comment-header svelte-1ku848x"><span class="author svelte-1ku848x"> </span> <span class="date svelte-1ku848x"> </span> <!></div> <div class="comment-body markdown-body svelte-1ku848x"></div></div>`),Wo=K(`<div class="comment-list svelte-1ku848x"></div>`),Go=K(`<img alt="" class="avatar-img svelte-1ku848x"/>`),Ko=K(`<div class="avatar-fallback svelte-1ku848x"> </div>`),qo=K(`<section class="comment-section svelte-1ku848x"><h3 class="section-header svelte-1ku848x"> </h3> <!> <div class="compose svelte-1ku848x"><div class="compose-avatar svelte-1ku848x"><!></div> <div class="compose-box svelte-1ku848x"><textarea placeholder="Write a comment..." class="compose-input svelte-1ku848x"></textarea> <div class="compose-footer svelte-1ku848x"><button><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg> Comment</button></div></div></div></section>`);function Jo(e,t){Ie(t,!0);let n=Zr(t,`userAvatarUrl`,3,null),r=R(``);function i(){let e=G(r).trim();e&&(z(r,``),t.onComment(e))}function a(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),i())}function o(e){let t=new Date(`${e.replace(` `,`T`)}Z`);return t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})+` `+t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}function s(e){return(e[0]??`?`).toUpperCase()}var c=qo(),l=B(c),u=B(l);j(l);var d=V(l,2),f=e=>{var n=Wo();Ar(n,21,()=>t.comments,e=>e.id,(e,n)=>{var r=Uo(),i=B(r),a=B(i),s=B(a,!0);j(a);var c=V(a,2),l=B(c,!0);j(c);var u=V(c,2),d=e=>{var r=Ho();fr(`click`,r,()=>t.onDelete?.(G(n).id)),q(e,r)};Y(u,e=>{t.onDelete&&G(n).author_username===t.currentUsername&&e(d)}),j(i);var f=V(i,2);Ir(f,()=>Vo(G(n).content),!0),j(f),j(r),H(e=>{J(s,G(n).author_display_name??G(n).author_username),J(l,e)},[()=>o(G(n).created_at)]),q(e,r)}),j(n),q(e,n)};Y(d,e=>{t.comments.length>0&&e(f)});var p=V(d,2),m=B(p),h=B(m),g=e=>{var t=Go();H(()=>Wr(t,`src`,n())),q(e,t)},_=e=>{var n=Ko(),r=B(n,!0);j(n),H(e=>J(r,e),[()=>s(t.currentUsername)]),q(e,n)};Y(h,e=>{n()?e(g):e(_,-1)}),j(m);var v=V(m,2),y=B(v);nn(y),Wr(y,`rows`,2);var b=V(y,2),x=B(b);let S;j(b),j(v),j(p),j(c),H((e,n)=>{J(u,`Comments (${t.comments.length??``})`),S=zr(x,1,`submit-btn svelte-1ku848x`,null,S,e),x.disabled=n},[()=>({active:!!G(r).trim()}),()=>!G(r).trim()]),fr(`keydown`,y,a),Jr(y,()=>G(r),e=>z(r,e)),fr(`click`,x,i),q(e,c),N()}pr([`click`,`keydown`]);var Yo=K(`<div class="error svelte-1n5zw0o"> </div>`),Xo=K(`<div class="status svelte-1n5zw0o">Loading...</div>`),Zo=K(`<div class="status svelte-1n5zw0o">Note not found.</div>`),Qo=K(`<button class="reply-to-link svelte-1n5zw0o"><span class="reply-arrow svelte-1n5zw0o">&#8617;</span> In reply to <span class="reply-ref svelte-1n5zw0o"> </span></button>`),$o=K(`<button> </button>`),es=K(`<form class="emoji-form svelte-1n5zw0o"><input class="emoji-input svelte-1n5zw0o" placeholder="emoji" maxlength="32"/></form>`),ts=K(`<button class="reaction-pill add-reaction svelte-1n5zw0o" title="Add reaction"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M8 14s1.5 2 4 2 4-2 4-2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line></svg></button>`),ns=K(`<button class="reply-card svelte-1n5zw0o"><span class="reply-title svelte-1n5zw0o"> </span> <span class="reply-meta svelte-1n5zw0o"> </span></button>`),rs=K(`<div class="replies-section svelte-1n5zw0o"><h3 class="section-title svelte-1n5zw0o">Replies</h3> <!></div>`),is=K(`<article class="note svelte-1n5zw0o"><!> <h1 class="title svelte-1n5zw0o"> </h1> <div class="meta svelte-1n5zw0o"><span class="author svelte-1n5zw0o"> </span> <span class="sep svelte-1n5zw0o">&middot;</span> <span class="date svelte-1n5zw0o"> </span></div> <div class="divider svelte-1n5zw0o"></div> <div class="content markdown-body svelte-1n5zw0o"></div> <div class="reactions-bar svelte-1n5zw0o"><!> <!></div></article> <!> <div class="comments-section svelte-1n5zw0o"><!></div>`,1),as=K(`<div class="note-view svelte-1n5zw0o"><button class="back-btn svelte-1n5zw0o">&larr; Back</button> <!> <!></div>`);function os(e,t){Ie(t,!0);let n=Zr(t,`userAvatarUrl`,3,null),r=R(null),i=R(!0),a=R(!1),o=R(``),s=R(``),c=R(!1);async function l(){z(i,!0),z(a,!1),z(o,``),z(r,null);try{let e=await ni(t.author,t.slug);e?z(r,e,!0):z(a,!0)}catch{z(o,`Network error — could not load note`)}finally{z(i,!1)}}pn(()=>{t.author,t.slug,l()});async function u(e){try{await ii(t.author,t.slug,e)}catch{z(o,`Failed to add comment`);return}await l()}async function d(e){try{await ai(t.author,t.slug,e)}catch{z(o,`Failed to delete comment`);return}await l()}async function f(e){try{await oi(t.author,t.slug,e)}catch{return}await l()}async function p(e){e.preventDefault();let t=G(s).trim();t&&(z(s,``),z(c,!1),await f(t))}function m(e){return new Date(`${e.replace(` `,`T`)}Z`).toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function h(e){return e.usernames.includes(t.username)}var g=as(),_=B(g),v=V(_,2),y=e=>{var t=Yo(),n=B(t,!0);j(t),H(()=>J(n,G(o))),q(e,t)};Y(v,e=>{G(o)&&e(y)});var b=V(v,2),x=e=>{q(e,Xo())},S=e=>{q(e,Zo())},ee=e=>{var i=is(),a=Zt(i),o=B(a),l=e=>{var n=Qo(),i=V(B(n),2),a=B(i,!0);j(i),j(n),H(()=>J(a,G(r).reply_to.title)),fr(`click`,n,()=>t.onNavigate(G(r).reply_to.author_username,G(r).reply_to.slug)),q(e,n)};Y(o,e=>{G(r).reply_to&&e(l)});var g=V(o,2),_=B(g,!0);j(g);var v=V(g,2),y=B(v),b=B(y,!0);j(y);var x=V(y,4),S=B(x,!0);j(x),j(v);var ee=V(v,4);Ir(ee,()=>Vo(G(r).content),!0),j(ee);var te=V(ee,2),ne=B(te),re=e=>{var t=br();Ar(Zt(t),17,()=>G(r).reactions,Er,(e,t)=>{var n=$o();let r;var i=B(n);j(n),H(e=>{r=zr(n,1,`reaction-pill svelte-1n5zw0o`,null,r,e),J(i,`${G(t).emoji??``} ${G(t).count??``}`)},[()=>({active:h(G(t))})]),fr(`click`,n,()=>f(G(t).emoji)),q(e,n)}),q(e,t)};Y(ne,e=>{G(r).reactions&&G(r).reactions.length>0&&e(re)});var C=V(ne,2),ie=e=>{var t=es(),n=B(t);Ur(n),j(t),dr(`submit`,t,p),Jr(n,()=>G(s),e=>z(s,e)),q(e,t)},ae=e=>{var t=ts();fr(`click`,t,()=>{z(c,!0)}),q(e,t)};Y(C,e=>{G(c)?e(ie):e(ae,-1)}),j(te),j(a);var oe=V(a,2),se=e=>{var n=rs();Ar(V(B(n),2),17,()=>G(r).replies,Er,(e,n)=>{var r=ns(),i=B(r),a=B(i,!0);j(i);var o=V(i,2),s=B(o);j(o),j(r),H(e=>{J(a,G(n).title),J(s,`${G(n).author_username??``} · ${e??``}`)},[()=>m(G(n).created_at)]),fr(`click`,r,()=>t.onNavigate(G(n).author_username,G(n).slug)),q(e,r)}),j(n),q(e,n)};Y(oe,e=>{G(r).replies&&G(r).replies.length>0&&e(se)});var ce=V(oe,2),le=B(ce);{let e=Tt(()=>G(r).comments??[]);Jo(le,{get comments(){return G(e)},onComment:u,onDelete:d,get currentUsername(){return t.username},get userAvatarUrl(){return n()}})}j(ce),H(e=>{J(_,G(r).title),J(b,G(r).author_display_name??G(r).author_username),J(S,e)},[()=>m(G(r).created_at)]),q(e,i)};Y(b,e=>{G(i)?e(x):G(a)?e(S,1):G(r)&&e(ee,2)}),j(g),fr(`click`,_,function(...e){t.onBack?.apply(this,e)}),q(e,g),N()}pr([`click`]);var ss=K(`<div class="reply-indicator svelte-1hapkk3"> </div>`),cs=K(`<span class="comments svelte-1hapkk3"> </span>`),ls=K(`<span class="reaction-pill svelte-1hapkk3"> </span>`),us=K(`<div class="reactions svelte-1hapkk3"></div>`),ds=K(`<button class="card svelte-1hapkk3"><!> <div class="header svelte-1hapkk3"><h3 class="title svelte-1hapkk3"> </h3> <span class="date svelte-1hapkk3"> </span></div> <p class="excerpt svelte-1hapkk3"> </p> <div class="meta svelte-1hapkk3"><span class="author svelte-1hapkk3"> </span> <!></div> <!></button>`);function fs(e,t){Ie(t,!0);function n(e){let t=Math.floor((Date.now()-new Date(`${e.replace(` `,`T`)}Z`).getTime())/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}var r=ds(),i=B(r),a=e=>{var n=ss(),r=B(n);j(n),H(()=>J(r,`↩ replying to ${t.replyTo.author_username??``}/${t.replyTo.slug??``}`)),q(e,n)};Y(i,e=>{t.replyTo&&e(a)});var o=V(i,2),s=B(o),c=B(s,!0);j(s);var l=V(s,2),u=B(l,!0);j(l),j(o);var d=V(o,2),f=B(d,!0);j(d);var p=V(d,2),m=B(p),h=B(m,!0);j(m);var g=V(m,2),_=e=>{var n=cs(),r=B(n);j(n),H(()=>J(r,`${t.commentCount??``} ${t.commentCount===1?`comment`:`comments`}`)),q(e,n)};Y(g,e=>{t.commentCount>0&&e(_)}),j(p);var v=V(p,2),y=e=>{var n=us();Ar(n,21,()=>t.reactions,Er,(e,t)=>{var n=ls(),r=B(n);j(n),H(()=>J(r,`${G(t).emoji??``} ${G(t).count??``}`)),q(e,n)}),j(n),q(e,n)};Y(v,e=>{t.reactions&&t.reactions.length>0&&e(y)}),j(r),H(e=>{J(c,t.title),J(u,e),J(f,t.excerpt),J(h,t.author)},[()=>n(t.createdAt)]),fr(`click`,r,()=>t.onSelect(t.author,t.slug)),q(e,r),N()}pr([`click`]);var ps=K(`<button class="btn btn-write svelte-vh096i"> </button>`),ms=K(`<form class="note-form svelte-vh096i"><input type="text" class="form-input svelte-vh096i" placeholder="Title"/> <textarea class="form-textarea svelte-vh096i" placeholder="Write your note..." rows="6"></textarea> <div class="form-actions svelte-vh096i"><button type="submit" class="btn btn-submit svelte-vh096i"> </button></div></form>`),hs=K(`<div class="error svelte-vh096i"> </div>`),gs=K(`<div class="loading svelte-vh096i">Loading notes...</div>`),_s=K(`<div class="empty svelte-vh096i">No notes yet. Be the first to write one.</div>`),vs=K(`<div class="notes-list svelte-vh096i"></div>`),ys=K(`<div class="notes-page svelte-vh096i"><div class="page-header svelte-vh096i"><h2 class="page-title svelte-vh096i">Notes</h2> <!></div> <!> <!> <!></div>`);function bs(e,t){Ie(t,!0);let n=R(Ht([])),r=R(!0),i=R(``),a=R(!1),o=R(``),s=R(``),c=R(!1);function l(e){let t=e.content.length>200?`${e.content.slice(0,200)}...`:e.content;return{title:e.title,author:e.author_username,slug:e.slug,excerpt:t,commentCount:e.comment_count,createdAt:e.created_at,replyTo:e.reply_to,reactions:e.reactions}}async function u(){try{z(n,(await ti({author:t.author})).map(l),!0),z(i,``)}catch(e){z(i,e instanceof Error?e.message:`Failed to load notes`,!0)}finally{z(r,!1)}}async function d(e){if(e.preventDefault(),!(!G(o).trim()||!G(s).trim()||G(c))){z(c,!0);try{await ri(G(o).trim(),G(s).trim()),z(o,``),z(s,``),z(a,!1),await u()}catch(e){z(i,e instanceof Error?e.message:`Failed to create note`,!0)}finally{z(c,!1)}}}Qr(()=>{u()});var f=ys(),p=B(f),m=V(B(p),2),h=e=>{var t=ps(),n=B(t,!0);j(t),H(()=>J(n,G(a)?`Cancel`:`Write a Note`)),fr(`click`,t,()=>{z(a,!G(a))}),q(e,t)};Y(m,e=>{t.author||e(h)}),j(p);var g=V(p,2),_=e=>{var t=ms(),n=B(t);Ur(n);var r=V(n,2);nn(r);var i=V(r,2),a=B(i),l=B(a,!0);j(a),j(i),j(t),H(e=>{a.disabled=e,J(l,G(c)?`Publishing...`:`Publish`)},[()=>G(c)||!G(o).trim()||!G(s).trim()]),dr(`submit`,t,d),Jr(n,()=>G(o),e=>z(o,e)),Jr(r,()=>G(s),e=>z(s,e)),q(e,t)};Y(g,e=>{G(a)&&e(_)});var v=V(g,2),y=e=>{var t=hs(),n=B(t,!0);j(t),H(()=>J(n,G(i))),q(e,t)};Y(v,e=>{G(i)&&e(y)});var b=V(v,2),x=e=>{q(e,gs())},S=e=>{q(e,_s())},ee=e=>{var r=vs();Ar(r,21,()=>G(n),e=>`${e.author}/${e.slug}`,(e,n)=>{fs(e,{get title(){return G(n).title},get author(){return G(n).author},get slug(){return G(n).slug},get excerpt(){return G(n).excerpt},get commentCount(){return G(n).commentCount},get createdAt(){return G(n).createdAt},get replyTo(){return G(n).replyTo},get reactions(){return G(n).reactions},get onSelect(){return t.onSelectNote}})}),j(r),q(e,r)};Y(b,e=>{G(r)?e(x):G(n).length===0?e(S,1):e(ee,-1)}),j(f),q(e,f),N()}pr([`click`]);var xs=K(`<div class="ext-app svelte-1r8vfx3"><!></div>`);function Ss(e,t){Ie(t,!0);let n=R(Ht(window.location.hash)),r=R(``),i=R(null);Qr(()=>{si().then(e=>{z(r,e.username,!0),z(i,e.avatarUrl,!0)}).catch(()=>{console.warn(`Failed to load current user`)});let e=()=>{z(n,window.location.hash,!0)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)});let a=Tt(()=>{let e=G(n).replace(/^#\/?/,``),t=e.match(/^mind\/([^/]+)(?:\/(.+))?/);if(t)return t[2]?{view:`detail`,author:t[1],slug:t[2],mindContext:t[1]}:{view:`list`,author:t[1],mindContext:t[1]};let r=e.match(/^([^/]+)\/(.+)/);return r?{view:`detail`,author:r[1],slug:r[2]}:{view:`list`}});function o(e){window.parent.postMessage({type:`navigate`,path:e},`*`)}function s(e,t){return`/minds/${e}/notes/${t}`}var c=xs(),l=B(c),u=e=>{os(e,{get author(){return G(a).author},get slug(){return G(a).slug},get username(){return G(r)},get userAvatarUrl(){return G(i)},onNavigate:(e,t)=>o(s(e,t)),onBack:()=>o(G(a).mindContext?`/minds/${G(a).mindContext}/notes`:`/notes`)})},d=e=>{bs(e,{get author(){return G(a).author},onSelectNote:(e,t)=>o(s(e,t))})};Y(l,e=>{G(a).view===`detail`?e(u):e(d,-1)}),j(c),q(e,c),N()}xr(Ss,{target:document.getElementById(`app`)});
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="stylesheet" href="/ext-theme.css" />
7
7
  <title>Notes</title>
8
- <script type="module" crossorigin src="/ext/notes/assets/index-8jWEv9SA.js"></script>
9
- <link rel="stylesheet" crossorigin href="/ext/notes/assets/index-DkaB7Ytd.css">
8
+ <script type="module" crossorigin src="/ext/notes/assets/index-Dsua7alJ.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/ext/notes/assets/index-D3cdui42.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="app"></div>
@@ -0,0 +1,2 @@
1
+ (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible,d=()=>{};function f(e){for(var t=0;t<e.length;t++)e[t]()}function p(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var m=1024,h=2048,g=4096,_=8192,v=16384,y=32768,b=1<<25,x=65536,S=1<<19,ee=1<<20,te=1<<25,C=65536,ne=1<<21,re=1<<22,ie=1<<23,ae=Symbol(`$state`),oe=Symbol(``),se=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ce=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function le(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function ue(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function de(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function fe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function pe(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function me(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function he(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ge(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function _e(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function ve(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ye(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var be={},w=Symbol(),xe=`http://www.w3.org/1999/xhtml`;function Se(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Ce(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var T=!1;function we(e){T=e}var E;function D(e){if(e===null)throw Se(),be;return E=e}function Te(){return D(Ut(E))}function O(e){if(T){if(Ut(E)!==null)throw Se(),be;E=e}}function Ee(e=1){if(T){for(var t=e,n=E;t--;)n=Ut(n);E=n}}function De(e=!0){for(var t=0,n=E;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Ut(n);e&&n.remove(),n=i}}function Oe(e){if(!e||e.nodeType!==8)throw Se(),be;return e.data}function ke(e){return e===this.v}function Ae(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function je(e){return!Ae(e,this.v)}var Me=!1,Ne=!1,k=null;function Pe(e){k=e}function Fe(e,t=!1,n){k={p:k,i:!1,c:null,e:null,s:e,x:null,r:G,l:Ne&&!t?{s:null,u:null,$:[]}:null}}function Ie(e){var t=k,n=t.e;if(n!==null){t.e=null;for(var r of n)tn(r)}return e!==void 0&&(t.x=e),t.i=!0,k=t.p,e??{}}function Le(){return!Ne||k!==null&&k.l===null}var Re=[];function ze(){var e=Re;Re=[],f(e)}function Be(e){if(Re.length===0&&!Ye){var t=Re;queueMicrotask(()=>{t===Re&&ze()})}Re.push(e)}function Ve(e){var t=G;if(t===null)return H.f|=ie,e;if(!(t.f&32768)&&!(t.f&4))throw e;He(e,t)}function He(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var Ue=~(h|g|m);function A(e,t){e.f=e.f&Ue|t}function We(e){e.f&512||e.deps===null?A(e,m):A(e,g)}function Ge(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=C,Ge(t.deps))}function Ke(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Ge(e.deps),A(e,m)}var qe=!1,j=new Set,M=null,N=null,Je=null,Ye=!1,Xe=!1,Ze=null,Qe=null,$e=0,et=1,tt=class e{id=et++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=[];#s=new Set;#c=new Set;#l=new Map;is_fork=!1;#u=!1;#d=new Set;#f(){return this.is_fork||this.#r.size>0}#p(){for(let n of this.#d)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#l.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#l.get(e);if(t){this.#l.delete(e);for(var n of t.d)A(n,h),this.schedule(n);for(n of t.m)A(n,g),this.schedule(n)}}#m(){if($e++>1e3&&(j.delete(this),nt()),!this.#f()){for(let e of this.#s)this.#c.delete(e),A(e,h),this.schedule(e);for(let e of this.#c)A(e,g),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=Ze=[],r=[],i=Qe=[];for(let e of t)try{this.#h(e,n,r)}catch(t){throw ct(e),t}if(M=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Ze=null,Qe=null,this.#f()||this.#p()){this.#g(r),this.#g(n);for(let[e,t]of this.#l)st(e,t)}else{this.#n.size===0&&j.delete(this),this.#s.clear(),this.#c.clear();for(let e of this.#e)e(this);this.#e.clear(),rt(r),rt(n),this.#i?.resolve()}var o=M;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(j.add(o),o.#m()),j.has(this)||this.#_()}#h(e,t,n){e.f^=m;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#l.has(r))&&r.fn!==null){a?r.f^=m:i&4?t.push(r):Me&&i&16777224?n.push(r):kn(r)&&(i&16&&this.#c.add(r),Pn(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#g(e){for(var t=0;t<e.length;t+=1)Ke(e[t],this.#s,this.#c)}capture(e,t,n=!1){t!==w&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,[e.v,n]),N?.set(e,e.v))}activate(){M=this}deactivate(){M=null,N=null}flush(){try{Xe=!0,M=this,this.#m()}finally{$e=0,Je=null,Ze=null,Qe=null,Xe=!1,M=null,N=null,Ot.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),j.delete(this)}register_created_effect(e){this.#o.push(e)}#_(){for(let l of j){var e=l.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(l.current.has(r)){var n=l.current.get(r)[0];if(e&&i!==n)l.current.set(r,[i,a]);else continue}t.push(r)}var r=[...l.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){l.activate();var i=new Set,a=new Map;for(var o of t)it(o,r,i,a);a=new Map;var s=[...l.current.keys()].filter(e=>this.current.has(e)?this.current.get(e)[0]!==e:!0);for(let e of this.#o)!(e.f&155648)&&at(e,s,a)&&(e.f&4194320?(A(e,h),l.schedule(e)):l.#s.add(e));if(l.#a.length>0){l.apply();for(var c of l.#a)l.#h(c,[],[]);l.#a=[]}l.deactivate()}}for(let e of j)e.#d.has(this)&&(e.#d.delete(this),e.#d.size===0&&!e.#f()&&(e.activate(),e.#m()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#u||n||(this.#u=!0,Be(()=>{this.#u=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#s.add(t);for(let e of t)this.#c.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=p()).promise}static ensure(){if(M===null){let t=M=new e;Xe||(j.add(M),Ye||Be(()=>{M===t&&t.flush()}))}return M}apply(){if(!Me||!this.is_fork&&j.size===1){N=null;return}N=new Map;for(let[e,[t]]of this.current)N.set(e,t);for(let n of j)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#d.add(n);else for(let[e,t]of n.previous)N.has(e)||N.set(e,t)}}schedule(e){if(Je=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Ze!==null&&t===G&&(Me||(H===null||!(H.f&2))&&!qe))return;if(n&96){if(!(n&1024))return;t.f^=m}}this.#a.push(t)}};function nt(){try{he()}catch(e){He(e,Je)}}var P=null;function rt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&kn(r)&&(P=new Set,Pn(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&fn(r),P?.size>0)){Ot.clear();for(let e of P){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)P.has(n)&&(P.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Pn(n)}}P.clear()}}P=null}}function it(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?it(i,t,n,r):e&4194320&&!(e&2048)&&at(i,t,r)&&(A(i,h),ot(i))}}function at(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&at(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function ot(e){M.schedule(e)}function st(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),A(e,m);for(var n=e.first;n!==null;)st(n,t),n=n.next}}function ct(e){A(e,m);for(var t=e.first;t!==null;)ct(t),t=t.next}function lt(e){let t=0,n=At(0),r;return()=>{Qt()&&(Z(n),an(()=>(t===0&&(r=Ln(()=>e(()=>Pt(n)))),t+=1,()=>{Be(()=>{--t,t===0&&(r?.(),r=void 0,Pt(n))})})))}}var ut=x|S;function dt(e,t,n,r){new ft(e,t,n,r)}var ft=class{parent;is_pending=!1;transform_error;#e;#t=T?E:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=lt(()=>(this.#m=At(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=G;t.b=this,t.f|=128,n(e)},this.parent=G.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=sn(()=>{if(T){let e=this.#t;Te();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},ut),T&&(this.#e=E)}#g(){try{this.#a=B(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=B(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=B(()=>e(this.#e)),Be(()=>{var e=this.#c=document.createDocumentFragment(),t=L();e.append(t),this.#a=this.#x(()=>B(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,pn(this.#o,()=>{this.#o=null}),this.#b(M))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=B(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();_n(this.#a,e);let t=this.#n.pending;this.#o=B(()=>t(this.#e))}else this.#b(M)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Ke(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=G,n=H,r=k;K(this.#i),W(this.#i),Pe(this.#i.ctx);try{return tt.ensure(),e()}catch(e){return Ve(e),null}finally{K(t),W(n),Pe(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&pn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Be(()=>{this.#d=!1,this.#m&&Mt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),Z(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(V(this.#a),null),this.#o&&=(V(this.#o),null),this.#s&&=(V(this.#s),null),T&&(D(this.#t),Ee(),D(De()));var r=!1,i=!1;let a=()=>{if(r){Ce();return}r=!0,i&&ye(),this.#s!==null&&pn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){He(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return B(()=>{var t=G;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return He(e,this.#i.parent),null}}))};Be(()=>{var t;try{t=this.transform_error(e)}catch(e){He(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>He(e,this.#i&&this.#i.parent)):o(t)})}};function pt(e,t,n,r){let i=Le()?_t:bt;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=G,s=mt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||He(e,o)}ht()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=gt();function d(){Promise.all(n.map(e=>vt(e))).then(e=>l([...t.map(i),...e])).catch(e=>He(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),ht()}):d()}function mt(){var e=G,t=H,n=k,r=M;return function(i=!0){K(e),W(t),Pe(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function ht(e=!0){K(null),W(null),Pe(null),e&&M?.deactivate()}function gt(){var e=G,t=e.b,n=M,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function _t(e){var t=2|h,n=H!==null&&H.f&2?H:null;return G!==null&&(G.f|=S),{ctx:k,deps:null,effects:null,equals:ke,f:t,fn:e,reactions:null,rv:0,v:w,wv:0,parent:n??G,ac:null}}function vt(e,t,n){let r=G;r===null&&ue();var i=void 0,a=At(w),o=!H,s=new Map;return rn(()=>{var t=G,n=p();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(ht)}catch(e){n.reject(e),ht()}var c=M;if(o){if(t.f&32768)var l=gt();if(r.b.is_rendered())s.get(c)?.reject(se),s.delete(c);else{for(let e of s.values())e.reject(se);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===se),!(n===se||t.f&16384)){if(c.activate(),n)a.f|=ie,Mt(a,n);else{a.f&8388608&&(a.f^=ie),Mt(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(se)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),$t(()=>{for(let e of s.values())e.reject(se)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function yt(e){let t=_t(e);return Me||Sn(t),t}function bt(e){let t=_t(e);return t.equals=je,t}function xt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)V(t[n])}}function St(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function Ct(e){var t,n=G;K(St(e));try{e.f&=~C,xt(e),t=jn(e)}finally{K(n)}return t}function wt(e){var t=e.v,n=Ct(e);if(!e.equals(n)&&(e.wv=On(),(!M?.is_fork||e.deps===null)&&(e.v=n,M?.capture(e,t,!0),e.deps===null))){A(e,m);return}bn||(N===null?We(e):(Qt()||M?.is_fork)&&N.set(e,n))}function Tt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(se),t.teardown=d,t.ac=null,Nn(t,0),ln(t))}function Et(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&Pn(t)}var Dt=new Set,Ot=new Map,kt=!1;function At(e,t){return{f:0,v:e,reactions:null,equals:ke,rv:0,wv:0}}function F(e,t){let n=At(e,t);return Sn(n),n}function jt(e,t=!1,n=!0){let r=At(e);return t||(r.equals=je),Ne&&n&&k!==null&&k.l!==null&&(k.l.s??=[]).push(r),r}function I(e,t,r=!1){return H!==null&&(!U||H.f&131072)&&Le()&&H.f&4325394&&(q===null||!n.call(q,e))&&ve(),Mt(e,r?It(t):t,Qe)}function Mt(e,t,n=null){if(!e.equals(t)){var r=e.v;bn?Ot.set(e,t):Ot.set(e,r),e.v=t;var i=tt.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&Ct(t),N===null&&We(t)}e.wv=On(),Ft(e,h,n),Le()&&G!==null&&G.f&1024&&!(G.f&96)&&(X===null?Cn([e]):X.push(e)),!i.is_fork&&Dt.size>0&&!kt&&Nt()}return t}function Nt(){kt=!1;for(let e of Dt)e.f&1024&&A(e,g),kn(e)&&Pn(e);Dt.clear()}function Pt(e){I(e,e.v+1)}function Ft(e,t,n){var r=e.reactions;if(r!==null)for(var i=Le(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===G)){var l=(c&h)===0;if(l&&A(s,t),c&2){var u=s;N?.delete(u),c&65536||(c&512&&(s.f|=C),Ft(u,g,n))}else if(l){var d=s;c&16&&P!==null&&P.add(d),n===null?ot(d):n.push(d)}}}}function It(t){if(typeof t!=`object`||!t||ae in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=F(0),u=null,d=En,f=e=>{if(En===d)return e();var t=H,n=En;W(null),Dn(d);var r=e();return W(t),Dn(n),r};return i&&r.set(`length`,F(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&ge();var i=r.get(t);return i===void 0?f(()=>{var e=F(n.value,u);return r.set(t,e),e}):I(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>F(w,u));r.set(t,e),Pt(o)}}else I(n,w),Pt(o);return!0},get(e,n,i){if(n===ae)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>F(It(s?e[n]:w),u)),r.set(n,o)),o!==void 0){var c=Z(o);return c===w?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=Z(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==w)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===ae)return!0;var n=r.get(t),i=n!==void 0&&n.v!==w||Reflect.has(e,t);return(n!==void 0||G!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>F(i?It(e[t]):w,u)),r.set(t,n)),Z(n)===w)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>F(w,u)),r.set(d+``,p)):I(p,w)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>F(void 0,u)),I(c,It(n)),r.set(t,c));else{l=c.v!==w;var m=f(()=>It(n));I(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&I(g,_+1)}Pt(o)}return!0},ownKeys(e){Z(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==w});for(var[n,i]of r)i.v!==w&&!(n in e)&&t.push(n);return t},setPrototypeOf(){_e()}})}var Lt,Rt,zt,Bt;function Vt(){if(Lt===void 0){Lt=window,Rt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;zt=a(t,`firstChild`).get,Bt=a(t,`nextSibling`).get,u(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),u(n)&&(n.__t=void 0)}}function L(e=``){return document.createTextNode(e)}function Ht(e){return zt.call(e)}function Ut(e){return Bt.call(e)}function R(e,t){if(!T)return Ht(e);var n=Ht(E);if(n===null)n=E.appendChild(L());else if(t&&n.nodeType!==3){var r=L();return n?.before(r),D(r),r}return t&&qt(n),D(n),n}function z(e,t=1,n=!1){let r=T?E:e;for(var i;t--;)i=r,r=Ut(r);if(!T)return r;if(n){if(r?.nodeType!==3){var a=L();return r===null?i?.after(a):r.before(a),D(a),a}qt(r)}return D(r),r}function Wt(e){e.textContent=``}function Gt(){return!Me||P!==null?!1:(G.f&y)!==0}function Kt(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function qt(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Jt(e){var t=H,n=G;W(null),K(null);try{return e()}finally{W(t),K(n)}}function Yt(e){G===null&&(H===null&&me(e),pe()),bn&&fe(e)}function Xt(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Zt(e,t){var n=G;n!==null&&n.f&8192&&(e|=_);var r={ctx:k,deps:null,nodes:null,f:e|h|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};M?.register_created_effect(r);var i=r;if(e&4)Ze===null?tt.ensure().schedule(r):Ze.push(r);else if(t!==null){try{Pn(r)}catch(e){throw V(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=x))}if(i!==null&&(i.parent=n,n!==null&&Xt(i,n),H!==null&&H.f&2&&!(e&64))){var a=H;(a.effects??=[]).push(i)}return r}function Qt(){return H!==null&&!U}function $t(e){let t=Zt(8,null);return A(t,m),t.teardown=e,t}function en(e){Yt(`$effect`);var t=G.f;if(!H&&t&32&&!(t&32768)){var n=k;(n.e??=[]).push(e)}else return tn(e)}function tn(e){return Zt(4|ee,e)}function nn(e){tt.ensure();let t=Zt(64|S,e);return(e={})=>new Promise(n=>{e.outro?pn(t,()=>{V(t),n(void 0)}):(V(t),n(void 0))})}function rn(e){return Zt(re|S,e)}function an(e,t=0){return Zt(8|t,e)}function on(e,t=[],n=[],r=[]){pt(r,t,n,t=>{Zt(8,()=>e(...t.map(Z)))})}function sn(e,t=0){return Zt(16|t,e)}function B(e){return Zt(32|S,e)}function cn(e){var t=e.teardown;if(t!==null){let e=bn,n=H;xn(!0),W(null);try{t.call(null)}finally{xn(e),W(n)}}}function ln(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Jt(()=>{e.abort(se)});var r=n.next;n.f&64?n.parent=null:V(n,t),n=r}}function un(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||V(t),t=n}}function V(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(dn(e.nodes.start,e.nodes.end),n=!0),A(e,b),ln(e,t&&!n),Nn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();cn(e),e.f^=b,e.f|=v;var i=e.parent;i!==null&&i.first!==null&&fn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function dn(e,t){for(;e!==null;){var n=e===t?null:Ut(e);e.remove(),e=n}}function fn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function pn(e,t,n=!0){var r=[];mn(e,r,!0);var i=()=>{n&&V(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function mn(e,t,n){if(!(e.f&8192)){e.f^=_;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;mn(i,t,o?n:!1),i=a}}}function hn(e){gn(e,!0)}function gn(e,t){if(e.f&8192){e.f^=_,e.f&1024||(A(e,h),tt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;gn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function _n(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Ut(n);t.append(n),n=i}}var vn=null,yn=!1,bn=!1;function xn(e){bn=e}var H=null,U=!1;function W(e){H=e}var G=null;function K(e){G=e}var q=null;function Sn(e){H!==null&&(!Me||H.f&2)&&(q===null?q=[e]:q.push(e))}var J=null,Y=0,X=null;function Cn(e){X=e}var wn=1,Tn=0,En=Tn;function Dn(e){En=e}function On(){return++wn}function kn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~C),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(kn(a)&&wt(a),a.wv>e.wv)return!0}t&512&&N===null&&A(e,m)}return!1}function An(e,t,r=!0){var i=e.reactions;if(i!==null&&!(!Me&&q!==null&&n.call(q,e)))for(var a=0;a<i.length;a++){var o=i[a];o.f&2?An(o,t,!1):t===o&&(r?A(o,h):o.f&1024&&A(o,g),ot(o))}}function jn(e){var t=J,n=Y,r=X,i=H,a=q,o=k,s=U,c=En,l=e.f;J=null,Y=0,X=null,H=l&96?null:e,q=null,Pe(e.ctx),U=!1,En=++Tn,e.ac!==null&&(Jt(()=>{e.ac.abort(se)}),e.ac=null);try{e.f|=ne;var u=e.fn,d=u();e.f|=y;var f=e.deps,p=M?.is_fork;if(J!==null){var m;if(p||Nn(e,Y),f!==null&&Y>0)for(f.length=Y+J.length,m=0;m<J.length;m++)f[Y+m]=J[m];else e.deps=f=J;if(Qt()&&e.f&512)for(m=Y;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&Y<f.length&&(Nn(e,Y),f.length=Y);if(Le()&&X!==null&&!U&&f!==null&&!(e.f&6146))for(m=0;m<X.length;m++)An(X[m],e);if(i!==null&&i!==e){if(Tn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Tn;if(t!==null)for(let e of t)e.rv=Tn;X!==null&&(r===null?r=X:r.push(...X))}return e.f&8388608&&(e.f^=ie),d}catch(e){return Ve(e)}finally{e.f^=ne,J=t,Y=n,X=r,H=i,q=a,Pe(o),U=s,En=c}}function Mn(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(J===null||!n.call(J,r))){var s=r;s.f&512&&(s.f^=512,s.f&=~C),We(s),Tt(s),Nn(s,0)}}function Nn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Mn(e,n[r])}function Pn(e){var t=e.f;if(!(t&16384)){A(e,m);var n=G,r=yn;G=e,yn=!0;try{t&16777232?un(e):ln(e),cn(e);var i=jn(e);e.teardown=typeof i==`function`?i:null,e.wv=wn}finally{yn=r,G=n}}}function Z(e){var t=(e.f&2)!=0;if(vn?.add(e),H!==null&&!U&&!(G!==null&&G.f&16384)&&(q===null||!n.call(q,e))){var r=H.deps;if(H.f&2097152)e.rv<Tn&&(e.rv=Tn,J===null&&r!==null&&r[Y]===e?Y++:J===null?J=[e]:J.push(e));else{(H.deps??=[]).push(e);var i=e.reactions;i===null?e.reactions=[H]:n.call(i,H)||i.push(H)}}if(bn&&Ot.has(e))return Ot.get(e);if(t){var a=e;if(bn){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||In(a))&&(o=Ct(a)),Ot.set(a,o),o}var s=(a.f&512)==0&&!U&&H!==null&&(yn||(H.f&512)!=0),c=(a.f&y)===0;kn(a)&&(s&&(a.f|=512),wt(a)),s&&!c&&(Et(a),Fn(a))}if(N?.has(e))return N.get(e);if(e.f&8388608)throw e.v;return e.v}function Fn(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Et(t),Fn(t))}function In(e){if(e.v===w)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Ot.has(t)||t.f&2&&In(t))return!0;return!1}function Ln(e){var t=U;try{return U=!0,e()}finally{U=t}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var Rn=[`touchstart`,`touchmove`];function zn(e){return Rn.includes(e)}var Bn=Symbol(`events`),Vn=new Set,Hn=new Set;function Un(e){if(!T)return;e.removeAttribute(`onload`),e.removeAttribute(`onerror`);let t=e.__e;t!==void 0&&(e.__e=void 0,queueMicrotask(()=>{e.isConnected&&e.dispatchEvent(t)}))}function Wn(e,t,n,r={}){function i(e){if(r.capture||Yn.call(t,e),!e.cancelBubble)return Jt(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?Be(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Gn(e,t,n,r,i){var a={capture:r,passive:i},o=Wn(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&$t(()=>{t.removeEventListener(e,o,a)})}function Kn(e,t,n){(t[Bn]??={})[e]=n}function qn(e){for(var t=0;t<e.length;t++)Vn.add(e[t]);for(var n of Hn)n(e)}var Jn=null;function Yn(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;Jn=e;var s=0,c=Jn===e&&e[Bn];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[Bn]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=H,f=G;W(null),K(null);try{for(var p,m=[];o!==null;){var h=o.assignedSlot||o.parentNode||o.host||null;try{var g=o[Bn]?.[r];g!=null&&(!o.disabled||e.target===o)&&g.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;o=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Bn]=t,delete e.currentTarget,W(d),K(f)}}}var Xn=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Zn(e){return Xn?.createHTML(e)??e}function Qn(e){var t=Kt(`template`);return t.innerHTML=Zn(e.replaceAll(`<!>`,`<!---->`)),t.content}function $n(e,t){var n=G;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Q(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(T)return $n(E,null),E;i===void 0&&(i=Qn(a?e:`<!>`+e),n||(i=Ht(i)));var t=r||Rt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Ht(t),s=t.lastChild;$n(o,s)}else $n(t,t);return t}}function $(e,t){if(T){var n=G;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=E),Te();return}e!==null&&e.before(t)}function er(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function tr(e,t){return rr(e,t)}var nr=new Map;function rr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){Vt();var l=void 0,u=nn(()=>{var s=n??t.appendChild(L());dt(s,{pending:()=>{}},t=>{Fe({});var n=k;if(o&&(n.c=o),a&&(i.$$events=a),T&&$n(t,null),l=e(t,i)||{},T&&(G.nodes.end=E,E===null||E.nodeType!==8||E.data!==`]`))throw Se(),be;Ie()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=zn(r);for(let e of[t,document]){var a=nr.get(e);a===void 0&&(a=new Map,nr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Yn,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(Vn)),Hn.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=nr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Yn),r.delete(e),r.size===0&&nr.delete(n)):r.set(e,i)}Hn.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return ir.set(l,u),l}var ir=new WeakMap,ar=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)hn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(V(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();_n(r,t),t.append(L()),this.#n.set(e,{effect:r,fragment:t})}else V(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),pn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(V(n.effect),this.#n.delete(e))};ensure(e,t){var n=M,r=Gt();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=L();i.append(a),this.#n.set(e,{effect:B(()=>t(a)),fragment:i})}else this.#t.set(e,B(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else T&&(this.anchor=E),this.#a(n)}};function or(e,t,n=!1){var r;T&&(r=E,Te());var i=new ar(e),a=n?x:0;function o(e,t){if(T){var n=Oe(r);if(e!==parseInt(n.substring(1))){var a=De();D(a),i.anchor=a,we(!1),i.ensure(e,t),we(!0);return}}i.ensure(e,t)}sn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function sr(e,t){return t}function cr(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];pn(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;lr(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=i.length===0&&n!==null;if(l){var u=n,d=u.parentNode;Wt(d),d.append(u),e.items.clear()}lr(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function lr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=te,_n(a,document.createDocumentFragment())):V(t[i],n)}}var ur;function dr(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=T?D(Ht(u)):u.appendChild(L())}T&&Te();var d=null,f=bt(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,pr(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=te,hr(d,null,c)):hn(d):pn(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:sn(()=>{p=Z(f);var e=p.length;let t=!1;T&&Oe(c)===`[!`!=(e===0)&&(c=De(),D(c),we(!1),t=!0);for(var r=new Set,u=M,v=Gt(),y=0;y<e;y+=1){T&&E.nodeType===8&&E.data===`]`&&(c=E,t=!0,we(!1));var b=p[y],x=a(b,y),S=h?null:l.get(x);S?(S.v&&Mt(S.v,b),S.i&&Mt(S.i,y),v&&u.unskip_effect(S.e)):(S=mr(l,h?c:ur??=L(),b,x,y,o,n,i),h||(S.e.f|=te),l.set(x,S)),r.add(x)}if(e===0&&s&&!d&&(h?d=B(()=>s(c)):(d=B(()=>s(ur??=L())),d.f|=te)),e>r.size&&de(``,``,``),T&&e>0&&D(De()),!h)if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);t&&we(!0),Z(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,T&&(c=E)}function fr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function pr(e,t,n,i,a){var o=(i&8)!=0,s=t.length,c=e.items,l=fr(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(hn(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=te,_===l)hr(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),gr(e,d,_),gr(e,_,y),hr(_,y,n),d=_,p=[],m=[],l=fr(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],ee=p[p.length-1];for(x=0;x<p.length;x+=1)hr(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);gr(e,S.prev,ee.next),gr(e,d,S),gr(e,ee,b),l=b,d=ee,--v,p=[],m=[]}else u.delete(_),hr(_,l,n),gr(e,_.prev,_.next),gr(e,_,d===null?e.effect.first:d.next),gr(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=fr(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=fr(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(lr(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var C=[];if(u!==void 0)for(_ of u)_.f&8192||C.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&C.push(l),l=fr(l.next);var ne=C.length;if(ne>0){var re=i&4&&s===0?n:null;if(o){for(v=0;v<ne;v+=1)C[v].nodes?.a?.measure();for(v=0;v<ne;v+=1)C[v].nodes?.a?.fix()}cr(e,C,re)}}o&&Be(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function mr(e,t,n,r,i,a,o,s){var c=o&1?o&16?At(n):jt(n,!1,!1):null,l=o&2?At(i):null;return{v:c,i:l,e:B(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function hr(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Ut(r);if(a.before(r),r===i)return;r=o}}function gr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}var _r=[...`
2
+ \r\f\xA0\v`];function vr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||_r.includes(r[o-1]))&&(s===r.length||_r.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function yr(e,t,n,r,i,a){var o=e.__className;if(T||o!==n||o===void 0){var s=vr(n,r,a);(!T||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}var br=Symbol(`is custom element`),xr=Symbol(`is html`),Sr=ce?`link`:`LINK`;function Cr(e,t,n,r){var i=wr(e);T&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Sr)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[oe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Er(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function wr(e){return e.__attributes??={[br]:e.nodeName.includes(`-`),[xr]:e.namespaceURI===xe}}var Tr=new Map;function Er(e){var t=e.getAttribute(`is`)||e.nodeName,n=Tr.get(t);if(n)return n;Tr.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&n.push(s);i=l(i)}return n}function Dr(e){k===null&&le(`onMount`),Ne&&k.l!==null?Or(k).m.push(e):en(()=>{let t=Ln(e);if(typeof t==`function`)return t})}function Or(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var kr=`/api/ext/pages`;async function Ar(){let e=await fetch(kr);return e.ok?e.json():(console.warn(`Failed to fetch pages data: HTTP ${e.status}`),{sites:[],systemSite:null,recentPages:[]})}var jr=Q(`<div class="thumbnail-sublabel svelte-yqwgpu"> </div>`),Mr=Q(`<button class="thumbnail-card svelte-yqwgpu"><div class="thumbnail-frame svelte-yqwgpu"><iframe loading="lazy" sandbox="allow-same-origin"></iframe></div> <div class="thumbnail-label svelte-yqwgpu"> </div> <!></button>`);function Nr(e,t){let n=F(!1);var r=Mr(),i=R(r),a=R(i);Cr(a,`tabindex`,-1);let o;O(i);var s=z(i,2),c=R(s,!0);O(s);var l=z(s,2),u=e=>{var n=jr(),r=R(n,!0);O(n),on(()=>er(r,t.sublabel)),$(e,n)};or(l,e=>{t.sublabel&&e(u)}),O(r),on(()=>{Cr(a,`src`,t.url),Cr(a,`title`,t.label),o=yr(a,1,`svelte-yqwgpu`,null,o,{loaded:Z(n)}),er(c,t.label)}),Kn(`click`,r,function(...e){t.onclick?.apply(this,e)}),Gn(`load`,a,()=>I(n,!0)),Un(a),$(e,r)}qn([`click`]);var Pr=Q(`<div class="section svelte-apzsoj"><div class="section-header svelte-apzsoj"><span class="section-title svelte-apzsoj">shared pages</span></div> <div class="thumbnail-grid svelte-apzsoj"></div></div>`),Fr=Q(`<div class="section svelte-apzsoj"><div class="section-header svelte-apzsoj"><span class="section-title svelte-apzsoj">mind sites</span></div> <div class="thumbnail-grid svelte-apzsoj"></div></div>`),Ir=Q(`<div class="section svelte-apzsoj"><div class="section-header svelte-apzsoj"><span class="section-title svelte-apzsoj">recently modified</span></div> <div class="thumbnail-grid svelte-apzsoj"></div></div>`),Lr=Q(`<div class="empty svelte-apzsoj">No pages published yet.</div>`),Rr=Q(`<div class="dashboard svelte-apzsoj"><!> <!> <!> <!></div>`);function zr(e,t){Fe(t,!0);function n(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}function r(e){let t=n(e.modified);return e.mind===`_system`&&e.author?`${e.author} · ${t}`:`${e.mind} · ${t}`}var i=Rr(),a=R(i),o=e=>{var n=Pr(),r=z(R(n),2);dr(r,21,()=>t.systemSite.pages,sr,(e,n)=>{{let r=yt(()=>Z(n).author??void 0);Nr(e,{get url(){return Z(n).url},get label(){return Z(n).file},get sublabel(){return Z(r)},onclick:()=>t.onSelectPage(`_system`,Z(n).file)})}}),O(r),O(n),$(e,n)};or(a,e=>{t.systemSite&&e(o)});var s=z(a,2),c=e=>{var n=Fr(),r=z(R(n),2);dr(r,21,()=>t.sites,sr,(e,n)=>{{let r=yt(()=>Z(n).pages[0]?`/ext/pages/public/${Z(n).name}/${Z(n).pages[0].file}`:`about:blank`);Nr(e,{get url(){return Z(r)},get label(){return Z(n).label},onclick:()=>t.onSelectSite(Z(n).name)})}}),O(r),O(n),$(e,n)};or(s,e=>{t.sites.length>0&&e(c)});var l=z(s,2),u=e=>{var n=Ir(),i=z(R(n),2);dr(i,21,()=>t.recentPages,sr,(e,n)=>{{let i=yt(()=>`/ext/pages/public/${Z(n).mind}/${Z(n).file}`),a=yt(()=>r(Z(n)));Nr(e,{get url(){return Z(i)},get label(){return Z(n).file},get sublabel(){return Z(a)},onclick:()=>t.onSelectPage(Z(n).mind,Z(n).file)})}}),O(i),O(n),$(e,n)};or(l,e=>{t.recentPages.length>0&&e(u)});var d=z(l,2),f=e=>{$(e,Lr())};or(d,e=>{!t.systemSite&&t.sites.length===0&&t.recentPages.length===0&&e(f)}),O(i),$(e,i),Ie()}var Br=Q(`<div class="empty svelte-vvnkg1">No pages in this site.</div>`),Vr=Q(`<div class="site-view svelte-vvnkg1"><div class="site-header svelte-vvnkg1"><span class="site-name svelte-vvnkg1"> </span> <span class="page-count svelte-vvnkg1"> </span></div> <div class="thumbnail-grid svelte-vvnkg1"></div> <!></div>`);function Hr(e,t){Fe(t,!0);function n(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}var r=Vr(),i=R(r),a=R(i),o=R(a,!0);O(a);var s=z(a,2),c=R(s);O(s),O(i);var l=z(i,2);dr(l,21,()=>t.site.pages,sr,(e,r)=>{{let i=yt(()=>`/ext/pages/public/${t.site.name}/${Z(r).file}`),a=yt(()=>n(Z(r).modified));Nr(e,{get url(){return Z(i)},get label(){return Z(r).file},get sublabel(){return Z(a)},onclick:()=>t.onSelectPage(t.site.name,Z(r).file)})}}),O(l);var u=z(l,2),d=e=>{$(e,Br())};or(u,e=>{t.site.pages.length===0&&e(d)}),O(r),on(()=>{er(o,t.site.label),er(c,`${t.site.pages.length??``} ${t.site.pages.length===1?`page`:`pages`}`)}),$(e,r),Ie()}var Ur=Q(`<iframe class="full-page-iframe svelte-1r8vfx3"></iframe>`),Wr=Q(`<div><!></div>`);function Gr(e,t){Fe(t,!0);let n=F(It(window.location.hash));Dr(()=>{let e=()=>{I(n,window.location.hash,!0)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)});let r=yt(()=>{let e=Z(n).replace(/^#\/?/,``),t=e.match(/^mind\/([^/]+)/);if(t)return{view:`mind`,name:t[1]};let r=e.match(/^([^/]+)\/(.+)$/);return r?{view:`page`,name:r[1],path:r[2]}:e&&!e.includes(`/`)?{view:`site`,name:e}:{view:`dashboard`}}),i=F(It([])),a=F(null),o=F(It([]));en(()=>{Ar().then(e=>{I(i,e.sites,!0),I(a,e.systemSite,!0),I(o,e.recentPages,!0)})});let s=yt(()=>[...Z(a)?[Z(a)]:[],...Z(i)]),c=yt(()=>{if(Z(r).view===`site`||Z(r).view===`mind`)return Z(s).find(e=>e.name===Z(r).name)});function l(e){window.parent.postMessage({type:`navigate`,path:e},`*`)}function u(e){let t=e.target;try{let e=t.contentWindow?.location.pathname;if(!e)return;let n=e.match(/^\/ext\/pages\/public\/([^/]+)\/(.+)$/);if(!n)return;let[,i,a]=n;if(i===Z(r).name&&a===Z(r).path)return;l(i===`_system`?`/pages/_system/${a}`:`/minds/${i}/pages/${a}`)}catch(e){e instanceof DOMException||console.error(`[pages] unexpected error in iframe nav handler:`,e)}}function d(e,t){l(e===`_system`?`/pages/_system/${t}`:`/minds/${e}/pages/${t}`)}function f(e){l(e===`_system`?`/pages/_system`:`/minds/${e}/pages`)}var p=Wr();let m;var h=R(p),g=e=>{var t=Ur();on(()=>{Cr(t,`src`,`/ext/pages/public/${Z(r).name??``}/${Z(r).path??``}`),Cr(t,`title`,`${Z(r).name??``}/${Z(r).path??``}`)}),Gn(`load`,t,u),Un(t),$(e,t)},_=e=>{Hr(e,{get site(){return Z(c)},onSelectPage:d})},v=e=>{zr(e,{get sites(){return Z(i)},get systemSite(){return Z(a)},get recentPages(){return Z(o)},onSelectSite:f,onSelectPage:d})};or(h,e=>{Z(r).view===`page`?e(g):(Z(r).view===`site`||Z(r).view===`mind`)&&Z(c)?e(_,1):e(v,-1)}),O(p),on(()=>m=yr(p,1,`ext-app svelte-1r8vfx3`,null,m,{"full-page":Z(r).view===`page`})),$(e,p),Ie()}tr(Gr,{target:document.getElementById(`app`)});
@@ -0,0 +1 @@
1
+ .thumbnail-card.svelte-yqwgpu{cursor:pointer;text-align:left;color:inherit;background:0 0;flex-direction:column;gap:6px;padding:0;display:flex}.thumbnail-frame.svelte-yqwgpu{border-radius:var(--radius-lg);border:1px solid var(--border);background:var(--bg-0);width:280px;height:180px;transition:border-color .15s;overflow:hidden}.thumbnail-card.svelte-yqwgpu:hover .thumbnail-frame:where(.svelte-yqwgpu){border-color:var(--border-bright)}iframe.svelte-yqwgpu{transform-origin:0 0;pointer-events:none;opacity:0;background:#fff;border:none;width:1280px;height:960px;transition:opacity .15s;transform:scale(.219)}iframe.loaded.svelte-yqwgpu{opacity:1}.thumbnail-label.svelte-yqwgpu{color:var(--text-0);text-overflow:ellipsis;white-space:nowrap;max-width:280px;padding:0 2px;font-size:13px;font-weight:500;overflow:hidden}.thumbnail-sublabel.svelte-yqwgpu{color:var(--text-2);text-overflow:ellipsis;white-space:nowrap;max-width:280px;padding:0 2px;font-size:11px;overflow:hidden}.dashboard.svelte-apzsoj{max-width:1200px}.section.svelte-apzsoj{margin-bottom:24px}.section-header.svelte-apzsoj{text-transform:uppercase;letter-spacing:.05em;margin-bottom:12px;font-size:12px}.section-title.svelte-apzsoj{color:var(--text-2)}.thumbnail-grid.svelte-apzsoj{flex-wrap:wrap;gap:16px;display:flex}.empty.svelte-apzsoj{color:var(--text-2);font-size:13px}.site-view.svelte-vvnkg1{max-width:1200px}.site-header.svelte-vvnkg1{align-items:baseline;gap:8px;margin-bottom:16px;display:flex}.site-name.svelte-vvnkg1{color:var(--text-0);font-size:16px;font-weight:500}.page-count.svelte-vvnkg1{color:var(--text-2);font-size:12px}.thumbnail-grid.svelte-vvnkg1{flex-wrap:wrap;gap:16px;display:flex}.empty.svelte-vvnkg1{color:var(--text-2);font-size:13px}.ext-app.svelte-1r8vfx3{max-width:100%;min-height:100%;padding:24px;animation:.2s both fadeIn}.ext-app.full-page.svelte-1r8vfx3{height:100%;padding:0}.full-page-iframe.svelte-1r8vfx3{background:#fff;border:none;width:100%;height:100%}
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="stylesheet" href="/ext-theme.css" />
7
7
  <title>Pages</title>
8
- <script type="module" crossorigin src="/ext/pages/assets/index-DKZLNMED.js"></script>
9
- <link rel="stylesheet" crossorigin href="/ext/pages/assets/index-D0HyS-xQ.css">
8
+ <script type="module" crossorigin src="/ext/pages/assets/index-BM7gRdg7.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/ext/pages/assets/index-BcY6lnq4.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="app"></div>