var content=(function(){"use strict";var ie=Object.defineProperty;var oe=(M,k,I)=>k in M?ie(M,k,{enumerable:!0,configurable:!0,writable:!0,value:I}):M[k]=I;var _=(M,k,I)=>oe(M,typeof k!="symbol"?k+"":k,I);function M(i){return i}const k={matches:["<all_urls>"],runAt:"document_idle",main(){let i=null;function e(c){const m=[];let u=c;for(;u&&u!==document.body;){let d=u.tagName.toLowerCase();if(u.id){d+=`#${u.id}`,m.unshift(d);break}const b=u.parentElement;if(b){const P=Array.from(b.children).filter(x=>x.tagName===u.tagName);if(P.length>1){const x=P.indexOf(u)+1;d+=`:nth-of-type(${x})`}}m.unshift(d),u=u.parentElement}return m.join(" > ")}function t(c){const u=c.getRangeAt(0).commonAncestorContainer,d=u.nodeType===Node.TEXT_NODE?u.parentElement:u;return((d==null?void 0:d.textContent)||"").slice(0,500)}function n(){i&&(i.remove(),i=null)}function g(c,m,u){n();const d=document.createElement("div");d.id="fdp-highlight-tooltip",d.style.cssText="position:fixed;top:0;left:0;width:0;height:0;z-index:2147483647;pointer-events:none;";const b=d.attachShadow({mode:"closed"}),P=document.createElement("style");P.textContent=`
        .tooltip {
          position: fixed;
          z-index: 2147483647;
          pointer-events: auto;
          display: flex;
          flex-direction: column;
          align-items: center;
          filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
          animation: fdp-fade-in 0.15s ease-out;
        }
        @keyframes fdp-fade-in {
          from { opacity: 0; transform: translateY(4px); }
          to { opacity: 1; transform: translateY(0); }
        }
        .arrow {
          width: 0;
          height: 0;
          border-left: 6px solid transparent;
          border-right: 6px solid transparent;
          border-bottom: 6px solid #0096C7;
        }
        .btn {
          background: #0096C7;
          color: #fff;
          border: none;
          padding: 6px 14px;
          border-radius: 6px;
          font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
          cursor: pointer;
          white-space: nowrap;
          transition: background 0.15s;
        }
        .btn:hover {
          background: #0077A8;
        }
        .btn.success {
          background: #16a34a;
          pointer-events: none;
        }
        .btn.error {
          background: #dc2626;
          pointer-events: none;
        }
      `,b.appendChild(P);const x=document.createElement("div");x.className="tooltip",x.style.left=`${c}px`,x.style.top=`${m}px`;const y=document.createElement("div");y.className="arrow";const w=document.createElement("button");return w.className="btn",w.textContent="Save to 4DPocket",w.addEventListener("click",p=>{p.stopPropagation(),p.preventDefault(),u()}),x.appendChild(y),x.appendChild(w),b.appendChild(x),document.body.appendChild(d),requestAnimationFrame(()=>{const p=w.getBoundingClientRect(),N=window.innerWidth;let S=c;S+p.width/2>N-8&&(S=N-p.width/2-8),S-p.width/2<8&&(S=p.width/2+8),x.style.left=`${S}px`}),i=d,{tooltip:x,btn:w,shadow:b}}function A(c,m){c.textContent=m?"✓ Saved":"✗ Failed",c.className=m?"btn success":"btn error",setTimeout(n,1500)}document.addEventListener("mouseup",c=>{setTimeout(()=>{var N,S;const m=window.getSelection();if(!m||m.isCollapsed)return;const u=m.toString().trim();if(!u||i&&((S=(N=c.target)==null?void 0:N.getRootNode)==null?void 0:S.call(N))===i)return;const b=m.getRangeAt(0).getBoundingClientRect(),P=b.left+b.width/2,x=b.top-10,y=m.anchorNode,w=(y==null?void 0:y.nodeType)===Node.TEXT_NODE?y.parentElement:y,{btn:p}=g(P,x,()=>{const D=u,U=t(m),z=w?e(w):"",$=m.anchorOffset;p.textContent="Saving...",p.style.pointerEvents="none",chrome.runtime.sendMessage({type:"SAVE_HIGHLIGHT",data:{url:window.location.href,title:document.title,text:D,context:U,position:{selector:z,textOffset:$,textLength:D.length}}},r=>{if(chrome.runtime.lastError){A(p,!1);return}A(p,(r==null?void 0:r.status)==="success")})})},10)}),document.addEventListener("mousedown",c=>{!i||c.composedPath().includes(i)||n()}),document.addEventListener("scroll",n,{passive:!0})}};function I(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var K={exports:{}},Z=K.exports,Y;function X(){return Y||(Y=1,(function(i,e){(function(t,n){n(i)})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:Z,function(t){if(!(globalThis.chrome&&globalThis.chrome.runtime&&globalThis.chrome.runtime.id))throw new Error("This script should only be loaded in a browser extension.");if(globalThis.browser&&globalThis.browser.runtime&&globalThis.browser.runtime.id)t.exports=globalThis.browser;else{const n="The message port closed before a response was received.",g=A=>{const c={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(Object.keys(c).length===0)throw new Error("api-metadata.json has not been included in browser-polyfill");class m extends WeakMap{constructor(s,a=void 0){super(a),this.createItem=s}get(s){return this.has(s)||this.set(s,this.createItem(s)),super.get(s)}}const u=r=>r&&typeof r=="object"&&typeof r.then=="function",d=(r,s)=>(...a)=>{A.runtime.lastError?r.reject(new Error(A.runtime.lastError.message)):s.singleCallbackArg||a.length<=1&&s.singleCallbackArg!==!1?r.resolve(a[0]):r.resolve(a)},b=r=>r==1?"argument":"arguments",P=(r,s)=>function(l,...h){if(h.length<s.minArgs)throw new Error(`Expected at least ${s.minArgs} ${b(s.minArgs)} for ${r}(), got ${h.length}`);if(h.length>s.maxArgs)throw new Error(`Expected at most ${s.maxArgs} ${b(s.maxArgs)} for ${r}(), got ${h.length}`);return new Promise((v,E)=>{if(s.fallbackToNoCallback)try{l[r](...h,d({resolve:v,reject:E},s))}catch(o){console.warn(`${r} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,o),l[r](...h),s.fallbackToNoCallback=!1,s.noCallback=!0,v()}else s.noCallback?(l[r](...h),v()):l[r](...h,d({resolve:v,reject:E},s))})},x=(r,s,a)=>new Proxy(s,{apply(l,h,v){return a.call(h,r,...v)}});let y=Function.call.bind(Object.prototype.hasOwnProperty);const w=(r,s={},a={})=>{let l=Object.create(null),h={has(E,o){return o in r||o in l},get(E,o,T){if(o in l)return l[o];if(!(o in r))return;let f=r[o];if(typeof f=="function")if(typeof s[o]=="function")f=x(r,r[o],s[o]);else if(y(a,o)){let R=P(o,a[o]);f=x(r,r[o],R)}else f=f.bind(r);else if(typeof f=="object"&&f!==null&&(y(s,o)||y(a,o)))f=w(f,s[o],a[o]);else if(y(a,"*"))f=w(f,s[o],a["*"]);else return Object.defineProperty(l,o,{configurable:!0,enumerable:!0,get(){return r[o]},set(R){r[o]=R}}),f;return l[o]=f,f},set(E,o,T,f){return o in l?l[o]=T:r[o]=T,!0},defineProperty(E,o,T){return Reflect.defineProperty(l,o,T)},deleteProperty(E,o){return Reflect.deleteProperty(l,o)}},v=Object.create(r);return new Proxy(v,h)},p=r=>({addListener(s,a,...l){s.addListener(r.get(a),...l)},hasListener(s,a){return s.hasListener(r.get(a))},removeListener(s,a){s.removeListener(r.get(a))}}),N=new m(r=>typeof r!="function"?r:function(a){const l=w(a,{},{getContent:{minArgs:0,maxArgs:0}});r(l)}),S=new m(r=>typeof r!="function"?r:function(a,l,h){let v=!1,E,o=new Promise(L=>{E=function(C){v=!0,L(C)}}),T;try{T=r(a,l,E)}catch(L){T=Promise.reject(L)}const f=T!==!0&&u(T);if(T!==!0&&!f&&!v)return!1;const R=L=>{L.then(C=>{h(C)},C=>{let G;C&&(C instanceof Error||typeof C.message=="string")?G=C.message:G="An unexpected error occurred",h({__mozWebExtensionPolyfillReject__:!0,message:G})}).catch(C=>{console.error("Failed to send onMessage rejected reply",C)})};return R(f?T:o),!0}),D=({reject:r,resolve:s},a)=>{A.runtime.lastError?A.runtime.lastError.message===n?s():r(new Error(A.runtime.lastError.message)):a&&a.__mozWebExtensionPolyfillReject__?r(new Error(a.message)):s(a)},U=(r,s,a,...l)=>{if(l.length<s.minArgs)throw new Error(`Expected at least ${s.minArgs} ${b(s.minArgs)} for ${r}(), got ${l.length}`);if(l.length>s.maxArgs)throw new Error(`Expected at most ${s.maxArgs} ${b(s.maxArgs)} for ${r}(), got ${l.length}`);return new Promise((h,v)=>{const E=D.bind(null,{resolve:h,reject:v});l.push(E),a.sendMessage(...l)})},z={devtools:{network:{onRequestFinished:p(N)}},runtime:{onMessage:p(S),onMessageExternal:p(S),sendMessage:U.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:U.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},$={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return c.privacy={network:{"*":$},services:{"*":$},websites:{"*":$}},w(A,z,c)};t.exports=g(chrome)}})})(K)),K.exports}var J=X();const O=I(J);function B(i,...e){}const Q={debug:(...i)=>B(console.debug,...i),log:(...i)=>B(console.log,...i),warn:(...i)=>B(console.warn,...i),error:(...i)=>B(console.error,...i)},q=class q extends Event{constructor(e,t){super(q.EVENT_NAME,{}),this.newUrl=e,this.oldUrl=t}};_(q,"EVENT_NAME",H("wxt:locationchange"));let W=q;function H(i){var e;return`${(e=O==null?void 0:O.runtime)==null?void 0:e.id}:content:${i}`}function ee(i){let e,t;return{run(){e==null&&(t=new URL(location.href),e=i.setInterval(()=>{let n=new URL(location.href);n.href!==t.href&&(window.dispatchEvent(new W(n,t)),t=n)},1e3))}}}const F=class F{constructor(e,t){_(this,"isTopFrame",window.self===window.top);_(this,"abortController");_(this,"locationWatcher",ee(this));_(this,"receivedMessageIds",new Set);this.contentScriptName=e,this.options=t,this.abortController=new AbortController,this.isTopFrame?(this.listenForNewerScripts({ignoreFirstEvent:!0}),this.stopOldScripts()):this.listenForNewerScripts()}get signal(){return this.abortController.signal}abort(e){return this.abortController.abort(e)}get isInvalid(){return O.runtime.id==null&&this.notifyInvalidated(),this.signal.aborted}get isValid(){return!this.isInvalid}onInvalidated(e){return this.signal.addEventListener("abort",e),()=>this.signal.removeEventListener("abort",e)}block(){return new Promise(()=>{})}setInterval(e,t){const n=setInterval(()=>{this.isValid&&e()},t);return this.onInvalidated(()=>clearInterval(n)),n}setTimeout(e,t){const n=setTimeout(()=>{this.isValid&&e()},t);return this.onInvalidated(()=>clearTimeout(n)),n}requestAnimationFrame(e){const t=requestAnimationFrame((...n)=>{this.isValid&&e(...n)});return this.onInvalidated(()=>cancelAnimationFrame(t)),t}requestIdleCallback(e,t){const n=requestIdleCallback((...g)=>{this.signal.aborted||e(...g)},t);return this.onInvalidated(()=>cancelIdleCallback(n)),n}addEventListener(e,t,n,g){var A;t==="wxt:locationchange"&&this.isValid&&this.locationWatcher.run(),(A=e.addEventListener)==null||A.call(e,t.startsWith("wxt:")?H(t):t,n,{...g,signal:this.signal})}notifyInvalidated(){this.abort("Content script context invalidated"),Q.debug(`Content script "${this.contentScriptName}" context invalidated`)}stopOldScripts(){window.postMessage({type:F.SCRIPT_STARTED_MESSAGE_TYPE,contentScriptName:this.contentScriptName,messageId:Math.random().toString(36).slice(2)},"*")}verifyScriptStartedEvent(e){var A,c,m;const t=((A=e.data)==null?void 0:A.type)===F.SCRIPT_STARTED_MESSAGE_TYPE,n=((c=e.data)==null?void 0:c.contentScriptName)===this.contentScriptName,g=!this.receivedMessageIds.has((m=e.data)==null?void 0:m.messageId);return t&&n&&g}listenForNewerScripts(e){let t=!0;const n=g=>{if(this.verifyScriptStartedEvent(g)){this.receivedMessageIds.add(g.data.messageId);const A=t;if(t=!1,A&&(e!=null&&e.ignoreFirstEvent))return;this.notifyInvalidated()}};addEventListener("message",n),this.onInvalidated(()=>removeEventListener("message",n))}};_(F,"SCRIPT_STARTED_MESSAGE_TYPE",H("wxt:content-script-started"));let V=F;const re=Symbol("null");let te=0;class se extends Map{constructor(){super(),this._objectHashes=new WeakMap,this._symbolHashes=new Map,this._publicKeys=new Map;const[e]=arguments;if(e!=null){if(typeof e[Symbol.iterator]!="function")throw new TypeError(typeof e+" is not iterable (cannot read property Symbol(Symbol.iterator))");for(const[t,n]of e)this.set(t,n)}}_getPublicKeys(e,t=!1){if(!Array.isArray(e))throw new TypeError("The keys parameter must be an array");const n=this._getPrivateKey(e,t);let g;return n&&this._publicKeys.has(n)?g=this._publicKeys.get(n):t&&(g=[...e],this._publicKeys.set(n,g)),{privateKey:n,publicKey:g}}_getPrivateKey(e,t=!1){const n=[];for(let g of e){g===null&&(g=re);const A=typeof g=="object"||typeof g=="function"?"_objectHashes":typeof g=="symbol"?"_symbolHashes":!1;if(!A)n.push(g);else if(this[A].has(g))n.push(this[A].get(g));else if(t){const c=`@@mkm-ref-${te++}@@`;this[A].set(g,c),n.push(c)}else return!1}return JSON.stringify(n)}set(e,t){const{publicKey:n}=this._getPublicKeys(e,!0);return super.set(n,t)}get(e){const{publicKey:t}=this._getPublicKeys(e);return super.get(t)}has(e){const{publicKey:t}=this._getPublicKeys(e);return super.has(t)}delete(e){const{publicKey:t,privateKey:n}=this._getPublicKeys(e);return!!(t&&super.delete(t)&&this._publicKeys.delete(n))}clear(){super.clear(),this._symbolHashes.clear(),this._publicKeys.clear()}get[Symbol.toStringTag](){return"ManyKeysMap"}get size(){return super.size}}new se;function le(){}function j(i,...e){}const ne={debug:(...i)=>j(console.debug,...i),log:(...i)=>j(console.log,...i),warn:(...i)=>j(console.warn,...i),error:(...i)=>j(console.error,...i)};return(async()=>{try{const{main:i,...e}=k,t=new V("content",e);return await i(t)}catch(i){throw ne.error('The content script "content" crashed on startup!',i),i}})()})();
content;
