From c3d876b476ac7ac4d659af52c03a82cfe3c7f11c Mon Sep 17 00:00:00 2001 From: Rustem Mussabekov Date: Wed, 11 Dec 2024 14:25:00 +0300 Subject: [PATCH] Fix pasting tags from clipboard --- package.json | 2 +- src/data/reducers/bookmarks/draft.js | 8 +- .../background/highlights/highlight.js | 95 +++++++++++-------- 3 files changed, 63 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index 873d27bc..47b4f63b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "5.6.64", + "version": "5.6.65", "description": "All-in-one bookmark manager", "author": "Rustem Mussabekov", "license": "MIT", diff --git a/src/data/reducers/bookmarks/draft.js b/src/data/reducers/bookmarks/draft.js index ba6cd750..4dcc1fdd 100755 --- a/src/data/reducers/bookmarks/draft.js +++ b/src/data/reducers/bookmarks/draft.js @@ -27,9 +27,11 @@ export default function(state, action) {switch (action.type) { //fix tags if (key=='tags') val = _.uniq( - val.map(tag=> - tag.trim().replace(/^#|^"#|^"|"$/gm, '') - ) + val + .flatMap(tag=>tag.split(',')) + .map(tag=> + tag.trim().replace(/^#|^"#|^"|"$/gm, '') + ) ) //update draft diff --git a/src/target/extension/background/highlights/highlight.js b/src/target/extension/background/highlights/highlight.js index 516168bd..4c8a49a8 100644 --- a/src/target/extension/background/highlights/highlight.js +++ b/src/target/extension/background/highlights/highlight.js @@ -1,9 +1,9 @@ -"use strict";var no=Object.defineProperty;var Wn=e=>{throw TypeError(e)};var ro=(e,t,n)=>t in e?no(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var fe=(e,t,n)=>ro(e,typeof t!="symbol"?t+"":t,n),Yn=(e,t,n)=>t.has(e)||Wn("Cannot "+n);var G=(e,t,n)=>(Yn(e,t,"read from private field"),n?n.call(e):t.get(e)),Xt=(e,t,n)=>t.has(e)?Wn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Kt=(e,t,n,r)=>(Yn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);(function(){var e=window.Document.prototype.createElement,t=window.Document.prototype.createElementNS,n=window.Document.prototype.importNode,r=window.Document.prototype.prepend,o=window.Document.prototype.append,s=window.DocumentFragment.prototype.prepend,l=window.DocumentFragment.prototype.append,f=window.Node.prototype.cloneNode,p=window.Node.prototype.appendChild,d=window.Node.prototype.insertBefore,h=window.Node.prototype.removeChild,g=window.Node.prototype.replaceChild,m=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),b=window.Element.prototype.attachShadow,w=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),N=window.Element.prototype.getAttribute,D=window.Element.prototype.setAttribute,M=window.Element.prototype.removeAttribute,k=window.Element.prototype.toggleAttribute,x=window.Element.prototype.getAttributeNS,$=window.Element.prototype.setAttributeNS,L=window.Element.prototype.removeAttributeNS,oe=window.Element.prototype.insertAdjacentElement,A=window.Element.prototype.insertAdjacentHTML,j=window.Element.prototype.prepend,B=window.Element.prototype.append,I=window.Element.prototype.before,R=window.Element.prototype.after,z=window.Element.prototype.replaceWith,X=window.Element.prototype.remove,Ee=window.HTMLElement,ce=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),nt=window.HTMLElement.prototype.insertAdjacentElement,rt=window.HTMLElement.prototype.insertAdjacentHTML,ot=new Set;"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach(function(i){return ot.add(i)});function Mn(i){var a=ot.has(i);return i=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(i),!a&&i}var Xr=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);function V(i){var a=i.isConnected;if(a!==void 0)return a;if(Xr(i))return!0;for(;i&&!(i.__CE_isImportDocument||i instanceof Document);)i=i.parentNode||(window.ShadowRoot&&i instanceof ShadowRoot?i.host:void 0);return!(!i||!(i.__CE_isImportDocument||i instanceof Document))}function Vt(i){var a=i.children;if(a)return Array.prototype.slice.call(a);for(a=[],i=i.firstChild;i;i=i.nextSibling)i.nodeType===Node.ELEMENT_NODE&&a.push(i);return a}function Wt(i,a){for(;a&&a!==i&&!a.nextSibling;)a=a.parentNode;return a&&a!==i?a.nextSibling:null}function Yt(i,a,c){for(var _=i;_;){if(_.nodeType===Node.ELEMENT_NODE){var u=_;a(u);var v=u.localName;if(v==="link"&&u.getAttribute("rel")==="import"){if(_=u.import,c===void 0&&(c=new Set),_ instanceof Node&&!c.has(_))for(c.add(_),_=_.firstChild;_;_=_.nextSibling)Yt(_,a,c);_=Wt(i,u);continue}else if(v==="template"){_=Wt(i,u);continue}if(u=u.__CE_shadowRoot)for(u=u.firstChild;u;u=u.nextSibling)Yt(u,a,c)}_=_.firstChild?_.firstChild:Wt(i,_)}}function bt(){var i=!(pe==null||!pe.noDocumentConstructionObserver),a=!(pe==null||!pe.shadyDomFastWalk);this.m=[],this.g=[],this.j=!1,this.shadyDomFastWalk=a,this.I=!i}function it(i,a,c,_){var u=window.ShadyDOM;if(i.shadyDomFastWalk&&u&&u.inUse){if(a.nodeType===Node.ELEMENT_NODE&&c(a),a.querySelectorAll)for(i=u.nativeMethods.querySelectorAll.call(a,"*"),a=0;a{Ve(t)}}function xn(e){return et(ar,e,!1)}function jt(e){return et(vt,e,!0)}function xe(e){return $n(e)}function $n(e,t=0){return et(vt|wn|t,e,!0)}function ft(e,t=!0){return et(vt|he,e,!0,t)}function _r(e){var t=e.teardown;if(t!==null){const n=Nn,r=P;zn(!0),Le(null);try{t.call(null)}finally{zn(n),Le(r)}}}function gr(e){var t=e.deriveds;if(t!==null){e.deriveds=null;for(var n=0;n{Ve(e),t&&t()})}function wr(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var o of e)o.out(r)}else t()}function Tn(e,t,n){if(!(e.f&ge)){if(e.f^=ge,e.transitions!==null)for(const l of e.transitions)(l.is_global||n)&&t.push(l);for(var r=e.first;r!==null;){var o=r.next,s=(r.f&bn)!==0||(r.f&he)!==0;Tn(r,t,s?n:!1),r=o}}}function St(e){br(e,!0)}function br(e,t){if(e.f&ge){mt(e)&&Ft(e),e.f^=ge;for(var n=e.first;n!==null;){var r=n.next,o=(n.f&bn)!==0||(n.f&he)!==0;br(n,o?t:!1),n=r}if(e.transitions!==null)for(const s of e.transitions)(s.is_global||t)&&s.in()}}const Oo=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let At=!1,Dt=!1,on=[],sn=[];function Er(){At=!1;const e=on.slice();on=[],lr(e)}function Cr(){Dt=!1;const e=sn.slice();sn=[],lr(e)}function qe(e){At||(At=!0,queueMicrotask(Er)),on.push(e)}function Lo(e){Dt||(Dt=!0,Oo(Cr)),sn.push(e)}function Mo(){At&&Er(),Dt&&Cr()}const kr=0,jo=1;let kt=kr,dt=!1,Ge=!1,Nn=!1;function Un(e){Ge=e}function zn(e){Nn=e}let Pe=[],Je=0;let P=null;function Le(e){P=e}let O=null;function ye(e){O=e}let me=null;function Ro(e){me=e}let K=null,te=0,De=null;function Fo(e){De=e}let xr=0,Xe=!1,U=null;function $r(){return++xr}function Rt(){return U!==null&&U.l===null}function mt(e){var l,f;var t=e.f;if(t&Oe)return!0;if(t&_t){var n=e.deps,r=(t&Be)!==0;if(n!==null){var o;if(t&Nt){for(o=0;oe.version)return!0}}r||we(e,Z)}return!1}function Po(e,t,n){throw e}function Tr(e){var m;var t=K,n=te,r=De,o=P,s=Xe,l=me,f=U,p=e.f;K=null,te=0,De=null,P=p&(he|pt)?null:e,Xe=!Ge&&(p&Be)!==0,me=null,U=e.ctx;try{var d=(0,e.fn)(),h=e.deps;if(K!==null){var g;if(ht(e,te),h!==null&&te>0)for(h.length=te+K.length,g=0;g1e3&&(Je=0,bo()),Je++}function Sr(e){var t=e.length;if(t!==0){Nr();var n=Ge;Ge=!0;try{for(var r=0;r1001)return;const e=Pe;Pe=[],Sr(e),dt||(Je=0)}function Pt(e){kt===kr&&(dt||(dt=!0,queueMicrotask(qo)));for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(n&(pt|he)){if(!(n&Z))return;t.f^=Z}}Pe.push(t)}function Ar(e,t){var n=e.first,r=[];e:for(;n!==null;){var o=n.f,s=(o&he)!==0,l=s&&(o&Z)!==0;if(!l&&!(o&ge))if(o&vt){s?n.f^=Z:mt(n)&&Ft(n);var f=n.first;if(f!==null){n=f;continue}}else o&ar&&r.push(n);var p=n.next;if(p===null){let g=n.parent;for(;g!==null;){if(e===g)break e;var d=g.next;if(d!==null){n=d;continue e}g=g.parent}}n=p}for(var h=0;h0||o.length>0)&&tt(),Je=0,r}finally{kt=t,Pe=n}}function T(e){var f;var t=e.f,n=(t&Ne)!==0;if(n&&t>){var r=hr(e);return Cn(e),r}if(P!==null){me!==null&&me.includes(e)&&$o();var o=P.deps;K===null&&o!==null&&o[te]===e?te++:K===null?K=[e]:K.push(e),De!==null&&O!==null&&O.f&Z&&!(O.f&he)&&De.includes(e)&&(we(O,Oe),Pt(O))}else if(n&&e.deps===null){var s=e,l=s.parent;l!==null&&!((f=l.deriveds)!=null&&f.includes(s))&&(l.deriveds??(l.deriveds=[])).push(s)}return n&&(s=e,mt(s)&&vr(s)),e.v}function Dr(e){const t=P;try{return P=null,e()}finally{P=t}}const Bo=~(Oe|_t|Z);function we(e,t){e.f=e.f&Bo|t}function yt(e,t=!1,n){U={p:U,c:null,e:null,m:!1,s:e,x:null,l:null},t||(U.l={s:null,u:null,r1:[],r2:ne(!1)})}function wt(e){const t=U;if(t!==null){e!==void 0&&(t.x=e);const l=t.e;if(l!==null){var n=O,r=P;t.e=null;try{for(var o=0;o=M.v&&W(M,k+1)}Xn(l)}return!0},ownKeys(p){T(l);var d=Reflect.ownKeys(p).filter(m=>{var b=o.get(m);return b===void 0||b.v!==ee});for(var[h,g]of o)g.v!==ee&&!(h in p)&&d.push(h);return d},setPrototypeOf(){xo()}})}function Xn(e,t=1){W(e,e.v+t)}function Kn(e){return e!==null&&typeof e=="object"&&Ke in e?e[Ke]:e}function Vo(e,t){return Object.is(Kn(e),Kn(t))}var Ot,Re,Or,Lr;function ln(){if(Ot===void 0){Ot=window,Re=document;var e=Element.prototype,t=Node.prototype;Or=He(t,"firstChild").get,Lr=He(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function Qe(e=""){return document.createTextNode(e)}function Me(e){return Or.call(e)}function Se(e){return Lr.call(e)}function ae(e,t){if(!F)return Me(e);var n=Me(H);if(n===null)n=H.appendChild(Qe());else if(t&&n.nodeType!==3){var r=Qe();return n==null||n.before(r),de(r),r}return de(n),n}function Sn(e,t){if(!F){var n=Me(e);return n instanceof Comment&&n.data===""?Se(n):n}return H}function re(e,t=1,n=!1){let r=F?H:e;for(;t--;)r=Se(r);if(!F)return r;var o=r.nodeType;if(n&&o!==3){var s=Qe();return r==null||r.before(s),de(s),s}return de(r),r}function An(e){e.textContent=""}let F=!1;function Te(e){F=e}let H;function de(e){if(e===null)throw gn(),ut;return H=e}function Ht(){return de(Se(H))}function J(e){if(F){if(Se(H)!==null)throw gn(),ut;H=e}}function Wo(e=1){if(F){for(var t=e,n=H;t--;)n=Se(n);H=n}}function an(){for(var e=0,t=H;;){if(t.nodeType===8){var n=t.data;if(n===_n){if(e===0)return t;e-=1}else(n===ir||n===pn)&&(e+=1)}var r=Se(t);t.remove(),t=r}}const Mr=new Set,un=new Set;function Yo(e,t,n,r){function o(s){if(r.capture||lt.call(t,s),!s.cancelBubble){var l=P,f=O;Le(null),ye(null);try{return n.call(this,s)}finally{Le(l),ye(f)}}}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?qe(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function _e(e,t,n,r,o){var s={capture:r,passive:o},l=Yo(e,t,n,s);(t===document.body||t===window||t===document)&&pr(()=>{t.removeEventListener(e,l,s)})}function jr(e){for(var t=0;t{throw x});throw m}}finally{e.__root=t,delete e.currentTarget,Le(h),ye(g)}}}function Uo(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Ze(e,t){var n=O;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function be(e,t){var n=(t&lo)!==0,r=(t&ao)!==0,o,s=!e.startsWith("");return()=>{if(F)return Ze(H,null),H;o===void 0&&(o=Uo(s?e:""+e),n||(o=Me(o)));var l=r?document.importNode(o,!0):o.cloneNode(!0);if(n){var f=Me(l),p=l.lastChild;Ze(f,p)}else Ze(l,l);return l}}function zo(){if(F)return Ze(H,null),H;var e=document.createDocumentFragment(),t=document.createComment(""),n=Qe();return e.append(t,n),Ze(t,n),e}function ue(e,t){if(F){O.nodes_end=H,Ht();return}e!==null&&e.before(t)}const Xo=["touchstart","touchmove"];function Ko(e){return Xo.includes(e)}function Gt(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n==null?"":n+"")}function Rr(e,t){return Fr(e,t)}function Go(e,t){ln(),t.intro=t.intro??!1;const n=t.target,r=F,o=H;try{for(var s=Me(n);s&&(s.nodeType!==8||s.data!==ir);)s=Se(s);if(!s)throw ut;Te(!0),de(s),Ht();const l=Fr(e,{...t,anchor:s});if(H===null||H.nodeType!==8||H.data!==_n)throw gn(),ut;return Te(!1),l}catch(l){if(l===ut)return t.recover===!1&&Eo(),ln(),An(n),Te(!1),Rr(e,t);throw l}finally{Te(r),de(o)}}const ze=new Map;function Fr(e,{target:t,anchor:n,props:r={},events:o,context:s,intro:l=!0}){ln();var f=new Set,p=g=>{for(var m=0;m{var g=n??t.appendChild(Qe());return ft(()=>{if(s){yt({});var m=U;m.c=s}o&&(r.$$events=o),F&&Ze(g,null),d=e(g,r)||{},F&&(O.nodes_end=H),s&&wt()}),()=>{var w;for(var m of f){t.removeEventListener(m,lt);var b=ze.get(m);--b===0?(document.removeEventListener(m,lt),ze.delete(m)):ze.set(m,b)}un.delete(p),cn.delete(d),g!==n&&((w=g.parentNode)==null||w.removeChild(g))}});return cn.set(d,h),d}let cn=new WeakMap;function Jo(e){const t=cn.get(e);t&&t()}function Lt(e,t,n,r=null,o=!1){F&&Ht();var s=e,l=null,f=null,p=null,d=o?bn:0;$n(()=>{if(p===(p=!!t()))return;let h=!1;if(F){const g=s.data===pn;p===g&&(s=an(),de(s),Te(!1),h=!0)}p?(l?St(l):l=ft(()=>n(s)),f&&rn(f,()=>{f=null})):(f?St(f):r&&(f=ft(()=>r(s))),l&&rn(l,()=>{l=null})),h&&Te(!0)},d),F&&(s=H)}let Jt=null;function Zo(e,t){return t}function Qo(e,t,n,r){for(var o=[],s=t.length,l=0;l0&&o.length===0&&n!==null;if(f){var p=n.parentNode;An(p),p.append(n),r.clear(),Ae(e,t[0].prev,t[s-1].next)}wr(o,()=>{for(var d=0;d{var m=n(),b=mn(m)?m:m==null?[]:yn(m),w=b.length;if(g&&w===0)return;g=w===0;let N=!1;if(F){var D=l.data===pn;D!==(w===0)&&(l=an(),de(l),Te(!1),N=!0)}if(F){for(var M=null,k,x=0;x0&&de(an())}if(!F){var oe=P;ei(b,f,l,o,t,(oe.f&ge)!==0,r)}s!==null&&(w===0?h?St(h):h=ft(()=>s(l)):h!==null&&rn(h,()=>{h=null})),N&&Te(!0),n()}),F&&(l=H)}function ei(e,t,n,r,o,s,l){var Ee,ce,nt,rt;var f=(o&oo)!==0,p=(o&(hn|vn))!==0,d=e.length,h=t.items,g=t.first,m=g,b,w=null,N,D=[],M=[],k,x,$,L;if(f)for(L=0;L0){var X=o&or&&d===0?n:null;if(f){for(L=0;L{var ot;if(N!==void 0)for($ of N)(ot=$.a)==null||ot.apply()}),O.first=t.first&&t.first.e,O.last=w&&w.e}function ti(e,t,n,r){r&hn&&tn(e.v,t),r&vn?tn(e.i,n):e.i=n}function Pr(e,t,n,r,o,s,l,f,p){var d=Jt;try{var h=(p&hn)!==0,g=(p&io)===0,m=h?g?En(o):ne(o):o,b=p&vn?ne(l):l,w={i:b,v:m,k:s,a:null,e:null,prev:n,next:r};return Jt=w,w.e=ft(()=>f(e,m,b),F),w.e.prev=n&&n.e,w.e.next=r&&r.e,n===null?t.first=w:(n.next=w,n.e.next=w.e),r!==null&&(r.prev=w,r.e.prev=w.e),w}finally{Jt=d}}function Gn(e,t,n){for(var r=e.next?e.next.e.nodes_start:n,o=t?t.e.nodes_start:n,s=e.e.nodes_start;s!==r;){var l=Se(s);o.before(s),s=l}}function Ae(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function On(e,t){qe(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const o=document.createElement("style");o.id=t.hash,o.textContent=t.code,r.appendChild(o)}})}function ni(e,t){{const n=document.body;e.autofocus=!0,qe(()=>{document.activeElement===n&&e.focus()})}}function ri(e){F&&Me(e)!==null&&An(e)}let Jn=!1;function Hr(){Jn||(Jn=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function oi(e){if(F){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;se(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var o=e.checked;se(e,"checked",null),e.checked=o}}};e.__on_r=n,Lo(n),Hr()}}function ii(e,t){var n=e.__attributes??(e.__attributes={});n.value===(n.value=t)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t)}function se(e,t,n,r){var o=e.__attributes??(e.__attributes={});F&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=n)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[po]=n),n==null?e.removeAttribute(t):typeof n!="string"&&si(e).includes(t)?e[t]=n:e.setAttribute(t,n))}var Zn=new Map;function si(e){var t=Zn.get(e.nodeName);if(t)return t;Zn.set(e.nodeName,t=[]);for(var n,r=en(e),o=Element.prototype;o!==r;){n=uo(r);for(var s in n)n[s].set&&t.push(s);r=en(r)}return t}function ct(e,t,n){if(n){if(e.classList.contains(t))return;e.classList.add(t)}else{if(!e.classList.contains(t))return;e.classList.remove(t)}}function Ir(e,t,n,r=n){e.addEventListener(t,n);const o=e.__on_r;o?e.__on_r=()=>{o(),r()}:e.__on_r=r,Hr()}function li(e,t,n=t){var r=Rt();Ir(e,"input",()=>{var o=er(e)?tr(e.value):e.value;n(o),r&&o!==(o=t())&&(e.value=o??"")}),jt(()=>{var o=t();if(F&&e.defaultValue!==e.value){n(e.value);return}er(e)&&o===tr(e.value)||e.type==="date"&&!o&&!e.value||o!==e.value&&(e.value=o??"")})}const Zt=new Set;function ai(e,t,n,r,o=r){var s=n.getAttribute("type")==="checkbox",l=e;let f=!1;if(t!==null)for(var p of t)l=l[p]??(l[p]=[]);l.push(n),Ir(n,"change",()=>{var d=n.__value;s&&(d=Qn(l,d,n.checked)),o(d)},()=>o(s?[]:null)),jt(()=>{var d=r();if(F&&n.defaultChecked!==n.checked){f=!0;return}s?(d=d||[],n.checked=d.includes(n.__value)):n.checked=Vo(n.__value,d)}),pr(()=>{var d=l.indexOf(n);d!==-1&&l.splice(d,1)}),Zt.has(l)||(Zt.add(l),qe(()=>{l.sort((d,h)=>d.compareDocumentPosition(h)===4?-1:1),Zt.delete(l)})),qe(()=>{if(f){var d;if(s)d=Qn(l,d,n.checked);else{var h=l.find(g=>g.checked);d=h==null?void 0:h.__value}o(d)}})}function Qn(e,t,n){for(var r=new Set,o=0;o{var o,s;return jt(()=>{o=s,s=[],Dr(()=>{e!==n(...s)&&(t(e,...s),o&&nr(n(...o),e)&&t(null,...o))})}),()=>{qe(()=>{s&&nr(n(...s),e)&&t(null,...s)})}}),e}function ui(e){for(var t=O,n=O;t!==null&&!(t.f&(he|pt));)t=t.parent;try{return ye(t),e()}finally{ye(n)}}function It(e,t,n,r){var k;var o=(n&so)!==0,s=!1,l;l=e[t];var f=(k=He(e,t))==null?void 0:k.set,p=r,d=!0,h=!1,g=()=>(h=!0,d&&(d=!1,p=r),p);l===void 0&&r!==void 0&&(f&&o&&Co(),l=g(),f&&f(l));var m;if(m=()=>{var x=e[t];return x===void 0?g():(d=!0,h=!1,x)},f){var b=e.$$legacy;return function(x,$){return arguments.length>0?((!$||b||s)&&f($?m():x),x):m()}}var w=!1,N=!1,D=En(l),M=ui(()=>Mt(()=>{var x=m(),$=T(D);return w?(w=!1,N=!0,$):(N=!1,D.v=x)}));return function(x,$){if(arguments.length>0){const L=$?T(M):x;return M.equals(L)||(w=!0,W(D,L),h&&p!==void 0&&(p=L),Dr(()=>T(M))),x}return T(M)}}function ci(e){return new fi(e)}var ke,ie;class fi{constructor(t){Xt(this,ke);Xt(this,ie);var s;var n=new Map,r=(l,f)=>{var p=En(f);return n.set(l,p),p};const o=new Proxy({...t.props||{},$$events:{}},{get(l,f){return T(n.get(f)??r(f,Reflect.get(l,f)))},has(l,f){return T(n.get(f)??r(f,Reflect.get(l,f))),Reflect.has(l,f)},set(l,f,p){return W(n.get(f)??r(f,p),p),Reflect.set(l,f,p)}});Kt(this,ie,(t.hydrate?Go:Rr)(t.component,{target:t.target,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((s=t==null?void 0:t.props)!=null&&s.$$host)||t.sync===!1)&&tt(),Kt(this,ke,o.$$events);for(const l of Object.keys(G(this,ie)))l==="$set"||l==="$destroy"||l==="$on"||Tt(this,l,{get(){return G(this,ie)[l]},set(f){G(this,ie)[l]=f},enumerable:!0});G(this,ie).$set=l=>{Object.assign(o,l)},G(this,ie).$destroy=()=>{Jo(G(this,ie))}}$set(t){G(this,ie).$set(t)}$on(t,n){G(this,ke)[t]=G(this,ke)[t]||[];const r=(...o)=>n.call(this,...o);return G(this,ke)[t].push(r),()=>{G(this,ke)[t]=G(this,ke)[t].filter(o=>o!==r)}}$destroy(){G(this,ie).$destroy()}}ke=new WeakMap,ie=new WeakMap;let qr;typeof HTMLElement=="function"&&(qr=class extends HTMLElement{constructor(t,n,r){super();fe(this,"$$ctor");fe(this,"$$s");fe(this,"$$c");fe(this,"$$cn",!1);fe(this,"$$d",{});fe(this,"$$r",!1);fe(this,"$$p_d",{});fe(this,"$$l",{});fe(this,"$$l_u",new Map);fe(this,"$$me");this.$$ctor=t,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(t,n,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const o=this.$$c.$on(t,n);this.$$l_u.set(n,o)}super.addEventListener(t,n,r)}removeEventListener(t,n,r){if(super.removeEventListener(t,n,r),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return s=>{const l=document.createElement("slot");o!=="default"&&(l.name=o),ue(s,l)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=di(this);for(const o of this.$$s)o in r&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),n.default=!0):n[o]=t(o));for(const o of this.attributes){const s=this.$$g_p(o.name);s in this.$$d||(this.$$d[s]=xt(s,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=ci({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=kn(()=>{jt(()=>{var o;this.$$r=!0;for(const s of $t(this.$$c)){if(!((o=this.$$p_d[s])!=null&&o.reflect))continue;this.$$d[s]=this.$$c[s];const l=xt(s,this.$$d[s],this.$$p_d,"toAttribute");l==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,l)}this.$$r=!1})});for(const o in this.$$l)for(const s of this.$$l[o]){const l=this.$$c.$on(o,s);this.$$l_u.set(s,l)}this.$$l={}}}attributeChangedCallback(t,n,r){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=xt(t,r,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return $t(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function xt(e,t,n,r){var s;const o=(s=n[e])==null?void 0:s.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function di(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function qt(e,t,n,r,o,s){let l=class extends qr{constructor(){super(e,n,o),this.$$p_d=t}static get observedAttributes(){return $t(t).map(f=>(t[f].attribute||f).toLowerCase())}};return $t(t).forEach(f=>{Tt(l.prototype,f,{get(){return this.$$c&&f in this.$$c?this.$$c[f]:this.$$d[f]},set(p){var g;p=xt(f,p,t),this.$$d[f]=p;var d=this.$$c;if(d){var h=(g=He(d,f))==null?void 0:g.get;h?d[f]=p:d.$set({[f]:p})}}})}),r.forEach(f=>{Tt(l.prototype,f,{get(){var p;return(p=this.$$c)==null?void 0:p[f]}})}),e.element=l,l}const je=new Map([["yellow","#F8B920"],["red","#FF4646"],["blue","#0064FF"],["green","#00C564"]]),hi=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function Ln(e){const t=document.documentElement.lang||void 0,n=e.map(f=>f.trim().toLocaleLowerCase(t)),r=n.map(()=>({start:null,end:null,shift:0})),o=n.map(()=>[]),s=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,f=>{var p,d;return hi.includes((p=f.parentNode)==null?void 0:p.tagName)||((d=f.parentNode)==null?void 0:d.contentEditable)=="true"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let l;for(;l=s.nextNode();)if(l!=null&&l.nodeValue)for(let f=0;f{var m,b;for(;d[r[h].shift]&&!d[r[h].shift].trim();)r[h].shift++;let g=d[r[h].shift]===p;if(!g&&r[h].shift&&(r[h].shift=0,g=d[r[h].shift]===p),g&&(r[h].shift||(r[h].start=[l,f]),r[h].end=[l,f],r[h].shift++),r[h].shift>=d.length){const w=document.createRange();w.setStart(r[h].start[0],r[h].start[1]),w.setEnd(r[h].end[0],r[h].end[1]+1),!w.collapsed&&(!((m=w.commonAncestorContainer.parentElement)!=null&&m.checkVisibility)||(b=w.commonAncestorContainer.parentElement)!=null&&b.checkVisibility())?o[h].push(w):w.detach(),g=!1}g||(r[h].shift=0,r[h].start=null,r[h].end=null)})}return o}const Ie=`rh-${new Date().getTime()}-`,Bt="highlights"in CSS;function vi(e){if(!e.length&&!CSS.highlights.size)return;const t=[];if(CSS.highlights.clear(),e.length){const r=Ln(e.map(({text:o})=>o||""));for(const o in e){const s=r[o];if(!s.length)continue;const{_id:l,color:f,note:p,index:d=0}=e[o],h=`${Ie}${l}`,g=(s==null?void 0:s[d])||s[0];CSS.highlights.set(h,new Highlight(g));const m=g.getBoundingClientRect();t.push(` +"use strict";var uo=Object.defineProperty;var Gn=e=>{throw TypeError(e)};var co=(e,t,n)=>t in e?uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var he=(e,t,n)=>co(e,typeof t!="symbol"?t+"":t,n),Kn=(e,t,n)=>t.has(e)||Gn("Cannot "+n);var Z=(e,t,n)=>(Kn(e,t,"read from private field"),n?n.call(e):t.get(e)),en=(e,t,n)=>t.has(e)?Gn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),tn=(e,t,n,r)=>(Kn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);(function(){var e=window.Document.prototype.createElement,t=window.Document.prototype.createElementNS,n=window.Document.prototype.importNode,r=window.Document.prototype.prepend,o=window.Document.prototype.append,s=window.DocumentFragment.prototype.prepend,l=window.DocumentFragment.prototype.append,d=window.Node.prototype.cloneNode,v=window.Node.prototype.appendChild,f=window.Node.prototype.insertBefore,h=window.Node.prototype.removeChild,m=window.Node.prototype.replaceChild,g=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),w=window.Element.prototype.attachShadow,y=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),N=window.Element.prototype.getAttribute,D=window.Element.prototype.setAttribute,O=window.Element.prototype.removeAttribute,M=window.Element.prototype.toggleAttribute,$=window.Element.prototype.getAttributeNS,k=window.Element.prototype.setAttributeNS,T=window.Element.prototype.removeAttributeNS,U=window.Element.prototype.insertAdjacentElement,X=window.Element.prototype.insertAdjacentHTML,S=window.Element.prototype.prepend,I=window.Element.prototype.append,W=window.Element.prototype.before,q=window.Element.prototype.after,R=window.Element.prototype.replaceWith,Y=window.Element.prototype.remove,fe=window.HTMLElement,K=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),de=window.HTMLElement.prototype.insertAdjacentElement,He=window.HTMLElement.prototype.insertAdjacentHTML,at=new Set;"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach(function(i){return at.add(i)});function Hn(i){var a=at.has(i);return i=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(i),!a&&i}var to=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);function V(i){var a=i.isConnected;if(a!==void 0)return a;if(to(i))return!0;for(;i&&!(i.__CE_isImportDocument||i instanceof Document);)i=i.parentNode||(window.ShadowRoot&&i instanceof ShadowRoot?i.host:void 0);return!(!i||!(i.__CE_isImportDocument||i instanceof Document))}function Gt(i){var a=i.children;if(a)return Array.prototype.slice.call(a);for(a=[],i=i.firstChild;i;i=i.nextSibling)i.nodeType===Node.ELEMENT_NODE&&a.push(i);return a}function Kt(i,a){for(;a&&a!==i&&!a.nextSibling;)a=a.parentNode;return a&&a!==i?a.nextSibling:null}function Jt(i,a,c){for(var _=i;_;){if(_.nodeType===Node.ELEMENT_NODE){var u=_;a(u);var p=u.localName;if(p==="link"&&u.getAttribute("rel")==="import"){if(_=u.import,c===void 0&&(c=new Set),_ instanceof Node&&!c.has(_))for(c.add(_),_=_.firstChild;_;_=_.nextSibling)Jt(_,a,c);_=Kt(i,u);continue}else if(p==="template"){_=Kt(i,u);continue}if(u=u.__CE_shadowRoot)for(u=u.firstChild;u;u=u.nextSibling)Jt(u,a,c)}_=_.firstChild?_.firstChild:Kt(i,_)}}function $t(){var i=!(we==null||!we.noDocumentConstructionObserver),a=!(we==null||!we.shadyDomFastWalk);this.m=[],this.g=[],this.j=!1,this.shadyDomFastWalk=a,this.I=!i}function ut(i,a,c,_){var u=window.ShadyDOM;if(i.shadyDomFastWalk&&u&&u.inUse){if(a.nodeType===Node.ELEMENT_NODE&&c(a),a.querySelectorAll)for(i=u.nativeMethods.querySelectorAll.call(a,"*"),a=0;a{};function fr(e){for(var t=0;t=O.v&&j(O,M+1)}Jn(l)}return!0},ownKeys(v){x(l);var f=Reflect.ownKeys(v).filter(g=>{var w=o.get(g);return w===void 0||w.v!==Q});for(var[h,m]of o)m.v!==Q&&!(h in v)&&f.push(h);return f},setPrototypeOf(){Lo()}})}function Jn(e,t=1){j(e,e.v+t)}function Zn(e){return e!==null&&typeof e=="object"&&Ve in e?e[Ve]:e}function Po(e,t){return Object.is(Zn(e),Zn(t))}var Mt,Ie,gr,wr;function dn(){if(Mt===void 0){Mt=window,Ie=document;var e=Element.prototype,t=Node.prototype;gr=je(t,"firstChild").get,wr=je(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function nt(e=""){return document.createTextNode(e)}function qe(e){return gr.call(e)}function De(e){return wr.call(e)}function oe(e,t){if(!P)return qe(e);var n=qe(F);if(n===null)n=F.appendChild(nt());else if(t&&n.nodeType!==3){var r=nt();return n==null||n.before(r),ve(r),r}return ve(n),n}function Sn(e,t){if(!P){var n=qe(e);return n instanceof Comment&&n.data===""?De(n):n}return F}function ie(e,t=1,n=!1){let r=P?F:e;for(var o;t--;)o=r,r=De(r);if(!P)return r;var s=r==null?void 0:r.nodeType;if(n&&s!==3){var l=nt();return r===null?o==null||o.after(l):r.before(l),ve(l),l}return ve(r),r}function An(e){e.textContent=""}function Bt(e){var t=pe|Re;L===null?t|=Ye:L.f|=hr;var n=H!==null&&H.f&pe?H:null;const r={children:null,ctx:ee,deps:null,equals:pr,f:t,fn:e,reactions:null,v:null,version:0,parent:n??L};return n!==null&&(n.children??(n.children=[])).push(r),r}function br(e){var t=e.children;if(t!==null){e.children=null;for(var n=0;n{Fe(t)}}function Mn(e){return it(dr,e,!1)}function jt(e){return it(gt,e,!0)}function ye(e){return Vt(e)}function Vt(e,t=0){return it(gt|xn|t,e,!0)}function rt(e,t=!0){return it(gt|_e,e,!0,t)}function $r(e){var t=e.teardown;if(t!==null){const n=Rn,r=H;er(!0),Pe(null);try{t.call(null)}finally{er(n),Pe(r)}}}function kr(e){var t=e.deriveds;if(t!==null){e.deriveds=null;for(var n=0;n{Fe(e),t&&t()})}function Nr(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var o of e)o.out(r)}else t()}function On(e,t,n){if(!(e.f&Ee)){if(e.f^=Ee,e.transitions!==null)for(const l of e.transitions)(l.is_global||n)&&t.push(l);for(var r=e.first;r!==null;){var o=r.next,s=(r.f&Ht)!==0||(r.f&_e)!==0;On(r,t,s?n:!1),r=o}}}function Rt(e){Sr(e,!0)}function Sr(e,t){if(e.f&Ee){yt(e)&&Wt(e),e.f^=Ee;for(var n=e.first;n!==null;){var r=n.next,o=(n.f&Ht)!==0||(n.f&_e)!==0;Sr(n,o?t:!1),n=r}if(e.transitions!==null)for(const s of e.transitions)(s.is_global||t)&&s.in()}}const jo=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let qt=!1,Pt=!1,vn=[],pn=[];function Ar(){qt=!1;const e=vn.slice();vn=[],fr(e)}function Dr(){Pt=!1;const e=pn.slice();pn=[],fr(e)}function We(e){qt||(qt=!0,queueMicrotask(Ar)),vn.push(e)}function Vo(e){Pt||(Pt=!0,jo(Dr)),pn.push(e)}function zo(){qt&&Ar(),Pt&&Dr()}const Lr=0,Wo=1;let Tt=!1,Nt=Lr,pt=!1,_t=null,Qe=!1,Rn=!1;function Qn(e){Qe=e}function er(e){Rn=e}let Be=[],et=0;let H=null;function Pe(e){H=e}let L=null;function $e(e){L=e}let Ce=null;function Yo(e){Ce=e}let G=null,re=0,Oe=null;function Uo(e){Oe=e}let Mr=0,Ze=!1,ee=null;function Or(){return++Mr}function Xo(){return!_r}function yt(e){var l,d;var t=e.f;if(t&Re)return!0;if(t&bt){var n=e.deps,r=(t&Ye)!==0;if(n!==null){var o;if(t&Lt){for(o=0;oe.version)return!0}}r||ke(e,te)}return!1}function Go(e,t){for(var n=t;n!==null;){if(n.f&un)try{n.fn(e);return}catch{n.f^=un}n=n.parent}throw Tt=!1,e}function Ko(e){return(e.f&ot)===0&&(e.parent===null||(e.parent.f&un)===0)}function zt(e,t,n,r){if(Tt){if(n===null&&(Tt=!1),Ko(t))throw e;return}n!==null&&(Tt=!0);{Go(e,t);return}}function Rr(e){var g;var t=G,n=re,r=Oe,o=H,s=Ze,l=Ce,d=ee,v=e.f;G=null,re=0,Oe=null,H=v&(_e|wt)?null:e,Ze=!Qe&&(v&Ye)!==0,Ce=null,ee=e.ctx;try{var f=(0,e.fn)(),h=e.deps;if(G!==null){var m;if(mt(e,re),h!==null&&re>0)for(h.length=re+G.length,m=0;m1e3){et=0;try{No()}catch(e){if(_t!==null)zt(e,_t,null);else throw e}}et++}function Pr(e){var t=e.length;if(t!==0){qr();var n=Qe;Qe=!0;try{for(var r=0;r1001)return;const e=Be;Be=[],Pr(e),pt||(et=0,_t=null)}function Yt(e){Nt===Lr&&(pt||(pt=!0,queueMicrotask(Qo))),_t=e;for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(n&(wt|_e)){if(!(n&te))return;t.f^=te}}Be.push(t)}function Fr(e,t){var n=e.first,r=[];e:for(;n!==null;){var o=n.f,s=(o&_e)!==0,l=s&&(o&te)!==0,d=n.next;if(!l&&!(o&Ee))if(o>){if(s)n.f^=te;else try{yt(n)&&Wt(n)}catch(m){zt(m,n,null,n.ctx)}var v=n.first;if(v!==null){n=v;continue}}else o&dr&&r.push(n);if(d===null){let m=n.parent;for(;m!==null;){if(e===m)break e;var f=m.next;if(f!==null){n=f;continue e}m=m.parent}}n=d}for(var h=0;h0||o.length>0)&&Ue(),et=0,_t=null,r}finally{Nt=t,Be=n}}function x(e){var h;var t=e.f,n=(t&pe)!==0;if(n&&t&ot){var r=yr(e);return Dn(e),r}if(H!==null){Ce!==null&&Ce.includes(e)&&Mo();var o=H.deps;G===null&&o!==null&&o[re]===e?re++:G===null?G=[e]:G.push(e),Oe!==null&&L!==null&&L.f&te&&!(L.f&_e)&&Oe.includes(e)&&(ke(L,Re),Yt(L))}else if(n&&e.deps===null)for(var s=e,l=s.parent,d=s;l!==null;)if(l.f&pe){var v=l;d=v,l=v.parent}else{var f=l;(h=f.deriveds)!=null&&h.includes(d)||(f.deriveds??(f.deriveds=[])).push(d);break}return n&&(s=e,yt(s)&&Er(s)),e.v}function qn(e){const t=H;try{return H=null,e()}finally{H=t}}const ei=~(Re|bt|te);function ke(e,t){e.f=e.f&ei|t}function st(e,t=!1,n){ee={p:ee,c:null,e:null,m:!1,s:e,x:null,l:null}}function lt(e){const t=ee;if(t!==null){e!==void 0&&(t.x=e);const l=t.e;if(l!==null){var n=L,r=H;t.e=null;try{for(var o=0;o{document.activeElement===n&&e.focus()})}}function ni(e){P&&qe(e)!==null&&An(e)}let tr=!1;function Hr(){tr||(tr=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function Ir(e){var t=H,n=L;Pe(null),$e(null);try{return e()}finally{Pe(t),$e(n)}}function Br(e,t,n,r=n){e.addEventListener(t,()=>Ir(n));const o=e.__on_r;o?e.__on_r=()=>{o(),r(!0)}:e.__on_r=()=>r(!0),Hr()}const jr=new Set,_n=new Set;function ri(e,t,n,r){function o(s){if(r.capture||ft.call(t,s),!s.cancelBubble)return Ir(()=>n.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?We(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function be(e,t,n,r,o){var s={capture:r,passive:o},l=ri(e,t,n,s);(t===document.body||t===window||t===document)&&Cr(()=>{t.removeEventListener(e,l,s)})}function Vr(e){for(var t=0;t{throw $});throw g}}finally{e.__root=t,delete e.currentTarget,Pe(h),$e(m)}}}function oi(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function tt(e,t){var n=L;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function me(e,t){var n=(t&po)!==0,r=(t&_o)!==0,o,s=!e.startsWith("");return()=>{if(P)return tt(F,null),F;o===void 0&&(o=oi(s?e:""+e),n||(o=qe(o)));var l=r?document.importNode(o,!0):o.cloneNode(!0);if(n){var d=qe(l),v=l.lastChild;tt(d,v)}else tt(l,l);return l}}function ii(){if(P)return tt(F,null),F;var e=document.createDocumentFragment(),t=document.createComment(""),n=nt();return e.append(t,n),tt(t,n),e}function se(e,t){if(P){L.nodes_end=F,It();return}e!==null&&e.before(t)}const si=["touchstart","touchmove"];function li(e){return si.includes(e)}function nn(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n==null?"":n+"")}function zr(e,t){return Wr(e,t)}function ai(e,t){dn(),t.intro=t.intro??!1;const n=t.target,r=P,o=F;try{for(var s=qe(n);s&&(s.nodeType!==8||s.data!==ar);)s=De(s);if(!s)throw ht;Se(!0),ve(s),It();const l=Wr(e,{...t,anchor:s});if(F===null||F.nodeType!==8||F.data!==Cn)throw Nn(),ht;return Se(!1),l}catch(l){if(l===ht)return t.recover===!1&&So(),dn(),An(n),Se(!1),zr(e,t);throw l}finally{Se(r),ve(o)}}const Je=new Map;function Wr(e,{target:t,anchor:n,props:r={},events:o,context:s,intro:l=!0}){dn();var d=new Set,v=m=>{for(var g=0;g{var m=n??t.appendChild(nt());return rt(()=>{if(s){st({});var g=ee;g.c=s}o&&(r.$$events=o),P&&tt(m,null),f=e(m,r)||{},P&&(L.nodes_end=F),s&<()}),()=>{var y;for(var g of d){t.removeEventListener(g,ft);var w=Je.get(g);--w===0?(document.removeEventListener(g,ft),Je.delete(g)):Je.set(g,w)}_n.delete(v),mn.delete(f),m!==n&&((y=m.parentNode)==null||y.removeChild(m))}});return mn.set(f,h),f}let mn=new WeakMap;function ui(e){const t=mn.get(e);t&&t()}function Ft(e,t,n=!1){P&&It();var r=e,o=null,s=null,l=Q,d=n?Ht:0,v=!1;const f=(m,g=!0)=>{v=!0,h(g,m)},h=(m,g)=>{if(l===(l=m))return;let w=!1;if(P){const y=r.data===En;!!l===y&&(r=fn(),ve(r),Se(!1),w=!0)}l?(o?Rt(o):g&&(o=rt(()=>g(r))),s&&hn(s,()=>{s=null})):(s?Rt(s):g&&(s=rt(()=>g(r))),o&&hn(o,()=>{o=null})),w&&Se(!0)};Vt(()=>{v=!1,t(f),v||h(null,null)},d),P&&(r=F)}function ci(e,t){return t}function fi(e,t,n,r){for(var o=[],s=t.length,l=0;l0&&o.length===0&&n!==null;if(d){var v=n.parentNode;An(v),v.append(n),r.clear(),Le(e,t[0].prev,t[s-1].next)}Nr(o,()=>{for(var f=0;f{var g=n(),w=$n(g)?g:g==null?[]:kn(g),y=w.length;if(m&&y===0)return;m=y===0;let N=!1;if(P){var D=l.data===En;D!==(y===0)&&(l=fn(),ve(l),Se(!1),N=!0)}if(P){for(var O=null,M,$=0;$0&&ve(fn())}if(!P){var U=H;di(w,d,l,o,t,(U.f&Ee)!==0,r)}s!==null&&(y===0?h?Rt(h):h=rt(()=>s(l)):h!==null&&hn(h,()=>{h=null})),N&&Se(!0),n()}),P&&(l=F)}function di(e,t,n,r,o,s,l){var fe,K,de,He;var d=(o&fo)!==0,v=(o&(bn|yn))!==0,f=e.length,h=t.items,m=t.first,g=m,w,y=null,N,D=[],O=[],M,$,k,T;if(d)for(T=0;T0){var Y=o&lr&&f===0?n:null;if(d){for(T=0;T{var at;if(N!==void 0)for(k of N)(at=k.a)==null||at.apply()}),L.first=t.first&&t.first.e,L.last=y&&y.e}function hi(e,t,n,r){r&bn&&cn(e.v,t),r&yn?cn(e.i,n):e.i=n}function Yr(e,t,n,r,o,s,l,d,v){var f=(v&bn)!==0,h=(v&ho)===0,m=f?h?Tn(o):ae(o):o,g=v&yn?ae(l):l,w={i:g,v:m,k:s,a:null,e:null,prev:n,next:r};try{return w.e=rt(()=>d(e,m,g),P),w.e.prev=n&&n.e,w.e.next=r&&r.e,n===null?t.first=w:(n.next=w,n.e.next=w.e),r!==null&&(r.prev=w,r.e.prev=w.e),w}finally{}}function nr(e,t,n){for(var r=e.next?e.next.e.nodes_start:n,o=t?t.e.nodes_start:n,s=e.e.nodes_start;s!==r;){var l=De(s);o.before(s),s=l}}function Le(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function vi(e,t,...n){var r=e,o=cr,s;Vt(()=>{o!==(o=t())&&(s&&(Fe(s),s=null),s=rt(()=>o(r,...n)))},Ht),P&&(r=F)}function Ut(e,t){We(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const o=document.createElement("style");o.id=t.hash,o.textContent=t.code,r.appendChild(o)}})}function pi(e){if(P){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;ue(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var o=e.checked;ue(e,"checked",null),e.checked=o}}};e.__on_r=n,Vo(n),Hr()}}function _i(e,t){var n=e.__attributes??(e.__attributes={});n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t)}function ue(e,t,n,r){var o=e.__attributes??(e.__attributes={});P&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=n)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[Eo]=n),n==null?e.removeAttribute(t):typeof n!="string"&&mi(e).includes(t)?e[t]=n:e.setAttribute(t,n))}var rr=new Map;function mi(e){var t=rr.get(e.nodeName);if(t)return t;rr.set(e.nodeName,t=[]);for(var n,r=an(e),o=Element.prototype;o!==r;){n=mo(r);for(var s in n)n[s].set&&t.push(s);r=an(r)}return t}function vt(e,t,n){if(n){if(e.classList.contains(t))return;e.classList.add(t)}else{if(!e.classList.contains(t))return;e.classList.remove(t)}}function gi(e,t,n,r){var o=e.__styles??(e.__styles={});o[t]!==n&&(o[t]=n,n==null?e.style.removeProperty(t):e.style.setProperty(t,n,""))}function wi(e,t,n=t){Br(e,"input",r=>{var o=r?e.defaultValue:e.value;if(o=on(e)?sn(o):o,n(o),o!==(o=t())){var s=e.selectionStart,l=e.selectionEnd;e.value=o??"",l!==null&&(e.selectionStart=s,e.selectionEnd=Math.min(l,e.value.length))}}),(P&&e.defaultValue!==e.value||qn(t)==null&&e.value)&&n(on(e)?sn(e.value):e.value),jt(()=>{var r=t();on(e)&&r===sn(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}const rn=new Set;function bi(e,t,n,r,o=r){var s=n.getAttribute("type")==="checkbox",l=e;let d=!1;if(t!==null)for(var v of t)l=l[v]??(l[v]=[]);l.push(n),Br(n,"change",()=>{var f=n.__value;s&&(f=or(l,f,n.checked)),o(f)},()=>o(s?[]:null)),jt(()=>{var f=r();if(P&&n.defaultChecked!==n.checked){d=!0;return}s?(f=f||[],n.checked=f.includes(n.__value)):n.checked=Po(n.__value,f)}),Cr(()=>{var f=l.indexOf(n);f!==-1&&l.splice(f,1)}),rn.has(l)||(rn.add(l),We(()=>{l.sort((f,h)=>f.compareDocumentPosition(h)===4?-1:1),rn.delete(l)})),We(()=>{if(d){var f;if(s)f=or(l,f,n.checked);else{var h=l.find(m=>m.checked);f=h==null?void 0:h.__value}o(f)}})}function or(e,t,n){for(var r=new Set,o=0;o{var o,s;return jt(()=>{o=s,s=[],qn(()=>{e!==n(...s)&&(t(e,...s),o&&ir(n(...o),e)&&t(null,...o))})}),()=>{We(()=>{s&&ir(n(...s),e)&&t(null,...s)})}}),e}function yi(e){for(var t=L,n=L;t!==null&&!(t.f&(_e|wt));)t=t.parent;try{return $e(t),e()}finally{$e(n)}}function Et(e,t,n,r){var k;var o=!_r,s=(n&vo)!==0,l=!1,d;d=e[t];var v=Ve in e||vr in e,f=((k=je(e,t))==null?void 0:k.set)??(v&&s&&t in e?T=>e[t]=T:void 0),h=r,m=!0,g=!1,w=()=>(g=!0,m&&(m=!1,h=r),h);d===void 0&&r!==void 0&&(f&&o&&Ao(),d=w(),f&&f(d));var y;if(y=()=>{var T=e[t];return T===void 0?w():(m=!0,g=!1,T)},f){var N=e.$$legacy;return function(T,U){return arguments.length>0?((!U||N||l)&&f(U?y():T),T):y()}}var D=!1,O=!1,M=Tn(d),$=yi(()=>Bt(()=>{var T=y(),U=x(M);return D?(D=!1,O=!0,U):(O=!1,M.v=T)}));return function(T,U){if(arguments.length>0){const X=U?x($):T;return $.equals(X)||(D=!0,j(M,X),g&&h!==void 0&&(h=X),qn(()=>x($))),T}return x($)}}function Ei(e){return new Ci(e)}var Te,le;class Ci{constructor(t){en(this,Te);en(this,le);var s;var n=new Map,r=(l,d)=>{var v=Tn(d);return n.set(l,v),v};const o=new Proxy({...t.props||{},$$events:{}},{get(l,d){return x(n.get(d)??r(d,Reflect.get(l,d)))},has(l,d){return d===vr?!0:(x(n.get(d)??r(d,Reflect.get(l,d))),Reflect.has(l,d))},set(l,d,v){return j(n.get(d)??r(d,v),v),Reflect.set(l,d,v)}});tn(this,le,(t.hydrate?ai:zr)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((s=t==null?void 0:t.props)!=null&&s.$$host)||t.sync===!1)&&Ue(),tn(this,Te,o.$$events);for(const l of Object.keys(Z(this,le)))l==="$set"||l==="$destroy"||l==="$on"||Dt(this,l,{get(){return Z(this,le)[l]},set(d){Z(this,le)[l]=d},enumerable:!0});Z(this,le).$set=l=>{Object.assign(o,l)},Z(this,le).$destroy=()=>{ui(Z(this,le))}}$set(t){Z(this,le).$set(t)}$on(t,n){Z(this,Te)[t]=Z(this,Te)[t]||[];const r=(...o)=>n.call(this,...o);return Z(this,Te)[t].push(r),()=>{Z(this,Te)[t]=Z(this,Te)[t].filter(o=>o!==r)}}$destroy(){Z(this,le).$destroy()}}Te=new WeakMap,le=new WeakMap;let Ur;typeof HTMLElement=="function"&&(Ur=class extends HTMLElement{constructor(t,n,r){super();he(this,"$$ctor");he(this,"$$s");he(this,"$$c");he(this,"$$cn",!1);he(this,"$$d",{});he(this,"$$r",!1);he(this,"$$p_d",{});he(this,"$$l",{});he(this,"$$l_u",new Map);he(this,"$$me");this.$$ctor=t,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(t,n,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const o=this.$$c.$on(t,n);this.$$l_u.set(n,o)}super.addEventListener(t,n,r)}removeEventListener(t,n,r){if(super.removeEventListener(t,n,r),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return s=>{const l=document.createElement("slot");o!=="default"&&(l.name=o),se(s,l)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=$i(this);for(const o of this.$$s)o in r&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),n.default=!0):n[o]=t(o));for(const o of this.attributes){const s=this.$$g_p(o.name);s in this.$$d||(this.$$d[s]=St(s,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=Ei({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=Ln(()=>{jt(()=>{var o;this.$$r=!0;for(const s of At(this.$$c)){if(!((o=this.$$p_d[s])!=null&&o.reflect))continue;this.$$d[s]=this.$$c[s];const l=St(s,this.$$d[s],this.$$p_d,"toAttribute");l==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,l)}this.$$r=!1})});for(const o in this.$$l)for(const s of this.$$l[o]){const l=this.$$c.$on(o,s);this.$$l_u.set(s,l)}this.$$l={}}}attributeChangedCallback(t,n,r){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=St(t,r,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return At(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function St(e,t,n,r){var s;const o=(s=n[e])==null?void 0:s.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function $i(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function Ct(e,t,n,r,o,s){let l=class extends Ur{constructor(){super(e,n,o),this.$$p_d=t}static get observedAttributes(){return At(t).map(d=>(t[d].attribute||d).toLowerCase())}};return At(t).forEach(d=>{Dt(l.prototype,d,{get(){return this.$$c&&d in this.$$c?this.$$c[d]:this.$$d[d]},set(v){var m;v=St(d,v,t),this.$$d[d]=v;var f=this.$$c;if(f){var h=(m=je(f,d))==null?void 0:m.get;h?f[d]=v:f.$set({[d]:v})}}})}),r.forEach(d=>{Dt(l.prototype,d,{get(){var v;return(v=this.$$c)==null?void 0:v[d]}})}),e.element=l,l}const Ae=new Map([["yellow","#F8B920"],["red","#FF4646"],["blue","#0064FF"],["green","#00C564"]]),ki=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function Fn(e){const t=document.documentElement.lang||void 0,n=e.map(d=>d.trim().toLocaleLowerCase(t)),r=n.map(()=>({start:null,end:null,shift:0})),o=n.map(()=>[]),s=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,d=>{var v,f;return ki.includes((v=d.parentNode)==null?void 0:v.tagName)||((f=d.parentNode)==null?void 0:f.contentEditable)=="true"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let l;for(;l=s.nextNode();)if(l!=null&&l.nodeValue)for(let d=0;d{var g,w;for(;f[r[h].shift]&&!f[r[h].shift].trim();)r[h].shift++;let m=f[r[h].shift]===v;if(!m&&r[h].shift&&(r[h].shift=0,m=f[r[h].shift]===v),m&&(r[h].shift||(r[h].start=[l,d]),r[h].end=[l,d],r[h].shift++),r[h].shift>=f.length){const y=document.createRange();y.setStart(r[h].start[0],r[h].start[1]),y.setEnd(r[h].end[0],r[h].end[1]+1),!y.collapsed&&(!((g=y.commonAncestorContainer.parentElement)!=null&&g.checkVisibility)||(w=y.commonAncestorContainer.parentElement)!=null&&w.checkVisibility())?o[h].push(y):y.detach(),m=!1}m||(r[h].shift=0,r[h].start=null,r[h].end=null)})}return o}const ze=`rh-${new Date().getTime()}-`,Xt="highlights"in CSS;function xi(e){if(!e.length&&!CSS.highlights.size)return;const t=[];if(CSS.highlights.clear(),e.length){const r=Fn(e.map(({text:o})=>o||""));for(const o in e){const s=r[o];if(!s.length)continue;const{_id:l,color:d,note:v,index:f=0}=e[o],h=`${ze}${l}`,m=(s==null?void 0:s[f])||s[0];CSS.highlights.set(h,new Highlight(m));const g=m.getBoundingClientRect();t.push(` ::highlight(${h}) { all: unset; - background-color: color-mix(in srgb, ${je.get(f)||f||"yellow"}, white 60%) !important; - color: color-mix(in srgb, ${je.get(f)||f||"yellow"}, black 80%) !important; - ${p?"text-decoration: underline wavy; -webkit-text-decoration: underline wavy;":""} + background-color: color-mix(in srgb, ${Ae.get(d)||d||"yellow"}, white 60%) !important; + color: color-mix(in srgb, ${Ae.get(d)||d||"yellow"}, black 80%) !important; + ${v?"text-decoration: underline wavy; -webkit-text-decoration: underline wavy;":""} text-decoration-thickness: from-font; } @@ -12,78 +12,97 @@ color: CanvasText !important; } + /* pdf render */ + .pdf ::highlight(${h}) { + background-color: color-mix(in srgb, ${Ae.get(d)||d||"yellow"}, transparent 60%) !important; + color: transparent !important; + } + :root { - --highlight-${l}-top: ${(100/document.documentElement.scrollHeight*(window.scrollY+m.top-10)).toFixed(2)}%; + --highlight-${l}-top: ${(100/document.documentElement.scrollHeight*(window.scrollY+g.top-10)).toFixed(2)}%; } - `);for(const b of s)b.detach()}}const n=(()=>{let r=document.getElementById(Ie);return r||(r=document.createElement("style"),r.id=Ie,document.head.appendChild(r)),r})();n.innerHTML=t.join(` -`)}function pi(){var e;(e=document.getElementById(Ie))==null||e.remove()}function _i(e){var t;for(const[n,r]of CSS.highlights){const o=n.replace(Ie,"");if(e==o)for(const s of r){(t=s.startContainer.parentElement)==null||t.scrollIntoView({behavior:"smooth",block:"start"});break}}}function gi(e){let t;for(const[n,r]of CSS.highlights)for(const o of r){const s=e.compareBoundaryPoints(Range.START_TO_START,o),l=e.compareBoundaryPoints(Range.END_TO_END,o);(s==0&&l==0||e!=null&&e.collapsed&&s>=0&&l<=0)&&(t=[n.replace(Ie,""),o])}if(t)return t[0].replace(Ie,"")}const $e=`rh-${new Date().getTime()}`;function mi(e){const t=document.body.querySelectorAll(`.${$e}`);if(!e.length&&!t.length)return;t.forEach(s=>s.outerHTML=s.innerText);const n=[],r=Ln(e.map(({text:s})=>s||""));for(const s in e){const{_id:l,color:f}=e[s];for(const p of r[s]){const d=document.createElement("mark");d.className=$e,d.setAttribute("data-id",String(l)),d.append(p.extractContents()),p.insertNode(d),p.detach()}n.push(` - .${$e}[data-id="${l}"] { + `);for(const w of s)w.detach()}}const n=(()=>{let r=document.getElementById(ze);return r||(r=document.createElement("style"),r.id=ze,document.head.appendChild(r)),r})();n.innerHTML=t.join(` +`)}function Ti(){var e;(e=document.getElementById(ze))==null||e.remove()}function Ni(e){var t;for(const[n,r]of CSS.highlights){const o=n.replace(ze,"");if(e==o)for(const s of r){(t=s.startContainer.parentElement)==null||t.scrollIntoView({behavior:"smooth",block:"start"});break}}}function Si(e){let t;for(const[n,r]of CSS.highlights)for(const o of r){const s=e.compareBoundaryPoints(Range.START_TO_START,o),l=e.compareBoundaryPoints(Range.END_TO_END,o);(s==0&&l==0||e!=null&&e.collapsed&&s>=0&&l<=0)&&(t=[n.replace(ze,""),o])}if(t)return t[0].replace(ze,"")}const Ne=`rh-${new Date().getTime()}`;function Ai(e){const t=document.body.querySelectorAll(`.${Ne}`);if(!e.length&&!t.length)return;t.forEach(s=>s.outerHTML=s.innerText);const n=[],r=Fn(e.map(({text:s})=>s||""));for(const s in e){const{_id:l,color:d}=e[s];for(const v of r[s]){const f=document.createElement("mark");f.className=Ne,f.setAttribute("data-id",String(l)),f.append(v.extractContents()),v.insertNode(f),v.detach()}n.push(` + .${Ne}[data-id="${l}"] { all: unset; display: inline-block !important; background-color: white !important; - background-image: linear-gradient(to bottom, ${rr(je.get(f)||f,.4)} 0, ${rr(je.get(f)||f,.4)} 100%) !important; + background-image: linear-gradient(to bottom, ${sr(Ae.get(d)||d,.4)} 0, ${sr(Ae.get(d)||d,.4)} 100%) !important; color: black !important; } - `)}const o=(()=>{let s=document.getElementById($e);return s||(s=document.createElement("style"),s.id=$e,document.head.appendChild(s)),s})();o.innerHTML=n.join(` -`)}function yi(){var e;document.body.querySelectorAll(`.${$e}`).forEach(t=>t.outerHTML=t.innerText),(e=document.getElementById($e))==null||e.remove()}function wi(e){const t=document.body.querySelector(`.${$e}[data-id="${e}"]`);t&&t.scrollIntoView({behavior:"smooth",block:"start"})}function bi(e){const t=e.commonAncestorContainer.nodeType==Node.ELEMENT_NODE?e.commonAncestorContainer:e.commonAncestorContainer.parentElement;if((t==null?void 0:t.className)==$e){if(!e.collapsed){const n=new Range;n.selectNodeContents(e.commonAncestorContainer);const r=e.compareBoundaryPoints(Range.START_TO_START,n),o=e.compareBoundaryPoints(Range.END_TO_END,n);if(n.detach(),r!=0||o!=0)return}return t.getAttribute("data-id")||void 0}}function rr(e,t){if(!e)return e;const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${o}, ${t})`}function Ei(e){return Bt?vi(e):mi(e)}function Qt(e){return Ei(e)}function Ci(){return Bt?pi():yi()}function Br(e){return Bt?_i(e):wi(e)}function Vr(){var n,r,o;const e=document.getSelection();if(!(e!=null&&e.rangeCount))return;const t=e.getRangeAt(0);if(!((o=((n=t==null?void 0:t.commonAncestorContainer)==null?void 0:n.nodeType)==1?t==null?void 0:t.commonAncestorContainer:(r=t==null?void 0:t.commonAncestorContainer)==null?void 0:r.parentElement)!=null&&o.closest('[contenteditable=""], [contenteditable=true]')))return t}function at(){const e=document.getSelection();e!=null&&e.rangeCount&&e.removeAllRanges()}function ki(e){return Bt?gi(e):bi(e)}function Wr(e){if(!e)return"";var t=document.createElement("div");t.appendChild(e.cloneContents().cloneNode(!0)),document.body.appendChild(t);const n=t.innerText;return document.body.removeChild(t),t=void 0,n}function xi(e){if(!e)return;const t=Wr(e);if(!t)return;const[n]=Ln([t]),r=n.findIndex(o=>{const s=o.compareBoundaryPoints(Range.START_TO_START,e),l=o.compareBoundaryPoints(Range.END_TO_END,e);return s==0&&l==0||(e==null?void 0:e.collapsed)&&s>=0&&l<=0});return r==-1?void 0:r}function $i(e,t,n){let r=Fe(le([])),o=Fe(!1),s=Fe(!1),l=Fe(void 0);function f(b){const w=ki(b);if(w)return T(r).find(D=>D._id==w);const N=Wr(b).trim();if(N)return{text:N,index:xi(b)}}function p(b){const w={...typeof b._id=="string"?{_id:b._id}:{},...typeof b.text=="string"?{text:b.text}:{},...typeof b.note=="string"?{note:b.note}:{},...typeof b.index=="number"?{index:b.index}:{},color:b.color||"yellow"};if(!w.text)return;const N=T(r).findIndex(D=>{var M,k;return D._id==w._id||((M=D.text)==null?void 0:M.toLocaleLowerCase().trim())===((k=w.text)==null?void 0:k.toLocaleLowerCase().trim())});N!=-1?(w._id=T(r)[N]._id,T(r)[N]=w,t(w)):(T(r).push(w),e(w))}function d({_id:b}){W(r,le(T(r).filter(w=>w._id!=b))),n({_id:b})}function h(b){W(l,le(JSON.parse(JSON.stringify(b))))}function g(){T(l)&&(p(T(l)),W(l,void 0))}function m(){W(l,void 0)}return{get highlights(){return T(r)},set highlights(b){W(r,le(b))},get pro(){return T(o)},set pro(b){W(o,le(b))},get nav(){return T(s)},set nav(b){W(s,le(b))},get draft(){return T(l)},find:f,upsert:p,remove:d,setDraft:h,draftSubmit:g,draftCancel:m}}const Ti="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ti);function Ni(e,t){let n=null,r=!0;return function(...s){n||(r?(e(...s),r=!1):(clearTimeout(n),n=setTimeout(()=>{e(...s),clearTimeout(n),n=null},t)))}}function dn(){var e;return(e=navigator==null?void 0:navigator.userAgentData)!=null&&e.mobile?!0:/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)}var Si=be(''),Ai=be(''),Di=be('
');const Oi={hash:"svelte-nxgeeo",code:`.svelte-nxgeeo {user-select:none;-webkit-user-select:none;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}dialog.svelte-nxgeeo {--control-size: 16px;--padding-s: 6px;--padding-m: 8px;--bg-light: rgb(255, 255, 255);--bg-dark: rgb(60, 60, 60);--control-fg-light: rgb(65, 65, 65);--control-fg-dark: rgb(230, 230, 230);--hover-bg-light: rgba(0,0,0,.07);--hover-bg-dark: rgba(255,255,255,.1);--active-bg-light: rgba(0,0,0,.13);--active-bg-dark: rgba(255,255,255,.2);} + `)}const o=(()=>{let s=document.getElementById(Ne);return s||(s=document.createElement("style"),s.id=Ne,document.head.appendChild(s)),s})();o.innerHTML=n.join(` +`)}function Di(){var e;document.body.querySelectorAll(`.${Ne}`).forEach(t=>t.outerHTML=t.innerText),(e=document.getElementById(Ne))==null||e.remove()}function Li(e){const t=document.body.querySelector(`.${Ne}[data-id="${e}"]`);t&&t.scrollIntoView({behavior:"smooth",block:"start"})}function Mi(e){const t=e.commonAncestorContainer.nodeType==Node.ELEMENT_NODE?e.commonAncestorContainer:e.commonAncestorContainer.parentElement;if((t==null?void 0:t.className)==Ne){if(!e.collapsed){const n=new Range;n.selectNodeContents(e.commonAncestorContainer);const r=e.compareBoundaryPoints(Range.START_TO_START,n),o=e.compareBoundaryPoints(Range.END_TO_END,n);if(n.detach(),r!=0||o!=0)return}return t.getAttribute("data-id")||void 0}}function sr(e,t){if(!e)return e;const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${o}, ${t})`}function Oi(e){return Xt?xi(e):Ai(e)}function ln(e){return Oi(e)}function Ri(){return Xt?Ti():Di()}function Xr(e){return Xt?Ni(e):Li(e)}function Gr(){var n,r,o;const e=document.getSelection();if(!(e!=null&&e.rangeCount))return;const t=e.getRangeAt(0);if(!((o=((n=t==null?void 0:t.commonAncestorContainer)==null?void 0:n.nodeType)==1?t==null?void 0:t.commonAncestorContainer:(r=t==null?void 0:t.commonAncestorContainer)==null?void 0:r.parentElement)!=null&&o.closest('[contenteditable=""], [contenteditable=true]')))return t}function dt(){const e=document.getSelection();e!=null&&e.rangeCount&&e.removeAllRanges()}function qi(e){return Xt?Si(e):Mi(e)}function Kr(e){if(!e)return"";var t=document.createElement("div");t.appendChild(e.cloneContents().cloneNode(!0)),t.querySelectorAll("tspan").forEach(r=>r.outerHTML=`${r.innerHTML}`),t.querySelectorAll("text").forEach(r=>r.outerHTML=`
${r.innerHTML}
`),document.body.appendChild(t);const n=t.innerText;return document.body.removeChild(t),t=void 0,n}function Pi(e){if(!e)return;const t=Kr(e);if(!t)return;const[n]=Fn([t]),r=n.findIndex(o=>{const s=o.compareBoundaryPoints(Range.START_TO_START,e),l=o.compareBoundaryPoints(Range.END_TO_END,e);return s==0&&l==0||(e==null?void 0:e.collapsed)&&s>=0&&l<=0});return r==-1?void 0:r}function Fi(e,t,n){let r=Me(ce([])),o=Me(!1),s=Me(!1),l=Me(void 0);function d(w){const y=qi(w);if(y)return x(r).find(D=>D._id==y);const N=Kr(w).trim();if(N)return{text:N,index:Pi(w)}}function v(w){const y={...typeof w._id=="string"?{_id:w._id}:{},...typeof w.text=="string"?{text:w.text}:{},...typeof w.note=="string"?{note:w.note}:{},...typeof w.index=="number"?{index:w.index}:{},color:w.color||"yellow"};if(!y.text)return;const N=x(r).findIndex(D=>{var O,M;return D._id==y._id||((O=D.text)==null?void 0:O.toLocaleLowerCase().trim())===((M=y.text)==null?void 0:M.toLocaleLowerCase().trim())});N!=-1?(y._id=x(r)[N]._id,x(r)[N]=y,t(y)):(x(r).push(y),e(y))}function f({_id:w}){j(r,ce(x(r).filter(y=>y._id!=w))),n({_id:w})}function h(w){j(l,ce(JSON.parse(JSON.stringify(w))))}function m(){x(l)&&(v(x(l)),j(l,void 0))}function g(){j(l,void 0)}return{get highlights(){return x(r)},set highlights(w){j(r,ce(w))},get pro(){return x(o)},set pro(w){j(o,ce(w))},get nav(){return x(s)},set nav(w){j(s,ce(w))},get draft(){return x(l)},find:d,upsert:v,remove:f,setDraft:h,draftSubmit:m,draftCancel:g}}const Hi="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Hi);function Ii(e,t){let n=null,r=!0;return function(...s){n||(r?(e(...s),r=!1):(clearTimeout(n),n=setTimeout(()=>{e(...s),clearTimeout(n),n=null},t)))}}function wn(){var e;return(e=navigator==null?void 0:navigator.userAgentData)!=null&&e.mobile?!0:/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)}var Bi=me(''),ji=me(''),Vi=me('
');const zi={hash:"svelte-1rsw1q7",code:`.svelte-1rsw1q7 {user-select:none;-webkit-user-select:none;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}dialog.svelte-1rsw1q7 {transform-origin:0 0;transform:scale(var(--mobile-zoom-level, 1));--control-size: 16px;--padding-s: 6px;--padding-m: 8px;--bg-light: rgb(255, 255, 255);--bg-dark: rgb(60, 60, 60);--control-fg-light: rgb(65, 65, 65);--control-fg-dark: rgb(230, 230, 230);--hover-bg-light: rgba(0,0,0,.07);--hover-bg-dark: rgba(255,255,255,.1);--active-bg-light: rgba(0,0,0,.13);--active-bg-dark: rgba(255,255,255,.2);} - @supports (background-color: -apple-system-control-background) {dialog.svelte-nxgeeo {--bg-light: rgba(255, 255, 255, .8);--bg-dark: rgba(60, 60, 60, .8);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);} - }dialog.mobile.svelte-nxgeeo {--control-size: 26px;}dialog.svelte-nxgeeo {position:absolute;left:unset;top:unset;right:unset;bottom:unset;border:none;padding:2px;border-radius:var(--control-size);overflow:clip;z-index:999999999999999;background:var(--bg-light);color:var(--control-fg-light); + /* Safari iOS fix position bug */ + @supports (background-color: -apple-system-control-background) {dialog.svelte-1rsw1q7 {transform-origin:top right;} + } + + @supports (background-color: -apple-system-control-background) {dialog.svelte-1rsw1q7 {--bg-light: rgba(255, 255, 255, .8);--bg-dark: rgba(60, 60, 60, .8);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);} + }dialog.mobile.svelte-1rsw1q7 {--control-size: 26px;}dialog.svelte-1rsw1q7 {position:absolute;left:unset;top:unset;right:unset;bottom:unset;border:none;padding:2px;border-radius:var(--control-size);overflow:clip;z-index:999999999999999;background:var(--bg-light);color:var(--control-fg-light); @supports(color: light-dark(white,black)) {background:light-dark(var(--bg-light), var(--bg-dark));color:light-dark(var(--control-fg-light), var(--control-fg-dark)); - }}dialog.mobile.new.svelte-nxgeeo {position:fixed;top:auto !important;left:auto !important;right:16px !important;bottom:16px !important;margin-right:env(safe-area-inset-right);margin-bottom:env(safe-area-inset-bottom);}[open].svelte-nxgeeo {box-shadow:0 0 0 .5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.05), 0 15px 40px rgba(0,0,0,.1);}form.svelte-nxgeeo {display:flex;gap:2px;margin:0;padding:0;}button.svelte-nxgeeo {border-radius:var(--control-size);border:0;background:transparent;cursor:pointer;appearance:none;touch-action:manipulation;width:calc(var(--control-size) + var(--padding-s)*2);height:calc(var(--control-size) + var(--padding-s)*2);padding:var(--padding-s);color:inherit;display:flex;align-items:center;justify-content:center;transition:background .15s ease-in-out;} + }} + + /* dialog.mobile.new { + position: fixed; + top: auto !important; + left: auto !important; + right: 16px !important; + bottom: 16px !important; + margin-right: env(safe-area-inset-right); + margin-bottom: env(safe-area-inset-bottom); + } */[open].svelte-1rsw1q7 {box-shadow:0 0 0 .5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.05), 0 15px 40px rgba(0,0,0,.1);}form.svelte-1rsw1q7 {display:flex;gap:2px;margin:0;padding:0;}button.svelte-1rsw1q7 {border-radius:var(--control-size);border:0;background:transparent;cursor:pointer;appearance:none;touch-action:manipulation;width:calc(var(--control-size) + var(--padding-s)*2);height:calc(var(--control-size) + var(--padding-s)*2);padding:var(--padding-s);color:inherit;display:flex;align-items:center;justify-content:center;transition:background .15s ease-in-out;} - @media (pointer: fine) {button.svelte-nxgeeo:hover {transition:none;background:var(--hover-bg-light); + @media (pointer: fine) {button.svelte-1rsw1q7:hover {transition:none;background:var(--hover-bg-light); @supports(color: light-dark(white,black)) {background:light-dark(var(--hover-bg-light), var(--hover-bg-dark)); }} - }button.svelte-nxgeeo:active {transition:none;background:var(--active-bg-light); + }button.svelte-1rsw1q7:active {transition:none;background:var(--active-bg-light); @supports(color: light-dark(white,black)) {background:light-dark(var(--active-bg-light), var(--active-bg-dark)); - }}svg.svelte-nxgeeo {stroke:currentColor;stroke-width:1.5px;}.color.svelte-nxgeeo {pointer-events:none;content:'';display:block;width:15px;height:15px;background:var(--color);transition:background .15s ease-in-out, box-shadow .15s ease-in-out;border-radius:50%;}.color.active.svelte-nxgeeo {background:transparent;box-shadow:inset 0 0 0 5px var(--color);} + }}svg.svelte-1rsw1q7 {stroke:currentColor;stroke-width:1.5px;}.color.svelte-1rsw1q7 {pointer-events:none;content:'';display:block;width:15px;height:15px;background:var(--color);transition:background .15s ease-in-out, box-shadow .15s ease-in-out;border-radius:50%;}.color.active.svelte-1rsw1q7 {background:transparent;box-shadow:inset 0 0 0 5px var(--color);} - /* animation */dialog.svelte-nxgeeo {transition:display .25s allow-discrete ease-in-out, + /* animation */dialog.svelte-1rsw1q7 {transition:display .25s allow-discrete ease-in-out, overlay .25s allow-discrete ease-in-out, box-shadow .25s allow-discrete ease-in-out, - opacity .25s ease-in-out;opacity:0;}[open].svelte-nxgeeo {opacity:1;}dialog.svelte-nxgeeo:not([open]:where(.svelte-nxgeeo)) {transition-duration:.2s;pointer-events:none;} + opacity .25s ease-in-out;opacity:0;}[open].svelte-1rsw1q7 {opacity:1;}dialog.svelte-1rsw1q7:not([open]) {transition-duration:.2s;pointer-events:none;} - @starting-style {[open].svelte-nxgeeo {opacity:0;} - }`};function Yr(e,t){yt(t,!0),On(e,Oi);let n=It(t,"store",7),r,o=Fe(void 0),s=Fe(!1);function l(A){if(!T(o))return;const j=A.currentTarget.returnValue;switch(A.currentTarget.returnValue="",j){case"add":n().upsert(T(o)),at();break;case"note":n().setDraft(T(o)),at();break;case"remove":n().remove(T(o)),at();break;default:if(je.has(j)){n().upsert({...T(o),color:j}),at();return}break}}function f(){W(s,!0)}function p(){W(s,!1),setTimeout(d)}function d(){if(T(s)){r==null||r.close();return}requestAnimationFrame(()=>{const A=Vr(),j=A&&n().find(A);if(!A||!(j!=null&&j._id)&&!A.toString().trim()){r==null||r.close();return}W(o,le(j)),r.inert=!0,r==null||r.show(),r.inert=!1;const B=256,I=10,R=A.getBoundingClientRect(),z=Math.min(Math.max(R.x,I)+window.scrollX,window.innerWidth+window.scrollX-B-I),X=Math.min(window.innerWidth-Math.max(R.x,I)-window.scrollX-R.width,window.innerWidth-window.scrollX-B-I),Ee=Math.max(R.y,40)+window.scrollY+R.height+4;window.innerHeight-Math.max(R.y,40)-window.scrollY+4;const ce=zct(g,"mobile",T(m)));var b=ae(g),w=ae(b);Dn(w,17,()=>je,([A,j])=>A,(A,j)=>{let B=()=>T(j)[0],I=()=>T(j)[1];var R=Si(),z=ae(R);J(R),xe(()=>{var X;se(R,"aria-label",B()),ii(R,B()),se(z,"style",`--color: ${I()??""}`),ct(z,"active",B()==((X=T(o))==null?void 0:X.color))}),ue(A,R)});var N=re(w,2),D=ae(N),M=ae(D),k=ae(M),x=re(k),$=re(x),L=re($);J(M),J(D),J(N);var oe=re(N,2);return Lt(oe,()=>{var A;return(A=T(o))==null?void 0:A._id},A=>{var j=Ai();ue(A,j)}),J(b),J(g),fn(g,A=>r=A,()=>r),xe(()=>{var A,j,B,I,R,z;ct(g,"new",!((A=T(o))!=null&&A._id)),se(k,"fill",(j=T(o))!=null&&j.note?"currentColor":"none"),se(k,"stroke-width",(B=T(o))!=null&&B.note?"0":void 0),se(x,"fill",(I=T(o))!=null&&I.note?"none":"currentColor"),se($,"fill",(R=T(o))!=null&&R.note?"none":"currentColor"),se(L,"fill",(z=T(o))!=null&&z.note?"none":"currentColor")}),_e("close",g,l),ue(e,g),wt({get store(){return n()},set store(A){n(A),tt()}})}qt(Yr,{store:{}},[],[],!0);function Li(e){const t=e.currentTarget.getBoundingClientRect();t.top<=e.clientY&&e.clientY<=t.top+t.height&&t.left<=e.clientX&&e.clientX<=t.left+t.width||(e.preventDefault(),e.currentTarget.close())}var Mi=(e,t)=>W(t,!1),ji=be(''),Ri=be('
Upgrade to Pro to unlock annotation
'),Fi=be('
',1),Pi=be('
');const Hi={hash:"svelte-n7j6yt",code:`.svelte-n7j6yt {box-sizing:border-box;-webkit-tap-highlight-color:transparent;}dialog.svelte-n7j6yt {--bg-light: rgb(245, 245, 245);--bg-dark: rgb(35, 35, 35);--fg-light: black;--fg-dark: white;--control-bg-light: rgb(230, 230, 230);--control-bg-dark: rgb(55, 55, 55);font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;font-size:18px;line-height:1.4;border:none;border-radius:.5em;padding:0;overscroll-behavior:none;color:var(--fg-light); + @starting-style {[open].svelte-1rsw1q7 {opacity:0;} + }`};function Jr(e,t){st(t,!0),Ut(e,zi);let n=Et(t,"store",7),r,o=Me(void 0),s=Me(!1);function l(S){if(!x(o))return;const I=S.currentTarget.returnValue;switch(S.currentTarget.returnValue="",I){case"add":n().upsert(x(o)),dt();break;case"note":n().setDraft(x(o)),dt();break;case"remove":n().remove(x(o)),dt();break;default:if(Ae.has(I)){n().upsert({...x(o),color:I}),dt();return}break}}function d(){j(s,!0)}function v(){j(s,!1),setTimeout(f)}function f(){if(x(s)){r==null||r.close();return}requestAnimationFrame(()=>{const S=Gr(),I=S&&n().find(S);if(!S||!(I!=null&&I._id)&&!S.toString().trim()){r==null||r.close();return}j(o,ce(I)),r.inert=!0,r==null||r.show(),r.inert=!1;const W=256,q=10,R=S.getBoundingClientRect(),Y=Math.min(Math.max(R.x,q)+window.scrollX,window.innerWidth+window.scrollX-W-q),fe=Math.min(window.innerWidth-Math.max(R.x,q)-window.scrollX-R.width,window.innerWidth-window.scrollX-W-q),K=Math.max(R.y,40)+window.scrollY+R.height+4;window.innerHeight-Math.max(R.y,40)-window.scrollY+4;const de=Yvt(m,"mobile",x(g)));var w=oe(m),y=oe(w);Pn(y,17,()=>Ae,([S,I])=>S,(S,I)=>{let W=()=>x(I)[0],q=()=>x(I)[1];var R=Bi(),Y=oe(R);J(R),ye(()=>{var fe;ue(R,"aria-label",W()),_i(R,W()),ue(Y,"style",`--color: ${q()??""}`),vt(Y,"active",W()==((fe=x(o))==null?void 0:fe.color))}),se(S,R)});var N=ie(y,2),D=oe(N),O=oe(D),M=oe(O),$=ie(M),k=ie($),T=ie(k);J(O),J(D),J(N);var U=ie(N,2);{var X=S=>{var I=ji();se(S,I)};Ft(U,S=>{var I;(I=x(o))!=null&&I._id&&S(X)})}return J(w),J(m),gn(m,S=>r=S,()=>r),ye(()=>{var S,I,W,q,R,Y;vt(m,"new",!((S=x(o))!=null&&S._id)),ue(M,"fill",(I=x(o))!=null&&I.note?"currentColor":"none"),ue(M,"stroke-width",(W=x(o))!=null&&W.note?"0":void 0),ue($,"fill",(q=x(o))!=null&&q.note?"none":"currentColor"),ue(k,"fill",(R=x(o))!=null&&R.note?"none":"currentColor"),ue(T,"fill",(Y=x(o))!=null&&Y.note?"none":"currentColor")}),be("close",m,l),se(e,m),lt({get store(){return n()},set store(S){n(S),Ue()}})}Ct(Jr,{store:{}},[],[],!0);function Wi(e){const t=e.currentTarget.getBoundingClientRect();t.top<=e.clientY&&e.clientY<=t.top+t.height&&t.left<=e.clientX&&e.clientX<=t.left+t.width||(e.preventDefault(),e.currentTarget.close())}var Yi=(e,t)=>j(t,!1),Ui=me(''),Xi=me('
Upgrade to Pro to unlock annotation
'),Gi=me('
',1),Ki=me('
');const Ji={hash:"svelte-ub8p4v",code:`.svelte-ub8p4v {box-sizing:border-box;-webkit-tap-highlight-color:transparent;}dialog.svelte-ub8p4v {transform:scale(var(--mobile-zoom-level, 1));--bg-light: rgb(245, 245, 245);--bg-dark: rgb(35, 35, 35);--fg-light: black;--fg-dark: white;--control-bg-light: rgb(230, 230, 230);--control-bg-dark: rgb(55, 55, 55);font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;font-size:18px;line-height:1.4;border:none;border-radius:.5em;padding:0;overscroll-behavior:none;color:var(--fg-light); @supports(color: light-dark(white,black)) {color:light-dark(var(--fg-light), var(--fg-dark)); - }}dialog.mobile.svelte-n7j6yt {left:0;right:0;bottom:0;top:0;width:100%;margin:0;max-width:100%;max-height:100%;border-radius:0;bottom:auto;}dialog.svelte-n7j6yt, header.svelte-n7j6yt {background:var(--bg-light); + }}dialog.mobile.svelte-ub8p4v {left:0;right:0;bottom:0;top:0;width:100%;margin:0;max-width:100%;max-height:100%;border-radius:0;bottom:auto;}dialog.svelte-ub8p4v, header.svelte-ub8p4v {background:var(--bg-light); @supports(color: light-dark(white,black)) {background:light-dark(var(--bg-light), var(--bg-dark)); - }}[open].svelte-n7j6yt {box-shadow:0 0 0 .5px rgba(60, 60, 60, .9), 0 3px 10px rgba(0,0,0,.05), 0 7px 15px -3px rgba(0,0,0,.15);}.svelte-n7j6yt::backdrop {background-color:rgba(0,0,0,.3);}header.svelte-n7j6yt {margin:0;padding:1em;font-weight:bold;position:sticky;top:0;} + }}[open].svelte-ub8p4v {box-shadow:0 0 0 .5px rgba(60, 60, 60, .9), 0 3px 10px rgba(0,0,0,.05), 0 7px 15px -3px rgba(0,0,0,.15);}.svelte-ub8p4v::backdrop {background-color:rgba(0,0,0,.3);}header.svelte-ub8p4v {margin:0;padding:1em;font-weight:bold;position:sticky;top:0;} - @supports(animation-timeline: scroll()) {header.svelte-n7j6yt { - animation: svelte-n7j6yt-header-scroll linear both;animation-timeline:scroll();animation-range:0 1px;} + @supports(animation-timeline: scroll()) {header.svelte-ub8p4v { + animation: svelte-ub8p4v-header-scroll linear both;animation-timeline:scroll();animation-range:0 1px;} } - @keyframes svelte-n7j6yt-header-scroll { + @keyframes svelte-ub8p4v-header-scroll { to { box-shadow: 0 .5px 0 rgba(0,0,0,.2); } - }form.svelte-n7j6yt {display:flex;flex-direction:column;gap:1em;padding:1em;padding-top:0;}.color.svelte-n7j6yt {all:unset;display:flex;gap:.75em;}.color.svelte-n7j6yt input[type="radio"]:where(.svelte-n7j6yt) {cursor:pointer;appearance:none;user-select:none;-webkit-user-select:none;margin:0;background:var(--color);transition:box-shadow .2s ease-in-out, background .2s ease-in-out;width:2em;height:2em;border-radius:50%;}.color.svelte-n7j6yt input[type="radio"]:where(.svelte-n7j6yt):checked {background:transparent;box-shadow:inset 0 0 0 .5em var(--color);}.color.svelte-n7j6yt input[type="radio"]:where(.svelte-n7j6yt):active {transform:translateY(1px);}blockquote.svelte-n7j6yt, .note.svelte-n7j6yt, button.svelte-n7j6yt {background:var(--control-bg-light); + }form.svelte-ub8p4v {display:flex;flex-direction:column;gap:1em;padding:1em;padding-top:0;}.color.svelte-ub8p4v {all:unset;display:flex;gap:.75em;}.color.svelte-ub8p4v input[type="radio"]:where(.svelte-ub8p4v) {cursor:pointer;appearance:none;user-select:none;-webkit-user-select:none;margin:0;background:var(--color);transition:box-shadow .2s ease-in-out, background .2s ease-in-out;width:2em;height:2em;border-radius:50%;}.color.svelte-ub8p4v input[type="radio"]:where(.svelte-ub8p4v):checked {background:transparent;box-shadow:inset 0 0 0 .5em var(--color);}.color.svelte-ub8p4v input[type="radio"]:where(.svelte-ub8p4v):active {transform:translateY(1px);}blockquote.svelte-ub8p4v, .note.svelte-ub8p4v, button.svelte-ub8p4v {background:var(--control-bg-light); @supports(color: light-dark(white,black)) {background:light-dark(var(--control-bg-light), var(--control-bg-dark)); - }}blockquote.svelte-n7j6yt {white-space:pre-wrap;margin:0;min-width:100%;width:0;font-size:16px;}blockquote.compact.svelte-n7j6yt {white-space:nowrap;text-overflow:ellipsis;overflow:hidden;overflow:clip;}blockquote.svelte-n7j6yt, .note.svelte-n7j6yt {border-radius:.5em;padding:.5em .6em;}.note.svelte-n7j6yt {min-width:min(21em, 70vw);min-height:4lh;appearance:none;border:0;font:inherit;color:inherit;display:block;scroll-margin-top:100vh;transition:background .15s ease-in-out, box-shadow .15s ease-in-out;}.note.svelte-n7j6yt:focus {background:transparent;}footer.svelte-n7j6yt {all:unset;display:flex;justify-content:flex-end;gap:.75em;}button.svelte-n7j6yt {appearance:none;user-select:none;-webkit-user-select:none;touch-action:manipulation;border:0;font:inherit;color:inherit;cursor:pointer;padding:.25em .75em;border-radius:.5em;}button.svelte-n7j6yt:active {transform:translateY(1px);}button.svelte-n7j6yt sup:where(.svelte-n7j6yt) {margin-left:.25em;vertical-align:text-top;opacity:.5;}dialog.mobile.svelte-n7j6yt button:where(.svelte-n7j6yt) sup:where(.svelte-n7j6yt) {display:none;}button[value].svelte-n7j6yt {background:blue;background:AccentColor;color:white;}.unlock.svelte-n7j6yt {font-size:.75em;color:GrayText;} + }}blockquote.svelte-ub8p4v {white-space:pre-wrap;margin:0;min-width:100%;width:0;font-size:16px;}blockquote.compact.svelte-ub8p4v {white-space:nowrap;text-overflow:ellipsis;overflow:hidden;overflow:clip;}blockquote.svelte-ub8p4v, .note.svelte-ub8p4v {border-radius:.5em;padding:.5em .6em;}.note.svelte-ub8p4v {min-width:min(21em, 70vw);min-height:4lh;appearance:none;border:0;font:inherit;color:inherit;display:block;scroll-margin-top:100vh;transition:background .15s ease-in-out, box-shadow .15s ease-in-out;}.note.svelte-ub8p4v:focus {background:transparent;}footer.svelte-ub8p4v {all:unset;display:flex;justify-content:flex-end;gap:.75em;}button.svelte-ub8p4v {appearance:none;user-select:none;-webkit-user-select:none;touch-action:manipulation;border:0;font:inherit;color:inherit;cursor:pointer;padding:.25em .75em;border-radius:.5em;}button.svelte-ub8p4v:active {transform:translateY(1px);}button.svelte-ub8p4v sup:where(.svelte-ub8p4v) {margin-left:.25em;vertical-align:text-top;opacity:.5;}dialog.mobile.svelte-ub8p4v button:where(.svelte-ub8p4v) sup:where(.svelte-ub8p4v) {display:none;}button[value].svelte-ub8p4v {background:blue;background:AccentColor;color:white;}.unlock.svelte-ub8p4v {font-size:.75em;color:GrayText;} - /* animation */dialog.svelte-n7j6yt, .svelte-n7j6yt::backdrop {transition:display .2s allow-discrete ease-in-out, + /* animation */dialog.svelte-ub8p4v, .svelte-ub8p4v::backdrop {transition:display .2s allow-discrete ease-in-out, overlay .2s allow-discrete ease-in-out, opacity .2s ease-in-out, - transform .2s ease-in-out, - box-shadow .2s ease-in-out;opacity:0;}dialog.svelte-n7j6yt {transform:translateY(1em);}[open].svelte-n7j6yt, - [open].svelte-n7j6yt::backdrop {opacity:1;transform:translateY(0);} + box-shadow .2s ease-in-out;opacity:0;}[open].svelte-ub8p4v, + [open].svelte-ub8p4v::backdrop {opacity:1;} - @starting-style {[open].svelte-n7j6yt, - [open].svelte-n7j6yt::backdrop {opacity:0;}[open].svelte-n7j6yt {transform:translateY(-1em);} + @starting-style {[open].svelte-ub8p4v, + [open].svelte-ub8p4v::backdrop {opacity:0;} } - @supports not selector(::highlight(a)) {dialog.svelte-n7j6yt, dialog.svelte-n7j6yt::backdrop { - animation: svelte-n7j6yt-simple-appear .2s forwards;} - @keyframes svelte-n7j6yt-simple-appear { + @supports not selector(::highlight(a)) {dialog.svelte-ub8p4v, dialog.svelte-ub8p4v::backdrop { + animation: svelte-ub8p4v-simple-appear .2s forwards;} + @keyframes svelte-ub8p4v-simple-appear { from { opacity: 0; } to { opacity: 1; } } - }`};function Ur(e,t){yt(t,!0),On(e,Hi);const n=[];let r=It(t,"store",7),o,s,l=Fe(!0);nn(()=>{r().draft?(W(l,!0),o==null||o.showModal()):o==null||o.close()});function f(k){const x=k.currentTarget.returnValue;k.currentTarget.returnValue="",setTimeout(x?r().draftSubmit:r().draftCancel,200)}function p(k){var x;dn()||(k.stopImmediatePropagation(),k.stopPropagation(),k.key=="Enter"&&!k.shiftKey&&(k.preventDefault(),s&&((x=k.currentTarget.closest("form"))==null||x.requestSubmit(s))))}var d=Pi();d.__mousedown=[Li];const h=Mt(dn);xe(()=>ct(d,"mobile",T(h)));var g=ae(d),m=ae(g);J(g);var b=re(g,2),w=ae(b);Lt(w,()=>r().draft,k=>{var x=Fi(),$=Sn(x);$.__click=[Mi,l];var L=ae($,!0);xe(()=>{var B,I;return Gt(L,((I=(B=r().draft)==null?void 0:B.text)==null?void 0:I.trim())||"")}),J($);var oe=re($,2);Dn(oe,21,()=>je,Zo,(B,I)=>{let R=()=>T(I)[0],z=()=>T(I)[1];var X=ji();oi(X);var Ee;xe(()=>{Ee!==(Ee=R())&&(X.value=(X.__value=R())==null?"":R()),se(X,"style",`--color: ${z()??""}`)}),ai(n,[],X,()=>(R(),r().draft.color),ce=>r().draft.color=ce),ue(B,X)}),J(oe);var A=re(oe,2);ri(A),ni(A),A.__keydown=p;var j=re(A,2);Lt(j,()=>!r().pro,B=>{var I=Ri();ue(B,I)}),xe(()=>{ct($,"compact",T(l)),A.disabled=!r().pro}),li(A,()=>r().draft.note,B=>r().draft.note=B),ue(k,x)});var N=re(w,2),D=re(ae(N),2),M=ae(D);return Wo(),J(D),fn(D,k=>s=k,()=>s),J(N),J(b),J(d),fn(d,k=>o=k,()=>o),xe(()=>{var k,x;Gt(m,`${((k=r().draft)!=null&&k._id?"Edit":"New")??""} highlight`),Gt(M,`${((x=r().draft)!=null&&x._id?"Update":"Create")??""} `)}),_e("close",d,f),ue(e,d),wt({get store(){return r()},set store(k){r(k),tt()}})}jr(["mousedown","click","keydown"]);qt(Ur,{store:{}},[],[],!0);const Ii=e=>{const t=e.target.getAttribute("data-highlight");t&&(e.preventDefault(),Br(t))};var qi=be('
'),Bi=be('');const Vi={hash:"svelte-rwfy02",code:"nav.svelte-rwfy02 {all:unset;}div.svelte-rwfy02 {position:fixed;right:0;width:24px;height:20px;display:flex;justify-content:flex-end;align-items:center;cursor:pointer;background:transparent;z-index:99999999999999;}div.svelte-rwfy02::before {content:'';display:block;height:3px;border-radius:3px;width:16px;background:var(--color);transition:width .15s ease-in-out;}div.svelte-rwfy02:hover::before {width:100%;}"};function zr(e,t){yt(t,!0),On(e,Vi);let n=It(t,"store",7);var r=zo(),o=Sn(r);return Lt(o,()=>n().nav,s=>{var l=Bi();l.__click=[Ii],Dn(l,21,()=>n().highlights,f=>f._id,(f,p)=>{var d=qi();const h=Mt(()=>`top: var(--highlight-${T(p)._id??""}-top); --color: ${(je.get(T(p).color)||T(p).color)??""}`);xe(()=>{se(d,"data-highlight",T(p)._id),se(d,"style",T(h))}),ue(f,d)}),J(l),ue(s,l)}),ue(e,r),wt({get store(){return n()},set store(s){n(s),tt()}})}jr(["click"]);qt(zr,{store:{}},[],[],!0);var Wi=be(" ",1);function Yi(e,t){yt(t,!0);let n=It(t,"store",7);nn(()=>{Qt(n().highlights)});let r;function o(){Qt(n().highlights),clearTimeout(r),r=setTimeout(()=>Qt(n().highlights),3e3)}kn(()=>{document.readyState&&o()}),nn(()=>Ci);var s=Wi();_e("load",Ot,o),_e("popstate",Ot,o);var l=Sn(s);Yr(l,{get store(){return n()}});var f=re(l,2);Ur(f,{get store(){return n()}});var p=re(f,2);return zr(p,{get store(){return n()}}),ue(e,s),wt({get store(){return n()},set store(d){n(d),tt()}})}customElements.define("rdh-ui",qt(Yi,{store:{}},[],[],!0));function Ui(e){if(typeof chrome=="object"&&chrome.runtime&&chrome.runtime.onMessage||typeof browser=="object"&&browser.runtime&&browser.runtime.onMessage){const{runtime:t}=typeof browser=="object"?browser:chrome,n=(r,o)=>{o.id==t.id&&typeof r.type=="string"&&e(r)};return t.onMessage.removeListener(n),t.onMessage.addListener(n),r=>t.sendMessage(null,r)}if(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.rdh)return window.rdhSend=e,t=>window.webkit.messageHandlers.rdh.postMessage(t);if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron){const{ipcRenderer:t}=require("electron"),n=(r,o)=>e(o);return t.removeListener("RDH",n),t.on("RDH",n),r=>t.sendToHost("RDH",r)}if("ReactNativeWebView"in window)return window.ReactNativeWebViewSendMessage=e,t=>window.ReactNativeWebView.postMessage(JSON.stringify(t));if(window.self!==window.top){const t=({data:n,source:r})=>{r!==window.parent||typeof n!="object"||typeof n.type!="string"||e(n)};return window.removeEventListener("message",t),window.addEventListener("message",t),n=>window.parent.postMessage(n,"*")}throw new Error("unsupported platform")}async function zi(e){let t=!1;const n=new Set,r=Ui(o=>{if(!t){n.add(o);return}e(o)});await new Promise(o=>{function s(){window.removeEventListener("DOMContentLoaded",s),o()}document.readyState=="loading"?(window.removeEventListener("DOMContentLoaded",s),window.addEventListener("DOMContentLoaded",s,{once:!0})):o()}),t=!0;for(const o of n)e(o),n.delete(o);return r}const st=document.createElement("rdh-ui");(async()=>{const e=await zi(n=>{switch(n.type){case"RDH_APPLY":Array.isArray(n.payload)&&(t.highlights=n.payload);break;case"RDH_CONFIG":typeof n.payload.pro=="boolean"&&(t.pro=n.payload.pro),typeof n.payload.nav=="boolean"&&(t.nav=n.payload.nav),typeof n.payload.enabled=="boolean"&&(n.payload.enabled===!0?document.body.contains(st)||document.body.appendChild(st):document.body.contains(st)&&document.body.removeChild(st));break;case"RDH_SCROLL":typeof n.payload._id=="string"&&Br(n.payload._id);break;case"RDH_ADD_SELECTION":const r=Vr();if(!r)return;const o=t.find(r);if(!o)return;t.upsert(o),at();break;case"RDH_NOTE_SELECTION":console.log("not implemented yet");break}}),t=$i(n=>e({type:"RDH_ADD",payload:n}),n=>e({type:"RDH_UPDATE",payload:n}),({_id:n})=>e({type:"RDH_REMOVE",payload:{_id:n}}));st.store=t,e({type:"RDH_READY",payload:{url:location.href}})})(); + }`};function Zr(e,t){st(t,!0),Ut(e,Ji);const n=[];let r=Et(t,"store",7),o,s,l=Me(!0);Ot(()=>{r().draft?(j(l,!0),o==null||o.showModal()):o==null||o.close()});function d($){const k=$.currentTarget.returnValue;$.currentTarget.returnValue="",setTimeout(k?r().draftSubmit:r().draftCancel,200)}function v($){var k;wn()||($.stopImmediatePropagation(),$.stopPropagation(),$.key=="Enter"&&!$.shiftKey&&($.preventDefault(),s&&((k=$.currentTarget.closest("form"))==null||k.requestSubmit(s))))}var f=Ki();f.__mousedown=[Wi];const h=Bt(wn);ye(()=>vt(f,"mobile",x(h)));var m=oe(f),g=oe(m);J(m);var w=ie(m,2),y=oe(w);{var N=$=>{var k=Gi(),T=Sn(k);T.__click=[Yi,l];var U=oe(T,!0);ye(()=>{var q,R;return nn(U,((R=(q=r().draft)==null?void 0:q.text)==null?void 0:R.trim())||"")}),J(T);var X=ie(T,2);Pn(X,21,()=>Ae,ci,(q,R)=>{let Y=()=>x(R)[0],fe=()=>x(R)[1];var K=Ui();pi(K);var de;ye(()=>{de!==(de=Y())&&(K.value=(K.__value=Y())==null?"":Y()),ue(K,"style",`--color: ${fe()??""}`)}),bi(n,[],K,()=>(Y(),r().draft.color),He=>r().draft.color=He),se(q,K)}),J(X);var S=ie(X,2);ni(S),ti(S),S.__keydown=v;var I=ie(S,2);{var W=q=>{var R=Xi();se(q,R)};Ft(I,q=>{r().pro||q(W)})}ye(()=>{vt(T,"compact",x(l)),S.disabled=!r().pro}),wi(S,()=>r().draft.note,q=>r().draft.note=q),se($,k)};Ft(y,$=>{r().draft&&$(N)})}var D=ie(y,2),O=ie(oe(D),2),M=oe(O);return qo(),J(O),gn(O,$=>s=$,()=>s),J(D),J(w),J(f),gn(f,$=>o=$,()=>o),ye(()=>{var $,k;nn(g,`${(($=r().draft)!=null&&$._id?"Edit":"New")??""} highlight`),nn(M,`${((k=r().draft)!=null&&k._id?"Update":"Create")??""} `)}),be("close",f,d),se(e,f),lt({get store(){return r()},set store($){r($),Ue()}})}Vr(["mousedown","click","keydown"]);Ct(Zr,{store:{}},[],[],!0);const Zi=e=>{const t=e.target.getAttribute("data-highlight");t&&(e.preventDefault(),Xr(t))};var Qi=me('
'),es=me('');const ts={hash:"svelte-rwfy02",code:"nav.svelte-rwfy02 {all:unset;}div.svelte-rwfy02 {position:fixed;right:0;width:24px;height:20px;display:flex;justify-content:flex-end;align-items:center;cursor:pointer;background:transparent;z-index:99999999999999;}div.svelte-rwfy02::before {content:'';display:block;height:3px;border-radius:3px;width:16px;background:var(--color);transition:width .15s ease-in-out;}div.svelte-rwfy02:hover::before {width:100%;}"};function Qr(e,t){st(t,!0),Ut(e,ts);let n=Et(t,"store",7);var r=ii(),o=Sn(r);{var s=l=>{var d=es();d.__click=[Zi],Pn(d,21,()=>n().highlights,v=>v._id,(v,f)=>{var h=Qi();const m=Bt(()=>`top: var(--highlight-${x(f)._id??""}-top); --color: ${(Ae.get(x(f).color)||x(f).color)??""}`);ye(()=>{ue(h,"data-highlight",x(f)._id),ue(h,"style",x(m))}),se(v,h)}),J(d),se(l,d)};Ft(o,l=>{n().nav&&l(s)})}return se(e,r),lt({get store(){return n()},set store(l){n(l),Ue()}})}Vr(["click"]);Ct(Qr,{store:{}},[],[],!0);var ns=me('
');const rs={hash:"svelte-1qyoyb3",code:"div.svelte-1qyoyb3 {display:contents;}"};function eo(e,t){st(t,!0),Ut(e,rs);let n=Et(t,"children",7),r=Me(1);Ot(()=>{var d;function l(){var v;j(r,1/(((v=window.visualViewport)==null?void 0:v.scale)||1))}return(d=window.visualViewport)==null||d.addEventListener("resize",l),()=>{var v;return(v=window.visualViewport)==null?void 0:v.removeEventListener("resize",l)}});var o=ns(),s=oe(o);return vi(s,()=>n()??cr),J(o),ye(()=>gi(o,"--mobile-zoom-level",x(r))),se(e,o),lt({get children(){return n()},set children(l){n(l),Ue()}})}Ct(eo,{children:{}},[],[],!0);var os=me(" ",1);function is(e,t){st(t,!0);let n=Et(t,"store",7);Ot(()=>{ln(n().highlights)});let r;function o(){ln(n().highlights),clearTimeout(r),r=setTimeout(()=>ln(n().highlights),3e3)}return Ln(()=>{document.readyState&&o()}),Ot(()=>Ri),be("load",Mt,o),be("popstate",Mt,o),eo(e,{children:(s,l)=>{var d=os(),v=Sn(d);Jr(v,{get store(){return n()}});var f=ie(v,2);Zr(f,{get store(){return n()}});var h=ie(f,2);Qr(h,{get store(){return n()}}),se(s,d)},$$slots:{default:!0}}),lt({get store(){return n()},set store(s){n(s),Ue()}})}customElements.define("rdh-ui",Ct(is,{store:{}},[],[],!0));function ss(e){if(typeof chrome=="object"&&chrome.runtime&&chrome.runtime.onMessage||typeof browser=="object"&&browser.runtime&&browser.runtime.onMessage){const{runtime:t}=typeof browser=="object"?browser:chrome,n=(r,o)=>{o.id==t.id&&typeof r.type=="string"&&e(r)};return t.onMessage.removeListener(n),t.onMessage.addListener(n),r=>t.sendMessage(null,r)}if(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.rdh)return window.rdhSend=e,t=>window.webkit.messageHandlers.rdh.postMessage(t);if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron){const{ipcRenderer:t}=require("electron"),n=(r,o)=>e(o);return t.removeListener("RDH",n),t.on("RDH",n),r=>t.sendToHost("RDH",r)}if("ReactNativeWebView"in window)return window.ReactNativeWebViewSendMessage=e,t=>window.ReactNativeWebView.postMessage(JSON.stringify(t));if(window.self!==window.top){const t=({data:n,source:r})=>{r!==window.parent||typeof n!="object"||typeof n.type!="string"||e(n)};return window.removeEventListener("message",t),window.addEventListener("message",t),n=>window.parent.postMessage(n,"*")}throw new Error("unsupported platform")}async function ls(e){let t=!1;const n=new Set,r=ss(o=>{if(!t){n.add(o);return}e(o)});await new Promise(o=>{function s(){window.removeEventListener("DOMContentLoaded",s),o()}document.body?o():(window.removeEventListener("DOMContentLoaded",s),window.addEventListener("DOMContentLoaded",s,{once:!0}))}),t=!0;for(const o of n)e(o),n.delete(o);return r}const ct=document.createElement("rdh-ui");(async()=>{const e=await ls(n=>{switch(n.type){case"RDH_APPLY":Array.isArray(n.payload)&&(t.highlights=n.payload);break;case"RDH_CONFIG":typeof n.payload.pro=="boolean"&&(t.pro=n.payload.pro),typeof n.payload.nav=="boolean"&&(t.nav=n.payload.nav),typeof n.payload.enabled=="boolean"&&(n.payload.enabled===!0?document.body.contains(ct)||document.body.appendChild(ct):document.body.contains(ct)&&document.body.removeChild(ct));break;case"RDH_SCROLL":typeof n.payload._id=="string"&&Xr(n.payload._id);break;case"RDH_ADD_SELECTION":const r=Gr();if(!r)return;const o=t.find(r);if(!o)return;t.upsert(o),dt();break;case"RDH_NOTE_SELECTION":console.log("not implemented yet");break}}),t=Fi(n=>e({type:"RDH_ADD",payload:n}),n=>e({type:"RDH_UPDATE",payload:n}),({_id:n})=>e({type:"RDH_REMOVE",payload:{_id:n}}));ct.store=t,e({type:"RDH_READY",payload:{url:location.href}})})();