From 851410d7d92452e632c976c697dbf796afcae6f1 Mon Sep 17 00:00:00 2001 From: Rit Date: Mon, 9 Nov 2026 16:51:14 +0530 Subject: [PATCH 1/9] feat/(ci): add Genesis check and release workflows Co-Authored-By: Claude Opus 5.5 --- .gitattributes | 5 +++++ .github/dependabot.yml | 8 ++++++++ .github/workflows/genesis-check.yml | 18 ++++++++++++++++++ .github/workflows/genesis-release.yml | 22 ++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 .gitattributes create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/genesis-check.yml create mode 100644 .github/workflows/genesis-release.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d3ad185 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# From the Genesis factory template. +# Text files use LF, and published builds are stored byte for byte, so a checkout never +# changes the bundle whose hash the release record names. +* text=auto eol=lf +**/published/** -text diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8280208 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +# From the Genesis factory template. +# including the Genesis reusable workflows; update genesis-ref to the same sha in each update. +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/genesis-check.yml b/.github/workflows/genesis-check.yml new file mode 100644 index 0000000..3366e8d --- /dev/null +++ b/.github/workflows/genesis-check.yml @@ -0,0 +1,18 @@ +# From the Genesis factory template. The pinned Genesis commit must be on GitHub before this runs. +# The check rebuilds every applet with the Genesis commit its release record names and fails +# unless the rebuild equals the committed published/ build. +name: Genesis check + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + check: + uses: nirvanacp/genesis/.github/workflows/applet-check.yml@655ce128bce13bd8a376a3630766fb18182ba928 + with: + genesis-ref: 655ce128bce13bd8a376a3630766fb18182ba928 diff --git a/.github/workflows/genesis-release.yml b/.github/workflows/genesis-release.yml new file mode 100644 index 0000000..130cb7a --- /dev/null +++ b/.github/workflows/genesis-release.yml @@ -0,0 +1,22 @@ +# From the Genesis factory template. The pinned Genesis commit must be on GitHub before this runs. +# A tag v (single-applet repository) or /v (multi-applet repository) +# rebuilds the applet, compares it with the committed build and publishes a GitHub Release +# with the bundle, its release record and build provenance attestations. +name: Genesis release + +on: + push: + tags: ['v*', '*/v*'] + +permissions: + contents: read + +jobs: + release: + uses: nirvanacp/genesis/.github/workflows/applet-release.yml@655ce128bce13bd8a376a3630766fb18182ba928 + with: + genesis-ref: 655ce128bce13bd8a376a3630766fb18182ba928 + permissions: + contents: write + id-token: write + attestations: write From 5aaeb5c73b27635141d7be8ca9a27cd51eb5aa26 Mon Sep 17 00:00:00 2001 From: Rit Date: Mon, 9 Nov 2026 16:51:55 +0530 Subject: [PATCH 2/9] feat/(hn-bookmarks): publish 0.1.0 Co-Authored-By: Claude Opus 5.5 --- .../2026-11-09-165141-publish-0.1.0.md | 6 +++ hn-bookmarks/.specs/current.md | 1 + .../published/applet-hn-bookmarks.bundle.json | 1 + .../applet-hn-bookmarks.release.json | 40 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 hn-bookmarks/.changelog/2026-11-09-165141-publish-0.1.0.md create mode 100644 hn-bookmarks/published/applet-hn-bookmarks.bundle.json create mode 100644 hn-bookmarks/published/applet-hn-bookmarks.release.json diff --git a/hn-bookmarks/.changelog/2026-11-09-165141-publish-0.1.0.md b/hn-bookmarks/.changelog/2026-11-09-165141-publish-0.1.0.md new file mode 100644 index 0000000..1649b95 --- /dev/null +++ b/hn-bookmarks/.changelog/2026-11-09-165141-publish-0.1.0.md @@ -0,0 +1,6 @@ +# Publish 0.1.0 + +- Goal: The user asked to adopt versioned releases for the applets in this repository, so Genesis can install them from GitHub and check them in CI. +- Changes: `genesis-applet publish` wrote `published/applet-hn-bookmarks.bundle.json` (SHA-256 `22df9e1db4ebe824…`, 353552 bytes) and `published/applet-hn-bookmarks.release.json` for version 0.1.0, built with Genesis commit `655ce128bce1`. The current spec names the published version and tag. Sources, id, service ids and stored data are unchanged. +- Decisions: The first release keeps the existing `package.json` version 0.1.0; dependencies already pin exact versions. The tag `hn-bookmarks/v0.1.0` follows the multi-applet tag format and is created locally after this commit; pushing it is left to the operator. +- Verification: `genesis-applet publish --verify` rebuilt the bundle with the recorded build time and found it identical. `genesis-applet check` and `build` ran as part of publish. Not run on a device; no backend was started. CI has not run because the Genesis commit and this repository are not pushed yet. diff --git a/hn-bookmarks/.specs/current.md b/hn-bookmarks/.specs/current.md index f855708..cf9daac 100644 --- a/hn-bookmarks/.specs/current.md +++ b/hn-bookmarks/.specs/current.md @@ -6,6 +6,7 @@ - Three contexts, each with its own website session history: `primary` (Home, start URL `/`), `post` (`/submit`) and `me` (`/news?account=1`). The adapter is [src/adapter.ts](../src/adapter.ts) with pages `feed`, `private-feed`, `item`, `user`, `info`, `account` and `submit` in [src/adapter](../src/adapter). - Screens: route screens `feed`, `item`, `user`, `info`, `post` and `me`; overlay screens `search`, `saved`, `categories` and `save`. Service: `bookmarks`, used by Saved, Categories and Save. - Manifest schema 6, `@genesis/sdk` 0.0.0, `genesis-applet` tools 0.0.0, protocol 1, adapter API 1. Kit version: not exported for this in-repository applet. The [manifest](../applet.json) is the authority for routes and contexts. +- Published release: version 0.1.0, tag `hn-bookmarks/v0.1.0`, build and release record in `published/` (built with Genesis `655ce128bce1`). Raise the version and run `genesis-applet publish` again before the next release. ## Product scope diff --git a/hn-bookmarks/published/applet-hn-bookmarks.bundle.json b/hn-bookmarks/published/applet-hn-bookmarks.bundle.json new file mode 100644 index 0000000..62086f0 --- /dev/null +++ b/hn-bookmarks/published/applet-hn-bookmarks.bundle.json @@ -0,0 +1 @@ +{"envelope":1,"bundle":{"format":3,"compat":{"manifestSchema":6,"bundleFormat":3,"protocol":1,"adapterApi":1,"sdk":"0.0.0","tools":"0.0.0","builtAt":"2026-11-09T11:21:14Z"},"manifest":{"schemaVersion":6,"id":"hn-bookmarks","name":"Hacker News","origins":["https://news.ycombinator.com"],"foreground":{"entry":"src/main.tsx","screens":["feed","item","user","info","search","post","saved","categories","save","me"]},"adapter":"src/adapter.ts","contexts":[{"id":"primary","startUrl":"https://news.ycombinator.com/"},{"id":"post","startUrl":"https://news.ycombinator.com/submit"},{"id":"me","startUrl":"https://news.ycombinator.com/news?account=1"}],"routes":[{"id":"account","pattern":"/news","query":["account"],"page":"account","screen":"me","context":"me"},{"id":"home","pattern":"/","page":"feed","screen":"feed","context":"primary"},{"id":"news","pattern":"/news","page":"feed","screen":"feed","context":"primary"},{"id":"newest","pattern":"/newest","page":"feed","screen":"feed"},{"id":"front","pattern":"/front","page":"feed","screen":"feed"},{"id":"newcomments","pattern":"/newcomments","page":"feed","screen":"feed"},{"id":"ask","pattern":"/ask","page":"feed","screen":"feed"},{"id":"show","pattern":"/show","page":"feed","screen":"feed"},{"id":"shownew","pattern":"/shownew","page":"feed","screen":"feed"},{"id":"asknew","pattern":"/asknew","page":"feed","screen":"feed"},{"id":"jobs","pattern":"/jobs","page":"feed","screen":"feed"},{"id":"best","pattern":"/best","page":"feed","screen":"feed"},{"id":"active","pattern":"/active","page":"feed","screen":"feed"},{"id":"from","pattern":"/from","page":"feed","screen":"feed"},{"id":"submitted","pattern":"/submitted","query":["id"],"page":"feed","screen":"feed"},{"id":"threads","pattern":"/threads","query":["id"],"page":"feed","screen":"feed"},{"id":"favorites","pattern":"/favorites","query":["id"],"page":"feed","screen":"feed"},{"id":"hidden","pattern":"/hidden","query":["id"],"page":"private-feed","screen":"feed"},{"id":"upvoted","pattern":"/upvoted","query":["id"],"page":"private-feed","screen":"feed"},{"id":"item","pattern":"/item","query":["id"],"page":"item","screen":"item"},{"id":"user","pattern":"/user","query":["id"],"page":"user","screen":"user"},{"id":"formatdoc","pattern":"/formatdoc","page":"info","screen":"info"},{"id":"faq","pattern":"/newsfaq.html","page":"info","screen":"info"},{"id":"guidelines","pattern":"/newsguidelines.html","page":"info","screen":"info"},{"id":"lists","pattern":"/lists","page":"info","screen":"info"},{"id":"leaders","pattern":"/leaders","page":"info","screen":"info"},{"id":"submit","pattern":"/submit","page":"submit","screen":"post","context":"post"},{"id":"submit-result","pattern":"/r","page":"submit","screen":"post"}],"capabilities":{"services":[{"id":"bookmarks","config":"backend/service.json"}]},"shell":{"accent":"#ff6600"}},"files":[{"path":"adapter.js","sha256":"ebe2db0683874c95b1f141d153e0db09ad24c4ff1754481f9e1b9123c8449821"},{"path":"assets/yc.png","sha256":"6759dc96b4c3d8e08bf3f3f1d8996a7a5743a72bd7567f2b9a0e7c7e26ee42d9"},{"path":"foreground.css","sha256":"ee20a9ba479eed976305d1a0c9777cb9f6d8ca9a7cf87290bae5064a1af5bc19"},{"path":"foreground.js","sha256":"e7b9b22272226d195cb03d426165bf6b1125ed92ea3ac317f663186d5e94efe3"},{"path":"index.html","sha256":"aa44f6b87ac40170d4ad8d891021e384d535858ab2a4098e6d9025e79cfc79cf"}]},"entries":[{"path":"adapter.js","encoding":"utf8","content":"(()=>{var j={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1};var ut=/^:[A-Za-z][A-Za-z0-9_]*$/,ft=/^[A-Za-z0-9_.~@-]+$/,fe=new Map;function dt(e){if(fe.has(e))return fe.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),r=n.at(-1)===\"*\";r&&n.pop();let i=[],o=!0;for(let s of n)ut.test(s)?i.push({param:s.slice(1)}):ft.test(s)&&s!==\".\"&&s!==\"..\"?i.push({literal:s}):o=!1;o&&(t={segments:i,rest:r})}return fe.set(e,t),t}function pe(e){try{return new URL(e).href}catch{return null}}function me(e,t){let n=pt(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let r;try{r=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}r.at(-1)===\"\"&&r.pop();for(let i of e.routes){let o=dt(i.pattern);if(!o)continue;let s=mt(o,r);if(!s||!(i.query??[]).every(f=>n.searchParams.has(f)))continue;for(let f of i.query??[])s[f]=n.searchParams.get(f);let a={kind:\"route\",routeId:i.id,page:i.page,screen:i.screen,params:s};return i.context!==void 0&&(a.context=i.context),a}return{kind:\"website\",url:t}}function pt(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function mt(e,t){if(e.rest?t.length{let i=null,o=!1,s=1,a=new Map,f=new Map,u={get bound(){return i},get retired(){return o},request(w,h={}){if(o)return Promise.reject(new O(\"RETIRED\",\"This page was closed\"));let x=s++;return new Promise((R,P)=>{let L=setTimeout(()=>{a.delete(x),P(new O(\"DEADLINE\",`${w} did not answer in time`))},i.limits.rpcDeadlineMs+gt);a.set(x,{resolve:R,reject:P,timer:L}),e.postMessage(JSON.stringify({type:\"request\",documentId:i.documentId,requestId:x,method:w,params:h}))})},on(w,h){let x=f.get(w);return x||f.set(w,x=new Set),x.add(h),()=>{x.delete(h)}}};function p(){o=!0;for(let w of a.values())clearTimeout(w.timer),w.reject(new O(\"RETIRED\",\"This page was closed\"));a.clear()}function g(w,h){for(let x of[...f.get(w)??[]])try{x(h)}catch(R){console.error(`Genesis ${w} handler failed`,R)}}e.addEventListener(\"message\",w=>{if(o||typeof w.data!=\"string\")return;let h;try{h=JSON.parse(w.data)}catch{return}if(h?.type===\"refused\"&&!i){o=!0,r(new O(h.error?.code??\"PROTOCOL_MISMATCH\",h.error?.message??\"The host refused this page\"));return}if(h?.type===\"bound\"){if(i)return;i=h,n(u);return}if(!(!i||h?.documentId!==i.documentId))if(h.type===\"response\"){let x=a.get(h.requestId);if(!x)return;a.delete(h.requestId),clearTimeout(x.timer),h.error?x.reject(new O(h.error.code,h.error.message)):x.resolve(h.result??null)}else h.type===\"event\"&&(h.name===\"retired\"?(p(),g(\"retired\",{})):g(h.name,h.data))}),addEventListener(\"pagehide\",()=>{o||(g(\"pagehide\",{}),p())});let b={type:\"hello\",protocol:j.protocol,url:t};e.postMessage(JSON.stringify(b))})}var ht=100;function yt(e){let t=new Map,n=Promise.resolve();return{act(r){let i={request:r,arrived:Date.now(),view:e.view(),cancelled:!1,dispatched:!1,stopped:!1};t.set(r.actionId,i),n=n.then(()=>vt(e,i)).catch(o=>{console.error(\"Genesis action failed\",o)}).finally(()=>{t.delete(r.actionId)})},cancel(r){let i=t.get(r);i&&!i.dispatched&&(i.cancelled=!0)},retire(){for(let r of t.values())r.stopped=!0}}}async function vt(e,t){let{connection:n,limits:r}=e,{actionId:i}=t.request,o,s=(T,A,$)=>{if(t.stopped)return Promise.resolve();let _={actionId:i,state:T};return $&&(_.navigating=!0),$&&o&&(_.expect=o),A&&(_.result=A),n.request(\"context.actionResult\",_).then(()=>{},()=>{})},a=(T,A,$)=>{let _={outcome:\"failed\",code:T,message:A};return $!==void 0&&Object.assign(_,{completedSteps:$,partial:$>0}),s(\"failed\",_)},f=()=>s(\"cancelled\",{outcome:\"cancelled\"});if(t.stopped)return;if(t.cancelled)return f();if((t.request.view??t.view)!==t.view||e.view()!==t.view)return a(\"CONTEXT_REPLACED\",\"The page the action was for has been replaced\");let u=e.find(t.request);if(\"error\"in u)return a(u.error.code,u.error.message);let p=u.element();if(p===void 0)return a(\"TARGET_NOT_FOUND\",\"The item is no longer on the page\");let g;try{g=u.action(p,t.request.args)}catch(T){return a(\"INVALID_STEPS\",Pe(T))}if(typeof g?.then==\"function\")return a(\"INVALID_STEPS\",\"An action must return its steps synchronously\");if(g&&\"satisfied\"in g&&g.satisfied===!0)return s(\"observed\",{outcome:\"observed\",noop:!0});let b=wt(g);if(b)return a(\"INVALID_STEPS\",b);let{steps:w,until:h,deadlineMs:x}=g;o=g.expect;let R=g.navigates===!0||je(w.at(-1)),P=t.arrived+(x??r.actionTimeoutMs),L=0,J=T=>(t.dispatched=!0,s(\"dispatched\",void 0,T)),Y=n.on(\"pagehide\",()=>{!t.dispatched&&!t.stopped&&L>0&&J(!0),t.stopped=!0}),ee=()=>t.stopped||t.cancelled;try{for(let[T,A]of w.entries()){if(t.stopped)return;if(t.cancelled)return f();if(Date.now()>=P)return a(\"DEADLINE\",\"The action did not finish in time\",L);if(T>0&&Me(w[T-1])&&u.element()===void 0)return a(\"TARGET_NOT_FOUND\",\"The item left the page during the action\",L);if(R&&T===w.length-1&&!Me(A)){if(ye(A),await J(!0),t.stopped)return;ye(A)();return}await kt(A,P,ee),L++}if(t.stopped)return;if(t.cancelled)return f();if(await J(R),R)return;if(h!==void 0){let T=typeof h==\"string\"?()=>document.querySelector(h)!==null:()=>h(document)===!0;try{await ve(T,P-Date.now(),\"the action to take effect\",()=>t.stopped)}catch{return s(\"failed\",{outcome:\"unknown\",code:\"DEADLINE\",message:\"The page did not show the action's effect in time\",completedSteps:L,partial:L>0})}}if(t.stopped)return;e.flush(),await s(\"observed\",{outcome:\"observed\"})}catch(T){let A=T instanceof O?T.code:\"INVALID_ARGUMENT\";return a(A,Pe(T),L)}finally{Y()}}function wt(e){if(typeof e!=\"object\"||e===null)return\"An action must return { satisfied: true } or { steps }\";let{steps:t,until:n}=e;if(!Array.isArray(t))return\"An action must return { satisfied: true } or { steps }\";for(let[r,i]of t.entries()){let o=Et(i);if(o)return`Step ${r}: ${o}`;if(je(i)&&r!==t.length-1)return\"A navigate or submit step must be the last step\"}return n!==void 0&&typeof n!=\"string\"&&typeof n!=\"function\"?\"until must be a selector or a function\":null}function Et(e){if(typeof e!=\"object\"||e===null)return\"must be an object\";let t=e,n=r=>typeof r==\"string\"&&r!==\"\";if(\"click\"in t)return n(t.click)?null:\"click needs a selector\";if(\"fill\"in t)return n(t.fill)&&typeof t.value==\"string\"?null:\"fill needs a selector and a string value\";if(\"submit\"in t)return n(t.submit)?null:\"submit needs a selector\";if(\"navigate\"in t)return n(t.navigate)?null:\"navigate needs a URL\";if(\"waitFor\"in t||\"waitForUrl\"in t)return n(t.waitFor??t.waitForUrl)&&typeof t.timeoutMs==\"number\"?null:\"a wait needs a selector or pattern and timeoutMs\";if(\"scroll\"in t){let r=t.scroll;return r&&n(r.target)&&(r.to===\"end\"||typeof r.to==\"number\")?null:\"scroll needs a target and to\"}return\"unknown step\"}var je=e=>e!==void 0&&(\"navigate\"in e||\"submit\"in e),Me=e=>\"waitFor\"in e||\"waitForUrl\"in e,Pe=e=>String(e?.message??e);function te(e){let t=document.querySelector(e);if(!t)throw new O(\"NOT_FOUND\",`Nothing matches ${e}`);return t}async function kt(e,t,n){let r=()=>Math.max(0,t-Date.now());if(\"waitFor\"in e)await ve(()=>document.querySelector(e.waitFor)!==null,Math.min(e.timeoutMs,r()),e.waitFor,n);else if(\"waitForUrl\"in e){let i=new RegExp(e.waitForUrl);await ve(()=>i.test(location.href),Math.min(e.timeoutMs,r()),e.waitForUrl,n)}else ye(e)()}function ye(e){if(\"click\"in e){let t=te(e.click);return()=>t.click()}if(\"fill\"in e){let t=te(e.fill);return()=>xt(t,e.value)}if(\"submit\"in e){let t=te(e.submit),n=t instanceof HTMLFormElement?t:t.closest(\"form\");if(!n)throw new O(\"NOT_FOUND\",`${e.submit} is not in a form`);let r=t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t:void 0;return()=>n.requestSubmit(r)}if(\"navigate\"in e){let t=e.navigate;return()=>location.assign(t)}if(\"scroll\"in e){let{target:t,to:n}=e.scroll,r=t===\"window\"?document.scrollingElement??document.documentElement:te(t);return()=>{r.scrollTop=n===\"end\"?r.scrollHeight:n}}throw new O(\"INVALID_STEPS\",\"A wait step does not run on its own\")}function xt(e,t){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new O(\"INVALID_STEPS\",\"fill needs an input or textarea\");let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(n,\"value\")?.set?.call(e,t),e.dispatchEvent(new Event(\"input\",{bubbles:!0})),e.dispatchEvent(new Event(\"change\",{bubbles:!0}))}function ve(e,t,n,r){let i=Date.now()+t;return new Promise((o,s)=>{let a=()=>{try{return e()}catch{return!1}},f=()=>{r()||a()?o():Date.now()>=i?s(new O(\"DEADLINE\",`Timed out waiting for ${n}`)):setTimeout(f,ht)};f()})}var $e=new WeakMap;function Ce(e){let t=$e.get(e);return t===void 0&&$e.set(e,t=JSON.stringify(e)),t}function we(e,t){return e===t?!0:e!==null&&t!==null&&Ce(e)===Ce(t)}function re(e,t){return e?.code===t?.code&&e?.message===t?.message}function bt(e,t){if(e.kind!==t.kind)return{kind:\"replace\",region:t};if(t.kind===\"single\"){let p=e;if(we(p.record,t.record)&&p.status===t.status&&re(p.error,t.error))return null;let g={kind:\"single\",record:t.record};return p.status!==t.status&&(g.status=t.status),re(p.error,t.error)||(g.error=t.error??null),g}let n=e;if(!!n.ephemeral!=!!t.ephemeral||t.ephemeral)return It(n,t)?null:{kind:\"replace\",region:t};let r=new Map(n.items.map(p=>[p.key,p])),i=new Set,o=[];for(let p of t.items){i.add(p.key);let g=r.get(p.key);(!g||!we(g,p))&&o.push(p)}let s=n.items.filter(p=>!i.has(p.key)).map(p=>p.key),a=t.items.map(p=>p.key),f=a.length!==n.items.length||a.some((p,g)=>n.items[g].key!==p),u={kind:\"collection\"};return o.length&&(u.upsert=o),s.length&&(u.remove=s),f&&(u.order=a),n.complete!==t.complete&&(u.complete=t.complete),n.status!==t.status&&(u.status=t.status),re(n.error,t.error)||(u.error=t.error??null),Object.keys(u).length>1?u:null}function It(e,t){return e.complete===t.complete&&e.status===t.status&&re(e.error,t.error)&&!!e.ephemeral==!!t.ephemeral&&e.items.length===t.items.length&&e.items.every((n,r)=>we(n,t.items[r]))}function Tt(e,t,n=1/0){let r=e.slice(),i=s=>r.findIndex(a=>a.key===s),o=-1;for(let[s,a]of t.entries()){let f=i(a.key);if(f!==-1){r[f]=a,o=f;continue}let u=o+1;o===-1&&(u=t.slice(s+1).map(g=>i(g.key)).find(g=>g!==-1)??r.length),r.splice(u,0,a),o=u}return r.length>n?Ve(r,new Set(t.map(s=>s.key)),n):r}function Ve(e,t,n){if(e.length<=n)return e;let r=-1,i=0;for(let[a,f]of e.entries())t.has(f.key)&&(r===-1&&(r=a),i=a);r===-1&&(r=0);let o=Math.max(n,i-r+1),s=Math.min(Math.max(0,Math.floor((r+i+1-o)/2)),e.length-o);return e.slice(s,s+o)}function At(e){return new Set(e).size===e.length?{keys:e,ephemeral:!1}:{keys:e.map((t,n)=>String(n)),ephemeral:!0}}function St(e,t,n){let r=new Map,i=o=>{let s=r.get(o);return s||r.set(o,s={keys:new Set,whole:!1,membership:!1,resolve:!1}),s};for(let[o,s]of Object.entries(e)){let a=t.some(f=>f.kind===\"childList\");if(!s.root){a&&(i(o).resolve=!0);continue}if(!ge(s.root,n)){i(o).resolve=!0;continue}(s.dependsOn.some(f=>!ge(f,n))||s.dependsOnMissing&&a)&&(i(o).whole=!0);for(let f of t){if(f.kind===\"field\"&&!s.fields||f.kind===\"resize\"&&!s.measure)continue;f.removed&&ge(s.root,f.target)&&(i(o).whole=!0);let u=He(s,f.target);u.dependent&&(i(o).whole=!0),u.inRoot&&(f.kind===\"childList\"&&(i(o).membership=!0),u.key===void 0?i(o).whole=!0:i(o).keys.add(u.key))}}return r}function Ot(e,t){let n=He(e,t);return n.inRoot||n.dependent}function He(e,t){let n,r=!1,i=!1;for(let o=t;o;o=o.parentNode)n??=e.items.get(o),o===e.root&&(r=!0),e.dependsOn.includes(o)&&(i=!0);return n!==void 0&&(r=!0),{key:n,inRoot:r,dependent:i}}function ge(e,t){for(let n=e;n;n=n.parentNode)if(n===t)return!0;return!1}function Nt(e){let t=new MutationObserver(o=>{let s=[];for(let a of o){s.push({target:a.target,kind:a.type});for(let f of a.removedNodes)s.push({target:f,kind:\"childList\",removed:!0})}e(s)});t.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let n=o=>{o.target instanceof Node&&e([{target:o.target,kind:\"field\"}])};document.addEventListener(\"input\",n,!0),document.addEventListener(\"change\",n,!0);let r=new WeakMap,i=typeof ResizeObserver==\"function\"?new ResizeObserver(o=>{let s=[];for(let a of o){let f=`${a.contentRect.width}x${a.contentRect.height}`,u=r.get(a.target);r.set(a.target,f),u!==void 0&&u!==f&&s.push({target:a.target,kind:\"resize\"})}s.length&&e(s)}):null;return{measure(o){if(i){i.disconnect();for(let s of o)i.observe(s)}},disconnect(){t.disconnect(),i?.disconnect(),document.removeEventListener(\"input\",n,!0),document.removeEventListener(\"change\",n,!0)}}}function Rt(e){for(let t of[\"pushState\",\"replaceState\"]){let n=History.prototype[t];History.prototype[t]=function(...r){let i=n.apply(this,r);try{e()}catch(o){console.error(\"Genesis navigation handler failed\",o)}return i}}addEventListener(\"popstate\",e),addEventListener(\"hashchange\",e)}var _t=new TextEncoder,ne=e=>_t.encode(JSON.stringify(e)).length,Dt=class{constructor(e,t,n=()=>null){this.send=e,this.limits=t,this.shrink=n}send;limits;shrink;epoch=0;seq=0;last=null;page(e){let t={...e,epoch:++this.epoch};for(;ne(t)>this.limits.pageMaxBytes;){let n=this.shrink(t);if(!n){t={...t,status:\"error\",error:{code:\"PAGE_TOO_LARGE\",message:\"The page is too large to show\"},regions:{}};break}t={...n,epoch:t.epoch}}this.seq=0,this.last=t,this.post({page:t})}update(e){let t=this.last;if(!t||!Lt(t,e))return this.page(e);let n={};for(let[o,s]of Object.entries(e.regions)){let a=bt(t.regions[o],s);a&&(n[o]=a)}let r=e.account!==void 0&&e.account!==t.account;if(!r&&Object.keys(n).length===0)return;let i=this.split(n);if(r&&(i[i.length-1].account=e.account),i.some(o=>ne(o)>this.limits.patchMaxBytes))return this.page(e);this.last={...e,epoch:this.epoch};for(let o of i)this.post({patch:o})}split(e){let t=[],n={};for(let[f,u]of Object.entries(e)){if(u.kind!==\"collection\"||!u.upsert){n[f]=u;continue}let{upsert:p,...g}=u;for(let b of p)t.push([f,b]);Object.keys(g).length>1&&(n[f]=g)}let r=this.limits.patchMaxBytes-ne(n)-256,i=[],o=[],s=0;for(let f of t){let u=ne(f[1])+1;o.length&&(o.length>=this.limits.patchRecordsMax||s+u>r)&&(i.push(o),o=[],s=0),o.push(f),s+=u}i.push(o);let a=this.last.view;return i.map((f,u)=>{let p={view:a,epoch:this.epoch,base:this.seq,seq:++this.seq,regions:{}};for(let[g,b]of f)(p.regions[g]??={kind:\"collection\",upsert:[]}).upsert.push(b);if(u===i.length-1)for(let[g,b]of Object.entries(n))p.regions[g]={...p.regions[g],...b};return p})}post(e){this.send(e).catch(t=>{let n=t instanceof O?t.code:null;if(n!==\"RETIRED\"){if(\"patch\"in e&&this.last&&e.patch.epoch===this.epoch){let{epoch:r,...i}=this.last;return this.page(i)}if(\"page\"in e&&n===\"PAGE_TOO_LARGE\"&&e.page.status!==\"error\"){let{epoch:r,...i}=e.page;return this.page({...i,status:\"error\",error:{code:n,message:\"The page is too large to show\"},regions:{}})}console.error(\"Genesis could not publish the page\",t)}})}};function Lt(e,t){let n=Object.keys(t.regions);return e.view.generation===t.view.generation&&e.view.n===t.view.n&&e.view.url===t.view.url&&e.status===t.status&&e.pageId===t.pageId&&e.routeId===t.routeId&&e.error?.code===t.error?.code&&e.error?.message===t.error?.message&&e.signInUrl===t.signInUrl&&JSON.stringify(e.params)===JSON.stringify(t.params)&&n.length===Object.keys(e.regions).length&&n.every(r=>e.regions[r]?.kind===t.regions[r].kind)}function Mt(e,t,n){let r,i,o=()=>{clearTimeout(r),r=void 0,i=void 0,e()};return{schedule(){let s=Date.now();i??=s,clearTimeout(r),r=setTimeout(o,Math.min(t,Math.max(0,i+n-s)))},now(){r!==void 0&&o()},cancel(){clearTimeout(r),r=void 0,i=void 0}}}var Pt=1e4,Ue=!1;function Ee(e){if(typeof window>\"u\"||window.top!==window||Ue)return;Ue=!0;let t=window,n=t.__genesisBridge;try{delete t.__genesisBridge}catch{t.__genesisBridge=void 0}if(!n)return;let r=null;Rt(()=>r?.navigated());let i=()=>Le(n,location.href).then(o=>{r=$t(o,e)},o=>console.error(\"Genesis could not bind this page\",o));i(),addEventListener(\"pageshow\",o=>{o.persisted&&(r?.stop(),r=null,i())})}function $t(e,t){let{manifest:n,limits:r,generation:i}=e.bound,o={batches:0,reads:0,lastBatchReads:0,pages:0,patches:0,lastPublishBytes:0,resyncs:0,startedAt:Date.now()},s=!1;s&&(window.__genesisStats=o);let a=new Dt(c=>(s&&(\"page\"in c?o.pages++:o.patches++,o.lastPublishBytes=JSON.stringify(c).length),e.request(\"context.publish\",c)),r,ct),f={generation:i,n:0,url:location.href};if(e.bound.compat.adapterApi!==j.adapterApi){let c=`This applet uses adapter API ${j.adapterApi}; this Genesis uses ${e.bound.compat.adapterApi}`;return console.error(`Genesis: ${c}`),a.page({view:f,pageId:null,routeId:null,params:{},status:\"error\",error:{code:\"PROTOCOL_MISMATCH\",message:c},account:null,regions:{}}),{navigated(){},stop(){}}}let u=!1,p=pe(location.href),g=me(n,location.href),b=P(g),w=null,h=new Map,x=[],R=!1;function P(c){return c.kind===\"route\"?t.pages[c.page]??null:null}function L(){let c=b?.account??t.account;try{let l=c?.(document);return l===void 0&&c?{account:void 0,failed:!1}:{account:typeof l==\"string\"&&l!==\"\"?l:null,failed:!1}}catch(l){return console.error(\"Genesis adapter account failed\",l),{account:void 0,failed:!0}}}function J(){let c=t.signInUrl;try{if(typeof c==\"string\")return new URL(c,n.origins[0]).href;if(typeof c==\"function\")return new URL(c(location.href),location.href).href}catch(l){console.error(\"Genesis adapter signInUrl failed\",l)}return null}function Y({account:c,failed:l}){if(g.kind!==\"route\")return{status:\"unsupported\"};if(!b)return{status:\"error\",error:{code:\"NOT_FOUND\",message:`The adapter declares no page ${g.page}`}};let m;try{m=b.ready(document)===!0}catch(y){return{status:\"error\",error:{code:\"INVALID_ARGUMENT\",message:Fe(y)}}}if(b.requiresAccount===!0&&l)return{status:\"loading\"};let d=b.requiresAccount===!0&&c===null;return m?{status:d?\"auth\":\"ready\"}:d&&document.readyState!==\"loading\"?{status:\"auth\"}:{status:\"loading\"}}function ee(c,l){let m={view:f,pageId:g.kind===\"route\"?g.page:null,routeId:g.kind===\"route\"?g.routeId:null,params:g.kind===\"route\"?g.params:{},status:l.status,signInUrl:J(),regions:{}};c!==void 0&&(m.account=c),l.error&&(m.error=l.error);for(let[d,y]of h)m.regions[d]=y.value;return m}function T(c,l,m){let d={name:c,def:l,root:null,items:new WeakMap,elements:new Map,dependsOn:[],dependsOnMissing:!1,value:m?.value??Ct(l)};for(let y of l.dependsOn??[]){let v=[...document.querySelectorAll(y)];v.length===0&&(d.dependsOnMissing=!0),d.dependsOn.push(...v)}return d.root=document.querySelector(l.root),A(d,()=>l.kind===\"collection\"?_(d,l,\"all\"):$(d,l)),d}function A(c,l){try{c.value=l()}catch(m){let d=m instanceof O?m.code:\"INVALID_ARGUMENT\";c.value={...c.value,status:\"error\",error:{code:d,message:`${c.name}: ${Fe(m)}`}}}}function $(c,l){let m=c.root;return m?{kind:\"single\",status:\"ready\",record:Se(l,m,l.key?oe(l.key,m):c.name)}:{kind:\"single\",status:\"ready\",record:null}}function _(c,l,m){let d=c.value,y=c.root?[...c.root.querySelectorAll(l.items)]:[],{keys:v,ephemeral:E}=At(y.map(M=>oe(l.key,M))),I=d.ephemeral?new Map:new Map(d.items.map(M=>[M.key,M])),D=c.elements;c.elements=new Map;let S=y.map((M,lt)=>{let W=v[lt];c.elements.set(W,M);let _e=I.get(W);return m!==\"all\"&&_e&&!m.has(W)&&D.get(W)===M?_e:Ae(c,l,M,W)}),G={kind:\"collection\",status:\"ready\",items:l.virtualized&&!E&&!d.ephemeral?Tt(d.items,S,r.patchRecordsMax):S,complete:he(l)};return E&&(G.ephemeral=!0),G}function Ae(c,l,m,d){let y=Se(l,m,d);c.items.set(m,d);for(let v of l.extent?.(m)??[])v&&c.items.set(v,d);return y}function Se(c,l,m){o.reads++;let d=c.read(l);if(typeof d?.then==\"function\")throw new O(\"ASYNC_READ\",\"read must return its data synchronously\");let y={key:m,data:d===void 0?null:d};return c.entity&&(y.entity=c.entity(l)),c.entityType&&(y.entityType=c.entityType),y}function it(c,l,m){let d=c.value;if(d.ephemeral||d.status===\"error\")return A(c,()=>_(c,l,m));let y=d.items.slice();for(let v of m){let E=c.elements.get(v),I=y.findIndex(S=>S.key===v);if(!(E?.isConnected&&c.root?.contains(E)&&E.matches(l.items))||I===-1||oe(l.key,E)!==v)return A(c,()=>_(c,l,m));try{y[I]=Ae(c,l,E,v)}catch{return A(c,()=>_(c,l,m))}}c.value={...d,items:y,complete:he(l)}}function st(c,l){let{def:m}=c;l.resolve||l.whole||m.kind===\"single\"?h.set(c.name,T(c.name,m,c)):l.membership?A(c,()=>_(c,m,l.keys)):it(c,m,l.keys)}function ct(c){if(c.view.n!==f.n)return null;let l={...c,regions:{...c.regions}},m=!1;for(let[d,y]of Object.entries(c.regions)){let v=h.get(d);if(v?.def.kind!==\"collection\"||!v.def.virtualized||y.kind!==\"collection\"||y.ephemeral)continue;let E=Ve(y.items,new Set(v.elements.keys()),Math.floor(y.items.length*3/4));E.length!==y.items.length&&(l.regions[d]={...y,items:E},v.value===y&&(v.value=l.regions[d]),m=!0)}return m?l:null}function ae(c=!1){if(u)return;x=[],R=!1;let l=L(),{account:m}=l,d=Y(l),y=h;if(h=new Map,d.status===\"ready\")for(let[E,I]of Object.entries(b?.regions??{}))h.set(E,T(E,I,y.get(E)));w=d.status;let v=ee(m,d);c?a.page(v):a.update(v),Ne()}function Oe(){if(u)return;o.batches++;let c=o.reads,l=x,m=R;x=[],R=!1;let d=L(),{account:y}=d,v=Y(d);if(v.status!==\"ready\"||w!==\"ready\"||m)ae();else{let E={};for(let[I,D]of h)E[I]=qe(D);for(let[I,D]of St(E,l,document))st(h.get(I),D);for(let I of h.values()){let D=I.value;if(I.def.kind===\"collection\"&&D.kind===\"collection\"&&I.def.more){let S=he(I.def);S!==D.complete&&(I.value={...D,complete:S})}}a.update(ee(y,v)),Ne()}o.lastBatchReads=o.reads-c}function Ne(){let c=[];for(let l of h.values())l.def.measure&&(l.def.kind===\"single\"?l.root&&c.push(l.root):c.push(...l.elements.values()));Re.measure(c)}let q=Mt(Oe,r.publishQuietMs,r.publishMaxDelayMs),Re=Nt(c=>{if(!u){if(w===\"ready\"&&!R){let l=[...h.values()].map(qe);x.push(...c.filter(m=>m.kind!==\"attributes\"||l.some(d=>Ot(d,m.target)))),x.length>Pt&&(x=[],R=!0)}q.schedule()}}),le=yt({connection:e,limits:r,flush:()=>{q.cancel(),Oe()},find:at,view:()=>f.n});function at(c){let l=(S,G)=>({error:{code:S,message:G}});if(w!==\"ready\"||!b)return l(\"NOT_READY\",\"The page is not ready\");let m=f.n;if(c.region===null){let S=b.actions?.[c.name];return S?{action:S,element:()=>null}:l(\"INVALID_ARGUMENT\",`The page has no action ${c.name}`)}let d=c.region,y=h.get(d);if(!y)return l(\"NOT_FOUND\",`The page has no region ${d}`);let v=y.def.actions?.[c.name];if(!v)return l(\"INVALID_ARGUMENT\",`Region ${d} has no action ${c.name}`);let E=y.def;if(E.kind===\"single\")return{action:v,element:()=>f.n===m?document.querySelector(E.root)??void 0:void 0};if(y.value.ephemeral)return l(\"PRECONDITION_FAILED\",`Region ${d} repeats keys, so its records have no actions`);let I=c.key;if(I===null)return l(\"INVALID_ARGUMENT\",`Action ${c.name} needs a record key`);let D=()=>{if(f.n!==m)return;let S=h.get(d)?.elements.get(I);if(S?.isConnected&&Ge(E,S)===I)return S;let G=document.querySelector(E.root);return G?[...G.querySelectorAll(E.items)].find(M=>Ge(E,M)===I):void 0};return D()===void 0?l(\"TARGET_NOT_FOUND\",`No ${d} item has key ${I}`):{action:v,element:D}}function ue(c=!0){u||(u=!0,q.cancel(),Re.disconnect(),c&&le.retire())}return e.on(\"resync\",()=>{o.resyncs++,q.cancel(),ae(!0)}),e.on(\"act\",c=>le.act(c)),e.on(\"cancel\",({actionId:c})=>le.cancel(c)),e.on(\"ping\",()=>{}),e.on(\"retired\",()=>ue()),e.on(\"pagehide\",()=>ue(!1)),document.readyState===\"loading\"&&document.addEventListener(\"DOMContentLoaded\",()=>q.schedule(),{once:!0}),ae(),{navigated(){if(u)return;let c=pe(location.href);c!==p&&(p=c,f={generation:i,n:f.n+1,url:location.href},g=me(n,location.href),b=P(g),w=null,h=new Map,q.cancel(),q.schedule())},stop:()=>ue()}}function qe(e){return{root:e.root,items:e.items,dependsOn:e.dependsOn,dependsOnMissing:e.dependsOnMissing,fields:e.def.fields===!0,measure:e.def.measure===!0}}function Ct(e){return e.kind===\"collection\"?{kind:\"collection\",status:\"ready\",items:[],complete:!0}:{kind:\"single\",status:\"ready\",record:null}}function he(e){return e.more?document.querySelector(e.more)===null:!0}function oe(e,t){let n=e(t);if(typeof n!=\"string\"||n===\"\")throw new O(\"INVALID_ARGUMENT\",\"key must return a non-empty string\");return n}function Ge(e,t){try{return oe(e.key,t)}catch{return null}}function Fe(e){return String(e?.message??e)}function H(e){return{...e,kind:\"collection\"}}function N(e){return{...e,kind:\"single\"}}function ke(e){let t=(o,s)=>{throw new Error(`Adapter ${o} ${s}`)},n=(o,s)=>{o!==void 0&&typeof o!=\"function\"&&t(s,\"must be a function\")},r=(o,s)=>{(typeof o!=\"string\"||o.trim()===\"\")&&t(s,\"must be a CSS selector\")},i=(o,s)=>{if(o!==void 0){V(o)||t(s,\"must be an object of functions\");for(let[a,f]of Object.entries(o))typeof f!=\"function\"&&t(`${s}.${a}`,\"must be a function\")}};V(e)||t(\"definition\",\"must be an object\"),n(e.account,\"account\"),e.signInUrl!==void 0&&typeof e.signInUrl!=\"string\"&&typeof e.signInUrl!=\"function\"&&t(\"signInUrl\",\"must be a path or a function\"),V(e.pages)||t(\"pages\",\"must be an object\");for(let[o,s]of Object.entries(e.pages)){let a=`pages.${o}`;V(s)||t(a,\"must be an object\"),typeof s.ready!=\"function\"&&t(`${a}.ready`,\"must be a function\"),n(s.account,`${a}.account`),i(s.actions,`${a}.actions`),s.regions!==void 0&&!V(s.regions)&&t(`${a}.regions`,\"must be an object\");for(let[f,u]of Object.entries(s.regions??{})){let p=`${a}.regions.${f}`;(!V(u)||u.kind!==\"collection\"&&u.kind!==\"single\")&&t(p,\"must be made with collection() or single()\"),r(u.root,`${p}.root`),typeof u.read!=\"function\"&&t(`${p}.read`,\"must be a function\"),n(u.entity,`${p}.entity`),u.dependsOn!==void 0&&(Array.isArray(u.dependsOn)||t(`${p}.dependsOn`,\"must be an array of selectors\"),u.dependsOn.forEach((g,b)=>r(g,`${p}.dependsOn.${b}`))),i(u.actions,`${p}.actions`),u.kind===\"collection\"?(r(u.items,`${p}.items`),typeof u.key!=\"function\"&&t(`${p}.key`,\"must be a function\"),n(u.extent,`${p}.extent`),u.more!==void 0&&r(u.more,`${p}.more`)):n(u.key,`${p}.key`)}}return e}function V(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var K=\"https://news.ycombinator.com\";var C=e=>typeof e==\"string\"&&e.length<=20&&/^[1-9][0-9]*$/.test(e);function xe(e,t=K){try{let n=new URL(e,t);return(n.protocol===\"https:\"||n.protocol===\"http:\")&&!n.username&&!n.password&&n.href.length<=2048?n.href:null}catch{return null}}function ie(e){try{let t=new URL(e,K),n=t.searchParams.get(\"id\");return t.origin===K&&t.pathname===\"/item\"&&C(n)?n:null}catch{return null}}var Ut=3,qt=1;function k(e,t=300){return(e??\"\").replace(/\\s+/g,\" \").trim().slice(0,t)}function Be(e){return e.ownerDocument?.location?.href??`${K}/`}function Z(e){let t=e.getAttribute(\"href\");return t?xe(t,Be(e)):null}var ze=e=>k((e?.querySelector(\".hnuser\")??e?.querySelector(\"a[href^='user?id=']\"))?.textContent,64)||null,U=e=>e.readyState!==\"loading\"&&e.querySelector(\"#hnmain\")!==null,B=e=>k(e.querySelector(\"#me\")?.textContent,64)||null;function F(e,t=12e3){let n=[],r=0,i=(o,s)=>{if(r>=t)return;if(o.nodeType===Ut){let u=(o.textContent??\"\").slice(0,t-r);r+=u.length,u&&n.push({text:u,...s});return}if(o.nodeType!==qt)return;let a=o;if(a.matches(\"script,style,input,textarea,select,button,noscript,form,img,.reply,.pagetop\"))return;let f={...s};if(a.tagName===\"A\"){let u=Z(a);u&&(f.href=u)}a.matches(\"b,strong\")&&(f.strong=!0),a.matches(\"i,em\")&&(f.em=!0),a.matches(\"code,pre\")&&(f.code=!0),a.matches(\"p,br,pre,li,tr,h1,h2,h3\")&&r>0&&(n.push({text:`\n\n`}),r+=2);for(let u of a.childNodes)i(u,f)};return e&&i(e,{}),n}function be(e,...t){let n=o=>{for(let s of t){let a=s?.querySelector(`[id=\"${o}_${e}\"]`);if(a)return a}return null},r=n(\"up\"),i=r?.classList.contains(\"nosee\")===!0||n(\"un\")!==null;return{canVote:r!==null&&!i,voted:i}}function se(e){if(!C(e.id))return null;let t=e.querySelector(\".titleline > a\"),n=k(t?.textContent,400);if(!t||!n)return null;let r=Z(t),i=e.nextElementSibling?.querySelector(\".subtext\")??null,o=[...i?.querySelectorAll(\"a[href^='item?id=']\")??[]].reverse().find(s=>/comment|discuss/i.test(s.textContent??\"\"));return{id:e.id,title:n,articleUrl:r&&ie(r)!==e.id?r:null,domain:k(e.querySelector(\".sitestr\")?.textContent,120)||null,submitter:ze(i),score:k(i?.querySelector(\".score\")?.textContent,40)||null,age:k(i?.querySelector(\".age\")?.textContent,40)||null,comments:o?k(o.textContent,40):null,rank:k(e.querySelector(\".rank\")?.textContent,8).replace(/\\.$/,\"\")||null,...be(e.id,e,i)}}function Gt(e){let n=[...e.querySelectorAll(\".navs a[href]\")].find(i=>k(i.textContent,20)===\"parent\")?.getAttribute(\"href\")??\"\",r=n.startsWith(\"#\")?n.slice(1):ie(xe(n,Be(e))??\"\")??\"\";return C(r)?r:null}function X(e,{links:t=!1}={}){if(!C(e.id))return null;let n=e.querySelector(\".comment\");if(!n)return null;let r=n.querySelector(\".commtext\"),i=e.querySelector(\".onstory a[href]\"),o=i?ie(Z(i)??\"\"):null;return{id:e.id,author:ze(e.querySelector(\".comhead\")),age:k(e.querySelector(\".age\")?.textContent,40)||null,depth:Math.min(20,Math.max(0,Number(e.querySelector(\".ind\")?.getAttribute(\"indent\")??0)||0)),parent:Gt(e),parts:r?F(r,8e3):[{text:k(n.textContent,100)||\"[no text]\"}],onStory:o?{id:o,title:k(i.getAttribute(\"title\")||i.textContent,400)}:null,links:t?[...e.querySelectorAll(\".navs a[href]\")].flatMap(s=>{let a=k(s.textContent,20),f=Z(s);return f&&a&&!s.classList.contains(\"togg\")&&s.closest(\".onstory\")===null?[{label:a,url:f}]:[]}).slice(0,6):[],canReply:n.querySelector(\".reply a[href^='reply?id=']\")!==null,...be(e.id,e)}}function ce(e){let t=Z(e);return t?{url:t}:null}function z(e,t,n){let r=n?.voted;if(typeof r!=\"boolean\")throw new Error(\"setVoted needs { voted: boolean }\");if(!C(t))throw new Error(\"Not a Hacker News item\");let i=s=>be(t,s.documentElement).voted;if(i(e)===r)return{satisfied:!0};let o=`[id=\"${r?\"up\":\"un\"}_${t}\"]`;if(!e.querySelector(o))throw new Error(r?\"This item cannot be upvoted here\":\"This vote cannot be undone here\");return{steps:[{click:o}],until:s=>i(s)===r}}function Ft(e){let t=k(e.querySelector(\"#me\")?.textContent,64);return t?{name:t,karma:k(e.querySelector(\"#karma\")?.textContent,20)||null}:null}var Je={ready:U,requiresAccount:!0,regions:{account:N({root:\"#hnmain\",read:Ft,actions:{signOut:e=>{if(B(e.ownerDocument)===null)return{satisfied:!0};if(!e.querySelector(\"a#logout\"))throw new Error(\"Hacker News shows no logout link\");return{steps:[{click:\"a#logout\"}],navigates:!0}}}})}};var Ie={ready:U,regions:{stories:H({root:\"#hnmain\",items:\"tr.athing.submission\",key:e=>e.id,entityType:\"story\",read:se,extent:e=>[e.nextElementSibling],more:\"a.morelink\",actions:{setVoted:(e,t)=>z(e.ownerDocument,e.id,t)}}),comments:H({root:\"#hnmain\",items:\"tr.athing:not(.submission)\",key:e=>e.id,entityType:\"comment\",read:e=>X(e),more:\"a.morelink\",actions:{setVoted:(e,t)=>z(e.ownerDocument,e.id,t)}}),more:N({root:\"a.morelink\",read:ce})},actions:{loadMore:()=>({steps:[{click:\"a.morelink\"}],navigates:!0,expect:{page:[\"feed\",\"private-feed\"]}})}},We={...Ie,requiresAccount:!0};var Te=`\n\n`,Ke=e=>!e.href&&e.text.trim()===\"\";function jt(e,t){let n=[],r=()=>n[n.length-1];for(let i of e)if(i.text===Te)n.length>0&&r().text!==Te&&n.push(i);else if(i.code)n.push(i);else{let o=i.text.replace(/\\s*\\n\\s*/g,\" \");(n.length===0||r().text===Te)&&(o=o.trimStart()),o&&n.push({...i,text:o})}for(;n.length>0&&Ke(r());)n.pop();for(n[0]?.text.trim()===t&&n.shift();n.length>0&&Ke(n[0]);)n.shift();return n}function Vt(e){let t=e.ownerDocument,n=e.querySelector(\"#bigbox\")??e.querySelector(\"body\"),r=k(t.title.replace(/\\s*\\|\\s*Hacker News$/,\"\"),120)||\"Hacker News\";return{title:r,parts:jt(F(n,6e4),r)}}var Ze={ready:e=>e.readyState!==\"loading\"&&e.body!==null,account:e=>e.querySelector(\"#hnmain\")?B(e):void 0,regions:{sections:N({root:\"html\",read:Vt})}};function Ht(e){let t=e.querySelector(\"tr.athing\"),n=t?.matches(\".submission\")?se(t):null;return{story:n,comment:t&&!n?X(t,{links:!0}):null,text:F(e.querySelector(\".toptext\")),canComment:e.querySelector(\"form[action='comment'] textarea\")!==null}}function Xe(e){let t=e.querySelector(\"tr.athing\")?.id;if(t)return t;let n=new URLSearchParams(e.ownerDocument?.location?.search??\"\").get(\"id\");return C(n)?n:\"item\"}var Qe={ready:U,regions:{story:N({root:\"table.fatitem\",key:Xe,entityType:\"story\",read:Ht,actions:{setVoted:(e,t)=>z(e.ownerDocument,Xe(e),t)}}),comments:H({root:\"table.comment-tree\",items:\"tr.athing.comtr\",key:e=>e.id,entityType:\"comment\",read:e=>X(e),more:\"a.morelink\",actions:{setVoted:(e,t)=>z(e.ownerDocument,e.id,t)}}),more:N({root:\"a.morelink\",read:ce})}};var Q=\"form[action='/r']\",et=[\"title\",\"url\",\"text\"],tt=(e,t)=>e.querySelector(`[name='${t}']`);function Bt(e){let t=Object.fromEntries(et.map(i=>[i,tt(e,i)?.value??\"\"])),n=e.closest(\"#bigbox, td\")??e.parentElement,r=\"\";for(let i of n?.childNodes??[])i===e||i.tagName===\"SCRIPT\"||i.contains?.(e)||(r+=` ${i.textContent??\"\"}`);return{...t,error:k(r,300)||null}}var zt=e=>et.includes(e),nt={ready:e=>e.readyState!==\"loading\"&&e.querySelector(\"#hnmain\")!==null,account:e=>e.querySelector(Q)?void 0:null,requiresAccount:!0,regions:{form:N({root:Q,dependsOn:[\"#hnmain\"],fields:!0,read:Bt,actions:{setField:(e,t)=>{let{name:n,value:r}=t??{};if(!zt(n)||typeof r!=\"string\")throw new Error(\"setField needs { name: title | url | text, value }\");if(n===\"title\"&&r.length>80)throw new Error(`Titles are at most ${80} characters`);let i=tt(e,n);if(!i)throw new Error(`The form has no ${n} field`);return i.value===r?{satisfied:!0}:{steps:[{fill:`${Q} [name='${n}']`,value:r}],until:o=>o.querySelector(`${Q} [name='${n}']`)?.value===r}},submit:()=>({steps:[{submit:Q}],navigates:!0,expect:{page:[\"item\",\"feed\"],notPage:\"submit\"}})}})}};function Jt(e){let t=new Map;for(let r of e.querySelectorAll(\"tr\")){let[i,o]=r.querySelectorAll(\":scope > td\"),s=k(i?.textContent,20).replace(/:$/,\"\").toLowerCase();s&&o&&!t.has(s)&&t.set(s,o)}let n=k(t.get(\"user\")?.textContent,64);return n?{name:n,created:k(t.get(\"created\")?.textContent,40)||null,karma:k(t.get(\"karma\")?.textContent,20)||null,about:F(t.get(\"about\")??null,6e3)}:null}var rt={ready:U,regions:{profile:N({root:\"#bigbox\",read:Jt})}};var Wt=e=>{let{pathname:t,search:n}=new URL(e);return`/login?goto=${encodeURIComponent(t.slice(1)+n)}`},ot=ke({account:B,signInUrl:Wt,pages:{feed:Ie,\"private-feed\":We,item:Qe,user:rt,info:Ze,account:Je,submit:nt}});Ee(ot);})();\n"},{"path":"assets/yc.png","encoding":"base64","content":"iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABAKADAAQAAAABAAABAAAAAABn6hpJAAASy0lEQVR4Ae2dC7BVVRnHv8tDXgIiGYKaZqaJpphvMzV8oEim5Tg6mk2T+ZryNZlWSvioTC0zHRtL03FirCwQEAN8oKiQD3wiCgahkIC8BAR5yW1912vA5t7DOXt965y9zvqtGeWuffb6r2/9vnv/e52999q7ofF8uVXWy5nSID2lUSgQgEC9E2hwA2yURdJGhjY0nicLXaWH29Sm3sfN+CAAgf8TWO8O+kvauWrP/2/iBwhAIBUCesDv2YZpfyr5ZpwQyBBwX/mZ9meYUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCHQLlOnWopAhy4inbqX2qOyz1avEPlwaWVt6nHvtu1Fum5nMzLlqVwpZRHAAMrC1LzTtp8RGfyaSJu2lbRqfd/500WG9BVZ/1Hr+6TwyYAfiXz9ev+RKsdr9hKZN81fKxEFvgJUkui5b4hMureSFqX37bW7yIFnlN6n3j/t2FXkmMtsRvnM3fzxV0gSA6gQmIy6RmTtqkpbtb7/iVeJNCSchqMvEemybet8yv1EczLaYBZRbn91sl/Cv3k5M7hktsj423M2bqFZrz3cLOD0Fj5IYFPT0f9Sm4GOv01Ec0OpiAAGUBGu5p3H3GB78m5gorMAnfp37pEnA5u2WbVMZMyvNt1GrSwCGEBZmDI7rVgkMvbGzEaPau89RQ44zUMgwqZ6NUWn/xZF//g1J5SKCWAAFSNrbvD4rSLL5uVtvXm71GYBTUf/bTbnUOmWZfNFNBeUXAQwgFzYXCO91qwnBK1KH3f5av9TrdSKrdNZj/4X28T40BCu+3uQxAA84Iledloww0dh07YnXp3GFYFjf2hzQ9XCmSJPuxxQchPAAHKjcw0/Wivy4E99FDZt22dvkf2+sem2eqvpSb/+F9mM6kF38lRzQMlNAAPIja654eQHRGa/5KuyoX29zwKOc0f/jt02jDfvT3NeFXnhr3lb066ZAAbg+6vQuF5k2JW+Khva77iPSL+TN9Tr6acu7uj/1R/YjGjYFSLKnuJFAAPwwtfceOo4kWnjLZQ+1qjXWcBx7p5/vfnHt7z1lMjrY3xVaO8IYABWvwaWs4Cd+onse5JVZMXQ6dLTHf2/bxPLcMMZl01E0apgAFapm/WcyIv/sFITGTTYTqsISgMuF+mwtX8kr4wQmTHRXweFJgIYgOUvwgh3RcBqae9O+9XPLGBrd/Q/yuDor9/59cw/xYwABmCG0gnpOvSJ99gpnlgns4AB7oSdPkzFt0y6T+TdKb4qtN+IAAawEQyTH/XONKvlwjvvL7LPIJOwaiaiT/o58kL/7tetEXnI8M5L/4jqQgEDsE7jkv/a3pse+yzA6uj/5B0ii2ZZZyt5PQwgxK/AWLc6zepZf7scKLL3wBBRhtfs1ssd/S/w72f1ByL//IW/DgqbEcAANkNisGHFErc+3T0zwKrEekVAj/5bdfanMO5mkeUL/HVQ2IwABrAZEqMNukR16Vwbsc8eLLLX8TZa1VLptr07+p/v39sHC0Ue/Y2/DgotEsAAWsRisHHNh7YnrWKbBRzvbtZp38kf5OjrRFYt99dBoUUCGECLWIw2Pn2XyHtv2YjteqhI3+NstEKrdHdH/yPO8+9l8TsiE+7010GhVQIYQKtoDD7Qm4JGGN64MuhnBkFVQeKEn7ijf0f/jka45yOsW+2vg0KrBDCAVtEYfTD57yLvvGgj9rnDRPY8xkYrlMo2fUQO/56/+typIs/+2V8HhZIEMICSeAw+bFou7M6GW5WizwKsjv7Df8xyX6vfmRI6GEAJOGYfvfGoyJuP28jtdrjIF/rbaFmr9NjBHf3P8Ved+S+RV0b666CwRQIYwBYRGe1guYS1qLOAE9xiqHYd/IFZsvKPpq4VMIBqpXfW8265sDsfYFE+f4TI7kdZKNlp9NhJ5Mvf9deb8rDI9Cf9dVAoiwAGUBYmo510Kev6dTZiXyvYFYGBevTfym9sjY0iw50OpWoEMICqoXYdzZ8m8syfbHrUGYDOBIpQtt1Z5LDv+Efy/P0ic17210GhbAIYQNmojHZ86Fq3XNjdJWhRinIuYKC77u979NfHe48cbEEFjQoIYAAVwDLZ9X1dLvw7E6mmqwF6VaCWpecuNkf/p/5g+5KVWjKJqG8MoBbJ0pdZrnzfpudazwL0u3/b9n5jWbNSZPT1fhq0zkUAA8iFzbPRSsPlwnpnoN4hWIvyqV1FDv22f8+P3mL7olX/iJJRwABqlWr9GvD+uza912oWYHH0X7FYZNxNNhxQqZgABlAxMqMGeiLQ6hl3ukpw14ONAitTpunof3aZO5fYbcwv7Z6eVKIbPmqZAAbQMpfqbNW3C8+fbtPXoCE2OuWq6NuL2rQrd++W99MTouNva/kztlaFAAZQFcytdKLLha3eLqxPDNrloFY6Mt786d1EDjnLX3Sku5lpLct9/UHmV8AA8rOzafnSMJG3X7DRqtbdgRZHf70patK9NuNGJTcBDCA3OqOGulxYl75aFH16sL5LIGTRo/9BZ/r3oDMfq7co+UeTrAIGUITU63LhNx6xiST0uQC94tCmrV+sOuOxfI+iXzRJt8YAipL+pgdgNPpHo28SCjUL6LWHyIFn+MdoNePxjyR5BQygKL8Cb08WmfyATTSh3iakTyb2PfrrTEdnPJRCEMAACpGG5iBGuktrFsuF9z1JRN8ubFm216P/6f6KHP39GRoqYACGML2l9J6Ap929ARZlkDMTy6LnFho8f110hqMzHUphCHhmtDDjqJ9ARl9rs1x435NFduxnw6V3X5EDTvPTanpEurEp+UVEa0cAAyjar4GuD3jMvVbMtzQ0iFjNAvS7v+/Rv+muR3ftn1IoAhhAodLRHMzYG9xyYbdi0Lf0O0Vkhy/6qfRxR//9PY/+a1e5dQ9uZkMpHAEMoHApcQGtXOpeh+0WyfiWplmAO3r7lKbv/m424VP0Ral63z+lcAQwgMKlpDmg8bfb/NHs902RPnvnG6XOHr50ar62n7T60JnZWPcAFEohCWAAhUyLC0qXC48a4h+dzgL0mX15StN3f8+jv/7xrzD4OpMnftpskQAGsEVENdxh4j0fP0nYNwT9Dq/38FdSdNagswefsmyeO6H5Wx8F2gYmgAEEBuwlb7VcWO/eO/7KykLRFX86e/Apo64RWeNmMpTCEsAACpua5sB00Yy+Vci3HPwtkW12KE+l957uzL/nd/8FM9w7EO4urz/2qhkBDKBm6Cvo2OJdefrc/mMuLa9TfcOv73X/EVeJ6LP+KYUmgAEUOj3NwembhaeO84/0K+eKdO5eWkfPFfiu+Jv9ssgLfyvdD58WggAGUIg0lBGExXLhjl1FjrigdGd6rsB3xV9TrOtL98OnhSCAARQiDWUE8c6LbrmwwVG1/0XuNV6tvMhD3/B7yNllBFNiF32z7+tjSuzAR0UigAEUKRtbikW/V/suF+7e2z3S66yWexpwuf9bfoZf0bI2WwtJAAMoZFpaCeq9f7vlwne18mEFm4+9bPOdu24ncvg5m2+vZMvLw0VmPltJC/atMQEMoMYJqLh7fZmIvkvPp+hNPvoykY3L0e4KQftOG2+p7Gd9uOmDboZCiYoABhBVulywS43urtv4kqCeHDzqQj8Sk+4TmTvVT4PWVSeAAVQduUGHY29099cv9hPqO0BEH/Ol5Uj3x99pC5cHP96z5f+vW22zbqFldbYGJIABBIQbTFpX2Ok79XyK3ubb/2J3RaCDu0HoEh8lkSfuEFn8tp8GrWtCAAOoCXaDTvWdekvm+AnpJb+jnQl02z6/zqrl7tkFP8/fnpY1JYAB1BS/R+f6Tj3f5cIduoic4jmTeORmkQ8WeQyEprUkgAHUkr5v35PuFZn3pp+Kzz3/yxeIPPJrv/5pXVMCGEBN8Xt2brVcOG8YD18vsnpF3ta0KwABDKAASfAKQd8u/J8a3HyzaJbIhN97hU7j2hPAAGqfA/8IhrkFPNUuIweLrGO5b7WxW/eHAVgTrYXe9CfcApyx1ev53Skizw6tXn/0FIwABhAMbZWFLZYLlxvycPfAEL31lxI9AQwg+hQ2D2D2S+4hHH8JP5oZE0VeHRW+H3qoCgEMoCqYq9TJiKvDP4aLt/tWKZnV6QYDqA7n6vSiD+J86o/h+npttMhbE8Lpo1x1AhhA1ZEH7nD0dWGuzTct9835gpHAQ0Y+PwEMID+7YrYM9TKO5+4XmfNqMcdMVLkJYAC50RW44bib3HJhw/vz9fHeet2fUncEMIC6S6kbkC4Xtni78CdsJtwpsnDmJzX+rSMCGEAdJXOToTzh3i68ZPYmm3JV9F5/veefUpcEMIC6TKsblC4Xnjbef3SP3SKybL6/DgqFJIABFDItBQpqCs/4L1A2zEPBAMyRIgiBeAhgAPHkikghYE4AAzBHiiAE4iGAAcSTKyKFgDkBDMAcKYIQiIcABhBProgUAuYEMABzpAhCIB4CGEA8uSJSCJgTwADMkSIIgXgIYADx5IpIIWBOAAMwR4ogBOIhgAHEkysihYA5AQzAHCmCEIiHAAYQT66IFALmBDAAc6QIQiAeAhhAPLkiUgiYE8AAzJEiCIF4CGAA8eSKSCFgTgADMEeKIATiIYABxJMrIoWAOQEMwBwpghCIhwAGEE+uiBQC5gQwAHOkCEIgHgIYQDy5IlIImBPAAMyRIgiBeAhgAPHkikghYE4AAzBHiiAE4iGAAcSTKyKFgDkBDMAcKYIQiIcABhBProgUAuYEMABzpAhCIB4CGEA8uSJSCJgTwADMkSIIgXgIYADx5IpIIWBOAAMwR4ogBOIhgAHEkysihYA5AQzAHCmCEIiHAAYQT66IFALmBDAAc6QIQiAeAhhAPLkiUgiYE8AAzJEiCIF4CGAA8eSKSCFgTgADMEeKIATiIYABxJMrIoWAOQEMwBwpghCIhwAGEE+uiBQC5gQwAHOkCEIgHgIYQDy5IlIImBPAAMyRIgiBeAhgAPHkikghYE4AAzBHiiAE4iGAAcSTKyKFgDmBhsZzpdFcFUEIQCAKAswAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAyBNtIQRhhVCECg4ATc377OABa5/9YXPFTCgwAEbAno3/winQEMdT8sYSZgSxc1CBSWwMezfv2bH/o/4JuJLNSc5H4AAAAASUVORK5CYII="},{"path":"foreground.css","encoding":"utf8","content":":root{color-scheme:light;--paper: #faf7f2;--card: #ffffff;--ink: #24211c;--muted: #655d53;--accent: #b93800;--wash: #f3e9dc;--line: #e5d9ca;--danger: #a52525;--skeleton: #e9e6e1;--font: Verdana, Geneva, \"DejaVu Sans\", sans-serif;--edge: 16px;--radius: 12px;--tabs: 64px}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--paper: #1d1b18;--card: #282520;--ink: #f5eee4;--muted: #c4b8a9;--accent: #ff995f;--wash: #363027;--line: #52483c;--danger: #ff9d96;--skeleton: #34312d}}@media(prefers-contrast:more){:root{--line: var(--muted)}}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}html,body{background:var(--paper);color:var(--ink);font:15px/1.5 var(--font)}button,input,textarea{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}a{color:inherit;text-underline-offset:2px}a,button{overflow-wrap:anywhere}button{cursor:pointer}button:disabled{opacity:.55;cursor:default}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}svg.filled{fill:currentColor}.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.app{display:flex;flex-direction:column;height:100%}.content{flex:1;min-height:0}.screen{height:100%;overflow-y:auto;padding:8px var(--edge) 32px}.screen:before{content:\"\";float:right;width:44px;height:44px}.screen-title{font-size:1.45rem;line-height:1.25;margin:12px 0 8px;overflow-wrap:anywhere}.section-title{font-size:1rem;margin:24px 0 4px}.eyebrow{margin:12px 0 0;color:var(--muted);font-size:.8rem;letter-spacing:.06em;text-transform:uppercase}.meta{margin:2px 0 0;color:var(--muted);font-size:.85rem}.meta a{color:var(--muted)}.tabs{display:flex;flex:none;min-height:var(--tabs);background:var(--card);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;border:0;background:none;color:var(--muted);font-size:.72rem}.tab[aria-current=page]{color:var(--accent);font-weight:700}.primary,.secondary,.danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:0 18px;margin:8px 8px 0 0;border-radius:999px;font-weight:700}.primary{border:0;background:var(--accent);color:var(--card)}.secondary{border:1px solid var(--line);background:var(--card)}.danger{border:0;background:var(--danger);color:var(--card)}.secondary svg,.primary svg{width:16px;height:16px}.text-button{min-height:48px;min-width:48px;padding:0 8px;border:0;background:none;color:var(--accent);font-weight:700}.danger-text{color:var(--danger)}.icon-button{display:inline-grid;place-items:center;width:48px;height:48px;flex:none;border:0;border-radius:50%;background:none;color:var(--muted)}.more{width:100%;margin:16px 0 0}input:not([type=checkbox]),textarea{width:100%;min-height:48px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--card)}textarea{resize:vertical}.chips{display:flex;gap:8px;overflow-x:auto;margin:4px 0;padding:8px 0;scrollbar-width:none}.chip{flex:none;min-height:40px;padding:0 16px;border:1px solid var(--line);border-radius:999px;background:var(--card)}.chip[aria-pressed=true]{border-color:var(--accent);background:var(--wash);color:var(--accent);font-weight:700}.story{display:flex;align-items:flex-start;gap:4px;padding:10px 0;border-bottom:1px solid var(--line)}.story-body{flex:1;min-width:0;padding-top:4px}.story-title{margin:0;font-size:15px;font-weight:400;line-height:21px;overflow-wrap:anywhere}h1.story-title{font-size:1.25rem;line-height:1.3;font-weight:700}.story-title a{text-decoration:none}.domain{color:var(--muted);font-size:.8rem;font-weight:400}.rank{width:24px;flex:none;padding-top:16px;color:var(--muted);font-size:.8rem;text-align:right}.vote{display:inline-grid;place-items:center;width:40px;min-height:48px;flex:none;color:var(--muted)}.vote.voted{color:var(--accent)}.vote svg{width:18px;height:18px}.vote.small{width:32px;min-height:40px;margin-left:-8px}.vote.small svg{width:14px;height:14px}.comment{padding:10px 0 10px calc(var(--depth, 0) * 12px);border-bottom:1px solid var(--line)}.comment>*{border-left:2px solid transparent}.comment[style*=\"--depth: 0\"]>*{border-left:0}.comment-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.comment-head .meta{flex:1}.comment-head .text-button{min-height:40px;font-size:.8rem}.comment-links{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:4px;font-size:.8rem}.comment-links a{color:var(--muted);display:inline-flex;align-items:center;gap:3px;min-height:32px}.comment-links svg{width:12px;height:12px}.rich{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:4px}.rich a{color:var(--accent)}.rich code{font-family:ui-monospace,Menlo,monospace;font-size:.9em}.toptext{padding:12px 0;border-bottom:1px solid var(--line)}.card{margin:12px 0;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}.card h2{margin:0;font-size:1.15rem}.list{display:flex;flex-direction:column;margin:12px 0;border:1px solid var(--line);border-radius:var(--radius);background:var(--card);overflow:hidden}.list button{display:flex;align-items:center;justify-content:space-between;min-height:52px;padding:0 16px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.list button:last-child{border-bottom:0}.list svg{width:16px;height:16px;color:var(--muted)}.facts{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;margin:8px 0}.facts dt{color:var(--muted)}.facts dd{margin:0}.notice{margin:24px 0;padding:20px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}.notice h2{margin:0 0 6px;font-size:1.05rem}.notice p{margin:0;color:var(--muted)}.inline-error,.field-error{color:var(--danger);font-size:.9rem}.status{padding:10px 12px;border-radius:10px;background:var(--wash)}.confirm{margin:12px 0;padding:12px 14px;border:1px solid var(--danger);border-radius:var(--radius)}.confirm p{margin:0}.form{display:flex;flex-direction:column;gap:14px;margin-top:8px}.form label{display:flex;flex-direction:column;gap:6px;font-weight:700}.form label .meta,.form .field-error{font-weight:400}.form .primary{margin-right:0}fieldset{min-width:0}fieldset.card legend{padding:0 4px;font-weight:700}.check{display:flex;align-items:center;gap:12px;min-height:48px}.check input{width:22px;height:22px;accent-color:var(--accent)}.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}.row .grow{flex:1 1 160px}.row .primary,.row .secondary{margin:0}.actions{display:flex;flex-wrap:wrap;align-items:center;margin-top:8px}.search-field{display:block;margin:4px 0 8px}.category{padding:8px 0;border-top:1px solid var(--line)}.skeleton{padding-top:8px}.skeleton-row{padding:14px 0;border-bottom:1px solid var(--line)}.skeleton-row span{display:block;height:14px;border-radius:4px;background:var(--skeleton)}.skeleton-row span+span{width:45%;height:10px;margin-top:8px}.skeleton.text .skeleton-row{border-bottom:0;padding:8px 0}\n"},{"path":"foreground.js","encoding":"utf8","content":"\"use strict\";(()=>{var h0=Object.create;var Kf=Object.defineProperty;var p0=Object.getOwnPropertyDescriptor;var b0=Object.getOwnPropertyNames;var S0=Object.getPrototypeOf,E0=Object.prototype.hasOwnProperty;var $t=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var T0=(e,t,n,l)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let a of b0(t))!E0.call(e,a)&&a!==n&&Kf(e,a,{get:()=>t[a],enumerable:!(l=p0(t,a))||l.enumerable});return e};var U=(e,t,n)=>(n=e!=null?h0(S0(e)):{},T0(t||!e||!e.__esModule?Kf(n,\"default\",{value:e,enumerable:!0}):n,e));var Ed=$t(D=>{\"use strict\";var Ac=Symbol.for(\"react.transitional.element\"),Z0=Symbol.for(\"react.portal\"),K0=Symbol.for(\"react.fragment\"),J0=Symbol.for(\"react.strict_mode\"),I0=Symbol.for(\"react.profiler\"),F0=Symbol.for(\"react.consumer\"),$0=Symbol.for(\"react.context\"),W0=Symbol.for(\"react.forward_ref\"),P0=Symbol.for(\"react.suspense\"),ep=Symbol.for(\"react.memo\"),md=Symbol.for(\"react.lazy\"),tp=Symbol.for(\"react.activity\"),np=Symbol.for(\"react.view_transition\"),rd=Symbol.iterator;function lp(e){return e===null||typeof e!=\"object\"?null:(e=rd&&e[rd]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var gd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vd=Object.assign,yd={};function $l(e,t,n){this.props=e,this.context=t,this.refs=yd,this.updater=n||gd}$l.prototype.isReactComponent={};$l.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};$l.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function hd(){}hd.prototype=$l.prototype;function zc(e,t,n){this.props=e,this.context=t,this.refs=yd,this.updater=n||gd}var _c=zc.prototype=new hd;_c.constructor=zc;vd(_c,$l.prototype);_c.isPureReactComponent=!0;var sd=Array.isArray;function Oc(){}var se={H:null,A:null,T:null,S:null},pd=Object.prototype.hasOwnProperty;function Cc(e,t,n){var l=n.ref;return{$$typeof:Ac,type:e,key:t,ref:l!==void 0?l:null,props:n}}function ap(e,t){return Cc(e.type,t,e.props)}function Mc(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===Ac}function up(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(n){return t[n]})}var fd=/\\/+/g;function Nc(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?up(\"\"+e.key):t.toString(36)}function ip(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(Oc,Oc):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function Fl(e,t,n,l,a){var u=typeof e;(u===\"undefined\"||u===\"boolean\")&&(e=null);var i=!1;if(e===null)i=!0;else switch(u){case\"bigint\":case\"string\":case\"number\":i=!0;break;case\"object\":switch(e.$$typeof){case Ac:case Z0:i=!0;break;case md:return i=e._init,Fl(i(e._payload),t,n,l,a)}}if(i)return a=a(e),i=l===\"\"?\".\"+Nc(e,0):l,sd(a)?(n=\"\",i!=null&&(n=i.replace(fd,\"$&/\")+\"/\"),Fl(a,t,n,\"\",function(f){return f})):a!=null&&(Mc(a)&&(a=ap(a,n+(a.key==null||e&&e.key===a.key?\"\":(\"\"+a.key).replace(fd,\"$&/\")+\"/\")+i)),t.push(a)),1;i=0;var o=l===\"\"?\".\":l+\":\";if(sd(e))for(var c=0;c{\"use strict\";Td.exports=Ed()});var Dd=$t(ge=>{\"use strict\";function wc(e,t){var n=e.length;e.push(t);e:for(;0>>1,a=e[l];if(0>>1;lvi(o,n))cvi(f,o)?(e[l]=f,e[c]=n,l=c):(e[l]=o,e[i]=n,l=i);else if(cvi(f,n))e[l]=f,e[c]=n,l=c;else break e}}return t}function vi(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}ge.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(Nd=performance,ge.unstable_now=function(){return Nd.now()}):(xc=Date,Od=xc.now(),ge.unstable_now=function(){return xc.now()-Od});var Nd,xc,Od,hn=[],Gn=[],rp=1,Mt=null,Qe=3,Uc=!1,tu=!1,nu=!1,Hc=!1,_d=typeof setTimeout==\"function\"?setTimeout:null,Cd=typeof clearTimeout==\"function\"?clearTimeout:null,Ad=typeof setImmediate<\"u\"?setImmediate:null;function yi(e){for(var t=Wt(Gn);t!==null;){if(t.callback===null)hi(Gn);else if(t.startTime<=e)hi(Gn),t.sortIndex=t.expirationTime,wc(hn,t);else break;t=Wt(Gn)}}function Gc(e){if(nu=!1,yi(e),!tu)if(Wt(hn)!==null)tu=!0,Pl||(Pl=!0,Wl());else{var t=Wt(Gn);t!==null&&Lc(Gc,t.startTime-e)}}var Pl=!1,lu=-1,Md=5,xd=-1;function Rd(){return Hc?!0:!(ge.unstable_now()-xde&&Rd());){var l=Mt.callback;if(typeof l==\"function\"){Mt.callback=null,Qe=Mt.priorityLevel;var a=l(Mt.expirationTime<=e);if(e=ge.unstable_now(),typeof a==\"function\"){Mt.callback=a,yi(e),t=!0;break t}Mt===Wt(hn)&&hi(hn),yi(e)}else hi(hn);Mt=Wt(hn)}if(Mt!==null)t=!0;else{var u=Wt(Gn);u!==null&&Lc(Gc,u.startTime-e),t=!1}}break e}finally{Mt=null,Qe=n,Uc=!1}t=void 0}}finally{t?Wl():Pl=!1}}}var Wl;typeof Ad==\"function\"?Wl=function(){Ad(Rc)}:typeof MessageChannel<\"u\"?(Dc=new MessageChannel,zd=Dc.port2,Dc.port1.onmessage=Rc,Wl=function(){zd.postMessage(null)}):Wl=function(){_d(Rc,0)};var Dc,zd;function Lc(e,t){lu=_d(function(){e(ge.unstable_now())},t)}ge.unstable_IdlePriority=5;ge.unstable_ImmediatePriority=1;ge.unstable_LowPriority=4;ge.unstable_NormalPriority=3;ge.unstable_Profiling=null;ge.unstable_UserBlockingPriority=2;ge.unstable_cancelCallback=function(e){e.callback=null};ge.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=n,wc(Gn,e),Wt(hn)===null&&e===Wt(Gn)&&(nu?(Cd(lu),lu=-1):nu=!0,Lc(Gc,n-l))):(e.sortIndex=a,wc(hn,e),tu||Uc||(tu=!0,Pl||(Pl=!0,Wl()))),e};ge.unstable_shouldYield=Rd;ge.unstable_wrapCallback=function(e){var t=Qe;return function(){var n=Qe;Qe=t;try{return e.apply(this,arguments)}finally{Qe=n}}}});var Ud=$t((tE,wd)=>{\"use strict\";wd.exports=Dd()});var Ld=$t(Xe=>{\"use strict\";var sp=mt();function Gd(e){var t=\"https://react.dev/errors/\"+e;if(1{\"use strict\";function Bd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bd)}catch(e){console.error(e)}}Bd(),qd.exports=Ld()});var zh=$t(ec=>{\"use strict\";var Ce=Ud(),Ag=mt(),gp=Vd();function E(e){var t=\"https://react.dev/errors/\"+e;if(1ca||(e.current=Nr[ca],Nr[ca]=null,ca--)}function me(e,t){ca++,Nr[ca]=e.current,e.current=t}var rn=dn(null),Mu=dn(null),Fn=dn(null),uo=dn(null);function io(e,t){switch(me(Fn,t),me(Mu,e),me(rn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ag(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ag(t),e=th(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}Ve(rn),me(rn,e)}function Ca(){Ve(rn),Ve(Mu),Ve(Fn)}function Or(e){var t=e.memoizedState;t!==null&&(Ba._currentValue=t.memoizedState,me(uo,e)),t=rn.current;var n=th(t,e.type);t!==n&&(me(Mu,e),me(rn,n))}function oo(e){Mu.current===e&&(Ve(rn),Ve(Mu)),uo.current===e&&(Ve(uo),Ba._currentValue=Ol)}var Bc,Xd;function qn(e){if(Bc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);Bc=t&&t[1]||\"\",Xd=-1)\":-1a||c[l]!==f[a]){var g=`\n`+c[l].replace(\" at new \",\" at \");return e.displayName&&g.includes(\"\")&&(g=g.replace(\"\",e.displayName)),g}while(1<=l&&0<=a);break}}}finally{qc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?qn(n):\"\"}function Np(e,t){switch(e.tag){case 26:case 27:case 5:return qn(e.type);case 16:return qn(\"Lazy\");case 13:return e.child!==t&&t!==null?qn(\"Suspense Fallback\"):qn(\"Suspense\");case 19:return qn(\"SuspenseList\");case 0:case 15:return Vc(e.type,!1);case 11:return Vc(e.type.render,!1);case 1:return Vc(e.type,!0);case 31:return qn(\"Activity\");case 30:return qn(\"ViewTransition\");default:return\"\"}}function Zd(e){try{var t=\"\",n=null;do t+=Np(e,n),n=e,e=e.return;while(e);return t}catch(l){return`\nError generating stack: `+l.message+`\n`+l.stack}}var Ar=Object.prototype.hasOwnProperty,Cs=Ce.unstable_scheduleCallback,Yc=Ce.unstable_cancelCallback,Op=Ce.unstable_shouldYield,Ap=Ce.unstable_requestPaint,bt=Ce.unstable_now,zp=Ce.unstable_getCurrentPriorityLevel,Ug=Ce.unstable_ImmediatePriority,Hg=Ce.unstable_UserBlockingPriority,co=Ce.unstable_NormalPriority,_p=Ce.unstable_LowPriority,Gg=Ce.unstable_IdlePriority,Cp=Ce.log,Mp=Ce.unstable_setDisableYieldValue,Zu=null,St=null;function Qn(e){if(typeof Cp==\"function\"&&Mp(e),St&&typeof St.setStrictMode==\"function\")try{St.setStrictMode(Zu,e)}catch{}}var Et=Math.clz32?Math.clz32:Dp,xp=Math.log,Rp=Math.LN2;function Dp(e){return e>>>=0,e===0?32:31-(xp(e)/Rp|0)|0}var Si=256,Ei=262144,Ti=4194304;function bl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ho(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,u=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~u,l!==0?a=bl(l):(i&=o,i!==0?a=bl(i):n||(n=o&~e,n!==0&&(a=bl(n))))):(o=l&~u,o!==0?a=bl(o):i!==0?a=bl(i):n||(n=l&~e,n!==0&&(a=bl(n)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:a}function Ku(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Lg(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Ju(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Up(e,t,n,l,a,u){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,f=e.hiddenUpdates;for(n=i&~n;0\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),Mr=!1;if(On)try{ea={},Object.defineProperty(ea,\"passive\",{get:function(){Mr=!0}}),window.addEventListener(\"test\",ea,ea),window.removeEventListener(\"test\",ea,ea)}catch{Mr=!1}var ea,Xn=null,ws=null,ki=null;function Pg(){if(ki)return ki;var e,t=ws,n=t.length,l,a=\"value\"in Xn?Xn.value:Xn.textContent,u=a.length;for(e=0;e=yu),um=\" \",im=!1;function tv(e,t){switch(e){case\"keyup\":return y1.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function nv(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var sa=!1;function p1(e,t){switch(e){case\"compositionend\":return nv(t);case\"keypress\":return t.which!==32?null:(im=!0,um);case\"textInput\":return e=t.data,e===um&&im?null:e;default:return null}}function b1(e,t){if(sa)return e===\"compositionend\"||!Hs&&tv(e,t)?(e=Pg(),ki=ws=Xn=null,sa=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function sm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fm(e,t){var n=sm(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sm(n)}}function iv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?iv(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ov(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=xr(e.document)}return t}function Gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var _1=On&&\"documentMode\"in document&&11>=document.documentMode,fa=null,Rr=null,pu=null,Dr=!1;function dm(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||fa==null||fa!==xr(l)||(l=fa,\"selectionStart\"in l&&Gs(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),pu&&Du(pu,l)||(pu=l,l=Do(Rr,\"onSelect\"),0>=i,a-=i,on=1<<32-Et(t)+a|n<_?(Y=A,A=null):Y=A.sibling;var M=r(v,A,h[_],S);if(M===null){A===null&&(A=Y);break}e&&A&&M.alternate===null&&t(v,A),d=u(M,d,_),C===null?O=M:C.sibling=M,C=M,A=Y}if(_===h.length)return n(v,A),H&&Sn(v,_),O;if(A===null){for(;__?(Y=A,A=null):Y=A.sibling;var F=r(v,A,M.value,S);if(F===null){A===null&&(A=Y);break}e&&A&&F.alternate===null&&t(v,A),d=u(F,d,_),C===null?O=F:C.sibling=F,C=F,A=Y}if(M.done)return n(v,A),H&&Sn(v,_),O;if(A===null){for(;!M.done;_++,M=h.next())M=m(v,M.value,S),M!==null&&(d=u(M,d,_),C===null?O=M:C.sibling=M,C=M);return H&&Sn(v,_),O}for(A=l(A);!M.done;_++,M=h.next())M=s(A,v,_,M.value,S),M!==null&&(e&&(Y=M.alternate,Y!==null&&A.delete(Y.key===null?_:Y.key)),d=u(M,d,_),C===null?O=M:C.sibling=M,C=M);return e&&A.forEach(function(Fe){return t(v,Fe)}),H&&Sn(v,_),O}function T(v,d,h,S){if(typeof h==\"object\"&&h!==null&&h.type===oa&&h.key===null&&h.props.ref===void 0&&(h=h.props.children),typeof h==\"object\"&&h!==null){switch(h.$$typeof){case bi:e:{for(var O=h.key;d!==null;){if(d.key===O){if(O=h.type,O===oa){if(d.tag===7){n(v,d.sibling),S=a(d,h.props.children),Bn(S,h),S.return=v,v=S;break e}}else if(d.elementType===O||typeof O==\"object\"&&O!==null&&O.$$typeof===Yn&&Sl(O)===d.type){n(v,d.sibling),S=a(d,h.props),Bn(S,h),S.return=v,v=S;break e}n(v,d);break}else t(v,d);d=d.sibling}h.type===oa?(S=Al(h.props.children,v.mode,S,h.key),Bn(S,h),S.return=v,v=S):(S=Qi(h.type,h.key,h.props,null,v.mode,S),Bn(S,h),S.return=v,v=S)}return i(v);case fu:e:{for(O=h.key;d!==null;){if(d.key===O)if(d.tag===4&&d.stateNode.containerInfo===h.containerInfo&&d.stateNode.implementation===h.implementation){n(v,d.sibling),S=a(d,h.children||[]),S.return=v,v=S;break e}else{n(v,d);break}else t(v,d);d=d.sibling}S=$c(h,v.mode,S),S.return=v,v=S}return i(v);case Yn:return h=Sl(h),T(v,d,h,S)}if(du(h))return p(v,d,h,S);if(uu(h)){if(O=uu(h),typeof O!=\"function\")throw Error(E(150));return h=O.call(h),b(v,d,h,S)}if(typeof h.then==\"function\")return T(v,d,Ci(h),S);if(h.$$typeof===an)return T(v,d,_i(v,h),S);Mi(v,h)}return typeof h==\"string\"&&h!==\"\"||typeof h==\"number\"||typeof h==\"bigint\"?(h=\"\"+h,d!==null&&d.tag===6?(n(v,d.sibling),S=a(d,h),S.return=v,v=S):(n(v,d),S=Fc(h,v.mode,S),S.return=v,v=S),i(v)):n(v,d)}return function(v,d,h,S){try{Hu=0;var O=T(v,d,h,S);return Ta=null,O}catch(A){if(A===ja||A===jo)throw A;var C=ct(29,A,null,v.mode);return C.lanes=S,C.return=v,C}}}var wl=Tv(!0),Nv=Tv(!1),kn=!1;function Qs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Br(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(X&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=fo(e),gv(e,null,n),t}return Yo(e,l,t,n),fo(e)}function Su(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Vg(e,n)}}function Pc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?a=u=i:u=u.next=i,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qr=!1;function Eu(){if(qr){var e=Ea;if(e!==null)throw e}}function Tu(e,t,n,l){qr=!1;var a=e.updateQueue;kn=!1;var u=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,f=c.next;c.next=null,i===null?u=f:i.next=f,i=c;var g=e.alternate;g!==null&&(g=g.updateQueue,o=g.lastBaseUpdate,o!==i&&(o===null?g.firstBaseUpdate=f:o.next=f,g.lastBaseUpdate=c))}if(u!==null){var m=a.baseState;i=0,g=f=c=null,o=u;do{var r=o.lane&-536870913,s=r!==o.lane;if(s?(B&r)===r:(l&r)===r){r!==0&&r===Dl&&(qr=!0),g!==null&&(g=g.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var p=e,b=o;r=t;var T=n;switch(b.tag){case 1:if(p=b.payload,typeof p==\"function\"){m=p.call(T,m,r);break e}m=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=b.payload,r=typeof p==\"function\"?p.call(T,m,r):p,r==null)break e;m=ue({},m,r);break e;case 2:kn=!0}}r=o.callback,r!==null&&(e.flags|=64,s&&(e.flags|=8192),s=a.callbacks,s===null?a.callbacks=[r]:s.push(r))}else s={lane:r,tag:o.tag,payload:o.payload,callback:o.callback,next:null},g===null?(f=g=s,c=m):g=g.next=s,i|=r;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;s=o,o=s.next,s.next=null,a.lastBaseUpdate=s,a.shared.pending=null}}while(!0);g===null&&(c=m),a.baseState=c,a.firstBaseUpdate=f,a.lastBaseUpdate=g,u===null&&(a.shared.lanes=0),sl|=i,e.lanes=i,e.memoizedState=m}}function Ov(e,t){if(typeof e!=\"function\")throw Error(E(191,e));e.call(t)}function Av(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eu?u:8;var i=R.T,o={};o.types=i!==null?i.types:null,R.T=o,af(e,!1,t,n);try{var c=a(),f=R.S;if(f!==null&&f(o,c),c!==null&&typeof c==\"object\"&&typeof c.then==\"function\"){var g=B1(c,l);Nu(e,t,g,Tt(e))}else Nu(e,t,l,Tt(e))}catch(m){Nu(e,t,{then:function(){},status:\"rejected\",reason:m},Tt())}finally{Z.p=u,i!==null&&o.types!==null&&(i.types=o.types),R.T=i}}function Q1(){}function Qr(e,t,n,l){if(e.tag!==5)throw Error(E(476));var a=Fv(e).queue;Iv(e,a,t,Ol,n===null?Q1:function(){return $v(e),n(l)})}function Fv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ol,baseState:Ol,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_n,lastRenderedState:Ol},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_n,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $v(e){var t=Fv(e);t.next===null&&(t=e.alternate.memoizedState),Nu(e,t.next.queue,{},Tt())}function lf(){return qe(Ba)}function Wv(){return Ee().memoizedState}function Pv(){return Ee().memoizedState}function X1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=Wn(n);var l=Pn(t,e,n);l!==null&&(rt(l,t,n),Su(l,t,n)),t={cache:Ys()},e.payload=t;return}t=t.return}}function Z1(e,t,n){var l=Tt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ko(e)?ty(t,n):(n=Bs(e,t,n,l),n!==null&&(rt(n,e,l),ny(n,t,l)))}function ey(e,t,n){var l=Tt();Nu(e,t,n,l)}function Nu(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ko(e))ty(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,o=u(i,n);if(a.hasEagerState=!0,a.eagerState=o,Nt(o,i))return Yo(e,t,a,0),ae===null&&Vo(),!1}catch{}if(n=Bs(e,t,a,l),n!==null)return rt(n,e,l),ny(n,t,l),!0}return!1}function af(e,t,n,l){if(l={lane:2,revertLane:yf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ko(e)){if(t)throw Error(E(479))}else t=Bs(e,n,l,2),t!==null&&rt(t,e,2)}function Ko(e){var t=e.alternate;return e===w||t!==null&&t===w}function ty(e,t){Na=bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ny(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Vg(e,n)}}var Eo={readContext:qe,use:Xo,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useLayoutEffect:he,useInsertionEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useSyncExternalStore:he,useId:he,useHostTransitionStatus:he,useFormState:he,useActionState:he,useOptimistic:he,useMemoCache:he,useCacheRefresh:he,useEffectEvent:he},ly={readContext:qe,use:Xo,useCallback:function(e,t){return nt().memoizedState=[e,t===void 0?null:t],e},useContext:qe,useEffect:Cm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ji(4194308,4,Qv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ji(4194308,4,e,t)},useInsertionEffect:function(e,t){Ji(4,2,e,t)},useMemo:function(e,t){var n=nt();t=t===void 0?null:t;var l=e();if(Ul){Qn(!0);try{e()}finally{Qn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=nt();if(n!==void 0){var a=n(t);if(Ul){Qn(!0);try{n(t)}finally{Qn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Z1.bind(null,w,e),[l.memoizedState,e]},useRef:function(e){var t=nt();return e={current:e},t.memoizedState=e},useState:function(e){e=kr(e);var t=e.queue,n=ey.bind(null,w,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:tf,useDeferredValue:function(e,t){var n=nt();return nf(n,e,t)},useTransition:function(){var e=kr(!1);return e=Iv.bind(null,w,e.queue,!0,!1),nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=w,a=nt();if(H){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),ae===null)throw Error(E(349));(B&127)!==0||xv(l,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,Cm(Dv.bind(null,l,u,e),[e]),l.flags|=2048,Ra(9,{destroy:void 0},Rv.bind(null,l,u,n,t),null),n},useId:function(){var e=nt(),t=ae.identifierPrefix;if(H){var n=cn,l=on;n=(l&~(1<<32-Et(l)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=So++,0<\\/script>\",u=u.removeChild(u.firstChild);break;case\"select\":u=typeof l.is==\"string\"?i.createElement(\"select\",{is:l.is}):i.createElement(\"select\"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is==\"string\"?i.createElement(a,{is:l.is}):i.createElement(a)}}u[Be]=t,u[ft]=l;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=u;e:switch(ke(u,a,l),a){case\"button\":case\"input\":case\"select\":case\"textarea\":l=!!l.autoFocus;break e;case\"img\":l=!0;break e;default:l=!1}l&&bn(t)}}return fe(t),t.subtreeFlags&=-33554433,lr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&bn(t);else{if(typeof l!=\"string\"&&t.stateNode===null)throw Error(E(166));if(e=Fn.current,ta(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=De,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Be]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||eh(e.nodeValue,n)),e||ol(t,!0)}else e=Vu(e).createTextNode(l),e[Be]=t,t.stateNode=e}return fe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=ta(t),n!==null){if(e===null){if(!l)throw Error(E(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(557));e[Be]=t}else Ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;fe(t),e=!1}else n=Wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(E(558))}return fe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ta(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(E(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(E(317));a[Be]=t}else Ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;fe(t),a=!1}else a=Wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Di(t,t.updateQueue),fe(t),null);case 4:return Ca(),e===null&&hf(t.stateNode.containerInfo),t.flags|=67108864,fe(t),null;case 10:return Nn(t.type),fe(t),null;case 19:if(Zs(t),l=t.memoizedState,l===null)return fe(t),null;if(a=(t.flags&128)!==0,u=l.rendering,u===null)if(a)ou(l,!1);else{if(pe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=po(e),u!==null){for(t.flags|=128,ou(l,!1),e=u.updateQueue,t.updateQueue=e,Di(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vv(n,e),n=n.sibling;return Gu(t,Ye.current&1|2),H&&Sn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&bt()>Co&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304)}else{if(!a)if(e=po(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Di(t,e),ou(l,!0),l.tail===null&&l.tailMode!==\"collapsed\"&&l.tailMode!==\"visible\"&&!u.alternate&&!H)return fe(t),null}else 2*bt()-l.renderingStartTime>Co&&n!==536870912&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=bt(),e.sibling=null,u=Ye.current,u=a?u&1|2:u&1,l.tailMode===\"visible\"||l.tailMode===\"collapsed\"||!n||H?Gu(t,u):(n=u,me(je,t),me(Ye,n),Ze===null&&(Ze=t)),H&&Sn(t,l.treeForkCount),e}return fe(t),null;case 22:case 23:return yt(t),Xs(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(fe(t),t.subtreeFlags&6&&(t.flags|=8192)):fe(t),n=t.updateQueue,n!==null&&Di(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Ve(zl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Nn(Oe),fe(t),null;case 25:return null;case 30:return t.flags|=33554432,fe(t),null}throw Error(E(156,t.tag))}function P1(e,t){switch(Vs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nn(Oe),Ca(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return oo(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(E(340));Ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));Ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zs(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ca(),null;case 10:return Nn(t.type),null;case 22:case 23:return yt(t),Xs(),e!==null&&Ve(zl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Nn(Oe),null;case 25:return null;default:return null}}function gy(e,t){switch(Vs(t),t.tag){case 3:Nn(Oe),Ca();break;case 26:case 27:case 5:oo(t);break;case 4:Ca();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:Zs(t);break;case 10:Nn(t.type);break;case 22:case 23:yt(t),Xs(),e!==null&&Ve(zl);break;case 24:Nn(Oe)}}function Pu(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var u=n.create,i=n.inst;l=u(),i.destroy=l}n=n.next}while(n!==a)}}catch(o){P(t,t.return,o)}}function rl(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var u=a.next;l=u;do{if((l.tag&e)===e){var i=l.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,a=t;var c=n,f=o;try{f()}catch(g){P(a,c,g)}}}l=l.next}while(l!==u)}}catch(g){P(t,t.return,g)}}function vy(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Av(t,n)}catch(l){P(e,e.return,l)}}}function yy(e,t,n){n.props=Hl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){P(e,t,l)}}function nn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var a=e.stateNode,u=An(e.memoizedProps,a);(a.ref===null||a.ref.name!==u)&&(a.ref=ih(u)),l=a.ref;break;case 7:if(e.stateNode===null){var i=new Ot(e);st(e.child,!1,Yb,i,void 0,void 0),e.stateNode=i}l=e.stateNode;break;default:l=e.stateNode}typeof n==\"function\"?e.refCleanup=n(l):n.current=l}}catch(o){P(e,t,o)}}function Le(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l==\"function\")try{l()}catch(a){P(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(a){P(e,t,a)}else n.current=null}function No(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title\"))),ke(l,t,n),l[Be]=e,Re(l),t=l;break e;case\"link\":if(u=yg(\"link\",\"href\",a).get(t+(n.href||\"\"))){for(i=0;iT&&(i=T,T=b,b=i);var v=fm(o,b),d=fm(o,T);if(v&&d&&(s.rangeCount!==1||s.anchorNode!==v.node||s.anchorOffset!==v.offset||s.focusNode!==d.node||s.focusOffset!==d.offset)){var h=m.createRange();h.setStart(v.node,v.offset),s.removeAllRanges(),b>T?(s.addRange(h),s.extend(d.node,d.offset)):(h.setEnd(d.node,d.offset),s.addRange(h))}}}}for(m=[],s=o;s=s.parentNode;)s.nodeType===1&&m.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof o.focus==\"function\"&&o.focus(),o=0;on?32:n,R.T=null,n=rs,rs=null;var u=Xt,i=sn;if(ye=0,Gl=Xt=null,sn=0,(X&6)!==0)throw Error(E(331));var o=X;if(X|=4,Hy(u.current),Dy(u,u.current,i,n),X=o,ei(0,!1),St&&typeof St.onPostCommitFiberRoot==\"function\")try{St.onPostCommitFiberRoot(Zu,u)}catch{}return!0}finally{Z.p=a,R.T=l,Ky(e,t)}}function Fm(e,t,n){t=Ht(n,t),t=Zr(e.stateNode,t,2),e=Pn(e,t,2),e!==null&&(Ju(e,2),mn(e))}function P(e,t,n){if(e.tag===3)Fm(e,e,n);else for(;t!==null;){if(t.tag===3){Fm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof l.componentDidCatch==\"function\"&&(nl===null||!nl.has(l))){e=Ht(n,e),n=cy(2),l=Pn(t,n,2),l!==null&&(ry(n,l,t,e),Ju(l,2),mn(l));break}}t=t.return}}function cr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new lb;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(gf=!0,a.add(n),e=fb.bind(null,e,t,n),t.then(e,e))}function fb(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ae===e&&(B&n)===n&&((pe===4||pe===3&&(B&62914560)===B&&300>bt()-Io)&&(X&2)===0?Ua(e,0):_o|=n,Da===B&&(Da=0)),mn(e)}function Jy(e,t){t===0&&(t=Bg()),e=Vl(e,t),e!==null&&(Ju(e,t),mn(e))}function db(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jy(e,n)}function mb(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(E(314))}l!==null&&l.delete(t),Jy(e,n)}function gb(e,t){return Cs(e,t)}var Ha=null,ua=null,gs=!1,Ro=!1,rr=!1,In=0;function mn(e){e!==ua&&e.next===null&&(ua===null?Ha=ua=e:ua=ua.next=e),Ro=!0,gs||(gs=!0,yb())}function ei(e,t){if(!rr&&Ro){rr=!0;do for(var n=!1,l=Ha;l!==null;){if(!t)if(e!==0){var a=l.pendingLanes;if(a===0)var u=0;else{var i=l.suspendedLanes,o=l.pingedLanes;u=(1<<31-Et(42|e)+1)-1,u&=a&~(i&~o),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,$m(l,u))}else u=B,u=Ho(l,l===ae?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Ku(l,u)||(n=!0,$m(l,u));l=l.next}while(n);rr=!1}}function vb(){Iy()}function Iy(){Ro=gs=!1;var e=0;In!==0&&Ab()&&(e=In);for(var t=bt(),n=null,l=Ha;l!==null;){var a=l.next,u=Fy(l,t);u===0?(l.next=null,n===null?Ha=a:n.next=a,a===null&&(ua=n)):(n=l,(e!==0||(u&3)!==0)&&(Ro=!0)),l=a}ye!==0&&ye!==5||ei(e,!1),In!==0&&(In=0)}function Fy(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0o)break;var g=c.transferSize,m=c.initiatorType;g&&lg(m)&&(c=c.responseEnd,i+=g*(cno){b.length=p;break}h=new Promise(Rb.bind(h)),b.push(h)}}}if(0\"u\"?null:document;function gh(e,t,n){var l=Za;if(l&&typeof t==\"string\"&&t){var a=Ut(t);a='link[rel=\"'+e+'\"][href=\"'+a+'\"]',typeof n==\"string\"&&(a+='[crossorigin=\"'+n+'\"]'),mg.has(a)||(mg.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement(\"link\"),ke(t,\"link\",e),Re(t),l.head.appendChild(t)))}}function Fb(e){Dn.D(e),gh(\"dns-prefetch\",e,null)}function $b(e,t){Dn.C(e,t),gh(\"preconnect\",e,t)}function Wb(e,t,n){Dn.L(e,t,n);var l=Za;if(l&&e&&t){var a='link[rel=\"preload\"][as=\"'+Ut(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(a+='[imagesrcset=\"'+Ut(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(a+='[imagesizes=\"'+Ut(n.imageSizes)+'\"]')):a+='[href=\"'+Ut(e)+'\"]';var u=a;switch(t){case\"style\":u=La(e);break;case\"script\":u=Ka(e)}if(!(Bt.has(u)||(e=ue({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),Bt.set(u,e),l.querySelector(a)!==null||t===\"style\"&&l.querySelector(ti(u))||t===\"script\"&&l.querySelector(ni(u))))){var i=l.createElement(\"link\");ke(i,\"link\",e),t===\"style\"&&(i[ro]=!0,i.onload=i.onerror=function(){jg(i)}),Re(i),l.head.appendChild(i)}}}function Pb(e,t){Dn.m(e,t);var n=Za;if(n&&e){var l=t&&typeof t.as==\"string\"?t.as:\"script\",a='link[rel=\"modulepreload\"][as=\"'+Ut(l)+'\"][href=\"'+Ut(e)+'\"]',u=a;switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":u=Ka(e)}if(!Bt.has(u)&&(e=ue({rel:\"modulepreload\",href:e},t),Bt.set(u,e),n.querySelector(a)===null)){switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(ni(u)))return}l=n.createElement(\"link\"),ke(l,\"link\",e),Re(l),n.head.appendChild(l)}}}function eS(e,t,n){Dn.S(e,t,n);var l=Za;if(l&&e){var a=pa(l).hoistableStyles,u=La(e);t=t||\"default\";var i=a.get(u);if(!i){var o={loading:0,preload:null};if(i=l.querySelector(ti(u)))o.loading=5;else{e=ue({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=Bt.get(u))&&Ef(e,n);var c=i=l.createElement(\"link\");Re(c),ke(c,\"link\",e),c._p=new Promise(function(f,g){c.onload=f,c.onerror=g}),c.addEventListener(\"load\",function(){o.loading|=1}),c.addEventListener(\"error\",function(){o.loading|=2}),o.loading|=4,eo(i,t,l)}i={type:\"stylesheet\",instance:i,count:1,state:o},a.set(u,i)}}}function tS(e,t){Dn.X(e,t);var n=Za;if(n&&e){var l=pa(n).hoistableScripts,a=Ka(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ue({src:e,async:!0},t),(t=Bt.get(a))&&Tf(e,t),u=n.createElement(\"script\"),Re(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function nS(e,t){Dn.M(e,t);var n=Za;if(n&&e){var l=pa(n).hoistableScripts,a=Ka(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ue({src:e,async:!0,type:\"module\"},t),(t=Bt.get(a))&&Tf(e,t),u=n.createElement(\"script\"),Re(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function gg(e,t,n,l){var a=(a=Fn.current)?Yu(a):null;if(!a)throw Error(E(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(n=La(n.href),t=pa(a).hoistableStyles,l=t.get(n),l||(l={type:\"style\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=La(n.href);var u=pa(a).hoistableStyles,i=u.get(e);if(i||(a=a.ownerDocument||a,i={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,i),(u=a.querySelector(ti(e)))?u._p||(i.instance=u,i.state.loading=5):(u=Bt.get(e),u||(u={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Bt.set(e,u)),lS(a,e,u,i.state))),t&&l===null)throw Error(E(528,\"\"));return i}if(t&&l!==null)throw Error(E(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(n=Ka(n),t=pa(a).hoistableScripts,l=t.get(n),l||(l={type:\"script\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};default:throw Error(E(444,e))}}function La(e){return'href=\"'+Ut(e)+'\"'}function ti(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function vh(e){return ue({},e,{\"data-precedence\":e.precedence,precedence:null})}function lS(e,t,n,l){if(t=e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")){if(t[ro]!==!0){l.loading=1;return}}else t=e.createElement(\"link\"),t[ro]=!0,t.onload=t.onerror=jg.bind(null,t),ke(t,\"link\",n),Re(t),e.head.appendChild(t);l.preload=t,t.addEventListener(\"load\",function(){return l.loading|=1}),t.addEventListener(\"error\",function(){return l.loading|=2})}function Ka(e){return'[src=\"'+Ut(e)+'\"]'}function ni(e){return\"script[async]\"+e}function vg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var l=e.querySelector('style[data-href~=\"'+Ut(n.href)+'\"]');if(l)return t.instance=l,Re(l),l;var a=ue({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement(\"style\"),Re(l),ke(l,\"style\",a),eo(l,n.precedence,e),t.instance=l;case\"stylesheet\":a=La(n.href);var u=e.querySelector(ti(a));if(u)return t.state.loading|=4,t.instance=u,Re(u),u;l=vh(n),(a=Bt.get(a))&&Ef(l,a),u=(e.ownerDocument||e).createElement(\"link\"),Re(u);var i=u;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),t.state.loading|=4,eo(u,n.precedence,e),t.instance=u;case\"script\":return u=Ka(n.src),(a=e.querySelector(ni(u)))?(t.instance=a,Re(a),a):(l=n,(a=Bt.get(u))&&(l=ue({},n),Tf(l,a)),e=e.ownerDocument||e,a=e.createElement(\"script\"),Re(a),ke(a,\"link\",l),e.head.appendChild(a),t.instance=a);case\"void\":return null;default:throw Error(E(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,eo(l,n.precedence,e));return t.instance}function eo(e,t,n){for(var l=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,u=a,i=0;i title\"):null)}function aS(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function hg(e,t){return e===\"img\"&&t.src!=null&&t.src!==\"\"&&t.onLoad==null&&t.loading!==\"lazy\"}function yh(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function hh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==\"number\"?devicePixelRatio:1)*.25}function pg(e,t){typeof t.decode==\"function\"&&(e.imgCount++,t.complete||(e.imgBytes+=hh(t),e.suspenseyImages.push(t)),e=oS.bind(e),t.decode().then(e,e))}function uS(e,t,n,l){if(n.type===\"stylesheet\"&&(typeof l.media!=\"string\"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=La(l.href),u=t.querySelector(ti(a));if(u){t=u._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=ku.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,Re(u);return}u=t.ownerDocument||t,l=vh(l),(a=Bt.get(a))&&Ef(l,a),u=u.createElement(\"link\"),Re(u);var i=u;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ku.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var no=0;function iS(e,t){return e.stylesheets&&e.count===0&&lo(e,e.stylesheets),0no?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function ph(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lo(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ku(){this.count--,ph(this)}function oS(){this.imgCount--,ph(this)}var wo=null;function lo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wo=new Map,t.forEach(cS,e),wo=null,ku.call(e))}function cS(e,t){if(!(t.state.loading&4)){var n=wo.get(e);if(n)var l=n.get(null);else{n=new Map,wo.set(e,n);for(var a=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),u=0;u{\"use strict\";function _h(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_h)}catch(e){console.error(e)}}_h(),Ch.exports=zh()});var Rh=$t(tc=>{\"use strict\";var yS=Symbol.for(\"react.transitional.element\"),hS=Symbol.for(\"react.fragment\");function xh(e,t,n){var l=null;if(n!==void 0&&(l=\"\"+n),t.key!==void 0&&(l=\"\"+t.key),\"key\"in t){n={};for(var a in t)a!==\"key\"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:yS,type:e,key:l,ref:t!==void 0?t:null,props:n}}tc.Fragment=hS;tc.jsx=xh;tc.jsxs=xh});var J=$t((oE,Dh)=>{\"use strict\";Dh.exports=Rh()});var yn={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1},N0=[\"RETIRED\",\"CONFLICT\",\"NOT_FOUND\",\"DOCUMENT_TOO_LARGE\",\"STORAGE_FAILURE\",\"ORIGIN_NOT_DECLARED\",\"MESSAGE_TOO_LARGE\",\"PAGE_TOO_LARGE\",\"PATCH_TOO_LARGE\",\"DEADLINE\",\"INVALID_STEPS\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"CONFIGURATION_REQUIRED\",\"NOT_READY\",\"UNKNOWN_METHOD\",\"INVALID_ARGUMENT\",\"QUOTA_EXCEEDED\",\"PROTOCOL_MISMATCH\",\"APPLET_INCOMPATIBLE\",\"ENVELOPE_INVALID\",\"CONTEXT_REPLACED\",\"TARGET_NOT_FOUND\",\"PRECONDITION_FAILED\",\"ASYNC_READ\",\"AUTH_REQUIRED\",\"REJECTED\"];function Pf(e){return typeof e==\"string\"&&N0.includes(e)}var O0=/^:[A-Za-z][A-Za-z0-9_]*$/,A0=/^[A-Za-z0-9_.~@-]+$/,yc=new Map;function z0(e){if(yc.has(e))return yc.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),l=n.at(-1)===\"*\";l&&n.pop();let a=[],u=!0;for(let i of n)O0.test(i)?a.push({param:i.slice(1)}):A0.test(i)&&i!==\".\"&&i!==\"..\"?a.push({literal:i}):u=!1;u&&(t={segments:a,rest:l})}return yc.set(e,t),t}function Te(e){try{return new URL(e).href}catch{return null}}function yl(e,t){let n=_0(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let l;try{l=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}l.at(-1)===\"\"&&l.pop();for(let a of e.routes){let u=z0(a.pattern);if(!u)continue;let i=C0(u,l);if(!i||!(a.query??[]).every(c=>n.searchParams.has(c)))continue;for(let c of a.query??[])i[c]=n.searchParams.get(c);let o={kind:\"route\",routeId:a.id,page:a.page,screen:a.screen,params:i};return a.context!==void 0&&(o.context=a.context),o}return{kind:\"website\",url:t}}function _0(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function C0(e,t){if(e.rest?t.lengthb.id===u.id)?.startUrl;f={index:o.index,start:p!==void 0&&Te(p)===Te(t.view.url),url:s}}}else t.status===\"ready\"&&t.account!==null&&c===\"auth\"&&(c=\"none\",f=null);o.page.status===\"ready\"&&(t.status===\"loading\"||t.status===\"error\")&&(g++,m=!1,l.push({type:\"schedule\",id:u.id,token:g}));let r={...o,seen:Math.max(o.seen,t.view.n),pin:c,signIn:f,deadline:g,page:{status:t.status,pageId:t.pageId,routeId:t.routeId,view:t.view,stale:t.stale,expired:m}};return{state:vl($f(e,u,r),r),effects:l}}case\"deadline\":{let u=e.contexts[t.id];return!u||t.token!==u.deadline||u.page.status===\"ready\"||u.page.expired?a:{state:vl(e,{...u,page:{...u.page,expired:!0}}),effects:l}}case\"user.viewWebsite\":{let u=e.contexts[t.id];return!u||u.pin===\"user\"?a:{state:vl(e,{...u,pin:\"user\"}),effects:l}}case\"user.done\":{let u=e.contexts[t.id];if(!u)return a;if(u.pin===\"auth\"&&u.signIn)return Jf(e,u,n)??a;let i=u.pin===\"none\"?u:{...u,pin:\"none\"},o=i===u?e:vl(e,i);if(di(i,n)!==\"website\")return{state:o,effects:l};if(i.canGoBack)l.push({type:\"context.back\",id:u.id});else{let c=n.contexts.find(f=>f.id===u.id)?.startUrl;c&&l.push({type:\"context.navigate\",id:u.id,url:c,mode:\"push\"})}return{state:o,effects:l}}case\"navigate.url\":{let u=t.context??e.active;return e.contexts[u]?(l.push({type:\"context.navigate\",id:u,url:t.url,mode:t.mode}),{state:{...e,active:u,overlay:[],leaveGuard:null},effects:l}):a}case\"navigate.screen\":{let u=t.mode===\"root\"?[t.screen]:t.mode===\"replace\"?[...e.overlay.slice(0,-1),t.screen]:[...e.overlay,t.screen];return{state:{...e,overlay:u,leaveGuard:null},effects:l}}case\"select\":{let u=e.contexts[t.id];if(!u)return a;if(t.id!==e.active||e.overlay.length>0)return{state:{...e,active:t.id,overlay:[],leaveGuard:null},effects:l};let i=n.contexts.find(o=>o.id===t.id)?.startUrl;return i&&(u.url===null||Te(u.url)!==Te(i))&&l.push({type:\"context.navigate\",id:t.id,url:i,mode:\"push\"}),{state:{...e,leaveGuard:null},effects:l}}case\"back\":{if(e.leaveGuard)return{state:e,effects:[{type:\"confirmLeave\",message:e.leaveGuard.message}]};if(e.overlay.length>0)return{state:{...e,overlay:e.overlay.slice(0,-1)},effects:l};let u=e.contexts[e.active];return u?.pin===\"auth\"&&u.signIn?Jf(e,u,n)??{state:e,effects:[{type:\"leave\"}]}:e.contexts[e.active]?.canGoBack?{state:e,effects:[{type:\"context.back\",id:e.active}]}:{state:e,effects:[{type:\"leave\"}]}}case\"guard\":return{state:{...e,leaveGuard:t.guard},effects:l};case\"context.gone\":{let u=e.contexts[t.id];return u?{state:vl(e,{...u,page:{...pc,status:\"unsupported\"}}),effects:l}:a}}}function Jf(e,t,n){let{index:l,start:a}=t.signIn,u=n.contexts[0].id,i=vl(e,{...t,pin:\"none\",signIn:null});if(!a&&l>0){let o=Math.max(1,t.index-l+1);return{state:i,effects:[{type:\"context.back\",id:t.id,steps:o}]}}return t.id===u?null:{state:{...i,active:u,overlay:[],leaveGuard:null},effects:[]}}function If(e,t,n){return t===e.generation&&e.url!==null&&Te(n)===Te(e.url)}function Ff(e,t,n,l){let a=e.deadline+1;return l.push({type:\"schedule\",id:e.id,token:a}),{...e,url:n,seen:t===e.generation?e.seen:-1,generation:t,page:pc,deadline:a}}function $f(e,t,n){return!e.leaveGuard||t.id!==e.active||e.overlay.length>0||t.index===n.index&&t.url!==null&&n.url!==null&&Te(t.url)===Te(n.url)?e:{...e,leaveGuard:null}}function vl(e,t){return{...e,contexts:{...e.contexts,[t.id]:t}}}function bc(e){let t={};for(let[n,l]of Object.entries(e.contexts))t[n]={url:l.url};return{version:yn.sessionState,state:{active:e.active,overlay:e.overlay,contexts:t}}}function nd(e,t){let n=M0(t);if(!e||e.version!==yn.sessionState||!eu(e.state))return n;let{active:l,overlay:a,contexts:u}=e.state,i={...n,contexts:{...n.contexts}};if(typeof l==\"string\"&&i.contexts[l]&&(i.active=l),Array.isArray(a)&&(i.overlay=a.filter(o=>R0(o,t.foreground.screens))),eu(u))for(let o of Object.keys(i.contexts)){let c=eu(u[o])?u[o].url:void 0;typeof c==\"string\"&&(i.contexts[o]=ed(o,c))}return i}function R0(e,t){return eu(e)&&typeof e.key==\"string\"&&typeof e.id==\"string\"&&t.includes(e.id)&&eu(e.params)&&Object.values(e.params).every(n=>typeof n==\"string\")}function eu(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var XS=yn.bundleFormat,hc=\"(0|[1-9]\\\\d*)\",Wf=\"(?:0|[1-9]\\\\d*|\\\\d*[A-Za-z-][0-9A-Za-z-]*)\",ZS=new RegExp(`^${hc}\\\\.${hc}\\\\.${hc}(?:-(${Wf}(?:\\\\.${Wf})*))?$`),te=class extends Error{code;constructor(e,t){super(t),this.name=\"GenesisError\",this.code=e}},D0=2e3;function Sc(e,t){return new Promise((n,l)=>{let a=null,u=!1,i=1,o=new Map,c=new Map,f={get bound(){return a},get retired(){return u},request(s,p={}){if(u)return Promise.reject(new te(\"RETIRED\",\"This page was closed\"));let b=i++;return new Promise((T,v)=>{let d=setTimeout(()=>{o.delete(b),v(new te(\"DEADLINE\",`${s} did not answer in time`))},a.limits.rpcDeadlineMs+D0);o.set(b,{resolve:T,reject:v,timer:d}),e.postMessage(JSON.stringify({type:\"request\",documentId:a.documentId,requestId:b,method:s,params:p}))})},on(s,p){let b=c.get(s);return b||c.set(s,b=new Set),b.add(p),()=>{b.delete(p)}}};function g(){u=!0;for(let s of o.values())clearTimeout(s.timer),s.reject(new te(\"RETIRED\",\"This page was closed\"));o.clear()}function m(s,p){for(let b of[...c.get(s)??[]])try{b(p)}catch(T){console.error(`Genesis ${s} handler failed`,T)}}e.addEventListener(\"message\",s=>{if(u||typeof s.data!=\"string\")return;let p;try{p=JSON.parse(s.data)}catch{return}if(p?.type===\"refused\"&&!a){u=!0,l(new te(p.error?.code??\"PROTOCOL_MISMATCH\",p.error?.message??\"The host refused this page\"));return}if(p?.type===\"bound\"){if(a)return;a=p,n(f);return}if(!(!a||p?.documentId!==a.documentId))if(p.type===\"response\"){let b=o.get(p.requestId);if(!b)return;o.delete(p.requestId),clearTimeout(b.timer),p.error?b.reject(new te(p.error.code,p.error.message)):b.resolve(p.result??null)}else p.type===\"event\"&&(p.name===\"retired\"?(g(),m(\"retired\",{})):m(p.name,p.data))}),addEventListener(\"pagehide\",()=>{u||(m(\"pagehide\",{}),g())});let r={type:\"hello\",protocol:yn.protocol,url:t};e.postMessage(JSON.stringify(r))})}var w0={pageId:null,routeId:null,params:{}};function ad(e,t){let n={};for(let m of e)n[m]=U0();let l={account:null,contexts:n},a=!1,u=new Map;function i(m){let r=m===null?[...u.values()]:[u.get(null),...m.map(p=>u.get(p))],s=new Set;for(let p of r)for(let b of[...p??[]])s.has(b)||(s.add(b),b())}function o(m,r){l={...l,contexts:{...l.contexts,[m]:r}}}function c(m){let{entry:r}=m;if(!m.attached||m.status!==\"ready\"||!r||!Il(r.url,m.url))return;let{history:s}=m;for(s.delete(r.index),s.set(r.index,ud(m));s.size>t.historyEntriesMax;)s.delete(s.keys().next().value)}function f(m,r,s){if(r===void 0||s!==\"ready\"&&s!==\"auth\")return!1;if(!a)return a=!0,l.account!==r&&(l={...l,account:r}),!1;if(r===l.account)return!1;let p={};for(let[b,T]of Object.entries(l.contexts))T.history.clear(),p[b]=b===m||!T.content||T.stale?T:{...T,stale:!0};return l={account:r,contexts:p},c(p[m]),!0}let g=(m,r=!1)=>({outcome:m,accountChanged:r});return{state:()=>l,context:m=>l.contexts[m],applyPage(m,r,s){let p=l.contexts[m];if(!p||r=r.size||d===r.index&&!Il(h.url,r.url))&&b.delete(d)}let T={...p,generation:r.generation,entry:{index:r.index,url:r.url}},v;if(Il(p.url,r.url))p.attached&&p.view?.generation!==r.generation?v={...T,attached:!1,status:\"loading\",error:null,stale:p.content}:v=T;else{let d=b.get(r.index);v=d?{...T,...d,attached:!1,status:\"loading\",error:null,stale:!0,content:!0}:{...T,...s,url:r.url,regions:{},attached:!1,status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1}}o(m,v),c(v),i([m])},gone(m,r){let s=l.contexts[m];s&&(o(m,{...s,attached:!1,status:\"error\",error:r,stale:s.content}),i([m]))},subscribe(m,r){let s=r??null,p=u.get(s);return p||u.set(s,p=new Set),p.add(m),()=>{p.delete(m)}}}}function U0(){return{generation:0,view:null,epoch:0,seq:0,live:[],attached:!1,url:null,pageId:null,routeId:null,params:{},regions:{},status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1,entry:null,history:new Map}}function Il(e,t){return e!==null&&t!==null&&Te(e)===Te(t)}function ud(e){return{url:e.url,pageId:e.pageId,routeId:e.routeId,params:e.params,regions:e.regions}}function H0(e,t){if(e.content&&Il(e.url,t))return ud(e);let{entry:n}=e,l=n&&Il(n.url,t)?e.history.get(n.index):void 0;return l&&Il(l.url,t)?l:null}function id(e,t=Object.create(null)){for(let n of e)t[n.key]=n;return t}function od(e){return e.kind===\"single\"?{kind:\"single\",status:e.status,error:e.error??null,record:e.record}:{kind:\"collection\",status:e.status,error:e.error??null,order:e.items.map(t=>t.key),complete:e.complete,ephemeral:e.ephemeral===!0,records:id(e.items)}}function G0(e,t){let n={};for(let[l,a]of Object.entries(e)){let u=od(a),i=t[l];n[l]=i?L0(i,u):u}return n}var mi=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function L0(e,t){if(e.kind===\"single\"||t.kind===\"single\")return e.kind!==\"single\"||t.kind!==\"single\"?t:(mi(e.record,t.record)&&(t.record=e.record),e.record===t.record&&e.status===t.status&&mi(e.error,t.error)?e:t);let n=e.order.length===t.order.length&&e.complete===t.complete&&e.ephemeral===t.ephemeral&&e.status===t.status&&mi(e.error,t.error);for(let[l,a]of t.order.entries()){let u=e.records[a];u&&mi(u,t.records[a])?t.records[a]=u:n=!1,e.order[l]!==a&&(n=!1)}return n?e:t}function B0(e,t){let n=e.regions;for(let[l,a]of Object.entries(t)){let u=e.live.includes(l)?n[l]:void 0;if(!u)return null;let i;if(a.kind===\"replace\")i=od(a.region);else if(a.kind===\"single\"){if(u.kind!==\"single\")return null;i={...u,record:a.record,status:a.status??u.status,error:a.error===void 0?u.error:a.error}}else{if(u.kind!==\"collection\")return null;if(i={...u,complete:a.complete??u.complete,status:a.status??u.status,error:a.error===void 0?u.error:a.error},a.upsert?.length||a.remove?.length){i.records=id(a.upsert??[],Object.assign(Object.create(null),u.records));for(let o of a.remove??[])delete i.records[o]}if(a.order){i.order=a.order;let o=new Set(a.order);for(let c of Object.keys(i.records))o.has(c)||(i.records===u.records&&(i.records=Object.assign(Object.create(null),u.records)),delete i.records[c])}else if(a.remove?.length){let o=new Set(a.remove);i.order=u.order.filter(c=>!o.has(c))}}n===e.regions&&(n={...n}),n[l]=i}return n}var cd=class extends te{constructor(e,t){super(e,t),this.name=\"ServiceError\"}},q0=[\"CONFIGURATION_REQUIRED\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"SERVICE_UNREACHABLE\",\"DEADLINE\",\"SERVICE_FAILURE\",\"QUOTA_EXCEEDED\"];function Ec(e){let t=e?.code;return t&&q0.includes(t)?\"This feature is temporarily unavailable. Try again in a moment.\":e instanceof Error?e.message:\"Something went wrong. Please try again.\"}async function Tc(e=window.__genesisBridge){if(!e)throw new Error(\"Genesis bridge is missing; the foreground must run inside Genesis\");let t=await Sc(e,location.href),{compat:n}=t.bound;if(n.protocol!==yn.protocol||n.sessionState!==yn.sessionState)throw new te(\"PROTOCOL_MISMATCH\",\"This applet was built for another Genesis version\");return X0(t)}var V0=500,Y0=1e3,k0=64,j0=2e3,Q0=Object.freeze([]),ld=e=>e===void 0?null:Array.isArray(e)?e:[e];function X0(e){let{manifest:t,appletId:n,limits:l,session:a}=e.bound,u=t.contexts.map(y=>y.id),i=ad(u,{historyEntriesMax:l.historyEntriesMax}),o=(y,N)=>e.request(y,N).catch(z=>{e.retired||console.error(`Genesis ${y} failed`,z)}),c=nd(a,t),f=new Set,g=null,m=new Set;function r(y){let N=td(c,y,t),z=N.state!==c;c=N.state;let x=N.effects.filter(k=>!s(k));if(z){O=void 0,h();for(let k of[...f])k()}return x}function s(y){switch(y.type){case\"reveal\":return o(\"context.reveal\",{id:y.id}),!0;case\"cover\":return o(\"context.cover\"),!0;case\"context.navigate\":return fi(y.id),o(\"context.navigate\",{id:y.id,url:y.url,mode:y.mode}),!0;case\"context.back\":return fi(y.id),o(\"context.back\",y.steps?{id:y.id,steps:y.steps}:{id:y.id}),!0;case\"context.reload\":return fi(y.id),o(\"context.reload\",{id:y.id}),!0;case\"schedule\":return setTimeout(()=>r({type:\"deadline\",id:y.id,token:y.token}),l.documentReadyMs),!0;case\"leave\":case\"confirmLeave\":return!1}}function p(y,N){g?g(y,N):window.confirm(y)&&N()}function b(y){let N=c.leaveGuard;if(!N)return y();p(N.message,()=>{r({type:\"guard\",guard:null}),y()})}function T(y){let N=!0;for(let z of r({type:\"back\"}))if(z.type===\"leave\")N=!1;else if(z.type===\"confirmLeave\"){let x=()=>{r({type:\"guard\",guard:null}),!T(!1)&&y&&o(\"back.leave\")};setTimeout(()=>p(z.message,x),0)}return N}let v=null,d=a?JSON.stringify(bc(c)):\"\";function h(){v===null&&(v=setTimeout(S,V0))}function S(){v!==null&&clearTimeout(v),v=null;let y=bc(c),N=JSON.stringify(y);N!==d&&(d=N,o(\"session.save\",y))}e.on(\"suspended\",S);let O;function C(){if(O!==void 0)return O;let y=c.overlay[c.overlay.length-1],N=c.contexts[c.active],z=null;if(y)z={key:y.key,id:y.id,params:y.params,context:c.active,overlay:!0};else if(N?.url){let x=yl(t,N.url);x.kind===\"route\"&&(z={key:`${N.id}:${N.index}`,id:x.screen,params:x.params,context:N.id,overlay:!1})}return O=z}let A=1,_=new Set(c.overlay.map(y=>y.key));function Y(){let y;do y=`s${A++}`;while(_.has(y));return _.add(y),y}function M(y){if(\"screen\"in y){let Ft={key:Y(),id:y.screen,params:y.params??{}};b(()=>r({type:\"navigate.screen\",screen:Ft,mode:y.mode??\"push\"}));return}let z=c.contexts[c.active]?.url??t.contexts[0].startUrl,x;try{x=new URL(y.url,z).href}catch{throw new te(\"INVALID_ARGUMENT\",`Not a URL: ${y.url}`)}let k=y.context??F(x);if(!c.contexts[k])throw new te(\"NOT_FOUND\",`No context ${k}`);let We=c.contexts[k].url;if(We!==null&&Te(We)===Te(x)&&(y.mode??\"push\")===\"push\"){(k!==c.active||c.overlay.length>0)&&b(()=>r({type:\"select\",id:k}));return}b(()=>r({type:\"navigate.url\",url:x,context:k,mode:y.mode??\"push\"}))}function F(y){let N=yl(t,y);if(N.kind!==\"route\"||!N.context||!c.contexts[N.context])return c.active;let z=c.contexts[c.active],x=t.contexts.find(We=>We.id===c.active)?.startUrl,k=!z.url||x!==void 0&&Te(z.url)===Te(x);return c.overlay.length>0||k?N.context:c.active}function Fe(y){b(()=>{let N=y===c.active&&c.overlay.length===0,z=N&&c.contexts[y]?.url!==null&&Te(c.contexts[y].url)!==Te(t.contexts.find(x=>x.id===y)?.startUrl??\"\");if(r({type:\"select\",id:y}),N&&!z)for(let x of[...m])x(y)})}let Ct=new Set;function Zl(y){Ct.has(y)||(Ct.add(y),setTimeout(()=>Ct.delete(y),Y0),e.request(\"context.resync\",{id:y}).catch(()=>{}))}function re(y){let N=yl(t,y);return N.kind===\"route\"?{pageId:N.page,routeId:N.routeId,params:N.params}:{pageId:null,routeId:null,params:{}}}e.on(\"page\",({id:y,generation:N,page:z})=>{let x=i.applyPage(y,N,z);if(x.outcome!==\"applied\")return;Ct.delete(y);let k=i.context(y);f0(y,z),r({type:\"context.page\",id:y,generation:N,view:z.view,status:z.status,pageId:z.pageId,routeId:z.routeId,account:z.account,stale:k.stale&&k.content,signInUrl:z.signInUrl??null}),Se(y,x)}),e.on(\"patch\",({id:y,generation:N,patch:z})=>{let x=i.applyPatch(y,N,z);x.outcome===\"resync\"&&Zl(y),Se(y,x)});function Se(y,N){if(!N.accountChanged)return;let z=Jl(c,t);for(let x of u)x!==y&&(x===z?Zl(x):at(x));for(let x of[...$e.values()])x.context!==y&&It(x,{outcome:\"unknown\",code:\"CONTEXT_REPLACED\",message:\"The account changed\"})}function at(y){fi(y),o(\"context.reload\",{id:y})}e.on(\"context.navigated\",y=>{i.navigated(y.id,y,re(y.url)),r({type:\"context.navigated\",...y})}),e.on(\"context.gone\",y=>{i.gone(y.id,{code:y.code??\"NOT_READY\",message:y.message??\"The page cannot be read\"}),r({type:\"context.gone\",id:y.id})}),e.on(\"user.viewWebsite\",y=>{r({type:\"user.viewWebsite\",id:y?.id??c.active})}),e.on(\"user.done\",y=>{r({type:\"user.done\",id:y?.id??c.active}),Yf()}),e.on(\"back\",()=>{let y=T(!0);o(\"back.handled\",{handled:y})});let $e=new Map,Wa=new Map,Pa=new Map,rc=0,sc=new Set,fc=new Map,Lf=(y,N,z)=>JSON.stringify([y,N,z]);function Bf(){let y=new Map;for(let z of $e.values()){let x=Lf(z.context,z.region,z.key),k=y.get(x);k||y.set(x,k=[]),k.push({name:z.name,args:z.args})}let N=new Map;for(let[z,x]of y){let k=fc.get(z);N.set(z,k&&k.length===x.length&&k.every((We,Ft)=>We.name===x[Ft].name&&We.args===x[Ft].args)?k:x)}fc=N;for(let z of[...sc])z()}function It(y,N){$e.get(y.dedup)===y&&($e.delete(y.dedup),y.actionId!==null&&Wa.delete(y.actionId),y.timer!==null&&clearTimeout(y.timer),y.resolve(N),Bf())}function qf(y,N){y.timer!==null&&clearTimeout(y.timer),y.timer=setTimeout(()=>It(y,{outcome:\"unknown\",code:\"DEADLINE\",message:\"The action did not finish in time\"}),N)}function Vf(y,N){if(N.state===\"dispatched\"){if(!N.navigating)return;y.from=i.context(y.context)?.view??null,y.expect=N.expect??null,qf(y,l.actionTimeoutMs);return}let z=N.state===\"observed\"?\"observed\":N.state===\"cancelled\"?\"cancelled\":\"failed\";It(y,N.result??{outcome:z})}e.on(\"action.update\",y=>{let N=Wa.get(y.actionId);if(N)return Vf(N,y);if(rc===0)return;let z=Pa.get(y.actionId)??[];z.push(y),Pa.set(y.actionId,z)});function f0(y,N){for(let z of[...$e.values()]){if(z.context!==y||z.from===null)continue;let{from:x}=z;if(N.view.generation===x.generation&&N.view.n===x.n||N.status===\"loading\")continue;let k=yl(t,N.view.url),We=k.kind===\"route\"?k.page:null,Ft=ld(z.expect?.page);N.status===\"auth\"?It(z,{outcome:\"failed\",code:\"AUTH_REQUIRED\",message:\"Sign-in is needed\"}):We!==null&&ld(z.expect?.notPage)?.includes(We)?It(z,{outcome:\"failed\",code:\"REJECTED\",message:\"The website did not accept the action\"}):N.status===\"ready\"&&We!==null&&(Ft===null||Ft.includes(We))?It(z,{outcome:\"observed\"}):It(z,{outcome:\"unknown\",message:\"The action led to another page\"})}}function fi(y){for(let N of[...$e.values()])N.context===y&&N.from!==null&&It(N,{outcome:\"unknown\",message:\"The page changed before the action finished\"})}function d0(y){let N=i.context(y.context);if(!N?.view)return Promise.resolve({outcome:\"failed\",code:\"NOT_READY\",message:\"The page is not ready\"});let z=y.region===null?void 0:N.regions[y.region],x=z?.kind===\"collection\"?z.records[y.key??\"\"]:z?.record??void 0,k=JSON.stringify([y.context,x?.entityType??y.region,x?.entity??y.key,y.name,y.args??null]),We=$e.get(k);if(We)return We.promise;let Ft,Qf=new Promise(Vt=>{Ft=Vt}),gl={...y,dedup:k,actionId:null,promise:Qf,resolve:Ft,timer:null,from:null,expect:null};$e.set(k,gl),qf(gl,l.actionTimeoutMs+j0),Bf();let{view:Xf}=N,v0={region:y.region,key:y.key,name:y.name,args:y.args??null,view:Xf.n},Zf=()=>{--rc===0&&Pa.clear()};return rc++,e.request(\"context.act\",{id:y.context,generation:Xf.generation,action:v0}).then(({actionId:Vt})=>{let vc=Pa.get(Vt)??[];if(Pa.delete(Vt),Zf(),$e.get(k)===gl){gl.actionId=Vt,Wa.set(Vt,gl);for(let y0 of vc)Vf(gl,y0)}},Vt=>{Zf();let vc=Pf(Vt?.code)?Vt.code:void 0;It(gl,{outcome:\"failed\",code:vc,message:Vt instanceof Error?Vt.message:\"The action failed\"})}),Qf}let dc=new Set;e.on(\"storage.changed\",y=>{for(let N of[...dc])N(y)});let m0={get:(y,N)=>e.request(\"storage.get\",{collection:y,key:N}),list:(y,N={})=>e.request(\"storage.list\",{collection:y,...N}),commit:y=>e.request(\"storage.commit\",{checks:y.checks??[],puts:y.puts??[],deletes:y.deletes??[]}),onChanged(y){return dc.add(y),()=>{dc.delete(y)}}},g0={async request(y,N,z={}){try{return await e.request(\"services.request\",{serviceId:y,path:N,method:z.method??\"GET\",body:z.body??null})}catch(x){throw x instanceof te?new cd(x.code,x.message):x}}},mc=new Set;function Yf(){for(let y of[...mc])y()}e.on(\"resumed\",Yf);let gc=new Set;e.on(\"retired\",()=>{for(let y of[...$e.values()])It(y,{outcome:\"unknown\",code:\"RETIRED\",message:\"This page was closed\"});for(let y of[...gc])y()});let Kl=new Map;for(let y of u)e.request(\"context.resync\",{id:y}).catch(()=>{}),s({type:\"schedule\",id:y,token:c.contexts[y].deadline});let kf=Jl(c,t);kf!==null&&o(\"context.reveal\",{id:kf});let jf=!1;return{manifest:t,appletId:n,limits:l,restored:a!==null,store:i,navigation:{state:()=>c,screen:C,presentation:y=>di(c.contexts[y],t),revealed:()=>Jl(c,t),navigate:M,select:Fe,back:()=>{T(!1)},reload:y=>{at(y??c.active)},viewWebsite:y=>{r({type:\"user.viewWebsite\",id:y??c.active})},done:y=>{r({type:\"user.done\",id:y??c.active})},setLeaveGuard:y=>{r({type:\"guard\",guard:y===null?null:{message:y}})},onConfirmLeave(y){return g=y,()=>{g===y&&(g=null)}},onScrollToTop(y){return m.add(y),()=>{m.delete(y)}},subscribe(y){return f.add(y),()=>{f.delete(y)}}},actions:{act:d0,pending:(y,N,z)=>fc.get(Lf(y,N,z))??Q0,subscribe(y){return sc.add(y),()=>{sc.delete(y)}}},storage:m0,services:g0,scroll:{get:y=>Kl.get(y),set(y,N){for(Kl.delete(y),Kl.set(y,N);Kl.size>k0;)Kl.delete(Kl.keys().next().value)}},onResume(y){return mc.add(y),()=>{mc.delete(y)}},onRetired(y){return gc.add(y),()=>{gc.delete(y)}},ready(){jf||(jf=!0,o(\"ui.ready\"))}}}var Q=U(mt(),1),Uh=U(Mh(),1),li=U(J(),1),Hh=(0,Q.createContext)(null);function pS({foreground:e,children:t}){return(0,li.jsx)(Hh.Provider,{value:e,children:t})}function Kt(){let e=(0,Q.useContext)(Hh);if(!e)throw new Error(\"Genesis hooks need mountForeground or GenesisProvider\");return e}function bS({foreground:e,children:t}){return(0,Q.useLayoutEffect)(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e.ready()))},[e]),t}async function Gh(e,t){let n=t??document.getElementById(\"root\")??document.body.appendChild(document.createElement(\"div\")),l=await Tc(),a=(0,Uh.createRoot)(n);return l.onRetired(()=>a.unmount()),a.render((0,li.jsx)(pS,{foreground:l,children:(0,li.jsx)(bS,{foreground:l,children:e})})),l}function _f(){let e=Kt();return(0,Q.useSyncExternalStore)(e.navigation.subscribe,e.navigation.state)}function nc(e){let t=_f();return e??t.active}function Lh(e,t){let{store:n}=Kt(),l=(0,Q.useCallback)(a=>n.subscribe(a,e),[n,e]);return(0,Q.useSyncExternalStore)(l,()=>t(n.context(e)))}var SS=(e,t)=>e.pageId===t.pageId&&e.status===t.status&&e.stale===t.stale&&e.generation===t.generation&&e.params===t.params&&e.error===t.error&&e.account===t.account&&e.url===t.url;function ES(e,t){return{pageId:e?.pageId??null,status:e?.status??\"loading\",stale:e?e.stale&&e.content:!1,generation:e?.view?.generation??null,params:e?.params??TS,error:e?.error??null,account:t,url:e?.url??null}}function qt(e){let{store:t}=Kt(),n=nc(e),l=(0,Q.useRef)(null),a=(0,Q.useCallback)(i=>t.subscribe(i),[t]),u=(0,Q.useCallback)(()=>{let i=ES(t.context(n),t.state().account);return(!l.current||!SS(l.current,i))&&(l.current=i),l.current},[t,n]);return(0,Q.useSyncExternalStore)(a,u)}var TS=Object.freeze({}),wh=new WeakMap,NS=Object.freeze({order:Object.freeze([]),get:()=>{},complete:!1,status:\"missing\",error:null,ephemeral:!1});function OS(e){if(!e)return NS;let t=wh.get(e);if(t)return t;if(e.kind===\"collection\"){let{records:n}=e;t={order:e.order.filter(l=>n[l]!==void 0),get:l=>n[l],complete:e.complete,status:e.status,error:e.error,ephemeral:e.ephemeral}}else{let{record:n}=e;t={order:n?[n.key]:[],get:l=>n&&n.key===l?n:void 0,complete:!0,status:e.status,error:e.error,ephemeral:!1}}return wh.set(e,t),t}function ai(e,t){return Lh(nc(t),n=>OS(n?.regions[e]))}function At(e,t,n){return Lh(nc(n),l=>AS(l?.regions[e],t))}function AS(e,t){if(e)return e.kind===\"single\"?t===null||e.record?.key===t?e.record??void 0:void 0:t===null?void 0:e.records[t]}function wn(e,t,n){let l=Kt();return(0,Q.useCallback)((a,u)=>l.actions.act({context:n??l.navigation.state().active,region:t??null,key:a,name:e,args:u}),[l,e,t,n])}function Ja(e,t,n){let l=Kt(),a=nc(n);return(0,Q.useSyncExternalStore)(l.actions.subscribe,()=>l.actions.pending(a,e,t))}function Ke(){let e=Kt(),t=_f(),{navigation:n}=e;return(0,Q.useMemo)(()=>({presentation:n.presentation(t.active),active:t.active,contexts:t.contexts,overlay:t.overlay,screen:n.screen(),revealed:n.revealed(),navigate:n.navigate,back:n.back,select:n.select,reload:n.reload,viewWebsite:n.viewWebsite,done:n.done,setLeaveGuard:n.setLeaveGuard}),[n,t])}function Bh(e,t={}){let n=Kt(),l=t.storage??n.storage,[a,u]=(0,Q.useState)({records:[],loading:!0,error:null});(0,Q.useEffect)(()=>{let m=!0,r=0;async function s(){let b=++r;try{let T=[],v;do{let d=await l.list(e,v===void 0?{}:{afterKey:v});T.push(...d.entries),v=d.nextAfterKey??void 0}while(v!==void 0);m&&b===r&&u({records:T,loading:!1,error:null})}catch(T){m&&b===r&&u(v=>({...v,loading:!1,error:T}))}}s();let p=l.onChanged(b=>{b.changes.some(T=>T.collection===e)&&s()});return()=>{m=!1,p()}},[l,e]);let i=(0,Q.useRef)(a.records);i.current=a.records;let o=(0,Q.useCallback)(m=>i.current.find(r=>r.key===m)?.revision??null,[]),c=(0,Q.useCallback)(m=>l.commit(m),[l]),f=(0,Q.useCallback)((m,r,s)=>l.commit({checks:[{collection:e,key:m,expectedRevision:s===void 0?o(m):s}],puts:[{collection:e,key:m,value:r}]}),[l,e,o]),g=(0,Q.useCallback)(m=>l.commit({checks:[{collection:e,key:m,expectedRevision:o(m)}],deletes:[{collection:e,key:m}]}),[l,e,o]);return{...a,put:f,remove:g,commit:c}}var zS=1500;function _S(){let e=Kt();_f();let t=e.navigation.screen(),n=t?.key??`${e.navigation.state().active}:none`,l=t&&!t.overlay?t.context:null;return(0,Q.useCallback)(a=>{if(!a)return;let u=e.scroll.get(n)??0,i=u>0,o=performance.now(),c=0,f=()=>{i&&(a.scrollTop=u,Math.abs(a.scrollTop-u)<2||performance.now()-o>zS?i=!1:c=requestAnimationFrame(f))},g=()=>{i=!1},m=()=>{i||e.scroll.set(n,a.scrollTop)},r=e.navigation.onScrollToTop(s=>{s===l&&(i=!1,a.scrollTo({top:0,behavior:\"smooth\"}))});return f(),a.addEventListener(\"scroll\",m,{passive:!0}),a.addEventListener(\"touchstart\",g,{passive:!0}),a.addEventListener(\"wheel\",g,{passive:!0}),()=>{cancelAnimationFrame(c),r(),a.removeEventListener(\"scroll\",m),a.removeEventListener(\"touchstart\",g),a.removeEventListener(\"wheel\",g)}},[e,n,l])}function we(e){return(0,li.jsx)(\"div\",{...e,ref:_S()})}function qh(e){let t=Kt(),n=(0,Q.useRef)(e);n.current=e,(0,Q.useEffect)(()=>t.onResume(()=>n.current()),[t])}var Vh=U(mt(),1);var ie=\"https://news.ycombinator.com\";var ui=e=>typeof e==\"string\"&&e.length<=20&&/^[1-9][0-9]*$/.test(e);var kl=e=>`${ie}/item?id=${e}`,gn=e=>`${ie}/user?id=${encodeURIComponent(e)}`;function lc(e,t=ie){try{let n=new URL(e,t);return(n.protocol===\"https:\"||n.protocol===\"http:\")&&!n.username&&!n.password&&n.href.length<=2048?n.href:null}catch{return null}}var be=U(J(),1),CS={home:\"M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z\",search:\"M21 21l-5.2-5.2M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0\",post:\"M12 5v14M5 12h14\",bookmark:\"M6 3h12v18l-6-4-6 4z\",person:\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0\",up:\"M12 6l7 10H5z\",chevron:\"M9 6l6 6-6 6\",external:\"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6\"};function Ia({name:e,filled:t=!1}){return(0,be.jsx)(\"svg\",{viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",className:t?\"filled\":void 0,children:(0,be.jsx)(\"path\",{d:CS[e]})})}function Je(){let{navigate:e}=Ke();return(0,Vh.useCallback)(t=>{try{e({url:t})}catch(n){console.error(\"Genesis could not open\",t,n)}},[e])}function ml({parts:e,onLink:t}){let n=Je(),l=t??n;return(0,be.jsx)(\"div\",{className:\"rich\",children:e.map((a,u)=>{let i=a.text;if(a.code&&(i=(0,be.jsx)(\"code\",{children:i})),a.em&&(i=(0,be.jsx)(\"em\",{children:i})),a.strong&&(i=(0,be.jsx)(\"strong\",{children:i})),a.href){let o=a.href;i=(0,be.jsx)(\"a\",{href:o,onClick:c=>{c.preventDefault(),l(o)},children:i})}return(0,be.jsx)(\"span\",{children:i},u)})})}function Ue({label:e,rows:t=8,kind:n=\"list\"}){return(0,be.jsx)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:`skeleton ${n}`,children:Array.from({length:t},(l,a)=>(0,be.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[(0,be.jsx)(\"span\",{}),(0,be.jsx)(\"span\",{})]},a))})}function Ie({title:e,children:t,role:n}){return(0,be.jsxs)(\"section\",{className:\"notice\",role:n,children:[(0,be.jsx)(\"h2\",{children:e}),t]})}function zt({error:e}){let{viewWebsite:t}=Ke(),n=e?.code===\"NOT_READY\"||e?.code===\"DEADLINE\"?\"Hacker News did not answer in time.\":e?.message||\"This page could not be read.\";return(0,be.jsxs)(Ie,{title:\"Couldn't load this page\",role:\"alert\",children:[(0,be.jsx)(\"p\",{children:n}),(0,be.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t(),children:[\"Open on Hacker News \",(0,be.jsx)(Ia,{name:\"external\"})]})]})}var Yh=e=>`${ie}/login?goto=${encodeURIComponent(e)}`;function ii({parts:e}){let t=e.filter(Boolean);return(0,be.jsx)(\"p\",{className:\"meta\",children:t.map((n,l)=>(0,be.jsxs)(\"span\",{children:[l>0&&\" \\xB7 \",n]},l))})}var Fa=U(mt(),1);var Ql=U(mt(),1);var yE=new TextEncoder;var MS=new Set([\"CONFLICT\",\"INVALID_ARGUMENT\",\"NOT_FOUND\",\"QUOTA_EXCEEDED\",\"STORAGE_FAILURE\"]),kh=new WeakMap;function xS(e){let t=kh.get(e);if(t)return t;let n=new Set,l=i=>queueMicrotask(()=>{for(let o of n)try{o(i)}catch(c){console.error(\"Library change listener failed\",c)}});async function a(i,o){let c=await e.services.request(\"bookmarks\",\"/v1/documents\",{method:\"POST\",body:{operation:i,params:o}}),f=c.body?.error;if(c.status<200||c.status>=300||f){let m=f&&MS.has(f.code)?f.code:\"SERVICE_FAILURE\";throw new te(m,f?.message??\"The bookmarks service refused the request. Reload before retrying.\")}let g=c.body?.result;if(!g||typeof g!=\"object\")throw new te(\"SERVICE_FAILURE\",\"The bookmarks service sent an invalid answer.\");return i===\"commit\"&&l({changes:c.body.changes??[],namespaceRevision:g.namespaceRevision}),g}let u={get:(i,o)=>a(\"get\",{collection:i,key:o}),list:(i,o={})=>a(\"list\",{collection:i,limit:100,...o}),commit:i=>a(\"commit\",{checks:[],puts:[],deletes:[],...i}),onChanged(i){return n.add(i),()=>{n.delete(i)}},refresh:()=>l({changes:[\"bookmarks\",\"categories\",\"category-meta\"].map(i=>({collection:i,key:\"\"})),namespaceRevision:0})};return e.onRetired(()=>n.clear()),kh.set(e,u),u}var xf=e=>new TextEncoder().encode(e).length,uc=e=>typeof e==\"number\"&&Number.isSafeInteger(e)&&e>=0,Uf=e=>typeof e==\"string\"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e),Cf=e=>`hn:item:${e}`,Xh=(e,t)=>`${String(Number.MAX_SAFE_INTEGER-e).padStart(16,\"0\")}:${t}`,jl=()=>new te(\"STORAGE_FAILURE\",\"Category data has an unsupported format. Its data has been preserved.\"),oi=()=>new te(\"CONFLICT\",\"Categories changed. Review them before retrying.\"),jh=()=>new te(\"CONFLICT\",\"A category with this name already exists.\");function ac(e){let t=e;if(!t||t.schemaVersion!==1||!ui(t.itemId)||t.discussionUrl!==kl(t.itemId)||typeof t.title!=\"string\"||!t.title.trim()||xf(t.title)>2048||!(t.submitter===null||typeof t.submitter==\"string\"&&xf(t.submitter)<=256)||!(t.articleUrl===null||typeof t.articleUrl==\"string\"&&lc(t.articleUrl)===t.articleUrl)||typeof t.truncated!=\"boolean\"||!uc(t.savedAtMs)||!uc(t.capturedAtMs)||!Array.isArray(t.categoryIds)||t.categoryIds.length>50||!t.categoryIds.every(Uf)||new Set(t.categoryIds).size!==t.categoryIds.length||t.orderKey!==Xh(t.savedAtMs,t.itemId))throw new te(\"STORAGE_FAILURE\",\"This saved story has an unsupported format. Its data has been preserved.\");return t}function Rf(e){let t=e.trim(),n=t.normalize(\"NFKC\").trim().replace(/\\s+/gu,\" \").toLowerCase();if(!t||[...t].length>40||!n||xf(n)>512)throw new te(\"INVALID_ARGUMENT\",\"Use a category name of 1 to 40 characters.\");if([\"all\",\"uncategorized\"].includes(n))throw new te(\"INVALID_ARGUMENT\",\"All and Uncategorized are reserved filter names.\");return{name:t,normalizedName:n}}function Mf(e){let t=e;try{if(!t||t.schemaVersion!==1||!Uf(t.id)||typeof t.name!=\"string\"||!uc(t.createdAtMs)||!(t.deletedAtMs===null||uc(t.deletedAtMs)&&t.deletedAtMs>=t.createdAtMs))throw jl();let n=Rf(t.name);if(t.name!==n.name||t.normalizedName!==n.normalizedName)throw jl();return t}catch{throw jl()}}function RS(e){let t=e;if(!t||!Array.isArray(t.ids)||t.ids.length>50||!t.ids.every(Uf)||new Set(t.ids).size!==t.ids.length)throw jl();return{ids:t.ids}}function Qh(e,t){if(!e||e.value?.categoryId!==t)throw jl()}function Zh(e,t){if(t.length>50||new Set(t).size!==t.length)throw new te(\"INVALID_ARGUMENT\",\"Invalid category selection\");let n=[{collection:\"category-meta\",key:\"active\",expectedRevision:e.meta?.revision??null}];for(let l of t){let a=e.categories.find(u=>u.value.id===l);if(!a)throw oi();n.push({collection:\"categories\",key:l,expectedRevision:a.revision})}return n}var Xl=(e,t)=>e.filter(n=>t.categories.some(l=>l.value.id===n)),Kh=e=>({itemId:e.id,discussionUrl:kl(e.id),articleUrl:e.articleUrl,title:e.title,submitter:e.submitter,truncated:!1,capturedAtMs:Date.now()}),Df=class{constructor(t){this.storage=t}storage;async get(t){if(!ui(t))throw new te(\"INVALID_ARGUMENT\",\"Invalid story ID\");let{document:n}=await this.storage.get(\"bookmarks\",Cf(t));if(!n)return null;let l=ac(n.value);if(l.itemId!==t)throw new te(\"STORAGE_FAILURE\",\"Saved story identity mismatch. Data preserved.\");return{...n,value:l}}async save(t,n,l={}){if(n&&n.value.itemId!==t.itemId)throw new te(\"INVALID_ARGUMENT\",\"Story identity changed\");let a=n?.value.savedAtMs??Date.now(),u=Cf(t.itemId),i=ac({...n&&!l.refresh?n.value:t,schemaVersion:1,savedAtMs:a,orderKey:Xh(a,t.itemId),categoryIds:l.categoryIds??n?.value.categoryIds??[]}),o=[{collection:\"bookmarks\",key:u,expectedRevision:n?.revision??null},...l.checks??[]],c=[{collection:\"bookmarks\",key:u,value:i}];n||(o.push({collection:\"bookmark-order\",key:i.orderKey,expectedRevision:null}),c.push({collection:\"bookmark-order\",key:i.orderKey,value:{bookmarkKey:u}})),await this.storage.commit({checks:o,puts:c})}async remove(t){let n=ac(t.value),l=Cf(n.itemId),a=await this.storage.get(\"bookmark-order\",n.orderKey);if(a.document&&a.document.value.bookmarkKey!==l)throw new te(\"STORAGE_FAILURE\",\"Bookmark index mismatch. Data preserved.\");await this.storage.commit({checks:[{collection:\"bookmarks\",key:l,expectedRevision:t.revision},{collection:\"bookmark-order\",key:n.orderKey,expectedRevision:a.document?.revision??null}],deletes:[{collection:\"bookmarks\",key:l},{collection:\"bookmark-order\",key:n.orderKey}]})}},wf=class{constructor(t){this.storage=t}storage;async read(){for(let t=0;t<3;t++){let n=await this.storage.get(\"category-meta\",\"active\"),l=n.document?{...n.document,value:RS(n.document.value)}:null,a=[];for(let i of l?.value.ids??[])a.push(await this.storage.get(\"categories\",i));if(a.some(i=>i.namespaceRevision!==n.namespaceRevision))continue;let u=a.map((i,o)=>{if(!i.document)throw jl();let c=Mf(i.document.value);if(c.id!==l.value.ids[o]||c.deletedAtMs!==null)throw jl();return{...i.document,value:c}});return{meta:l,categories:u,namespaceRevision:n.namespaceRevision}}throw oi()}async create(t){let n=Rf(t),l=await this.read();if(l.categories.length>=50)throw new te(\"QUOTA_EXCEEDED\",\"You can have up to 50 active categories.\");if((await this.storage.get(\"category-names\",n.normalizedName)).document)throw jh();let a=crypto.randomUUID(),u={schemaVersion:1,id:a,...n,createdAtMs:Date.now(),deletedAtMs:null};return await this.storage.commit({checks:[{collection:\"category-meta\",key:\"active\",expectedRevision:l.meta?.revision??null},{collection:\"categories\",key:a,expectedRevision:null},{collection:\"category-names\",key:n.normalizedName,expectedRevision:null}],puts:[{collection:\"categories\",key:a,value:u},{collection:\"category-names\",key:n.normalizedName,value:{categoryId:a}},{collection:\"category-meta\",key:\"active\",value:{ids:[...l.meta?.value.ids??[],a]}}]}),a}async rename(t,n){let l=Mf(t.value),a=Rf(n);if(l.deletedAtMs!==null||(await this.storage.get(\"categories\",l.id)).document?.revision!==t.revision)throw oi();if(l.normalizedName===a.normalizedName){await this.storage.commit({checks:[{collection:\"categories\",key:l.id,expectedRevision:t.revision}],puts:[{collection:\"categories\",key:l.id,value:{...l,...a}}]});return}let[i,o]=await Promise.all([this.storage.get(\"category-names\",l.normalizedName),this.storage.get(\"category-names\",a.normalizedName)]);if(Qh(i.document,l.id),o.document)throw jh();await this.storage.commit({checks:[{collection:\"categories\",key:l.id,expectedRevision:t.revision},{collection:\"category-names\",key:l.normalizedName,expectedRevision:i.document.revision},{collection:\"category-names\",key:a.normalizedName,expectedRevision:null}],puts:[{collection:\"categories\",key:l.id,value:{...l,...a}},{collection:\"category-names\",key:a.normalizedName,value:{categoryId:l.id}}],deletes:[{collection:\"category-names\",key:l.normalizedName}]})}async remove(t){let n=Mf(t.value),l=await this.read();if(!l.categories.some(u=>u.value.id===n.id&&u.revision===t.revision))throw oi();let a=await this.storage.get(\"category-names\",n.normalizedName);Qh(a.document,n.id),await this.storage.commit({checks:[{collection:\"categories\",key:n.id,expectedRevision:t.revision},{collection:\"category-meta\",key:\"active\",expectedRevision:l.meta.revision},{collection:\"category-names\",key:n.normalizedName,expectedRevision:a.document.revision}],puts:[{collection:\"categories\",key:n.id,value:{...n,deletedAtMs:Math.max(Date.now(),n.createdAtMs)}},{collection:\"category-meta\",key:\"active\",value:{ids:l.meta.value.ids.filter(u=>u!==n.id)}}],deletes:[{collection:\"category-names\",key:n.normalizedName}]})}};function ci(){let e=xS(Kt());return(0,Ql.useMemo)(()=>({storage:e,bookmarkRepository:new Df(e),categoryRepository:new wf(e)}),[e])}function vn(e){return e?.code===\"CONFIGURATION_REQUIRED\"?\"Saved stories need the bookmarks service. Connect it under Service connections in the Genesis menu.\":Ec(e)}function ic(){let{storage:e,bookmarkRepository:t,categoryRepository:n}=ci(),l=Bh(\"bookmarks\",{storage:e}),[a,u]=(0,Ql.useState)({snapshot:null,error:null});return(0,Ql.useEffect)(()=>{let o=!0,c=0,f=()=>{let m=++c;n.read().then(r=>{o&&m===c&&u({snapshot:r,error:null})},r=>{o&&m===c&&u(s=>({...s,error:r}))})};f();let g=e.onChanged(m=>{m.changes.some(r=>r.collection.startsWith(\"categor\"))&&f()});return()=>{o=!1,g()}},[e,n]),qh(()=>e.refresh()),{bookmarks:(0,Ql.useMemo)(()=>l.records.flatMap(o=>{try{return[{...o,value:ac(o.value)}]}catch{return[]}}).sort((o,c)=>c.value.savedAtMs-o.value.savedAtMs),[l.records]),categories:a.snapshot,loading:l.loading||a.snapshot===null&&a.error===null,error:l.error??a.error,bookmarkRepository:t,categoryRepository:n}}var I=U(J(),1);function Jh(){let e=ic(),t;return!e.categories&&e.error?t=(0,I.jsx)(Ie,{title:\"Couldn't load categories\",role:\"alert\",children:(0,I.jsx)(\"p\",{children:vn(e.error)})}):e.categories?t=(0,I.jsx)(DS,{categories:e.categories}):t=(0,I.jsx)(Ue,{label:\"Loading categories\",rows:3,kind:\"text\"}),(0,I.jsxs)(we,{className:\"screen\",children:[(0,I.jsx)(\"p\",{className:\"eyebrow\",children:\"Saved stories\"}),(0,I.jsx)(\"h1\",{className:\"screen-title\",children:\"Categories\"}),t]})}function DS({categories:e}){let{categoryRepository:t,storage:n}=ci(),[l,a]=(0,Fa.useState)(\"\"),[u,i]=(0,Fa.useState)(!1),[o,c]=(0,Fa.useState)(\"\"),f=async(g,m)=>{if(!u){i(!0),c(\"\");try{await g(),c(m)}catch(r){n.refresh(),c(`${vn(r)} The list has been reread; review it before retrying.`)}finally{i(!1)}}};return(0,I.jsxs)(\"section\",{className:\"card manager\",\"aria-busy\":u,\"aria-label\":\"Manage categories\",children:[(0,I.jsx)(\"p\",{className:\"meta\",children:\"Changes save immediately. Deleting a category keeps its stories, which become Uncategorized.\"}),o&&(0,I.jsx)(\"p\",{role:\"status\",className:\"status\",children:o}),(0,I.jsxs)(\"form\",{className:\"row\",onSubmit:g=>{g.preventDefault(),f(async()=>{await t.create(l),a(\"\")},\"Category created.\")},children:[(0,I.jsxs)(\"label\",{className:\"grow\",children:[(0,I.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,I.jsx)(\"input\",{placeholder:\"New category\",value:l,disabled:u,onChange:g=>a(g.target.value)})]}),(0,I.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:u||!l.trim(),children:\"Create\"})]}),(0,I.jsxs)(\"p\",{className:\"meta\",children:[e.categories.length,\" of 50 categories\"]}),e.categories.map(g=>(0,I.jsx)(wS,{record:g,busy:u,rename:m=>{f(()=>t.rename(g,m),\"Category renamed.\")},remove:()=>{f(()=>t.remove(g),\"Category deleted.\")}},`${g.value.id}:${g.revision}`))]})}function wS({record:e,busy:t,rename:n,remove:l}){let[a,u]=(0,Fa.useState)(e.value.name),[i,o]=(0,Fa.useState)(!1);return(0,I.jsxs)(\"div\",{className:\"category\",children:[(0,I.jsxs)(\"div\",{className:\"row\",children:[(0,I.jsxs)(\"label\",{className:\"grow\",children:[(0,I.jsxs)(\"span\",{className:\"visually-hidden\",children:[\"Rename \",e.value.name]}),(0,I.jsx)(\"input\",{value:a,disabled:t,onChange:c=>u(c.target.value)})]}),(0,I.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t||!a.trim()||a===e.value.name,onClick:()=>n(a),children:\"Rename\"}),(0,I.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:t,onClick:()=>o(!0),children:\"Delete\"})]}),i&&(0,I.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":`Delete ${e.value.name}`,children:[(0,I.jsxs)(\"p\",{children:[\"Delete \\u201C\",e.value.name,\"\\u201D? Its stories stay saved.\"]}),(0,I.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:t,onClick:l,children:\"Delete category permanently\"}),(0,I.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t,onClick:()=>o(!1),children:\"Keep category\"})]})]})}var ri=U(mt(),1);var V=U(J(),1);function Fh(e,t,n){let l=Ja(e,t),a=wn(\"setVoted\",e),[u,i]=(0,ri.useState)(!1),o=[...l].reverse().find(g=>g.name===\"setVoted\"),c=o?o.args.voted:n;return{shown:c,busy:o!==void 0,failed:u,toggle:()=>{i(!1),a(t,{voted:!c}).then(g=>i(g.outcome===\"failed\"))}}}function $h({vote:e,canVote:t,title:n,signedIn:l,small:a=!1}){let u=`vote${a?\" small\":\"\"}${e.shown?\" voted\":\"\"}`;return!l||!t&&!e.shown?(0,V.jsx)(\"span\",{className:u,\"aria-hidden\":\"true\"}):(0,V.jsx)(\"button\",{type:\"button\",className:`${u} icon-button`,\"aria-pressed\":e.shown,disabled:e.busy,\"aria-label\":e.shown?`Remove upvote: ${n}`:`Upvote: ${n}`,onClick:e.toggle,children:(0,V.jsx)(Ia,{name:\"up\",filled:e.shown})})}var Wh=({vote:e})=>e.failed?(0,V.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"The vote didn't go through. Try again.\"}):null;function US(){let{navigate:e}=Ke();return t=>e({screen:\"save\",params:{snapshot:JSON.stringify(Kh(t)),fresh:\"1\"}})}var oc=(0,ri.memo)(function({story:t,region:n,signedIn:l,heading:a=!1}){let u=Je(),i=Fh(n,t.id,t.voted),o=US(),c=a?\"h1\":\"h2\",f=kl(t.id);return(0,V.jsxs)(\"article\",{className:\"story\",children:[t.rank&&!a&&(0,V.jsx)(\"span\",{className:\"rank\",\"aria-hidden\":\"true\",children:t.rank}),(0,V.jsx)($h,{vote:i,canVote:t.canVote,title:t.title,signedIn:l}),(0,V.jsxs)(\"div\",{className:\"story-body\",children:[(0,V.jsxs)(c,{className:\"story-title\",children:[(0,V.jsx)(\"a\",{href:t.articleUrl??f,onClick:g=>{g.preventDefault(),u(t.articleUrl??f)},children:t.title}),t.domain&&(0,V.jsxs)(\"span\",{className:\"domain\",children:[\" (\",t.domain,\")\"]})]}),(0,V.jsx)(ii,{parts:[t.score,t.submitter&&(0,V.jsx)(\"a\",{href:gn(t.submitter),onClick:g=>{g.preventDefault(),u(gn(t.submitter))},children:t.submitter}),t.age,t.comments&&!a&&(0,V.jsx)(\"a\",{href:f,onClick:g=>{g.preventDefault(),u(f)},children:t.comments})]}),(0,V.jsx)(Wh,{vote:i})]}),(0,V.jsx)(\"button\",{type:\"button\",className:\"icon-button\",\"aria-label\":`Save story: ${t.title}`,onClick:()=>o(t),children:(0,V.jsx)(Ia,{name:\"bookmark\"})})]})}),Ih=(e,t)=>`${ie}/reply?id=${e}&goto=${encodeURIComponent(`item?id=${t}#${e}`)}`,si=(0,ri.memo)(function({entry:t,region:n,storyId:l,signedIn:a,collapsed:u,hidden:i,onToggle:o,onLink:c,head:f=!1}){let g=Je(),m=Fh(n,t.id,t.voted),r=t.author;return(0,V.jsxs)(\"article\",{className:\"comment\",id:`comment-${t.id}`,style:{\"--depth\":Math.min(t.depth,8)},children:[(0,V.jsxs)(\"header\",{className:\"comment-head\",children:[(0,V.jsx)($h,{small:!0,vote:m,canVote:t.canVote,title:`comment by ${r??\"unknown\"}`,signedIn:a}),(0,V.jsx)(ii,{parts:[r&&(0,V.jsx)(\"a\",{href:gn(r),onClick:s=>{s.preventDefault(),g(gn(r))},children:(0,V.jsx)(\"strong\",{children:r})}),t.age,f&&t.onStory&&(0,V.jsxs)(\"a\",{href:kl(t.onStory.id),onClick:s=>{s.preventDefault(),g(kl(t.onStory.id))},children:[\"on: \",t.onStory.title]})]}),o&&(0,V.jsx)(\"button\",{type:\"button\",className:\"text-button\",\"aria-expanded\":!u,onClick:()=>o(t.id),children:u?`Show${i?` (${i+1})`:\"\"}`:\"Hide\"})]}),!u&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ml,{parts:t.parts,onLink:c}),(0,V.jsx)(Wh,{vote:m}),(0,V.jsxs)(\"nav\",{className:\"comment-links\",\"aria-label\":\"Comment links\",children:[t.links.map(s=>(0,V.jsx)(\"a\",{href:s.url,onClick:p=>{p.preventDefault(),c(s.url)},children:s.label},s.label+s.url)),t.canReply&&(0,V.jsx)(\"a\",{href:Ih(t.id,l),onClick:s=>{s.preventDefault(),g(Ih(t.id,l))},children:\"reply\"})]})]})]})});var He=U(J(),1),Ph=[{label:\"Top\",paths:[\"/\",\"/news\"]},{label:\"New\",paths:[\"/newest\"]},{label:\"Past\",paths:[\"/front\"]},{label:\"Comments\",paths:[\"/newcomments\"]},{label:\"Ask\",paths:[\"/ask\"]},{label:\"Show\",paths:[\"/show\"]},{label:\"Jobs\",paths:[\"/jobs\"]}],HS={\"/shownew\":\"New Show\",\"/asknew\":\"New Ask\",\"/best\":\"Best\",\"/active\":\"Active\",\"/from\":\"From site\",\"/submitted\":\"Submissions\",\"/threads\":\"Comments\",\"/favorites\":\"Favorites\",\"/hidden\":\"Hidden\",\"/upvoted\":\"Upvoted\"};function e0(){let e=qt(),{navigate:t}=Ke(),n=ai(\"stories\"),l=ai(\"comments\"),a=At(\"more\",null),u=wn(\"loadMore\"),i=Ja(null,null).some(T=>T.name===\"loadMore\"),o=Je(),c=e.account!==null,f=e.pageId===\"feed\"||e.pageId===\"private-feed\",g=e.url?new URL(e.url).pathname:\"/\",m=Ph.find(T=>T.paths.includes(g)),r=f?n.order:[],s=f&&r.length===0?l.order:[],p=()=>{u(null).then(T=>{T.outcome===\"failed\"&&a&&o(a.data.url)})},b;return r.length===0&&s.length===0?f&&e.status===\"ready\"&&n.status===\"ready\"?b=(0,He.jsx)(Ie,{title:\"Nothing here yet\",children:(0,He.jsx)(\"p\",{children:\"This list is empty on Hacker News.\"})}):e.status===\"error\"||n.status===\"error\"?b=(0,He.jsx)(zt,{error:e.error??n.error}):b=(0,He.jsx)(Ue,{label:\"Loading stories\"}):b=(0,He.jsxs)(He.Fragment,{children:[e.status===\"error\"&&(0,He.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),(n.status===\"error\"||l.status===\"error\")&&(0,He.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some rows couldn't be read.\"}),r.map(T=>{let v=n.get(T)?.data;return v&&(0,He.jsx)(oc,{story:v,region:\"stories\",signedIn:c},T)}),s.map(T=>{let v=l.get(T)?.data;return v&&(0,He.jsx)(si,{head:!0,entry:v,region:\"comments\",storyId:v.onStory?.id??T,signedIn:c,onLink:o},T)}),a&&(0,He.jsx)(\"button\",{type:\"button\",className:\"secondary more\",disabled:i||e.stale,onClick:p,children:i?\"Loading\\u2026\":\"More\"})]}),(0,He.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[m?(0,He.jsx)(\"nav\",{className:\"chips\",\"aria-label\":\"Feeds\",children:Ph.map(T=>(0,He.jsx)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":T===m,onClick:()=>T!==m&&t({url:ie+T.paths[0],mode:\"replace\"}),children:T.label},T.label))}):(0,He.jsx)(\"h1\",{className:\"screen-title\",children:HS[g]??\"Hacker News\"}),b]})}var Un=U(J(),1);function t0(){let e=qt(),t=At(\"sections\",null),n=e.pageId===\"info\"?t?.data??null:null;return n?(0,Un.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale,children:[(0,Un.jsx)(\"h1\",{className:\"screen-title\",children:n.title}),(0,Un.jsx)(\"div\",{className:\"card\",children:(0,Un.jsx)(ml,{parts:n.parts})})]}):(0,Un.jsx)(\"div\",{className:\"screen\",\"aria-busy\":e.status===\"loading\",children:e.status===\"error\"?(0,Un.jsx)(zt,{error:e.error}):(0,Un.jsx)(Ue,{label:\"Loading page\",rows:6,kind:\"text\"})})}var _t=U(mt(),1);var Ge=U(J(),1);function GS(e){let t=new Map,n=new Map,l=[];for(let a of e.order){let u=e.get(a)?.data;if(u){for(;l.length>0&&l[l.length-1].depth>=u.depth;)l.pop();t.set(a,l.map(i=>i.id));for(let i of l)n.set(i.id,(n.get(i.id)??0)+1);l.push({id:a,depth:u.depth})}}return{ancestors:t,replies:n}}function n0(){let e=qt(),t=At(\"story\",null),n=ai(\"comments\"),l=At(\"more\",null),a=Je(),[u,i]=(0,_t.useState)(new Set),[o,c]=(0,_t.useState)(null),f=(0,_t.useRef)(null),{ancestors:g,replies:m}=(0,_t.useMemo)(()=>GS(n),[n]),r=e.account!==null,s=e.pageId===\"item\"?t?.data??null:null,p=s?.story?.id??s?.comment?.id??e.params.id??\"\",b=s?.comment?.onStory?.id??p,T=(0,_t.useRef)({ancestors:g,url:e.url});T.current={ancestors:g,url:e.url},(0,_t.useEffect)(()=>{o&&(f.current?.querySelector(`[id=\"comment-${o}\"]`)?.scrollIntoView({block:\"start\"}),c(null))},[o]);let v=(0,_t.useCallback)(C=>{let{ancestors:A,url:_}=T.current,Y=new URL(C),M=Y.hash.slice(1);Y.hash=\"\";let F=_?new URL(_):null;F&&(F.hash=\"\"),M&&F&&Y.href===F.href&&A.has(M)?(i(Fe=>new Set([...Fe].filter(Ct=>Ct!==M&&!A.get(M).includes(Ct)))),c(M)):a(C)},[a]),d=(0,_t.useCallback)(C=>i(A=>{let _=new Set(A);return _.delete(C)||_.add(C),_}),[]);if(!s)return(0,Ge.jsx)(\"div\",{className:\"screen\",\"aria-busy\":e.status===\"loading\",children:e.status===\"error\"?(0,Ge.jsx)(zt,{error:e.error}):(0,Ge.jsx)(Ue,{label:\"Loading discussion\"})});let h=e.pageId===\"item\"?n.order:[],S=h.filter(C=>!g.get(C)?.some(A=>u.has(A))),O=`item?id=${p}`;return(0,Ge.jsx)(we,{className:\"screen\",\"aria-busy\":e.stale,children:(0,Ge.jsxs)(\"div\",{ref:f,children:[e.status===\"error\"&&(0,Ge.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),s.story&&(0,Ge.jsx)(oc,{heading:!0,story:s.story,region:\"story\",signedIn:r}),s.comment&&(0,Ge.jsx)(si,{head:!0,entry:s.comment,region:\"story\",storyId:b,signedIn:r,onLink:v}),s.text.length>0&&(0,Ge.jsx)(\"div\",{className:\"toptext\",children:(0,Ge.jsx)(ml,{parts:s.text,onLink:v})}),r&&s.canComment&&(0,Ge.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>a(`${ie}/reply?id=${p}&goto=${encodeURIComponent(O)}`),children:\"Add a comment\"}),!r&&(0,Ge.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>a(Yh(O)),children:\"Sign in to comment\"}),(0,Ge.jsx)(\"h2\",{className:\"section-title\",children:h.length===0?\"No comments yet\":\"Comments\"}),n.status===\"error\"&&(0,Ge.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some comments couldn't be read.\"}),S.map(C=>{let A=n.get(C)?.data;return A&&(0,Ge.jsx)(si,{entry:A,region:\"comments\",storyId:b,signedIn:r,collapsed:u.has(C),hidden:m.get(C)??0,onToggle:d,onLink:v},C)}),l&&(0,Ge.jsx)(\"button\",{type:\"button\",className:\"secondary more\",disabled:e.stale,onClick:()=>a(l.data.url),children:\"More comments\"})]})})}var Hf=U(mt(),1);var ee=U(J(),1);function l0(){let e=qt(),t=At(\"account\",null),n=wn(\"signOut\",\"account\"),l=Ja(\"account\",t?.key??null).length>0,a=Je(),[u,i]=(0,Hf.useState)(!1),[o,c]=(0,Hf.useState)(!1),f=e.pageId===\"account\"&&!e.stale?t?.data??null:null,g=()=>{c(!1),n(t.key).then(r=>{let s=r.outcome===\"observed\"||r.code===\"AUTH_REQUIRED\"||r.code===\"CONTEXT_REPLACED\";c(!s),s&&i(!1)})},m;if(!f)m=e.status===\"error\"?(0,ee.jsx)(zt,{error:e.error}):(0,ee.jsx)(Ue,{label:\"Loading account\",rows:4,kind:\"text\"});else{let r=encodeURIComponent(f.name);m=(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)(\"section\",{className:\"card account\",children:[(0,ee.jsx)(\"h2\",{children:f.name}),f.karma&&(0,ee.jsxs)(\"p\",{className:\"meta\",children:[f.karma,\" karma\"]})]}),(0,ee.jsxs)(\"nav\",{className:\"list\",\"aria-label\":\"Your Hacker News\",children:[(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(gn(f.name)),children:\"Profile\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/submitted?id=${r}`),children:\"My submissions\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/threads?id=${r}`),children:\"My comments\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/favorites?id=${r}`),children:\"HN favorites\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/upvoted?id=${r}`),children:\"Upvoted\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/hidden?id=${r}`),children:\"Hidden\"})]}),(0,ee.jsx)(\"p\",{className:\"meta\",children:\"Genesis Saved stories are separate from HN favorites.\"}),o&&(0,ee.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't sign out. Try again.\"}),u?(0,ee.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":\"Confirm sign out\",children:[(0,ee.jsx)(\"p\",{children:\"Sign out of Hacker News in this app?\"}),(0,ee.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:l,onClick:g,children:\"Sign out\"}),(0,ee.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:l,onClick:()=>i(!1),children:\"Stay signed in\"})]}):(0,ee.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>i(!0),children:\"Sign out\"})]})}return(0,ee.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,ee.jsx)(\"h1\",{className:\"screen-title\",children:\"Me\"}),m,(0,ee.jsxs)(\"nav\",{className:\"list\",\"aria-label\":\"About Hacker News\",children:[(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/newsguidelines.html`),children:\"Guidelines\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/newsfaq.html`),children:\"FAQ\"})]})]})}var Jt=U(mt(),1);var oe=U(J(),1);function a0(){let e=qt(),{setLeaveGuard:t}=Ke(),n=At(\"form\",null),l=wn(\"setField\",\"form\"),a=wn(\"submit\",\"form\"),u=Je(),[i,o]=(0,Jt.useState)(\"\"),[c,f]=(0,Jt.useState)(\"\"),[g,m]=(0,Jt.useState)(\"\"),[r,s]=(0,Jt.useState)(!1),[p,b]=(0,Jt.useState)(null),[T,v]=(0,Jt.useState)(null),d=e.pageId===\"submit\"&&!e.stale?n?.data??null:null,[h,S]=(0,Jt.useState)(!1);(0,Jt.useEffect)(()=>{h||!d||(S(!0),o(d.title),f(d.url),m(d.text))},[h,d]);let O=T===null&&(i.trim()!==\"\"||c.trim()!==\"\"||g.trim()!==\"\");(0,Jt.useEffect)(()=>t(O?\"Discard this post?\":null),[O,t]);let C=c.trim()&&!lc(c.trim())?\"Enter a web address that starts with http or https.\":null,A=i.trim()!==\"\"&&i.trim().length<=80&&!C&&!r&&n!==void 0,_=async()=>{s(!0),b(null);let F=n.key;for(let[Ct,Zl]of[[\"title\",i.trim()],[\"url\",c.trim()],[\"text\",g]])if((await l(F,{name:Ct,value:Zl})).outcome!==\"observed\"){s(!1),b(\"Couldn't fill in Hacker News's form. Try again.\");return}let Fe=await a(F);s(!1),Fe.outcome===\"observed\"?v(\"accepted\"):Fe.code===\"REJECTED\"?b(null):Fe.outcome===\"unknown\"?v(\"unknown\"):b(\"Hacker News didn't take the post. Check the form and try again.\")},Y=()=>{o(\"\"),f(\"\"),m(\"\"),v(null),u(`${ie}/submit`)};if(T)return(0,oe.jsxs)(\"div\",{className:\"screen\",children:[(0,oe.jsx)(\"h1\",{className:\"screen-title\",children:\"Post\"}),(0,oe.jsxs)(Ie,{title:T===\"accepted\"?\"Submitted to Hacker News\":\"Check Hacker News\",role:\"status\",children:[(0,oe.jsx)(\"p\",{children:T===\"accepted\"?\"New posts appear under New. Hacker News may point you to an existing discussion of the same link.\":\"Hacker News went to another page, so the app can't tell whether the post went through.\"}),(0,oe.jsx)(\"button\",{type:\"button\",className:\"primary\",onClick:()=>u(`${ie}/newest`),children:\"See New\"}),(0,oe.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:Y,children:\"Post another\"})]})]});let M;return d?M=(0,oe.jsxs)(\"form\",{className:\"form\",onSubmit:F=>{F.preventDefault(),A&&_()},children:[d.error&&(0,oe.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:d.error}),(0,oe.jsxs)(\"label\",{children:[\"Title\",(0,oe.jsx)(\"input\",{value:i,maxLength:80,required:!0,onChange:F=>o(F.target.value)}),(0,oe.jsxs)(\"span\",{className:\"meta\",children:[i.trim().length,\" of \",80]})]}),(0,oe.jsxs)(\"label\",{children:[\"URL\",(0,oe.jsx)(\"input\",{type:\"url\",inputMode:\"url\",value:c,\"aria-invalid\":C!==null,onChange:F=>f(F.target.value)}),C&&(0,oe.jsx)(\"span\",{className:\"field-error\",children:C})]}),(0,oe.jsxs)(\"label\",{children:[\"Text\",(0,oe.jsx)(\"textarea\",{rows:6,value:g,onChange:F=>m(F.target.value)})]}),(0,oe.jsx)(\"p\",{className:\"meta\",children:\"Leave the URL blank to ask a question. With a URL, the text appears as the first comment.\"}),p&&(0,oe.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:p}),(0,oe.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:!A,children:r?\"Posting\\u2026\":\"Post\"}),(0,oe.jsx)(\"button\",{type:\"button\",className:\"text-button\",onClick:()=>u(`${ie}/newsguidelines.html`),children:\"Read the guidelines\"})]}):M=e.status===\"error\"?(0,oe.jsx)(zt,{error:e.error}):e.status===\"ready\"?(0,oe.jsx)(zt,{error:{code:\"NOT_FOUND\",message:\"Hacker News didn't show its submit form.\"}}):(0,oe.jsx)(Ue,{label:\"Loading the post form\",rows:3,kind:\"text\"}),(0,oe.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,oe.jsx)(\"h1\",{className:\"screen-title\",children:\"Post\"}),M]})}var dt=U(mt(),1);var q=U(J(),1),LS=[\"DEADLINE\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\"];function BS(e){try{let t=JSON.parse(e??\"\");return ui(t?.itemId)&&typeof t.title==\"string\"?t:null}catch{return null}}function u0(){let{screen:e,back:t}=Ke(),{storage:n,bookmarkRepository:l,categoryRepository:a}=ci(),u=(0,dt.useMemo)(()=>BS(e?.params.snapshot),[e?.params.snapshot]),i=e?.params.fresh===\"1\",[o,c]=(0,dt.useState)(null),[f,g]=(0,dt.useState)(null),[m,r]=(0,dt.useState)(!1),[s,p]=(0,dt.useState)(0),[b,T]=(0,dt.useState)(!1),[v,d]=(0,dt.useState)(\"\"),[h,S]=(0,dt.useState)(\"\"),[O,C]=(0,dt.useState)(!1),[A,_]=(0,dt.useState)(!1),Y=async()=>{let[re,Se]=await Promise.all([l.get(u.itemId),a.read()]);return c({previous:re,categories:Se}),g(at=>at??Xl(re?.value.categoryIds??[],Se)),r(!1),Se};if((0,dt.useEffect)(()=>{if(!u)return;let re=!0;return Promise.all([l.get(u.itemId),a.read()]).then(([Se,at])=>{re&&(c({previous:Se,categories:at}),g($e=>$e??Xl(Se?.value.categoryIds??[],at)),r(!1))},Se=>{re&&(d(vn(Se)),r(!0))}),()=>{re=!1}},[u,l,a,s]),!u)return(0,q.jsx)(\"div\",{className:\"screen\",children:(0,q.jsx)(Ie,{title:\"Can't save this story\",role:\"alert\",children:(0,q.jsx)(\"p\",{children:\"The story details are missing.\"})})});let M=o?.previous??null,F=!o&&!m,Fe=b||F||m,Ct=async re=>{if(!(Fe||!o||!f)){T(!0),d(\"\");try{if(re&&M)await l.remove(M);else{let Se=Xl(f,o.categories);await l.save(u,M,{refresh:O&&i,categoryIds:Se,checks:Zh(o.categories,Se)})}t()}catch(Se){let at=Se.code??\"\";if(d(vn(Se)),at===\"CONFLICT\"||LS.includes(at))try{await Y(),d(at===\"CONFLICT\"?\"This story or its categories changed. Review the current record and your selections, then try again.\":\"The result of the save was uncertain. The current record was reloaded. Review it before retrying.\")}catch{r(!0),d(\"The current record could not be reloaded. Reload it before retrying.\")}}finally{T(!1)}}},Zl=async()=>{if(!Fe){T(!0),d(\"\");try{let re=await a.create(h);await Y(),g(Se=>[...new Set([...Se??[],re])]),S(\"\"),d(\"Category created. Save to apply your selection.\")}catch(re){try{await Y(),d(`${vn(re)} Categories were reloaded; review them before retrying.`)}catch{r(!0),d(\"The new category could not be confirmed. Reload before retrying.\")}}finally{T(!1),n.refresh()}}};return(0,q.jsxs)(we,{className:\"screen\",children:[(0,q.jsx)(\"p\",{className:\"eyebrow\",children:\"Saved stories\"}),(0,q.jsx)(\"h1\",{className:\"screen-title\",children:M?\"Edit saved story\":\"Save story\"}),(0,q.jsxs)(\"section\",{className:\"card\",children:[(0,q.jsx)(\"p\",{className:\"story-title\",children:M?.value.title??u.title}),(0,q.jsxs)(\"p\",{className:\"meta\",children:[u.submitter?`By ${u.submitter} \\xB7 `:\"\",\"HN item \",u.itemId]}),(0,q.jsx)(\"p\",{className:\"meta\",children:\"Saved in Genesis, separate from your HN favorites.\"})]}),F&&(0,q.jsx)(Ue,{label:\"Loading saved state\",rows:3,kind:\"text\"}),o&&f&&(0,q.jsxs)(\"fieldset\",{className:\"card\",disabled:Fe,children:[(0,q.jsx)(\"legend\",{children:\"Categories\"}),o.categories.categories.length===0&&(0,q.jsx)(\"p\",{className:\"meta\",children:\"No categories yet. Saving without one files the story under Uncategorized.\"}),o.categories.categories.map(re=>(0,q.jsxs)(\"label\",{className:\"check\",children:[(0,q.jsx)(\"input\",{type:\"checkbox\",checked:f.includes(re.value.id),onChange:Se=>{let at=re.value.id;g($e=>Se.target.checked?[...$e??[],at]:($e??[]).filter(Wa=>Wa!==at))}}),re.value.name]},re.value.id)),(0,q.jsxs)(\"div\",{className:\"row\",children:[(0,q.jsxs)(\"label\",{className:\"grow\",children:[(0,q.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,q.jsx)(\"input\",{placeholder:\"New category\",value:h,onChange:re=>S(re.target.value)})]}),(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:!h.trim(),onClick:()=>{Zl()},children:\"Create\"})]}),(0,q.jsx)(\"p\",{className:\"meta\",children:\"A new category is kept even if you leave without saving.\"})]}),M&&i&&(0,q.jsxs)(\"label\",{className:\"check\",children:[(0,q.jsx)(\"input\",{type:\"checkbox\",checked:O,disabled:b,onChange:re=>C(re.target.checked)}),\"Update the title and link from Hacker News\"]}),v&&(0,q.jsx)(\"p\",{role:\"status\",className:\"status\",children:v}),m&&(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:b,onClick:()=>{d(\"\"),p(re=>re+1)},children:\"Reload saved state\"}),(0,q.jsxs)(\"div\",{className:\"actions\",children:[(0,q.jsx)(\"button\",{type:\"button\",className:\"primary\",disabled:Fe,onClick:()=>{Ct(!1)},children:b?\"Saving\\u2026\":M?\"Save changes\":\"Save\"}),(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:b,onClick:t,children:\"Cancel\"}),M&&!A&&(0,q.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:Fe,onClick:()=>_(!0),children:\"Remove from Saved\"})]}),A&&(0,q.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":\"Confirm removal\",children:[(0,q.jsx)(\"p\",{children:\"Remove this saved story? This can't be undone.\"}),(0,q.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:b,onClick:()=>{Ct(!0)},children:\"Remove story\"}),(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:b,onClick:()=>_(!1),children:\"Keep story\"})]})]})}var cc=U(mt(),1);var le=U(J(),1),qS=(e,t,n)=>{let l=Xl(e.categoryIds,n);return t===\"all\"||(t===\"uncategorized\"?l.length===0:l.includes(t))};function i0(){let{screen:e,navigate:t}=Ke(),n=ic(),[l,a]=(0,cc.useState)(\"\"),u=n.categories,i=e?.params.filter,o=u?.categories.some(m=>m.value.id===i)||i===\"uncategorized\"?i:\"all\",c=m=>t({screen:\"saved\",params:{filter:m},mode:\"replace\"}),f=(0,cc.useMemo)(()=>{if(!u)return[];let m=l.trim().toLowerCase();return n.bookmarks.filter(r=>qS(r.value,o,u)&&(!m||r.value.title.toLowerCase().includes(m)))},[n.bookmarks,u,o,l]),g;return!u&&n.error?g=(0,le.jsx)(Ie,{title:\"Couldn't load saved stories\",role:\"alert\",children:(0,le.jsx)(\"p\",{children:vn(n.error)})}):!u||n.loading?g=(0,le.jsx)(Ue,{label:\"Loading saved stories\"}):g=(0,le.jsxs)(le.Fragment,{children:[n.error!=null&&(0,le.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:vn(n.error)}),(0,le.jsx)(\"nav\",{className:\"chips\",\"aria-label\":\"Filter saved stories\",children:[{id:\"all\",name:\"All\"},{id:\"uncategorized\",name:\"Uncategorized\"},...u.categories.map(m=>m.value)].map(m=>(0,le.jsx)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":o===m.id,onClick:()=>c(m.id),children:m.name},m.id))}),(0,le.jsxs)(\"label\",{className:\"search-field\",children:[(0,le.jsx)(\"span\",{className:\"visually-hidden\",children:\"Filter by title\"}),(0,le.jsx)(\"input\",{type:\"search\",placeholder:\"Filter by title\",value:l,onChange:m=>a(m.target.value)})]}),f.length===0?(0,le.jsx)(Ie,{title:n.bookmarks.length===0?\"No saved stories\":\"No matches\",children:(0,le.jsx)(\"p\",{children:n.bookmarks.length===0?\"Use the bookmark button on any story to save it here.\":\"Try another filter or title.\"})}):f.map(m=>(0,le.jsx)(VS,{record:m,categories:u},m.key)),(0,le.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t({screen:\"categories\"}),children:\"Manage categories\"})]}),(0,le.jsxs)(we,{className:\"screen\",children:[(0,le.jsx)(\"h1\",{className:\"screen-title\",children:\"Saved\"}),g]})}function VS({record:e,categories:t}){let{navigate:n}=Ke(),l=Je(),a=e.value,u=Xl(a.categoryIds,t).map(i=>t.categories.find(o=>o.value.id===i).value.name);return(0,le.jsxs)(\"article\",{className:\"story saved\",children:[(0,le.jsxs)(\"div\",{className:\"story-body\",children:[(0,le.jsx)(\"h2\",{className:\"story-title\",children:(0,le.jsx)(\"a\",{href:a.articleUrl??a.discussionUrl,onClick:i=>{i.preventDefault(),l(a.articleUrl??a.discussionUrl)},children:a.title})}),(0,le.jsx)(ii,{parts:[a.submitter&&(0,le.jsx)(\"a\",{href:gn(a.submitter),onClick:i=>{i.preventDefault(),l(gn(a.submitter))},children:a.submitter}),(0,le.jsx)(\"a\",{href:a.discussionUrl,onClick:i=>{i.preventDefault(),l(a.discussionUrl)},children:\"discussion\"}),u.length>0?u.join(\", \"):\"Uncategorized\"]})]}),(0,le.jsx)(\"button\",{type:\"button\",className:\"text-button\",\"aria-label\":`Edit saved story: ${a.title}`,onClick:()=>n({screen:\"save\",params:{snapshot:JSON.stringify(a)}}),children:\"Edit\"})]})}var $a=U(J(),1);function o0(){return(0,$a.jsxs)(\"div\",{className:\"screen\",children:[(0,$a.jsx)(\"h1\",{className:\"screen-title\",children:\"Search\"}),(0,$a.jsx)(Ie,{title:\"Search is coming\",children:(0,$a.jsx)(\"p\",{children:\"This space will connect to a separate search site. For now, browse Home or your Saved stories.\"})})]})}var ce=U(J(),1);function c0(){let e=qt(),t=At(\"profile\",null),n=Je(),l=e.pageId===\"user\"?t?.data??null:null;if(!l)return(0,ce.jsx)(\"div\",{className:\"screen\",\"aria-busy\":e.status===\"loading\",children:e.status===\"error\"?(0,ce.jsx)(zt,{error:e.error}):e.status===\"ready\"&&e.pageId===\"user\"?(0,ce.jsx)(Ie,{title:\"No such user\",children:(0,ce.jsx)(\"p\",{children:\"Hacker News has no profile with this name.\"})}):(0,ce.jsx)(Ue,{label:\"Loading profile\",rows:4,kind:\"text\"})});let a=encodeURIComponent(l.name);return(0,ce.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale,children:[e.status===\"error\"&&(0,ce.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),(0,ce.jsx)(\"h1\",{className:\"screen-title\",children:l.name}),(0,ce.jsxs)(\"dl\",{className:\"facts\",children:[l.karma&&(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(\"dt\",{children:\"Karma\"}),(0,ce.jsx)(\"dd\",{children:l.karma})]}),l.created&&(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(\"dt\",{children:\"Joined\"}),(0,ce.jsx)(\"dd\",{children:l.created})]})]}),l.about.length>0&&(0,ce.jsxs)(\"section\",{className:\"card\",children:[(0,ce.jsx)(\"h2\",{className:\"section-title\",children:\"About\"}),(0,ce.jsx)(ml,{parts:l.about})]}),(0,ce.jsxs)(\"nav\",{className:\"list\",\"aria-label\":`${l.name} on Hacker News`,children:[(0,ce.jsx)(\"button\",{type:\"button\",onClick:()=>n(`${ie}/submitted?id=${a}`),children:\"Submissions\"}),(0,ce.jsx)(\"button\",{type:\"button\",onClick:()=>n(`${ie}/threads?id=${a}`),children:\"Comments\"}),(0,ce.jsx)(\"button\",{type:\"button\",onClick:()=>n(`${ie}/favorites?id=${a}`),children:\"Favorites\"})]})]})}var Hn=U(J(),1),YS={feed:e0,item:n0,user:c0,info:t0,search:o0,post:a0,saved:i0,categories:Jh,save:u0,me:l0},kS=[{id:\"primary\",label:\"Home\",icon:\"home\",context:!0},{id:\"search\",label:\"Search\",icon:\"search\",context:!1},{id:\"post\",label:\"Post\",icon:\"post\",context:!0},{id:\"saved\",label:\"Saved\",icon:\"bookmark\",context:!1},{id:\"me\",label:\"Me\",icon:\"person\",context:!0}];function r0(){let{screen:e,active:t,overlay:n,select:l,navigate:a}=Ke(),u=e?YS[e.id]:void 0,i=n[0]?.id,o=i===\"search\"||i===\"saved\"?i:n.length>0?null:t;return(0,Hn.jsxs)(\"div\",{className:\"app\",children:[(0,Hn.jsx)(\"main\",{className:\"content\",children:u&&(0,Hn.jsx)(u,{},e.key)}),(0,Hn.jsx)(\"nav\",{className:\"tabs\",\"aria-label\":\"Sections\",children:kS.map(c=>{let f=c.id===o;return(0,Hn.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":f?\"page\":void 0,onClick:()=>c.context?l(c.id):a({screen:c.id,mode:\"root\"}),children:[(0,Hn.jsx)(Ia,{name:c.icon,filled:f}),(0,Hn.jsx)(\"span\",{children:c.label})]},c.id)})})]})}var s0=U(J(),1);Gh((0,s0.jsx)(r0,{}));})();\n"},{"path":"index.html","encoding":"utf8","content":"\n\n\n\n\nHacker News\n\n\n\n\n
\n\n\n\n"}]} \ No newline at end of file diff --git a/hn-bookmarks/published/applet-hn-bookmarks.release.json b/hn-bookmarks/published/applet-hn-bookmarks.release.json new file mode 100644 index 0000000..0d983f9 --- /dev/null +++ b/hn-bookmarks/published/applet-hn-bookmarks.release.json @@ -0,0 +1,40 @@ +{ + "releaseFormat": 1, + "appletId": "hn-bookmarks", + "name": "Hacker News", + "version": "0.1.0", + "bundle": { + "file": "applet-hn-bookmarks.bundle.json", + "sha256": "22df9e1db4ebe8248f8bd08517b57dc628eb0323f09c70056b01c559b1ec617c", + "size": 353552 + }, + "compat": { + "manifestSchema": 6, + "bundleFormat": 3, + "protocol": 1, + "adapterApi": 1, + "sdk": "0.0.0", + "tools": "0.0.0", + "builtAt": "2026-11-09T11:21:14Z" + }, + "origins": [ + "https://news.ycombinator.com" + ], + "capabilities": { + "storage": false, + "services": [ + "bookmarks" + ] + }, + "toolchain": { + "genesisCommit": "655ce128bce13bd8a376a3630766fb18182ba928", + "node": "24.15.0", + "tools": "0.0.0", + "sdk": "0.0.0" + }, + "home": { + "fullName": "nirvanacp/applets", + "path": "hn-bookmarks" + }, + "builtAt": "2026-11-09T11:21:14Z" +} From 51e7225b94e841a122e7cfdd78cce246773d44e1 Mon Sep 17 00:00:00 2001 From: Rit Date: Mon, 9 Nov 2026 16:51:55 +0530 Subject: [PATCH 3/9] feat/(x-bookmarks): publish 0.1.0 Co-Authored-By: Claude Opus 5.5 --- .../2026-11-09-165141-publish-0.1.0.md | 6 +++ x-bookmarks/.specs/current.md | 1 + .../published/applet-x-bookmarks.bundle.json | 1 + .../published/applet-x-bookmarks.release.json | 40 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 x-bookmarks/.changelog/2026-11-09-165141-publish-0.1.0.md create mode 100644 x-bookmarks/published/applet-x-bookmarks.bundle.json create mode 100644 x-bookmarks/published/applet-x-bookmarks.release.json diff --git a/x-bookmarks/.changelog/2026-11-09-165141-publish-0.1.0.md b/x-bookmarks/.changelog/2026-11-09-165141-publish-0.1.0.md new file mode 100644 index 0000000..2b38ca0 --- /dev/null +++ b/x-bookmarks/.changelog/2026-11-09-165141-publish-0.1.0.md @@ -0,0 +1,6 @@ +# Publish 0.1.0 + +- Goal: The user asked to adopt versioned releases for the applets in this repository, so Genesis can install them from GitHub and check them in CI. +- Changes: `genesis-applet publish` wrote `published/applet-x-bookmarks.bundle.json` (SHA-256 `17dc77590f03244d…`, 357380 bytes) and `published/applet-x-bookmarks.release.json` for version 0.1.0, built with Genesis commit `655ce128bce1`. The current spec names the published version and tag. Sources, id, service ids and stored data are unchanged. +- Decisions: The first release keeps the existing `package.json` version 0.1.0; dependencies already pin exact versions. The tag `x-bookmarks/v0.1.0` follows the multi-applet tag format and is created locally after this commit; pushing it is left to the operator. +- Verification: `genesis-applet publish --verify` rebuilt the bundle with the recorded build time and found it identical. `genesis-applet check` and `build` ran as part of publish. Not run on a device; no backend was started. CI has not run because the Genesis commit and this repository are not pushed yet. diff --git a/x-bookmarks/.specs/current.md b/x-bookmarks/.specs/current.md index d97e569..75046e3 100644 --- a/x-bookmarks/.specs/current.md +++ b/x-bookmarks/.specs/current.md @@ -6,6 +6,7 @@ - Three contexts, each with its own website session history: `primary` (Home, Notifications and Saved, start URL `/home`), `explore` (`/explore`) and `account` (`/settings/account`, the Profile tab). The adapter is [src/adapter.ts](../src/adapter.ts) with pages `timeline`, `post`, `profile`, `explore`, `media` and `account` in [src/adapter](../src/adapter). - Screens: route screens `home`, `notifications`, `saved`, `explore`, `post`, `profile`, `media` and `account`; overlay screens `categories`, `save` and `manage`. Service: `bookmarks`. - Manifest schema 6, `@genesis/sdk` 0.0.0, `genesis-applet` tools 0.0.0, protocol 1, adapter API 1. Kit version: not exported for this in-repository applet. The [manifest](../applet.json) is the authority for routes and contexts. +- Published release: version 0.1.0, tag `x-bookmarks/v0.1.0`, build and release record in `published/` (built with Genesis `655ce128bce1`). Raise the version and run `genesis-applet publish` again before the next release. - Installed for development with `dev install`; it is not bundled into the APK. ## Product scope diff --git a/x-bookmarks/published/applet-x-bookmarks.bundle.json b/x-bookmarks/published/applet-x-bookmarks.bundle.json new file mode 100644 index 0000000..27dd909 --- /dev/null +++ b/x-bookmarks/published/applet-x-bookmarks.bundle.json @@ -0,0 +1 @@ +{"envelope":1,"bundle":{"format":3,"compat":{"manifestSchema":6,"bundleFormat":3,"protocol":1,"adapterApi":1,"sdk":"0.0.0","tools":"0.0.0","builtAt":"2026-11-09T11:21:14Z"},"manifest":{"schemaVersion":6,"id":"x-bookmarks","name":"X","origins":["https://x.com"],"foreground":{"entry":"src/main.tsx","screens":["home","explore","notifications","saved","post","profile","media","account","categories","save","manage"]},"adapter":"src/adapter.ts","contexts":[{"id":"primary","startUrl":"https://x.com/home"},{"id":"explore","startUrl":"https://x.com/explore"},{"id":"account","startUrl":"https://x.com/settings/account"}],"routes":[{"id":"home","pattern":"/home","page":"timeline","screen":"home","context":"primary"},{"id":"notifications","pattern":"/notifications","page":"timeline","screen":"notifications","context":"primary"},{"id":"bookmarks","pattern":"/i/history","page":"timeline","screen":"saved","context":"primary"},{"id":"own-likes","pattern":"/i/history/likes","page":"timeline","screen":"saved","context":"primary"},{"id":"bookmarks-alias","pattern":"/i/bookmarks","page":"timeline","screen":"saved","context":"primary"},{"id":"explore","pattern":"/explore/*","page":"explore","screen":"explore","context":"explore"},{"id":"search","pattern":"/search","query":["q"],"page":"explore","screen":"explore","context":"explore"},{"id":"hashtag","pattern":"/hashtag/:tag","page":"explore","screen":"explore","context":"explore"},{"id":"account","pattern":"/settings/account","page":"account","screen":"account","context":"account"},{"id":"photo","pattern":"/:handle/status/:id/photo/:index","page":"media","screen":"media"},{"id":"post","pattern":"/:handle/status/:id","page":"post","screen":"post"},{"id":"likes","pattern":"/:handle/likes","page":"timeline","screen":"saved"},{"id":"replies","pattern":"/:handle/with_replies","page":"profile","screen":"profile"},{"id":"profile-media","pattern":"/:handle/media","page":"profile","screen":"profile"},{"id":"profile","pattern":"/:handle","page":"profile","screen":"profile"}],"capabilities":{"storage":true,"services":[{"id":"bookmarks","config":"backend/service.json"}]},"shell":{"accent":"#1d9bf0"}},"files":[{"path":"adapter.js","sha256":"6919c36aefa790f8a6dba84682ce9630a451098181856cac4600503e4e8ec540"},{"path":"assets/x.png","sha256":"7b11fa53318a4ae13d8fe37d7720c435209990edd274e39ff7111d068ef44d66"},{"path":"foreground.css","sha256":"57538bd3fd841af3d98f7954bd826e4c1e408cfef647dba0ee4ca8badf9e0ca9"},{"path":"foreground.js","sha256":"33ff4e5715c2bddbbb88aec97fbaca57bac2b034c2de8db7ba03ecce1183836e"},{"path":"index.html","sha256":"f5ba0d8e362f8a300a7c903ef44798981b18c35394edde0de326012f1cb2bad5"}]},"entries":[{"path":"adapter.js","encoding":"utf8","content":"(()=>{var j={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1};var At=/^:[A-Za-z][A-Za-z0-9_]*$/,Et=/^[A-Za-z0-9_.~@-]+$/,me=new Map;function It(e){if(me.has(e))return me.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),r=n.at(-1)===\"*\";r&&n.pop();let i=[],o=!0;for(let s of n)At.test(s)?i.push({param:s.slice(1)}):Et.test(s)&&s!==\".\"&&s!==\"..\"?i.push({literal:s}):o=!1;o&&(t={segments:i,rest:r})}return me.set(e,t),t}function ye(e){try{return new URL(e).href}catch{return null}}function we(e,t){let n=Tt(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let r;try{r=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}r.at(-1)===\"\"&&r.pop();for(let i of e.routes){let o=It(i.pattern);if(!o)continue;let s=St(o,r);if(!s||!(i.query??[]).every(u=>n.searchParams.has(u)))continue;for(let u of i.query??[])s[u]=n.searchParams.get(u);let c={kind:\"route\",routeId:i.id,page:i.page,screen:i.screen,params:s};return i.context!==void 0&&(c.context=i.context),c}return{kind:\"website\",url:t}}function Tt(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function St(e,t){if(e.rest?t.length{let i=null,o=!1,s=1,c=new Map,u=new Map,d={get bound(){return i},get retired(){return o},request(k,h={}){if(o)return Promise.reject(new O(\"RETIRED\",\"This page was closed\"));let v=s++;return new Promise((N,D)=>{let L=setTimeout(()=>{c.delete(v),D(new O(\"DEADLINE\",`${k} did not answer in time`))},i.limits.rpcDeadlineMs+Ot);c.set(v,{resolve:N,reject:D,timer:L}),e.postMessage(JSON.stringify({type:\"request\",documentId:i.documentId,requestId:v,method:k,params:h}))})},on(k,h){let v=u.get(k);return v||u.set(k,v=new Set),v.add(h),()=>{v.delete(h)}}};function f(){o=!0;for(let k of c.values())clearTimeout(k.timer),k.reject(new O(\"RETIRED\",\"This page was closed\"));c.clear()}function g(k,h){for(let v of[...u.get(k)??[]])try{v(h)}catch(N){console.error(`Genesis ${k} handler failed`,N)}}e.addEventListener(\"message\",k=>{if(o||typeof k.data!=\"string\")return;let h;try{h=JSON.parse(k.data)}catch{return}if(h?.type===\"refused\"&&!i){o=!0,r(new O(h.error?.code??\"PROTOCOL_MISMATCH\",h.error?.message??\"The host refused this page\"));return}if(h?.type===\"bound\"){if(i)return;i=h,n(d);return}if(!(!i||h?.documentId!==i.documentId))if(h.type===\"response\"){let v=c.get(h.requestId);if(!v)return;c.delete(h.requestId),clearTimeout(v.timer),h.error?v.reject(new O(h.error.code,h.error.message)):v.resolve(h.result??null)}else h.type===\"event\"&&(h.name===\"retired\"?(f(),g(\"retired\",{})):g(h.name,h.data))}),addEventListener(\"pagehide\",()=>{o||(g(\"pagehide\",{}),f())});let y={type:\"hello\",protocol:j.protocol,url:t};e.postMessage(JSON.stringify(y))})}var Nt=100;function Mt(e){let t=new Map,n=Promise.resolve();return{act(r){let i={request:r,arrived:Date.now(),view:e.view(),cancelled:!1,dispatched:!1,stopped:!1};t.set(r.actionId,i),n=n.then(()=>_t(e,i)).catch(o=>{console.error(\"Genesis action failed\",o)}).finally(()=>{t.delete(r.actionId)})},cancel(r){let i=t.get(r);i&&!i.dispatched&&(i.cancelled=!0)},retire(){for(let r of t.values())r.stopped=!0}}}async function _t(e,t){let{connection:n,limits:r}=e,{actionId:i}=t.request,o,s=(E,T,C)=>{if(t.stopped)return Promise.resolve();let M={actionId:i,state:E};return C&&(M.navigating=!0),C&&o&&(M.expect=o),T&&(M.result=T),n.request(\"context.actionResult\",M).then(()=>{},()=>{})},c=(E,T,C)=>{let M={outcome:\"failed\",code:E,message:T};return C!==void 0&&Object.assign(M,{completedSteps:C,partial:C>0}),s(\"failed\",M)},u=()=>s(\"cancelled\",{outcome:\"cancelled\"});if(t.stopped)return;if(t.cancelled)return u();if((t.request.view??t.view)!==t.view||e.view()!==t.view)return c(\"CONTEXT_REPLACED\",\"The page the action was for has been replaced\");let d=e.find(t.request);if(\"error\"in d)return c(d.error.code,d.error.message);let f=d.element();if(f===void 0)return c(\"TARGET_NOT_FOUND\",\"The item is no longer on the page\");let g;try{g=d.action(f,t.request.args)}catch(E){return c(\"INVALID_STEPS\",je(E))}if(typeof g?.then==\"function\")return c(\"INVALID_STEPS\",\"An action must return its steps synchronously\");if(g&&\"satisfied\"in g&&g.satisfied===!0)return s(\"observed\",{outcome:\"observed\",noop:!0});let y=Rt(g);if(y)return c(\"INVALID_STEPS\",y);let{steps:k,until:h,deadlineMs:v}=g;o=g.expect;let N=g.navigates===!0||Ze(k.at(-1)),D=t.arrived+(v??r.actionTimeoutMs),L=0,W=E=>(t.dispatched=!0,s(\"dispatched\",void 0,E)),Q=n.on(\"pagehide\",()=>{!t.dispatched&&!t.stopped&&L>0&&W(!0),t.stopped=!0}),ee=()=>t.stopped||t.cancelled;try{for(let[E,T]of k.entries()){if(t.stopped)return;if(t.cancelled)return u();if(Date.now()>=D)return c(\"DEADLINE\",\"The action did not finish in time\",L);if(E>0&&Fe(k[E-1])&&d.element()===void 0)return c(\"TARGET_NOT_FOUND\",\"The item left the page during the action\",L);if(N&&E===k.length-1&&!Fe(T)){if(be(T),await W(!0),t.stopped)return;be(T)();return}await Pt(T,D,ee),L++}if(t.stopped)return;if(t.cancelled)return u();if(await W(N),N)return;if(h!==void 0){let E=typeof h==\"string\"?()=>document.querySelector(h)!==null:()=>h(document)===!0;try{await ve(E,D-Date.now(),\"the action to take effect\",()=>t.stopped)}catch{return s(\"failed\",{outcome:\"unknown\",code:\"DEADLINE\",message:\"The page did not show the action's effect in time\",completedSteps:L,partial:L>0})}}if(t.stopped)return;e.flush(),await s(\"observed\",{outcome:\"observed\"})}catch(E){let T=E instanceof O?E.code:\"INVALID_ARGUMENT\";return c(T,je(E),L)}finally{Q()}}function Rt(e){if(typeof e!=\"object\"||e===null)return\"An action must return { satisfied: true } or { steps }\";let{steps:t,until:n}=e;if(!Array.isArray(t))return\"An action must return { satisfied: true } or { steps }\";for(let[r,i]of t.entries()){let o=Lt(i);if(o)return`Step ${r}: ${o}`;if(Ze(i)&&r!==t.length-1)return\"A navigate or submit step must be the last step\"}return n!==void 0&&typeof n!=\"string\"&&typeof n!=\"function\"?\"until must be a selector or a function\":null}function Lt(e){if(typeof e!=\"object\"||e===null)return\"must be an object\";let t=e,n=r=>typeof r==\"string\"&&r!==\"\";if(\"click\"in t)return n(t.click)?null:\"click needs a selector\";if(\"fill\"in t)return n(t.fill)&&typeof t.value==\"string\"?null:\"fill needs a selector and a string value\";if(\"submit\"in t)return n(t.submit)?null:\"submit needs a selector\";if(\"navigate\"in t)return n(t.navigate)?null:\"navigate needs a URL\";if(\"waitFor\"in t||\"waitForUrl\"in t)return n(t.waitFor??t.waitForUrl)&&typeof t.timeoutMs==\"number\"?null:\"a wait needs a selector or pattern and timeoutMs\";if(\"scroll\"in t){let r=t.scroll;return r&&n(r.target)&&(r.to===\"end\"||typeof r.to==\"number\")?null:\"scroll needs a target and to\"}return\"unknown step\"}var Ze=e=>e!==void 0&&(\"navigate\"in e||\"submit\"in e),Fe=e=>\"waitFor\"in e||\"waitForUrl\"in e,je=e=>String(e?.message??e);function te(e){let t=document.querySelector(e);if(!t)throw new O(\"NOT_FOUND\",`Nothing matches ${e}`);return t}async function Pt(e,t,n){let r=()=>Math.max(0,t-Date.now());if(\"waitFor\"in e)await ve(()=>document.querySelector(e.waitFor)!==null,Math.min(e.timeoutMs,r()),e.waitFor,n);else if(\"waitForUrl\"in e){let i=new RegExp(e.waitForUrl);await ve(()=>i.test(location.href),Math.min(e.timeoutMs,r()),e.waitForUrl,n)}else be(e)()}function be(e){if(\"click\"in e){let t=te(e.click);return()=>t.click()}if(\"fill\"in e){let t=te(e.fill);return()=>$t(t,e.value)}if(\"submit\"in e){let t=te(e.submit),n=t instanceof HTMLFormElement?t:t.closest(\"form\");if(!n)throw new O(\"NOT_FOUND\",`${e.submit} is not in a form`);let r=t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t:void 0;return()=>n.requestSubmit(r)}if(\"navigate\"in e){let t=e.navigate;return()=>location.assign(t)}if(\"scroll\"in e){let{target:t,to:n}=e.scroll,r=t===\"window\"?document.scrollingElement??document.documentElement:te(t);return()=>{r.scrollTop=n===\"end\"?r.scrollHeight:n}}throw new O(\"INVALID_STEPS\",\"A wait step does not run on its own\")}function $t(e,t){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new O(\"INVALID_STEPS\",\"fill needs an input or textarea\");let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(n,\"value\")?.set?.call(e,t),e.dispatchEvent(new Event(\"input\",{bubbles:!0})),e.dispatchEvent(new Event(\"change\",{bubbles:!0}))}function ve(e,t,n,r){let i=Date.now()+t;return new Promise((o,s)=>{let c=()=>{try{return e()}catch{return!1}},u=()=>{r()||c()?o():Date.now()>=i?s(new O(\"DEADLINE\",`Timed out waiting for ${n}`)):setTimeout(u,Nt)};u()})}var He=new WeakMap;function Ve(e){let t=He.get(e);return t===void 0&&He.set(e,t=JSON.stringify(e)),t}function Ae(e,t){return e===t?!0:e!==null&&t!==null&&Ve(e)===Ve(t)}function re(e,t){return e?.code===t?.code&&e?.message===t?.message}function Dt(e,t){if(e.kind!==t.kind)return{kind:\"replace\",region:t};if(t.kind===\"single\"){let f=e;if(Ae(f.record,t.record)&&f.status===t.status&&re(f.error,t.error))return null;let g={kind:\"single\",record:t.record};return f.status!==t.status&&(g.status=t.status),re(f.error,t.error)||(g.error=t.error??null),g}let n=e;if(!!n.ephemeral!=!!t.ephemeral||t.ephemeral)return Ct(n,t)?null:{kind:\"replace\",region:t};let r=new Map(n.items.map(f=>[f.key,f])),i=new Set,o=[];for(let f of t.items){i.add(f.key);let g=r.get(f.key);(!g||!Ae(g,f))&&o.push(f)}let s=n.items.filter(f=>!i.has(f.key)).map(f=>f.key),c=t.items.map(f=>f.key),u=c.length!==n.items.length||c.some((f,g)=>n.items[g].key!==f),d={kind:\"collection\"};return o.length&&(d.upsert=o),s.length&&(d.remove=s),u&&(d.order=c),n.complete!==t.complete&&(d.complete=t.complete),n.status!==t.status&&(d.status=t.status),re(n.error,t.error)||(d.error=t.error??null),Object.keys(d).length>1?d:null}function Ct(e,t){return e.complete===t.complete&&e.status===t.status&&re(e.error,t.error)&&!!e.ephemeral==!!t.ephemeral&&e.items.length===t.items.length&&e.items.every((n,r)=>Ae(n,t.items[r]))}function Ut(e,t,n=1/0){let r=e.slice(),i=s=>r.findIndex(c=>c.key===s),o=-1;for(let[s,c]of t.entries()){let u=i(c.key);if(u!==-1){r[u]=c,o=u;continue}let d=o+1;o===-1&&(d=t.slice(s+1).map(g=>i(g.key)).find(g=>g!==-1)??r.length),r.splice(d,0,c),o=d}return r.length>n?Xe(r,new Set(t.map(s=>s.key)),n):r}function Xe(e,t,n){if(e.length<=n)return e;let r=-1,i=0;for(let[c,u]of e.entries())t.has(u.key)&&(r===-1&&(r=c),i=c);r===-1&&(r=0);let o=Math.max(n,i-r+1),s=Math.min(Math.max(0,Math.floor((r+i+1-o)/2)),e.length-o);return e.slice(s,s+o)}function qt(e){return new Set(e).size===e.length?{keys:e,ephemeral:!1}:{keys:e.map((t,n)=>String(n)),ephemeral:!0}}function Gt(e,t,n){let r=new Map,i=o=>{let s=r.get(o);return s||r.set(o,s={keys:new Set,whole:!1,membership:!1,resolve:!1}),s};for(let[o,s]of Object.entries(e)){let c=t.some(u=>u.kind===\"childList\");if(!s.root){c&&(i(o).resolve=!0);continue}if(!ke(s.root,n)){i(o).resolve=!0;continue}(s.dependsOn.some(u=>!ke(u,n))||s.dependsOnMissing&&c)&&(i(o).whole=!0);for(let u of t){if(u.kind===\"field\"&&!s.fields||u.kind===\"resize\"&&!s.measure)continue;u.removed&&ke(s.root,u.target)&&(i(o).whole=!0);let d=Ye(s,u.target);d.dependent&&(i(o).whole=!0),d.inRoot&&(u.kind===\"childList\"&&(i(o).membership=!0),d.key===void 0?i(o).whole=!0:i(o).keys.add(d.key))}}return r}function Bt(e,t){let n=Ye(e,t);return n.inRoot||n.dependent}function Ye(e,t){let n,r=!1,i=!1;for(let o=t;o;o=o.parentNode)n??=e.items.get(o),o===e.root&&(r=!0),e.dependsOn.includes(o)&&(i=!0);return n!==void 0&&(r=!0),{key:n,inRoot:r,dependent:i}}function ke(e,t){for(let n=e;n;n=n.parentNode)if(n===t)return!0;return!1}function Ft(e){let t=new MutationObserver(o=>{let s=[];for(let c of o){s.push({target:c.target,kind:c.type});for(let u of c.removedNodes)s.push({target:u,kind:\"childList\",removed:!0})}e(s)});t.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let n=o=>{o.target instanceof Node&&e([{target:o.target,kind:\"field\"}])};document.addEventListener(\"input\",n,!0),document.addEventListener(\"change\",n,!0);let r=new WeakMap,i=typeof ResizeObserver==\"function\"?new ResizeObserver(o=>{let s=[];for(let c of o){let u=`${c.contentRect.width}x${c.contentRect.height}`,d=r.get(c.target);r.set(c.target,u),d!==void 0&&d!==u&&s.push({target:c.target,kind:\"resize\"})}s.length&&e(s)}):null;return{measure(o){if(i){i.disconnect();for(let s of o)i.observe(s)}},disconnect(){t.disconnect(),i?.disconnect(),document.removeEventListener(\"input\",n,!0),document.removeEventListener(\"change\",n,!0)}}}function jt(e){for(let t of[\"pushState\",\"replaceState\"]){let n=History.prototype[t];History.prototype[t]=function(...r){let i=n.apply(this,r);try{e()}catch(o){console.error(\"Genesis navigation handler failed\",o)}return i}}addEventListener(\"popstate\",e),addEventListener(\"hashchange\",e)}var Ht=new TextEncoder,ne=e=>Ht.encode(JSON.stringify(e)).length,Vt=class{constructor(e,t,n=()=>null){this.send=e,this.limits=t,this.shrink=n}send;limits;shrink;epoch=0;seq=0;last=null;page(e){let t={...e,epoch:++this.epoch};for(;ne(t)>this.limits.pageMaxBytes;){let n=this.shrink(t);if(!n){t={...t,status:\"error\",error:{code:\"PAGE_TOO_LARGE\",message:\"The page is too large to show\"},regions:{}};break}t={...n,epoch:t.epoch}}this.seq=0,this.last=t,this.post({page:t})}update(e){let t=this.last;if(!t||!zt(t,e))return this.page(e);let n={};for(let[o,s]of Object.entries(e.regions)){let c=Dt(t.regions[o],s);c&&(n[o]=c)}let r=e.account!==void 0&&e.account!==t.account;if(!r&&Object.keys(n).length===0)return;let i=this.split(n);if(r&&(i[i.length-1].account=e.account),i.some(o=>ne(o)>this.limits.patchMaxBytes))return this.page(e);this.last={...e,epoch:this.epoch};for(let o of i)this.post({patch:o})}split(e){let t=[],n={};for(let[u,d]of Object.entries(e)){if(d.kind!==\"collection\"||!d.upsert){n[u]=d;continue}let{upsert:f,...g}=d;for(let y of f)t.push([u,y]);Object.keys(g).length>1&&(n[u]=g)}let r=this.limits.patchMaxBytes-ne(n)-256,i=[],o=[],s=0;for(let u of t){let d=ne(u[1])+1;o.length&&(o.length>=this.limits.patchRecordsMax||s+d>r)&&(i.push(o),o=[],s=0),o.push(u),s+=d}i.push(o);let c=this.last.view;return i.map((u,d)=>{let f={view:c,epoch:this.epoch,base:this.seq,seq:++this.seq,regions:{}};for(let[g,y]of u)(f.regions[g]??={kind:\"collection\",upsert:[]}).upsert.push(y);if(d===i.length-1)for(let[g,y]of Object.entries(n))f.regions[g]={...f.regions[g],...y};return f})}post(e){this.send(e).catch(t=>{let n=t instanceof O?t.code:null;if(n!==\"RETIRED\"){if(\"patch\"in e&&this.last&&e.patch.epoch===this.epoch){let{epoch:r,...i}=this.last;return this.page(i)}if(\"page\"in e&&n===\"PAGE_TOO_LARGE\"&&e.page.status!==\"error\"){let{epoch:r,...i}=e.page;return this.page({...i,status:\"error\",error:{code:n,message:\"The page is too large to show\"},regions:{}})}console.error(\"Genesis could not publish the page\",t)}})}};function zt(e,t){let n=Object.keys(t.regions);return e.view.generation===t.view.generation&&e.view.n===t.view.n&&e.view.url===t.view.url&&e.status===t.status&&e.pageId===t.pageId&&e.routeId===t.routeId&&e.error?.code===t.error?.code&&e.error?.message===t.error?.message&&e.signInUrl===t.signInUrl&&JSON.stringify(e.params)===JSON.stringify(t.params)&&n.length===Object.keys(e.regions).length&&n.every(r=>e.regions[r]?.kind===t.regions[r].kind)}function Kt(e,t,n){let r,i,o=()=>{clearTimeout(r),r=void 0,i=void 0,e()};return{schedule(){let s=Date.now();i??=s,clearTimeout(r),r=setTimeout(o,Math.min(t,Math.max(0,i+n-s)))},now(){r!==void 0&&o()},cancel(){clearTimeout(r),r=void 0,i=void 0}}}var Wt=1e4,ze=!1;function Ee(e){if(typeof window>\"u\"||window.top!==window||ze)return;ze=!0;let t=window,n=t.__genesisBridge;try{delete t.__genesisBridge}catch{t.__genesisBridge=void 0}if(!n)return;let r=null;jt(()=>r?.navigated());let i=()=>Be(n,location.href).then(o=>{r=Jt(o,e)},o=>console.error(\"Genesis could not bind this page\",o));i(),addEventListener(\"pageshow\",o=>{o.persisted&&(r?.stop(),r=null,i())})}function Jt(e,t){let{manifest:n,limits:r,generation:i}=e.bound,o={batches:0,reads:0,lastBatchReads:0,pages:0,patches:0,lastPublishBytes:0,resyncs:0,startedAt:Date.now()},s=!1;s&&(window.__genesisStats=o);let c=new Vt(a=>(s&&(\"page\"in a?o.pages++:o.patches++,o.lastPublishBytes=JSON.stringify(a).length),e.request(\"context.publish\",a)),r,xt),u={generation:i,n:0,url:location.href};if(e.bound.compat.adapterApi!==j.adapterApi){let a=`This applet uses adapter API ${j.adapterApi}; this Genesis uses ${e.bound.compat.adapterApi}`;return console.error(`Genesis: ${a}`),c.page({view:u,pageId:null,routeId:null,params:{},status:\"error\",error:{code:\"PROTOCOL_MISMATCH\",message:a},account:null,regions:{}}),{navigated(){},stop(){}}}let d=!1,f=ye(location.href),g=we(n,location.href),y=D(g),k=null,h=new Map,v=[],N=!1;function D(a){return a.kind===\"route\"?t.pages[a.page]??null:null}function L(){let a=y?.account??t.account;try{let l=a?.(document);return l===void 0&&a?{account:void 0,failed:!1}:{account:typeof l==\"string\"&&l!==\"\"?l:null,failed:!1}}catch(l){return console.error(\"Genesis adapter account failed\",l),{account:void 0,failed:!0}}}function W(){let a=t.signInUrl;try{if(typeof a==\"string\")return new URL(a,n.origins[0]).href;if(typeof a==\"function\")return new URL(a(location.href),location.href).href}catch(l){console.error(\"Genesis adapter signInUrl failed\",l)}return null}function Q({account:a,failed:l}){if(g.kind!==\"route\")return{status:\"unsupported\"};if(!y)return{status:\"error\",error:{code:\"NOT_FOUND\",message:`The adapter declares no page ${g.page}`}};let m;try{m=y.ready(document)===!0}catch(w){return{status:\"error\",error:{code:\"INVALID_ARGUMENT\",message:Je(w)}}}if(y.requiresAccount===!0&&l)return{status:\"loading\"};let p=y.requiresAccount===!0&&a===null;return m?{status:p?\"auth\":\"ready\"}:p&&document.readyState!==\"loading\"?{status:\"auth\"}:{status:\"loading\"}}function ee(a,l){let m={view:u,pageId:g.kind===\"route\"?g.page:null,routeId:g.kind===\"route\"?g.routeId:null,params:g.kind===\"route\"?g.params:{},status:l.status,signInUrl:W(),regions:{}};a!==void 0&&(m.account=a),l.error&&(m.error=l.error);for(let[p,w]of h)m.regions[p]=w.value;return m}function E(a,l,m){let p={name:a,def:l,root:null,items:new WeakMap,elements:new Map,dependsOn:[],dependsOnMissing:!1,value:m?.value??Zt(l)};for(let w of l.dependsOn??[]){let x=[...document.querySelectorAll(w)];x.length===0&&(p.dependsOnMissing=!0),p.dependsOn.push(...x)}return p.root=document.querySelector(l.root),T(p,()=>l.kind===\"collection\"?M(p,l,\"all\"):C(p,l)),p}function T(a,l){try{a.value=l()}catch(m){let p=m instanceof O?m.code:\"INVALID_ARGUMENT\";a.value={...a.value,status:\"error\",error:{code:p,message:`${a.name}: ${Je(m)}`}}}}function C(a,l){let m=a.root;return m?{kind:\"single\",status:\"ready\",record:$e(l,m,l.key?oe(l.key,m):a.name)}:{kind:\"single\",status:\"ready\",record:null}}function M(a,l,m){let p=a.value,w=a.root?[...a.root.querySelectorAll(l.items)]:[],{keys:x,ephemeral:b}=qt(w.map($=>oe(l.key,$))),A=p.ephemeral?new Map:new Map(p.items.map($=>[$.key,$])),_=a.elements;a.elements=new Map;let S=w.map(($,vt)=>{let J=x[vt];a.elements.set(J,$);let qe=A.get(J);return m!==\"all\"&&qe&&!m.has(J)&&_.get(J)===$?qe:Pe(a,l,$,J)}),G={kind:\"collection\",status:\"ready\",items:l.virtualized&&!b&&!p.ephemeral?Ut(p.items,S,r.patchRecordsMax):S,complete:xe(l)};return b&&(G.ephemeral=!0),G}function Pe(a,l,m,p){let w=$e(l,m,p);a.items.set(m,p);for(let x of l.extent?.(m)??[])x&&a.items.set(x,p);return w}function $e(a,l,m){o.reads++;let p=a.read(l);if(typeof p?.then==\"function\")throw new O(\"ASYNC_READ\",\"read must return its data synchronously\");let w={key:m,data:p===void 0?null:p};return a.entity&&(w.entity=a.entity(l)),a.entityType&&(w.entityType=a.entityType),w}function wt(a,l,m){let p=a.value;if(p.ephemeral||p.status===\"error\")return T(a,()=>M(a,l,m));let w=p.items.slice();for(let x of m){let b=a.elements.get(x),A=w.findIndex(S=>S.key===x);if(!(b?.isConnected&&a.root?.contains(b)&&b.matches(l.items))||A===-1||oe(l.key,b)!==x)return T(a,()=>M(a,l,m));try{w[A]=Pe(a,l,b,x)}catch{return T(a,()=>M(a,l,m))}}a.value={...p,items:w,complete:xe(l)}}function kt(a,l){let{def:m}=a;l.resolve||l.whole||m.kind===\"single\"?h.set(a.name,E(a.name,m,a)):l.membership?T(a,()=>M(a,m,l.keys)):wt(a,m,l.keys)}function xt(a){if(a.view.n!==u.n)return null;let l={...a,regions:{...a.regions}},m=!1;for(let[p,w]of Object.entries(a.regions)){let x=h.get(p);if(x?.def.kind!==\"collection\"||!x.def.virtualized||w.kind!==\"collection\"||w.ephemeral)continue;let b=Xe(w.items,new Set(x.elements.keys()),Math.floor(w.items.length*3/4));b.length!==w.items.length&&(l.regions[p]={...w,items:b},x.value===w&&(x.value=l.regions[p]),m=!0)}return m?l:null}function fe(a=!1){if(d)return;v=[],N=!1;let l=L(),{account:m}=l,p=Q(l),w=h;if(h=new Map,p.status===\"ready\")for(let[b,A]of Object.entries(y?.regions??{}))h.set(b,E(b,A,w.get(b)));k=p.status;let x=ee(m,p);a?c.page(x):c.update(x),Ce()}function De(){if(d)return;o.batches++;let a=o.reads,l=v,m=N;v=[],N=!1;let p=L(),{account:w}=p,x=Q(p);if(x.status!==\"ready\"||k!==\"ready\"||m)fe();else{let b={};for(let[A,_]of h)b[A]=Ke(_);for(let[A,_]of Gt(b,l,document))kt(h.get(A),_);for(let A of h.values()){let _=A.value;if(A.def.kind===\"collection\"&&_.kind===\"collection\"&&A.def.more){let S=xe(A.def);S!==_.complete&&(A.value={..._,complete:S})}}c.update(ee(w,x)),Ce()}o.lastBatchReads=o.reads-a}function Ce(){let a=[];for(let l of h.values())l.def.measure&&(l.def.kind===\"single\"?l.root&&a.push(l.root):a.push(...l.elements.values()));Ue.measure(a)}let q=Kt(De,r.publishQuietMs,r.publishMaxDelayMs),Ue=Ft(a=>{if(!d){if(k===\"ready\"&&!N){let l=[...h.values()].map(Ke);v.push(...a.filter(m=>m.kind!==\"attributes\"||l.some(p=>Bt(p,m.target)))),v.length>Wt&&(v=[],N=!0)}q.schedule()}}),pe=Mt({connection:e,limits:r,flush:()=>{q.cancel(),De()},find:bt,view:()=>u.n});function bt(a){let l=(S,G)=>({error:{code:S,message:G}});if(k!==\"ready\"||!y)return l(\"NOT_READY\",\"The page is not ready\");let m=u.n;if(a.region===null){let S=y.actions?.[a.name];return S?{action:S,element:()=>null}:l(\"INVALID_ARGUMENT\",`The page has no action ${a.name}`)}let p=a.region,w=h.get(p);if(!w)return l(\"NOT_FOUND\",`The page has no region ${p}`);let x=w.def.actions?.[a.name];if(!x)return l(\"INVALID_ARGUMENT\",`Region ${p} has no action ${a.name}`);let b=w.def;if(b.kind===\"single\")return{action:x,element:()=>u.n===m?document.querySelector(b.root)??void 0:void 0};if(w.value.ephemeral)return l(\"PRECONDITION_FAILED\",`Region ${p} repeats keys, so its records have no actions`);let A=a.key;if(A===null)return l(\"INVALID_ARGUMENT\",`Action ${a.name} needs a record key`);let _=()=>{if(u.n!==m)return;let S=h.get(p)?.elements.get(A);if(S?.isConnected&&We(b,S)===A)return S;let G=document.querySelector(b.root);return G?[...G.querySelectorAll(b.items)].find($=>We(b,$)===A):void 0};return _()===void 0?l(\"TARGET_NOT_FOUND\",`No ${p} item has key ${A}`):{action:x,element:_}}function ge(a=!0){d||(d=!0,q.cancel(),Ue.disconnect(),a&&pe.retire())}return e.on(\"resync\",()=>{o.resyncs++,q.cancel(),fe(!0)}),e.on(\"act\",a=>pe.act(a)),e.on(\"cancel\",({actionId:a})=>pe.cancel(a)),e.on(\"ping\",()=>{}),e.on(\"retired\",()=>ge()),e.on(\"pagehide\",()=>ge(!1)),document.readyState===\"loading\"&&document.addEventListener(\"DOMContentLoaded\",()=>q.schedule(),{once:!0}),fe(),{navigated(){if(d)return;let a=ye(location.href);a!==f&&(f=a,u={generation:i,n:u.n+1,url:location.href},g=we(n,location.href),y=D(g),k=null,h=new Map,q.cancel(),q.schedule())},stop:()=>ge()}}function Ke(e){return{root:e.root,items:e.items,dependsOn:e.dependsOn,dependsOnMissing:e.dependsOnMissing,fields:e.def.fields===!0,measure:e.def.measure===!0}}function Zt(e){return e.kind===\"collection\"?{kind:\"collection\",status:\"ready\",items:[],complete:!0}:{kind:\"single\",status:\"ready\",record:null}}function xe(e){return e.more?document.querySelector(e.more)===null:!0}function oe(e,t){let n=e(t);if(typeof n!=\"string\"||n===\"\")throw new O(\"INVALID_ARGUMENT\",\"key must return a non-empty string\");return n}function We(e,t){try{return oe(e.key,t)}catch{return null}}function Je(e){return String(e?.message??e)}function V(e){return{...e,kind:\"collection\"}}function z(e){return{...e,kind:\"single\"}}function Ie(e){let t=(o,s)=>{throw new Error(`Adapter ${o} ${s}`)},n=(o,s)=>{o!==void 0&&typeof o!=\"function\"&&t(s,\"must be a function\")},r=(o,s)=>{(typeof o!=\"string\"||o.trim()===\"\")&&t(s,\"must be a CSS selector\")},i=(o,s)=>{if(o!==void 0){H(o)||t(s,\"must be an object of functions\");for(let[c,u]of Object.entries(o))typeof u!=\"function\"&&t(`${s}.${c}`,\"must be a function\")}};H(e)||t(\"definition\",\"must be an object\"),n(e.account,\"account\"),e.signInUrl!==void 0&&typeof e.signInUrl!=\"string\"&&typeof e.signInUrl!=\"function\"&&t(\"signInUrl\",\"must be a path or a function\"),H(e.pages)||t(\"pages\",\"must be an object\");for(let[o,s]of Object.entries(e.pages)){let c=`pages.${o}`;H(s)||t(c,\"must be an object\"),typeof s.ready!=\"function\"&&t(`${c}.ready`,\"must be a function\"),n(s.account,`${c}.account`),i(s.actions,`${c}.actions`),s.regions!==void 0&&!H(s.regions)&&t(`${c}.regions`,\"must be an object\");for(let[u,d]of Object.entries(s.regions??{})){let f=`${c}.regions.${u}`;(!H(d)||d.kind!==\"collection\"&&d.kind!==\"single\")&&t(f,\"must be made with collection() or single()\"),r(d.root,`${f}.root`),typeof d.read!=\"function\"&&t(`${f}.read`,\"must be a function\"),n(d.entity,`${f}.entity`),d.dependsOn!==void 0&&(Array.isArray(d.dependsOn)||t(`${f}.dependsOn`,\"must be an array of selectors\"),d.dependsOn.forEach((g,y)=>r(g,`${f}.dependsOn.${y}`))),i(d.actions,`${f}.actions`),d.kind===\"collection\"?(r(d.items,`${f}.items`),typeof d.key!=\"function\"&&t(`${f}.key`,\"must be a function\"),n(d.extent,`${f}.extent`),d.more!==void 0&&r(d.more,`${f}.more`)):n(d.key,`${f}.key`)}}return e}function H(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var Te=\"https://x.com\";var Z=e=>typeof e==\"string\"&&/^[A-Za-z0-9_]{1,15}$/.test(e);function X(e,t){if(typeof e!=\"string\"||e.length>2048)return null;try{let n=new URL(e,t);return[\"https:\",\"http:\"].includes(n.protocol)&&!n.username&&!n.password?n.href:null}catch{return null}}function U(e){let t=X(e);if(!t)return null;let n=new URL(t);return n.protocol===\"https:\"&&[\"pbs.twimg.com\",\"abs.twimg.com\"].includes(n.hostname)&&!n.port?n.href:null}function B(e){if(typeof e!=\"string\")return null;try{let t=new URL(e,Te),n=/^\\/([A-Za-z0-9_]{1,15})\\/status\\/([0-9]{1,25})$/.exec(t.pathname);return t.origin===Te&&!t.username&&!t.password&&n?{postId:n[2],handle:n[1],url:`${Te}/${n[1]}/status/${n[2]}`}:null}catch{return null}}var R='article[data-testid=\"tweet\"]',se=`${R}, [data-testid=\"notification\"]`;function I(e,t=300){return[...(e??\"\").replace(/\\s+/g,\" \").trim()].slice(0,t).join(\"\")}function ae(e){return(e instanceof HTMLElement?e.innerText:e?.textContent??\"\").split(`\n`).map(n=>I(n,300)).filter(Boolean)}function K(e){let t=5381;for(let n of e)t=t*33+n.charCodeAt(0)>>>0;return t.toString(36)}function tt(e){let t=[...e.querySelectorAll(\"span\")].find(n=>/^Something went wrong/i.test(n.textContent??\"\"));return t&&e.querySelector('[role=\"button\"], button')?I(t.textContent,200):null}var Xt=e=>e.querySelector('[data-testid=\"loginButton\"]')!==null,Yt=(e,t)=>e.closest(R)===t&&!e.parentElement?.closest('div[role=\"link\"]'),P=(e,t)=>[...e.querySelectorAll(t)].filter(n=>Yt(n,e));function Y(e){let t=P(e,\"a[href]\").filter(r=>r.querySelector(\"time\")).map(r=>({link:r,id:B(r.getAttribute(\"href\"))})).filter(r=>r.id!==null),n=t[0];return!n||t.some(r=>r.id.postId!==n.id.postId)?null:{link:n.link,...n.id}}var nt=e=>Y(e)?.postId??null;function ce(e){return e.matches(R)?Y(e)?.postId??`p:${K(I(e.textContent,600))}`:`n:${K(I(e.textContent,600))}`}function Qt(e,t=7e3){let n=[],r=0,i=(s,c)=>{if(r>=t||!s)return;let u=[...s].slice(0,t-r).join(\"\");r+=[...u].length,n.push(c?{text:u,href:c}:{text:u})},o=(s,c)=>{if(s.nodeType===Node.TEXT_NODE)return i(s.textContent??\"\",c);if(!(s instanceof Element))return;if(s.tagName===\"IMG\")return i(s.getAttribute(\"alt\")??\"\",c);if(s.matches(\"script,style,button,svg\"))return;let u=s.tagName===\"A\"?X(s.getAttribute(\"href\"),s.ownerDocument.location.href)??void 0:c;for(let d of s.childNodes)o(d,u)};return e&&o(e),n}var en=e=>e.map(t=>t.text).join(\"\"),ie=e=>I(e?.textContent,20);function Se(e){let t=Y(e);if(!t)return null;let n=t.link.querySelector(\"time\"),r=P(e,'[data-testid=\"tweetText\"]')[0]??null,i=r?Qt(r):[],o=r?.textContent??\"\",s=P(e,'[data-testid=\"User-Name\"] a')[0],c=y=>P(e,`[data-testid=\"${y}\"]`)[0],u=P(e,'[data-testid=\"tweetPhoto\"] img').filter(y=>B(y.closest(\"a[href]\")?.getAttribute(\"href\")?.replace(/\\/photo\\/[0-9]+$/,\"\"))?.postId===t.postId).map(y=>U(y.getAttribute(\"src\"))).filter(y=>y!==null).slice(0,4),d=P(e,'[data-testid=\"socialContext\"]')[0],f=[...e.querySelectorAll('div[role=\"link\"]')].find(y=>y.closest(R)===e&&y.querySelector('[data-testid=\"User-Name\"]')),g=null;if(f){let y=ae(f.querySelector('[data-testid=\"User-Name\"]')),k=y.find(h=>h.startsWith(\"@\"))?.slice(1)??null;g={name:y[0]??\"\",handle:Z(k)?k:null,text:I(f.querySelector('[data-testid=\"tweetText\"]')?.textContent,1200),url:B(f.querySelector('a[href*=\"/status/\"]')?.getAttribute(\"href\")?.replace(/\\/(photo|video)\\/[0-9]+$/,\"\"))?.url??null}}return{postId:t.postId,url:t.url,handle:t.handle,name:I(s?.textContent,200)||t.handle,avatar:U(P(e,'[data-testid=\"Tweet-User-Avatar\"] img')[0]?.getAttribute(\"src\")),verified:P(e,'[data-testid=\"User-Name\"] [data-testid=\"icon-verified\"]').length>0,time:I(n?.textContent,60),dateTime:n?.getAttribute(\"datetime\")?.slice(0,40)??null,parts:i,textState:o?en(i).lengthB(r.getAttribute(\"href\"))).find(Boolean);return{id:K(t),text:t,url:n?.url??null,avatars:[...e.querySelectorAll(\"img\")].map(r=>U(r.getAttribute(\"src\"))).filter(r=>r!==null).slice(0,4)}}function rt(e){if(e.matches(R)){let n=Se(e);return n&&{kind:\"post\",post:n}}let t=tn(e);return t&&{kind:\"notice\",notice:t}}function ot(e){return it(e)??`u:${K(I(e.textContent,300))}`}function it(e){return[...e.querySelectorAll(\"a[href]\")].map(t=>/^\\/([A-Za-z0-9_]{1,15})$/.exec(t.getAttribute(\"href\")??\"\")?.[1]).find(Z)??null}function st(e){let t=it(e);if(!t)return null;let n=ae(e),r=n.findIndex(i=>i.toLowerCase()===`@${t.toLowerCase()}`);return{handle:t,name:(r>0?n[0]:null)??t,avatar:U(e.querySelector(\"img\")?.getAttribute(\"src\")),verified:e.querySelector('[data-testid=\"icon-verified\"]')!==null,description:I(n.slice(r+1).filter(i=>!/^(Follow|Following|Follows you|Unfollow)$/.test(i)).join(\" \"),300)}}var Qe=e=>/\\b(posts?|tweets?)$/i.test(e)||/^[0-9][0-9.,]*[KMB]?$/i.test(e),nn=e=>e.length<=80&&/trending|^[^·]{1,40} · [^·]{1,40}$|^(sports|politics|entertainment|news|technology|business|music|gaming)$/i.test(e);function Oe(e){let t=ae(e).filter(o=>o!==\"\\xB7\"),n=t.find(nn)??\"\",r=t.filter(o=>o!==n),i=I(r.find(o=>!Qe(o))??\"\",200);return i?{context:n,name:i,meta:r.filter(o=>o!==i&&Qe(o)).join(\" \\xB7 \").slice(0,120)}:null}function Ne(e){let t=e.ownerDocument.location.pathname.split(\"/\")[1]??\"\",n=e.querySelector('[data-testid=\"UserName\"]'),r=ae(n);if(!n||!r.some(o=>o.toLowerCase()===`@${t.toLowerCase()}`))return null;let i=o=>U(e.querySelector(`a[href=\"/${t}/${o}\" i] img`)?.getAttribute(\"src\"));return{handle:t,name:r[0],verified:n.querySelector('[data-testid=\"icon-verified\"]')!==null,avatar:i(\"photo\"),banner:i(\"header_photo\"),description:I(e.querySelector('[data-testid=\"UserDescription\"]')?.textContent,1e3),details:I([...e.querySelector('[data-testid=\"UserProfileHeader_Items\"]')?.children??[]].map(o=>o.textContent?.trim()).filter(Boolean).join(\" \\xB7 \"),300),links:[...e.querySelectorAll(\"a[href]\")].filter(o=>new RegExp(`^/${t}/(following|followers|verified_followers)$`,\"i\").test(o.getAttribute(\"href\")??\"\")).slice(0,2).flatMap(o=>{let s=X(o.getAttribute(\"href\"),e.ownerDocument.location.href);return s?[{label:I(o.textContent,60),url:s}]:[]}),own:e.querySelector('[data-testid=\"editProfileButton\"]')!==null}}function at(e){let t=e.ownerDocument.defaultView?.innerWidth??0,n=[...e.querySelectorAll(\"img\")].filter(s=>{let c=U(s.getAttribute(\"src\"));return c&&new URL(c).pathname.startsWith(\"/media/\")}),r=t/2,i=n.find(s=>{let c=s.getBoundingClientRect();return c.width>0&&c.left<=r&&c.right>=r});if(!i)return null;let o=new URL(U(i.getAttribute(\"src\")));return o.searchParams.has(\"name\")&&o.searchParams.set(\"name\",\"large\"),{image:o.href,hasNext:n.some(s=>s.getBoundingClientRect().left>=t-2)}}var et=\"window.__INITIAL_STATE__=\";function rn(e){let t=[...e.scripts].find(n=>n.textContent?.startsWith(et));if(!t)return null;try{let n=t.textContent??\"\",r=n.indexOf(\";window.\"),i=JSON.parse(n.slice(et.length,r<0?void 0:r)),o=i.entities?.users?.entities?.[i.session?.user_id];return Z(o?.screen_name)&&typeof o.name==\"string\"?{handle:o.screen_name.toLowerCase(),name:o.name}:null}catch{return null}}function Me(e){let t=e.querySelector('[data-testid=\"AppTabBar_Profile_Link\"]')?.getAttribute(\"href\")?.match(/^\\/([A-Za-z0-9_]{1,15})$/)?.[1],n=rn(e);if(Z(t))return{handle:t.toLowerCase(),name:n?.handle===t.toLowerCase()?n.name:null};if(!n)return null;let r=e.querySelector('[data-testid=\"DashButton_ProfileIcon_Link\"]');return r?r.getAttribute(\"aria-label\")===`Profile menu ${n.name}`?n:null:e.querySelector('[data-testid=\"AppTabBar_Notifications_Link\"]')?n:null}function le(e){if(e.readyState!==\"loading\")return Xt(e)?null:Me(e)?.handle??void 0}function _e(e,t,n){if(typeof t!=\"boolean\")throw new Error(\"Needs a boolean\");if(!e?.matches(R))throw new Error(\"Not a post\");let r=Y(e);if(!r)throw new Error(\"This post has no clear identity\");let i=c=>P(c,`[data-testid=\"${n.off}\"]`).length>0;if(i(e)===t)return{satisfied:!0};let o=`a[href$=\"/status/${r.postId}\"] time`,s=`${R}:has(${o}):not(:has(div[role=\"link\"] ${o}))`;if(!P(e,`[data-testid=\"${t?n.on:n.off}\"]`).length)throw new Error(\"X shows no control for this here\");return{steps:[{click:`${s} [data-testid=\"${t?n.on:n.off}\"]`}],until:c=>{let u=[...c.querySelectorAll(R)].find(d=>Y(d)?.postId===r.postId);return u!==void 0&&i(u)===t}}}var F=\"main\",lt='[data-testid=\"emptyState\"]';function ue(e,t){if(e.readyState===\"loading\")return!1;let n=e.querySelector(F);if(!n)return!1;let r=tt(n);if(r)throw new Error(r);return n.querySelector(lt)?!0:typeof t==\"string\"?n.querySelector(t)!==null:t(n)}var ut={setLiked:(e,t)=>_e(e,t?.liked,{on:\"like\",off:\"unlike\"}),setBookmarked:(e,t)=>_e(e,t?.bookmarked,{on:\"bookmark\",off:\"removeBookmark\"})},Re=(e=se)=>V({root:F,items:e,key:ce,entityType:\"post\",read:rt,virtualized:!0,actions:ut}),de=z({root:lt,read:e=>I(e.textContent,200)||null}),ct=e=>{let t=e.querySelectorAll(`${F} :is(${se})`);return t.length?ce(t[t.length-1]):null};function Le(){let e=ct(document);return{steps:[{scroll:{target:\"window\",to:\"end\"}}],until:t=>ct(t)!==e,deadlineMs:1e4}}var dt={ready:e=>ue(e,se),requiresAccount:!0,regions:{timeline:Re(),empty:de},actions:{loadMore:Le}},ft={ready:e=>{let t=B(e.location.href)?.postId;return ue(e,n=>[...n.querySelectorAll(R)].some(r=>nt(r)===t))},regions:{thread:Re(R),empty:de}},on=new Set([\"home\",\"explore\",\"notifications\",\"messages\",\"settings\",\"i\",\"login\",\"logout\",\"signup\",\"tos\",\"privacy\",\"about\",\"download\",\"compose\",\"search\",\"jobs\",\"communities\",\"premium\",\"lists\",\"bookmarks\",\"account\"]),pt={ready:e=>{let t=e.location.pathname.split(\"/\")[1]??\"\";if(on.has(t.toLowerCase())||!/^[A-Za-z0-9_]{1,15}$/.test(t))throw new Error(\"This X page isn't a profile\");return ue(e,n=>Ne(n)!==null)},regions:{header:z({root:F,read:Ne}),posts:Re(),empty:de},actions:{loadMore:Le}};function sn(e){let t=e.querySelector(\"a[href]\")?.getAttribute(\"href\")??e.closest(\"a[href]\")?.getAttribute(\"href\"),n=Oe(e)?.name??I(e.textContent,300);return`t:${K(t??n)}`}var gt={ready:e=>ue(e,`${R}, [data-testid=\"trend\"], [data-testid=\"UserCell\"]`),regions:{trends:V({root:F,items:'[data-testid=\"trend\"]',key:sn,read:Oe}),people:V({root:F,items:'[data-testid=\"UserCell\"]',key:ot,read:st}),results:V({root:F,items:R,key:ce,entityType:\"post\",read:e=>Se(e),virtualized:!0,actions:ut}),empty:de},actions:{loadMore:Le}},mt={ready:e=>e.readyState!==\"loading\"&&e.querySelector('[data-testid=\"swipe-to-dismiss\"]')!==null,regions:{photos:z({root:'[data-testid=\"swipe-to-dismiss\"]',read:at,measure:!0})}},ht={ready:e=>le(e)!==void 0,requiresAccount:!0,regions:{handle:z({root:\"html\",read:e=>Me(e.ownerDocument)})}};var yt=Ie({account:le,signInUrl:\"/i/flow/login\",pages:{timeline:dt,post:ft,profile:pt,explore:gt,media:mt,account:ht}});Ee(yt);})();\n"},{"path":"assets/x.png","encoding":"base64","content":"iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAB6UlEQVR4nO3cQa7CMBRDUXbAhAn7XyisANSkyfN1nit59qW6Pgwo+u3j+Xp/El0e6gLdE4AA9E4AAtA7AQhA7wQgAL0TgAD0TgAC0DsBCEDvBCAAvROA0wD+HeqLXXU9AQjAHIAbQsU1lAO4IFR1lwDQESo7b/kW5IxQ3XXb11BHBEXHrfcBTgiqbttvxBwQlJ1K7oTJCOouAegAQEUgdCj9MY6EQBi/HICCQBlfAqBGII0vA1Ah0MaXAlQjEMeXA1QhUMcPQAD2I5DHxwDsQqCPjwJYjeAwPg5gFYLL+EiAuwhO42MBZhHcxkcDjCI4jo8HuIrw6+/U3dsAuH76LQBmEdSdjwIYRVB3PRJgBEHd81iAExGOBXBBsAKYOdSdjwG4c6i7BwDQ3xrg37DuCHiAK4M6I6ABRoZ0RcACzAzoiIAEuDOcGwIOYMVgTggogJVDuSAEIADrx3dCQADsHIaOIAeoGISMgPz39MpzqRFwD2gozqlEQD2ipDy3CgHzkB6hg6ITAqC6w1WE4wAIn/4RgIpu8iflFeOTEKTvilCOT0GQva5GPTwFQfLCJvXgJITyV5aph6YhlL60Tz3wKgQ8QBIAmwQgAL0TgAD0TgAC0DsBCEDvBCAAvROAAPROAALQOwEIQO98ASr29V3LMWMvAAAAAElFTkSuQmCC"},{"path":"foreground.css","encoding":"utf8","content":":root{color-scheme:light;--paper: #ffffff;--ink: #0f1419;--muted: #536471;--line: #eff3f4;--control-line: #cfd9de;--wash: #f7f9f9;--accent: #1d9bf0;--link: #0078b8;--accent-wash: #e8f5fd;--danger: #b42336;--like: #f91880;--repost: #00875a;--skeleton: #eff3f4;--font: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;--edge: 16px;--radius: 16px;--tabs: 64px}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--paper: #000000;--ink: #e7e9ea;--muted: #71767b;--line: #2f3336;--control-line: #536471;--wash: #16181c;--link: #1d9bf0;--accent-wash: #071e2d;--danger: #ff9aa5;--repost: #00ba7c;--skeleton: #202327}}@media(prefers-contrast:more){:root{--line: var(--muted);--control-line: var(--muted)}}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}html,body{background:var(--paper);color:var(--ink);font:15px/20px var(--font)}button,input,textarea{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}a{color:var(--link);text-decoration:none}a,button{overflow-wrap:anywhere}button{cursor:pointer}button:disabled{opacity:.5;cursor:default}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}svg.filled{fill:currentColor}.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.app{display:flex;flex-direction:column;height:100%}.content{flex:1;min-height:0}.screen{height:100%;overflow-y:auto;padding:8px var(--edge) 32px}.screen:before{content:\"\";float:right;width:44px;height:44px}.screen-title{font-size:20px;line-height:24px;font-weight:800;margin:12px 0 8px;overflow-wrap:anywhere}.section-title{font-size:17px;font-weight:800;margin:20px 0 4px}.post-meta{margin:0;color:var(--muted)}.grow{flex:1;min-width:0}.tabs{display:flex;flex:none;min-height:var(--tabs);background:var(--paper);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:56px;border:0;background:none;color:var(--muted);font-size:11px;line-height:13px}.tab[aria-current=page]{color:var(--ink);font-weight:700}.tab svg{width:24px;height:24px}.viewing .tabs{display:none}.primary,.secondary,.danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 18px;margin:8px 8px 0 0;border-radius:999px;font-weight:700}.primary{border:0;background:var(--ink);color:var(--paper)}.secondary{border:1px solid var(--control-line);background:var(--paper)}.danger{border:0;background:var(--danger);color:var(--paper)}.secondary svg,.primary svg{width:16px;height:16px}.text-button{min-height:44px;min-width:44px;padding:0 8px;border:0;background:none;color:var(--link);font-weight:700}.danger-text{color:var(--danger)}.icon-button{display:inline-grid;place-items:center;width:48px;height:48px;flex:none;border:0;border-radius:50%;background:none;color:inherit}.more{margin:16px 0 0}input:not([type=checkbox]){width:100%;min-height:44px;padding:10px 14px;border:1px solid var(--control-line);border-radius:999px;background:var(--paper)}input:not([type=checkbox]):focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 1px var(--accent)}.mode-tabs{display:flex;margin:0 calc(-1 * var(--edge));border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none}.mode-tab{flex:1 0 auto;min-height:53px;padding:0 16px;border:0;background:none;color:var(--muted);font-weight:500;position:relative}.mode-tab[aria-current=page]{color:var(--ink);font-weight:700}.mode-tab[aria-current=page]:after{content:\"\";position:absolute;left:50%;bottom:0;width:56px;height:4px;margin-left:-28px;border-radius:2px;background:var(--accent)}.chips{display:flex;gap:8px;overflow-x:auto;margin:4px 0;padding:8px 0;scrollbar-width:none}.chip{flex:none;min-height:36px;padding:0 14px;border:1px solid var(--control-line);border-radius:999px;background:var(--paper);font-weight:600}.chip[aria-pressed=true]{border-color:var(--ink);background:var(--ink);color:var(--paper)}.chip-count{margin-left:4px;opacity:.7;font-weight:400}.search-form{margin:4px 0 8px}.search-field{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border-radius:999px;background:var(--wash);color:var(--muted)}.search-field input,.search-field input:focus{min-height:42px;padding:0;border:0;border-radius:0;background:none;color:var(--ink);box-shadow:none}.search-field svg{width:18px;height:18px}.feed{margin:0 calc(-1 * var(--edge))}.post{padding:12px var(--edge);border-bottom:1px solid var(--line)}.post-context{display:flex;align-items:center;gap:8px;margin:0 0 4px 28px;color:var(--muted);font-size:13px;font-weight:700}.post-context svg{width:16px;height:16px}.post-context a{color:inherit}.post-grid{display:grid;grid-template-columns:40px minmax(0,1fr);gap:12px}.focus .post-grid{grid-template-columns:48px minmax(0,1fr)}.avatar{display:block;border-radius:50%;background:var(--skeleton);object-fit:cover}.avatar-button{padding:0;border:0;background:none;align-self:start;border-radius:50%}.post-body{min-width:0}.post-head{display:flex;align-items:center;flex-wrap:wrap;gap:0 4px;margin:0;min-width:0}.post-name{display:inline-flex;align-items:center;gap:2px;min-width:0;color:var(--ink)}.post-name strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.verified{width:18px;height:18px;fill:var(--accent);stroke:none}.verified .tick{fill:none;stroke:#fff;stroke-width:2}.post-content{cursor:pointer}.post-content.plain{display:block;width:100%;padding:0;border:0;background:none;text-align:left}.post-text{margin:2px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.post-text.large{font-size:20px;line-height:28px;margin-top:12px}.clamp{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}.show-more{color:var(--link)}.photos{display:grid;gap:2px;margin-top:12px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}.photos button{padding:0;border:0;background:var(--skeleton);min-height:0}.photos img{display:block;width:100%;height:100%;object-fit:cover}.photos.n1 img{max-height:510px;height:auto}.photos.n2,.photos.n3,.photos.n4{grid-template-columns:1fr 1fr;aspect-ratio:16 / 9}.photos.n3 button:first-child{grid-row:span 2}.photos.n2 button,.photos.n3 button,.photos.n4 button{overflow:hidden}.video-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;aspect-ratio:16 / 9;margin-top:12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--wash);font-weight:700}.video-tile svg{width:14px;height:14px;vertical-align:-2px}.quote{display:block;width:100%;margin-top:12px;padding:12px;border:1px solid var(--control-line);border-radius:var(--radius);background:none;text-align:left}.quote-text{display:block;margin-top:2px;white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden}.focus-time{padding:16px 0;border-bottom:1px solid var(--line)}.actions-bar{display:flex;justify-content:space-between;margin:4px -8px -4px;max-width:440px}.action{display:inline-flex;align-items:center;gap:4px;min-width:40px;min-height:40px;padding:0 6px;white-space:nowrap;border:0;background:none;color:var(--muted);font-size:13px}.action svg{width:18px;height:18px}.action.liked{color:var(--like)}.action.reposted{color:var(--repost)}.action.bookmarked{color:var(--accent)}.thread .post:not(:last-child){border-bottom:0}.notification{display:flex;flex-direction:column;gap:8px;width:100%;padding:12px var(--edge) 12px 68px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.notice-avatars{display:flex;gap:4px}.notice-text{overflow-wrap:anywhere}.trend,.person{display:flex;flex-direction:column;align-items:flex-start;width:calc(100% + 2 * var(--edge));margin:0 calc(-1 * var(--edge));padding:12px var(--edge);border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.trend strong{font-size:15px}.trend .post-meta{font-size:13px}.person{flex-direction:row;gap:12px}.person-body{display:flex;flex-direction:column;min-width:0}.person-bio{margin-top:4px;overflow-wrap:anywhere}.profile-screen{padding-top:0}.profile-screen:before{display:none}.profile{margin:0 calc(-1 * var(--edge));padding:0 var(--edge) 12px}.banner{margin:0 calc(-1 * var(--edge));aspect-ratio:3 / 1;background:var(--control-line);overflow:hidden}.banner img{display:block;width:100%;height:100%;object-fit:cover}.profile-top{display:flex;align-items:flex-end;justify-content:space-between;margin-top:-40px}.profile-top .avatar{border:4px solid var(--paper);box-sizing:content-box}.profile-name{display:flex;align-items:center;gap:2px;margin:8px 0 0;font-size:20px;line-height:24px;font-weight:800;overflow-wrap:anywhere}.profile .post-text,.profile .post-meta{margin-top:8px}.profile-links{display:flex;flex-wrap:wrap;gap:4px 16px;margin:8px 0 0}.profile-links a{display:inline-flex;align-items:center;min-height:32px}.media-viewer{position:fixed;inset:0;z-index:1;display:flex;flex-direction:column;background:#000;color:#fff}.media-close{position:absolute;top:8px;left:8px;z-index:1;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:#0009;color:#fff}.media-stage{flex:1;min-height:0;display:grid;place-items:center}.media-stage img{max-width:100%;max-height:100%;object-fit:contain}.media-message{margin:0;padding:16px;text-align:center}.media-message .secondary{background:none;color:#fff;border-color:#536471}.media-nav{display:flex;align-items:center;justify-content:center;gap:24px;padding:8px 0 calc(8px + env(safe-area-inset-bottom))}.saved-post .post-head{margin-bottom:2px}.pills{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px}.pill{padding:2px 10px;border-radius:999px;background:var(--accent-wash);color:var(--link);font-size:13px;font-weight:600}.pills .text-button{min-height:36px;margin-left:auto}.category-list{margin-top:8px}.category{padding:8px 0;border-top:1px solid var(--line)}.category-head{display:flex;align-items:center;gap:4px}.card{margin:12px 0;padding:12px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--paper)}.card .post-text{margin-top:4px}.card .post-meta{margin-top:8px;font-size:13px}fieldset{min-width:0}fieldset.card legend{padding:0 4px;font-weight:800}.check{display:flex;align-items:center;gap:12px;min-height:48px}.check input{width:22px;height:22px;accent-color:var(--accent)}.row{display:flex;align-items:center;gap:8px;margin-top:8px}.row .primary,.row .secondary{margin:0}.actions{display:flex;flex-wrap:wrap;align-items:center;margin-top:4px}.notice{margin:24px 0;padding:20px;border:1px solid var(--line);border-radius:var(--radius)}.notice h2{margin:0 0 6px;font-size:20px;line-height:24px;font-weight:800}.notice p{margin:0;color:var(--muted)}.inline-error,.field-error{color:var(--danger)}.status{padding:10px 12px;border-radius:12px;background:var(--wash)}.confirm{margin:12px 0;padding:12px 14px;border:1px solid var(--danger);border-radius:var(--radius)}.confirm p{margin:0}.skeleton{padding-top:8px}.skeleton-row{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}.skeleton-row>div{flex:1}.skeleton-avatar{width:40px;height:40px;flex:none;border-radius:50%;background:var(--skeleton)}.skeleton-row span:not(.skeleton-avatar){display:block;height:12px;border-radius:4px;background:var(--skeleton)}.skeleton-row span+span{width:80%;margin-top:8px}.skeleton-row span+span+span{width:45%}.skeleton.text .skeleton-row{border-bottom:0;padding:8px 0}\n"},{"path":"foreground.js","encoding":"utf8","content":"\"use strict\";(()=>{var h0=Object.create;var Jf=Object.defineProperty;var y0=Object.getOwnPropertyDescriptor;var b0=Object.getOwnPropertyNames;var S0=Object.getPrototypeOf,T0=Object.prototype.hasOwnProperty;var Ft=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var N0=(e,t,n,l)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let a of b0(t))!T0.call(e,a)&&a!==n&&Jf(e,a,{get:()=>t[a],enumerable:!(l=y0(t,a))||l.enumerable});return e};var L=(e,t,n)=>(n=e!=null?h0(S0(e)):{},N0(t||!e||!e.__esModule?Jf(n,\"default\",{value:e,enumerable:!0}):n,e));var Nd=Ft(D=>{\"use strict\";var _c=Symbol.for(\"react.transitional.element\"),Z0=Symbol.for(\"react.portal\"),K0=Symbol.for(\"react.fragment\"),J0=Symbol.for(\"react.strict_mode\"),I0=Symbol.for(\"react.profiler\"),$0=Symbol.for(\"react.consumer\"),F0=Symbol.for(\"react.context\"),W0=Symbol.for(\"react.forward_ref\"),P0=Symbol.for(\"react.suspense\"),ey=Symbol.for(\"react.memo\"),gd=Symbol.for(\"react.lazy\"),ty=Symbol.for(\"react.activity\"),ny=Symbol.for(\"react.view_transition\"),sd=Symbol.iterator;function ly(e){return e===null||typeof e!=\"object\"?null:(e=sd&&e[sd]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var pd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vd=Object.assign,hd={};function Il(e,t,n){this.props=e,this.context=t,this.refs=hd,this.updater=n||pd}Il.prototype.isReactComponent={};Il.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};Il.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function yd(){}yd.prototype=Il.prototype;function Mc(e,t,n){this.props=e,this.context=t,this.refs=hd,this.updater=n||pd}var zc=Mc.prototype=new yd;zc.constructor=Mc;vd(zc,Il.prototype);zc.isPureReactComponent=!0;var fd=Array.isArray;function Ac(){}var oe={H:null,A:null,T:null,S:null},bd=Object.prototype.hasOwnProperty;function wc(e,t,n){var l=n.ref;return{$$typeof:_c,type:e,key:t,ref:l!==void 0?l:null,props:n}}function ay(e,t){return wc(e.type,t,e.props)}function Cc(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===_c}function uy(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(n){return t[n]})}var dd=/\\/+/g;function Oc(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?uy(\"\"+e.key):t.toString(36)}function iy(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(Ac,Ac):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function Jl(e,t,n,l,a){var u=typeof e;(u===\"undefined\"||u===\"boolean\")&&(e=null);var i=!1;if(e===null)i=!0;else switch(u){case\"bigint\":case\"string\":case\"number\":i=!0;break;case\"object\":switch(e.$$typeof){case _c:case Z0:i=!0;break;case gd:return i=e._init,Jl(i(e._payload),t,n,l,a)}}if(i)return a=a(e),i=l===\"\"?\".\"+Oc(e,0):l,fd(a)?(n=\"\",i!=null&&(n=i.replace(dd,\"$&/\")+\"/\"),Jl(a,t,n,\"\",function(f){return f})):a!=null&&(Cc(a)&&(a=ay(a,n+(a.key==null||e&&e.key===a.key?\"\":(\"\"+a.key).replace(dd,\"$&/\")+\"/\")+i)),t.push(a)),1;i=0;var o=l===\"\"?\".\":l+\":\";if(fd(e))for(var c=0;c{\"use strict\";Ed.exports=Nd()});var Dd=Ft(de=>{\"use strict\";function Hc(e,t){var n=e.length;e.push(t);e:for(;0>>1,a=e[l];if(0>>1;lgi(o,n))cgi(f,o)?(e[l]=f,e[c]=n,l=c):(e[l]=o,e[i]=n,l=i);else if(cgi(f,n))e[l]=f,e[c]=n,l=c;else break e}}return t}function gi(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}de.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(xd=performance,de.unstable_now=function(){return xd.now()}):(Rc=Date,Od=Rc.now(),de.unstable_now=function(){return Rc.now()-Od});var xd,Rc,Od,bn=[],qn=[],ry=1,At=null,Ve=3,Lc=!1,tu=!1,nu=!1,qc=!1,Md=typeof setTimeout==\"function\"?setTimeout:null,zd=typeof clearTimeout==\"function\"?clearTimeout:null,Ad=typeof setImmediate<\"u\"?setImmediate:null;function pi(e){for(var t=Wt(qn);t!==null;){if(t.callback===null)vi(qn);else if(t.startTime<=e)vi(qn),t.sortIndex=t.expirationTime,Hc(bn,t);else break;t=Wt(qn)}}function Gc(e){if(nu=!1,pi(e),!tu)if(Wt(bn)!==null)tu=!0,Fl||(Fl=!0,$l());else{var t=Wt(qn);t!==null&&Bc(Gc,t.startTime-e)}}var Fl=!1,lu=-1,wd=5,Cd=-1;function Rd(){return qc?!0:!(de.unstable_now()-Cde&&Rd());){var l=At.callback;if(typeof l==\"function\"){At.callback=null,Ve=At.priorityLevel;var a=l(At.expirationTime<=e);if(e=de.unstable_now(),typeof a==\"function\"){At.callback=a,pi(e),t=!0;break t}At===Wt(bn)&&vi(bn),pi(e)}else vi(bn);At=Wt(bn)}if(At!==null)t=!0;else{var u=Wt(qn);u!==null&&Bc(Gc,u.startTime-e),t=!1}}break e}finally{At=null,Ve=n,Lc=!1}t=void 0}}finally{t?$l():Fl=!1}}}var $l;typeof Ad==\"function\"?$l=function(){Ad(Dc)}:typeof MessageChannel<\"u\"?(Uc=new MessageChannel,_d=Uc.port2,Uc.port1.onmessage=Dc,$l=function(){_d.postMessage(null)}):$l=function(){Md(Dc,0)};var Uc,_d;function Bc(e,t){lu=Md(function(){e(de.unstable_now())},t)}de.unstable_IdlePriority=5;de.unstable_ImmediatePriority=1;de.unstable_LowPriority=4;de.unstable_NormalPriority=3;de.unstable_Profiling=null;de.unstable_UserBlockingPriority=2;de.unstable_cancelCallback=function(e){e.callback=null};de.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=n,Hc(qn,e),Wt(bn)===null&&e===Wt(qn)&&(nu?(zd(lu),lu=-1):nu=!0,Bc(Gc,n-l))):(e.sortIndex=a,Hc(bn,e),tu||Lc||(tu=!0,Fl||(Fl=!0,$l()))),e};de.unstable_shouldYield=Rd;de.unstable_wrapCallback=function(e){var t=Ve;return function(){var n=Ve;Ve=t;try{return e.apply(this,arguments)}finally{Ve=n}}}});var Hd=Ft((uT,Ud)=>{\"use strict\";Ud.exports=Dd()});var Gd=Ft(je=>{\"use strict\";var sy=et();function qd(e){var t=\"https://react.dev/errors/\"+e;if(1{\"use strict\";function Bd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bd)}catch(e){console.error(e)}}Bd(),kd.exports=Gd()});var _h=Ft(Po=>{\"use strict\";var _e=Hd(),Ag=et(),gy=Yd();function T(e){var t=\"https://react.dev/errors/\"+e;if(1ia||(e.current=Or[ia],Or[ia]=null,ia--)}function se(e,t){ia++,Or[ia]=e.current,e.current=t}var rn=dn(null),zu=dn(null),Fn=dn(null),ao=dn(null);function uo(e,t){switch(se(Fn,t),se(zu,e),se(rn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ug(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ug(t),e=nh(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}Ge(rn),se(rn,e)}function Aa(){Ge(rn),Ge(zu),Ge(Fn)}function Ar(e){var t=e.memoizedState;t!==null&&(La._currentValue=t.memoizedState,se(ao,e)),t=rn.current;var n=nh(t,e.type);t!==n&&(se(zu,e),se(rn,n))}function io(e){zu.current===e&&(Ge(rn),Ge(zu)),ao.current===e&&(Ge(ao),La._currentValue=Ol)}var kc,Zd;function kn(e){if(kc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);kc=t&&t[1]||\"\",Zd=-1)\":-1a||c[l]!==f[a]){var d=`\n`+c[l].replace(\" at new \",\" at \");return e.displayName&&d.includes(\"\")&&(d=d.replace(\"\",e.displayName)),d}while(1<=l&&0<=a);break}}}finally{Yc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?kn(n):\"\"}function Ey(e,t){switch(e.tag){case 26:case 27:case 5:return kn(e.type);case 16:return kn(\"Lazy\");case 13:return e.child!==t&&t!==null?kn(\"Suspense Fallback\"):kn(\"Suspense\");case 19:return kn(\"SuspenseList\");case 0:case 15:return Vc(e.type,!1);case 11:return Vc(e.type.render,!1);case 1:return Vc(e.type,!0);case 31:return kn(\"Activity\");case 30:return kn(\"ViewTransition\");default:return\"\"}}function Kd(e){try{var t=\"\",n=null;do t+=Ey(e,n),n=e,e=e.return;while(e);return t}catch(l){return`\nError generating stack: `+l.message+`\n`+l.stack}}var _r=Object.prototype.hasOwnProperty,ws=_e.unstable_scheduleCallback,jc=_e.unstable_cancelCallback,xy=_e.unstable_shouldYield,Oy=_e.unstable_requestPaint,vt=_e.unstable_now,Ay=_e.unstable_getCurrentPriorityLevel,Hg=_e.unstable_ImmediatePriority,Lg=_e.unstable_UserBlockingPriority,oo=_e.unstable_NormalPriority,_y=_e.unstable_LowPriority,qg=_e.unstable_IdlePriority,My=_e.log,zy=_e.unstable_setDisableYieldValue,Zu=null,ht=null;function Qn(e){if(typeof My==\"function\"&&zy(e),ht&&typeof ht.setStrictMode==\"function\")try{ht.setStrictMode(Zu,e)}catch{}}var yt=Math.clz32?Math.clz32:Ry,wy=Math.log,Cy=Math.LN2;function Ry(e){return e>>>=0,e===0?32:31-(wy(e)/Cy|0)|0}var bi=256,Si=262144,Ti=4194304;function Sl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Uo(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,u=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~u,l!==0?a=Sl(l):(i&=o,i!==0?a=Sl(i):n||(n=o&~e,n!==0&&(a=Sl(n))))):(o=l&~u,o!==0?a=Sl(o):i!==0?a=Sl(i):n||(n=l&~e,n!==0&&(a=Sl(n)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:a}function Ku(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Gg(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Ju(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Uy(e,t,n,l,a,u){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,f=e.hiddenUpdates;for(n=i&~n;0\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),Cr=!1;if(An)try{Wl={},Object.defineProperty(Wl,\"passive\",{get:function(){Cr=!0}}),window.addEventListener(\"test\",Wl,Wl),window.removeEventListener(\"test\",Wl,Wl)}catch{Cr=!1}var Wl,Zn=null,Hs=null,Yi=null;function ep(){if(Yi)return Yi;var e,t=Hs,n=t.length,l,a=\"value\"in Zn?Zn.value:Zn.textContent,u=a.length;for(e=0;e=vu),im=\" \",om=!1;function np(e,t){switch(e){case\"keyup\":return v1.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function lp(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var ca=!1;function y1(e,t){switch(e){case\"compositionend\":return lp(t);case\"keypress\":return t.which!==32?null:(om=!0,im);case\"textInput\":return e=t.data,e===im&&om?null:e;default:return null}}function b1(e,t){if(ca)return e===\"compositionend\"||!qs&&np(e,t)?(e=ep(),Yi=Hs=Zn=null,ca=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function fm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dm(e,t){var n=fm(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fm(n)}}function op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?op(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rr(e.document)}return t}function Gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var _1=An&&\"documentMode\"in document&&11>=document.documentMode,ra=null,Dr=null,yu=null,Ur=!1;function mm(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ur||ra==null||ra!==Rr(l)||(l=ra,\"selectionStart\"in l&&Gs(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),yu&&Ru(yu,l)||(yu=l,l=Co(Dr,\"onSelect\"),0>=i,a-=i,on=1<<32-yt(t)+a|n<z?(fe=A,A=null):fe=A.sibling;var G=r(p,A,h[z],b);if(G===null){A===null&&(A=fe);break}e&&A&&G.alternate===null&&t(p,A),m=u(G,m,z),M===null?N=G:M.sibling=G,M=G,A=fe}if(z===h.length)return n(p,A),q&&Nn(p,z),N;if(A===null){for(;zz?(fe=A,A=null):fe=A.sibling;var rt=r(p,A,G.value,b);if(rt===null){A===null&&(A=fe);break}e&&A&&rt.alternate===null&&t(p,A),m=u(rt,m,z),M===null?N=rt:M.sibling=rt,M=rt,A=fe}if(G.done)return n(p,A),q&&Nn(p,z),N;if(A===null){for(;!G.done;z++,G=h.next())G=g(p,G.value,b),G!==null&&(m=u(G,m,z),M===null?N=G:M.sibling=G,M=G);return q&&Nn(p,z),N}for(A=l(A);!G.done;z++,G=h.next())G=s(A,p,z,G.value,b),G!==null&&(e&&(fe=G.alternate,fe!==null&&A.delete(fe.key===null?z:fe.key)),m=u(G,m,z),M===null?N=G:M.sibling=G,M=G);return e&&A.forEach(function($){return t(p,$)}),q&&Nn(p,z),N}function x(p,m,h,b){if(typeof h==\"object\"&&h!==null&&h.type===ua&&h.key===null&&h.props.ref===void 0&&(h=h.props.children),typeof h==\"object\"&&h!==null){switch(h.$$typeof){case yi:e:{for(var N=h.key;m!==null;){if(m.key===N){if(N=h.type,N===ua){if(m.tag===7){n(p,m.sibling),b=a(m,h.props.children),Bn(b,h),b.return=p,p=b;break e}}else if(m.elementType===N||typeof N==\"object\"&&N!==null&&N.$$typeof===Vn&&Tl(N)===m.type){n(p,m.sibling),b=a(m,h.props),Bn(b,h),b.return=p,p=b;break e}n(p,m);break}else t(p,m);m=m.sibling}h.type===ua?(b=Al(h.props.children,p.mode,b,h.key),Bn(b,h),b.return=p,p=b):(b=ji(h.type,h.key,h.props,null,p.mode,b),Bn(b,h),b.return=p,p=b)}return i(p);case fu:e:{for(N=h.key;m!==null;){if(m.key===N)if(m.tag===4&&m.stateNode.containerInfo===h.containerInfo&&m.stateNode.implementation===h.implementation){n(p,m.sibling),b=a(m,h.children||[]),b.return=p,p=b;break e}else{n(p,m);break}else t(p,m);m=m.sibling}b=Pc(h,p.mode,b),b.return=p,p=b}return i(p);case Vn:return h=Tl(h),x(p,m,h,b)}if(du(h))return y(p,m,h,b);if(uu(h)){if(N=uu(h),typeof N!=\"function\")throw Error(T(150));return h=N.call(h),S(p,m,h,b)}if(typeof h.then==\"function\")return x(p,m,_i(h),b);if(h.$$typeof===an)return x(p,m,Ai(p,h),b);Mi(p,h)}return typeof h==\"string\"&&h!==\"\"||typeof h==\"number\"||typeof h==\"bigint\"?(h=\"\"+h,m!==null&&m.tag===6?(n(p,m.sibling),b=a(m,h),b.return=p,p=b):(n(p,m),b=Wc(h,p.mode,b),b.return=p,p=b),i(p)):n(p,m)}return function(p,m,h,b){try{Hu=0;var N=x(p,m,h,b);return Sa=null,N}catch(A){if(A===Ya||A===Vo)throw A;var M=at(29,A,null,p.mode);return M.lanes=b,M.return=p,M}}}var Ul=Ep(!0),xp=Ep(!1),jn=!1;function Zs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Pn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function el(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(F&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=so(e),pp(e,null,n),t}return ko(e,l,t,n),so(e)}function Su(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Yg(e,n)}}function tr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?a=u=i:u=u.next=i,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Yr=!1;function Tu(){if(Yr){var e=ba;if(e!==null)throw e}}function Nu(e,t,n,l){Yr=!1;var a=e.updateQueue;jn=!1;var u=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,f=c.next;c.next=null,i===null?u=f:i.next=f,i=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==i&&(o===null?d.firstBaseUpdate=f:o.next=f,d.lastBaseUpdate=c))}if(u!==null){var g=a.baseState;i=0,d=f=c=null,o=u;do{var r=o.lane&-536870913,s=r!==o.lane;if(s?(V&r)===r:(l&r)===r){r!==0&&r===Dl&&(Yr=!0),d!==null&&(d=d.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var y=e,S=o;r=t;var x=n;switch(S.tag){case 1:if(y=S.payload,typeof y==\"function\"){g=y.call(x,g,r);break e}g=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=S.payload,r=typeof y==\"function\"?y.call(x,g,r):y,r==null)break e;g=ie({},g,r);break e;case 2:jn=!0}}r=o.callback,r!==null&&(e.flags|=64,s&&(e.flags|=8192),s=a.callbacks,s===null?a.callbacks=[r]:s.push(r))}else s={lane:r,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(f=d=s,c=g):d=d.next=s,i|=r;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;s=o,o=s.next,s.next=null,a.lastBaseUpdate=s,a.shared.pending=null}}while(!0);d===null&&(c=g),a.baseState=c,a.firstBaseUpdate=f,a.lastBaseUpdate=d,u===null&&(a.shared.lanes=0),fl|=i,e.lanes=i,e.memoizedState=g}}function Op(e,t){if(typeof e!=\"function\")throw Error(T(191,e));e.call(t)}function Ap(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eu?u:8;var i=C.T,o={};o.types=i!==null?i.types:null,C.T=o,of(e,!1,t,n);try{var c=a(),f=C.S;if(f!==null&&f(o,c),c!==null&&typeof c==\"object\"&&typeof c.then==\"function\"){var d=G1(c,l);Eu(e,t,d,bt(e))}else Eu(e,t,l,bt(e))}catch(g){Eu(e,t,{then:function(){},status:\"rejected\",reason:g},bt())}finally{W.p=u,i!==null&&o.types!==null&&(i.types=o.types),C.T=i}}function X1(){}function Zr(e,t,n,l){if(e.tag!==5)throw Error(T(476));var a=Fp(e).queue;$p(e,a,t,Ol,n===null?X1:function(){return Wp(e),n(l)})}function Fp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ol,baseState:Ol,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:Ol},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wp(e){var t=Fp(e);t.next===null&&(t=e.alternate.memoizedState),Eu(e,t.next.queue,{},bt())}function uf(){return qe(La)}function Pp(){return be().memoizedState}function ev(){return be().memoizedState}function Q1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=bt();e=Pn(n);var l=el(t,e,n);l!==null&&(ut(l,t,n),Su(l,t,n)),t={cache:js()},e.payload=t;return}t=t.return}}function Z1(e,t,n){var l=bt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Zo(e)?nv(t,n):(n=ks(e,t,n,l),n!==null&&(ut(n,e,l),lv(n,t,l)))}function tv(e,t,n){var l=bt();Eu(e,t,n,l)}function Eu(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zo(e))nv(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,o=u(i,n);if(a.hasEagerState=!0,a.eagerState=o,St(o,i))return ko(e,t,a,0),ue===null&&Bo(),!1}catch{}if(n=ks(e,t,a,l),n!==null)return ut(n,e,l),lv(n,t,l),!0}return!1}function of(e,t,n,l){if(l={lane:2,revertLane:yf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Zo(e)){if(t)throw Error(T(479))}else t=ks(e,n,l,2),t!==null&&ut(t,e,2)}function Zo(e){var t=e.alternate;return e===H||t!==null&&t===H}function nv(e,t){Ta=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lv(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Yg(e,n)}}var So={readContext:qe,use:Xo,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useLayoutEffect:he,useInsertionEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useSyncExternalStore:he,useId:he,useHostTransitionStatus:he,useFormState:he,useActionState:he,useOptimistic:he,useMemoCache:he,useCacheRefresh:he,useEffectEvent:he},av={readContext:qe,use:Xo,useCallback:function(e,t){return Fe().memoizedState=[e,t===void 0?null:t],e},useContext:qe,useEffect:zm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ki(4194308,4,Qp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ki(4194308,4,e,t)},useInsertionEffect:function(e,t){Ki(4,2,e,t)},useMemo:function(e,t){var n=Fe();t=t===void 0?null:t;var l=e();if(Hl){Qn(!0);try{e()}finally{Qn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Fe();if(n!==void 0){var a=n(t);if(Hl){Qn(!0);try{n(t)}finally{Qn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Z1.bind(null,H,e),[l.memoizedState,e]},useRef:function(e){var t=Fe();return e={current:e},t.memoizedState=e},useState:function(e){e=Xr(e);var t=e.queue,n=tv.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:lf,useDeferredValue:function(e,t){var n=Fe();return af(n,e,t)},useTransition:function(){var e=Xr(!1);return e=$p.bind(null,H,e.queue,!0,!1),Fe().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=H,a=Fe();if(q){if(n===void 0)throw Error(T(407));n=n()}else{if(n=t(),ue===null)throw Error(T(349));(V&127)!==0||Cp(l,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,zm(Dp.bind(null,l,u,e),[e]),l.flags|=2048,za(9,{destroy:void 0},Rp.bind(null,l,u,n,t),null),n},useId:function(){var e=Fe(),t=ue.identifierPrefix;if(q){var n=cn,l=on;n=(l&~(1<<32-yt(l)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=bo++,0<\\/script>\",u=u.removeChild(u.firstChild);break;case\"select\":u=typeof l.is==\"string\"?i.createElement(\"select\",{is:l.is}):i.createElement(\"select\"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is==\"string\"?i.createElement(a,{is:l.is}):i.createElement(a)}}u[Le]=t,u[ot]=l;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=u;e:switch(ke(u,a,l),a){case\"button\":case\"input\":case\"select\":case\"textarea\":l=!!l.autoFocus;break e;case\"img\":l=!0;break e;default:l=!1}l&&Tn(t)}}return ce(t),t.subtreeFlags&=-33554433,ur(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Tn(t);else{if(typeof l!=\"string\"&&t.stateNode===null)throw Error(T(166));if(e=Fn.current,Pl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Ce,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Le]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||th(e.nodeValue,n)),e||cl(t,!0)}else e=ku(e).createTextNode(l),e[Le]=t,t.stateNode=e}return ce(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Pl(t),n!==null){if(e===null){if(!l)throw Error(T(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(557));e[Le]=t}else wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ce(t),e=!1}else n=er(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(mt(t),t):(mt(t),null);if((t.flags&128)!==0)throw Error(T(558))}return ce(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Pl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(T(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(T(317));a[Le]=t}else wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ce(t),a=!1}else a=er(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(mt(t),t):(mt(t),null)}return mt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ci(t,t.updateQueue),ce(t),null);case 4:return Aa(),e===null&&bf(t.stateNode.containerInfo),t.flags|=67108864,ce(t),null;case 10:return On(t.type),ce(t),null;case 19:if(Js(t),l=t.memoizedState,l===null)return ce(t),null;if(a=(t.flags&128)!==0,u=l.rendering,u===null)if(a)ou(l,!1);else{if(ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=ho(e),u!==null){for(t.flags|=128,ou(l,!1),e=u.updateQueue,t.updateQueue=e,Ci(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vp(n,e),n=n.sibling;return Lu(t,Be.current&1|2),q&&Nn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&vt()>_o&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304)}else{if(!a)if(e=ho(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ci(t,e),ou(l,!0),l.tail===null&&l.tailMode!==\"collapsed\"&&l.tailMode!==\"visible\"&&!u.alternate&&!q)return ce(t),null}else 2*vt()-l.renderingStartTime>_o&&n!==536870912&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=vt(),e.sibling=null,u=Be.current,u=a?u&1|2:u&1,l.tailMode===\"visible\"||l.tailMode===\"collapsed\"||!n||q?Lu(t,u):(n=u,se(Ye,t),se(Be,n),Xe===null&&(Xe=t)),q&&Nn(t,l.treeForkCount),e}return ce(t),null;case 22:case 23:return mt(t),Ks(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(ce(t),t.subtreeFlags&6&&(t.flags|=8192)):ce(t),n=t.updateQueue,n!==null&&Ci(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Ge(_l),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),On(Ne),ce(t),null;case 25:return null;case 30:return t.flags|=33554432,ce(t),null}throw Error(T(156,t.tag))}function P1(e,t){switch(Vs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return On(Ne),Aa(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return io(t),null;case 31:if(t.memoizedState!==null){if(mt(t),t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Js(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Aa(),null;case 10:return On(t.type),null;case 22:case 23:return mt(t),Ks(),e!==null&&Ge(_l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return On(Ne),null;case 25:return null;default:return null}}function pv(e,t){switch(Vs(t),t.tag){case 3:On(Ne),Aa();break;case 26:case 27:case 5:io(t);break;case 4:Aa();break;case 31:t.memoizedState!==null&&mt(t);break;case 13:mt(t);break;case 19:Js(t);break;case 10:On(t.type);break;case 22:case 23:mt(t),Ks(),e!==null&&Ge(_l);break;case 24:On(Ne)}}function Pu(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var u=n.create,i=n.inst;l=u(),i.destroy=l}n=n.next}while(n!==a)}}catch(o){ne(t,t.return,o)}}function sl(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var u=a.next;l=u;do{if((l.tag&e)===e){var i=l.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,a=t;var c=n,f=o;try{f()}catch(d){ne(a,c,d)}}}l=l.next}while(l!==u)}}catch(d){ne(t,t.return,d)}}function vv(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ap(t,n)}catch(l){ne(e,e.return,l)}}}function hv(e,t,n){n.props=Ll(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){ne(e,t,l)}}function nn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var a=e.stateNode,u=_n(e.memoizedProps,a);(a.ref===null||a.ref.name!==u)&&(a.ref=oh(u)),l=a.ref;break;case 7:if(e.stateNode===null){var i=new Tt(e);it(e.child,!1,Yb,i,void 0,void 0),e.stateNode=i}l=e.stateNode;break;default:l=e.stateNode}typeof n==\"function\"?e.refCleanup=n(l):n.current=l}}catch(o){ne(e,t,o)}}function He(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l==\"function\")try{l()}catch(a){ne(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(a){ne(e,t,a)}else n.current=null}function No(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title\"))),ke(l,t,n),l[Le]=e,we(l),t=l;break e;case\"link\":if(u=hg(\"link\",\"href\",a).get(t+(n.href||\"\"))){for(i=0;ix&&(i=x,x=S,S=i);var p=dm(o,S),m=dm(o,x);if(p&&m&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==m.node||s.focusOffset!==m.offset)){var h=g.createRange();h.setStart(p.node,p.offset),s.removeAllRanges(),S>x?(s.addRange(h),s.extend(m.node,m.offset)):(h.setEnd(m.node,m.offset),s.addRange(h))}}}}for(g=[],s=o;s=s.parentNode;)s.nodeType===1&&g.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof o.focus==\"function\"&&o.focus(),o=0;on?32:n,C.T=null,n=fs,fs=null;var u=Xt,i=sn;if(pe=0,ql=Xt=null,sn=0,(F&6)!==0)throw Error(T(331));var o=F;if(F|=4,Lv(u.current),Dv(u,u.current,i,n),F=o,ei(0,!1),ht&&typeof ht.onPostCommitFiberRoot==\"function\")try{ht.onPostCommitFiberRoot(Zu,u)}catch{}return!0}finally{W.p=a,C.T=l,Jv(e,t)}}function Fm(e,t,n){t=Rt(n,t),t=Jr(e.stateNode,t,2),e=el(e,t,2),e!==null&&(Ju(e,2),mn(e))}function ne(e,t,n){if(e.tag===3)Fm(e,e,n);else for(;t!==null;){if(t.tag===3){Fm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof l.componentDidCatch==\"function\"&&(ll===null||!ll.has(l))){e=Rt(n,e),n=rv(2),l=el(t,n,2),l!==null&&(sv(n,l,t,e),Ju(l,2),mn(l));break}}t=t.return}}function sr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new lb;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(vf=!0,a.add(n),e=fb.bind(null,e,t,n),t.then(e,e))}function fb(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ue===e&&(V&n)===n&&((ye===4||ye===3&&(V&62914560)===V&&300>vt()-Jo)&&(F&2)===0?Ra(e,0):Ao|=n,wa===V&&(wa=0)),mn(e)}function Iv(e,t){t===0&&(t=Bg()),e=Yl(e,t),e!==null&&(Ju(e,t),mn(e))}function db(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Iv(e,n)}function mb(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(T(314))}l!==null&&l.delete(t),Iv(e,n)}function gb(e,t){return ws(e,t)}var Da=null,la=null,vs=!1,wo=!1,fr=!1,$n=0;function mn(e){e!==la&&e.next===null&&(la===null?Da=la=e:la=la.next=e),wo=!0,vs||(vs=!0,vb())}function ei(e,t){if(!fr&&wo){fr=!0;do for(var n=!1,l=Da;l!==null;){if(!t)if(e!==0){var a=l.pendingLanes;if(a===0)var u=0;else{var i=l.suspendedLanes,o=l.pingedLanes;u=(1<<31-yt(42|e)+1)-1,u&=a&~(i&~o),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Wm(l,u))}else u=V,u=Uo(l,l===ue?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Ku(l,u)||(n=!0,Wm(l,u));l=l.next}while(n);fr=!1}}function pb(){$v()}function $v(){wo=vs=!1;var e=0;$n!==0&&Ob()&&(e=$n);for(var t=vt(),n=null,l=Da;l!==null;){var a=l.next,u=Fv(l,t);u===0?(l.next=null,n===null?Da=a:n.next=a,a===null&&(la=n)):(n=l,(e!==0||(u&3)!==0)&&(wo=!0)),l=a}pe!==0&&pe!==5||ei(e,!1),$n!==0&&($n=0)}function Fv(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0o)break;var d=c.transferSize,g=c.initiatorType;d&&ag(g)&&(c=c.responseEnd,i+=d*(cto){S.length=y;break}h=new Promise(Cb.bind(h)),S.push(h)}}}if(0\"u\"?null:document;function ph(e,t,n){var l=Xa;if(l&&typeof t==\"string\"&&t){var a=Ct(t);a='link[rel=\"'+e+'\"][href=\"'+a+'\"]',typeof n==\"string\"&&(a+='[crossorigin=\"'+n+'\"]'),gg.has(a)||(gg.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement(\"link\"),ke(t,\"link\",e),we(t),l.head.appendChild(t)))}}function $b(e){Un.D(e),ph(\"dns-prefetch\",e,null)}function Fb(e,t){Un.C(e,t),ph(\"preconnect\",e,t)}function Wb(e,t,n){Un.L(e,t,n);var l=Xa;if(l&&e&&t){var a='link[rel=\"preload\"][as=\"'+Ct(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(a+='[imagesrcset=\"'+Ct(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(a+='[imagesizes=\"'+Ct(n.imageSizes)+'\"]')):a+='[href=\"'+Ct(e)+'\"]';var u=a;switch(t){case\"style\":u=Ha(e);break;case\"script\":u=Qa(e)}if(!(Ht.has(u)||(e=ie({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ht.set(u,e),l.querySelector(a)!==null||t===\"style\"&&l.querySelector(ti(u))||t===\"script\"&&l.querySelector(ni(u))))){var i=l.createElement(\"link\");ke(i,\"link\",e),t===\"style\"&&(i[co]=!0,i.onload=i.onerror=function(){Xg(i)}),we(i),l.head.appendChild(i)}}}function Pb(e,t){Un.m(e,t);var n=Xa;if(n&&e){var l=t&&typeof t.as==\"string\"?t.as:\"script\",a='link[rel=\"modulepreload\"][as=\"'+Ct(l)+'\"][href=\"'+Ct(e)+'\"]',u=a;switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":u=Qa(e)}if(!Ht.has(u)&&(e=ie({rel:\"modulepreload\",href:e},t),Ht.set(u,e),n.querySelector(a)===null)){switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(ni(u)))return}l=n.createElement(\"link\"),ke(l,\"link\",e),we(l),n.head.appendChild(l)}}}function eS(e,t,n){Un.S(e,t,n);var l=Xa;if(l&&e){var a=va(l).hoistableStyles,u=Ha(e);t=t||\"default\";var i=a.get(u);if(!i){var o={loading:0,preload:null};if(i=l.querySelector(ti(u)))o.loading=5;else{e=ie({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=Ht.get(u))&&Ef(e,n);var c=i=l.createElement(\"link\");we(c),ke(c,\"link\",e),c._p=new Promise(function(f,d){c.onload=f,c.onerror=d}),c.addEventListener(\"load\",function(){o.loading|=1}),c.addEventListener(\"error\",function(){o.loading|=2}),o.loading|=4,Pi(i,t,l)}i={type:\"stylesheet\",instance:i,count:1,state:o},a.set(u,i)}}}function tS(e,t){Un.X(e,t);var n=Xa;if(n&&e){var l=va(n).hoistableScripts,a=Qa(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ie({src:e,async:!0},t),(t=Ht.get(a))&&xf(e,t),u=n.createElement(\"script\"),we(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function nS(e,t){Un.M(e,t);var n=Xa;if(n&&e){var l=va(n).hoistableScripts,a=Qa(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ie({src:e,async:!0,type:\"module\"},t),(t=Ht.get(a))&&xf(e,t),u=n.createElement(\"script\"),we(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function pg(e,t,n,l){var a=(a=Fn.current)?Yu(a):null;if(!a)throw Error(T(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(n=Ha(n.href),t=va(a).hoistableStyles,l=t.get(n),l||(l={type:\"style\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=Ha(n.href);var u=va(a).hoistableStyles,i=u.get(e);if(i||(a=a.ownerDocument||a,i={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,i),(u=a.querySelector(ti(e)))?u._p||(i.instance=u,i.state.loading=5):(u=Ht.get(e),u||(u={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ht.set(e,u)),lS(a,e,u,i.state))),t&&l===null)throw Error(T(528,\"\"));return i}if(t&&l!==null)throw Error(T(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(n=Qa(n),t=va(a).hoistableScripts,l=t.get(n),l||(l={type:\"script\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};default:throw Error(T(444,e))}}function Ha(e){return'href=\"'+Ct(e)+'\"'}function ti(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function vh(e){return ie({},e,{\"data-precedence\":e.precedence,precedence:null})}function lS(e,t,n,l){if(t=e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")){if(t[co]!==!0){l.loading=1;return}}else t=e.createElement(\"link\"),t[co]=!0,t.onload=t.onerror=Xg.bind(null,t),ke(t,\"link\",n),we(t),e.head.appendChild(t);l.preload=t,t.addEventListener(\"load\",function(){return l.loading|=1}),t.addEventListener(\"error\",function(){return l.loading|=2})}function Qa(e){return'[src=\"'+Ct(e)+'\"]'}function ni(e){return\"script[async]\"+e}function vg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var l=e.querySelector('style[data-href~=\"'+Ct(n.href)+'\"]');if(l)return t.instance=l,we(l),l;var a=ie({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement(\"style\"),we(l),ke(l,\"style\",a),Pi(l,n.precedence,e),t.instance=l;case\"stylesheet\":a=Ha(n.href);var u=e.querySelector(ti(a));if(u)return t.state.loading|=4,t.instance=u,we(u),u;l=vh(n),(a=Ht.get(a))&&Ef(l,a),u=(e.ownerDocument||e).createElement(\"link\"),we(u);var i=u;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),t.state.loading|=4,Pi(u,n.precedence,e),t.instance=u;case\"script\":return u=Qa(n.src),(a=e.querySelector(ni(u)))?(t.instance=a,we(a),a):(l=n,(a=Ht.get(u))&&(l=ie({},n),xf(l,a)),e=e.ownerDocument||e,a=e.createElement(\"script\"),we(a),ke(a,\"link\",l),e.head.appendChild(a),t.instance=a);case\"void\":return null;default:throw Error(T(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Pi(l,n.precedence,e));return t.instance}function Pi(e,t,n){for(var l=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,u=a,i=0;i title\"):null)}function aS(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function yg(e,t){return e===\"img\"&&t.src!=null&&t.src!==\"\"&&t.onLoad==null&&t.loading!==\"lazy\"}function hh(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function yh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==\"number\"?devicePixelRatio:1)*.25}function bg(e,t){typeof t.decode==\"function\"&&(e.imgCount++,t.complete||(e.imgBytes+=yh(t),e.suspenseyImages.push(t)),e=oS.bind(e),t.decode().then(e,e))}function uS(e,t,n,l){if(n.type===\"stylesheet\"&&(typeof l.media!=\"string\"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Ha(l.href),u=t.querySelector(ti(a));if(u){t=u._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=Vu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,we(u);return}u=t.ownerDocument||t,l=vh(l),(a=Ht.get(a))&&Ef(l,a),u=u.createElement(\"link\"),we(u);var i=u;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Vu.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var to=0;function iS(e,t){return e.stylesheets&&e.count===0&&no(e,e.stylesheets),0to?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function bh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)no(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Vu(){this.count--,bh(this)}function oS(){this.imgCount--,bh(this)}var Ro=null;function no(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ro=new Map,t.forEach(cS,e),Ro=null,Vu.call(e))}function cS(e,t){if(!(t.state.loading&4)){var n=Ro.get(e);if(n)var l=n.get(null);else{n=new Map,Ro.set(e,n);for(var a=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),u=0;u{\"use strict\";function Mh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mh)}catch(e){console.error(e)}}Mh(),zh.exports=_h()});var Rh=Ft(ec=>{\"use strict\";var vS=Symbol.for(\"react.transitional.element\"),hS=Symbol.for(\"react.fragment\");function Ch(e,t,n){var l=null;if(n!==void 0&&(l=\"\"+n),t.key!==void 0&&(l=\"\"+t.key),\"key\"in t){n={};for(var a in t)a!==\"key\"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:vS,type:e,key:l,ref:t!==void 0?t:null,props:n}}ec.Fragment=hS;ec.jsx=Ch;ec.jsxs=Ch});var ae=Ft((fT,Dh)=>{\"use strict\";Dh.exports=Rh()});var yn={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1},E0=[\"RETIRED\",\"CONFLICT\",\"NOT_FOUND\",\"DOCUMENT_TOO_LARGE\",\"STORAGE_FAILURE\",\"ORIGIN_NOT_DECLARED\",\"MESSAGE_TOO_LARGE\",\"PAGE_TOO_LARGE\",\"PATCH_TOO_LARGE\",\"DEADLINE\",\"INVALID_STEPS\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"CONFIGURATION_REQUIRED\",\"NOT_READY\",\"UNKNOWN_METHOD\",\"INVALID_ARGUMENT\",\"QUOTA_EXCEEDED\",\"PROTOCOL_MISMATCH\",\"APPLET_INCOMPATIBLE\",\"ENVELOPE_INVALID\",\"CONTEXT_REPLACED\",\"TARGET_NOT_FOUND\",\"PRECONDITION_FAILED\",\"ASYNC_READ\",\"AUTH_REQUIRED\",\"REJECTED\"];function ed(e){return typeof e==\"string\"&&E0.includes(e)}var x0=/^:[A-Za-z][A-Za-z0-9_]*$/,O0=/^[A-Za-z0-9_.~@-]+$/,yc=new Map;function A0(e){if(yc.has(e))return yc.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),l=n.at(-1)===\"*\";l&&n.pop();let a=[],u=!0;for(let i of n)x0.test(i)?a.push({param:i.slice(1)}):O0.test(i)&&i!==\".\"&&i!==\"..\"?a.push({literal:i}):u=!1;u&&(t={segments:a,rest:l})}return yc.set(e,t),t}function Se(e){try{return new URL(e).href}catch{return null}}function hl(e,t){let n=_0(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let l;try{l=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}l.at(-1)===\"\"&&l.pop();for(let a of e.routes){let u=A0(a.pattern);if(!u)continue;let i=M0(u,l);if(!i||!(a.query??[]).every(c=>n.searchParams.has(c)))continue;for(let c of a.query??[])i[c]=n.searchParams.get(c);let o={kind:\"route\",routeId:a.id,page:a.page,screen:a.screen,params:i};return a.context!==void 0&&(o.context=a.context),o}return{kind:\"website\",url:t}}function _0(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function M0(e,t){if(e.rest?t.lengthS.id===u.id)?.startUrl;f={index:o.index,start:y!==void 0&&Se(y)===Se(t.view.url),url:s}}}else t.status===\"ready\"&&t.account!==null&&c===\"auth\"&&(c=\"none\",f=null);o.page.status===\"ready\"&&(t.status===\"loading\"||t.status===\"error\")&&(d++,g=!1,l.push({type:\"schedule\",id:u.id,token:d}));let r={...o,seen:Math.max(o.seen,t.view.n),pin:c,signIn:f,deadline:d,page:{status:t.status,pageId:t.pageId,routeId:t.routeId,view:t.view,stale:t.stale,expired:g}};return{state:vl(Wf(e,u,r),r),effects:l}}case\"deadline\":{let u=e.contexts[t.id];return!u||t.token!==u.deadline||u.page.status===\"ready\"||u.page.expired?a:{state:vl(e,{...u,page:{...u.page,expired:!0}}),effects:l}}case\"user.viewWebsite\":{let u=e.contexts[t.id];return!u||u.pin===\"user\"?a:{state:vl(e,{...u,pin:\"user\"}),effects:l}}case\"user.done\":{let u=e.contexts[t.id];if(!u)return a;if(u.pin===\"auth\"&&u.signIn)return If(e,u,n)??a;let i=u.pin===\"none\"?u:{...u,pin:\"none\"},o=i===u?e:vl(e,i);if(fi(i,n)!==\"website\")return{state:o,effects:l};if(i.canGoBack)l.push({type:\"context.back\",id:u.id});else{let c=n.contexts.find(f=>f.id===u.id)?.startUrl;c&&l.push({type:\"context.navigate\",id:u.id,url:c,mode:\"push\"})}return{state:o,effects:l}}case\"navigate.url\":{let u=t.context??e.active;return e.contexts[u]?(l.push({type:\"context.navigate\",id:u,url:t.url,mode:t.mode}),{state:{...e,active:u,overlay:[],leaveGuard:null},effects:l}):a}case\"navigate.screen\":{let u=t.mode===\"root\"?[t.screen]:t.mode===\"replace\"?[...e.overlay.slice(0,-1),t.screen]:[...e.overlay,t.screen];return{state:{...e,overlay:u,leaveGuard:null},effects:l}}case\"select\":{let u=e.contexts[t.id];if(!u)return a;if(t.id!==e.active||e.overlay.length>0)return{state:{...e,active:t.id,overlay:[],leaveGuard:null},effects:l};let i=n.contexts.find(o=>o.id===t.id)?.startUrl;return i&&(u.url===null||Se(u.url)!==Se(i))&&l.push({type:\"context.navigate\",id:t.id,url:i,mode:\"push\"}),{state:{...e,leaveGuard:null},effects:l}}case\"back\":{if(e.leaveGuard)return{state:e,effects:[{type:\"confirmLeave\",message:e.leaveGuard.message}]};if(e.overlay.length>0)return{state:{...e,overlay:e.overlay.slice(0,-1)},effects:l};let u=e.contexts[e.active];return u?.pin===\"auth\"&&u.signIn?If(e,u,n)??{state:e,effects:[{type:\"leave\"}]}:e.contexts[e.active]?.canGoBack?{state:e,effects:[{type:\"context.back\",id:e.active}]}:{state:e,effects:[{type:\"leave\"}]}}case\"guard\":return{state:{...e,leaveGuard:t.guard},effects:l};case\"context.gone\":{let u=e.contexts[t.id];return u?{state:vl(e,{...u,page:{...Sc,status:\"unsupported\"}}),effects:l}:a}}}function If(e,t,n){let{index:l,start:a}=t.signIn,u=n.contexts[0].id,i=vl(e,{...t,pin:\"none\",signIn:null});if(!a&&l>0){let o=Math.max(1,t.index-l+1);return{state:i,effects:[{type:\"context.back\",id:t.id,steps:o}]}}return t.id===u?null:{state:{...i,active:u,overlay:[],leaveGuard:null},effects:[]}}function $f(e,t,n){return t===e.generation&&e.url!==null&&Se(n)===Se(e.url)}function Ff(e,t,n,l){let a=e.deadline+1;return l.push({type:\"schedule\",id:e.id,token:a}),{...e,url:n,seen:t===e.generation?e.seen:-1,generation:t,page:Sc,deadline:a}}function Wf(e,t,n){return!e.leaveGuard||t.id!==e.active||e.overlay.length>0||t.index===n.index&&t.url!==null&&n.url!==null&&Se(t.url)===Se(n.url)?e:{...e,leaveGuard:null}}function vl(e,t){return{...e,contexts:{...e.contexts,[t.id]:t}}}function Tc(e){let t={};for(let[n,l]of Object.entries(e.contexts))t[n]={url:l.url};return{version:yn.sessionState,state:{active:e.active,overlay:e.overlay,contexts:t}}}function ld(e,t){let n=z0(t);if(!e||e.version!==yn.sessionState||!eu(e.state))return n;let{active:l,overlay:a,contexts:u}=e.state,i={...n,contexts:{...n.contexts}};if(typeof l==\"string\"&&i.contexts[l]&&(i.active=l),Array.isArray(a)&&(i.overlay=a.filter(o=>C0(o,t.foreground.screens))),eu(u))for(let o of Object.keys(i.contexts)){let c=eu(u[o])?u[o].url:void 0;typeof c==\"string\"&&(i.contexts[o]=td(o,c))}return i}function C0(e,t){return eu(e)&&typeof e.key==\"string\"&&typeof e.id==\"string\"&&t.includes(e.id)&&eu(e.params)&&Object.values(e.params).every(n=>typeof n==\"string\")}function eu(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var IS=yn.bundleFormat,bc=\"(0|[1-9]\\\\d*)\",Pf=\"(?:0|[1-9]\\\\d*|\\\\d*[A-Za-z-][0-9A-Za-z-]*)\",$S=new RegExp(`^${bc}\\\\.${bc}\\\\.${bc}(?:-(${Pf}(?:\\\\.${Pf})*))?$`),st=class extends Error{code;constructor(e,t){super(t),this.name=\"GenesisError\",this.code=e}},R0=2e3;function Nc(e,t){return new Promise((n,l)=>{let a=null,u=!1,i=1,o=new Map,c=new Map,f={get bound(){return a},get retired(){return u},request(s,y={}){if(u)return Promise.reject(new st(\"RETIRED\",\"This page was closed\"));let S=i++;return new Promise((x,p)=>{let m=setTimeout(()=>{o.delete(S),p(new st(\"DEADLINE\",`${s} did not answer in time`))},a.limits.rpcDeadlineMs+R0);o.set(S,{resolve:x,reject:p,timer:m}),e.postMessage(JSON.stringify({type:\"request\",documentId:a.documentId,requestId:S,method:s,params:y}))})},on(s,y){let S=c.get(s);return S||c.set(s,S=new Set),S.add(y),()=>{S.delete(y)}}};function d(){u=!0;for(let s of o.values())clearTimeout(s.timer),s.reject(new st(\"RETIRED\",\"This page was closed\"));o.clear()}function g(s,y){for(let S of[...c.get(s)??[]])try{S(y)}catch(x){console.error(`Genesis ${s} handler failed`,x)}}e.addEventListener(\"message\",s=>{if(u||typeof s.data!=\"string\")return;let y;try{y=JSON.parse(s.data)}catch{return}if(y?.type===\"refused\"&&!a){u=!0,l(new st(y.error?.code??\"PROTOCOL_MISMATCH\",y.error?.message??\"The host refused this page\"));return}if(y?.type===\"bound\"){if(a)return;a=y,n(f);return}if(!(!a||y?.documentId!==a.documentId))if(y.type===\"response\"){let S=o.get(y.requestId);if(!S)return;o.delete(y.requestId),clearTimeout(S.timer),y.error?S.reject(new st(y.error.code,y.error.message)):S.resolve(y.result??null)}else y.type===\"event\"&&(y.name===\"retired\"?(d(),g(\"retired\",{})):g(y.name,y.data))}),addEventListener(\"pagehide\",()=>{u||(g(\"pagehide\",{}),d())});let r={type:\"hello\",protocol:yn.protocol,url:t};e.postMessage(JSON.stringify(r))})}var D0={pageId:null,routeId:null,params:{}};function ud(e,t){let n={};for(let g of e)n[g]=U0();let l={account:null,contexts:n},a=!1,u=new Map;function i(g){let r=g===null?[...u.values()]:[u.get(null),...g.map(y=>u.get(y))],s=new Set;for(let y of r)for(let S of[...y??[]])s.has(S)||(s.add(S),S())}function o(g,r){l={...l,contexts:{...l.contexts,[g]:r}}}function c(g){let{entry:r}=g;if(!g.attached||g.status!==\"ready\"||!r||!Kl(r.url,g.url))return;let{history:s}=g;for(s.delete(r.index),s.set(r.index,id(g));s.size>t.historyEntriesMax;)s.delete(s.keys().next().value)}function f(g,r,s){if(r===void 0||s!==\"ready\"&&s!==\"auth\")return!1;if(!a)return a=!0,l.account!==r&&(l={...l,account:r}),!1;if(r===l.account)return!1;let y={};for(let[S,x]of Object.entries(l.contexts))x.history.clear(),y[S]=S===g||!x.content||x.stale?x:{...x,stale:!0};return l={account:r,contexts:y},c(y[g]),!0}let d=(g,r=!1)=>({outcome:g,accountChanged:r});return{state:()=>l,context:g=>l.contexts[g],applyPage(g,r,s){let y=l.contexts[g];if(!y||r=r.size||m===r.index&&!Kl(h.url,r.url))&&S.delete(m)}let x={...y,generation:r.generation,entry:{index:r.index,url:r.url}},p;if(Kl(y.url,r.url))y.attached&&y.view?.generation!==r.generation?p={...x,attached:!1,status:\"loading\",error:null,stale:y.content}:p=x;else{let m=S.get(r.index);p=m?{...x,...m,attached:!1,status:\"loading\",error:null,stale:!0,content:!0}:{...x,...s,url:r.url,regions:{},attached:!1,status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1}}o(g,p),c(p),i([g])},gone(g,r){let s=l.contexts[g];s&&(o(g,{...s,attached:!1,status:\"error\",error:r,stale:s.content}),i([g]))},subscribe(g,r){let s=r??null,y=u.get(s);return y||u.set(s,y=new Set),y.add(g),()=>{y.delete(g)}}}}function U0(){return{generation:0,view:null,epoch:0,seq:0,live:[],attached:!1,url:null,pageId:null,routeId:null,params:{},regions:{},status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1,entry:null,history:new Map}}function Kl(e,t){return e!==null&&t!==null&&Se(e)===Se(t)}function id(e){return{url:e.url,pageId:e.pageId,routeId:e.routeId,params:e.params,regions:e.regions}}function H0(e,t){if(e.content&&Kl(e.url,t))return id(e);let{entry:n}=e,l=n&&Kl(n.url,t)?e.history.get(n.index):void 0;return l&&Kl(l.url,t)?l:null}function od(e,t=Object.create(null)){for(let n of e)t[n.key]=n;return t}function cd(e){return e.kind===\"single\"?{kind:\"single\",status:e.status,error:e.error??null,record:e.record}:{kind:\"collection\",status:e.status,error:e.error??null,order:e.items.map(t=>t.key),complete:e.complete,ephemeral:e.ephemeral===!0,records:od(e.items)}}function L0(e,t){let n={};for(let[l,a]of Object.entries(e)){let u=cd(a),i=t[l];n[l]=i?q0(i,u):u}return n}var di=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function q0(e,t){if(e.kind===\"single\"||t.kind===\"single\")return e.kind!==\"single\"||t.kind!==\"single\"?t:(di(e.record,t.record)&&(t.record=e.record),e.record===t.record&&e.status===t.status&&di(e.error,t.error)?e:t);let n=e.order.length===t.order.length&&e.complete===t.complete&&e.ephemeral===t.ephemeral&&e.status===t.status&&di(e.error,t.error);for(let[l,a]of t.order.entries()){let u=e.records[a];u&&di(u,t.records[a])?t.records[a]=u:n=!1,e.order[l]!==a&&(n=!1)}return n?e:t}function G0(e,t){let n=e.regions;for(let[l,a]of Object.entries(t)){let u=e.live.includes(l)?n[l]:void 0;if(!u)return null;let i;if(a.kind===\"replace\")i=cd(a.region);else if(a.kind===\"single\"){if(u.kind!==\"single\")return null;i={...u,record:a.record,status:a.status??u.status,error:a.error===void 0?u.error:a.error}}else{if(u.kind!==\"collection\")return null;if(i={...u,complete:a.complete??u.complete,status:a.status??u.status,error:a.error===void 0?u.error:a.error},a.upsert?.length||a.remove?.length){i.records=od(a.upsert??[],Object.assign(Object.create(null),u.records));for(let o of a.remove??[])delete i.records[o]}if(a.order){i.order=a.order;let o=new Set(a.order);for(let c of Object.keys(i.records))o.has(c)||(i.records===u.records&&(i.records=Object.assign(Object.create(null),u.records)),delete i.records[c])}else if(a.remove?.length){let o=new Set(a.remove);i.order=u.order.filter(c=>!o.has(c))}}n===e.regions&&(n={...n}),n[l]=i}return n}var rd=class extends st{constructor(e,t){super(e,t),this.name=\"ServiceError\"}},B0=[\"CONFIGURATION_REQUIRED\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"SERVICE_UNREACHABLE\",\"DEADLINE\",\"SERVICE_FAILURE\",\"QUOTA_EXCEEDED\"];function Ec(e){let t=e?.code;return t&&B0.includes(t)?\"This feature is temporarily unavailable. Try again in a moment.\":e instanceof Error?e.message:\"Something went wrong. Please try again.\"}async function xc(e=window.__genesisBridge){if(!e)throw new Error(\"Genesis bridge is missing; the foreground must run inside Genesis\");let t=await Nc(e,location.href),{compat:n}=t.bound;if(n.protocol!==yn.protocol||n.sessionState!==yn.sessionState)throw new st(\"PROTOCOL_MISMATCH\",\"This applet was built for another Genesis version\");return Q0(t)}var k0=500,Y0=1e3,V0=64,j0=2e3,X0=Object.freeze([]),ad=e=>e===void 0?null:Array.isArray(e)?e:[e];function Q0(e){let{manifest:t,appletId:n,limits:l,session:a}=e.bound,u=t.contexts.map(v=>v.id),i=ud(u,{historyEntriesMax:l.historyEntriesMax}),o=(v,E)=>e.request(v,E).catch(O=>{e.retired||console.error(`Genesis ${v} failed`,O)}),c=ld(a,t),f=new Set,d=null,g=new Set;function r(v){let E=nd(c,v,t),O=E.state!==c;c=E.state;let w=E.effects.filter(Z=>!s(Z));if(O){N=void 0,h();for(let Z of[...f])Z()}return w}function s(v){switch(v.type){case\"reveal\":return o(\"context.reveal\",{id:v.id}),!0;case\"cover\":return o(\"context.cover\"),!0;case\"context.navigate\":return si(v.id),o(\"context.navigate\",{id:v.id,url:v.url,mode:v.mode}),!0;case\"context.back\":return si(v.id),o(\"context.back\",v.steps?{id:v.id,steps:v.steps}:{id:v.id}),!0;case\"context.reload\":return si(v.id),o(\"context.reload\",{id:v.id}),!0;case\"schedule\":return setTimeout(()=>r({type:\"deadline\",id:v.id,token:v.token}),l.documentReadyMs),!0;case\"leave\":case\"confirmLeave\":return!1}}function y(v,E){d?d(v,E):window.confirm(v)&&E()}function S(v){let E=c.leaveGuard;if(!E)return v();y(E.message,()=>{r({type:\"guard\",guard:null}),v()})}function x(v){let E=!0;for(let O of r({type:\"back\"}))if(O.type===\"leave\")E=!1;else if(O.type===\"confirmLeave\"){let w=()=>{r({type:\"guard\",guard:null}),!x(!1)&&v&&o(\"back.leave\")};setTimeout(()=>y(O.message,w),0)}return E}let p=null,m=a?JSON.stringify(Tc(c)):\"\";function h(){p===null&&(p=setTimeout(b,k0))}function b(){p!==null&&clearTimeout(p),p=null;let v=Tc(c),E=JSON.stringify(v);E!==m&&(m=E,o(\"session.save\",v))}e.on(\"suspended\",b);let N;function M(){if(N!==void 0)return N;let v=c.overlay[c.overlay.length-1],E=c.contexts[c.active],O=null;if(v)O={key:v.key,id:v.id,params:v.params,context:c.active,overlay:!0};else if(E?.url){let w=hl(t,E.url);w.kind===\"route\"&&(O={key:`${E.id}:${E.index}`,id:w.screen,params:w.params,context:E.id,overlay:!1})}return N=O}let A=1,z=new Set(c.overlay.map(v=>v.key));function fe(){let v;do v=`s${A++}`;while(z.has(v));return z.add(v),v}function G(v){if(\"screen\"in v){let $t={key:fe(),id:v.screen,params:v.params??{}};S(()=>r({type:\"navigate.screen\",screen:$t,mode:v.mode??\"push\"}));return}let O=c.contexts[c.active]?.url??t.contexts[0].startUrl,w;try{w=new URL(v.url,O).href}catch{throw new st(\"INVALID_ARGUMENT\",`Not a URL: ${v.url}`)}let Z=v.context??rt(w);if(!c.contexts[Z])throw new st(\"NOT_FOUND\",`No context ${Z}`);let Ke=c.contexts[Z].url;if(Ke!==null&&Se(Ke)===Se(w)&&(v.mode??\"push\")===\"push\"){(Z!==c.active||c.overlay.length>0)&&S(()=>r({type:\"select\",id:Z}));return}S(()=>r({type:\"navigate.url\",url:w,context:Z,mode:v.mode??\"push\"}))}function rt(v){let E=hl(t,v);if(E.kind!==\"route\"||!E.context||!c.contexts[E.context])return c.active;let O=c.contexts[c.active],w=t.contexts.find(Ke=>Ke.id===c.active)?.startUrl,Z=!O.url||w!==void 0&&Se(O.url)===Se(w);return c.overlay.length>0||Z?E.context:c.active}function $(v){S(()=>{let E=v===c.active&&c.overlay.length===0,O=E&&c.contexts[v]?.url!==null&&Se(c.contexts[v].url)!==Se(t.contexts.find(w=>w.id===v)?.startUrl??\"\");if(r({type:\"select\",id:v}),E&&!O)for(let w of[...g])w(v)})}let xe=new Set;function Kt(v){xe.has(v)||(xe.add(v),setTimeout(()=>xe.delete(v),Y0),e.request(\"context.resync\",{id:v}).catch(()=>{}))}function ci(v){let E=hl(t,v);return E.kind===\"route\"?{pageId:E.page,routeId:E.routeId,params:E.params}:{pageId:null,routeId:null,params:{}}}e.on(\"page\",({id:v,generation:E,page:O})=>{let w=i.applyPage(v,E,O);if(w.outcome!==\"applied\")return;xe.delete(v);let Z=i.context(v);f0(v,O),r({type:\"context.page\",id:v,generation:E,view:O.view,status:O.status,pageId:O.pageId,routeId:O.routeId,account:O.account,stale:Z.stale&&Z.content,signInUrl:O.signInUrl??null}),Wa(v,w)}),e.on(\"patch\",({id:v,generation:E,patch:O})=>{let w=i.applyPatch(v,E,O);w.outcome===\"resync\"&&Kt(v),Wa(v,w)});function Wa(v,E){if(!E.accountChanged)return;let O=Zl(c,t);for(let w of u)w!==v&&(w===O?Kt(w):ri(w));for(let w of[...Jt.values()])w.context!==v&&It(w,{outcome:\"unknown\",code:\"CONTEXT_REPLACED\",message:\"The account changed\"})}function ri(v){si(v),o(\"context.reload\",{id:v})}e.on(\"context.navigated\",v=>{i.navigated(v.id,v,ci(v.url)),r({type:\"context.navigated\",...v})}),e.on(\"context.gone\",v=>{i.gone(v.id,{code:v.code??\"NOT_READY\",message:v.message??\"The page cannot be read\"}),r({type:\"context.gone\",id:v.id})}),e.on(\"user.viewWebsite\",v=>{r({type:\"user.viewWebsite\",id:v?.id??c.active})}),e.on(\"user.done\",v=>{r({type:\"user.done\",id:v?.id??c.active}),Vf()}),e.on(\"back\",()=>{let v=x(!0);o(\"back.handled\",{handled:v})});let Jt=new Map,sc=new Map,Pa=new Map,fc=0,dc=new Set,mc=new Map,Gf=(v,E,O)=>JSON.stringify([v,E,O]);function Bf(){let v=new Map;for(let O of Jt.values()){let w=Gf(O.context,O.region,O.key),Z=v.get(w);Z||v.set(w,Z=[]),Z.push({name:O.name,args:O.args})}let E=new Map;for(let[O,w]of v){let Z=mc.get(O);E.set(O,Z&&Z.length===w.length&&Z.every((Ke,$t)=>Ke.name===w[$t].name&&Ke.args===w[$t].args)?Z:w)}mc=E;for(let O of[...dc])O()}function It(v,E){Jt.get(v.dedup)===v&&(Jt.delete(v.dedup),v.actionId!==null&&sc.delete(v.actionId),v.timer!==null&&clearTimeout(v.timer),v.resolve(E),Bf())}function kf(v,E){v.timer!==null&&clearTimeout(v.timer),v.timer=setTimeout(()=>It(v,{outcome:\"unknown\",code:\"DEADLINE\",message:\"The action did not finish in time\"}),E)}function Yf(v,E){if(E.state===\"dispatched\"){if(!E.navigating)return;v.from=i.context(v.context)?.view??null,v.expect=E.expect??null,kf(v,l.actionTimeoutMs);return}let O=E.state===\"observed\"?\"observed\":E.state===\"cancelled\"?\"cancelled\":\"failed\";It(v,E.result??{outcome:O})}e.on(\"action.update\",v=>{let E=sc.get(v.actionId);if(E)return Yf(E,v);if(fc===0)return;let O=Pa.get(v.actionId)??[];O.push(v),Pa.set(v.actionId,O)});function f0(v,E){for(let O of[...Jt.values()]){if(O.context!==v||O.from===null)continue;let{from:w}=O;if(E.view.generation===w.generation&&E.view.n===w.n||E.status===\"loading\")continue;let Z=hl(t,E.view.url),Ke=Z.kind===\"route\"?Z.page:null,$t=ad(O.expect?.page);E.status===\"auth\"?It(O,{outcome:\"failed\",code:\"AUTH_REQUIRED\",message:\"Sign-in is needed\"}):Ke!==null&&ad(O.expect?.notPage)?.includes(Ke)?It(O,{outcome:\"failed\",code:\"REJECTED\",message:\"The website did not accept the action\"}):E.status===\"ready\"&&Ke!==null&&($t===null||$t.includes(Ke))?It(O,{outcome:\"observed\"}):It(O,{outcome:\"unknown\",message:\"The action led to another page\"})}}function si(v){for(let E of[...Jt.values()])E.context===v&&E.from!==null&&It(E,{outcome:\"unknown\",message:\"The page changed before the action finished\"})}function d0(v){let E=i.context(v.context);if(!E?.view)return Promise.resolve({outcome:\"failed\",code:\"NOT_READY\",message:\"The page is not ready\"});let O=v.region===null?void 0:E.regions[v.region],w=O?.kind===\"collection\"?O.records[v.key??\"\"]:O?.record??void 0,Z=JSON.stringify([v.context,w?.entityType??v.region,w?.entity??v.key,v.name,v.args??null]),Ke=Jt.get(Z);if(Ke)return Ke.promise;let $t,Qf=new Promise(Bt=>{$t=Bt}),pl={...v,dedup:Z,actionId:null,promise:Qf,resolve:$t,timer:null,from:null,expect:null};Jt.set(Z,pl),kf(pl,l.actionTimeoutMs+j0),Bf();let{view:Zf}=E,p0={region:v.region,key:v.key,name:v.name,args:v.args??null,view:Zf.n},Kf=()=>{--fc===0&&Pa.clear()};return fc++,e.request(\"context.act\",{id:v.context,generation:Zf.generation,action:p0}).then(({actionId:Bt})=>{let hc=Pa.get(Bt)??[];if(Pa.delete(Bt),Kf(),Jt.get(Z)===pl){pl.actionId=Bt,sc.set(Bt,pl);for(let v0 of hc)Yf(pl,v0)}},Bt=>{Kf();let hc=ed(Bt?.code)?Bt.code:void 0;It(pl,{outcome:\"failed\",code:hc,message:Bt instanceof Error?Bt.message:\"The action failed\"})}),Qf}let gc=new Set;e.on(\"storage.changed\",v=>{for(let E of[...gc])E(v)});let m0={get:(v,E)=>e.request(\"storage.get\",{collection:v,key:E}),list:(v,E={})=>e.request(\"storage.list\",{collection:v,...E}),commit:v=>e.request(\"storage.commit\",{checks:v.checks??[],puts:v.puts??[],deletes:v.deletes??[]}),onChanged(v){return gc.add(v),()=>{gc.delete(v)}}},g0={async request(v,E,O={}){try{return await e.request(\"services.request\",{serviceId:v,path:E,method:O.method??\"GET\",body:O.body??null})}catch(w){throw w instanceof st?new rd(w.code,w.message):w}}},pc=new Set;function Vf(){for(let v of[...pc])v()}e.on(\"resumed\",Vf);let vc=new Set;e.on(\"retired\",()=>{for(let v of[...Jt.values()])It(v,{outcome:\"unknown\",code:\"RETIRED\",message:\"This page was closed\"});for(let v of[...vc])v()});let Ql=new Map;for(let v of u)e.request(\"context.resync\",{id:v}).catch(()=>{}),s({type:\"schedule\",id:v,token:c.contexts[v].deadline});let jf=Zl(c,t);jf!==null&&o(\"context.reveal\",{id:jf});let Xf=!1;return{manifest:t,appletId:n,limits:l,restored:a!==null,store:i,navigation:{state:()=>c,screen:M,presentation:v=>fi(c.contexts[v],t),revealed:()=>Zl(c,t),navigate:G,select:$,back:()=>{x(!1)},reload:v=>{ri(v??c.active)},viewWebsite:v=>{r({type:\"user.viewWebsite\",id:v??c.active})},done:v=>{r({type:\"user.done\",id:v??c.active})},setLeaveGuard:v=>{r({type:\"guard\",guard:v===null?null:{message:v}})},onConfirmLeave(v){return d=v,()=>{d===v&&(d=null)}},onScrollToTop(v){return g.add(v),()=>{g.delete(v)}},subscribe(v){return f.add(v),()=>{f.delete(v)}}},actions:{act:d0,pending:(v,E,O)=>mc.get(Gf(v,E,O))??X0,subscribe(v){return dc.add(v),()=>{dc.delete(v)}}},storage:m0,services:g0,scroll:{get:v=>Ql.get(v),set(v,E){for(Ql.delete(v),Ql.set(v,E);Ql.size>V0;)Ql.delete(Ql.keys().next().value)}},onResume(v){return pc.add(v),()=>{pc.delete(v)}},onRetired(v){return vc.add(v),()=>{vc.delete(v)}},ready(){Xf||(Xf=!0,o(\"ui.ready\"))}}}var X=L(et(),1),Hh=L(wh(),1),li=L(ae(),1),Lh=(0,X.createContext)(null);function yS({foreground:e,children:t}){return(0,li.jsx)(Lh.Provider,{value:e,children:t})}function gn(){let e=(0,X.useContext)(Lh);if(!e)throw new Error(\"Genesis hooks need mountForeground or GenesisProvider\");return e}function bS({foreground:e,children:t}){return(0,X.useLayoutEffect)(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e.ready()))},[e]),t}async function qh(e,t){let n=t??document.getElementById(\"root\")??document.body.appendChild(document.createElement(\"div\")),l=await xc(),a=(0,Hh.createRoot)(n);return l.onRetired(()=>a.unmount()),a.render((0,li.jsx)(yS,{foreground:l,children:(0,li.jsx)(bS,{foreground:l,children:e})})),l}function zf(){let e=gn();return(0,X.useSyncExternalStore)(e.navigation.subscribe,e.navigation.state)}function tc(e){let t=zf();return e??t.active}function Gh(e,t){let{store:n}=gn(),l=(0,X.useCallback)(a=>n.subscribe(a,e),[n,e]);return(0,X.useSyncExternalStore)(l,()=>t(n.context(e)))}var SS=(e,t)=>e.pageId===t.pageId&&e.status===t.status&&e.stale===t.stale&&e.generation===t.generation&&e.params===t.params&&e.error===t.error&&e.account===t.account&&e.url===t.url;function TS(e,t){return{pageId:e?.pageId??null,status:e?.status??\"loading\",stale:e?e.stale&&e.content:!1,generation:e?.view?.generation??null,params:e?.params??NS,error:e?.error??null,account:t,url:e?.url??null}}function ct(e){let{store:t}=gn(),n=tc(e),l=(0,X.useRef)(null),a=(0,X.useCallback)(i=>t.subscribe(i),[t]),u=(0,X.useCallback)(()=>{let i=TS(t.context(n),t.state().account);return(!l.current||!SS(l.current,i))&&(l.current=i),l.current},[t,n]);return(0,X.useSyncExternalStore)(a,u)}var NS=Object.freeze({}),Uh=new WeakMap,ES=Object.freeze({order:Object.freeze([]),get:()=>{},complete:!1,status:\"missing\",error:null,ephemeral:!1});function xS(e){if(!e)return ES;let t=Uh.get(e);if(t)return t;if(e.kind===\"collection\"){let{records:n}=e;t={order:e.order.filter(l=>n[l]!==void 0),get:l=>n[l],complete:e.complete,status:e.status,error:e.error,ephemeral:e.ephemeral}}else{let{record:n}=e;t={order:n?[n.key]:[],get:l=>n&&n.key===l?n:void 0,complete:!0,status:e.status,error:e.error,ephemeral:!1}}return Uh.set(e,t),t}function pn(e,t){return Gh(tc(t),n=>xS(n?.regions[e]))}function Nt(e,t,n){return Gh(tc(n),l=>OS(l?.regions[e],t))}function OS(e,t){if(e)return e.kind===\"single\"?t===null||e.record?.key===t?e.record??void 0:void 0:t===null?void 0:e.records[t]}function nc(e,t,n){let l=gn();return(0,X.useCallback)((a,u)=>l.actions.act({context:n??l.navigation.state().active,region:t??null,key:a,name:e,args:u}),[l,e,t,n])}function lc(e,t,n){let l=gn(),a=tc(n);return(0,X.useSyncExternalStore)(l.actions.subscribe,()=>l.actions.pending(a,e,t))}function ge(){let e=gn(),t=zf(),{navigation:n}=e;return(0,X.useMemo)(()=>({presentation:n.presentation(t.active),active:t.active,contexts:t.contexts,overlay:t.overlay,screen:n.screen(),revealed:n.revealed(),navigate:n.navigate,back:n.back,select:n.select,reload:n.reload,viewWebsite:n.viewWebsite,done:n.done,setLeaveGuard:n.setLeaveGuard}),[n,t])}function ac(e,t={}){let n=gn(),l=t.storage??n.storage,[a,u]=(0,X.useState)({records:[],loading:!0,error:null});(0,X.useEffect)(()=>{let g=!0,r=0;async function s(){let S=++r;try{let x=[],p;do{let m=await l.list(e,p===void 0?{}:{afterKey:p});x.push(...m.entries),p=m.nextAfterKey??void 0}while(p!==void 0);g&&S===r&&u({records:x,loading:!1,error:null})}catch(x){g&&S===r&&u(p=>({...p,loading:!1,error:x}))}}s();let y=l.onChanged(S=>{S.changes.some(x=>x.collection===e)&&s()});return()=>{g=!1,y()}},[l,e]);let i=(0,X.useRef)(a.records);i.current=a.records;let o=(0,X.useCallback)(g=>i.current.find(r=>r.key===g)?.revision??null,[]),c=(0,X.useCallback)(g=>l.commit(g),[l]),f=(0,X.useCallback)((g,r,s)=>l.commit({checks:[{collection:e,key:g,expectedRevision:s===void 0?o(g):s}],puts:[{collection:e,key:g,value:r}]}),[l,e,o]),d=(0,X.useCallback)(g=>l.commit({checks:[{collection:e,key:g,expectedRevision:o(g)}],deletes:[{collection:e,key:g}]}),[l,e,o]);return{...a,put:f,remove:d,commit:c}}function Bh(e){let t=gn();return(0,X.useCallback)((n,l={})=>t.services.request(e,n,l),[t,e])}var AS=1500;function _S(){let e=gn();zf();let t=e.navigation.screen(),n=t?.key??`${e.navigation.state().active}:none`,l=t&&!t.overlay?t.context:null;return(0,X.useCallback)(a=>{if(!a)return;let u=e.scroll.get(n)??0,i=u>0,o=performance.now(),c=0,f=()=>{i&&(a.scrollTop=u,Math.abs(a.scrollTop-u)<2||performance.now()-o>AS?i=!1:c=requestAnimationFrame(f))},d=()=>{i=!1},g=()=>{i||e.scroll.set(n,a.scrollTop)},r=e.navigation.onScrollToTop(s=>{s===l&&(i=!1,a.scrollTo({top:0,behavior:\"smooth\"}))});return f(),a.addEventListener(\"scroll\",g,{passive:!0}),a.addEventListener(\"touchstart\",d,{passive:!0}),a.addEventListener(\"wheel\",d,{passive:!0}),()=>{cancelAnimationFrame(c),r(),a.removeEventListener(\"scroll\",g),a.removeEventListener(\"touchstart\",d),a.removeEventListener(\"wheel\",d)}},[e,n,l])}function Qe(e){return(0,li.jsx)(\"div\",{...e,ref:_S()})}function uc(e){let t=gn(),n=(0,X.useRef)(e);n.current=e,(0,X.useEffect)(()=>t.onResume(()=>n.current()),[t])}var c0=L(et(),1);var Re=\"https://x.com\";var kh=e=>typeof e==\"string\"&&/^[A-Za-z0-9_]{1,15}$/.test(e),wf=e=>typeof e==\"string\"&&/^[0-9]{1,25}$/.test(e),Et=e=>!!e&&typeof e==\"object\"&&!Array.isArray(e),Lt=e=>Number.isSafeInteger(e)&&e>=0,ic=e=>typeof e==\"string\"&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e);function MS(e,t){if(typeof e!=\"string\"||e.length>2048)return null;try{let n=new URL(e,t);return[\"https:\",\"http:\"].includes(n.protocol)&&!n.username&&!n.password?n.href:null}catch{return null}}function Cf(e){if(typeof e!=\"string\")return null;try{let t=new URL(e,Re),n=/^\\/([A-Za-z0-9_]{1,15})\\/status\\/([0-9]{1,25})$/.exec(t.pathname);return t.origin===Re&&!t.username&&!t.password&&n?{postId:n[2],handle:n[1],url:`${Re}/${n[1]}/status/${n[2]}`}:null}catch{return null}}function Rf(e){return Et(e)&&wf(e.postId)&&Lt(e.revision)&&e.revision>0&&Array.isArray(e.categoryIds)&&e.categoryIds.length<=10&&e.categoryIds.every(ic)}function Df(e){return!Et(e)||!kh(e.authorHandle)||typeof e.authorName!=\"string\"||e.authorName.length>800||typeof e.text!=\"string\"||e.text.length>16e3||!Lt(e.capturedAtMs)||![\"complete\",\"excerpt\",\"unavailable\"].includes(String(e.textState))||!Et(e.media)||![\"none\",\"photo\",\"video\",\"mixed\"].includes(String(e.media.kind))||!Lt(e.media.count)||e.media.count>16?!1:Array.isArray(e.links)&&e.links.length<=8&&e.links.every(t=>Et(t)&&typeof t.text==\"string\"&&!!MS(t.href))}function Yh(e){return Rf(e)&&Et(e)&&e.version===1&&Df(e.snapshot)&&Cf(e.url)?.postId===e.postId&&Lt(e.savedAtMs)&&Lt(e.updatedAtMs)}function Vh(e){return Et(e)&&e.version===1&&ic(e.id)&&typeof e.name==\"string\"&&e.name.length<=320&&typeof e.nameKey==\"string\"&&Lt(e.revision)&&e.revision>0&&Lt(e.count)&&Lt(e.createdAtMs)&&Lt(e.updatedAtMs)}var jh=e=>Et(e)&&e.version===1&&ic(e.libraryId)&&kh(e.expectedHandle)&&Lt(e.revision),Uf=e=>Et(e)&&ic(e.operationId)&&e.status===\"committed\"&&typeof e.kind==\"string\"&&Lt(e.libraryRevision)&&Lt(e.createdAtMs)&&Et(e.result);function ai(e){let t=e.normalize(\"NFKC\").trim().replace(/\\s+/gu,\" \");return t?[...t].length>80||new TextEncoder().encode(t).length>320?\"Use 80 characters or fewer.\":/[\\u0000-\\u001f\\u007f]/u.test(t)?\"Use a name without control characters.\":null:\"Enter a category name.\"}var xt=e=>`${Re}/${e}`,oc=(e,t)=>`${Re}/search?q=${encodeURIComponent(e)}&src=typed_query${t?`&f=${t}`:\"\"}`;var Xh=L(et(),1);var J=L(ae(),1),zS={home:\"M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z\",search:\"M21 21l-5.2-5.2M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0\",bell:\"M6 16V11a6 6 0 1 1 12 0v5l2 2H4zM10 21h4\",bookmark:\"M6 3h12v18l-6-4-6 4z\",person:\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0\",reply:\"M4 5h16v11H9l-5 4z\",repost:\"M7 4 3 8l4 4M3 8h13a4 4 0 0 1 4 4M17 20l4-4-4-4M21 16H8a4 4 0 0 1-4-4\",heart:\"M12 20s-8-4.9-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 9c0 6.1-8 11-8 11z\",views:\"M5 20V12M10 20V6M15 20v-9M20 20V4\",folder:\"M3 6a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z\",external:\"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6\",close:\"M6 6l12 12M18 6 6 18\",left:\"M15 5l-7 7 7 7\",right:\"M9 5l7 7-7 7\",check:\"M5 12.5 10 17 19 7\"};function ve({name:e,filled:t=!1}){return(0,J.jsx)(\"svg\",{viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",className:t?\"filled\":void 0,children:(0,J.jsx)(\"path\",{d:zS[e]})})}function Ot(){let{navigate:e}=ge();return(0,Xh.useCallback)(t=>{try{e({url:t})}catch(n){console.error(\"Genesis could not open\",t,n)}},[e])}function Qh({parts:e,className:t}){let n=Ot();return(0,J.jsx)(\"p\",{className:t??\"post-text\",dir:\"auto\",children:e.map((l,a)=>l.href?(0,J.jsx)(\"a\",{href:l.href,onClick:u=>{u.preventDefault(),u.stopPropagation(),n(l.href)},children:l.text},a):(0,J.jsx)(\"span\",{children:l.text},a))})}function gl({src:e,size:t=40}){return e?(0,J.jsx)(\"img\",{className:\"avatar\",src:e,alt:\"\",width:t,height:t,loading:\"lazy\",referrerPolicy:\"no-referrer\"}):(0,J.jsx)(\"span\",{className:\"avatar\",style:{width:t,height:t},\"aria-hidden\":\"true\"})}function Za(){return(0,J.jsxs)(\"svg\",{viewBox:\"0 0 24 24\",className:\"verified\",role:\"img\",\"aria-label\":\"Verified account\",children:[(0,J.jsx)(\"path\",{d:\"M12 2.5l2.4 1.8 3-.2.9 2.8 2.5 1.7-1 2.9 1 2.9-2.5 1.7-.9 2.8-3-.2L12 21.5l-2.4-1.8-3 .2-.9-2.8-2.5-1.7 1-2.9-1-2.9 2.5-1.7.9-2.8 3 .2z\"}),(0,J.jsx)(\"path\",{d:\"M8 12.2l2.6 2.6L16 9.4\",className:\"tick\"})]})}function Pe({label:e,rows:t=6,kind:n=\"posts\"}){return(0,J.jsx)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:`skeleton ${n}`,children:Array.from({length:t},(l,a)=>(0,J.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[n===\"posts\"&&(0,J.jsx)(\"span\",{className:\"skeleton-avatar\"}),(0,J.jsxs)(\"div\",{children:[(0,J.jsx)(\"span\",{}),(0,J.jsx)(\"span\",{}),(0,J.jsx)(\"span\",{})]})]},a))})}function Ze({title:e,children:t,role:n}){return(0,J.jsxs)(\"section\",{className:\"notice\",role:n,children:[(0,J.jsx)(\"h2\",{children:e}),t]})}function Hf({url:e,label:t=\"Open on X\"}){let{navigate:n,viewWebsite:l}=ge();return(0,J.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>e?n({url:e}):l(),children:[t,\" \",(0,J.jsx)(ve,{name:\"external\"})]})}function vn({error:e}){let t=e?.code===\"NOT_READY\"||e?.code===\"DEADLINE\"?\"X did not answer in time.\":e?.message||\"This page could not be read.\";return(0,J.jsxs)(Ze,{title:\"Couldn't load this page\",role:\"alert\",children:[(0,J.jsx)(\"p\",{children:t}),(0,J.jsx)(Hf,{})]})}function Ka({reason:e}){let{navigate:t}=ge();return(0,J.jsxs)(Ze,{title:\"Sign in to X\",children:[(0,J.jsx)(\"p\",{children:e}),(0,J.jsxs)(\"button\",{type:\"button\",className:\"primary\",onClick:()=>t({url:`${Re}/i/flow/login`}),children:[\"Sign in \",(0,J.jsx)(ve,{name:\"external\"})]})]})}function Ja({label:e,options:t,active:n}){return(0,J.jsx)(\"nav\",{className:\"mode-tabs\",\"aria-label\":e,children:t.map(l=>(0,J.jsx)(\"button\",{type:\"button\",className:\"mode-tab\",\"aria-current\":l.id===n?\"page\":void 0,onClick:()=>l.id!==n&&l.go(),children:l.label},l.id))})}var Zh=L(et(),1);var jl=L(ae(),1);function Kh(){let{navigate:e}=ge(),t=ct(),n=Nt(\"handle\",null),l=t.stale||t.pageId!==\"account\"?null:n?.data?.handle??t.account;(0,Zh.useEffect)(()=>{l&&e({url:xt(l),context:\"account\",mode:\"replace\"})},[l,e]);let a;return t.status===\"auth\"?a=(0,jl.jsx)(Ka,{reason:\"Sign in to see your profile and use Saved categories.\"}):t.status===\"error\"?a=(0,jl.jsx)(vn,{error:t.error}):a=(0,jl.jsx)(Pe,{label:\"Loading your profile\",rows:3,kind:\"text\"}),(0,jl.jsxs)(Qe,{className:\"screen\",children:[(0,jl.jsx)(\"h1\",{className:\"screen-title\",children:\"Profile\"}),a]})}var qt=L(et(),1);var Hn=L(et(),1);var xT=new TextEncoder;var Zt=class extends Error{constructor(n,l,a=!1){super(l);this.code=n;this.uncertain=a;this.name=\"LibraryError\"}code;uncertain},Ia={CONFLICT:\"This item changed. Refresh before saving again.\",CATEGORY_NAME_EXISTS:\"A category with this name already exists.\",CATEGORY_NOT_EMPTY:\"Move or remove its saved posts before deleting this category.\",CATEGORY_MISSING:\"A selected category no longer exists. Review your choices.\",CURSOR_STALE:\"The list changed while loading. Refresh to see it.\",LIMIT_REACHED:\"This would go over a library limit.\",ACCOUNT_MISMATCH:\"These categories belong to a different X account. Switch accounts on X to use them.\",SIGN_IN:\"Sign in to X to use your categories.\",UNCERTAIN:\"The last change may not have finished. Check it before making another.\"};function hn(e){let t=e?.code;return t&&Ia[t]?Ia[t]:e instanceof Zt?e.message:Ec(e)}function wS(){let e=Bh(\"bookmarks\");return(0,Hn.useMemo)(()=>{async function t(l,a){let u=await e(l,a===void 0?{}:{method:\"POST\",body:a});if(u.status>=200&&u.status<300)return u.body?.result;let i=u.body?.error;throw new Zt(i?.code??\"SERVICE_FAILURE\",i?.message??\"The bookmarks service refused the request.\",u.status>=500)}let n=(l,a)=>{if(!a(l))throw new Zt(\"SERVICE_FAILURE\",\"The bookmarks service sent an invalid answer.\");return l};return{library:async()=>n(await t(\"/v1/library\"),jh),categories:async()=>{let l=await t(\"/v1/categories\");return n(Et(l)?l.categories:void 0,a=>Array.isArray(a)&&a.every(Vh))},lookup:async l=>{let a=await t(\"/v1/bookmarks/lookup\",{postIds:[l]});return n(Et(a)?a.records:void 0,i=>Array.isArray(i)&&i.every(Rf)).find(i=>i.postId===l)??null},query:async(l,a,u)=>n(await t(\"/v1/bookmarks/query\",{categoryId:l,query:a,cursor:u,limit:20}),i=>Et(i)&&Array.isArray(i.entries)&&i.entries.every(Yh)),operate:async(l,a,u)=>n(await t(\"/v1/operations\",{operationId:l,kind:a,payload:u}),Uf),receipt:async l=>n(await t(`/v1/operations/${l}`),Uf)}},[e])}function CS(){let e=ct(\"account\");return{account:e.account?{handle:e.account,name:null}:null,signedOut:e.status===\"auth\"}}function $a(){let e=wS(),{account:t,signedOut:n}=CS(),l=ac(\"operations\"),[a,u]=(0,Hn.useState)({library:null,categories:[],loading:!0,error:null}),[i,o]=(0,Hn.useState)(0),c=(0,Hn.useCallback)(()=>o(y=>y+1),[]);uc(c),(0,Hn.useEffect)(()=>{let y=!0;return u(S=>({...S,loading:!0})),Promise.all([e.library(),e.categories()]).then(([S,x])=>{y&&u({library:S,categories:x,loading:!1,error:null})},S=>{y&&u(x=>({...x,loading:!1,error:S}))}),()=>{y=!1}},[e,i]);let f=a.library,d=f?l.records.find(y=>y.key===`pending:${f.libraryId}`)?.value??null:null,g=a.error;return!g&&f&&!t&&(g=new Zt(n?\"SIGN_IN\":\"ACCOUNT_UNKNOWN\",n?Ia.SIGN_IN:\"Checking your X account\\u2026\")),!g&&f&&t&&t.handle.toLowerCase()!==f.expectedHandle.toLowerCase()&&(g=new Zt(\"ACCOUNT_MISMATCH\",Ia.ACCOUNT_MISMATCH)),{...a,error:g,pending:d,reload:c,service:e,operate:async(y,S,x)=>{if(!f||g)throw g??new Zt(\"SERVICE_FAILURE\",\"The library isn't loaded.\");if(d)throw new Zt(\"UNCERTAIN\",Ia.UNCERTAIN);let p=`pending:${f.libraryId}`,m=crypto.randomUUID();await l.put(p,{operationId:m,kind:y,libraryId:f.libraryId,createdAtMs:Date.now(),recordId:x});try{let h=await e.operate(m,y,S);return await l.remove(p),h}catch(h){let b=!(h instanceof Zt)||h.uncertain;throw b||await l.remove(p),b?new Zt(\"UNCERTAIN\",Ia.UNCERTAIN,!0):h}finally{c()}},check:async()=>{if(!(!f||!d)){try{await e.receipt(d.operationId)}catch(y){if(y.code!==\"OPERATION_NOT_FOUND\")throw y}await l.remove(`pending:${f.libraryId}`),c()}},loading:a.loading||l.loading}}function Jh(e){let t=e.parts.map(a=>a.text).join(\"\"),n=e.photos.length&&e.videos?\"mixed\":e.videos?\"video\":e.photos.length?\"photo\":\"none\",l=e.parts.filter(a=>a.href).map(a=>({text:a.text.slice(0,300),href:a.href})).slice(0,8);return{authorHandle:e.handle.toLowerCase(),authorName:e.name,text:t,textState:e.textState,capturedAtMs:Date.now(),media:{kind:n,count:Math.min(16,e.photos.length+e.videos)},links:l}}var Fh=L(et(),1);var cc=L(et(),1);var _=L(ae(),1);function Ih(e,t,n,l,a){let u=lc(e,t),i=nc(n,e),[o,c]=(0,cc.useState)(!1),f=[...u].reverse().find(r=>r.name===n),d=f?f.args[l]:a;return{shown:d,busy:f!==void 0,failed:o,toggle:()=>{c(!1),i(t,{[l]:!d}).then(r=>c(r.outcome===\"failed\"))}}}function RS(){let{navigate:e}=ge();return t=>e({screen:\"save\",params:{post:JSON.stringify({postId:t.postId,url:t.url,snapshot:Jh(t)})}})}var Fa=(0,cc.memo)(function({post:t,region:n,actionable:l,focus:a=!1}){let u=Ot(),{viewWebsite:i}=ge(),o=RS(),c=()=>{a||u(t.url)},f=()=>{a||u(t.url),i()};return(0,_.jsxs)(\"article\",{className:a?\"post focus\":\"post\",\"aria-label\":`Post by ${t.name}`,children:[t.context&&(0,_.jsxs)(\"p\",{className:\"post-context\",children:[(0,_.jsx)(ve,{name:/pinned/i.test(t.context.text)?\"bookmark\":\"repost\"}),t.context.url?(0,_.jsx)(\"a\",{href:t.context.url,onClick:d=>{d.preventDefault(),u(t.context.url)},children:t.context.text}):t.context.text]}),(0,_.jsxs)(\"div\",{className:\"post-grid\",children:[(0,_.jsx)(\"button\",{type:\"button\",className:\"avatar-button\",\"aria-label\":`Profile of ${t.name}`,onClick:()=>u(xt(t.handle)),children:(0,_.jsx)(gl,{src:t.avatar,size:a?48:40})}),(0,_.jsxs)(\"div\",{className:\"post-body\",children:[(0,_.jsxs)(\"header\",{className:\"post-head\",children:[(0,_.jsxs)(\"a\",{className:\"post-name\",href:xt(t.handle),onClick:d=>{d.preventDefault(),u(xt(t.handle))},children:[(0,_.jsx)(\"strong\",{children:t.name}),t.verified&&(0,_.jsx)(Za,{})]}),(0,_.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",t.handle,!a&&t.time&&(0,_.jsxs)(_.Fragment,{children:[\" \\xB7 \",(0,_.jsx)(\"time\",{dateTime:t.dateTime??void 0,children:t.time})]})]})]}),(0,_.jsxs)(\"div\",{className:\"post-content\",onClick:c,children:[t.parts.length>0&&(0,_.jsx)(Qh,{parts:t.parts,className:a?\"post-text large\":\"post-text\"}),t.textState===\"excerpt\"&&!a&&(0,_.jsx)(\"span\",{className:\"show-more\",children:\"Show more\"}),t.textState===\"unavailable\"&&t.photos.length===0&&t.videos===0&&!t.quote&&(0,_.jsx)(\"p\",{className:\"post-meta\",children:\"X didn't show this post's text.\"})]}),t.photos.length>0&&(0,_.jsx)(\"div\",{className:`photos n${t.photos.length}`,children:t.photos.map((d,g)=>(0,_.jsx)(\"button\",{type:\"button\",\"aria-label\":`Photo ${g+1} of ${t.photos.length}`,onClick:()=>u(`${t.url}/photo/${g+1}`),children:(0,_.jsx)(\"img\",{src:d,alt:\"\",loading:\"lazy\",referrerPolicy:\"no-referrer\"})},d))}),t.videos>0&&(0,_.jsxs)(\"button\",{type:\"button\",className:\"video-tile\",onClick:f,children:[(0,_.jsx)(\"span\",{children:\"Video\"}),(0,_.jsxs)(\"span\",{className:\"post-meta\",children:[\"Play on X \",(0,_.jsx)(ve,{name:\"external\"})]})]}),t.quote&&(0,_.jsxs)(\"button\",{type:\"button\",className:\"quote\",disabled:!t.quote.url,onClick:()=>t.quote?.url&&u(t.quote.url),children:[(0,_.jsxs)(\"span\",{className:\"post-head\",children:[(0,_.jsx)(\"strong\",{children:t.quote.name}),t.quote.handle&&(0,_.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",t.quote.handle]})]}),t.quote.text&&(0,_.jsx)(\"span\",{className:\"quote-text\",children:t.quote.text})]}),a&&t.time&&(0,_.jsxs)(\"p\",{className:\"post-meta focus-time\",children:[(0,_.jsx)(\"time\",{dateTime:t.dateTime??void 0,children:t.time}),t.views&&(0,_.jsxs)(_.Fragment,{children:[\" \\xB7 \",(0,_.jsx)(\"strong\",{children:t.views}),\" views\"]})]}),(0,_.jsx)(DS,{post:t,region:n,actionable:l,save:()=>o(t)})]})]})]})});function DS({post:e,region:t,actionable:n,save:l}){let a=Ot(),u=Ih(t,e.postId,\"setLiked\",\"liked\",e.liked),i=Ih(t,e.postId,\"setBookmarked\",\"bookmarked\",e.bookmarked);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(\"div\",{className:\"actions-bar\",children:[(0,_.jsxs)(\"button\",{type:\"button\",className:\"action\",\"aria-label\":`Reply${e.replies?`, ${e.replies} replies`:\"\"}`,onClick:()=>a(`${Re}/compose/post?in_reply_to=${e.postId}`),children:[(0,_.jsx)(ve,{name:\"reply\"}),(0,_.jsx)(\"span\",{children:e.replies})]}),(0,_.jsxs)(\"span\",{className:e.reposted?\"action reposted\":\"action\",\"aria-label\":`${e.reposts||\"No\"} reposts`,role:\"img\",children:[(0,_.jsx)(ve,{name:\"repost\"}),(0,_.jsx)(\"span\",{children:e.reposts})]}),(0,_.jsxs)(\"button\",{type:\"button\",className:u.shown?\"action liked\":\"action\",\"aria-pressed\":u.shown,disabled:!n||!e.canLike||u.busy,\"aria-label\":`${u.shown?\"Unlike\":\"Like\"}${e.likes?`, ${e.likes} likes`:\"\"}`,onClick:u.toggle,children:[(0,_.jsx)(ve,{name:\"heart\",filled:u.shown}),(0,_.jsx)(\"span\",{children:e.likes})]}),(0,_.jsxs)(\"button\",{type:\"button\",className:\"action\",\"aria-label\":`${e.views||\"No\"} views`,disabled:!e.views,onClick:()=>a(`${e.url}/analytics`),children:[(0,_.jsx)(ve,{name:\"views\"}),(0,_.jsx)(\"span\",{children:e.views})]}),(0,_.jsx)(\"button\",{type:\"button\",className:i.shown?\"action bookmarked\":\"action\",\"aria-pressed\":i.shown,disabled:!n||!e.canBookmark||i.busy,\"aria-label\":i.shown?\"Remove bookmark\":\"Bookmark\",onClick:i.toggle,children:(0,_.jsx)(ve,{name:\"bookmark\",filled:i.shown})}),(0,_.jsx)(\"button\",{type:\"button\",className:\"action\",\"aria-label\":\"Save to categories\",onClick:l,children:(0,_.jsx)(ve,{name:\"folder\"})})]}),(u.failed||i.failed)&&(0,_.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"That didn't go through on X. Try again.\"})]})}var I=L(ae(),1);function Lf({active:e}){let{navigate:t}=ge();return(0,I.jsx)(Ja,{label:\"Saved\",options:[{id:\"bookmarks\",label:\"Bookmarks\",go:()=>t({url:`${Re}/i/history`,context:\"primary\",mode:e===\"categories\"?\"push\":\"replace\"})},{id:\"likes\",label:\"Likes\",go:()=>t({url:`${Re}/i/history/likes`,context:\"primary\",mode:e===\"categories\"?\"push\":\"replace\"})},{id:\"categories\",label:\"Categories\",go:()=>t({screen:\"categories\",mode:\"root\"})}],active:e})}var $h={home:\"Home\",notifications:\"Notifications\",saved:\"Saved\"},US={home:\"Sign in to see your timeline.\",notifications:\"Sign in to see your notifications.\",saved:\"Sign in to see your bookmarks and likes.\"};function HS(e,t){if(e===\"/home\")return{kind:\"home\",likes:!1,handle:null};if(e===\"/notifications\")return{kind:\"notifications\",likes:!1,handle:null};if(e===\"/i/history/likes\")return{kind:\"saved\",likes:!0,handle:null};let n=/^\\/([A-Za-z0-9_]{1,15})\\/likes$/.exec(e)?.[1]??null;return n?n.toLowerCase()===t?.toLowerCase()?{kind:\"saved\",likes:!0,handle:null}:{kind:\"likes\",likes:!0,handle:n}:{kind:\"saved\",likes:!1,handle:null}}function rc(){let e=ct(),t=pn(\"timeline\"),n=Nt(\"empty\",null),l=e.url?new URL(e.url).pathname:\"/home\",{kind:a,likes:u,handle:i}=HS(l,e.account),o=e.pageId===\"timeline\"?t.order:[],c=e.account!==null&&!e.stale&&!t.ephemeral,f=e.pageId===\"timeline\"&&t.status===\"error\",d;return e.status===\"auth\"?d=(0,I.jsx)(Ka,{reason:US[a]??\"Sign in to see this page.\"}):o.length===0?f?d=(0,I.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}):e.status===\"ready\"&&e.pageId===\"timeline\"?d=(0,I.jsx)(Ze,{title:n?.data??\"Nothing here yet\",children:(0,I.jsx)(\"p\",{children:a===\"notifications\"?\"New activity shows up here.\":a===\"saved\"?\"Posts you bookmark or like on X appear here.\":\"X has nothing to show here right now.\"})}):d=e.status===\"error\"?(0,I.jsx)(vn,{error:e.error}):(0,I.jsx)(Pe,{label:`Loading ${$h[a]??\"posts\"}`}):d=(0,I.jsxs)(I.Fragment,{children:[e.status===\"error\"&&(0,I.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),f&&(0,I.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}),(0,I.jsx)(qf,{region:\"timeline\",items:t,actionable:c}),(0,I.jsx)(ui,{stale:e.stale})]}),(0,I.jsxs)(Qe,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,I.jsx)(\"h1\",{className:\"screen-title\",children:a===\"likes\"?`@${i}\\u2019s likes`:$h[a]??\"Posts\"}),a===\"saved\"&&(0,I.jsx)(Lf,{active:u?\"likes\":\"bookmarks\"}),d]})}function qf({region:e,items:t,actionable:n}){return(0,I.jsx)(\"div\",{className:\"feed\",children:t.order.map(l=>{let a=t.get(l)?.data;return a?a.kind===\"post\"?(0,I.jsx)(Fa,{post:a.post,region:e,actionable:n},l):(0,I.jsx)(LS,{notice:a.notice},l):null})})}function ui({stale:e}){let t=nc(\"loadMore\"),n=lc(null,null).some(i=>i.name===\"loadMore\"),[l,a]=(0,Fh.useState)(!1);return(0,I.jsxs)(\"div\",{className:\"more\",children:[l&&(0,I.jsx)(\"p\",{className:\"post-meta\",role:\"status\",children:\"No more posts right now.\"}),(0,I.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:n||e,onClick:()=>{t(null).then(i=>a(i.outcome!==\"observed\"))},children:n?\"Loading\\u2026\":\"Show more\"})]})}function LS({notice:e}){let t=Ot(),n=(0,I.jsxs)(I.Fragment,{children:[e.avatars.length>0&&(0,I.jsx)(\"span\",{className:\"notice-avatars\",children:e.avatars.map(l=>(0,I.jsx)(gl,{src:l,size:32},l))}),(0,I.jsx)(\"span\",{className:\"notice-text\",children:e.text})]});return e.url?(0,I.jsx)(\"button\",{type:\"button\",className:\"notification\",onClick:()=>t(e.url),children:n}):(0,I.jsx)(\"div\",{className:\"notification\",children:n})}var R=L(ae(),1);function ii({library:e,children:t}){let[n,l]=(0,qt.useState)(!1),[a,u]=(0,qt.useState)(\"\"),i=e.error?.code;return i===\"SIGN_IN\"?(0,R.jsx)(Ka,{reason:\"Categories belong to your X account. Sign in to use them.\"}):i===\"ACCOUNT_UNKNOWN\"||e.loading&&!e.library?(0,R.jsx)(Pe,{label:\"Loading categories\",rows:4,kind:\"text\"}):e.error?(0,R.jsxs)(Ze,{title:i===\"ACCOUNT_MISMATCH\"?\"Different account\":\"Categories are unavailable\",role:\"alert\",children:[(0,R.jsx)(\"p\",{children:hn(e.error)}),i!==\"ACCOUNT_MISMATCH\"&&(0,R.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:e.reload,children:\"Try again\"})]}):e.pending?(0,R.jsxs)(Ze,{title:\"Check the last change\",role:\"alert\",children:[(0,R.jsx)(\"p\",{children:\"The last change to your categories may not have finished. Check it before making another.\"}),a&&(0,R.jsx)(\"p\",{className:\"inline-error\",children:a}),(0,R.jsx)(\"button\",{type:\"button\",className:\"primary\",disabled:n,onClick:()=>{l(!0),u(\"\"),e.check().catch(o=>u(hn(o))).finally(()=>l(!1))},children:n?\"Checking\\u2026\":\"Check last change\"})]}):(0,R.jsx)(R.Fragment,{children:t})}function Wh(){let{navigate:e}=ge(),t=$a(),[n,l]=(0,qt.useState)(null),[a,u]=(0,qt.useState)(\"\"),[i,o]=(0,qt.useState)(\"\"),[c,f]=(0,qt.useState)({entries:[],cursor:null,loading:!0,error:null}),d=t.library?.revision,{service:g}=t,r=ac(\"preferences\"),s=t.library?`library:${t.library.libraryId}`:null,y=s?(r.records.find(N=>N.key===s)??r.records.find(N=>N.key===\"library\"))?.value??null:null,[S,x]=(0,qt.useState)(null);(0,qt.useEffect)(()=>{!s||r.loading||S===s||(x(s),typeof y?.query==\"string\"&&(o(y.query),u(y.query)),y?.categoryId&&t.categories.some(N=>N.id===y.categoryId)&&l(y.categoryId))},[s,r.loading,S,y,t.categories]),(0,qt.useEffect)(()=>{let N=y?y.query===i&&y.categoryId===n:!i&&n===null;!s||S!==s||N||r.put(s,{query:i,categoryId:n,scroll:y?.scroll??0}).catch(()=>{})},[s,S,i,n]);let p=!!t.library&&!t.error&&!t.pending&&S===s;(0,qt.useEffect)(()=>{if(!p)return;let N=!0;return f(M=>({...M,loading:!0,error:null})),g.query(n,i,null).then(M=>{N&&f({entries:M.entries,cursor:M.nextCursor,loading:!1,error:null})},M=>{N&&f(A=>({...A,loading:!1,error:M}))}),()=>{N=!1}},[p,g,n,i,d]);let m=()=>{!c.cursor||c.loading||(f(N=>({...N,loading:!0})),g.query(n,i,c.cursor).then(N=>{f(M=>({entries:[...M.entries,...N.entries],cursor:N.nextCursor,loading:!1,error:null}))},N=>f(M=>({...M,loading:!1,error:N}))))},h=new Map(t.categories.map(N=>[N.id,N.name])),b=t.categories.reduce((N,M)=>N+M.count,0);return(0,R.jsxs)(Qe,{className:\"screen\",children:[(0,R.jsx)(\"h1\",{className:\"screen-title\",children:\"Saved\"}),(0,R.jsx)(Lf,{active:\"categories\"}),(0,R.jsxs)(ii,{library:t,children:[(0,R.jsxs)(\"div\",{className:\"chips\",role:\"group\",\"aria-label\":\"Filter by category\",children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":n===null,onClick:()=>l(null),children:\"All\"}),t.categories.map(N=>(0,R.jsxs)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":n===N.id,onClick:()=>l(N.id),children:[N.name,\" \",(0,R.jsx)(\"span\",{className:\"chip-count\",children:N.count})]},N.id))]}),(0,R.jsx)(\"form\",{className:\"search-form\",role:\"search\",onSubmit:N=>{N.preventDefault(),o(a.trim())},children:(0,R.jsxs)(\"label\",{className:\"search-field\",children:[(0,R.jsx)(ve,{name:\"search\"}),(0,R.jsx)(\"span\",{className:\"visually-hidden\",children:\"Search saved posts\"}),(0,R.jsx)(\"input\",{type:\"search\",placeholder:\"Search saved posts\",value:a,enterKeyHint:\"search\",onChange:N=>{u(N.target.value),N.target.value||o(\"\")}})]})}),(0,R.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>e({screen:\"manage\"}),children:[(0,R.jsx)(ve,{name:\"folder\"}),\" Manage categories\"]}),c.error!=null&&(0,R.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:hn(c.error)}),c.entries.length===0&&!c.loading&&!c.error&&(0,R.jsx)(Ze,{title:i?\"No matches\":t.categories.length?\"Nothing filed here\":\"No categories yet\",children:(0,R.jsx)(\"p\",{children:i?\"Try other words.\":t.categories.length?b?\"No saved posts in this category.\":\"Tap the folder on any post to file it.\":\"Create a category, then tap the folder on any post to file it.\"})}),(0,R.jsx)(\"div\",{className:\"feed\",children:c.entries.map(N=>(0,R.jsx)(qS,{entry:N,names:h},N.postId))}),c.loading&&(0,R.jsx)(Pe,{label:\"Loading saved posts\",rows:c.entries.length?1:4}),c.cursor&&!c.loading&&(0,R.jsx)(\"button\",{type:\"button\",className:\"secondary more\",onClick:m,children:\"Load more\"})]})]})}function qS({entry:e,names:t}){let n=Ot(),{navigate:l}=ge(),{snapshot:a}=e;return(0,R.jsx)(\"article\",{className:\"post saved-post\",children:(0,R.jsxs)(\"div\",{className:\"post-body\",children:[(0,R.jsxs)(\"header\",{className:\"post-head\",children:[(0,R.jsx)(\"a\",{className:\"post-name\",href:xt(a.authorHandle),onClick:u=>{u.preventDefault(),n(xt(a.authorHandle))},children:(0,R.jsx)(\"strong\",{children:a.authorName})}),(0,R.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",a.authorHandle]})]}),(0,R.jsx)(\"button\",{type:\"button\",className:\"post-content plain\",onClick:()=>n(e.url),children:(0,R.jsx)(\"span\",{className:\"post-text\",dir:\"auto\",children:a.text||(a.media.count?`${a.media.count} ${a.media.kind===\"video\"?\"video\":\"media\"}`:\"Post\")})}),(0,R.jsxs)(\"div\",{className:\"pills\",children:[e.categoryIds.map(u=>t.has(u)&&(0,R.jsx)(\"span\",{className:\"pill\",children:t.get(u)},u)),(0,R.jsx)(\"button\",{type:\"button\",className:\"text-button\",onClick:()=>l({screen:\"save\",params:{post:JSON.stringify({postId:e.postId,url:e.url,snapshot:a})}}),children:\"Edit\"})]})]})})}var Ph=L(et(),1);var B=L(ae(),1),GS=[{id:\"\",label:\"Top\"},{id:\"live\",label:\"Latest\"},{id:\"user\",label:\"People\"},{id:\"media\",label:\"Media\"}];function e0(){let{navigate:e}=ge(),t=ct(),n=pn(\"trends\"),l=pn(\"people\"),a=pn(\"results\"),u=Nt(\"empty\",null),i=Ot(),o=new URL(t.url??\"https://x.com/explore\"),c=o.pathname,f=c===\"/search\"?t.params.q??\"\":c.startsWith(\"/hashtag/\")?`#${t.params.tag}`:\"\",d=o.searchParams.get(\"f\")??\"\",[g,r]=(0,Ph.useState)(f),s=t.pageId===\"explore\",y={trends:s?n.order:[],people:s?l.order:[],results:s?a.order:[]},S=t.account!==null&&!t.stale&&!a.ephemeral,x=s&&[n,l,a].some(h=>h.status===\"error\"),p=x&&(0,B.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some results couldn't be read.\"}),m;return!y.trends.length&&!y.people.length&&!y.results.length?m=x?p:s&&t.status===\"ready\"?(0,B.jsx)(Ze,{title:u?.data??\"No results\",children:(0,B.jsx)(\"p\",{children:\"Try a different search.\"})}):t.status===\"error\"?(0,B.jsx)(vn,{error:t.error}):(0,B.jsx)(Pe,{label:f?\"Searching\":\"Loading trends\"}):m=(0,B.jsxs)(B.Fragment,{children:[t.status===\"error\"&&(0,B.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),p,y.trends.length>0&&(0,B.jsxs)(\"section\",{\"aria-label\":\"Trends\",children:[!f&&(0,B.jsx)(\"h2\",{className:\"section-title\",children:\"Trends for you\"}),y.trends.map(h=>{let b=n.get(h)?.data;return b&&(0,B.jsxs)(\"button\",{type:\"button\",className:\"trend\",onClick:()=>i(oc(b.name)),children:[b.context&&(0,B.jsx)(\"span\",{className:\"post-meta\",children:b.context}),(0,B.jsx)(\"strong\",{children:b.name}),b.meta&&(0,B.jsx)(\"span\",{className:\"post-meta\",children:b.meta})]},h)})]}),y.people.length>0&&(0,B.jsxs)(\"section\",{\"aria-label\":\"People\",children:[d!==\"user\"&&(0,B.jsx)(\"h2\",{className:\"section-title\",children:\"People\"}),y.people.map(h=>{let b=l.get(h)?.data;return b&&(0,B.jsx)(BS,{person:b},h)})]}),y.results.length>0&&(0,B.jsx)(\"div\",{className:\"feed\",children:y.results.map(h=>{let b=a.get(h)?.data;return b&&(0,B.jsx)(Fa,{post:b,region:\"results\",actionable:S},h)})}),f&&(0,B.jsx)(ui,{stale:t.stale})]}),(0,B.jsxs)(Qe,{className:\"screen\",\"aria-busy\":t.stale||t.status===\"loading\",children:[(0,B.jsx)(\"form\",{role:\"search\",className:\"search-form\",onSubmit:h=>{h.preventDefault();let b=g.trim();b&&e({url:oc(b,d||void 0),mode:f?\"replace\":\"push\"})},children:(0,B.jsxs)(\"label\",{className:\"search-field\",children:[(0,B.jsx)(ve,{name:\"search\"}),(0,B.jsx)(\"span\",{className:\"visually-hidden\",children:\"Search X\"}),(0,B.jsx)(\"input\",{type:\"search\",enterKeyHint:\"search\",placeholder:\"Search\",value:g,onChange:h=>r(h.target.value)})]})}),f&&(0,B.jsx)(Ja,{label:\"Result type\",active:d,options:GS.map(h=>({...h,go:()=>e({url:oc(f,h.id||void 0),mode:\"replace\"})}))}),m]})}function BS({person:e}){let t=Ot();return(0,B.jsxs)(\"button\",{type:\"button\",className:\"person\",onClick:()=>t(xt(e.handle)),children:[(0,B.jsx)(gl,{src:e.avatar}),(0,B.jsxs)(\"span\",{className:\"person-body\",children:[(0,B.jsxs)(\"span\",{className:\"post-head\",children:[(0,B.jsx)(\"strong\",{children:e.name}),e.verified&&(0,B.jsx)(Za,{})]}),(0,B.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",e.handle]}),e.description&&(0,B.jsx)(\"span\",{className:\"person-bio\",children:e.description})]})]})}var Xl=L(et(),1);var Q=L(ae(),1);function t0(){let e=$a(),[t,n]=(0,Xl.useState)(\"\"),[l,a]=(0,Xl.useState)(!1),[u,i]=(0,Xl.useState)(\"\"),o=async(d,g,r)=>{a(!0),i(\"\");try{return await e.operate(d,g,r),!0}catch(s){return i(hn(s)),!1}finally{a(!1)}},c=async()=>{let d=ai(t);if(d){i(d);return}let g=crypto.randomUUID();await o(\"category.create\",{id:g,name:t},g)&&n(\"\")},f=e.categories.length;return(0,Q.jsxs)(Qe,{className:\"screen\",children:[(0,Q.jsx)(\"h1\",{className:\"screen-title\",children:\"Manage categories\"}),(0,Q.jsxs)(ii,{library:e,children:[(0,Q.jsxs)(\"p\",{className:\"post-meta\",children:[f,\" of \",50,\" categories\"]}),f<50&&(0,Q.jsxs)(\"form\",{className:\"row\",onSubmit:d=>{d.preventDefault(),c()},children:[(0,Q.jsxs)(\"label\",{className:\"grow\",children:[(0,Q.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,Q.jsx)(\"input\",{placeholder:\"New category\",value:t,maxLength:80,enterKeyHint:\"done\",disabled:l,onChange:d=>n(d.target.value)})]}),(0,Q.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:l||!t.trim(),children:\"Create\"})]}),u&&(0,Q.jsx)(\"p\",{role:\"status\",className:\"status\",children:u}),(0,Q.jsx)(\"div\",{className:\"category-list\",children:e.categories.map(d=>(0,Q.jsx)(kS,{category:d,busy:l,run:o},d.id))})]})]})}function kS({category:e,busy:t,run:n}){let[l,a]=(0,Xl.useState)(\"view\"),[u,i]=(0,Xl.useState)(e.name),[o,c]=(0,Xl.useState)(\"\");return l===\"rename\"?(0,Q.jsxs)(\"form\",{className:\"category\",onSubmit:async f=>{f.preventDefault();let d=ai(u);if(d){c(d);return}await n(\"category.rename\",{id:e.id,expectedRevision:e.revision,name:u},e.id)&&a(\"view\")},children:[(0,Q.jsxs)(\"label\",{children:[(0,Q.jsxs)(\"span\",{className:\"visually-hidden\",children:[\"Name for \",e.name]}),(0,Q.jsx)(\"input\",{value:u,maxLength:80,autoFocus:!0,enterKeyHint:\"done\",onChange:f=>{i(f.target.value),c(\"\")}})]}),o&&(0,Q.jsx)(\"p\",{className:\"field-error\",children:o}),(0,Q.jsxs)(\"div\",{className:\"actions\",children:[(0,Q.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:t||!u.trim(),children:\"Save\"}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t,onClick:()=>{i(e.name),a(\"view\")},children:\"Cancel\"})]})]}):(0,Q.jsxs)(\"div\",{className:\"category\",children:[(0,Q.jsxs)(\"div\",{className:\"category-head\",children:[(0,Q.jsxs)(\"span\",{className:\"grow\",children:[(0,Q.jsx)(\"strong\",{children:e.name}),\" \",(0,Q.jsxs)(\"span\",{className:\"post-meta\",children:[e.count,\" \",e.count===1?\"post\":\"posts\"]})]}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"text-button\",disabled:t,onClick:()=>a(\"rename\"),children:\"Rename\"}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:t,onClick:()=>a(\"delete\"),children:\"Delete\"})]}),l===\"delete\"&&(0,Q.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":`Confirm deleting ${e.name}`,children:[(0,Q.jsx)(\"p\",{children:e.count?`Delete \\u201C${e.name}\\u201D? Move or remove its ${e.count} saved posts first.`:`Delete \\u201C${e.name}\\u201D?`}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:t,onClick:async()=>{await n(\"category.delete\",{id:e.id,expectedRevision:e.revision},e.id)&&a(\"view\")},children:\"Delete\"}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t,onClick:()=>a(\"view\"),children:\"Keep\"})]})]})}var De=L(ae(),1);function n0(){let{navigate:e,back:t,viewWebsite:n}=ge(),l=ct(),a=Nt(\"photos\",null),{handle:u,id:i,index:o}=l.params,c=Number(o)||1,f=g=>e({url:`${Re}/${u}/status/${i}/photo/${g}`,mode:\"replace\"}),d=l.stale||l.pageId!==\"media\"?null:a?.data??null;return(0,De.jsxs)(\"div\",{className:\"media-viewer\",children:[(0,De.jsx)(\"button\",{type:\"button\",className:\"media-close\",\"aria-label\":\"Close\",onClick:t,children:(0,De.jsx)(ve,{name:\"close\"})}),(0,De.jsx)(\"div\",{className:\"media-stage\",children:d?.image?(0,De.jsx)(\"img\",{src:d.image,alt:`Photo ${c}`,referrerPolicy:\"no-referrer\"}):l.status===\"error\"?(0,De.jsxs)(\"div\",{className:\"media-message\",children:[(0,De.jsx)(\"p\",{children:\"This photo couldn't be shown.\"}),(0,De.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>n(),children:[\"Open on X \",(0,De.jsx)(ve,{name:\"external\"})]})]}):(0,De.jsx)(\"p\",{className:\"media-message\",role:\"status\",children:\"Loading photo\\u2026\"})}),(0,De.jsxs)(\"div\",{className:\"media-nav\",children:[(0,De.jsx)(\"button\",{type:\"button\",className:\"icon-button\",\"aria-label\":\"Previous photo\",disabled:c<=1,onClick:()=>f(c-1),children:(0,De.jsx)(ve,{name:\"left\"})}),(0,De.jsx)(\"span\",{children:c}),(0,De.jsx)(\"button\",{type:\"button\",className:\"icon-button\",\"aria-label\":\"Next photo\",disabled:!d?.hasNext,onClick:()=>f(c+1),children:(0,De.jsx)(ve,{name:\"right\"})})]})]})}var Ue=L(ae(),1);function l0(){let e=ct(),t=pn(\"thread\"),n=Nt(\"empty\",null),a=(e.pageId===\"post\"?t.order:[]).flatMap(d=>{let g=t.get(d)?.data;return g?.kind===\"post\"?[{key:d,post:g.post}]:[]}),u=a.findIndex(({post:d})=>d.postId===e.params.id),i=e.account!==null&&!e.stale&&!t.ephemeral,o=({key:d,post:g},r=!1)=>(0,Ue.jsx)(Fa,{post:g,region:\"thread\",actionable:i,focus:r},d),c=e.pageId===\"post\"&&t.status===\"error\",f;if(u<0)f=e.status===\"error\"?(0,Ue.jsx)(vn,{error:e.error}):c?(0,Ue.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"This post couldn't be read.\"}):e.status===\"ready\"&&e.pageId===\"post\"?(0,Ue.jsx)(Ze,{title:n?.data??\"This post isn't available\",children:(0,Ue.jsx)(\"p\",{children:\"X has nothing to show for it.\"})}):(0,Ue.jsx)(Pe,{label:\"Loading post\",rows:3});else{let d=a.slice(u+1);f=(0,Ue.jsxs)(Ue.Fragment,{children:[e.status===\"error\"&&(0,Ue.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),c&&(0,Ue.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some replies couldn't be read.\"}),(0,Ue.jsxs)(\"div\",{className:\"feed thread\",children:[a.slice(0,u).map(g=>o(g)),o(a[u],!0)]}),d.length>0&&(0,Ue.jsx)(\"h2\",{className:\"section-title\",children:\"Replies\"}),(0,Ue.jsx)(\"div\",{className:\"feed\",children:d.map(g=>o(g))})]})}return(0,Ue.jsxs)(Qe,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,Ue.jsx)(\"h1\",{className:\"screen-title\",children:\"Post\"}),f]})}var j=L(ae(),1),a0=[{id:\"\",label:\"Posts\"},{id:\"/with_replies\",label:\"Replies\"},{id:\"/media\",label:\"Media\"}];function u0(){let{navigate:e}=ge(),t=ct(),n=Nt(\"header\",null),l=pn(\"posts\"),a=Nt(\"empty\",null),u=t.params.handle??\"\",i=t.url?new URL(t.url).pathname:\"\",o=a0.find(y=>y.id&&i.endsWith(y.id))?.id??\"\",c=t.pageId===\"profile\",f=c?n?.data??null:null,d=c?l.order:[],g=t.account!==null&&!t.stale&&!l.ephemeral,r=c&&l.status===\"error\",s;return!f&&d.length===0?s=t.status===\"error\"?(0,j.jsx)(vn,{error:t.error}):r?(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}):(0,j.jsx)(Pe,{label:\"Loading profile\"}):s=(0,j.jsxs)(j.Fragment,{children:[t.status===\"error\"&&(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),f?(0,j.jsx)(YS,{profile:f}):(0,j.jsxs)(\"h1\",{className:\"screen-title\",children:[\"@\",u]}),(0,j.jsx)(Ja,{label:\"Profile sections\",active:o,options:a0.map(y=>({...y,go:()=>e({url:`${xt(u)}${y.id}`,mode:\"replace\"})}))}),d.length===0&&r?(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}):d.length===0?(0,j.jsx)(Ze,{title:a?.data??\"No posts yet\",children:(0,j.jsx)(\"p\",{children:f?\"Posts show up here.\":\"X has nothing to show for this account.\"})}):(0,j.jsxs)(j.Fragment,{children:[r&&(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}),(0,j.jsx)(qf,{region:\"posts\",items:l,actionable:g}),(0,j.jsx)(ui,{stale:t.stale})]})]}),(0,j.jsx)(Qe,{className:\"screen profile-screen\",\"aria-busy\":t.stale||t.status===\"loading\",children:s})}function YS({profile:e}){let t=Ot();return(0,j.jsxs)(\"header\",{className:\"profile\",children:[(0,j.jsx)(\"div\",{className:\"banner\",children:e.banner&&(0,j.jsx)(\"img\",{src:e.banner,alt:\"\",referrerPolicy:\"no-referrer\"})}),(0,j.jsxs)(\"div\",{className:\"profile-top\",children:[(0,j.jsx)(gl,{src:e.avatar,size:80}),e.own&&(0,j.jsx)(Hf,{url:`${Re}/settings/profile`,label:\"Edit profile\"})]}),(0,j.jsxs)(\"h1\",{className:\"profile-name\",children:[e.name,e.verified&&(0,j.jsx)(Za,{})]}),(0,j.jsxs)(\"p\",{className:\"post-meta\",children:[\"@\",e.handle]}),e.description&&(0,j.jsx)(\"p\",{className:\"post-text\",dir:\"auto\",children:e.description}),e.details&&(0,j.jsx)(\"p\",{className:\"post-meta\",children:e.details}),e.links.length>0&&(0,j.jsx)(\"p\",{className:\"profile-links\",children:e.links.map(n=>(0,j.jsx)(\"a\",{href:n.url,onClick:l=>{l.preventDefault(),t(n.url)},children:n.label},n.url))})]})}var Gt=L(et(),1);var U=L(ae(),1);function VS(e){try{let t=JSON.parse(e??\"\");return wf(t?.postId)&&Cf(t.url)?.postId===t.postId&&Df(t.snapshot)?t:null}catch{return null}}function o0(){let{screen:e,back:t}=ge(),n=$a(),l=(0,Gt.useMemo)(()=>VS(e?.params.post),[e?.params.post]),[a,u]=(0,Gt.useState)(void 0),[i,o]=(0,Gt.useState)(null),[c,f]=(0,Gt.useState)(0),[d,g]=(0,Gt.useState)(!1),[r,s]=(0,Gt.useState)(\"\"),[y,S]=(0,Gt.useState)(\"\"),[x,p]=(0,Gt.useState)(!1),{service:m}=n,h=!!n.library&&!n.error&&!n.pending;if((0,Gt.useEffect)(()=>{if(!l||!h)return;let $=!0;return m.lookup(l.postId).then(xe=>{$&&(u(xe),o(xe?.categoryIds??[]))},xe=>{$&&s(hn(xe))}),()=>{$=!1}},[l,h,m,c]),!l)return(0,U.jsx)(\"div\",{className:\"screen\",children:(0,U.jsx)(Ze,{title:\"Can't file this post\",role:\"alert\",children:(0,U.jsx)(\"p\",{children:\"The post details are missing.\"})})});let b=new Set(n.categories.map($=>$.id)),N=(i??[]).filter($=>b.has($)),M=N.length>=10,A=$=>{let xe=$.code;s(xe===\"CONFLICT\"?\"This post's categories changed elsewhere. They were reloaded; review them and save again.\":hn($)),xe===\"CONFLICT\"&&(o(null),f(Kt=>Kt+1))},z=async()=>{g(!0),s(\"\");try{await n.operate(\"bookmark.setCategories\",{postId:l.postId,expectedRevision:a?.revision??null,categoryIds:N,...a?{}:{url:l.url,snapshot:l.snapshot}},l.postId),t()}catch($){A($)}finally{g(!1)}},fe=async()=>{if(a){g(!0),s(\"\");try{await n.operate(\"bookmark.remove\",{postId:l.postId,expectedRevision:a.revision},l.postId),t()}catch($){p(!1),A($)}finally{g(!1)}}},G=async()=>{let $=ai(y);if($){s($);return}g(!0),s(\"\");let xe=crypto.randomUUID();try{await n.operate(\"category.create\",{id:xe,name:y},xe),S(\"\"),M||o(Kt=>[...new Set([...Kt??[],xe])])}catch(Kt){s(hn(Kt))}finally{g(!1)}},rt=h&&a!==void 0&&i!==null;return(0,U.jsxs)(Qe,{className:\"screen\",children:[(0,U.jsx)(\"h1\",{className:\"screen-title\",children:a?\"Edit categories\":\"Save to categories\"}),(0,U.jsxs)(\"section\",{className:\"card\",children:[(0,U.jsxs)(\"p\",{className:\"post-head\",children:[(0,U.jsx)(\"strong\",{children:l.snapshot.authorName}),\" \",(0,U.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",l.snapshot.authorHandle]})]}),l.snapshot.text&&(0,U.jsx)(\"p\",{className:\"post-text clamp\",dir:\"auto\",children:l.snapshot.text}),(0,U.jsx)(\"p\",{className:\"post-meta\",children:\"Categories are kept by this app, separate from your X bookmarks.\"})]}),(0,U.jsx)(ii,{library:n,children:rt?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(\"fieldset\",{className:\"card\",disabled:d,children:[(0,U.jsx)(\"legend\",{children:\"Categories\"}),n.categories.length===0&&(0,U.jsx)(\"p\",{className:\"post-meta\",children:\"No categories yet. Create one below.\"}),n.categories.map($=>{let xe=N.includes($.id);return(0,U.jsxs)(\"label\",{className:\"check\",children:[(0,U.jsx)(\"input\",{type:\"checkbox\",checked:xe,disabled:!xe&&M,onChange:Kt=>{let ci=$.id;o(Wa=>Kt.target.checked?[...Wa??[],ci]:(Wa??[]).filter(ri=>ri!==ci))}}),(0,U.jsx)(\"span\",{className:\"grow\",children:$.name}),(0,U.jsx)(\"span\",{className:\"post-meta\",children:$.count})]},$.id)}),M&&(0,U.jsxs)(\"p\",{className:\"post-meta\",children:[\"A post can be in up to \",10,\" categories.\"]}),n.categories.length<50?(0,U.jsxs)(\"form\",{className:\"row\",onSubmit:$=>{$.preventDefault(),G()},children:[(0,U.jsxs)(\"label\",{className:\"grow\",children:[(0,U.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,U.jsx)(\"input\",{placeholder:\"New category\",value:y,maxLength:80,enterKeyHint:\"done\",onChange:$=>S($.target.value)})]}),(0,U.jsx)(\"button\",{type:\"submit\",className:\"secondary\",disabled:!y.trim(),children:\"Create\"})]}):(0,U.jsxs)(\"p\",{className:\"post-meta\",children:[\"You have \",50,\" categories, the most allowed.\"]})]}),r&&(0,U.jsx)(\"p\",{role:\"status\",className:\"status\",children:r}),(0,U.jsxs)(\"div\",{className:\"actions\",children:[(0,U.jsx)(\"button\",{type:\"button\",className:\"primary\",disabled:d||N.length===0,onClick:()=>{z()},children:d?\"Saving\\u2026\":\"Save\"}),(0,U.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:d,onClick:t,children:\"Cancel\"}),a&&!x&&(0,U.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:d,onClick:()=>p(!0),children:\"Remove from Categories\"})]}),N.length===0&&(0,U.jsx)(\"p\",{className:\"post-meta\",children:a?\"Choose a category, or remove the post from Categories.\":\"Choose at least one category.\"}),x&&(0,U.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":\"Confirm removal\",children:[(0,U.jsx)(\"p\",{children:\"Remove this post from Categories? Its X bookmark will stay unchanged.\"}),(0,U.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:d,onClick:()=>{fe()},children:\"Remove\"}),(0,U.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:d,onClick:()=>p(!1),children:\"Keep\"})]})]}):(0,U.jsx)(Pe,{label:\"Loading categories\",rows:3,kind:\"text\"})}),!n.error&&r&&!rt&&(0,U.jsx)(\"p\",{role:\"status\",className:\"status\",children:r})]})}var Ln=L(ae(),1),jS={home:rc,notifications:rc,saved:rc,explore:e0,post:l0,profile:u0,media:n0,account:Kh,categories:Wh,save:o0,manage:t0},XS=[{id:\"home\",label:\"Home\",icon:\"home\"},{id:\"explore\",label:\"Explore\",icon:\"search\"},{id:\"notifications\",label:\"Notifications\",icon:\"bell\"},{id:\"saved\",label:\"Saved\",icon:\"bookmark\"},{id:\"profile\",label:\"Profile\",icon:\"person\"}],QS={home:\"/home\",notifications:\"/notifications\",saved:\"/i/history\"};function ZS(e){let t=e?new URL(e).pathname:\"/home\";return t===\"/home\"?\"home\":t===\"/notifications\"?\"notifications\":t.startsWith(\"/i/history\")||t===\"/i/bookmarks\"?\"saved\":null}function r0(){let{screen:e,active:t,contexts:n,overlay:l,select:a,navigate:u,reload:i}=ge();uc(()=>i(\"account\"));let o=(0,c0.useRef)(\"home\"),c=ZS(n.primary?.url??null);c&&(o.current=c);let f=l.length>0?\"saved\":t===\"explore\"?\"explore\":t===\"account\"?\"profile\":c??o.current,d=r=>{r===\"explore\"?a(\"explore\"):r===\"profile\"?a(\"account\"):r===o.current&&(t!==\"primary\"||l.length>0||r===\"home\")?a(\"primary\"):u({url:`${Re}${QS[r]}`,context:\"primary\"})},g=e?jS[e.id]:void 0;return(0,Ln.jsxs)(\"div\",{className:e?.id===\"media\"?\"app viewing\":\"app\",children:[(0,Ln.jsx)(\"main\",{className:\"content\",children:g&&(0,Ln.jsx)(g,{},e.key)}),(0,Ln.jsx)(\"nav\",{className:\"tabs\",\"aria-label\":\"Sections\",children:XS.map(r=>{let s=r.id===f;return(0,Ln.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":s?\"page\":void 0,onClick:()=>{s&&l.length===0&&c===r.id&&r.id!==\"home\"?document.querySelector(\".screen\")?.scrollTo({top:0,behavior:\"smooth\"}):d(r.id)},children:[(0,Ln.jsx)(ve,{name:r.icon,filled:s}),(0,Ln.jsx)(\"span\",{children:r.label})]},r.id)})})]})}var s0=L(ae(),1);qh((0,s0.jsx)(r0,{}));})();\n"},{"path":"index.html","encoding":"utf8","content":"\n\n\n\n\nX\n\n\n\n\n
\n\n\n\n"}]} \ No newline at end of file diff --git a/x-bookmarks/published/applet-x-bookmarks.release.json b/x-bookmarks/published/applet-x-bookmarks.release.json new file mode 100644 index 0000000..b73d508 --- /dev/null +++ b/x-bookmarks/published/applet-x-bookmarks.release.json @@ -0,0 +1,40 @@ +{ + "releaseFormat": 1, + "appletId": "x-bookmarks", + "name": "X", + "version": "0.1.0", + "bundle": { + "file": "applet-x-bookmarks.bundle.json", + "sha256": "17dc77590f03244d2fec222f48c5ae85773453f5338286b77036655346db3718", + "size": 357380 + }, + "compat": { + "manifestSchema": 6, + "bundleFormat": 3, + "protocol": 1, + "adapterApi": 1, + "sdk": "0.0.0", + "tools": "0.0.0", + "builtAt": "2026-11-09T11:21:14Z" + }, + "origins": [ + "https://x.com" + ], + "capabilities": { + "storage": true, + "services": [ + "bookmarks" + ] + }, + "toolchain": { + "genesisCommit": "655ce128bce13bd8a376a3630766fb18182ba928", + "node": "24.15.0", + "tools": "0.0.0", + "sdk": "0.0.0" + }, + "home": { + "fullName": "nirvanacp/applets", + "path": "x-bookmarks" + }, + "builtAt": "2026-11-09T11:21:14Z" +} From 184cf13893606292b2c3c801a3f4d6237baa9af7 Mon Sep 17 00:00:00 2001 From: Rit Date: Mon, 9 Nov 2026 16:51:55 +0530 Subject: [PATCH 4/9] feat/(gmail-only): publish 0.1.0 Co-Authored-By: Claude Opus 5.5 --- .../2026-11-09-165141-publish-0.1.0.md | 6 +++ gmail-only/.specs/current.md | 1 + .../published/applet-gmail-only.bundle.json | 1 + .../published/applet-gmail-only.release.json | 38 +++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 gmail-only/.changelog/2026-11-09-165141-publish-0.1.0.md create mode 100644 gmail-only/published/applet-gmail-only.bundle.json create mode 100644 gmail-only/published/applet-gmail-only.release.json diff --git a/gmail-only/.changelog/2026-11-09-165141-publish-0.1.0.md b/gmail-only/.changelog/2026-11-09-165141-publish-0.1.0.md new file mode 100644 index 0000000..f2de445 --- /dev/null +++ b/gmail-only/.changelog/2026-11-09-165141-publish-0.1.0.md @@ -0,0 +1,6 @@ +# Publish 0.1.0 + +- Goal: The user asked to adopt versioned releases for the applets in this repository, so Genesis can install them from GitHub and check them in CI. +- Changes: `genesis-applet publish` wrote `published/applet-gmail-only.bundle.json` (SHA-256 `e9c94c854254f2b8…`, 444989 bytes) and `published/applet-gmail-only.release.json` for version 0.1.0, built with Genesis commit `655ce128bce1`. The current spec names the published version and tag. Sources, id, service ids and stored data are unchanged. +- Decisions: The first release keeps the existing `package.json` version 0.1.0; dependencies already pin exact versions. The tag `gmail-only/v0.1.0` follows the multi-applet tag format and is created locally after this commit; pushing it is left to the operator. +- Verification: `genesis-applet publish --verify` rebuilt the bundle with the recorded build time and found it identical. `genesis-applet check` and `build` ran as part of publish. Not run on a device; no backend was started. CI has not run because the Genesis commit and this repository are not pushed yet. diff --git a/gmail-only/.specs/current.md b/gmail-only/.specs/current.md index 929681f..3ae767e 100644 --- a/gmail-only/.specs/current.md +++ b/gmail-only/.specs/current.md @@ -12,6 +12,7 @@ Name Gmail Only, id `gmail-only`, origin https://mail\.google\.com. Created 2026 | Adapter API | 1 | | SDK and tools | 0.0.0 | | Kit | 0.0.0 | +| Published release | 0.1.0, tag `gmail-only/v0.1.0`, in `published/` | ## Product scope diff --git a/gmail-only/published/applet-gmail-only.bundle.json b/gmail-only/published/applet-gmail-only.bundle.json new file mode 100644 index 0000000..e0deb70 --- /dev/null +++ b/gmail-only/published/applet-gmail-only.bundle.json @@ -0,0 +1 @@ +{"envelope":1,"bundle":{"format":3,"compat":{"manifestSchema":6,"bundleFormat":3,"protocol":1,"adapterApi":1,"sdk":"0.0.0","tools":"0.0.0","builtAt":"2026-11-09T11:21:15Z"},"manifest":{"schemaVersion":6,"id":"gmail-only","name":"Gmail Only","origins":["https://mail.google.com"],"foreground":{"entry":"src/main.tsx","screens":["mail","todo","item","add","bulk","search","settings","accounts","account-setup","snoozed","menu"]},"adapter":"src/adapter.ts","contexts":[{"id":"primary","startUrl":"https://mail.google.com/mail/u/0/"}],"routes":[{"id":"mail","pattern":"/mail/*","page":"mail","screen":"mail","context":"primary"},{"id":"root","pattern":"/","page":"mail","screen":"mail","context":"primary"}],"capabilities":{"storage":true},"shell":{"accent":"#2347d9"}},"files":[{"path":"adapter.js","sha256":"4cfbe976a517eb7cd38fafa65e6ecbb60b01ab13de90956f95d8c390f1ef2a9a"},{"path":"foreground.css","sha256":"1f8afcbc2ceb8b81e8498f34d2fe8a82faa8af0e7e98d931e093cd2bf0de9e6f"},{"path":"foreground.js","sha256":"c4c2cd291d96febc206a54928495245b836ea20fa6b78c4f0bae5b2e47552915"},{"path":"index.html","sha256":"b19327387a3eb3bc797318bf6f660fb14d55f4031300a0aa85de91f63bd31844"}]},"entries":[{"path":"adapter.js","encoding":"utf8","content":"(()=>{var P={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1};var gt=/^:[A-Za-z][A-Za-z0-9_]*$/,ht=/^[A-Za-z0-9_.~@-]+$/,le=new Map;function yt(e){if(le.has(e))return le.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),r=n.at(-1)===\"*\";r&&n.pop();let s=[],o=!0;for(let i of n)gt.test(i)?s.push({param:i.slice(1)}):ht.test(i)&&i!==\".\"&&i!==\"..\"?s.push({literal:i}):o=!1;o&&(t={segments:s,rest:r})}return le.set(e,t),t}function de(e){try{return new URL(e).href}catch{return null}}function fe(e,t){let n=vt(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let r;try{r=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}r.at(-1)===\"\"&&r.pop();for(let s of e.routes){let o=yt(s.pattern);if(!o)continue;let i=Et(o,r);if(!i||!(s.query??[]).every(a=>n.searchParams.has(a)))continue;for(let a of s.query??[])i[a]=n.searchParams.get(a);let l={kind:\"route\",routeId:s.id,page:s.page,screen:s.screen,params:i};return s.context!==void 0&&(l.context=s.context),l}return{kind:\"website\",url:t}}function vt(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function Et(e,t){if(e.rest?t.length{let s=null,o=!1,i=1,l=new Map,a=new Map,u={get bound(){return s},get retired(){return o},request(y,g={}){if(o)return Promise.reject(new T(\"RETIRED\",\"This page was closed\"));let A=i++;return new Promise((O,D)=>{let N=setTimeout(()=>{l.delete(A),D(new T(\"DEADLINE\",`${y} did not answer in time`))},s.limits.rpcDeadlineMs+wt);l.set(A,{resolve:O,reject:D,timer:N}),e.postMessage(JSON.stringify({type:\"request\",documentId:s.documentId,requestId:A,method:y,params:g}))})},on(y,g){let A=a.get(y);return A||a.set(y,A=new Set),A.add(g),()=>{A.delete(g)}}};function f(){o=!0;for(let y of l.values())clearTimeout(y.timer),y.reject(new T(\"RETIRED\",\"This page was closed\"));l.clear()}function p(y,g){for(let A of[...a.get(y)??[]])try{A(g)}catch(O){console.error(`Genesis ${y} handler failed`,O)}}e.addEventListener(\"message\",y=>{if(o||typeof y.data!=\"string\")return;let g;try{g=JSON.parse(y.data)}catch{return}if(g?.type===\"refused\"&&!s){o=!0,r(new T(g.error?.code??\"PROTOCOL_MISMATCH\",g.error?.message??\"The host refused this page\"));return}if(g?.type===\"bound\"){if(s)return;s=g,n(u);return}if(!(!s||g?.documentId!==s.documentId))if(g.type===\"response\"){let A=l.get(g.requestId);if(!A)return;l.delete(g.requestId),clearTimeout(A.timer),g.error?A.reject(new T(g.error.code,g.error.message)):A.resolve(g.result??null)}else g.type===\"event\"&&(g.name===\"retired\"?(f(),p(\"retired\",{})):p(g.name,g.data))}),addEventListener(\"pagehide\",()=>{o||(p(\"pagehide\",{}),f())});let b={type:\"hello\",protocol:P.protocol,url:t};e.postMessage(JSON.stringify(b))})}var bt=100;function kt(e){let t=new Map,n=Promise.resolve();return{act(r){let s={request:r,arrived:Date.now(),view:e.view(),cancelled:!1,dispatched:!1,stopped:!1};t.set(r.actionId,s),n=n.then(()=>At(e,s)).catch(o=>{console.error(\"Genesis action failed\",o)}).finally(()=>{t.delete(r.actionId)})},cancel(r){let s=t.get(r);s&&!s.dispatched&&(s.cancelled=!0)},retire(){for(let r of t.values())r.stopped=!0}}}async function At(e,t){let{connection:n,limits:r}=e,{actionId:s}=t.request,o,i=(S,_,C)=>{if(t.stopped)return Promise.resolve();let M={actionId:s,state:S};return C&&(M.navigating=!0),C&&o&&(M.expect=o),_&&(M.result=_),n.request(\"context.actionResult\",M).then(()=>{},()=>{})},l=(S,_,C)=>{let M={outcome:\"failed\",code:S,message:_};return C!==void 0&&Object.assign(M,{completedSteps:C,partial:C>0}),i(\"failed\",M)},a=()=>i(\"cancelled\",{outcome:\"cancelled\"});if(t.stopped)return;if(t.cancelled)return a();if((t.request.view??t.view)!==t.view||e.view()!==t.view)return l(\"CONTEXT_REPLACED\",\"The page the action was for has been replaced\");let u=e.find(t.request);if(\"error\"in u)return l(u.error.code,u.error.message);let f=u.element();if(f===void 0)return l(\"TARGET_NOT_FOUND\",\"The item is no longer on the page\");let p;try{p=u.action(f,t.request.args)}catch(S){return l(\"INVALID_STEPS\",De(S))}if(typeof p?.then==\"function\")return l(\"INVALID_STEPS\",\"An action must return its steps synchronously\");if(p&&\"satisfied\"in p&&p.satisfied===!0)return i(\"observed\",{outcome:\"observed\",noop:!0});let b=It(p);if(b)return l(\"INVALID_STEPS\",b);let{steps:y,until:g,deadlineMs:A}=p;o=p.expect;let O=p.navigates===!0||Pe(y.at(-1)),D=t.arrived+(A??r.actionTimeoutMs),N=0,H=S=>(t.dispatched=!0,i(\"dispatched\",void 0,S)),K=n.on(\"pagehide\",()=>{!t.dispatched&&!t.stopped&&N>0&&H(!0),t.stopped=!0}),X=()=>t.stopped||t.cancelled;try{for(let[S,_]of y.entries()){if(t.stopped)return;if(t.cancelled)return a();if(Date.now()>=D)return l(\"DEADLINE\",\"The action did not finish in time\",N);if(S>0&&Le(y[S-1])&&u.element()===void 0)return l(\"TARGET_NOT_FOUND\",\"The item left the page during the action\",N);if(O&&S===y.length-1&&!Le(_)){if(ge(_),await H(!0),t.stopped)return;ge(_)();return}await _t(_,D,X),N++}if(t.stopped)return;if(t.cancelled)return a();if(await H(O),O)return;if(g!==void 0){let S=typeof g==\"string\"?()=>document.querySelector(g)!==null:()=>g(document)===!0;try{await he(S,D-Date.now(),\"the action to take effect\",()=>t.stopped)}catch{return i(\"failed\",{outcome:\"unknown\",code:\"DEADLINE\",message:\"The page did not show the action's effect in time\",completedSteps:N,partial:N>0})}}if(t.stopped)return;e.flush(),await i(\"observed\",{outcome:\"observed\"})}catch(S){let _=S instanceof T?S.code:\"INVALID_ARGUMENT\";return l(_,De(S),N)}finally{K()}}function It(e){if(typeof e!=\"object\"||e===null)return\"An action must return { satisfied: true } or { steps }\";let{steps:t,until:n}=e;if(!Array.isArray(t))return\"An action must return { satisfied: true } or { steps }\";for(let[r,s]of t.entries()){let o=St(s);if(o)return`Step ${r}: ${o}`;if(Pe(s)&&r!==t.length-1)return\"A navigate or submit step must be the last step\"}return n!==void 0&&typeof n!=\"string\"&&typeof n!=\"function\"?\"until must be a selector or a function\":null}function St(e){if(typeof e!=\"object\"||e===null)return\"must be an object\";let t=e,n=r=>typeof r==\"string\"&&r!==\"\";if(\"click\"in t)return n(t.click)?null:\"click needs a selector\";if(\"fill\"in t)return n(t.fill)&&typeof t.value==\"string\"?null:\"fill needs a selector and a string value\";if(\"submit\"in t)return n(t.submit)?null:\"submit needs a selector\";if(\"navigate\"in t)return n(t.navigate)?null:\"navigate needs a URL\";if(\"waitFor\"in t||\"waitForUrl\"in t)return n(t.waitFor??t.waitForUrl)&&typeof t.timeoutMs==\"number\"?null:\"a wait needs a selector or pattern and timeoutMs\";if(\"scroll\"in t){let r=t.scroll;return r&&n(r.target)&&(r.to===\"end\"||typeof r.to==\"number\")?null:\"scroll needs a target and to\"}return\"unknown step\"}var Pe=e=>e!==void 0&&(\"navigate\"in e||\"submit\"in e),Le=e=>\"waitFor\"in e||\"waitForUrl\"in e,De=e=>String(e?.message??e);function Y(e){let t=document.querySelector(e);if(!t)throw new T(\"NOT_FOUND\",`Nothing matches ${e}`);return t}async function _t(e,t,n){let r=()=>Math.max(0,t-Date.now());if(\"waitFor\"in e)await he(()=>document.querySelector(e.waitFor)!==null,Math.min(e.timeoutMs,r()),e.waitFor,n);else if(\"waitForUrl\"in e){let s=new RegExp(e.waitForUrl);await he(()=>s.test(location.href),Math.min(e.timeoutMs,r()),e.waitForUrl,n)}else ge(e)()}function ge(e){if(\"click\"in e){let t=Y(e.click);return()=>t.click()}if(\"fill\"in e){let t=Y(e.fill);return()=>xt(t,e.value)}if(\"submit\"in e){let t=Y(e.submit),n=t instanceof HTMLFormElement?t:t.closest(\"form\");if(!n)throw new T(\"NOT_FOUND\",`${e.submit} is not in a form`);let r=t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t:void 0;return()=>n.requestSubmit(r)}if(\"navigate\"in e){let t=e.navigate;return()=>location.assign(t)}if(\"scroll\"in e){let{target:t,to:n}=e.scroll,r=t===\"window\"?document.scrollingElement??document.documentElement:Y(t);return()=>{r.scrollTop=n===\"end\"?r.scrollHeight:n}}throw new T(\"INVALID_STEPS\",\"A wait step does not run on its own\")}function xt(e,t){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new T(\"INVALID_STEPS\",\"fill needs an input or textarea\");let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(n,\"value\")?.set?.call(e,t),e.dispatchEvent(new Event(\"input\",{bubbles:!0})),e.dispatchEvent(new Event(\"change\",{bubbles:!0}))}function he(e,t,n,r){let s=Date.now()+t;return new Promise((o,i)=>{let l=()=>{try{return e()}catch{return!1}},a=()=>{r()||l()?o():Date.now()>=s?i(new T(\"DEADLINE\",`Timed out waiting for ${n}`)):setTimeout(a,bt)};a()})}var Ce=new WeakMap;function $e(e){let t=Ce.get(e);return t===void 0&&Ce.set(e,t=JSON.stringify(e)),t}function ye(e,t){return e===t?!0:e!==null&&t!==null&&$e(e)===$e(t)}function Q(e,t){return e?.code===t?.code&&e?.message===t?.message}function Tt(e,t){if(e.kind!==t.kind)return{kind:\"replace\",region:t};if(t.kind===\"single\"){let f=e;if(ye(f.record,t.record)&&f.status===t.status&&Q(f.error,t.error))return null;let p={kind:\"single\",record:t.record};return f.status!==t.status&&(p.status=t.status),Q(f.error,t.error)||(p.error=t.error??null),p}let n=e;if(!!n.ephemeral!=!!t.ephemeral||t.ephemeral)return Ot(n,t)?null:{kind:\"replace\",region:t};let r=new Map(n.items.map(f=>[f.key,f])),s=new Set,o=[];for(let f of t.items){s.add(f.key);let p=r.get(f.key);(!p||!ye(p,f))&&o.push(f)}let i=n.items.filter(f=>!s.has(f.key)).map(f=>f.key),l=t.items.map(f=>f.key),a=l.length!==n.items.length||l.some((f,p)=>n.items[p].key!==f),u={kind:\"collection\"};return o.length&&(u.upsert=o),i.length&&(u.remove=i),a&&(u.order=l),n.complete!==t.complete&&(u.complete=t.complete),n.status!==t.status&&(u.status=t.status),Q(n.error,t.error)||(u.error=t.error??null),Object.keys(u).length>1?u:null}function Ot(e,t){return e.complete===t.complete&&e.status===t.status&&Q(e.error,t.error)&&!!e.ephemeral==!!t.ephemeral&&e.items.length===t.items.length&&e.items.every((n,r)=>ye(n,t.items[r]))}function Mt(e,t,n=1/0){let r=e.slice(),s=i=>r.findIndex(l=>l.key===i),o=-1;for(let[i,l]of t.entries()){let a=s(l.key);if(a!==-1){r[a]=l,o=a;continue}let u=o+1;o===-1&&(u=t.slice(i+1).map(p=>s(p.key)).find(p=>p!==-1)??r.length),r.splice(u,0,l),o=u}return r.length>n?je(r,new Set(t.map(i=>i.key)),n):r}function je(e,t,n){if(e.length<=n)return e;let r=-1,s=0;for(let[l,a]of e.entries())t.has(a.key)&&(r===-1&&(r=l),s=l);r===-1&&(r=0);let o=Math.max(n,s-r+1),i=Math.min(Math.max(0,Math.floor((r+s+1-o)/2)),e.length-o);return e.slice(i,i+o)}function Rt(e){return new Set(e).size===e.length?{keys:e,ephemeral:!1}:{keys:e.map((t,n)=>String(n)),ephemeral:!0}}function Nt(e,t,n){let r=new Map,s=o=>{let i=r.get(o);return i||r.set(o,i={keys:new Set,whole:!1,membership:!1,resolve:!1}),i};for(let[o,i]of Object.entries(e)){let l=t.some(a=>a.kind===\"childList\");if(!i.root){l&&(s(o).resolve=!0);continue}if(!pe(i.root,n)){s(o).resolve=!0;continue}(i.dependsOn.some(a=>!pe(a,n))||i.dependsOnMissing&&l)&&(s(o).whole=!0);for(let a of t){if(a.kind===\"field\"&&!i.fields||a.kind===\"resize\"&&!i.measure)continue;a.removed&&pe(i.root,a.target)&&(s(o).whole=!0);let u=Fe(i,a.target);u.dependent&&(s(o).whole=!0),u.inRoot&&(a.kind===\"childList\"&&(s(o).membership=!0),u.key===void 0?s(o).whole=!0:s(o).keys.add(u.key))}}return r}function Lt(e,t){let n=Fe(e,t);return n.inRoot||n.dependent}function Fe(e,t){let n,r=!1,s=!1;for(let o=t;o;o=o.parentNode)n??=e.items.get(o),o===e.root&&(r=!0),e.dependsOn.includes(o)&&(s=!0);return n!==void 0&&(r=!0),{key:n,inRoot:r,dependent:s}}function pe(e,t){for(let n=e;n;n=n.parentNode)if(n===t)return!0;return!1}function Dt(e){let t=new MutationObserver(o=>{let i=[];for(let l of o){i.push({target:l.target,kind:l.type});for(let a of l.removedNodes)i.push({target:a,kind:\"childList\",removed:!0})}e(i)});t.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let n=o=>{o.target instanceof Node&&e([{target:o.target,kind:\"field\"}])};document.addEventListener(\"input\",n,!0),document.addEventListener(\"change\",n,!0);let r=new WeakMap,s=typeof ResizeObserver==\"function\"?new ResizeObserver(o=>{let i=[];for(let l of o){let a=`${l.contentRect.width}x${l.contentRect.height}`,u=r.get(l.target);r.set(l.target,a),u!==void 0&&u!==a&&i.push({target:l.target,kind:\"resize\"})}i.length&&e(i)}):null;return{measure(o){if(s){s.disconnect();for(let i of o)s.observe(i)}},disconnect(){t.disconnect(),s?.disconnect(),document.removeEventListener(\"input\",n,!0),document.removeEventListener(\"change\",n,!0)}}}function Ct(e){for(let t of[\"pushState\",\"replaceState\"]){let n=History.prototype[t];History.prototype[t]=function(...r){let s=n.apply(this,r);try{e()}catch(o){console.error(\"Genesis navigation handler failed\",o)}return s}}addEventListener(\"popstate\",e),addEventListener(\"hashchange\",e)}var $t=new TextEncoder,Z=e=>$t.encode(JSON.stringify(e)).length,Gt=class{constructor(e,t,n=()=>null){this.send=e,this.limits=t,this.shrink=n}send;limits;shrink;epoch=0;seq=0;last=null;page(e){let t={...e,epoch:++this.epoch};for(;Z(t)>this.limits.pageMaxBytes;){let n=this.shrink(t);if(!n){t={...t,status:\"error\",error:{code:\"PAGE_TOO_LARGE\",message:\"The page is too large to show\"},regions:{}};break}t={...n,epoch:t.epoch}}this.seq=0,this.last=t,this.post({page:t})}update(e){let t=this.last;if(!t||!qt(t,e))return this.page(e);let n={};for(let[o,i]of Object.entries(e.regions)){let l=Tt(t.regions[o],i);l&&(n[o]=l)}let r=e.account!==void 0&&e.account!==t.account;if(!r&&Object.keys(n).length===0)return;let s=this.split(n);if(r&&(s[s.length-1].account=e.account),s.some(o=>Z(o)>this.limits.patchMaxBytes))return this.page(e);this.last={...e,epoch:this.epoch};for(let o of s)this.post({patch:o})}split(e){let t=[],n={};for(let[a,u]of Object.entries(e)){if(u.kind!==\"collection\"||!u.upsert){n[a]=u;continue}let{upsert:f,...p}=u;for(let b of f)t.push([a,b]);Object.keys(p).length>1&&(n[a]=p)}let r=this.limits.patchMaxBytes-Z(n)-256,s=[],o=[],i=0;for(let a of t){let u=Z(a[1])+1;o.length&&(o.length>=this.limits.patchRecordsMax||i+u>r)&&(s.push(o),o=[],i=0),o.push(a),i+=u}s.push(o);let l=this.last.view;return s.map((a,u)=>{let f={view:l,epoch:this.epoch,base:this.seq,seq:++this.seq,regions:{}};for(let[p,b]of a)(f.regions[p]??={kind:\"collection\",upsert:[]}).upsert.push(b);if(u===s.length-1)for(let[p,b]of Object.entries(n))f.regions[p]={...f.regions[p],...b};return f})}post(e){this.send(e).catch(t=>{let n=t instanceof T?t.code:null;if(n!==\"RETIRED\"){if(\"patch\"in e&&this.last&&e.patch.epoch===this.epoch){let{epoch:r,...s}=this.last;return this.page(s)}if(\"page\"in e&&n===\"PAGE_TOO_LARGE\"&&e.page.status!==\"error\"){let{epoch:r,...s}=e.page;return this.page({...s,status:\"error\",error:{code:n,message:\"The page is too large to show\"},regions:{}})}console.error(\"Genesis could not publish the page\",t)}})}};function qt(e,t){let n=Object.keys(t.regions);return e.view.generation===t.view.generation&&e.view.n===t.view.n&&e.view.url===t.view.url&&e.status===t.status&&e.pageId===t.pageId&&e.routeId===t.routeId&&e.error?.code===t.error?.code&&e.error?.message===t.error?.message&&e.signInUrl===t.signInUrl&&JSON.stringify(e.params)===JSON.stringify(t.params)&&n.length===Object.keys(e.regions).length&&n.every(r=>e.regions[r]?.kind===t.regions[r].kind)}function Ut(e,t,n){let r,s,o=()=>{clearTimeout(r),r=void 0,s=void 0,e()};return{schedule(){let i=Date.now();s??=i,clearTimeout(r),r=setTimeout(o,Math.min(t,Math.max(0,s+n-i)))},now(){r!==void 0&&o()},cancel(){clearTimeout(r),r=void 0,s=void 0}}}var Bt=1e4,Ge=!1;function ve(e){if(typeof window>\"u\"||window.top!==window||Ge)return;Ge=!0;let t=window,n=t.__genesisBridge;try{delete t.__genesisBridge}catch{t.__genesisBridge=void 0}if(!n)return;let r=null;Ct(()=>r?.navigated());let s=()=>Ne(n,location.href).then(o=>{r=Pt(o,e)},o=>console.error(\"Genesis could not bind this page\",o));s(),addEventListener(\"pageshow\",o=>{o.persisted&&(r?.stop(),r=null,s())})}function Pt(e,t){let{manifest:n,limits:r,generation:s}=e.bound,o={batches:0,reads:0,lastBatchReads:0,pages:0,patches:0,lastPublishBytes:0,resyncs:0,startedAt:Date.now()},i=!1;i&&(window.__genesisStats=o);let l=new Gt(c=>(i&&(\"page\"in c?o.pages++:o.patches++,o.lastPublishBytes=JSON.stringify(c).length),e.request(\"context.publish\",c)),r,ft),a={generation:s,n:0,url:location.href};if(e.bound.compat.adapterApi!==P.adapterApi){let c=`This applet uses adapter API ${P.adapterApi}; this Genesis uses ${e.bound.compat.adapterApi}`;return console.error(`Genesis: ${c}`),l.page({view:a,pageId:null,routeId:null,params:{},status:\"error\",error:{code:\"PROTOCOL_MISMATCH\",message:c},account:null,regions:{}}),{navigated(){},stop(){}}}let u=!1,f=de(location.href),p=fe(n,location.href),b=D(p),y=null,g=new Map,A=[],O=!1;function D(c){return c.kind===\"route\"?t.pages[c.page]??null:null}function N(){let c=b?.account??t.account;try{let d=c?.(document);return d===void 0&&c?{account:void 0,failed:!1}:{account:typeof d==\"string\"&&d!==\"\"?d:null,failed:!1}}catch(d){return console.error(\"Genesis adapter account failed\",d),{account:void 0,failed:!0}}}function H(){let c=t.signInUrl;try{if(typeof c==\"string\")return new URL(c,n.origins[0]).href;if(typeof c==\"function\")return new URL(c(location.href),location.href).href}catch(d){console.error(\"Genesis adapter signInUrl failed\",d)}return null}function K({account:c,failed:d}){if(p.kind!==\"route\")return{status:\"unsupported\"};if(!b)return{status:\"error\",error:{code:\"NOT_FOUND\",message:`The adapter declares no page ${p.page}`}};let h;try{h=b.ready(document)===!0}catch(v){return{status:\"error\",error:{code:\"INVALID_ARGUMENT\",message:Be(v)}}}if(b.requiresAccount===!0&&d)return{status:\"loading\"};let m=b.requiresAccount===!0&&c===null;return h?{status:m?\"auth\":\"ready\"}:m&&document.readyState!==\"loading\"?{status:\"auth\"}:{status:\"loading\"}}function X(c,d){let h={view:a,pageId:p.kind===\"route\"?p.page:null,routeId:p.kind===\"route\"?p.routeId:null,params:p.kind===\"route\"?p.params:{},status:d.status,signInUrl:H(),regions:{}};c!==void 0&&(h.account=c),d.error&&(h.error=d.error);for(let[m,v]of g)h.regions[m]=v.value;return h}function S(c,d,h){let m={name:c,def:d,root:null,items:new WeakMap,elements:new Map,dependsOn:[],dependsOnMissing:!1,value:h?.value??jt(d)};for(let v of d.dependsOn??[]){let E=[...document.querySelectorAll(v)];E.length===0&&(m.dependsOnMissing=!0),m.dependsOn.push(...E)}return m.root=document.querySelector(d.root),_(m,()=>d.kind===\"collection\"?M(m,d,\"all\"):C(m,d)),m}function _(c,d){try{c.value=d()}catch(h){let m=h instanceof T?h.code:\"INVALID_ARGUMENT\";c.value={...c.value,status:\"error\",error:{code:m,message:`${c.name}: ${Be(h)}`}}}}function C(c,d){let h=c.root;return h?{kind:\"single\",status:\"ready\",record:_e(d,h,d.key?ee(d.key,h):c.name)}:{kind:\"single\",status:\"ready\",record:null}}function M(c,d,h){let m=c.value,v=c.root?[...c.root.querySelectorAll(d.items)]:[],{keys:E,ephemeral:k}=Rt(v.map(L=>ee(d.key,L))),I=m.ephemeral?new Map:new Map(m.items.map(L=>[L.key,L])),R=c.elements;c.elements=new Map;let x=v.map((L,mt)=>{let V=E[mt];c.elements.set(V,L);let Me=I.get(V);return h!==\"all\"&&Me&&!h.has(V)&&R.get(V)===L?Me:Se(c,d,L,V)}),q={kind:\"collection\",status:\"ready\",items:d.virtualized&&!k&&!m.ephemeral?Mt(m.items,x,r.patchRecordsMax):x,complete:me(d)};return k&&(q.ephemeral=!0),q}function Se(c,d,h,m){let v=_e(d,h,m);c.items.set(h,m);for(let E of d.extent?.(h)??[])E&&c.items.set(E,m);return v}function _e(c,d,h){o.reads++;let m=c.read(d);if(typeof m?.then==\"function\")throw new T(\"ASYNC_READ\",\"read must return its data synchronously\");let v={key:h,data:m===void 0?null:m};return c.entity&&(v.entity=c.entity(d)),c.entityType&&(v.entityType=c.entityType),v}function ut(c,d,h){let m=c.value;if(m.ephemeral||m.status===\"error\")return _(c,()=>M(c,d,h));let v=m.items.slice();for(let E of h){let k=c.elements.get(E),I=v.findIndex(x=>x.key===E);if(!(k?.isConnected&&c.root?.contains(k)&&k.matches(d.items))||I===-1||ee(d.key,k)!==E)return _(c,()=>M(c,d,h));try{v[I]=Se(c,d,k,E)}catch{return _(c,()=>M(c,d,h))}}c.value={...m,items:v,complete:me(d)}}function dt(c,d){let{def:h}=c;d.resolve||d.whole||h.kind===\"single\"?g.set(c.name,S(c.name,h,c)):d.membership?_(c,()=>M(c,h,d.keys)):ut(c,h,d.keys)}function ft(c){if(c.view.n!==a.n)return null;let d={...c,regions:{...c.regions}},h=!1;for(let[m,v]of Object.entries(c.regions)){let E=g.get(m);if(E?.def.kind!==\"collection\"||!E.def.virtualized||v.kind!==\"collection\"||v.ephemeral)continue;let k=je(v.items,new Set(E.elements.keys()),Math.floor(v.items.length*3/4));k.length!==v.items.length&&(d.regions[m]={...v,items:k},E.value===v&&(E.value=d.regions[m]),h=!0)}return h?d:null}function ie(c=!1){if(u)return;A=[],O=!1;let d=N(),{account:h}=d,m=K(d),v=g;if(g=new Map,m.status===\"ready\")for(let[k,I]of Object.entries(b?.regions??{}))g.set(k,S(k,I,v.get(k)));y=m.status;let E=X(h,m);c?l.page(E):l.update(E),Te()}function xe(){if(u)return;o.batches++;let c=o.reads,d=A,h=O;A=[],O=!1;let m=N(),{account:v}=m,E=K(m);if(E.status!==\"ready\"||y!==\"ready\"||h)ie();else{let k={};for(let[I,R]of g)k[I]=qe(R);for(let[I,R]of Nt(k,d,document))dt(g.get(I),R);for(let I of g.values()){let R=I.value;if(I.def.kind===\"collection\"&&R.kind===\"collection\"&&I.def.more){let x=me(I.def);x!==R.complete&&(I.value={...R,complete:x})}}l.update(X(v,E)),Te()}o.lastBatchReads=o.reads-c}function Te(){let c=[];for(let d of g.values())d.def.measure&&(d.def.kind===\"single\"?d.root&&c.push(d.root):c.push(...d.elements.values()));Oe.measure(c)}let G=Ut(xe,r.publishQuietMs,r.publishMaxDelayMs),Oe=Dt(c=>{if(!u){if(y===\"ready\"&&!O){let d=[...g.values()].map(qe);A.push(...c.filter(h=>h.kind!==\"attributes\"||d.some(m=>Lt(m,h.target)))),A.length>Bt&&(A=[],O=!0)}G.schedule()}}),ce=kt({connection:e,limits:r,flush:()=>{G.cancel(),xe()},find:pt,view:()=>a.n});function pt(c){let d=(x,q)=>({error:{code:x,message:q}});if(y!==\"ready\"||!b)return d(\"NOT_READY\",\"The page is not ready\");let h=a.n;if(c.region===null){let x=b.actions?.[c.name];return x?{action:x,element:()=>null}:d(\"INVALID_ARGUMENT\",`The page has no action ${c.name}`)}let m=c.region,v=g.get(m);if(!v)return d(\"NOT_FOUND\",`The page has no region ${m}`);let E=v.def.actions?.[c.name];if(!E)return d(\"INVALID_ARGUMENT\",`Region ${m} has no action ${c.name}`);let k=v.def;if(k.kind===\"single\")return{action:E,element:()=>a.n===h?document.querySelector(k.root)??void 0:void 0};if(v.value.ephemeral)return d(\"PRECONDITION_FAILED\",`Region ${m} repeats keys, so its records have no actions`);let I=c.key;if(I===null)return d(\"INVALID_ARGUMENT\",`Action ${c.name} needs a record key`);let R=()=>{if(a.n!==h)return;let x=g.get(m)?.elements.get(I);if(x?.isConnected&&Ue(k,x)===I)return x;let q=document.querySelector(k.root);return q?[...q.querySelectorAll(k.items)].find(L=>Ue(k,L)===I):void 0};return R()===void 0?d(\"TARGET_NOT_FOUND\",`No ${m} item has key ${I}`):{action:E,element:R}}function ae(c=!0){u||(u=!0,G.cancel(),Oe.disconnect(),c&&ce.retire())}return e.on(\"resync\",()=>{o.resyncs++,G.cancel(),ie(!0)}),e.on(\"act\",c=>ce.act(c)),e.on(\"cancel\",({actionId:c})=>ce.cancel(c)),e.on(\"ping\",()=>{}),e.on(\"retired\",()=>ae()),e.on(\"pagehide\",()=>ae(!1)),document.readyState===\"loading\"&&document.addEventListener(\"DOMContentLoaded\",()=>G.schedule(),{once:!0}),ie(),{navigated(){if(u)return;let c=de(location.href);c!==f&&(f=c,a={generation:s,n:a.n+1,url:location.href},p=fe(n,location.href),b=D(p),y=null,g=new Map,G.cancel(),G.schedule())},stop:()=>ae()}}function qe(e){return{root:e.root,items:e.items,dependsOn:e.dependsOn,dependsOnMissing:e.dependsOnMissing,fields:e.def.fields===!0,measure:e.def.measure===!0}}function jt(e){return e.kind===\"collection\"?{kind:\"collection\",status:\"ready\",items:[],complete:!0}:{kind:\"single\",status:\"ready\",record:null}}function me(e){return e.more?document.querySelector(e.more)===null:!0}function ee(e,t){let n=e(t);if(typeof n!=\"string\"||n===\"\")throw new T(\"INVALID_ARGUMENT\",\"key must return a non-empty string\");return n}function Ue(e,t){try{return ee(e.key,t)}catch{return null}}function Be(e){return String(e?.message??e)}function te(e){return{...e,kind:\"collection\"}}function U(e){return{...e,kind:\"single\"}}function Ee(e){let t=(o,i)=>{throw new Error(`Adapter ${o} ${i}`)},n=(o,i)=>{o!==void 0&&typeof o!=\"function\"&&t(i,\"must be a function\")},r=(o,i)=>{(typeof o!=\"string\"||o.trim()===\"\")&&t(i,\"must be a CSS selector\")},s=(o,i)=>{if(o!==void 0){j(o)||t(i,\"must be an object of functions\");for(let[l,a]of Object.entries(o))typeof a!=\"function\"&&t(`${i}.${l}`,\"must be a function\")}};j(e)||t(\"definition\",\"must be an object\"),n(e.account,\"account\"),e.signInUrl!==void 0&&typeof e.signInUrl!=\"string\"&&typeof e.signInUrl!=\"function\"&&t(\"signInUrl\",\"must be a path or a function\"),j(e.pages)||t(\"pages\",\"must be an object\");for(let[o,i]of Object.entries(e.pages)){let l=`pages.${o}`;j(i)||t(l,\"must be an object\"),typeof i.ready!=\"function\"&&t(`${l}.ready`,\"must be a function\"),n(i.account,`${l}.account`),s(i.actions,`${l}.actions`),i.regions!==void 0&&!j(i.regions)&&t(`${l}.regions`,\"must be an object\");for(let[a,u]of Object.entries(i.regions??{})){let f=`${l}.regions.${a}`;(!j(u)||u.kind!==\"collection\"&&u.kind!==\"single\")&&t(f,\"must be made with collection() or single()\"),r(u.root,`${f}.root`),typeof u.read!=\"function\"&&t(`${f}.read`,\"must be a function\"),n(u.entity,`${f}.entity`),u.dependsOn!==void 0&&(Array.isArray(u.dependsOn)||t(`${f}.dependsOn`,\"must be an array of selectors\"),u.dependsOn.forEach((p,b)=>r(p,`${f}.dependsOn.${b}`))),s(u.actions,`${f}.actions`),u.kind===\"collection\"?(r(u.items,`${f}.items`),typeof u.key!=\"function\"&&t(`${f}.key`,\"must be a function\"),n(u.extent,`${f}.extent`),u.more!==void 0&&r(u.more,`${f}.more`)):n(u.key,`${f}.key`)}}return e}function j(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var Ft=[\"tl_\",\"cv_\",\"co_\",\"mn_\",\"pr_\"],F='[role=\"listitem\"][id^=\"th_\"]';function w(e,t=300){return[...(e??\"\").replace(/[​-‏⁠͏]/g,\"\").replace(/\\s+/g,\" \").trim()].slice(0,t).join(\"\")}function z(e){if(!(e instanceof HTMLElement))return!1;let t=e.ownerDocument.defaultView?.getComputedStyle(e);return t?t.display!==\"none\"&&t.visibility!==\"hidden\":e.offsetParent!==null}function W(e){for(let t of Ft)if(z(e.getElementById(t)))return t;return null}function Ht(e){for(let t of e.scripts){let n=/USER_EMAIL\\s*=\\s*\"([^\"@\\s]+@[^\"\\s]+)\"/.exec(t.textContent??\"\");if(n)return n[1].toLowerCase()}}var we=new WeakMap;function ze(e){if(we.has(e))return we.get(e);let t=null;for(let n of e.scripts){let r=/authuser\\\\u003d(\\d+)/.exec(n.textContent??\"\");if(r){t=Number(r[1]);break}}return we.set(e,t),t}function re(e){if(e.location.hostname!==\"mail.google.com\")return null;let t=Ht(e);if(t)return t}var B=e=>e.id.replace(/^th_/,\"\"),He=e=>e?.getAttribute(\"aria-checked\")===\"true\";function oe(e){let t=B(e),n=o=>e.querySelector(`[id=\"${o}${t}\"]`),r=n(\"ti_f_\"),s=e.querySelector(\".Akvd4\");return{threadId:t,sender:w(r?.textContent,120),subject:w(n(\"ti_s_\")?.textContent,240)||\"(no subject)\",snippet:w(n(\"ti_b_\")?.textContent,220).replace(/^[-–—]\\s*/,\"\"),date:w(n(\"ti_d_\")?.textContent,24),unread:r?.querySelector(\"b\")!==null||(s?.getAttribute(\"aria-labelledby\")??\"\").includes(\"tl_ul\"),starred:He(e.querySelector('[data-control-type^=\"tlastar\"]')),selected:e.classList.contains(\"B7pLff\")||He(e.querySelector('[data-control-type^=\"tlatogglecheck\"]')),attachment:e.querySelector('[aria-label*=\"ttachment\" i], img[src*=\"paperclip\" i], .M2ge3b')!==null,labels:[...e.querySelectorAll(\".Se5Bse .q49Gcc\")].map(o=>w(o.textContent,40)).filter(Boolean).slice(0,4)}}function We(e){let t=e.ownerDocument,n=w(t.querySelector(\"#tltbt .aLzX3d\")?.textContent,80),r=/^(.*?)(\\d+)?$/.exec(n),s=e.querySelector(\".mmDIjd\");return{title:w(r?.[1]??n,60),unread:r?.[2]?Number(r[2]):null,empty:s&&z(s)?w(s.textContent,200):null,selected:e.querySelectorAll(`${F}.B7pLff`).length}}var Vt=/^cvcmsg_[^_]+$/;function be(e,t){if(!e)return null;try{let n=new URL(e,t);if(n.hostname.endsWith(\"google.com\")&&n.pathname===\"/url\"){let r=n.searchParams.get(\"q\");if(r)return be(r,t)}return n.protocol===\"https:\"||n.protocol===\"http:\"?n.href:null}catch{return null}}var Ve=new Set([\"P\",\"DIV\",\"BR\",\"TR\",\"LI\",\"H1\",\"H2\",\"H3\",\"H4\",\"BLOCKQUOTE\",\"TABLE\",\"HR\"]);function zt(e,t=6e3){let n=[],r=0,s=!1,o=(a,u,f)=>{if(s)return;let p=a.replace(/[​-‏⁠͏]/g,\"\").replace(/[ \\t\\r\\f\\v]+/g,\" \");if(!p)return;let b=t-r,y=[...p].slice(0,b).join(\"\");y.length{if(a.nodeType===Node.TEXT_NODE)return o(a.textContent??\"\",u,f);if(!(a instanceof Element)||a.matches(\"script,style,head,title,svg,button,[aria-hidden=true],.adL,.gmail_quote,blockquote.gmail_quote\")||a instanceof HTMLElement&&a.style.display===\"none\"||a.matches('a[id^=\"att_\"]'))return;if(a.tagName===\"IMG\"){let y=w(a.getAttribute(\"alt\"),80);return y?o(y,u,f):void 0}let p=a.tagName===\"A\"?be(a.getAttribute(\"href\"),a.ownerDocument.location.href)??void 0:u,b=f||a.tagName===\"B\"||a.tagName===\"STRONG\";Ve.has(a.tagName)&&o(`\n`);for(let y of a.childNodes)i(y,p,b);Ve.has(a.tagName)&&a.tagName!==\"BR\"&&o(`\n`)};i(e??document.createElement(\"div\"));for(let a of n)a.text=a.text.replace(/ *\\n */g,`\n`).replace(/\\n{3,}/g,`\n\n`);for(;n.length&&!n[0].text.trim();)n.shift();n[0]&&(n[0].text=n[0].text.replace(/^\\s+/,\"\"));let l=n[n.length-1];return l&&(l.text=l.text.replace(/\\s+$/,\"\")),{runs:n.filter(a=>a.text!==\"\"),truncated:s}}function Wt(e){let t=new Map;for(let n of e.querySelectorAll('a[id^=\"att_\"]')){let r=n.getAttribute(\"href\")??n.id;t.has(r)||t.set(r,n)}return[...t.values()].slice(0,8).map(n=>{let r=(n instanceof HTMLElement?n.innerText:n.textContent??\"\").split(`\n`).map(l=>w(l,120)).filter(Boolean),s=w(n.getAttribute(\"download\"),120)||r.find(l=>/\\.[a-z0-9]{2,5}$/i.test(l))||r[0]||\"Attachment\",o=r.find(l=>/\\d\\s*(K|M|G)?B$/i.test(l))??\"\",i=Kt(s,n);return{name:s,size:o,...i?{href:i}:{}}})}var Jt=/\\.(jpe?g|png|gif|webp|bmp|svg|txt|csv|mp4|webm|mp3|m4a|ogg|wav)$/i;function Kt(e,t){let n=be(t.getAttribute(\"href\"),t.ownerDocument.location.href);if(!n||!Jt.test(e))return;let r=new URL(n);if(r.searchParams.get(\"view\")===\"att\")return r.searchParams.set(\"disp\",\"inline\"),r.href}function Xt(e){if(!e)return\"\";let t=\"\";for(let n of e.childNodes)if(n instanceof HTMLBRElement)t+=`\n`;else{if(n instanceof Element&&n.matches('[role=\"button\"]'))continue;t+=n.textContent??\"\"}return t}function Yt(e,t){let n=e.id.replace(/^cvcmsg_/,\"\"),r=e.ownerDocument,s=w(e.querySelector(\".HXJujf\")?.textContent,120),o=Xt(r.getElementById(`cvcstrecip_${n}`)).split(`\n`).map(u=>w(u,120)).filter(Boolean),i=r.getElementById(`cvcmsgbod_${n}`),{runs:l,truncated:a}=i&&z(i)?zt(i,t):{runs:[],truncated:!1};return{id:n,sender:s||\"Unknown sender\",initial:w(e.querySelector(\".th5Fjd\")?.textContent,2)||(s[0]??\"?\").toUpperCase(),recipients:o[0]??\"\",time:o.find(u=>/ago|AM|PM|\\d{1,2}:\\d{2}|yesterday|\\b[A-Z][a-z]{2} \\d{1,2}\\b/i.test(u)&&u!==o[0])??o[1]??\"\",snippet:w(r.querySelector(`#cvcstsnip_${CSS.escape(n)} .oex1Df`)?.textContent,200),body:l,truncated:a,attachments:Wt(e)}}var Je=[[\"archive\",\"ca+5\",\"1\"],[\"trash\",\"ca+5\",\"9\"],[\"deleteForever\",\"ca+5\",\"10\"],[\"notSpam\",\"ca+5\",\"8\"],[\"moveToInbox\",\"ca+5\",\"2\"],[\"mute\",\"ca+5\",\"11\"],[\"markUnread\",\"ca+5\",\"4\"],[\"spam\",\"spam+8\",\"7\"]];function ke(e){let[,t,n]=Je.find(([r])=>r===e);return`#cv__cntbt [data-control-type=\"${t}\"][data-onclick-arg=\"${n}\"]`}function Ke(e){let t=e.ownerDocument,n=[...e.querySelectorAll('[id^=\"cvcmsg_\"]')].filter(i=>Vt.test(i.id)),r=24e3,s=[];for(let i of[...n].reverse().slice(0,40)){let l=Yt(i,Math.max(400,Math.min(8e3,r)));r-=l.body.reduce((a,u)=>a+u.text.length,0),s.unshift(l)}let o=t.getElementById(\"cvcstar\");return{subject:w(e.querySelector(\".jzNoVc\")?.textContent,300)||\"(no subject)\",starred:z(o),labels:[...e.querySelectorAll(\".Se5Bse .q49Gcc, .Bqkuxd\")].map(i=>w(i.textContent,40)).filter(Boolean).slice(0,6),messages:s,commands:Je.filter(([i])=>{let l=t.querySelector(ke(i));return l!==null&&z(l.closest(\"[role=button], div\")??l)}).map(([i])=>i)}}var ne=(e,t)=>{let n=e.getElementById(t);return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?w(n.value,600):\"\"};function Xe(e){let t=e.ownerDocument,n=t.getElementById(\"cmcfrom\"),r=n instanceof HTMLSelectElement?n.selectedOptions[0]?.textContent:n?.textContent;return{from:w(r,160),to:ne(t,\"composeto\"),cc:ne(t,\"composecc\"),bcc:ne(t,\"composebcc\"),subject:ne(t,\"cmcsubj\"),body:w(t.getElementById(\"cmcbody\")?.innerText,2e3)}}var Ae='[role=\"menuitem\"][data-onclick-arg]';function Ye(e){let t=e.getAttribute(\"data-onclick-arg\")??\"\",n=e.getAttribute(\"data-control-type\")??e.getAttribute(\"data-onclick\")??\"\",r=w(e.querySelector(\".EAH59d\")?.textContent,8),s=w(e.textContent,80),o=w(s.replace(r,\"\"),60)||t,i=t.startsWith(\"^smartlabel\")?\"category\":t.startsWith(\"^\")?\"system\":n.startsWith(\"mnpi\")?\"category\":\"label\";return{arg:t,kind:i,label:o,count:/^\\d+$/.test(r)?Number(r):null}}var Ze=e=>{let t=w(e.ownerDocument.querySelector('[data-control-type^=\"toggleaccountscallout\"]')?.textContent,200);return/[^\\s@]+@[^\\s@]+/.exec(t)?.[0]?.toLowerCase()??null};var Zt=[[\"tl\",\"tl_\"],[\"cv\",\"cv_\"],[\"co\",\"co_\"],[\"mn\",\"mn_\"],[\"pr\",\"pr_\"]];function Qt(e){let t=e.replace(/^#/,\"\").split(/[/?]/)[0];return t===\"\"?\"tl_\":Zt.find(([n])=>n===t)?.[1]??null}function en(e,t){let n=e.getElementById(t);switch(t){case\"tl_\":return n.querySelector(F)!==null||w(n.querySelector(\".mmDIjd\")?.textContent)!==\"\";case\"cv_\":return n.querySelector(\".jzNoVc\")!==null&&n.querySelector('[id^=\"cvcmsg_\"]')!==null;case\"co_\":return e.getElementById(\"composeto\")!==null;case\"mn_\":return n.querySelector(Ae)!==null;case\"pr_\":return!0}}function tn(e){if(e.readyState===\"loading\")return!1;let t=W(e);if(!t||!en(e,t))return!1;let n=Qt(e.location.hash);return n===null||n===t||t===\"co_\"}var J=e=>`#th_${CSS.escape(e)}`,ct='[data-control-type^=\"tlatogglecheck\"]',nn='[data-control-type^=\"tlastar\"]',Ie=e=>`.zY6rPd [data-control-type=\"ca+5\"][data-onclick-arg=\"${e}\"]`;function Qe(e,t,n){if(!e||typeof n!=\"boolean\")throw new Error(\"Expected a thread and true or false\");let r=e.querySelector(t);if(!r)throw new Error(\"Gmail did not show this control\");if(r.getAttribute(\"aria-checked\")===\"true\"===n)return{satisfied:!0};let s=B(e);return{steps:[{click:`${J(s)} ${t}`}],until:o=>o.querySelector(`${J(s)} ${t}`)?.getAttribute(\"aria-checked\")===\"true\"===n}}var se=e=>[...e.querySelectorAll(`#tl_ ${F}`)].filter(t=>oe(t).selected);function et(e){return t=>{if(!t)throw new Error(\"Expected a thread\");let n=B(t);if(se(t.ownerDocument).filter(o=>B(o)!==n).length)throw new Error(\"Clear the selection first\");let s=[];return oe(t).selected||s.push({click:`${J(n)} ${ct}`},{waitFor:Ie(e),timeoutMs:3e3}),s.push({click:Ie(e)}),{steps:s,until:o=>o.querySelector(J(n))===null,deadlineMs:12e3}}}function tt(e){return()=>{let t=se(document).map(B);if(!t.length)throw new Error(\"No emails are selected\");return{steps:[{click:Ie(e)}],until:n=>t.every(r=>n.querySelector(J(r))===null),deadlineMs:12e3}}}function nt(){return se(document).length?{steps:[{click:'[data-control-type^=\"banone\"]'}],until:e=>se(e).length===0}:{satisfied:!0}}var rt=e=>e.querySelectorAll(`#tl_ ${F}`).length;function ot(){let e=rt(document);return{steps:[{scroll:{target:\"window\",to:\"end\"}}],until:t=>rt(t)>e,deadlineMs:1e4}}function st(){return document.querySelector('#tl_ [aria-label=\"Refresh\"], #tltbt [data-control-type^=\"rfr\"], [aria-label=\"Refresh\"]')?{steps:[{click:'[aria-label=\"Refresh\"]'}]}:{satisfied:!0}}function $(e){return()=>{let t=ke(e);if(!document.querySelector(t))throw new Error(\"Gmail does not offer that for this email\");let n=location.hash;return{steps:[{click:t}],until:r=>r.location.hash!==n||r.querySelector(t)===null,deadlineMs:1e4}}}function rn(e,t){let n=t?.id;if(typeof n!=\"string\"||!/^[\\w-]+$/.test(n))throw new Error(\"Expected a message id\");let r=o=>{let i=o.getElementById(`cvcmsgbod_${n}`);return i instanceof HTMLElement&&i.getClientRects().length>0&&(i.textContent??\"\").trim()!==\"\"};if(r(document))return{satisfied:!0};let s=`[data-control-type^=\"cvasnip\"][data-onclick-arg=\"${n}\"]`;if(!document.querySelector(s))throw new Error(\"Gmail can't open this message here\");return{steps:[{click:s}],until:r,deadlineMs:1e4}}function on(e,t){if(typeof t?.starred!=\"boolean\")throw new Error(\"Expected starred: true or false\");let n=()=>{let r=document.getElementById(\"cvcstar\");return r instanceof HTMLElement&&getComputedStyle(r).display!==\"none\"};return n()===t.starred?{satisfied:!0}:{steps:[{click:t.starred?\"#cvcstaroff\":\"#cvcstar\"}],until:()=>n()===t.starred}}var it={reply:\"cvarplf+29\",replyAll:\"cvarplallf+30\",forward:\"cvafwdf+31\"};function sn(e,t){let n=typeof t?.mode==\"string\"&&t.mode in it?t.mode:\"reply\",r=`#cv_ [data-control-type=\"${it[n]}\"]`;if(!document.querySelector(r))throw new Error(\"Gmail did not show a reply button\");return{steps:[{click:r}],until:s=>W(s)===\"co_\"&&s.getElementById(\"composeto\")!==null}}var cn=(e,t)=>typeof e?.[t]==\"string\"?e[t].slice(0,2e3):null;function an(e,t){let n=[];for(let[r,s]of[[\"to\",\"composeto\"],[\"cc\",\"composecc\"],[\"bcc\",\"composebcc\"],[\"subject\",\"cmcsubj\"]]){let o=cn(t,r),i=document.getElementById(s);o!==null&&i instanceof HTMLInputElement&&i.value!==o&&n.push({fill:`#${s}`,value:o})}return n.length?{steps:n,until:r=>n.every(s=>r.querySelector(s.fill)?.value===s.value)}:{satisfied:!0}}function ln(){return document.querySelector('#co_ [data-control-type=\"cmclose+108\"], [data-control-type=\"cmclose+108\"]')?{steps:[{click:'[data-control-type=\"cmclose+108\"]'}],until:t=>W(t)!==\"co_\"}:{satisfied:!0}}function un(e){if(!e)throw new Error(\"Expected a menu item\");let t=e.getAttribute(\"data-onclick-arg\")??\"\",n=location.hash;return{steps:[{click:`#mn_ [role=\"menuitem\"][data-onclick-arg=\"${CSS.escape(t)}\"]`}],until:r=>r.location.hash!==n}}var at={ready:tn,requiresAccount:!0,account:re,regions:{view:U({root:\"#views\",read:e=>({view:W(e.ownerDocument),hash:e.ownerDocument.location.hash.slice(0,600),session:ze(e.ownerDocument)})}),list:U({root:\"#tl_\",dependsOn:[\"#tltbt\"],read:We,actions:{clearSelection:nt,loadMore:ot,refresh:st}}),threads:te({root:\"#tl_\",items:F,key:B,entityType:\"thread\",read:oe,actions:{setStarred:(e,t)=>Qe(e,nn,t?.starred),setSelected:(e,t)=>Qe(e,ct,t?.selected),archive:et(\"1\"),trash:et(\"9\")}}),conversation:U({root:\"#cv_\",key:()=>location.hash.split(\"/\").pop()??\"conversation\",read:Ke,actions:{archive:$(\"archive\"),trash:$(\"trash\"),deleteForever:$(\"deleteForever\"),notSpam:$(\"notSpam\"),moveToInbox:$(\"moveToInbox\"),mute:$(\"mute\"),markUnread:$(\"markUnread\"),spam:$(\"spam\"),setStarred:on,expandMessage:rn,respond:sn}}),compose:U({root:\"#co_\",fields:!0,read:Xe,actions:{fill:an,discard:ln}}),menu:te({root:\"#mn_\",items:Ae,key:e=>e.getAttribute(\"data-onclick-arg\")??w(e.textContent,60),read:Ye,actions:{open:un}}),menuAccount:U({root:\"#mn_\",read:e=>({email:Ze(e)})})},actions:{archiveSelected:tt(\"1\"),trashSelected:tt(\"9\"),clearSelection:nt,loadMore:ot,refresh:st}};var lt=Ee({account:re,signInUrl:\"/mail/u/0/\",pages:{mail:at}});ve(lt);})();\n"},{"path":"foreground.css","encoding":"utf8","content":":root{color-scheme:light;--font: \"Inter\", \"Roboto\", system-ui, -apple-system, sans-serif;--accent: #2347d9;--accent-ink: #ffffff;--accent-tint: #e8edff;--hero: #2347d9;--hero-ink: #ffffff;--ink: #15161a;--ink-2: #4a4f5c;--ink-3: #6b7080;--wash: #f4f5f7;--paper: #ffffff;--line: #e4e6eb;--chip: #eceef2;--reminder: #9a3d06;--reminder-tint: #fdebdc;--done: #1f7a4d;--danger: #c62828;--danger-tint: #fde8e8;--scrim: rgba(21, 22, 26, .42);--shadow: 0 8px 28px rgba(21, 22, 26, .14);--radius: 20px;--ease-out: cubic-bezier(.2, 0, 0, 1);--ease-in: cubic-bezier(.3, 0, .8, .15);--ease-spring: cubic-bezier(.34, 1.4, .64, 1);--dur-short: .15s;--dur-medium: .25s;--dur-long: .35s;--press: rgba(21, 22, 26, .08)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--accent: #8ea6ff;--accent-ink: #0d1640;--accent-tint: #1f2850;--hero: #263a8f;--hero-ink: #eef1ff;--ink: #eceef2;--ink-2: #bfc3cd;--ink-3: #9297a3;--wash: #0f1013;--paper: #1a1c21;--line: #2c2f37;--chip: #262930;--reminder: #ffb27a;--reminder-tint: #3a2414;--done: #6fd39f;--danger: #ff8a80;--danger-tint: #3b1b1b;--scrim: rgba(0, 0, 0, .6);--shadow: 0 8px 28px rgba(0, 0, 0, .5);--press: rgba(255, 255, 255, .08)}}:root[data-theme=dark]{color-scheme:dark;--accent: #8ea6ff;--accent-ink: #0d1640;--accent-tint: #1f2850;--hero: #263a8f;--hero-ink: #eef1ff;--ink: #eceef2;--ink-2: #bfc3cd;--ink-3: #9297a3;--wash: #0f1013;--paper: #1a1c21;--line: #2c2f37;--chip: #262930;--reminder: #ffb27a;--reminder-tint: #3a2414;--done: #6fd39f;--danger: #ff8a80;--danger-tint: #3b1b1b;--scrim: rgba(0, 0, 0, .6);--shadow: 0 8px 28px rgba(0, 0, 0, .5);--press: rgba(255, 255, 255, .08)}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}html,body{background:var(--wash);color:var(--ink);font:15px/21px var(--font);-webkit-font-smoothing:antialiased}h1,h2,h3,p{margin:0}button,input,textarea,select{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{cursor:pointer;background:none;border:0;padding:0;text-align:inherit}button:disabled{opacity:.45;cursor:default}a{color:var(--accent);text-decoration:none;overflow-wrap:anywhere}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}svg.filled{fill:currentColor}ul,ol{list-style:none;margin:0;padding:0}small{color:var(--ink-3);font-size:13px;line-height:18px}mark{background:#ffe9a8;color:inherit;border-radius:3px;padding:0 1px}.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.muted{color:var(--ink-3)}.danger{color:var(--danger)}.spacer{flex:1}.padded{padding:8px 20px}.padded-x{margin-left:16px!important;margin-right:16px!important;width:calc(100% - 32px)!important}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.app{display:flex;flex-direction:column;height:100%;position:relative}.content{flex:1;min-height:0;position:relative;isolation:isolate;overflow:hidden}.screen-frame{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--wash)}.screen{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:104px}.screen.centered{display:grid;place-items:center;padding:24px}.icon-button{display:inline-grid;place-items:center;width:48px;height:48px;border-radius:50%;color:var(--ink-2);flex:none}.icon-button:active{background:var(--chip)}.icon-button[aria-pressed=true]{color:var(--accent)}.icon-button.star.on,.star.on{color:#e3a008}.accent,.primary,.secondary,.outline{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;border-radius:999px;font-weight:600}.accent{background:var(--accent);color:var(--accent-ink)}.primary{background:var(--ink);color:var(--paper)}.secondary{background:var(--chip);color:var(--ink)}.outline{border:1px solid var(--line);background:var(--paper)}.accent svg,.primary svg,.secondary svg,.outline svg{width:18px;height:18px}.block{display:flex;width:100%}.link-button{color:var(--accent);font-weight:600;min-height:44px;padding:0 8px;display:inline-flex;align-items:center}.row-buttons{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:16px}.card{background:var(--paper);border-radius:var(--radius);margin:0 16px;overflow:hidden}.section-label{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);padding:20px 20px 8px;display:flex;align-items:center;gap:6px}.section-label.with-action{justify-content:space-between;padding-bottom:0}.hint{color:var(--ink-3);font-size:13px;line-height:18px;display:flex;gap:6px;align-items:flex-start}.list-button{display:flex;align-items:center;gap:14px;width:100%;min-height:56px;padding:10px 16px}.list-button>span:not(.account-dot):not(.tile):not(.avatar){flex:1;min-width:0;display:flex;flex-direction:column}.list-button strong{font-weight:600}.list-button>svg:last-child{color:var(--ink-3);width:18px;height:18px}.plain-list>li+li{border-top:1px solid var(--line)}.tile{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:12px;flex:none}.tile.small{width:32px;height:32px;border-radius:10px}.tile.small svg{width:18px;height:18px}.tile.reminder{background:var(--reminder-tint);color:var(--reminder)}.tile.todo{background:var(--accent-tint);color:var(--accent)}.tile.neutral{background:var(--chip);color:var(--ink-2)}.account-dot{display:inline-block;width:10px;height:10px;min-width:10px;border-radius:50%;flex:none;vertical-align:middle}.avatar{display:inline-grid;place-items:center;border-radius:50%;flex:none;font-weight:600;background:hsl(var(--hue) 70% 92%);color:hsl(var(--hue) 55% 32%)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .avatar{background:hsl(var(--hue) 35% 24%);color:hsl(var(--hue) 70% 82%)}}:root[data-theme=dark] .avatar{background:hsl(var(--hue) 35% 24%);color:hsl(var(--hue) 70% 82%)}.avatar.selected{background:var(--accent);color:var(--accent-ink)}.avatar.selected svg{width:20px;height:20px}.logo{font-weight:800;font-size:20px;letter-spacing:-.02em}.logo span{color:var(--accent)}.chips{display:flex;flex-wrap:wrap;gap:8px}.chip{flex:none;white-space:nowrap;display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--paper);font-weight:500}.chip[aria-checked=true]{background:var(--ink);color:var(--paper);border-color:var(--ink)}.chip.high[aria-checked=true]{background:var(--danger);border-color:var(--danger);color:#fff}.chip .count{opacity:.7;margin-left:2px}.chips.filters{padding:12px 16px 4px;flex-wrap:nowrap;overflow-x:auto}.chip-small{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:12px;line-height:18px;background:var(--chip);color:var(--ink-2);font-weight:500}.chip-small.reminder{background:var(--reminder-tint);color:var(--reminder)}.chip-small.todo{background:var(--accent-tint);color:var(--accent)}.tag{flex:none;padding:3px 10px;border-radius:8px;font-size:13px;font-weight:600;background:var(--chip);color:var(--ink-2);white-space:nowrap}.tag.reminder{background:var(--reminder-tint);color:var(--reminder)}.tag.set-date{background:transparent;color:var(--accent);border:1.5px dashed var(--accent);min-height:32px}.time-tag{flex:none;color:var(--ink-3);font-size:13px;font-variant-numeric:tabular-nums}.top-bar{display:flex;align-items:center;gap:4px;min-height:64px;padding:8px 56px 8px 4px;background:var(--wash);flex:none}.top-bar h1{font-size:20px;font-weight:700;padding-left:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-bar .logo{padding-left:16px}.top-bar .send{min-height:40px;padding:0 16px}.mail-header{flex:none;padding:10px 64px 8px 12px;background:var(--wash)}.search-pill{display:flex;align-items:center;gap:4px;min-height:52px;border-radius:999px;background:var(--paper);padding:2px 4px;box-shadow:0 1px 2px #0000000f}.search-pill>svg{margin:0 6px 0 12px;color:var(--ink-3)}.search-pill-text{flex:1;min-height:48px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-pill-text.filled{color:var(--ink);font-weight:500}.search-pill input{flex:1;min-width:0;min-height:48px;border:0;background:none;outline:none}.me{display:grid;place-items:center;width:48px;height:48px;position:relative}.me-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;border:2px solid;font-size:12px;font-weight:700;background:var(--accent-tint);color:var(--accent)}.me-badge{position:absolute;right:2px;bottom:4px;min-width:18px;height:18px;border-radius:9px;background:var(--ink);color:var(--paper);font-size:11px;display:grid;place-items:center}.selection-bar{display:flex;align-items:center;min-height:64px;padding:8px 56px 8px 4px;background:var(--accent-tint);color:var(--accent);flex:none}.selection-bar h1{font-size:18px;font-weight:700}.selection-bar .icon-button{color:var(--accent)}.category-chips,.filter-chips{display:flex;gap:8px;overflow-x:auto;padding:4px 16px 8px;scrollbar-width:none}.category-chip,.filter-chip{flex:none;display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 16px;border-radius:999px;background:var(--paper);border:1px solid var(--line);font-weight:500}.category-chip[aria-current=page],.filter-chip[aria-pressed=true]{background:var(--ink);color:var(--paper);border-color:var(--ink)}.category-chip .count{font-size:12px;font-weight:700;color:var(--accent)}.category-chip[aria-current=page] .count{color:inherit;opacity:.8}.list-title{font-size:26px;font-weight:800;padding:4px 20px 12px;letter-spacing:-.01em}.results-line{padding:4px 20px 8px;color:var(--ink-2);font-size:14px}.thread-list{background:var(--paper);border-radius:var(--radius);margin:0 12px;overflow:hidden}.thread{position:relative;overflow:hidden}.thread+.thread{border-top:1px solid var(--line)}.thread-inner{position:relative;display:flex;align-items:flex-start;gap:4px;padding:10px 4px 10px 8px;background:var(--paper);transition:transform .2s;touch-action:pan-y}.thread.selected .thread-inner{background:var(--accent-tint)}.avatar-button{display:grid;place-items:center;width:48px;height:48px;flex:none}.thread-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;padding:2px 0}.thread-line{display:flex;align-items:baseline;gap:8px}.thread .sender{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}.thread .date{flex:none;font-size:12px;color:var(--ink-3)}.thread .subject{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}.thread .snippet{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-3);font-size:14px}.thread.unread .sender,.thread.unread .subject{color:var(--ink);font-weight:700}.thread.unread .date{color:var(--accent);font-weight:700}.thread-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.thread .star{color:var(--ink-3)}.swipe-under{position:absolute;inset:0;display:flex;align-items:center;padding:0 24px;color:#fff;font-weight:600;gap:8px}.swipe-under.right{justify-content:flex-start}.swipe-under.left{justify-content:flex-end}.swipe-under.remind{background:#d0611c}.swipe-under.archive{background:#1f7a4d}.swipe-under.none{background:var(--chip);color:var(--ink-3)}.list-end{display:flex;justify-content:center;padding:16px}.inline-error{color:var(--danger);padding:8px 20px}.fab{position:absolute;right:16px;bottom:16px;z-index:5;display:inline-flex;align-items:center;gap:10px;min-height:56px;padding:0 22px 0 18px;border-radius:18px;background:var(--accent);color:var(--accent-ink);font-weight:700;box-shadow:var(--shadow)}.fab.round{width:60px;height:60px;padding:0;justify-content:center;border-radius:20px}.fab.round svg{width:28px;height:28px}.today-card{margin:4px 12px 12px;border-radius:var(--radius);background:var(--hero);color:var(--hero-ink);padding:4px 16px 16px}.today-head{display:flex;align-items:center;width:100%;min-height:48px;gap:8px}.today-head>span{flex:1}.today-head .muted{color:inherit;opacity:.8}.today-row{display:flex;align-items:center;gap:10px;min-height:48px;border-top:1px solid rgba(255,255,255,.18)}.today-title{flex:1;min-width:0;min-height:48px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.today-card .tag{background:#ffffff2e;color:inherit}.today-card .mark{border-color:#fffc;color:inherit}.today-card .mark.reminder{background:#ffffff2e}.progress{height:6px;border-radius:3px;background:#ffffff40;margin-top:8px;overflow:hidden}.progress span{display:block;height:100%;background:currentColor;border-radius:3px}.back-section{margin:0 12px 12px;border-radius:var(--radius);background:var(--reminder-tint);color:var(--reminder)}.back-section .section-label{color:var(--reminder);padding:12px 16px 4px}.back-row{display:flex;align-items:center;gap:4px;padding-left:16px}.back-row+.back-row{border-top:1px solid rgba(154,61,6,.15)}.back-main{flex:1;min-width:0;min-height:56px;display:flex;flex-direction:column;justify-content:center}.back-main strong{color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.back-main span{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.back-row .icon-button{color:var(--reminder)}.also{margin-bottom:12px}.item-list{display:block}.item-row{display:flex;align-items:center;gap:12px;padding:6px 16px 6px 12px;min-height:64px}.item-row+.item-row{border-top:1px solid var(--line)}.item-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;min-height:52px;justify-content:center}.item-title{font-weight:600;display:flex;align-items:center;gap:6px;overflow-wrap:anywhere}.item-meta{display:block;font-size:13px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item-meta svg{width:14px;height:14px;vertical-align:-2px}.item-meta .account-dot{width:8px;height:8px;vertical-align:0}.item-row.overdue .item-meta{color:var(--danger)}.item-row.is-done .item-title{text-decoration:line-through;color:var(--ink-3);font-weight:500}.priority{color:var(--danger);display:inline-flex}.match{flex:none;max-width:40%;font-size:12px;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mark{position:relative;display:grid;place-items:center;width:28px;height:28px;flex:none;border:2px solid var(--ink-3);border-radius:8px;color:var(--paper)}.mark:after{content:\"\";position:absolute;inset:-10px}.mark.reminder{border:0;border-radius:50%;background:var(--reminder-tint);color:var(--reminder)}.mark svg{width:16px;height:16px}.mark.done{background:var(--done);border-color:var(--done);color:#fff}.mark.large{width:40px;height:40px;border-radius:12px}.mark.reminder.large{border-radius:50%}.mark.large svg{width:22px;height:22px}.todo-header{display:flex;align-items:center;gap:4px;min-height:72px;padding:12px 56px 4px 20px;flex:none}.todo-header h1{font-size:30px;font-weight:800;letter-spacing:-.02em}.todo-search{flex:1}.account-filter{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:var(--paper);font-weight:500}.segmented{position:relative;display:flex;margin:4px 16px 0;padding:4px;border-radius:16px;background:var(--chip)}.segmented:before{content:\"\";position:absolute;top:4px;bottom:4px;left:4px;width:calc(50% - 4px);border-radius:12px;background:var(--paper);box-shadow:0 1px 3px #0000001a;transition:transform var(--dur-medium) var(--ease-out)}.segmented[data-index=\"1\"]:before{transform:translate(100%)}.segmented button{position:relative;flex:1;min-height:44px;border-radius:12px;text-align:center;color:var(--ink-2);font-weight:600;transition:color var(--dur-short)}.segmented button[aria-selected=true]{color:var(--ink)}.week-strip{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;padding:12px 12px 4px}.week-day{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:64px;padding:6px 0;border-radius:14px;color:var(--ink-3)}.week-day strong{color:var(--ink);font-size:17px}.week-day.today,.week-day.today strong{color:var(--accent)}.week-day[aria-pressed=true]{background:var(--ink);color:var(--paper)}.week-day[aria-pressed=true] strong{color:var(--paper)}.week-day .dot{width:6px;height:6px;border-radius:50%;background:var(--accent)}.week-day .dot.none{background:transparent}.week-day[aria-pressed=true] .dot{background:var(--paper)}.group{margin-top:8px}.group-head{display:flex;align-items:baseline;gap:8px;padding:16px 20px 8px;font-size:16px;font-weight:700}.group-head small{font-weight:500}.group-head .link-button{margin-left:auto;min-height:32px;font-size:14px}.group.overdue .group-head>span{color:var(--danger)}.group.done .item-list{opacity:.85}.type-label{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--accent)}.type-label.reminder{color:var(--reminder)}.type-label svg{width:16px;height:16px}.item-hero{display:flex;align-items:flex-start;gap:14px;padding:8px 20px 20px}.item-hero h1{font-size:24px;line-height:30px;font-weight:800;letter-spacing:-.01em;overflow-wrap:anywhere}.item-hero h1.is-done{text-decoration:line-through;color:var(--ink-3)}.detail-rows{margin:0 16px}.detail-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 16px}.detail-row+.detail-row{border-top:1px solid var(--line)}.detail-row dt{display:flex;align-items:center;gap:10px;width:132px;flex:none;color:var(--ink-3);font-size:14px}.detail-row dd{margin:0;flex:1;min-width:0;display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-weight:500}.detail-row dd .link-button{margin-left:auto}.note-text{white-space:pre-wrap;font-weight:400}.email-card{display:flex;align-items:center;gap:12px;width:calc(100% - 32px);padding:14px 16px}.email-card>span:not(.avatar){flex:1;min-width:0;display:flex;flex-direction:column}.email-card small{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.email-subject{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-card.gone{color:var(--ink-3)}.email-card+.hint{padding:8px 20px}.snooze-chips{padding:16px}.action-bar{flex:none;display:flex;gap:8px;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:var(--paper);border-top:1px solid var(--line)}.action-bar>button{flex:1;min-width:0;padding:0 10px;white-space:nowrap}.conversation{padding:0 0 104px}.add-to{display:flex;align-items:center;gap:12px;padding:4px 16px 8px}.add-to .muted{font-size:13px;line-height:17px}.add-pill{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:44px;padding:0 14px;border-radius:999px;background:var(--ink);color:var(--paper);font-weight:600}.add-pill svg{width:18px;height:18px}.popover-scrim{position:fixed;inset:0;z-index:20;background:transparent;cursor:default}.popover{position:absolute;z-index:21;background:var(--paper);border-radius:18px;box-shadow:var(--shadow);padding:8px;display:flex;flex-direction:column;min-width:220px}.popover>button{min-height:48px;padding:0 14px;border-radius:12px;display:flex;align-items:center;gap:10px}.popover>button:active,.popover>button[aria-checked=true]{background:var(--chip)}.more-menu{top:64px;right:12px}.add-menu{top:120px;left:16px;right:16px}.account-menu{top:72px;right:56px}.add-option{display:flex;align-items:center;gap:14px;width:100%;min-height:64px;padding:8px 10px;border-radius:14px}.add-option>span:nth-child(2){flex:1;display:flex;flex-direction:column}.add-option>svg:last-child{color:var(--ink-3)}.quick-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 10px 6px;border-top:1px solid var(--line);margin-top:4px}.quick-row .section-label{width:100%;padding:0 4px}.subject-row{display:flex;align-items:flex-start;gap:4px;padding:4px 8px 0 20px}.conversation-subject{flex:1;font-size:22px;line-height:28px;font-weight:800;letter-spacing:-.01em;padding-top:8px;overflow-wrap:anywhere}.conversation-meta{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:6px 20px 12px;font-size:13px}.account-line{display:inline-flex;align-items:center;gap:6px;color:var(--ink-2)}.linked-items{margin-bottom:8px}.messages{display:flex;flex-direction:column;gap:8px;padding:0 12px}.message{background:var(--paper);border-radius:var(--radius);padding:4px 16px 16px}.message-head{display:flex;align-items:center;gap:12px;width:100%;min-height:56px}.message-head:disabled{opacity:1}.message-who{flex:1;min-width:0;display:flex;flex-direction:column}.message-who .muted{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:22px;padding-top:4px}.message-body p{margin-top:12px}.message-snippet{color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachments{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.attachment-card{display:flex;align-items:center;gap:10px;padding:8px 12px 8px 8px;border:1px solid var(--line);border-radius:14px;max-width:100%}.attachment-card>span:last-child{display:flex;flex-direction:column;min-width:0}.attachments>li{max-width:100%}a.attachment-card{color:inherit;text-decoration:none}a.attachment-card:active{background:var(--press)}.attachment-card small{color:var(--ink-2);font-size:12px}.attachment-card strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-tile{display:grid;place-items:center;width:40px;height:40px;border-radius:10px;background:var(--danger-tint);color:var(--danger);font-size:11px;font-weight:800;flex:none}.reply-row{display:flex;gap:8px;padding:16px 12px}.reply-row button{flex:1;min-width:0;padding:0 8px;white-space:nowrap}.compose-card{background:var(--paper);border-radius:var(--radius);margin:0 12px;overflow:hidden}.compose-field{display:flex;align-items:center;gap:12px;min-height:56px;padding:0 16px;border-bottom:1px solid var(--line)}.compose-field>span:first-child{width:56px;flex:none;color:var(--ink-3)}.compose-field input{flex:1;min-width:0;min-height:48px;border:0;background:none;outline:none}.compose-to{display:flex;align-items:center}.compose-to .compose-field{flex:1}.compose-to .link-button{border-bottom:1px solid var(--line);min-height:56px}.from-value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.compose-body-note{display:flex;gap:12px;padding:16px;color:var(--ink-2)}.compose-body-note svg{color:var(--ink-3)}.remind-card{margin-top:12px}.drawer .screen,.drawer .top-bar{background:var(--paper)}.account-card{display:flex;align-items:center;gap:12px;width:calc(100% - 32px);margin:0 16px 8px;min-height:64px;padding:10px 16px;border-radius:var(--radius);background:var(--accent-tint)}.account-card>span:not(.account-dot){flex:1;min-width:0;display:flex;flex-direction:column}.account-card>.account-dot{width:14px;height:14px}.account-card small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drawer-list{padding:0 8px}.drawer-list.end{margin-top:12px;border-top:1px solid var(--line);padding-top:8px}.drawer-row{display:flex;align-items:center;gap:16px;width:100%;min-height:52px;padding:0 16px;border-radius:999px;font-weight:500}.drawer-row>span:nth-child(2){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drawer-row.accent{background:transparent;color:var(--accent);min-height:52px;padding:0 16px;border-radius:999px;justify-content:flex-start;font-weight:600}.drawer-row .count{font-size:13px;font-weight:700;color:var(--ink-2)}.drawer-row svg{color:var(--ink-3)}.drawer-row.accent svg{color:var(--accent)}.drawer-row:active{background:var(--chip)}.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}.field>span{font-size:13px;font-weight:600;color:var(--ink-2)}.field input,.field textarea,.setting-row input,.select-row select{min-height:48px;padding:10px 14px;border-radius:14px;border:1px solid var(--line);background:var(--wash);outline:none;width:100%}.field input:focus,.field textarea:focus{border-color:var(--accent)}.field textarea{resize:vertical}.error-text{color:var(--danger)}.select-row{display:flex;align-items:center;gap:12px;min-height:56px}.select-row>span{flex:1}.select-row select{width:auto}.toggle-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 16px;cursor:pointer;position:relative}.card .toggle-row+.toggle-row,.card .toggle-row+.setting-row,.card .setting-row+.toggle-row,.card .setting-row+.setting-row{border-top:1px solid var(--line)}.sheet-body .toggle-row{padding:8px 0}.toggle-text{flex:1;min-width:0;display:flex;flex-direction:column}.toggle-row input{position:absolute;opacity:0;width:1px;height:1px}.switch{position:relative;width:50px;height:30px;border-radius:15px;background:var(--line);flex:none;transition:background .15s}.switch:after{content:\"\";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #00000040;transition:transform .15s}.toggle-row input:checked+.switch{background:var(--accent)}.toggle-row input:checked+.switch:after{transform:translate(20px)}.toggle-row input:focus-visible+.switch{outline:3px solid var(--accent);outline-offset:2px}.setting-row{display:flex;flex-direction:column;gap:10px;padding:12px 16px}.setting-row>span{display:flex;flex-direction:column;font-weight:500}.setting-row>span:has(svg){flex-direction:row;align-items:center;gap:6px}.setting-row input[type=time]{width:160px}.setting-row.nested{padding-left:32px}.settings .card{margin-bottom:4px}.settings-links{margin-top:8px}.sheet-layer{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;justify-content:flex-end}.sheet-backdrop{position:absolute;inset:0;background:var(--scrim);animation:fade .22s ease-out}.sheet{position:relative;max-height:92%;display:flex;flex-direction:column;background:var(--paper);border-radius:24px 24px 0 0;box-shadow:var(--shadow);animation:sheet-in .32s var(--ease-out);outline:none;transition:transform .28s var(--ease-out);will-change:transform}.grabber{width:40px;height:5px;border-radius:3px;background:var(--line);margin:8px auto 0;flex:none}.sheet-head{display:flex;align-items:center;gap:12px;padding:8px 8px 8px 20px;flex:none}.sheet-head h2{flex:1;font-size:19px;font-weight:800}.sheet-body{flex:1;min-height:0;overflow-y:auto;padding:4px 20px 16px}.sheet-foot{flex:none;display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 20px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line)}.sheet-lead{color:var(--ink-2);margin-bottom:14px}.sheet-body .section-label{padding:12px 0 8px}.linked-card{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:14px;background:var(--wash);margin-bottom:10px;font-size:14px}.linked-card>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}.preset{display:flex;flex-direction:column;gap:2px;min-height:64px;padding:10px 14px;border-radius:16px;border:1.5px solid var(--line)}.preset span{font-size:13px;color:var(--ink-3)}.preset[aria-checked=true]{border-color:var(--reminder);background:var(--reminder-tint)}.preset[aria-checked=true] span{color:var(--reminder)}.option-list{display:flex;flex-direction:column;gap:4px;margin-bottom:12px}.option{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:0 12px;border-radius:14px;background:var(--wash)}.option>span{flex:1;font-weight:600}@keyframes fade{0%{opacity:0}}.account-row{display:flex;align-items:center;padding-right:8px}.account-row .list-button:disabled{opacity:1;cursor:default}.account-row .list-button>svg:last-child{color:var(--accent)}.account-preview{display:flex;flex-direction:column;align-items:center;gap:4px;padding:16px 20px 24px}.account-badge{display:grid;place-items:center;width:72px;height:72px;border-radius:50%;border:3px solid var(--account);color:var(--account);background:color-mix(in srgb,var(--account) 14%,var(--paper));font-size:28px;font-weight:800;margin-bottom:8px}.swatches{display:flex;gap:12px;padding:0 20px;flex-wrap:wrap}.swatch{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;color:#fff}.swatch[aria-checked=true]{box-shadow:0 0 0 3px var(--paper),0 0 0 5px var(--ink)}.snooze-row{display:flex;align-items:center;padding-right:4px}.snooze-row .list-button small{display:inline-flex;align-items:center;gap:4px}.notice{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:48px 32px;color:var(--ink-2)}.notice h2{font-size:18px;color:var(--ink)}.notice .secondary{margin-top:12px}.notice-icon{display:grid;place-items:center;width:64px;height:64px;border-radius:20px;background:var(--accent-tint);color:var(--accent);margin-bottom:4px}.welcome{display:flex;flex-direction:column;gap:12px;max-width:360px;text-align:center}.welcome .logo{font-size:32px;margin-bottom:12px}.welcome h1{font-size:24px}.welcome p{color:var(--ink-2);margin-bottom:12px}.skeleton{padding:8px 12px;animation:fade .2s .12s both}.skeleton-row{display:flex;gap:12px;padding:12px 8px}.skeleton-avatar,.skeleton-row>div span,.skeleton .bar{background:linear-gradient(90deg,var(--chip) 0 40%,var(--shimmer) 50%,var(--chip) 60% 100%) var(--chip);background-size:300% 100%;animation:shimmer 1.4s linear infinite}.skeleton-avatar{width:40px;height:40px;border-radius:50%;flex:none}.skeleton-row>div{flex:1;display:flex;flex-direction:column;gap:8px}.skeleton-row>div span{height:12px;border-radius:6px}.skeleton-row>div span:nth-child(1){width:40%}.skeleton-row>div span:nth-child(3){width:70%}.skeleton.email{display:flex;flex-direction:column;gap:10px;padding:16px}.skeleton .bar{display:block;height:12px;border-radius:6px}.skeleton .bar.title{height:22px;border-radius:8px;width:85%}.skeleton .bar.title.short{width:55%;margin-bottom:8px}.skeleton .bar.short{width:60%}.skeleton.email .skeleton-row{padding:8px 0 12px}@keyframes shimmer{0%{background-position:100% 0}to{background-position:0 0}}.tabs{flex:none;display:flex;background:var(--paper);border-top:1px solid var(--line);padding:6px 8px calc(6px + env(safe-area-inset-bottom))}.tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;min-height:56px;font-size:13px;font-weight:600;color:var(--ink-3)}.tab-icon{position:relative;display:grid;place-items:center;width:64px;height:32px;border-radius:16px}.tab[aria-current=page]{color:var(--ink)}.tab[aria-current=page] .tab-icon{background:var(--accent-tint);color:var(--accent)}.badge{position:absolute;top:-4px;right:6px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--danger);color:#fff;font-size:11px;line-height:18px;text-align:center;font-weight:700}.badge.due{background:var(--reminder)}.toast-region{position:absolute;left:12px;right:12px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:40;display:flex;justify-content:center;pointer-events:none}.toast{pointer-events:auto;display:flex;align-items:center;gap:4px;min-height:52px;max-width:520px;width:100%;padding:4px 4px 4px 16px;border-radius:16px;background:var(--ink);color:var(--paper);box-shadow:var(--shadow);animation:toast-in var(--dur-medium) var(--ease-out)}.toast>span{flex:1}.toast button{min-height:44px;padding:0 12px;color:#a8bbff;font-weight:700}:root[data-theme=dark] .toast button{color:var(--accent-ink)}input[type=search]::-webkit-search-cancel-button{display:none}.search-screen .accent.block{margin-top:16px}.stage{position:absolute;inset:0}.ghosts,.ghost{position:absolute;inset:0;pointer-events:none}.ghost,.ghost *{animation:none!important;transition:none!important}.sheet-handle{flex:none;touch-action:none;cursor:grab}.sheet.dragging{transition:none}@keyframes sheet-in{0%{transform:translateY(100%)}}.list-button,.drawer-row,.option,.preset,.popover>button,.item-row,.thread-inner,.back-row,.tab,.week-day{transition:background-color var(--dur-short),color var(--dur-short),transform var(--dur-short) var(--ease-out)}.list-button:active,.option:active,.item-row:active,.back-row:active,.thread-inner:active{background-color:var(--press)}.thread-inner:active{background-image:linear-gradient(var(--press),var(--press))}.accent,.primary,.secondary,.outline,.chip,.add-pill,.fab,.preset,.option,.link-button,.segmented button,.week-day{transition:transform var(--dur-short) var(--ease-out),background-color var(--dur-short),color var(--dur-short),border-color var(--dur-short)}.accent:active,.primary:active,.secondary:active,.outline:active,.chip:active,.add-pill:active,.preset:active,.option:active,.week-day:active{transform:scale(.97)}.fab:active{transform:scale(.94)}.icon-button{transition:background-color var(--dur-short),transform var(--dur-short) var(--ease-out)}.icon-button:active{transform:scale(.92)}.popover{animation:pop-in .18s var(--ease-out);transform-origin:top right}.add-menu{transform-origin:top left}@keyframes pop-in{0%{opacity:0;transform:scale(.9)}}.tabs{animation:tabs-in var(--dur-medium) var(--ease-out)}@keyframes tabs-in{0%{transform:translateY(100%)}}.tab .tab-icon{isolation:isolate}.tab .tab-icon:before{content:\"\";position:absolute;inset:0;z-index:-1;border-radius:16px;background:var(--accent-tint);transform:scaleX(.3);opacity:0;transition:transform var(--dur-medium) var(--ease-out),opacity var(--dur-short)}.tab[aria-current=page] .tab-icon{background:none}.tab[aria-current=page] .tab-icon:before{transform:none;opacity:1}.tab:active .tab-icon:before{opacity:1;background:var(--press);transform:none}.tab[aria-current=page]:active .tab-icon:before{background:var(--accent-tint)}.badge{animation:badge-pop .3s var(--ease-spring)}@keyframes badge-pop{0%{transform:scale(.4)}}.crossfade{animation:fade var(--dur-medium) var(--ease-out)}.week-day{transition:background-color var(--dur-medium) var(--ease-out),color var(--dur-medium)}.progress span{transition:width .5s var(--ease-out)}.app.has-tabs .toast-region{bottom:84px}@keyframes toast-in{0%{opacity:0;transform:translateY(24px) scale(.96)}}.toast.leaving{animation:toast-out .18s var(--ease-in) forwards}@keyframes toast-out{to{opacity:0;transform:translateY(16px) scale(.96)}}.fab{transition:transform var(--dur-medium) var(--ease-out),background-color var(--dur-short)}.app.has-toast .fab{transform:translateY(-64px)}.app.has-toast .fab:active{transform:translateY(-64px) scale(.94)}.message-body{animation:fade var(--dur-medium) var(--ease-out)}:root{--shimmer: rgba(255, 255, 255, .7)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--shimmer: rgba(255, 255, 255, .1)}}:root[data-theme=dark]{--shimmer: rgba(255, 255, 255, .1)}.progress-bar{position:relative;flex:none;height:3px;margin-bottom:-3px;z-index:2;overflow:hidden;opacity:0;transition:opacity .2s;pointer-events:none}.progress-bar.active{opacity:1;transition-delay:.25s}.progress-bar.active:before{content:\"\";position:absolute;inset:0 auto 0 0;width:40%;border-radius:2px;background:var(--accent);animation:progress 1.2s var(--ease-out) infinite}@keyframes progress{0%{transform:translate(-100%)}to{transform:translate(250%)}}.spinner{width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.list-end{flex-direction:column;align-items:center;gap:4px}.screen{position:relative}.pull-indicator{position:absolute;top:-44px;left:50%;z-index:3;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--paper);color:var(--ink-3);box-shadow:0 2px 8px #0000002e;pointer-events:none}.pull-indicator.armed,.pull-indicator.active{color:var(--accent)}.pull-indicator.active{transition:transform .25s var(--ease-out)}.pull-indicator span{display:grid}.pull-indicator.active span{animation:spin .8s linear infinite}.reveal{animation:fade .24s var(--ease-out)}.mark{transition:background-color .15s,border-color .15s}.mark.checking{background:var(--done);border-color:var(--done);color:#fff;animation:badge-pop .32s var(--ease-spring)}.today-title{transition:opacity .25s}.today-row.is-done .today-title{opacity:.55;text-decoration:line-through}.star.on svg{animation:star-pop .36s var(--ease-spring)}@keyframes star-pop{0%{transform:scale(.5) rotate(-30deg)}to{transform:none}}.thread-inner{transition:background-color var(--dur-short),transform .22s var(--ease-out)}.thread-inner.dragging{transition:none}.swipe-under svg{transition:transform .15s var(--ease-spring)}.swipe-under.armed svg{transform:scale(1.3)}@media(prefers-reduced-motion:reduce){.skeleton-avatar,.skeleton-row>div span,.skeleton .bar,.progress-bar.active:before{animation:none}.progress-bar.active:before{width:100%;opacity:.5}.reveal,.mark.checking,.star.on svg,.pull-indicator.active span{animation:none}}\n"},{"path":"foreground.js","encoding":"utf8","content":"\"use strict\";(()=>{var t1=Object.create;var lm=Object.defineProperty;var n1=Object.getOwnPropertyDescriptor;var a1=Object.getOwnPropertyNames;var l1=Object.getPrototypeOf,i1=Object.prototype.hasOwnProperty;var kn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var o1=(e,t,n,a)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let l of a1(t))!i1.call(e,l)&&l!==n&&lm(e,l,{get:()=>t[l],enumerable:!(a=n1(t,l))||a.enumerable});return e};var Y=(e,t,n)=>(n=e!=null?t1(l1(e)):{},o1(t||!e||!e.__esModule?lm(n,\"default\",{value:e,enumerable:!0}):n,e));var km=kn($=>{\"use strict\";var zc=Symbol.for(\"react.transitional.element\"),O1=Symbol.for(\"react.portal\"),k1=Symbol.for(\"react.fragment\"),_1=Symbol.for(\"react.strict_mode\"),R1=Symbol.for(\"react.profiler\"),U1=Symbol.for(\"react.consumer\"),H1=Symbol.for(\"react.context\"),B1=Symbol.for(\"react.forward_ref\"),L1=Symbol.for(\"react.suspense\"),G1=Symbol.for(\"react.memo\"),wm=Symbol.for(\"react.lazy\"),q1=Symbol.for(\"react.activity\"),Y1=Symbol.for(\"react.view_transition\"),xm=Symbol.iterator;function j1(e){return e===null||typeof e!=\"object\"?null:(e=xm&&e[xm]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var Em={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Am=Object.assign,Mm={};function Ql(e,t,n){this.props=e,this.context=t,this.refs=Mm,this.updater=n||Em}Ql.prototype.isReactComponent={};Ql.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};Ql.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function Dm(){}Dm.prototype=Ql.prototype;function Cc(e,t,n){this.props=e,this.context=t,this.refs=Mm,this.updater=n||Em}var Oc=Cc.prototype=new Dm;Oc.constructor=Cc;Am(Oc,Ql.prototype);Oc.isPureReactComponent=!0;var Sm=Array.isArray;function Dc(){}var ze={H:null,A:null,T:null,S:null},zm=Object.prototype.hasOwnProperty;function kc(e,t,n){var a=n.ref;return{$$typeof:zc,type:e,key:t,ref:a!==void 0?a:null,props:n}}function X1(e,t){return kc(e.type,t,e.props)}function _c(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===zc}function V1(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(n){return t[n]})}var Tm=/\\/+/g;function Mc(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?V1(\"\"+e.key):t.toString(36)}function Q1(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(Dc,Dc):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function Vl(e,t,n,a,l){var i=typeof e;(i===\"undefined\"||i===\"boolean\")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case\"bigint\":case\"string\":case\"number\":o=!0;break;case\"object\":switch(e.$$typeof){case zc:case O1:o=!0;break;case wm:return o=e._init,Vl(o(e._payload),t,n,a,l)}}if(o)return l=l(e),o=a===\"\"?\".\"+Mc(e,0):a,Sm(l)?(n=\"\",o!=null&&(n=o.replace(Tm,\"$&/\")+\"/\"),Vl(l,t,n,\"\",function(c){return c})):l!=null&&(_c(l)&&(l=X1(l,n+(l.key==null||e&&e.key===l.key?\"\":(\"\"+l.key).replace(Tm,\"$&/\")+\"/\")+o)),t.push(l)),1;o=0;var u=a===\"\"?\".\":a+\":\";if(Sm(e))for(var r=0;r{\"use strict\";_m.exports=km()});var Xm=kn(He=>{\"use strict\";function Bc(e,t){var n=e.length;e.push(t);e:for(;0>>1,l=e[a];if(0>>1;avu(u,n))rvu(c,u)?(e[a]=c,e[r]=n,a=r):(e[a]=u,e[o]=n,a=o);else if(rvu(c,n))e[a]=c,e[r]=n,a=r;else break e}}return t}function vu(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}He.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(Rm=performance,He.unstable_now=function(){return Rm.now()}):(Rc=Date,Um=Rc.now(),He.unstable_now=function(){return Rc.now()-Um});var Rm,Rc,Um,ea=[],ya=[],K1=1,on=null,xt=3,Lc=!1,$i=!1,Fi=!1,Gc=!1,Lm=typeof setTimeout==\"function\"?setTimeout:null,Gm=typeof clearTimeout==\"function\"?clearTimeout:null,Hm=typeof setImmediate<\"u\"?setImmediate:null;function yu(e){for(var t=_n(ya);t!==null;){if(t.callback===null)bu(ya);else if(t.startTime<=e)bu(ya),t.sortIndex=t.expirationTime,Bc(ea,t);else break;t=_n(ya)}}function qc(e){if(Fi=!1,yu(e),!$i)if(_n(ea)!==null)$i=!0,Il||(Il=!0,Zl());else{var t=_n(ya);t!==null&&Yc(qc,t.startTime-e)}}var Il=!1,Wi=-1,qm=5,Ym=-1;function jm(){return Gc?!0:!(He.unstable_now()-Yme&&jm());){var a=on.callback;if(typeof a==\"function\"){on.callback=null,xt=on.priorityLevel;var l=a(on.expirationTime<=e);if(e=He.unstable_now(),typeof l==\"function\"){on.callback=l,yu(e),t=!0;break t}on===_n(ea)&&bu(ea),yu(e)}else bu(ea);on=_n(ea)}if(on!==null)t=!0;else{var i=_n(ya);i!==null&&Yc(qc,i.startTime-e),t=!1}}break e}finally{on=null,xt=n,Lc=!1}t=void 0}}finally{t?Zl():Il=!1}}}var Zl;typeof Hm==\"function\"?Zl=function(){Hm(Uc)}:typeof MessageChannel<\"u\"?(Hc=new MessageChannel,Bm=Hc.port2,Hc.port1.onmessage=Uc,Zl=function(){Bm.postMessage(null)}):Zl=function(){Lm(Uc,0)};var Hc,Bm;function Yc(e,t){Wi=Lm(function(){e(He.unstable_now())},t)}He.unstable_IdlePriority=5;He.unstable_ImmediatePriority=1;He.unstable_LowPriority=4;He.unstable_NormalPriority=3;He.unstable_Profiling=null;He.unstable_UserBlockingPriority=2;He.unstable_cancelCallback=function(e){e.callback=null};He.unstable_forceFrameRate=function(e){0>e||125a?(e.sortIndex=n,Bc(ya,e),_n(ea)===null&&e===_n(ya)&&(Fi?(Gm(Wi),Wi=-1):Fi=!0,Yc(qc,n-a))):(e.sortIndex=l,Bc(ea,e),$i||Lc||($i=!0,Il||(Il=!0,Zl()))),e};He.unstable_shouldYield=jm;He.unstable_wrapCallback=function(e){var t=xt;return function(){var n=xt;xt=t;try{return e.apply(this,arguments)}finally{xt=n}}}});var Qm=kn((kT,Vm)=>{\"use strict\";Vm.exports=Xm()});var Km=kn(St=>{\"use strict\";var J1=Ke();function Im(e){var t=\"https://react.dev/errors/\"+e;if(1{\"use strict\";function Jm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jm)}catch(e){console.error(e)}}Jm(),$m.exports=Km()});var B0=kn(tc=>{\"use strict\";var tt=Qm(),Hg=Ke(),P1=Fm();function N(e){var t=\"https://react.dev/errors/\"+e;if(1ni||(e.current=Ms[ni],Ms[ni]=null,ni--)}function ke(e,t){ni++,Ms[ni]=e.current,e.current=t}var Xn=Zn(null),Eo=Zn(null),ka=Zn(null),ur=Zn(null);function rr(e,t){switch(ke(ka,t),ke(Eo,e),ke(Xn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gg(t),e=f0(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}mt(Xn),ke(Xn,e)}function Ti(){mt(Xn),mt(Eo),mt(ka)}function Ds(e){var t=e.memoizedState;t!==null&&(ki._currentValue=t.memoizedState,ke(ur,e)),t=Xn.current;var n=f0(t,e.type);t!==n&&(ke(Eo,e),ke(Xn,n))}function cr(e){Eo.current===e&&(mt(Xn),mt(Eo)),ur.current===e&&(mt(ur),ki._currentValue=fl)}var jc,np;function Sa(e){if(jc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);jc=t&&t[1]||\"\",np=-1)\":-1l||r[a]!==c[l]){var m=`\n`+r[a].replace(\" at new \",\" at \");return e.displayName&&m.includes(\"\")&&(m=m.replace(\"\",e.displayName)),m}while(1<=a&&0<=l);break}}}finally{Xc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?Sa(n):\"\"}function rb(e,t){switch(e.tag){case 26:case 27:case 5:return Sa(e.type);case 16:return Sa(\"Lazy\");case 13:return e.child!==t&&t!==null?Sa(\"Suspense Fallback\"):Sa(\"Suspense\");case 19:return Sa(\"SuspenseList\");case 0:case 15:return Vc(e.type,!1);case 11:return Vc(e.type.render,!1);case 1:return Vc(e.type,!0);case 31:return Sa(\"Activity\");case 30:return Sa(\"ViewTransition\");default:return\"\"}}function ap(e){try{var t=\"\",n=null;do t+=rb(e,n),n=e,e=e.return;while(e);return t}catch(a){return`\nError generating stack: `+a.message+`\n`+a.stack}}var zs=Object.prototype.hasOwnProperty,kd=tt.unstable_scheduleCallback,Qc=tt.unstable_cancelCallback,cb=tt.unstable_shouldYield,sb=tt.unstable_requestPaint,Kt=tt.unstable_now,db=tt.unstable_getCurrentPriorityLevel,Qg=tt.unstable_ImmediatePriority,Zg=tt.unstable_UserBlockingPriority,sr=tt.unstable_NormalPriority,fb=tt.unstable_LowPriority,Ig=tt.unstable_IdlePriority,mb=tt.log,pb=tt.unstable_setDisableYieldValue,jo=null,Jt=null;function Aa(e){if(typeof mb==\"function\"&&pb(e),Jt&&typeof Jt.setStrictMode==\"function\")try{Jt.setStrictMode(jo,e)}catch{}}var $t=Math.clz32?Math.clz32:vb,gb=Math.log,hb=Math.LN2;function vb(e){return e>>>=0,e===0?32:31-(gb(e)/hb|0)|0}var Tu=256,Nu=262144,wu=4194304;function ul(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Hr(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var u=a&134217727;return u!==0?(a=u&~i,a!==0?l=ul(a):(o&=u,o!==0?l=ul(o):n||(n=u&~e,n!==0&&(l=ul(n))))):(u=a&~i,u!==0?l=ul(u):o!==0?l=ul(o):n||(n=a&~e,n!==0&&(l=ul(n)))),l===0?0:t!==0&&t!==l&&(t&i)===0&&(i=l&-l,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:l}function Xo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Kg(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Vo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bb(e,t,n,a,l,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var u=e.entanglements,r=e.expirationTimes,c=e.hiddenUpdates;for(n=o&~n;0\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),_s=!1;if(ua)try{Kl={},Object.defineProperty(Kl,\"passive\",{get:function(){_s=!0}}),window.addEventListener(\"test\",Kl,Kl),window.removeEventListener(\"test\",Kl,Kl)}catch{_s=!1}var Kl,Ma=null,Bd=null,Vu=null;function sh(){if(Vu)return Vu;var e,t=Bd,n=t.length,a,l=\"value\"in Ma?Ma.value:Ma.textContent,i=l.length;for(e=0;e=fo),hp=\" \",vp=!1;function fh(e,t){switch(e){case\"keyup\":return tx.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function mh(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var li=!1;function ax(e,t){switch(e){case\"compositionend\":return mh(t);case\"keypress\":return t.which!==32?null:(vp=!0,hp);case\"textInput\":return e=t.data,e===hp&&vp?null:e;default:return null}}function lx(e,t){if(li)return e===\"compositionend\"||!Gd&&fh(e,t)?(e=sh(),Vu=Bd=Ma=null,li=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function Sp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tp(e,t){var n=Sp(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Sp(n)}}function vh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vh(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rs(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rs(e.document)}return t}function qd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var fx=ua&&\"documentMode\"in document&&11>=document.documentMode,ii=null,Us=null,po=null,Hs=!1;function Np(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hs||ii==null||ii!==Rs(a)||(a=ii,\"selectionStart\"in a&&qd(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),po&&Do(po,a)||(po=a,a=_r(Us,\"onSelect\"),0>=o,l-=o,Yn=1<<32-$t(t)+l|n<D?(Q=C,C=null):Q=C.sibling;var O=f(p,C,v[D],x);if(O===null){C===null&&(C=Q);break}e&&C&&O.alternate===null&&t(p,C),g=i(O,g,D),U===null?w=O:U.sibling=O,U=O,C=Q}if(D===v.length)return n(p,C),ee&&aa(p,D),w;if(C===null){for(;DD?(Q=C,C=null):Q=C.sibling;var ne=f(p,C,O.value,x);if(ne===null){C===null&&(C=Q);break}e&&C&&ne.alternate===null&&t(p,C),g=i(ne,g,D),U===null?w=ne:U.sibling=ne,U=ne,C=Q}if(O.done)return n(p,C),ee&&aa(p,D),w;if(C===null){for(;!O.done;D++,O=v.next())O=d(p,O.value,x),O!==null&&(g=i(O,g,D),U===null?w=O:U.sibling=O,U=O);return ee&&aa(p,D),w}for(C=a(C);!O.done;D++,O=v.next())O=s(C,p,D,O.value,x),O!==null&&(e&&(Q=O.alternate,Q!==null&&C.delete(Q.key===null?D:Q.key)),g=i(O,g,D),U===null?w=O:U.sibling=O,U=O);return e&&C.forEach(function(Ne){return t(p,Ne)}),ee&&aa(p,D),w}function S(p,g,v,x){if(typeof v==\"object\"&&v!==null&&v.type===ti&&v.key===null&&v.props.ref===void 0&&(v=v.props.children),typeof v==\"object\"&&v!==null){switch(v.$$typeof){case Su:e:{for(var w=v.key;g!==null;){if(g.key===w){if(w=v.type,w===ti){if(g.tag===7){n(p,g.sibling),x=l(g,v.props.children),xa(x,v),x.return=p,p=x;break e}}else if(g.elementType===w||typeof w==\"object\"&&w!==null&&w.$$typeof===Na&&rl(w)===g.type){n(p,g.sibling),x=l(g,v.props),xa(x,v),x.return=p,p=x;break e}n(p,g);break}else t(p,g);g=g.sibling}v.type===ti?(x=ml(v.props.children,p.mode,x,v.key),xa(x,v),x.return=p,p=x):(x=Zu(v.type,v.key,v.props,null,p.mode,x),xa(x,v),x.return=p,p=x)}return o(p);case oo:e:{for(w=v.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(p,g.sibling),x=l(g,v.children||[]),x.return=p,p=x;break e}else{n(p,g);break}else t(p,g);g=g.sibling}x=ts(v,p.mode,x),x.return=p,p=x}return o(p);case Na:return v=rl(v),S(p,g,v,x)}if(uo(v))return h(p,g,v,x);if(eo(v)){if(w=eo(v),typeof w!=\"function\")throw Error(N(150));return v=w.call(v),y(p,g,v,x)}if(typeof v.then==\"function\")return S(p,g,Cu(v),x);if(v.$$typeof===Gn)return S(p,g,zu(p,v),x);Ou(p,v)}return typeof v==\"string\"&&v!==\"\"||typeof v==\"number\"||typeof v==\"bigint\"?(v=\"\"+v,g!==null&&g.tag===6?(n(p,g.sibling),x=l(g,v),x.return=p,p=x):(n(p,g),x=es(v,p.mode,x),x.return=p,p=x),o(p)):n(p,g)}return function(p,g,v,x){try{Oo=0;var w=S(p,g,v,x);return hi=null,w}catch(C){if(C===Bi||C===Vr)throw C;var U=Bt(29,C,null,p.mode);return U.lanes=x,U.return=p,U}}}var Sl=_h(!0),Rh=_h(!1),wa=!1;function Kd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function js(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(se&2)!==0){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=mr(e),Eh(e,null,n),t}return jr(e,a,t,n),mr(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Fg(e,n)}}function as(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xs=!1;function vo(){if(Xs){var e=gi;if(e!==null)throw e}}function yo(e,t,n,a){Xs=!1;var l=e.updateQueue;wa=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var r=u,c=r.next;r.next=null,o===null?i=c:o.next=c,o=r;var m=e.alternate;m!==null&&(m=m.updateQueue,u=m.lastBaseUpdate,u!==o&&(u===null?m.firstBaseUpdate=c:u.next=c,m.lastBaseUpdate=r))}if(i!==null){var d=l.baseState;o=0,m=c=r=null,u=i;do{var f=u.lane&-536870913,s=f!==u.lane;if(s?(oe&f)===f:(a&f)===f){f!==0&&f===xl&&(Xs=!0),m!==null&&(m=m.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var h=e,y=u;f=t;var S=n;switch(y.tag){case 1:if(h=y.payload,typeof h==\"function\"){d=h.call(S,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=y.payload,f=typeof h==\"function\"?h.call(S,d,f):h,f==null)break e;d=Me({},d,f);break e;case 2:wa=!0}}f=u.callback,f!==null&&(e.flags|=64,s&&(e.flags|=8192),s=l.callbacks,s===null?l.callbacks=[f]:s.push(f))}else s={lane:f,tag:u.tag,payload:u.payload,callback:u.callback,next:null},m===null?(c=m=s,r=d):m=m.next=s,o|=f;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;s=u,u=s.next,s.next=null,l.lastBaseUpdate=s,l.shared.pending=null}}while(!0);m===null&&(r=d),l.baseState=r,l.firstBaseUpdate=c,l.lastBaseUpdate=m,i===null&&(l.shared.lanes=0),Za|=o,e.lanes=o,e.memoizedState=d}}function Uh(e,t){if(typeof e!=\"function\")throw Error(N(191,e));e.call(t)}function Hh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ei?i:8;var o=Z.T,u={};u.types=o!==null?o.types:null,Z.T=u,cf(e,!1,t,n);try{var r=l(),c=Z.S;if(c!==null&&c(u,r),r!==null&&typeof r==\"object\"&&typeof r.then==\"function\"){var m=Nx(r,a);bo(e,t,m,Ft(e))}else bo(e,t,a,Ft(e))}catch(d){bo(e,t,{then:function(){},status:\"rejected\",reason:d},Ft())}finally{de.p=i,o!==null&&u.types!==null&&(o.types=u.types),Z.T=o}}function zx(){}function Ks(e,t,n,a){if(e.tag!==5)throw Error(N(476));var l=uv(e).queue;ov(e,l,t,fl,n===null?zx:function(){return rv(e),n(a)})}function uv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fl,baseState:fl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:fl},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rv(e){var t=uv(e);t.next===null&&(t=e.alternate.memoizedState),bo(e,t.next.queue,{},Ft())}function rf(){return ft(ki)}function cv(){return Qe().memoizedState}function sv(){return Qe().memoizedState}function Cx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ft();e=Ra(n);var a=Ua(t,e,n);a!==null&&(Lt(a,t,n),ho(a,t,n)),t={cache:Qd()},e.payload=t;return}t=t.return}}function Ox(e,t,n){var a=Ft();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Kr(e)?fv(t,n):(n=jd(e,t,n,a),n!==null&&(Lt(n,e,a),mv(n,t,a)))}function dv(e,t,n){var a=Ft();bo(e,t,n,a)}function bo(e,t,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Kr(e))fv(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,u=i(o,n);if(l.hasEagerState=!0,l.eagerState=u,Wt(u,o))return jr(e,t,l,0),Ae===null&&Yr(),!1}catch{}if(n=jd(e,t,l,a),n!==null)return Lt(n,e,a),mv(n,t,a),!0}return!1}function cf(e,t,n,a){if(a={lane:2,revertLane:xf(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Kr(e)){if(t)throw Error(N(479))}else t=jd(e,n,a,2),t!==null&&Lt(t,e,2)}function Kr(e){var t=e.alternate;return e===F||t!==null&&t===F}function fv(e,t){vi=xr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mv(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Fg(e,n)}}var Tr={readContext:ft,use:Zr,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye,useEffectEvent:Ye},pv={readContext:ft,use:Zr,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:Gp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$u(4194308,4,tv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $u(4194308,4,e,t)},useInsertionEffect:function(e,t){$u(4,2,e,t)},useMemo:function(e,t){var n=Dt();t=t===void 0?null:t;var a=e();if(Tl){Aa(!0);try{e()}finally{Aa(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Dt();if(n!==void 0){var l=n(t);if(Tl){Aa(!0);try{n(t)}finally{Aa(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=Ox.bind(null,F,e),[a.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Zs(e);var t=e.queue,n=dv.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:of,useDeferredValue:function(e,t){var n=Dt();return uf(n,e,t)},useTransition:function(){var e=Zs(!1);return e=ov.bind(null,F,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=F,l=Dt();if(ee){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),Ae===null)throw Error(N(349));(oe&127)!==0||Yh(a,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Gp(Xh.bind(null,a,i,e),[e]),a.flags|=2048,Ei(9,{destroy:void 0},jh.bind(null,a,i,n,t),null),n},useId:function(){var e=Dt(),t=Ae.identifierPrefix;if(ee){var n=jn,a=Yn;n=(a&~(1<<32-$t(a)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=Sr++,0<\\/script>\",i=i.removeChild(i.firstChild);break;case\"select\":i=typeof a.is==\"string\"?o.createElement(\"select\",{is:a.is}):o.createElement(\"select\"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is==\"string\"?o.createElement(l,{is:a.is}):o.createElement(l)}}i[dt]=t,i[qt]=a;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(gt(i,l,a),l){case\"button\":case\"input\":case\"select\":case\"textarea\":a=!!a.autoFocus;break e;case\"img\":a=!0;break e;default:a=!1}a&&na(t)}}return Ce(t),t.subtreeFlags&=-33554433,us(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&na(t);else{if(typeof a!=\"string\"&&t.stateNode===null)throw Error(N(166));if(e=ka.current,Jl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=it,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||d0(e.nodeValue,n)),e||Xa(t,!0)}else e=Ho(e).createTextNode(a),e[dt]=t,t.stateNode=e}return Ce(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Jl(t),n!==null){if(e===null){if(!a)throw Error(N(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(557));e[dt]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ce(t),e=!1}else n=ns(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Qt(t),t):(Qt(t),null);if((t.flags&128)!==0)throw Error(N(558))}return Ce(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Jl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(N(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(N(317));l[dt]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ce(t),l=!1}else l=ns(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(Qt(t),t):(Qt(t),null)}return Qt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==l&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ru(t,t.updateQueue),Ce(t),null);case 4:return Ti(),e===null&&Sf(t.stateNode.containerInfo),t.flags|=67108864,Ce(t),null;case 10:return oa(t.type),Ce(t),null;case 19:if($d(t),a=t.memoizedState,a===null)return Ce(t),null;if(l=(t.flags&128)!==0,i=a.rendering,i===null)if(l)no(a,!1);else{if(je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=br(e),i!==null){for(t.flags|=128,no(a,!1),e=i.updateQueue,t.updateQueue=e,Ru(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ah(n,e),n=n.sibling;return ko(t,pt.current&1|2),ee&&aa(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Kt()>zr&&(t.flags|=128,l=!0,no(a,!1),t.lanes=4194304)}else{if(!l)if(e=br(i),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Ru(t,e),no(a,!0),a.tail===null&&a.tailMode!==\"collapsed\"&&a.tailMode!==\"visible\"&&!i.alternate&&!ee)return Ce(t),null}else 2*Kt()-a.renderingStartTime>zr&&n!==536870912&&(t.flags|=128,l=!0,no(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}if(a.tail!==null){e=a.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Kt(),e.sibling=null,i=pt.current,i=l?i&1|2:i&1,a.tailMode===\"visible\"||a.tailMode===\"collapsed\"||!n||ee?ko(t,i):(n=i,ke(ht,t),ke(pt,n),Tt===null&&(Tt=t)),ee&&aa(t,a.treeForkCount),e}return Ce(t),null;case 22:case 23:return Qt(t),Jd(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ce(t),t.subtreeFlags&6&&(t.flags|=8192)):Ce(t),n=t.updateQueue,n!==null&&Ru(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&mt(pl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),oa($e),Ce(t),null;case 25:return null;case 30:return t.flags|=33554432,Ce(t),null}throw Error(N(156,t.tag))}function Lx(e,t){switch(Vd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return oa($e),Ti(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return cr(t),null;case 31:if(t.memoizedState!==null){if(Qt(t),t.alternate===null)throw Error(N(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $d(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ti(),null;case 10:return oa(t.type),null;case 22:case 23:return Qt(t),Jd(),e!==null&&mt(pl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return oa($e),null;case 25:return null;default:return null}}function Ev(e,t){switch(Vd(t),t.tag){case 3:oa($e),Ti();break;case 26:case 27:case 5:cr(t);break;case 4:Ti();break;case 31:t.memoizedState!==null&&Qt(t);break;case 13:Qt(t);break;case 19:$d(t);break;case 10:oa(t.type);break;case 22:case 23:Qt(t),Jd(),e!==null&&mt(pl);break;case 24:oa($e)}}function Jo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var i=n.create,o=n.inst;a=i(),o.destroy=a}n=n.next}while(n!==l)}}catch(u){be(t,t.return,u)}}function Qa(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&e)===e){var o=a.inst,u=o.destroy;if(u!==void 0){o.destroy=void 0,l=t;var r=n,c=u;try{c()}catch(m){be(l,r,m)}}}a=a.next}while(a!==i)}}catch(m){be(t,t.return,m)}}function Av(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hh(t,n)}catch(a){be(e,e.return,a)}}}function Mv(e,t,n){n.props=Nl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){be(e,t,a)}}function Bn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:var l=e.stateNode,i=ra(e.memoizedProps,l);(l.ref===null||l.ref.name!==i)&&(l.ref=v0(i)),a=l.ref;break;case 7:if(e.stateNode===null){var o=new Pt(e);Gt(e.child,!1,A2,o,void 0,void 0),e.stateNode=o}a=e.stateNode;break;default:a=e.stateNode}typeof n==\"function\"?e.refCleanup=n(a):n.current=a}}catch(u){be(e,t,u)}}function st(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a==\"function\")try{a()}catch(l){be(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(l){be(e,t,l)}else n.current=null}function wr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title\"))),gt(a,t,n),a[dt]=e,lt(a),t=a;break e;case\"link\":if(i=Mg(\"link\",\"href\",l).get(t+(n.href||\"\"))){for(o=0;oS&&(o=S,S=y,y=o);var p=Tp(u,y),g=Tp(u,S);if(p&&g&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==g.node||s.focusOffset!==g.offset)){var v=d.createRange();v.setStart(p.node,p.offset),s.removeAllRanges(),y>S?(s.addRange(v),s.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),s.addRange(v))}}}}for(d=[],s=u;s=s.parentNode;)s.nodeType===1&&d.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof u.focus==\"function\"&&u.focus(),u=0;un?32:n,Z.T=null,n=md,md=null;var i=An,o=Vn;if(Ge=0,wl=An=null,Vn=0,(se&6)!==0)throw Error(N(331));var u=se;if(se|=4,Zv(i.current),Xv(i,i.current,o,n),se=u,$o(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot==\"function\")try{Jt.onPostCommitFiberRoot(jo,i)}catch{}return!0}finally{de.p=l,Z.T=a,l0(e,t)}}function ug(e,t,n){t=fn(n,t),t=$s(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Vo(e,2),In(e))}function be(e,t,n){if(e.tag===3)ug(e,e,n);else for(;t!==null;){if(t.tag===3){ug(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof a.componentDidCatch==\"function\"&&(La===null||!La.has(a))){e=fn(n,e),n=bv(2),a=Ua(t,n,2),a!==null&&(xv(n,a,t,e),Vo(a,2),In(a));break}}t=t.return}}function fs(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new jx;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(yf=!0,l.add(n),e=$x.bind(null,e,t,n),t.then(e,e))}function $x(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ae===e&&(oe&n)===n&&((je===4||je===3&&(oe&62914560)===oe&&300>Kt()-$r)&&(se&2)===0?Di(e,0):Dr|=n,Ai===oe&&(Ai=0)),In(e)}function i0(e,t){t===0&&(t=Jg()),e=Dl(e,t),e!==null&&(Vo(e,t),In(e))}function Fx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),i0(e,n)}function Wx(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(N(314))}a!==null&&a.delete(t),i0(e,n)}function Px(e,t){return kd(e,t)}var zi=null,Pl=null,yd=!1,kr=!1,ms=!1,Oa=0;function In(e){e!==Pl&&e.next===null&&(Pl===null?zi=Pl=e:Pl=Pl.next=e),kr=!0,yd||(yd=!0,t2())}function $o(e,t){if(!ms&&kr){ms=!0;do for(var n=!1,a=zi;a!==null;){if(!t)if(e!==0){var l=a.pendingLanes;if(l===0)var i=0;else{var o=a.suspendedLanes,u=a.pingedLanes;i=(1<<31-$t(42|e)+1)-1,i&=l&~(o&~u),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,rg(a,i))}else i=oe,i=Hr(a,a===Ae?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Xo(a,i)||(n=!0,rg(a,i));a=a.next}while(n);ms=!1}}function e2(){o0()}function o0(){kr=yd=!1;var e=0;Oa!==0&&s2()&&(e=Oa);for(var t=Kt(),n=null,a=zi;a!==null;){var l=a.next,i=u0(a,t);i===0?(a.next=null,n===null?zi=l:n.next=l,l===null&&(Pl=n)):(n=a,(e!==0||(i&3)!==0)&&(kr=!0)),a=l}Ge!==0&&Ge!==5||$o(e,!1),Oa!==0&&(Oa=0)}function u0(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes&-62914561;0u)break;var m=r.transferSize,d=r.initiatorType;m&&pg(d)&&(r=r.responseEnd,o+=m*(rlr){y.length=h;break}v=new Promise(h2.bind(v)),y.push(v)}}}if(0\"u\"?null:document;function E0(e,t,n){var a=qi;if(a&&typeof t==\"string\"&&t){var l=dn(t);l='link[rel=\"'+e+'\"][href=\"'+l+'\"]',typeof n==\"string\"&&(l+='[crossorigin=\"'+n+'\"]'),wg.has(l)||(wg.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement(\"link\"),gt(t,\"link\",e),lt(t),a.head.appendChild(t)))}}function U2(e){ga.D(e),E0(\"dns-prefetch\",e,null)}function H2(e,t){ga.C(e,t),E0(\"preconnect\",e,t)}function B2(e,t,n){ga.L(e,t,n);var a=qi;if(a&&e&&t){var l='link[rel=\"preload\"][as=\"'+dn(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(l+='[imagesrcset=\"'+dn(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(l+='[imagesizes=\"'+dn(n.imageSizes)+'\"]')):l+='[href=\"'+dn(e)+'\"]';var i=l;switch(t){case\"style\":i=Oi(e);break;case\"script\":i=Yi(e)}if(!(gn.has(i)||(e=Me({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),gn.set(i,e),a.querySelector(l)!==null||t===\"style\"&&a.querySelector(Fo(i))||t===\"script\"&&a.querySelector(Wo(i))))){var o=a.createElement(\"link\");gt(o,\"link\",e),t===\"style\"&&(o[dr]=!0,o.onload=o.onerror=function(){eh(o)}),lt(o),a.head.appendChild(o)}}}function L2(e,t){ga.m(e,t);var n=qi;if(n&&e){var a=t&&typeof t.as==\"string\"?t.as:\"script\",l='link[rel=\"modulepreload\"][as=\"'+dn(a)+'\"][href=\"'+dn(e)+'\"]',i=l;switch(a){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":i=Yi(e)}if(!gn.has(i)&&(e=Me({rel:\"modulepreload\",href:e},t),gn.set(i,e),n.querySelector(l)===null)){switch(a){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(Wo(i)))return}a=n.createElement(\"link\"),gt(a,\"link\",e),lt(a),n.head.appendChild(a)}}}function G2(e,t,n){ga.S(e,t,n);var a=qi;if(a&&e){var l=fi(a).hoistableStyles,i=Oi(e);t=t||\"default\";var o=l.get(i);if(!o){var u={loading:0,preload:null};if(o=a.querySelector(Fo(i)))u.loading=5;else{e=Me({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=gn.get(i))&&Ef(e,n);var r=o=a.createElement(\"link\");lt(r),gt(r,\"link\",e),r._p=new Promise(function(c,m){r.onload=c,r.onerror=m}),r.addEventListener(\"load\",function(){u.loading|=1}),r.addEventListener(\"error\",function(){u.loading|=2}),u.loading|=4,nr(o,t,a)}o={type:\"stylesheet\",instance:o,count:1,state:u},l.set(i,o)}}}function q2(e,t){ga.X(e,t);var n=qi;if(n&&e){var a=fi(n).hoistableScripts,l=Yi(e),i=a.get(l);i||(i=n.querySelector(Wo(l)),i||(e=Me({src:e,async:!0},t),(t=gn.get(l))&&Af(e,t),i=n.createElement(\"script\"),lt(i),gt(i,\"link\",e),n.head.appendChild(i)),i={type:\"script\",instance:i,count:1,state:null},a.set(l,i))}}function Y2(e,t){ga.M(e,t);var n=qi;if(n&&e){var a=fi(n).hoistableScripts,l=Yi(e),i=a.get(l);i||(i=n.querySelector(Wo(l)),i||(e=Me({src:e,async:!0,type:\"module\"},t),(t=gn.get(l))&&Af(e,t),i=n.createElement(\"script\"),lt(i),gt(i,\"link\",e),n.head.appendChild(i)),i={type:\"script\",instance:i,count:1,state:null},a.set(l,i))}}function Eg(e,t,n,a){var l=(l=ka.current)?Bo(l):null;if(!l)throw Error(N(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(n=Oi(n.href),t=fi(l).hoistableStyles,a=t.get(n),a||(a={type:\"style\",instance:null,count:0,state:null},t.set(n,a)),a):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=Oi(n.href);var i=fi(l).hoistableStyles,o=i.get(e);if(o||(l=l.ownerDocument||l,o={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=l.querySelector(Fo(e)))?i._p||(o.instance=i,o.state.loading=5):(i=gn.get(e),i||(i={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gn.set(e,i)),j2(l,e,i,o.state))),t&&a===null)throw Error(N(528,\"\"));return o}if(t&&a!==null)throw Error(N(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(n=Yi(n),t=fi(l).hoistableScripts,a=t.get(n),a||(a={type:\"script\",instance:null,count:0,state:null},t.set(n,a)),a):{type:\"void\",instance:null,count:0,state:null};default:throw Error(N(444,e))}}function Oi(e){return'href=\"'+dn(e)+'\"'}function Fo(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function A0(e){return Me({},e,{\"data-precedence\":e.precedence,precedence:null})}function j2(e,t,n,a){if(t=e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")){if(t[dr]!==!0){a.loading=1;return}}else t=e.createElement(\"link\"),t[dr]=!0,t.onload=t.onerror=eh.bind(null,t),gt(t,\"link\",n),lt(t),e.head.appendChild(t);a.preload=t,t.addEventListener(\"load\",function(){return a.loading|=1}),t.addEventListener(\"error\",function(){return a.loading|=2})}function Yi(e){return'[src=\"'+dn(e)+'\"]'}function Wo(e){return\"script[async]\"+e}function Ag(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var a=e.querySelector('style[data-href~=\"'+dn(n.href)+'\"]');if(a)return t.instance=a,lt(a),a;var l=Me({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement(\"style\"),lt(a),gt(a,\"style\",l),nr(a,n.precedence,e),t.instance=a;case\"stylesheet\":l=Oi(n.href);var i=e.querySelector(Fo(l));if(i)return t.state.loading|=4,t.instance=i,lt(i),i;a=A0(n),(l=gn.get(l))&&Ef(a,l),i=(e.ownerDocument||e).createElement(\"link\"),lt(i);var o=i;return o._p=new Promise(function(u,r){o.onload=u,o.onerror=r}),gt(i,\"link\",a),t.state.loading|=4,nr(i,n.precedence,e),t.instance=i;case\"script\":return i=Yi(n.src),(l=e.querySelector(Wo(i)))?(t.instance=l,lt(l),l):(a=n,(l=gn.get(i))&&(a=Me({},n),Af(a,l)),e=e.ownerDocument||e,l=e.createElement(\"script\"),lt(l),gt(l,\"link\",a),e.head.appendChild(l),t.instance=l);case\"void\":return null;default:throw Error(N(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,nr(a,n.precedence,e));return t.instance}function nr(e,t,n){for(var a=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,i=l,o=0;o title\"):null)}function X2(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function Dg(e,t){return e===\"img\"&&t.src!=null&&t.src!==\"\"&&t.onLoad==null&&t.loading!==\"lazy\"}function M0(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function D0(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==\"number\"?devicePixelRatio:1)*.25}function zg(e,t){typeof t.decode==\"function\"&&(e.imgCount++,t.complete||(e.imgBytes+=D0(t),e.suspenseyImages.push(t)),e=Z2.bind(e),t.decode().then(e,e))}function V2(e,t,n,a){if(n.type===\"stylesheet\"&&(typeof a.media!=\"string\"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=Oi(a.href),i=t.querySelector(Fo(l));if(i){t=i._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=Lo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,lt(i);return}i=t.ownerDocument||t,a=A0(a),(l=gn.get(l))&&Ef(a,l),i=i.createElement(\"link\"),lt(i);var o=i;o._p=new Promise(function(u,r){o.onload=u,o.onerror=r}),gt(i,\"link\",a),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Lo.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var lr=0;function Q2(e,t){return e.stylesheets&&e.count===0&&ir(e,e.stylesheets),0lr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function z0(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ir(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Lo(){this.count--,z0(this)}function Z2(){this.imgCount--,z0(this)}var Rr=null;function ir(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Rr=new Map,t.forEach(I2,e),Rr=null,Lo.call(e))}function I2(e,t){if(!(t.state.loading&4)){var n=Rr.get(e);if(n)var a=n.get(null);else{n=new Map,Rr.set(e,n);for(var l=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),i=0;i{\"use strict\";function L0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(L0)}catch(e){console.error(e)}}L0(),G0.exports=B0()});var j0=kn(nc=>{\"use strict\";var tS=Symbol.for(\"react.transitional.element\"),nS=Symbol.for(\"react.fragment\");function Y0(e,t,n){var a=null;if(n!==void 0&&(a=\"\"+n),t.key!==void 0&&(a=\"\"+t.key),\"key\"in t){n={};for(var l in t)l!==\"key\"&&(n[l]=t[l])}else n=t;return t=n.ref,{$$typeof:tS,type:e,key:a,ref:t!==void 0?t:null,props:n}}nc.Fragment=nS;nc.jsx=Y0;nc.jsxs=Y0});var P=kn((LT,X0)=>{\"use strict\";X0.exports=j0()});var va={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1},u1=[\"RETIRED\",\"CONFLICT\",\"NOT_FOUND\",\"DOCUMENT_TOO_LARGE\",\"STORAGE_FAILURE\",\"ORIGIN_NOT_DECLARED\",\"MESSAGE_TOO_LARGE\",\"PAGE_TOO_LARGE\",\"PATCH_TOO_LARGE\",\"DEADLINE\",\"INVALID_STEPS\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"CONFIGURATION_REQUIRED\",\"NOT_READY\",\"UNKNOWN_METHOD\",\"INVALID_ARGUMENT\",\"QUOTA_EXCEEDED\",\"PROTOCOL_MISMATCH\",\"APPLET_INCOMPATIBLE\",\"ENVELOPE_INVALID\",\"CONTEXT_REPLACED\",\"TARGET_NOT_FOUND\",\"PRECONDITION_FAILED\",\"ASYNC_READ\",\"AUTH_REQUIRED\",\"REJECTED\"];function sm(e){return typeof e==\"string\"&&u1.includes(e)}var r1=/^:[A-Za-z][A-Za-z0-9_]*$/,c1=/^[A-Za-z0-9_.~@-]+$/,Nc=new Map;function s1(e){if(Nc.has(e))return Nc.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),a=n.at(-1)===\"*\";a&&n.pop();let l=[],i=!0;for(let o of n)r1.test(o)?l.push({param:o.slice(1)}):c1.test(o)&&o!==\".\"&&o!==\"..\"?l.push({literal:o}):i=!1;i&&(t={segments:l,rest:a})}return Nc.set(e,t),t}function We(e){try{return new URL(e).href}catch{return null}}function jl(e,t){let n=d1(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let a;try{a=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}a.at(-1)===\"\"&&a.pop();for(let l of e.routes){let i=s1(l.pattern);if(!i)continue;let o=f1(i,a);if(!o||!(l.query??[]).every(r=>n.searchParams.has(r)))continue;for(let r of l.query??[])o[r]=n.searchParams.get(r);let u={kind:\"route\",routeId:l.id,page:l.page,screen:l.screen,params:o};return l.context!==void 0&&(u.context=l.context),u}return{kind:\"website\",url:t}}function d1(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function f1(e,t){if(e.rest?t.lengthy.id===i.id)?.startUrl;c={index:u.index,start:h!==void 0&&We(h)===We(t.view.url),url:s}}}else t.status===\"ready\"&&t.account!==null&&r===\"auth\"&&(r=\"none\",c=null);u.page.status===\"ready\"&&(t.status===\"loading\"||t.status===\"error\")&&(m++,d=!1,a.push({type:\"schedule\",id:i.id,token:m}));let f={...u,seen:Math.max(u.seen,t.view.n),pin:r,signIn:c,deadline:m,page:{status:t.status,pageId:t.pageId,routeId:t.routeId,view:t.view,stale:t.stale,expired:d}};return{state:ll(rm(e,i,f),f),effects:a}}case\"deadline\":{let i=e.contexts[t.id];return!i||t.token!==i.deadline||i.page.status===\"ready\"||i.page.expired?l:{state:ll(e,{...i,page:{...i.page,expired:!0}}),effects:a}}case\"user.viewWebsite\":{let i=e.contexts[t.id];return!i||i.pin===\"user\"?l:{state:ll(e,{...i,pin:\"user\"}),effects:a}}case\"user.done\":{let i=e.contexts[t.id];if(!i)return l;if(i.pin===\"auth\"&&i.signIn)return im(e,i,n)??l;let o=i.pin===\"none\"?i:{...i,pin:\"none\"},u=o===i?e:ll(e,o);if(pu(o,n)!==\"website\")return{state:u,effects:a};if(o.canGoBack)a.push({type:\"context.back\",id:i.id});else{let r=n.contexts.find(c=>c.id===i.id)?.startUrl;r&&a.push({type:\"context.navigate\",id:i.id,url:r,mode:\"push\"})}return{state:u,effects:a}}case\"navigate.url\":{let i=t.context??e.active;return e.contexts[i]?(a.push({type:\"context.navigate\",id:i,url:t.url,mode:t.mode}),{state:{...e,active:i,overlay:[],leaveGuard:null},effects:a}):l}case\"navigate.screen\":{let i=t.mode===\"root\"?[t.screen]:t.mode===\"replace\"?[...e.overlay.slice(0,-1),t.screen]:[...e.overlay,t.screen];return{state:{...e,overlay:i,leaveGuard:null},effects:a}}case\"select\":{let i=e.contexts[t.id];if(!i)return l;if(t.id!==e.active||e.overlay.length>0)return{state:{...e,active:t.id,overlay:[],leaveGuard:null},effects:a};let o=n.contexts.find(u=>u.id===t.id)?.startUrl;return o&&(i.url===null||We(i.url)!==We(o))&&a.push({type:\"context.navigate\",id:t.id,url:o,mode:\"push\"}),{state:{...e,leaveGuard:null},effects:a}}case\"back\":{if(e.leaveGuard)return{state:e,effects:[{type:\"confirmLeave\",message:e.leaveGuard.message}]};if(e.overlay.length>0)return{state:{...e,overlay:e.overlay.slice(0,-1)},effects:a};let i=e.contexts[e.active];return i?.pin===\"auth\"&&i.signIn?im(e,i,n)??{state:e,effects:[{type:\"leave\"}]}:e.contexts[e.active]?.canGoBack?{state:e,effects:[{type:\"context.back\",id:e.active}]}:{state:e,effects:[{type:\"leave\"}]}}case\"guard\":return{state:{...e,leaveGuard:t.guard},effects:a};case\"context.gone\":{let i=e.contexts[t.id];return i?{state:ll(e,{...i,page:{...Ec,status:\"unsupported\"}}),effects:a}:l}}}function im(e,t,n){let{index:a,start:l}=t.signIn,i=n.contexts[0].id,o=ll(e,{...t,pin:\"none\",signIn:null});if(!l&&a>0){let u=Math.max(1,t.index-a+1);return{state:o,effects:[{type:\"context.back\",id:t.id,steps:u}]}}return t.id===i?null:{state:{...o,active:i,overlay:[],leaveGuard:null},effects:[]}}function om(e,t,n){return t===e.generation&&e.url!==null&&We(n)===We(e.url)}function um(e,t,n,a){let l=e.deadline+1;return a.push({type:\"schedule\",id:e.id,token:l}),{...e,url:n,seen:t===e.generation?e.seen:-1,generation:t,page:Ec,deadline:l}}function rm(e,t,n){return!e.leaveGuard||t.id!==e.active||e.overlay.length>0||t.index===n.index&&t.url!==null&&n.url!==null&&We(t.url)===We(n.url)?e:{...e,leaveGuard:null}}function ll(e,t){return{...e,contexts:{...e.contexts,[t.id]:t}}}function Ac(e){let t={};for(let[n,a]of Object.entries(e.contexts))t[n]={url:a.url};return{version:va.sessionState,state:{active:e.active,overlay:e.overlay,contexts:t}}}function mm(e,t){let n=m1(t);if(!e||e.version!==va.sessionState||!Ji(e.state))return n;let{active:a,overlay:l,contexts:i}=e.state,o={...n,contexts:{...n.contexts}};if(typeof a==\"string\"&&o.contexts[a]&&(o.active=a),Array.isArray(l)&&(o.overlay=l.filter(u=>g1(u,t.foreground.screens))),Ji(i))for(let u of Object.keys(o.contexts)){let r=Ji(i[u])?i[u].url:void 0;typeof r==\"string\"&&(o.contexts[u]=dm(u,r))}return o}function g1(e,t){return Ji(e)&&typeof e.key==\"string\"&&typeof e.id==\"string\"&&t.includes(e.id)&&Ji(e.params)&&Object.values(e.params).every(n=>typeof n==\"string\")}function Ji(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var TT=va.bundleFormat,wc=\"(0|[1-9]\\\\d*)\",cm=\"(?:0|[1-9]\\\\d*|\\\\d*[A-Za-z-][0-9A-Za-z-]*)\",NT=new RegExp(`^${wc}\\\\.${wc}\\\\.${wc}(?:-(${cm}(?:\\\\.${cm})*))?$`),Sn=class extends Error{code;constructor(e,t){super(t),this.name=\"GenesisError\",this.code=e}},h1=2e3;function pm(e,t){return new Promise((n,a)=>{let l=null,i=!1,o=1,u=new Map,r=new Map,c={get bound(){return l},get retired(){return i},request(s,h={}){if(i)return Promise.reject(new Sn(\"RETIRED\",\"This page was closed\"));let y=o++;return new Promise((S,p)=>{let g=setTimeout(()=>{u.delete(y),p(new Sn(\"DEADLINE\",`${s} did not answer in time`))},l.limits.rpcDeadlineMs+h1);u.set(y,{resolve:S,reject:p,timer:g}),e.postMessage(JSON.stringify({type:\"request\",documentId:l.documentId,requestId:y,method:s,params:h}))})},on(s,h){let y=r.get(s);return y||r.set(s,y=new Set),y.add(h),()=>{y.delete(h)}}};function m(){i=!0;for(let s of u.values())clearTimeout(s.timer),s.reject(new Sn(\"RETIRED\",\"This page was closed\"));u.clear()}function d(s,h){for(let y of[...r.get(s)??[]])try{y(h)}catch(S){console.error(`Genesis ${s} handler failed`,S)}}e.addEventListener(\"message\",s=>{if(i||typeof s.data!=\"string\")return;let h;try{h=JSON.parse(s.data)}catch{return}if(h?.type===\"refused\"&&!l){i=!0,a(new Sn(h.error?.code??\"PROTOCOL_MISMATCH\",h.error?.message??\"The host refused this page\"));return}if(h?.type===\"bound\"){if(l)return;l=h,n(c);return}if(!(!l||h?.documentId!==l.documentId))if(h.type===\"response\"){let y=u.get(h.requestId);if(!y)return;u.delete(h.requestId),clearTimeout(y.timer),h.error?y.reject(new Sn(h.error.code,h.error.message)):y.resolve(h.result??null)}else h.type===\"event\"&&(h.name===\"retired\"?(m(),d(\"retired\",{})):d(h.name,h.data))}),addEventListener(\"pagehide\",()=>{i||(d(\"pagehide\",{}),m())});let f={type:\"hello\",protocol:va.protocol,url:t};e.postMessage(JSON.stringify(f))})}var v1={pageId:null,routeId:null,params:{}};function y1(e,t){let n={};for(let d of e)n[d]=b1();let a={account:null,contexts:n},l=!1,i=new Map;function o(d){let f=d===null?[...i.values()]:[i.get(null),...d.map(h=>i.get(h))],s=new Set;for(let h of f)for(let y of[...h??[]])s.has(y)||(s.add(y),y())}function u(d,f){a={...a,contexts:{...a.contexts,[d]:f}}}function r(d){let{entry:f}=d;if(!d.attached||d.status!==\"ready\"||!f||!Xl(f.url,d.url))return;let{history:s}=d;for(s.delete(f.index),s.set(f.index,hm(d));s.size>t.historyEntriesMax;)s.delete(s.keys().next().value)}function c(d,f,s){if(f===void 0||s!==\"ready\"&&s!==\"auth\")return!1;if(!l)return l=!0,a.account!==f&&(a={...a,account:f}),!1;if(f===a.account)return!1;let h={};for(let[y,S]of Object.entries(a.contexts))S.history.clear(),h[y]=y===d||!S.content||S.stale?S:{...S,stale:!0};return a={account:f,contexts:h},r(h[d]),!0}let m=(d,f=!1)=>({outcome:d,accountChanged:f});return{state:()=>a,context:d=>a.contexts[d],applyPage(d,f,s){let h=a.contexts[d];if(!h||f=f.size||g===f.index&&!Xl(v.url,f.url))&&y.delete(g)}let S={...h,generation:f.generation,entry:{index:f.index,url:f.url}},p;if(Xl(h.url,f.url))h.attached&&h.view?.generation!==f.generation?p={...S,attached:!1,status:\"loading\",error:null,stale:h.content}:p=S;else{let g=y.get(f.index);p=g?{...S,...g,attached:!1,status:\"loading\",error:null,stale:!0,content:!0}:{...S,...s,url:f.url,regions:{},attached:!1,status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1}}u(d,p),r(p),o([d])},gone(d,f){let s=a.contexts[d];s&&(u(d,{...s,attached:!1,status:\"error\",error:f,stale:s.content}),o([d]))},subscribe(d,f){let s=f??null,h=i.get(s);return h||i.set(s,h=new Set),h.add(d),()=>{h.delete(d)}}}}function b1(){return{generation:0,view:null,epoch:0,seq:0,live:[],attached:!1,url:null,pageId:null,routeId:null,params:{},regions:{},status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1,entry:null,history:new Map}}function Xl(e,t){return e!==null&&t!==null&&We(e)===We(t)}function hm(e){return{url:e.url,pageId:e.pageId,routeId:e.routeId,params:e.params,regions:e.regions}}function x1(e,t){if(e.content&&Xl(e.url,t))return hm(e);let{entry:n}=e,a=n&&Xl(n.url,t)?e.history.get(n.index):void 0;return a&&Xl(a.url,t)?a:null}function vm(e,t=Object.create(null)){for(let n of e)t[n.key]=n;return t}function ym(e){return e.kind===\"single\"?{kind:\"single\",status:e.status,error:e.error??null,record:e.record}:{kind:\"collection\",status:e.status,error:e.error??null,order:e.items.map(t=>t.key),complete:e.complete,ephemeral:e.ephemeral===!0,records:vm(e.items)}}function S1(e,t){let n={};for(let[a,l]of Object.entries(e)){let i=ym(l),o=t[a];n[a]=o?T1(o,i):i}return n}var gu=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function T1(e,t){if(e.kind===\"single\"||t.kind===\"single\")return e.kind!==\"single\"||t.kind!==\"single\"?t:(gu(e.record,t.record)&&(t.record=e.record),e.record===t.record&&e.status===t.status&&gu(e.error,t.error)?e:t);let n=e.order.length===t.order.length&&e.complete===t.complete&&e.ephemeral===t.ephemeral&&e.status===t.status&&gu(e.error,t.error);for(let[a,l]of t.order.entries()){let i=e.records[l];i&&gu(i,t.records[l])?t.records[l]=i:n=!1,e.order[a]!==l&&(n=!1)}return n?e:t}function N1(e,t){let n=e.regions;for(let[a,l]of Object.entries(t)){let i=e.live.includes(a)?n[a]:void 0;if(!i)return null;let o;if(l.kind===\"replace\")o=ym(l.region);else if(l.kind===\"single\"){if(i.kind!==\"single\")return null;o={...i,record:l.record,status:l.status??i.status,error:l.error===void 0?i.error:l.error}}else{if(i.kind!==\"collection\")return null;if(o={...i,complete:l.complete??i.complete,status:l.status??i.status,error:l.error===void 0?i.error:l.error},l.upsert?.length||l.remove?.length){o.records=vm(l.upsert??[],Object.assign(Object.create(null),i.records));for(let u of l.remove??[])delete o.records[u]}if(l.order){o.order=l.order;let u=new Set(l.order);for(let r of Object.keys(o.records))u.has(r)||(o.records===i.records&&(o.records=Object.assign(Object.create(null),i.records)),delete o.records[r])}else if(l.remove?.length){let u=new Set(l.remove);o.order=i.order.filter(r=>!u.has(r))}}n===e.regions&&(n={...n}),n[a]=o}return n}var w1=class extends Sn{constructor(e,t){super(e,t),this.name=\"ServiceError\"}};async function bm(e=window.__genesisBridge){if(!e)throw new Error(\"Genesis bridge is missing; the foreground must run inside Genesis\");let t=await pm(e,location.href),{compat:n}=t.bound;if(n.protocol!==va.protocol||n.sessionState!==va.sessionState)throw new Sn(\"PROTOCOL_MISMATCH\",\"This applet was built for another Genesis version\");return C1(t)}var E1=500,A1=1e3,M1=64,D1=2e3,z1=Object.freeze([]),gm=e=>e===void 0?null:Array.isArray(e)?e:[e];function C1(e){let{manifest:t,appletId:n,limits:a,session:l}=e.bound,i=t.contexts.map(b=>b.id),o=y1(i,{historyEntriesMax:a.historyEntriesMax}),u=(b,A)=>e.request(b,A).catch(B=>{e.retired||console.error(`Genesis ${b} failed`,B)}),r=mm(l,t),c=new Set,m=null,d=new Set;function f(b){let A=fm(r,b,t),B=A.state!==r;r=A.state;let V=A.effects.filter(re=>!s(re));if(B){w=void 0,v();for(let re of[...c])re()}return V}function s(b){switch(b.type){case\"reveal\":return u(\"context.reveal\",{id:b.id}),!0;case\"cover\":return u(\"context.cover\"),!0;case\"context.navigate\":return mu(b.id),u(\"context.navigate\",{id:b.id,url:b.url,mode:b.mode}),!0;case\"context.back\":return mu(b.id),u(\"context.back\",b.steps?{id:b.id,steps:b.steps}:{id:b.id}),!0;case\"context.reload\":return mu(b.id),u(\"context.reload\",{id:b.id}),!0;case\"schedule\":return setTimeout(()=>f({type:\"deadline\",id:b.id,token:b.token}),a.documentReadyMs),!0;case\"leave\":case\"confirmLeave\":return!1}}function h(b,A){m?m(b,A):window.confirm(b)&&A()}function y(b){let A=r.leaveGuard;if(!A)return b();h(A.message,()=>{f({type:\"guard\",guard:null}),b()})}function S(b){let A=!0;for(let B of f({type:\"back\"}))if(B.type===\"leave\")A=!1;else if(B.type===\"confirmLeave\"){let V=()=>{f({type:\"guard\",guard:null}),!S(!1)&&b&&u(\"back.leave\")};setTimeout(()=>h(B.message,V),0)}return A}let p=null,g=l?JSON.stringify(Ac(r)):\"\";function v(){p===null&&(p=setTimeout(x,E1))}function x(){p!==null&&clearTimeout(p),p=null;let b=Ac(r),A=JSON.stringify(b);A!==g&&(g=A,u(\"session.save\",b))}e.on(\"suspended\",x);let w;function U(){if(w!==void 0)return w;let b=r.overlay[r.overlay.length-1],A=r.contexts[r.active],B=null;if(b)B={key:b.key,id:b.id,params:b.params,context:r.active,overlay:!0};else if(A?.url){let V=jl(t,A.url);V.kind===\"route\"&&(B={key:`${A.id}:${A.index}`,id:V.screen,params:V.params,context:A.id,overlay:!1})}return w=B}let C=1,D=new Set(r.overlay.map(b=>b.key));function Q(){let b;do b=`s${C++}`;while(D.has(b));return D.add(b),b}function O(b){if(\"screen\"in b){let On={key:Q(),id:b.screen,params:b.params??{}};y(()=>f({type:\"navigate.screen\",screen:On,mode:b.mode??\"push\"}));return}let B=r.contexts[r.active]?.url??t.contexts[0].startUrl,V;try{V=new URL(b.url,B).href}catch{throw new Sn(\"INVALID_ARGUMENT\",`Not a URL: ${b.url}`)}let re=b.context??ne(V);if(!r.contexts[re])throw new Sn(\"NOT_FOUND\",`No context ${re}`);let wt=r.contexts[re].url;if(wt!==null&&We(wt)===We(V)&&(b.mode??\"push\")===\"push\"){(re!==r.active||r.overlay.length>0)&&y(()=>f({type:\"select\",id:re}));return}y(()=>f({type:\"navigate.url\",url:V,context:re,mode:b.mode??\"push\"}))}function ne(b){let A=jl(t,b);if(A.kind!==\"route\"||!A.context||!r.contexts[A.context])return r.active;let B=r.contexts[r.active],V=t.contexts.find(wt=>wt.id===r.active)?.startUrl,re=!B.url||V!==void 0&&We(B.url)===We(V);return r.overlay.length>0||re?A.context:r.active}function Ne(b){y(()=>{let A=b===r.active&&r.overlay.length===0,B=A&&r.contexts[b]?.url!==null&&We(r.contexts[b].url)!==We(t.contexts.find(V=>V.id===b)?.startUrl??\"\");if(f({type:\"select\",id:b}),A&&!B)for(let V of[...d])V(b)})}let he=new Set;function K(b){he.has(b)||(he.add(b),setTimeout(()=>he.delete(b),A1),e.request(\"context.resync\",{id:b}).catch(()=>{}))}function q(b){let A=jl(t,b);return A.kind===\"route\"?{pageId:A.page,routeId:A.routeId,params:A.params}:{pageId:null,routeId:null,params:{}}}e.on(\"page\",({id:b,generation:A,page:B})=>{let V=o.applyPage(b,A,B);if(V.outcome!==\"applied\")return;he.delete(b);let re=o.context(b);Jy(b,B),f({type:\"context.page\",id:b,generation:A,view:B.view,status:B.status,pageId:B.pageId,routeId:B.routeId,account:B.account,stale:re.stale&&re.content,signInUrl:B.signInUrl??null}),ln(b,V)}),e.on(\"patch\",({id:b,generation:A,patch:B})=>{let V=o.applyPatch(b,A,B);V.outcome===\"resync\"&&K(b),ln(b,V)});function ln(b,A){if(!A.accountChanged)return;let B=Yl(r,t);for(let V of i)V!==b&&(V===B?K(V):Cn(V));for(let V of[...H.values()])V.context!==b&&jt(V,{outcome:\"unknown\",code:\"CONTEXT_REPLACED\",message:\"The account changed\"})}function Cn(b){mu(b),u(\"context.reload\",{id:b})}e.on(\"context.navigated\",b=>{o.navigated(b.id,b,q(b.url)),f({type:\"context.navigated\",...b})}),e.on(\"context.gone\",b=>{o.gone(b.id,{code:b.code??\"NOT_READY\",message:b.message??\"The page cannot be read\"}),f({type:\"context.gone\",id:b.id})}),e.on(\"user.viewWebsite\",b=>{f({type:\"user.viewWebsite\",id:b?.id??r.active})}),e.on(\"user.done\",b=>{f({type:\"user.done\",id:b?.id??r.active}),Wf()}),e.on(\"back\",()=>{let b=S(!0);u(\"back.handled\",{handled:b})});let H=new Map,_t=new Map,J=new Map,Ie=0,k=new Set,ue=new Map,Nt=(b,A,B)=>JSON.stringify([b,A,B]);function Gl(){let b=new Map;for(let B of H.values()){let V=Nt(B.context,B.region,B.key),re=b.get(V);re||b.set(V,re=[]),re.push({name:B.name,args:B.args})}let A=new Map;for(let[B,V]of b){let re=ue.get(B);A.set(B,re&&re.length===V.length&&re.every((wt,On)=>wt.name===V[On].name&&wt.args===V[On].args)?re:V)}ue=A;for(let B of[...k])B()}function jt(b,A){H.get(b.dedup)===b&&(H.delete(b.dedup),b.actionId!==null&&_t.delete(b.actionId),b.timer!==null&&clearTimeout(b.timer),b.resolve(A),Gl())}function Pn(b,A){b.timer!==null&&clearTimeout(b.timer),b.timer=setTimeout(()=>jt(b,{outcome:\"unknown\",code:\"DEADLINE\",message:\"The action did not finish in time\"}),A)}function Ki(b,A){if(A.state===\"dispatched\"){if(!A.navigating)return;b.from=o.context(b.context)?.view??null,b.expect=A.expect??null,Pn(b,a.actionTimeoutMs);return}let B=A.state===\"observed\"?\"observed\":A.state===\"cancelled\"?\"cancelled\":\"failed\";jt(b,A.result??{outcome:B})}e.on(\"action.update\",b=>{let A=_t.get(b.actionId);if(A)return Ki(A,b);if(Ie===0)return;let B=J.get(b.actionId)??[];B.push(b),J.set(b.actionId,B)});function Jy(b,A){for(let B of[...H.values()]){if(B.context!==b||B.from===null)continue;let{from:V}=B;if(A.view.generation===V.generation&&A.view.n===V.n||A.status===\"loading\")continue;let re=jl(t,A.view.url),wt=re.kind===\"route\"?re.page:null,On=gm(B.expect?.page);A.status===\"auth\"?jt(B,{outcome:\"failed\",code:\"AUTH_REQUIRED\",message:\"Sign-in is needed\"}):wt!==null&&gm(B.expect?.notPage)?.includes(wt)?jt(B,{outcome:\"failed\",code:\"REJECTED\",message:\"The website did not accept the action\"}):A.status===\"ready\"&&wt!==null&&(On===null||On.includes(wt))?jt(B,{outcome:\"observed\"}):jt(B,{outcome:\"unknown\",message:\"The action led to another page\"})}}function mu(b){for(let A of[...H.values()])A.context===b&&A.from!==null&&jt(A,{outcome:\"unknown\",message:\"The page changed before the action finished\"})}function $y(b){let A=o.context(b.context);if(!A?.view)return Promise.resolve({outcome:\"failed\",code:\"NOT_READY\",message:\"The page is not ready\"});let B=b.region===null?void 0:A.regions[b.region],V=B?.kind===\"collection\"?B.records[b.key??\"\"]:B?.record??void 0,re=JSON.stringify([b.context,V?.entityType??b.region,V?.entity??b.key,b.name,b.args??null]),wt=H.get(re);if(wt)return wt.promise;let On,tm=new Promise(xn=>{On=xn}),al={...b,dedup:re,actionId:null,promise:tm,resolve:On,timer:null,from:null,expect:null};H.set(re,al),Pn(al,a.actionTimeoutMs+D1),Gl();let{view:nm}=A,Py={region:b.region,key:b.key,name:b.name,args:b.args??null,view:nm.n},am=()=>{--Ie===0&&J.clear()};return Ie++,e.request(\"context.act\",{id:b.context,generation:nm.generation,action:Py}).then(({actionId:xn})=>{let Tc=J.get(xn)??[];if(J.delete(xn),am(),H.get(re)===al){al.actionId=xn,_t.set(xn,al);for(let e1 of Tc)Ki(al,e1)}},xn=>{am();let Tc=sm(xn?.code)?xn.code:void 0;jt(al,{outcome:\"failed\",code:Tc,message:xn instanceof Error?xn.message:\"The action failed\"})}),tm}let bc=new Set;e.on(\"storage.changed\",b=>{for(let A of[...bc])A(b)});let Fy={get:(b,A)=>e.request(\"storage.get\",{collection:b,key:A}),list:(b,A={})=>e.request(\"storage.list\",{collection:b,...A}),commit:b=>e.request(\"storage.commit\",{checks:b.checks??[],puts:b.puts??[],deletes:b.deletes??[]}),onChanged(b){return bc.add(b),()=>{bc.delete(b)}}},Wy={async request(b,A,B={}){try{return await e.request(\"services.request\",{serviceId:b,path:A,method:B.method??\"GET\",body:B.body??null})}catch(V){throw V instanceof Sn?new w1(V.code,V.message):V}}},xc=new Set;function Wf(){for(let b of[...xc])b()}e.on(\"resumed\",Wf);let Sc=new Set;e.on(\"retired\",()=>{for(let b of[...H.values()])jt(b,{outcome:\"unknown\",code:\"RETIRED\",message:\"This page was closed\"});for(let b of[...Sc])b()});let ql=new Map;for(let b of i)e.request(\"context.resync\",{id:b}).catch(()=>{}),s({type:\"schedule\",id:b,token:r.contexts[b].deadline});let Pf=Yl(r,t);Pf!==null&&u(\"context.reveal\",{id:Pf});let em=!1;return{manifest:t,appletId:n,limits:a,restored:l!==null,store:o,navigation:{state:()=>r,screen:U,presentation:b=>pu(r.contexts[b],t),revealed:()=>Yl(r,t),navigate:O,select:Ne,back:()=>{S(!1)},reload:b=>{Cn(b??r.active)},viewWebsite:b=>{f({type:\"user.viewWebsite\",id:b??r.active})},done:b=>{f({type:\"user.done\",id:b??r.active})},setLeaveGuard:b=>{f({type:\"guard\",guard:b===null?null:{message:b}})},onConfirmLeave(b){return m=b,()=>{m===b&&(m=null)}},onScrollToTop(b){return d.add(b),()=>{d.delete(b)}},subscribe(b){return c.add(b),()=>{c.delete(b)}}},actions:{act:$y,pending:(b,A,B)=>ue.get(Nt(b,A,B))??z1,subscribe(b){return k.add(b),()=>{k.delete(b)}}},storage:Fy,services:Wy,scroll:{get:b=>ql.get(b),set(b,A){for(ql.delete(b),ql.set(b,A);ql.size>M1;)ql.delete(ql.keys().next().value)}},onResume(b){return xc.add(b),()=>{xc.delete(b)}},onRetired(b){return Sc.add(b),()=>{Sc.delete(b)}},ready(){em||(em=!0,u(\"ui.ready\"))}}}var me=Y(Ke(),1),Q0=Y(q0(),1),Po=Y(P(),1),Z0=(0,me.createContext)(null);function aS({foreground:e,children:t}){return(0,Po.jsx)(Z0.Provider,{value:e,children:t})}function Kn(){let e=(0,me.useContext)(Z0);if(!e)throw new Error(\"Genesis hooks need mountForeground or GenesisProvider\");return e}function lS({foreground:e,children:t}){return(0,me.useLayoutEffect)(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e.ready()))},[e]),t}async function I0(e,t){let n=t??document.getElementById(\"root\")??document.body.appendChild(document.createElement(\"div\")),a=await bm(),l=(0,Q0.createRoot)(n);return a.onRetired(()=>l.unmount()),l.render((0,Po.jsx)(aS,{foreground:a,children:(0,Po.jsx)(lS,{foreground:a,children:e})})),a}function Of(){let e=Kn();return(0,me.useSyncExternalStore)(e.navigation.subscribe,e.navigation.state)}function ac(e){let t=Of();return e??t.active}function K0(e,t){let{store:n}=Kn(),a=(0,me.useCallback)(l=>n.subscribe(l,e),[n,e]);return(0,me.useSyncExternalStore)(a,()=>t(n.context(e)))}var iS=(e,t)=>e.pageId===t.pageId&&e.status===t.status&&e.stale===t.stale&&e.generation===t.generation&&e.params===t.params&&e.error===t.error&&e.account===t.account&&e.url===t.url;function oS(e,t){return{pageId:e?.pageId??null,status:e?.status??\"loading\",stale:e?e.stale&&e.content:!1,generation:e?.view?.generation??null,params:e?.params??uS,error:e?.error??null,account:t,url:e?.url??null}}function hn(e){let{store:t}=Kn(),n=ac(e),a=(0,me.useRef)(null),l=(0,me.useCallback)(o=>t.subscribe(o),[t]),i=(0,me.useCallback)(()=>{let o=oS(t.context(n),t.state().account);return(!a.current||!iS(a.current,o))&&(a.current=o),a.current},[t,n]);return(0,me.useSyncExternalStore)(l,i)}var uS=Object.freeze({}),V0=new WeakMap,rS=Object.freeze({order:Object.freeze([]),get:()=>{},complete:!1,status:\"missing\",error:null,ephemeral:!1});function cS(e){if(!e)return rS;let t=V0.get(e);if(t)return t;if(e.kind===\"collection\"){let{records:n}=e;t={order:e.order.filter(a=>n[a]!==void 0),get:a=>n[a],complete:e.complete,status:e.status,error:e.error,ephemeral:e.ephemeral}}else{let{record:n}=e;t={order:n?[n.key]:[],get:a=>n&&n.key===a?n:void 0,complete:!0,status:e.status,error:e.error,ephemeral:!1}}return V0.set(e,t),t}function lc(e,t){return K0(ac(t),n=>cS(n?.regions[e]))}function vn(e,t,n){return K0(ac(n),a=>sS(a?.regions[e],t))}function sS(e,t){if(e)return e.kind===\"single\"?t===null||e.record?.key===t?e.record??void 0:void 0:t===null?void 0:e.records[t]}function xe(e,t,n){let a=Kn();return(0,me.useCallback)((l,i)=>a.actions.act({context:n??a.navigation.state().active,region:t??null,key:l,name:e,args:i}),[a,e,t,n])}function ic(e,t,n){let a=Kn(),l=ac(n);return(0,me.useSyncExternalStore)(a.actions.subscribe,()=>a.actions.pending(l,e,t))}function I(){let e=Kn(),t=Of(),{navigation:n}=e;return(0,me.useMemo)(()=>({presentation:n.presentation(t.active),active:t.active,contexts:t.contexts,overlay:t.overlay,screen:n.screen(),revealed:n.revealed(),navigate:n.navigate,back:n.back,select:n.select,reload:n.reload,viewWebsite:n.viewWebsite,done:n.done,setLeaveGuard:n.setLeaveGuard}),[n,t])}function oc(e,t={}){let n=Kn(),a=t.storage??n.storage,[l,i]=(0,me.useState)({records:[],loading:!0,error:null});(0,me.useEffect)(()=>{let d=!0,f=0;async function s(){let y=++f;try{let S=[],p;do{let g=await a.list(e,p===void 0?{}:{afterKey:p});S.push(...g.entries),p=g.nextAfterKey??void 0}while(p!==void 0);d&&y===f&&i({records:S,loading:!1,error:null})}catch(S){d&&y===f&&i(p=>({...p,loading:!1,error:S}))}}s();let h=a.onChanged(y=>{y.changes.some(S=>S.collection===e)&&s()});return()=>{d=!1,h()}},[a,e]);let o=(0,me.useRef)(l.records);o.current=l.records;let u=(0,me.useCallback)(d=>o.current.find(f=>f.key===d)?.revision??null,[]),r=(0,me.useCallback)(d=>a.commit(d),[a]),c=(0,me.useCallback)((d,f,s)=>a.commit({checks:[{collection:e,key:d,expectedRevision:s===void 0?u(d):s}],puts:[{collection:e,key:d,value:f}]}),[a,e,u]),m=(0,me.useCallback)(d=>a.commit({checks:[{collection:e,key:d,expectedRevision:u(d)}],deletes:[{collection:e,key:d}]}),[a,e,u]);return{...l,put:c,remove:m,commit:r}}var dS=1500;function fS(){let e=Kn();Of();let t=e.navigation.screen(),n=t?.key??`${e.navigation.state().active}:none`,a=t&&!t.overlay?t.context:null;return(0,me.useCallback)(l=>{if(!l)return;let i=e.scroll.get(n)??0,o=i>0,u=performance.now(),r=0,c=()=>{o&&(l.scrollTop=i,Math.abs(l.scrollTop-i)<2||performance.now()-u>dS?o=!1:r=requestAnimationFrame(c))},m=()=>{o=!1},d=()=>{o||e.scroll.set(n,l.scrollTop)},f=e.navigation.onScrollToTop(s=>{s===a&&(o=!1,l.scrollTo({top:0,behavior:\"smooth\"}))});return c(),l.addEventListener(\"scroll\",d,{passive:!0}),l.addEventListener(\"touchstart\",m,{passive:!0}),l.addEventListener(\"wheel\",m,{passive:!0}),()=>{cancelAnimationFrame(r),f(),l.removeEventListener(\"scroll\",d),l.removeEventListener(\"touchstart\",m),l.removeEventListener(\"wheel\",m)}},[e,n,a])}function Xe(e){return(0,Po.jsx)(\"div\",{...e,ref:fS()})}var Yt=Y(Ke(),1);var ji=\"https://mail.google.com\",mS=\"/mail/mu/mp/239/\";var Ja=[{id:\"primary\",path:\"priority/%5Esmartlabel_personal\",title:\"Primary\",arg:\"^smartlabel_personal\",icon:\"inbox\",category:!0},{id:\"promotions\",path:\"priority/%5Esmartlabel_promo\",title:\"Promotions\",arg:\"^smartlabel_promo\",icon:\"tag\",category:!0},{id:\"social\",path:\"priority/%5Esmartlabel_social\",title:\"Social\",arg:\"^smartlabel_social\",icon:\"people\",category:!0},{id:\"starred\",path:\"Starred\",title:\"Starred\",arg:\"^t\",icon:\"star\"},{id:\"important\",path:\"Important\",title:\"Important\",arg:\"^io_im\",icon:\"important\"},{id:\"sent\",path:\"Sent%20Mail\",title:\"Sent\",arg:\"^f\",icon:\"send\"},{id:\"drafts\",path:\"Drafts\",title:\"Drafts\",arg:\"^r\",icon:\"draft\"},{id:\"all\",path:\"All%20Mail\",title:\"All mail\",arg:\"^all\",icon:\"mail\"},{id:\"spam\",path:\"Spam\",title:\"Spam\",arg:\"^s\",icon:\"alert\"},{id:\"trash\",path:\"Trash\",title:\"Trash\",arg:\"^k\",icon:\"trash\"}],yn=Ja[0];function eu(e){try{return decodeURIComponent(e)}catch{return e}}function kf(e){if(e.startsWith(\"search/\")){let n=eu(e.slice(7));return{path:e,id:\"search\",title:\"Search\",query:n}}let t=Ja.find(n=>n.path===e||eu(n.path)===eu(e));return t?{path:t.path,id:t.id,title:t.title}:{path:e,id:`label:${eu(e)}`,title:eu(e).replace(/^.*\\//,\"\")}}function $0(e){let t=e.replace(/^#/,\"\");if(t===\"\")return{kind:\"list\",list:kf(yn.path)};if(t.startsWith(\"tl/\"))return{kind:\"list\",list:kf(t.slice(3))};if(t.startsWith(\"cv/\")){let n=t.slice(3),a=n.lastIndexOf(\"/\"),l=a>=0?n.slice(a+1):n,i=a>=0?n.slice(0,a):yn.path;if(/^[0-9a-f]{6,24}$/i.test(l))return{kind:\"conversation\",list:kf(i),threadId:l}}return t===\"co\"||t.startsWith(\"co?\")||t.startsWith(\"co/\")?{kind:\"compose\"}:t===\"mn\"||t.startsWith(\"mn/\")?{kind:\"menu\"}:t===\"pr\"||t.startsWith(\"pr/\")?{kind:\"settings\"}:{kind:\"other\",hash:t}}function F0(e){try{let t=new URL(e??\"\");if(t.origin===ji&&t.pathname.startsWith(\"/mail/mu/\"))return`${ji}${t.pathname}${t.search}`}catch{}return`${ji}${mS}`}var _f=e=>`${ji}/mail/mu/?authuser=${encodeURIComponent(e.email||String(e.sessionIndex))}`,uc=(e,t)=>`${e}#tl/${t}`,W0=(e,t)=>`${e}#tl/search/${encodeURIComponent(t.trim())}`,Rf=(e,t,n=\"All%20Mail\")=>`${e}#cv/${n}/${t}`,P0=e=>`${e}#co`,ey=e=>`${e}#mn`,Cl=[\"#2347d9\",\"#b5470b\",\"#1f7a4d\",\"#7b2d8e\",\"#0e7490\",\"#3d4250\"],ty=[\"Blue\",\"Rust\",\"Green\",\"Plum\",\"Teal\",\"Graphite\"],ny={v:1,showAddTo:!0,defaultSort:\"due\",defaultReminderTime:\"09:00\",morningSummary:\"08:00\",archiveAfterAdding:!0,keepDoneDays:7,swipeRight:\"remind\",swipeLeft:\"archive\",theme:\"system\",todoAccount:\"all\",recentSearches:[]},Uf=e=>e.trim().toLowerCase();function ay(e,t=[]){let[n=\"\",a=\"\"]=e.split(\"@\"),l=a.toLowerCase(),i=l===\"gmail.com\"||l===\"googlemail.com\"?\"Personal\":l.split(\".\")[0]??\"\",o=i?i[0].toUpperCase()+i.slice(1):e;return t.includes(o)&&n?n:o}function rc(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var pS=/^\\d{4}-\\d{2}-\\d{2}$/,gS=/^\\d{2}:\\d{2}$/;function ly(e){return!rc(e)||e.v!==1?!1:typeof e.id==\"string\"&&(e.type===\"reminder\"||e.type===\"todo\")&&typeof e.title==\"string\"&&(e.dueDate===null||typeof e.dueDate==\"string\"&&pS.test(e.dueDate))&&(e.dueTime===null||typeof e.dueTime==\"string\"&&gS.test(e.dueTime))&&typeof e.done==\"boolean\"&&typeof e.createdAt==\"number\"&&typeof e.accountId==\"string\"}function iy(e){return rc(e)&&e.v===1&&typeof e.id==\"string\"&&typeof e.email==\"string\"&&typeof e.name==\"string\"&&typeof e.color==\"string\"}var tu=e=>String(e).padStart(2,\"0\"),pe=e=>`${e.getFullYear()}-${tu(e.getMonth()+1)}-${tu(e.getDate())}`,ut=e=>`${tu(e.getHours())}:${tu(e.getMinutes())}`;function en(e){let[t,n,a]=e.split(\"-\").map(Number);return new Date(t,n-1,a)}function _e(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}var vt=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate());function ot(e,t){let[n,a]=t.split(\":\").map(Number),l=vt(e);return l.setHours(n,a,0,0),l}function Hf(e){return e.dueDate?ot(en(e.dueDate),e.dueTime??\"23:59\"):null}var hS=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],oy=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],Xi=e=>hS[e.getDay()],Jn=e=>`${Xi(e)}, ${e.getDate()} ${oy[e.getMonth()]}`;function Ct(e){let[t,n]=e.split(\":\").map(Number),a=t<12?\"AM\":\"PM\";return`${t%12===0?12:t%12}:${tu(n)} ${a}`}function $a(e,t=new Date){return Math.round((vt(e).getTime()-vt(t).getTime())/864e5)}function Bf(e,t=new Date){let n=$a(e,t);return n===0?\"Today\":n===1?\"Tomorrow\":n===-1?\"Yesterday\":n>1&&n<7?Xi(e):Jn(e)}function $n(e,t=new Date){if(!e.dueDate)return\"No date\";let n=en(e.dueDate),a=Bf(n,t);return e.dueTime?`${a}, ${Ct(e.dueTime)}`:a}function Fn(e,t=new Date){if(!e.dueDate)return\"\";let n=en(e.dueDate),a=$a(n,t),l=a===0?\"today\":a===1?\"tomorrow\":a===-1?\"yesterday\":a>1&&a<7?Xi(n):`${Xi(n)} ${n.getDate()} ${oy[n.getMonth()]}`;return e.dueTime?`${l[0].toUpperCase()}${l.slice(1)} ${Ct(e.dueTime)}`:`Due ${l}`}function cc(e,t=new Date){let n=new Date(e),a=Bf(n,t);return`${a===\"Today\"?\"today\":a===\"Yesterday\"?\"yesterday\":a}, ${Ct(ut(n))}`}function uy(e,t){let n=en(e),a=vt(new Date);do if(t===\"daily\")n=_e(n,1);else if(t===\"weekly\")n=_e(n,7);else if(t===\"monthly\")n=new Date(n.getFullYear(),n.getMonth()+1,n.getDate());else if(t===\"weekdays\")do n=_e(n,1);while(n.getDay()===0||n.getDay()===6);else break;while(n=8&&i.getHours()<22&&a.push({id:\"later\",label:\"Later today\",date:i,detail:Dn(i,t)});let o=ot(_e(n,1),e);a.push({id:\"tomorrow\",label:\"Tomorrow\",date:o,detail:Dn(o,t)});let u=ot(_e(n,(8-n.getDay())%7||7),e);if(a.push({id:\"week\",label:\"Next week\",date:u,detail:Dn(u,t)}),n.getDay()!==0){let r=ot(_e(n,(6-n.getDay()+7)%7),\"10:00\"),c=r>t?r:ot(_e(n,1),\"10:00\");c>t&&c.getDay()!==1&&a.push({id:\"weekend\",label:\"This weekend\",date:c,detail:Dn(c,t)})}return a}function cy(e,t=new Date){let n=vt(t),a=[],l=ot(n,\"18:00\");if(l>t)a.push({id:\"evening\",label:\"Today 6 PM\",date:l,detail:\"\"});else{let o=ot(n,\"21:00\");o>t&&a.push({id:\"night\",label:\"Tonight 9 PM\",date:o,detail:\"\"})}let i=ot(_e(n,1),e);return a.push({id:\"tomorrow\",label:`Tomorrow ${Ct(e).replace(\":00\",\"\")}`,date:i,detail:\"\"}),a}function sy(e,t,n=new Date){let a=vt(n);if(e===\"today\")return pe(a);if(e===\"tomorrow\")return pe(_e(a,1));if(e===\"week\"){let l=(5-a.getDay()+7)%7,i=a.getDay()===6||a.getDay()===0||l<2?_e(a,(7-a.getDay())%7||0):_e(a,l);return pe(i<_e(a,2)?_e(a,2):i)}return e===\"pick\"?t:null}function Ol(e,t=new Date){if(e.done)return\"done\";if(!e.dueDate)return\"none\";let n=$a(en(e.dueDate),t);return n<0?\"overdue\":n===0?\"today\":n===1?\"tomorrow\":n<7?\"week\":\"later\"}function au(e,t){return(e.dueDate??\"9\")!==(t.dueDate??\"9\")?(e.dueDate??\"9\")<(t.dueDate??\"9\")?-1:1:!e.dueTime!=!t.dueTime?e.dueTime?1:-1:(e.dueTime??\"\")!==(t.dueTime??\"\")?(e.dueTime??\"\")<(t.dueTime??\"\")?-1:1:e.priority!==t.priority?e.priority===\"high\"?-1:1:e.createdAt-t.createdAt}function Fa(e,t=new Date){return e.done||e.snooze||!e.dueDate?!1:$a(en(e.dueDate),t)<=0}function dy(e,t=new Date){if(e.done||!e.bringBack||!e.link?.threadId)return!1;let n=Hf(e);return n!==null&&n<=t}function fy(e){let t=e.replace(/[<(].*$/,\"\").replace(/[^\\p{L}\\p{N} ]/gu,\" \").trim().split(/\\s+/).filter(Boolean);return t.length===0?\"?\":t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function my(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return t%360}var py=()=>typeof crypto<\"u\"&&\"randomUUID\"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`;var ie=Y(Ke(),1);var gy=(0,ie.createContext)(null);function vS(){let e=oc(\"items\"),t=(0,ie.useMemo)(()=>e.records.map(u=>u.value).filter(ly),[e.records]),n=(0,ie.useRef)(new Map);n.current=(0,ie.useMemo)(()=>new Map(e.records.map(u=>[u.key,u.revision])),[e.records]);let a=u=>n.current.get(u)??null,l=(0,ie.useCallback)(async u=>{u.length&&await e.commit({checks:u.map(r=>({collection:\"items\",key:r.id,expectedRevision:a(r.id)})),puts:u.map(r=>({collection:\"items\",key:r.id,value:r}))})},[e]),i=(0,ie.useCallback)(async u=>{let r=u.filter(c=>n.current.has(c));r.length&&await e.commit({checks:r.map(c=>({collection:\"items\",key:c,expectedRevision:a(c)})),deletes:r.map(c=>({collection:\"items\",key:c}))})},[e]),o=(0,ie.useCallback)(async(u,r)=>{if(r&&u.type===\"reminder\"&&u.repeat!==\"never\"&&u.dueDate){await l([{...u,dueDate:uy(u.dueDate,u.repeat),returned:!1}]);return}await l([{...u,done:r,completedAt:r?Date.now():null}])},[l]);return{items:t,loading:e.loading,error:e.error,save:u=>l([u]),saveMany:l,remove:u=>i([u]),removeMany:i,complete:o}}function yS(){let e=oc(\"accounts\"),t=hn(\"primary\"),n=(0,ie.useMemo)(()=>e.records.map(m=>m.value).filter(iy).sort((m,d)=>m.addedAt-d.addedAt),[e.records]),a=t.account,l=vn(\"view\",null,\"primary\")?.data.session,i=typeof l==\"number\"?l:bS(t.url),o=(0,ie.useCallback)(async m=>{await e.put(m.id,m)},[e]),u=(0,ie.useRef)(null);(0,ie.useEffect)(()=>{if(e.loading||!a)return;let m=Uf(a),d=n.find(h=>h.id===m);if(d){i!==null&&d.sessionIndex!==i&&e.put(m,{...d,sessionIndex:i}).catch(()=>{});return}if(u.current===m)return;u.current=m;let f=new Set(n.map(h=>h.color)),s=Cl.find(h=>!f.has(h))??Cl[n.length%Cl.length];e.put(m,{v:1,id:m,email:a,name:ay(a,n.map(h=>h.name)),color:s,sessionIndex:i??0,showInInbox:!0,showInTodo:!0,addedAt:Date.now()},null).catch(()=>{u.current=null})},[e,n,a,i]);let r=(0,ie.useCallback)(m=>n.find(d=>d.id===m),[n]),c=a?r(Uf(a))??null:null;return{accounts:n,current:c,byId:r,save:o}}function bS(e){let t=/\\/mail\\/u\\/(\\d+)\\/|[?&]authuser=(\\d+)/.exec(e??\"\");return t?Number(t[1]??t[2]):null}function xS(){let e=oc(\"settings\"),t=e.records.find(l=>l.key===\"prefs\")?.value,n=(0,ie.useMemo)(()=>({...ny,...rc(t)?t:{}}),[t]),a=(0,ie.useCallback)(async l=>{await e.put(\"prefs\",{...n,...l,v:1})},[e,n]);return{settings:n,loading:e.loading,update:a}}function hy({children:e}){let t=vS(),n=yS(),a=xS(),l=(0,ie.useMemo)(()=>({items:t,accounts:n,settings:a}),[t,n,a]);return(0,ie.createElement)(gy.Provider,{value:l},e)}function Lf(){let e=(0,ie.useContext)(gy);if(!e)throw new Error(\"DataProvider is missing\");return e}var Se=()=>Lf().items,Ee=()=>Lf().accounts,yt=()=>Lf().settings;function vy(){let{items:e,loading:t,removeMany:n}=Se(),{settings:a,loading:l}=yt(),i=(0,ie.useRef)(!1);(0,ie.useEffect)(()=>{if(t||l||i.current)return;i.current=!0;let o=Date.now()-a.keepDoneDays*864e5,u=e.filter(r=>r.done&&(r.completedAt??0)r.id);u.length&&n(u).catch(()=>{})},[t,l,e,a.keepDoneDays,n])}var yy=(0,ie.createContext)(null);function by({children:e}){let[t,n]=(0,ie.useState)(null),a=(0,ie.useRef)(0),l=(0,ie.useCallback)(u=>{window.clearTimeout(a.current);let r=Date.now();n({...u,id:r}),a.current=window.setTimeout(()=>n(c=>c?.id===r?null:c),u.undo?6e3:3500)},[]),i=(0,ie.useCallback)(()=>n(null),[]),o=(0,ie.useMemo)(()=>({toast:t,show:l,clear:i}),[t,l,i]);return(0,ie.createElement)(yy.Provider,{value:o},e)}function qe(){let e=(0,ie.useContext)(yy);if(!e)throw new Error(\"ToastProvider is missing\");return e}function Le(){let[e,t]=(0,ie.useState)(()=>new Date);return(0,ie.useEffect)(()=>{let n=window.setInterval(()=>t(new Date),3e4);return()=>window.clearInterval(n)},[]),e}var Ot=Y(Ke(),1);var R=Y(P(),1),SS={menu:\"M4 7h16M4 12h16M4 17h16\",search:\"M20 20l-4.6-4.6M17 10.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0\",back:\"M19 12H5M11 6l-6 6 6 6\",close:\"M6 6l12 12M18 6 6 18\",archive:\"M4 5h16v4H4zM5 9v10h14V9M10 13h4\",trash:\"M5 7h14M10 4h4M7 7l1 13h8l1-13M10 11v6M14 11v6\",unread:\"M3 6h18v12H3zM3 7l9 6 9-6\",clock:\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2\",more:\"M12 5.5h.01M12 12h.01M12 18.5h.01\",plus:\"M12 5v14M5 12h14\",down:\"M6 9l6 6 6-6\",up:\"M6 15l6-6 6 6\",right:\"M9 6l6 6-6 6\",bell:\"M6 16v-5a6 6 0 1 1 12 0v5l1.5 2h-15zM10 21h4\",check:\"M5 12.5 10 17 19 7\",star:\"M12 3.5l2.6 5.4 5.9.8-4.3 4.1 1 5.9L12 17l-5.2 2.7 1-5.9-4.3-4.1 5.9-.8z\",clip:\"M20 11.5l-8 8a5 5 0 0 1-7-7l8.5-8.5a3.3 3.3 0 0 1 4.7 4.7l-8.4 8.4a1.7 1.7 0 0 1-2.4-2.4L15 7\",reply:\"M10 8V4L3 11l7 7v-4c5 0 8 1.5 11 5-1-6-4-10-11-11z\",replyAll:\"M13 8V4l-7 7 7 7v-4c4.5 0 7 1.5 9 5-1-6-3.5-10-9-11zM7 4l-7 7 7 7\",forward:\"M14 8V4l7 7-7 7v-4c-5 0-8 1.5-11 5 1-6 4-10 11-11z\",inbox:\"M4 13l2.5-8h11L20 13v6H4zM4 13h5l1 2h4l1-2h5\",tag:\"M3 12V4h8l10 10-8 8zM7.5 8h.01\",people:\"M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 6.5M18 14.5a6.5 6.5 0 0 1 3.5 5.5\",send:\"M4 4l17 8-17 8 3-8zM7 12h14\",draft:\"M5 3h9l5 5v13H5zM14 3v5h5M8 13h8M8 17h5\",mail:\"M3 6h18v12H3zM3 7l9 6 9-6\",alert:\"M12 3l10 18H2zM12 10v5M12 18h.01\",important:\"M4 6h11l5 6-5 6H4l4-6z\",settings:\"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 0 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 0 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 0 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 0 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z\",pencil:\"M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4\",todo:\"M4 6l2 2 3-3M4 13l2 2 3-3M12 7h8M12 14h8M12 20h8M4 19.5h4\",calendar:\"M4 6h16v14H4zM4 10h16M8 3v4M16 3v4\",repeat:\"M17 2l3 3-3 3M4 11V9a4 4 0 0 1 4-4h12M7 22l-3-3 3-3M20 13v2a4 4 0 0 1-4 4H4\",note:\"M5 4h14v16H5zM8 9h8M8 13h8M8 17h4\",external:\"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6\",flag:\"M5 21V4h11l-2 4 2 4H5\",label:\"M3 12V4h8l10 10-8 8zM7.5 8h.01\",refresh:\"M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7\",mute:\"M11 5L6 9H3v6h3l5 4zM16 9l5 6M21 9l-5 6\",spam:\"M8 3h8l5 5v8l-5 5H8l-5-5V8zM12 8v5M12 16h.01\",user:\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0\",sun:\"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4\",swipe:\"M4 12h16M8 8l-4 4 4 4M16 8l4 4-4 4\",check2:\"M4 4h16v16H4zM8 12l3 3 5-6\"};function E({name:e,filled:t=!1,size:n}){return(0,R.jsx)(\"svg\",{viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",className:t?\"filled\":void 0,style:n?{width:n,height:n}:void 0,children:(0,R.jsx)(\"path\",{d:SS[e]})})}function te({icon:e,label:t,onClick:n,filled:a,disabled:l,pressed:i,className:o}){return(0,R.jsx)(\"button\",{type:\"button\",className:`icon-button ${o??\"\"}`,\"aria-label\":t,title:t,\"aria-pressed\":i,disabled:l,onClick:n,children:(0,R.jsx)(E,{name:e,filled:a})})}function Wa({name:e,size:t=40,selected:n=!1}){let a=my(e);return n?(0,R.jsx)(\"span\",{className:\"avatar selected\",style:{width:t,height:t},\"aria-hidden\":\"true\",children:(0,R.jsx)(E,{name:\"check\"})}):(0,R.jsx)(\"span\",{className:\"avatar\",\"aria-hidden\":\"true\",style:{width:t,height:t,fontSize:t*.38,\"--hue\":String(a)},children:fy(e)})}function Ze({color:e,label:t}){return(0,R.jsx)(\"span\",{className:\"account-dot\",style:{background:e},role:t?\"img\":void 0,\"aria-label\":t,\"aria-hidden\":t?void 0:!0})}function tn({label:e,detail:t,checked:n,onChange:a,icon:l}){let i=(0,Ot.useId)();return(0,R.jsxs)(\"label\",{className:\"toggle-row\",htmlFor:i,children:[l,(0,R.jsxs)(\"span\",{className:\"toggle-text\",children:[(0,R.jsx)(\"span\",{children:e}),t&&(0,R.jsx)(\"small\",{children:t})]}),(0,R.jsx)(\"input\",{id:i,type:\"checkbox\",role:\"switch\",checked:n,onChange:o=>a(o.target.checked)}),(0,R.jsx)(\"span\",{className:\"switch\",\"aria-hidden\":\"true\"})]})}function zn({label:e,options:t,value:n,onChange:a,className:l}){return(0,R.jsx)(\"div\",{className:`chips ${l??\"\"}`,role:\"radiogroup\",\"aria-label\":e,children:t.map(i=>(0,R.jsx)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":i.id===n,className:`chip ${i.tone??\"\"}`,onClick:()=>a(i.id),children:i.label},i.id))})}function lu({title:e,icon:t,tone:n,children:a,footer:l,onClose:i,labelledBy:o}){let u=(0,Ot.useId)(),r=(0,Ot.useRef)(null),c=(0,Ot.useRef)(null);(0,Ot.useEffect)(()=>{let s=document.activeElement instanceof HTMLElement?document.activeElement:null;return r.current?.focus(),()=>{s?.isConnected&&s.focus({preventScroll:!0})}},[]);let m=s=>{let h=c.current;!h||!r.current||(h.dy=Math.max(0,s-h.y),r.current.style.transform=h.dy?`translateY(${h.dy}px)`:\"\")},d=()=>{let s=c.current;if(c.current=null,!(!s||!r.current)){if(r.current.classList.remove(\"dragging\"),s.dy>Math.min(120,r.current.offsetHeight/4)){i();return}r.current.style.transform=\"\"}};return(0,R.jsxs)(\"div\",{className:\"sheet-layer\",children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"sheet-backdrop\",\"aria-label\":\"Close\",onClick:i}),(0,R.jsxs)(\"div\",{className:\"sheet\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":o??u,ref:r,tabIndex:-1,children:[(0,R.jsxs)(\"div\",{className:\"sheet-handle\",...{onPointerDown:s=>{s.target.closest(\"button\")||(c.current={id:s.pointerId,y:s.clientY,dy:0},s.currentTarget.setPointerCapture(s.pointerId),r.current?.classList.add(\"dragging\"))},onPointerMove:s=>{c.current?.id===s.pointerId&&m(s.clientY)},onPointerUp:d,onPointerCancel:d},children:[(0,R.jsx)(\"span\",{className:\"grabber\",\"aria-hidden\":\"true\"}),(0,R.jsxs)(\"header\",{className:\"sheet-head\",children:[(0,R.jsx)(\"span\",{className:`tile ${n}`,children:(0,R.jsx)(E,{name:t})}),(0,R.jsx)(\"h2\",{id:u,children:e}),(0,R.jsx)(te,{icon:\"close\",label:\"Close\",onClick:i})]})]}),(0,R.jsx)(\"div\",{className:\"sheet-body\",children:a}),l&&(0,R.jsx)(\"footer\",{className:\"sheet-foot\",children:l})]})]})}var sc={count:0};function iu({children:e,onClose:t,className:n}){let a=(0,Ot.useRef)(null),l=Kn().navigation,{screen:i}=I(),o=(0,Ot.useRef)({key:null,seen:!1}),u=(0,Ot.useRef)(t);return u.current=t,(0,Ot.useEffect)(()=>(sc.count++,l.navigate({screen:\"menu\"}),o.current={key:l.screen()?.key??null,seen:!1},()=>{sc.count--,o.current.key&&l.screen()?.key===o.current.key&&l.back(),o.current={key:null,seen:!1}}),[l]),(0,Ot.useEffect)(()=>{let r=o.current;r.key&&(i?.key===r.key?r.seen=!0:r.seen&&(o.current={key:null,seen:!1},u.current()))},[i?.key]),(0,Ot.useEffect)(()=>{a.current?.querySelector(\"button\")?.focus();let r=c=>{c.key===\"Escape\"&&t()};return window.addEventListener(\"keydown\",r),()=>window.removeEventListener(\"keydown\",r)},[t]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"popover-scrim\",\"aria-label\":\"Close menu\",onClick:t}),(0,R.jsx)(\"div\",{ref:a,role:\"menu\",className:`popover ${n}`,children:e})]})}function bn({title:e,children:t,onBack:n,backLabel:a=\"Back\",className:l}){let{back:i}=I();return(0,R.jsxs)(\"header\",{className:`top-bar ${l??\"\"}`,children:[(0,R.jsx)(te,{icon:\"back\",label:a,onClick:n??i}),e!==void 0&&(0,R.jsx)(\"h1\",{children:e}),(0,R.jsx)(\"span\",{className:\"spacer\"}),t]})}function nn({label:e,rows:t=7,kind:n=\"rows\"}){return n===\"email\"?(0,R.jsxs)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:\"skeleton email\",children:[(0,R.jsx)(\"span\",{className:\"bar title\"}),(0,R.jsx)(\"span\",{className:\"bar title short\"}),(0,R.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[(0,R.jsx)(\"span\",{className:\"skeleton-avatar\"}),(0,R.jsxs)(\"div\",{children:[(0,R.jsx)(\"span\",{}),(0,R.jsx)(\"span\",{})]})]}),Array.from({length:t},(a,l)=>(0,R.jsx)(\"span\",{className:`bar line ${l%4===3?\"short\":\"\"}`,\"aria-hidden\":\"true\"},l))]}):(0,R.jsx)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:`skeleton ${n}`,children:Array.from({length:t},(a,l)=>(0,R.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[n===\"rows\"&&(0,R.jsx)(\"span\",{className:\"skeleton-avatar\"}),(0,R.jsxs)(\"div\",{children:[(0,R.jsx)(\"span\",{}),(0,R.jsx)(\"span\",{}),(0,R.jsx)(\"span\",{})]})]},l))})}function dc({active:e,label:t=\"Loading\"}){return(0,R.jsx)(\"div\",{className:`progress-bar${e?\" active\":\"\"}`,role:\"progressbar\",\"aria-label\":t,\"aria-hidden\":!e,\"aria-busy\":e})}function fc(e){let t=(0,Ot.useRef)(e);return e&&(t.current=!0),t.current}function kt({title:e,children:t,role:n,icon:a}){return(0,R.jsxs)(\"section\",{className:\"notice\",role:n,children:[a&&(0,R.jsx)(\"span\",{className:\"notice-icon\",children:(0,R.jsx)(E,{name:a,size:28})}),(0,R.jsx)(\"h2\",{children:e}),t]})}function xy({error:e}){let{reload:t,viewWebsite:n}=I(),a=e?.code===\"NOT_READY\"||e?.code===\"DEADLINE\"?\"Gmail did not answer in time.\":e?.message||\"This page could not be read.\";return(0,R.jsxs)(kt,{title:\"Couldn't load Gmail\",role:\"alert\",icon:\"alert\",children:[(0,R.jsx)(\"p\",{children:a}),(0,R.jsxs)(\"div\",{className:\"row-buttons\",children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t(),children:\"Try again\"}),(0,R.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>n(),children:[\"Open in Gmail \",(0,R.jsx)(E,{name:\"external\"})]})]})]})}function ou({text:e,terms:t}){let n=t.map(l=>l.trim()).filter(l=>l.length>1);if(!n.length)return(0,R.jsx)(R.Fragment,{children:e});let a=new RegExp(`(${n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")).join(\"|\")})`,\"gi\");return(0,R.jsx)(R.Fragment,{children:e.split(a).map((l,i)=>i%2===1?(0,R.jsx)(\"mark\",{children:l},i):l)})}function mc(){return(0,R.jsxs)(\"span\",{className:\"logo\",\"aria-label\":\"Gmail Only\",children:[\"gmail \",(0,R.jsx)(\"span\",{children:\"only\"})]})}var kl=Y(Ke(),1);var j=\"primary\";function ru(){let e=hn(j);return(0,kl.useMemo)(()=>{let t=\"\";try{t=new URL(e.url??\"\").hash}catch{}return{view:$0(t),base:F0(e.url),url:e.url}},[e.url])}function Ve(){let{navigate:e}=I(),{base:t}=ru(),{current:n,byId:a}=Ee();return(0,kl.useMemo)(()=>({base:t,list:(l,i=\"push\")=>e({url:uc(t,l),context:j,mode:i}),inbox:(l=\"push\")=>e({url:uc(t,yn.path),context:j,mode:l}),thread:(l,i)=>e({url:Rf(t,l,i),context:j}),email:(l,i)=>{let o=a(i),u=o&&n&&o.id!==n.id;e({url:Rf(u?_f(o):t,l),context:j})},inboxOf:l=>e({url:uc(_f(l),yn.path),context:j}),search:(l,i=\"push\")=>e({url:W0(t,l),context:j,mode:i}),compose:()=>e({url:P0(t),context:j}),menu:()=>e({url:ey(t),context:j})}),[e,t,n,a])}var uu=new Map,pc=new Set,Gf=0;function gc(e,t){if(!(t===null||uu.get(e)===t)){uu.set(e,t),Gf++;for(let n of pc)n()}}function Sy(){if(uu.size){uu.clear(),Gf++;for(let e of pc)e()}}function hc(e){return(0,kl.useSyncExternalStore)(t=>(pc.add(t),()=>{pc.delete(t)}),()=>Gf),uu.get(e)??null}function _l(e,t,n,a={}){return{v:1,id:py(),type:e,title:t?Wn(t.subject):\"\",note:\"\",dueDate:null,dueTime:null,notify:e===\"reminder\",repeat:\"never\",priority:\"normal\",link:t?{threadId:t.threadId,sender:t.sender,subject:t.subject,snippet:t.snippet,receivedAt:t.receivedAt}:null,accountId:t?.accountId??n,source:\"user\",createdAt:Date.now(),completedAt:null,done:!1,bringBack:e===\"reminder\",snooze:!1,...a}}function Wn(e){return e.replace(/^((re|fwd?|fw|aw)\\s*:\\s*)+/i,\"\").trim().slice(0,200)||\"Follow up\"}function Vi(e,t){return t?e.filter(n=>n.link?.threadId===t):[]}function Pa(e){return e.split(/,| \\d+$/)[0].replace(/\\s+\\d+$/,\"\").trim()||e}function el(){let{navigate:e}=I();return(0,kl.useCallback)(t=>e({screen:\"item\",params:{id:t}}),[e])}var cu={threadId:null};var vc=Y(Ke(),1);var qf=(0,vc.createContext)(null);function Qi(){let e=(0,vc.useContext)(qf),{screen:t}=I();return e??t?.params??{}}var Rl=Y(Ke(),1),jf=Y(P(),1);function du(){try{return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches}catch{return!1}}var su=\"cubic-bezier(.2, 0, 0, 1)\",Zi=\"cubic-bezier(.3, 0, .8, .15)\",yc=\"32px\",TS={push:{frames:[{opacity:0,transform:`translateX(${yc})`},{opacity:1,transform:\"none\"}],ms:300,easing:su},pop:{frames:[{opacity:0,transform:`translateX(-${yc})`},{opacity:1,transform:\"none\"}],ms:300,easing:su},fade:{frames:[{opacity:0,transform:\"scale(.98)\"},{opacity:1,transform:\"none\"}],ms:220,easing:su},\"drawer-in\":{frames:[{transform:\"translateX(-100%)\"},{transform:\"none\"}],ms:280,easing:su}},NS={push:[{frames:[{opacity:1,transform:\"none\"},{opacity:0,transform:`translateX(-${yc})`}],ms:200,easing:Zi}],pop:Object.assign([{frames:[{opacity:1,transform:\"none\"},{opacity:0,transform:`translateX(${yc})`}],ms:200,easing:Zi}],{above:!0}),fade:[{frames:[{opacity:1},{opacity:0}],ms:120,easing:Zi}],\"drawer-in\":[{frames:[{opacity:1},{opacity:.6}],ms:280,easing:su}],\"drawer-out\":Object.assign([{frames:[{transform:\"none\"},{transform:\"translateX(-100%)\"}],ms:240,easing:Zi}],{above:!0}),\"sheet-close\":Object.assign([{frames:[{transform:\"translateY(100%)\"}],ms:220,easing:Zi,target:\".sheet\"},{frames:[{opacity:1},{opacity:0}],ms:220,easing:\"linear\",target:\".sheet-backdrop\"}],{above:!0}),\"sheet-swap\":[{frames:[{opacity:1},{opacity:0,transform:\"translateY(24px)\"}],ms:160,easing:Zi,target:\".sheet\"},{frames:[{opacity:1},{opacity:1}],ms:260,easing:\"linear\",target:\".sheet-backdrop\"}]},Ty=\".screen, .sheet-body, .sheet\",wS=90;function ES(e){let t=[...e.querySelectorAll(Ty)].map(a=>a.scrollTop),n=e.cloneNode(!0);return n.setAttribute(\"aria-hidden\",\"true\"),n.inert=!0,n.classList.add(\"ghost\"),{node:n,tops:t}}function AS(e,t,n,a){let l=NS[n];if(!e||!l)return;t.node.style.zIndex=String(a+(l.above?1:-1)),e.appendChild(t.node),t.node.querySelectorAll(Ty).forEach((r,c)=>{r.scrollTop=t.tops[c]??0});let i=l.map(r=>(r.target?t.node.querySelector(r.target):t.node)?.animate(r.frames,{duration:r.ms,easing:r.easing,fill:\"forwards\"})),o=Math.max(...l.map(r=>r.ms)),u=()=>t.node.remove();Promise.all(i.map(r=>r?.finished)).then(u,u),window.setTimeout(u,o+200)}function Yf({id:e,motion:t,layer:n,zIndex:a,inert:l,children:i}){let o=(0,Rl.useRef)(null),u=(0,Rl.useRef)({id:e,at:0}),r=(0,Rl.useRef)(null);if(u.current.id!==e){let c=performance.now(),m=c-u.current.at{let c=r.current;if(r.current=null,!c)return;c.copy&&AS(n.current,c.copy,c.motion,a);let m=TS[c.motion];m&&o.current&&o.current.animate(m.frames,{duration:m.ms,easing:m.easing})},[e,n,a]),e===null?null:(0,jf.jsx)(\"div\",{ref:o,className:\"stage\",style:{zIndex:a},inert:l,children:i})}function Ny({layer:e}){return(0,jf.jsx)(\"div\",{className:\"ghosts\",ref:e,\"aria-hidden\":\"true\"})}function MS(e,t){return!e||e.id===t.id?\"none\":t.drawer&&!e.drawer?\"drawer-in\":e.drawer&&!t.drawer?\"drawer-out\":e.tab&&t.tab?\"fade\":t.index!==e.index?t.index>e.index?\"push\":\"pop\":t.depth!==e.depth?t.depth>e.depth?\"push\":\"pop\":\"fade\"}function wy(e){let t=(0,Rl.useRef)({place:null,motion:\"none\"});return t.current.place?.id!==e.id&&(t.current={place:e,motion:MS(t.current.place,e)}),t.current.motion}var rt=Y(Ke(),1);var Ey=Y(Ke(),1);var Re=Y(P(),1),DS=380;function Xf(e){let{complete:t}=Se(),{show:n}=qe(),[a,l]=(0,Ey.useState)(!1);return{checking:a,toggle:()=>{if(!a){if(e.done){t(e,!1);return}l(!0),window.setTimeout(()=>{t(e,!0).then(()=>n({text:e.type===\"reminder\"?\"Reminder done\":\"To-do done\",undo:()=>t(e,!1)}),()=>n({text:\"Couldn't save. Try again.\"})).finally(()=>l(!1))},du()?0:DS)}}}}function fu({item:e,onToggle:t,large:n=!1,checking:a=!1}){let l=e.done||a,i=e.done?`Mark \"${e.title}\" not done`:`Mark \"${e.title}\" done`;return(0,Re.jsx)(\"button\",{type:\"button\",className:`mark ${e.type} ${l?\"done\":\"\"} ${a?\"checking\":\"\"} ${n?\"large\":\"\"}`,role:\"checkbox\",\"aria-checked\":l,\"aria-label\":i,onClick:o=>{o.stopPropagation(),t()},children:l?(0,Re.jsx)(E,{name:\"check\"}):e.type===\"reminder\"?(0,Re.jsx)(E,{name:\"bell\"}):null})}function zS(e,t){return e.byId(t.accountId)}function tl({item:e,mode:t=\"due\",now:n,onOpen:a,trailing:l,onSetDate:i}){let{checking:o,toggle:u}=Xf(e),r=Ee(),c=zS(r,e),m=Ol(e,n),d=m===\"overdue\",f=Hf(e),s;if(t===\"added\")s=(0,Re.jsxs)(Re.Fragment,{children:[e.link?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(E,{name:\"mail\",size:14}),\" \",Pa(e.link.sender),\" \\xB7 \"]}):\"Added by you \\xB7 \",e.done&&e.completedAt?`Done ${cc(e.completedAt,n)}`:Ct(ut(new Date(e.createdAt)))]});else{let y=d?e.dueTime?`Due ${Fn(e,n)}`:Fn(e,n):m===\"today\"&&!e.dueTime?\"Anytime today\":m===\"none\"?\"No date yet\":e.dueTime&&m===\"today\"?\"Today\":Fn(e,n);s=(0,Re.jsxs)(Re.Fragment,{children:[y,c&&(0,Re.jsxs)(Re.Fragment,{children:[\" \\xB7 \",(0,Re.jsx)(Ze,{color:c.color}),\" \",c.name]})]})}let h=l;return h===void 0&&(t===\"added\"&&!e.dueDate&&!e.done?h=(0,Re.jsx)(\"button\",{type:\"button\",className:\"tag set-date\",onClick:y=>{y.stopPropagation(),(i??a)()},children:\"+ Set date\"}):t===\"added\"&&e.dueDate&&!e.done?h=(0,Re.jsx)(\"span\",{className:`tag ${e.type===\"reminder\"?\"reminder\":\"\"}`,children:Fn(e,n)}):t===\"due\"&&e.dueTime&&!e.done&&f&&(h=(0,Re.jsx)(\"span\",{className:\"time-tag\",children:Ct(e.dueTime)}))),(0,Re.jsxs)(\"li\",{className:`item-row ${d&&t===\"due\"?\"overdue\":\"\"} ${e.done||o?\"is-done\":\"\"} ${e.type}`,children:[(0,Re.jsx)(fu,{item:e,onToggle:u,checking:o}),(0,Re.jsxs)(\"button\",{type:\"button\",className:\"item-main\",onClick:a,children:[(0,Re.jsxs)(\"span\",{className:\"item-title\",children:[e.priority===\"high\"&&!e.done&&(0,Re.jsx)(\"span\",{className:\"priority\",\"aria-label\":\"High priority\",children:(0,Re.jsx)(E,{name:\"flag\",filled:!0,size:14})}),e.title||\"Untitled\"]}),(0,Re.jsx)(\"span\",{className:\"item-meta\",children:s})]}),h]})}var T=Y(P(),1);function My(e,t){return{threadId:e.threadId,sender:e.sender,subject:e.subject,snippet:e.snippet,receivedAt:e.date,accountId:t}}var Ay=[{id:\"attachment\",label:\"Has attachment\",term:\"has:attachment\"},{id:\"unread\",label:\"Unread\",term:\"is:unread\"},{id:\"starred\",label:\"Starred\",term:\"is:starred\"},{id:\"week\",label:\"Last 7 days\",term:\"newer_than:7d\"}];function Zf(e){return e.split(/\\s+/).filter(t=>t&&!t.includes(\":\"))}function Dy({list:e}){let t=hn(j),n=lc(\"threads\",j),a=vn(\"list\",null,j)?.data,{items:l}=Se(),i=Ee(),{settings:o}=yt(),u=Ve(),r=Le(),c=xe(\"loadMore\",null,j),[m,d]=(0,rt.useState)(!1),[f,s]=(0,rt.useState)(!1),h=i.current,y=h?.id??\"unknown\",S=e.id===\"search\",p=e.id===yn.id,g=Ja.some(q=>q.category&&q.id===e.id);(0,rt.useEffect)(()=>{a&&!S&&gc(e.id,a.unread??0)},[a,e.id,S,i.current?.id]),(0,rt.useEffect)(()=>{s(!1)},[e.path]);let v=n.order.map(q=>n.get(q)?.data).filter(q=>!!q),x=v.filter(q=>q.selected),w=t.status===\"ready\"&&!t.stale,U=w&&!n.ephemeral,C=q=>i.byId(q.accountId)?.showInInbox!==!1,D=p?l.filter(q=>dy(q,r)&&!q.returned&&C(q)):[],Q=p?l.filter(q=>Fa(q,r)&&C(q)):[],O=t.status===\"loading\"||t.stale,ne=fc(!v.length&&O),Ne=OS(O),he=async()=>{d(!0);let q=await c(null);d(!1),q.outcome!==\"observed\"&&s(!0)},K;return!v.length&&O?K=(0,T.jsx)(nn,{label:`Loading ${e.title}`}):v.length?K=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(\"ul\",{className:`thread-list${ne?\" reveal\":\"\"}`,\"aria-label\":e.title,children:v.map(q=>(0,T.jsx)(HS,{row:q,list:e,linked:Vi(l,q.threadId),account:i.accounts.length>1?h?.color??null:null,selecting:x.length>0,actionable:U,terms:S?Zf(e.query??\"\"):[],accountId:y,swipeLeft:o.swipeLeft,swipeRight:o.swipeRight},q.threadId))}),(0,T.jsxs)(\"div\",{className:\"list-end\",children:[f?(0,T.jsx)(\"p\",{className:\"muted\",children:\"No more emails here.\"}):(0,T.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:m||!U,onClick:()=>{he()},children:m?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(\"span\",{className:\"spinner\",\"aria-hidden\":\"true\"}),\" Loading\\u2026\"]}):\"Load older emails\"}),(0,T.jsxs)(\"button\",{type:\"button\",className:\"link-button\",disabled:Ne.active,onClick:Ne.run,children:[(0,T.jsx)(E,{name:\"refresh\"}),\" Refresh\"]})]})]}):K=(0,T.jsxs)(kt,{title:S?\"No results\":`Nothing in ${e.title}`,icon:S?\"search\":\"inbox\",children:[(0,T.jsx)(\"p\",{children:a?.empty??(S?\"Try different words or remove a filter.\":\"You're all caught up.\")}),(0,T.jsx)(\"div\",{className:\"row-buttons\",children:(0,T.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:Ne.run,children:[(0,T.jsx)(E,{name:\"refresh\"}),\" Refresh\"]})})]}),(0,T.jsxs)(\"div\",{className:\"screen-frame\",children:[x.length>0?(0,T.jsx)(BS,{rows:x,accountId:y}):S?(0,T.jsx)(LS,{query:e.query??\"\"}):(0,T.jsx)(_S,{title:e.title}),(0,T.jsx)(dc,{active:O&&v.length>0||m||Ne.active}),(0,T.jsxs)(Xe,{className:\"screen\",\"aria-busy\":!w,...Ne.handlers,children:[(0,T.jsx)(kS,{state:Ne}),g&&!S&&(0,T.jsx)(RS,{current:e.id}),!p&&!g&&!S&&(0,T.jsx)(\"h1\",{className:\"list-title\",children:e.title}),S&&(0,T.jsx)(GS,{query:e.query??\"\",count:v.length,complete:f}),D.length>0&&(0,T.jsx)(YS,{items:D}),Q.length>0&&(0,T.jsx)(jS,{items:Q,all:l,now:r}),S&&(0,T.jsx)(qS,{query:e.query??\"\",items:l}),K,t.status===\"error\"&&v.length>0&&(0,T.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"})]}),!x.length&&(0,T.jsxs)(\"button\",{type:\"button\",className:\"fab\",onClick:()=>u.compose(),\"aria-label\":\"Compose\",children:[(0,T.jsx)(E,{name:\"pencil\"}),(0,T.jsx)(\"span\",{children:\"Compose\"})]})]})}var Qf=72,CS=112;function OS(e){let{reload:t}=I(),[n,a]=(0,rt.useState)(0),[l,i]=(0,rt.useState)(!1),o=(0,rt.useRef)(null),u=(0,rt.useRef)(!1),r=()=>{l||(i(!0),u.current=!1,t(j))};return(0,rt.useEffect)(()=>{if(!l)return;if(e)u.current=!0;else if(u.current){i(!1);return}let m=window.setTimeout(()=>i(!1),1e4);return()=>window.clearTimeout(m)},[l,e]),{pull:n,active:l,run:r,handlers:{onTouchStart:m=>{o.current=m.currentTarget.scrollTop<=0&&!l?m.touches[0].clientY:null},onTouchMove:m=>{if(o.current===null)return;let d=m.touches[0].clientY-o.current;if(d<=0||m.currentTarget.scrollTop>0){o.current=null,a(0);return}a(Math.min(CS,d*.5))},onTouchEnd:()=>{o.current!==null&&n>=Qf&&r(),o.current=null,a(0)},onTouchCancel:()=>{o.current=null,a(0)}}}}function kS({state:e}){let{pull:t,active:n}=e;if(!t&&!n)return null;let a=n?56:t,l=Math.min(1,t/Qf);return(0,T.jsx)(\"div\",{className:`pull-indicator${n?\" active\":\"\"}${t>=Qf?\" armed\":\"\"}`,\"aria-hidden\":\"true\",style:{transform:`translate(-50%, ${a}px)`,opacity:n?1:l},children:(0,T.jsx)(\"span\",{style:n?void 0:{transform:`rotate(${l*270}deg)`},children:(0,T.jsx)(E,{name:\"refresh\"})})})}function _S({title:e}){let t=Ve(),{navigate:n}=I(),{current:a,accounts:l}=Ee();return(0,T.jsx)(\"header\",{className:\"mail-header\",children:(0,T.jsxs)(\"div\",{className:\"search-pill\",children:[(0,T.jsx)(te,{icon:\"menu\",label:\"Menu\",onClick:()=>t.menu()}),(0,T.jsx)(\"button\",{type:\"button\",className:\"search-pill-text\",onClick:()=>n({screen:\"search\"}),children:`Search in ${e===\"Primary\"?\"mail\":e}`}),(0,T.jsxs)(\"button\",{type:\"button\",className:\"me\",\"aria-label\":`Account ${a?.email??\"\"}`,onClick:()=>n({screen:\"accounts\"}),children:[(0,T.jsx)(\"span\",{className:\"me-avatar\",style:{borderColor:a?.color??\"var(--accent)\"},children:(a?.name??a?.email??\"?\").slice(0,2).toUpperCase()}),l.length>1&&(0,T.jsx)(\"span\",{className:\"me-badge\",children:l.length})]})]})})}function RS({current:e}){let t=Ve(),n=Ja.filter(a=>a.category);return(0,T.jsx)(\"nav\",{className:\"category-chips\",\"aria-label\":\"Categories\",children:n.map(a=>(0,T.jsx)(US,{id:a.id,title:a.title,current:e===a.id,onClick:()=>e!==a.id&&t.list(a.path,\"replace\")},a.id))})}function US({id:e,title:t,current:n,onClick:a}){let l=hc(e);return(0,T.jsxs)(\"button\",{type:\"button\",className:\"category-chip\",\"aria-current\":n?\"page\":void 0,onClick:a,children:[t,l?(0,T.jsx)(\"span\",{className:\"count\",children:l}):null]})}var Vf=.3,HS=(0,rt.memo)(function({row:t,list:n,linked:a,account:l,selecting:i,actionable:o,terms:u,accountId:r,swipeLeft:c,swipeRight:m}){let d=Ve(),{navigate:f}=I(),{show:s}=qe(),h=xe(\"setStarred\",\"threads\",j),y=xe(\"setSelected\",\"threads\",j),S=xe(\"archive\",\"threads\",j),p=ic(\"threads\",t.threadId,j),g=(J,Ie,k)=>{let ue=[...p].reverse().find(Nt=>Nt.name===J);return ue?ue.args[Ie]??k:k},v=g(\"setStarred\",\"starred\",t.starred),x=g(\"setSelected\",\"selected\",t.selected),[w,U]=(0,rt.useState)(0),[C,D]=(0,rt.useState)(!1),Q=(0,rt.useRef)(null),O=(0,rt.useRef)(null),ne=a.filter(J=>!J.done&&!J.snooze),Ne=a.find(J=>J.snooze&&!J.done),he=(J,Ie=-1)=>{if(J===\"archive\"){let k=O.current,ue=k?.offsetWidth??360,Nt=du()||!k;U(Ie*ue);let Gl=Nt?null:k.animate([{height:`${k.offsetHeight}px`},{height:\"0px\"}],{duration:220,delay:180,easing:\"cubic-bezier(.2, 0, 0, 1)\",fill:\"forwards\"});S(t.threadId).then(jt=>{if(jt.outcome===\"observed\"){s({text:\"Archived\"});return}Gl?.cancel(),U(0),s({text:\"Couldn't archive. Try again.\"})})}else J===\"remind\"&&f({screen:\"add\",params:{type:\"reminder\",emails:JSON.stringify([My(t,r)]),archive:\"row\"}})},K=J=>{!o||i||J.pointerType===\"mouse\"&&J.button!==0||(Q.current={x:J.clientX,y:J.clientY,id:J.pointerId,swiping:!1})},q=J=>{let Ie=Q.current;if(!Ie||Ie.id!==J.pointerId)return;let k=J.clientX-Ie.x,ue=J.clientY-Ie.y;if(!Ie.swiping){if(Math.abs(ue)>12){Q.current=null;return}if(Math.abs(k)<14)return;Ie.swiping=!0,D(!0),J.currentTarget.setPointerCapture(J.pointerId)}let Nt=k>0&&m!==\"none\"||k<0&&c!==\"none\";U(Nt?k:0)},ln=()=>{let J=Q.current;if(Q.current=null,!J?.swiping)return;D(!1);let Ie=O.current?.offsetWidth??360,k=w,ue=k>0?m:c;if(Math.abs(k)>Ie*Vf&&ue===\"archive\"){he(ue,Math.sign(k));return}U(0),Math.abs(k)>Ie*Vf&&he(ue)},Cn=`${t.unread?\"Unread. \":\"\"}${t.sender}. ${t.subject}. ${t.date}`,H=w>0?m:w<0?c:\"\",_t=Math.abs(w)>(O.current?.offsetWidth??360)*Vf;return(0,T.jsxs)(\"li\",{ref:O,className:`thread ${t.unread?\"unread\":\"\"} ${x?\"selected\":\"\"}`,children:[w!==0&&(0,T.jsxs)(\"div\",{className:`swipe-under ${w>0?\"right\":\"left\"} ${H}${_t?\" armed\":\"\"}`,\"aria-hidden\":\"true\",children:[(0,T.jsx)(E,{name:H===\"archive\"?\"archive\":\"bell\"}),(0,T.jsx)(\"span\",{children:H===\"archive\"?\"Archive\":\"Remind\"})]}),(0,T.jsxs)(\"div\",{className:`thread-inner${C?\" dragging\":\"\"}`,style:w?{transform:`translateX(${w}px)`}:void 0,onPointerDown:K,onPointerMove:q,onPointerUp:ln,onPointerCancel:()=>{Q.current=null,D(!1),U(0)},children:[(0,T.jsx)(\"button\",{type:\"button\",className:\"avatar-button\",\"aria-label\":x?`Deselect ${t.subject}`:`Select ${t.subject}`,\"aria-pressed\":x,disabled:!o,onClick:()=>{y(t.threadId,{selected:!x})},children:(0,T.jsx)(Wa,{name:t.sender,selected:x})}),(0,T.jsxs)(\"button\",{type:\"button\",className:\"thread-main\",\"aria-label\":Cn,onClick:()=>i?void y(t.threadId,{selected:!x}):d.thread(t.threadId,n.path),children:[(0,T.jsxs)(\"span\",{className:\"thread-line\",children:[l&&(0,T.jsx)(Ze,{color:l}),(0,T.jsx)(\"span\",{className:\"sender\",children:t.sender}),(0,T.jsx)(\"span\",{className:\"date\",children:t.date})]}),(0,T.jsx)(\"span\",{className:\"subject\",children:(0,T.jsx)(ou,{text:t.subject,terms:u})}),(0,T.jsx)(\"span\",{className:\"snippet\",children:(0,T.jsx)(ou,{text:t.snippet,terms:u})}),(ne.length>0||Ne||t.attachment||t.labels.length>0)&&(0,T.jsxs)(\"span\",{className:\"thread-chips\",children:[ne.map(J=>(0,T.jsx)(\"span\",{className:`chip-small ${J.type}`,children:J.type===\"todo\"?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(E,{name:\"check\",size:12}),\" To-do added\"]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(E,{name:\"bell\",size:12}),\" \",J.dueDate?Fn(J):\"Reminder\"]})},J.id)).slice(0,2),Ne&&(0,T.jsxs)(\"span\",{className:\"chip-small\",children:[(0,T.jsx)(E,{name:\"clock\",size:12}),\" \",Fn(Ne)]}),t.attachment&&(0,T.jsxs)(\"span\",{className:\"chip-small attachment\",children:[(0,T.jsx)(E,{name:\"clip\",size:12}),\" Attachment\"]}),t.labels.filter(J=>J!==\"Inbox\"||u.length>0).slice(0,2).map(J=>(0,T.jsx)(\"span\",{className:\"chip-small label\",children:J},J))]})]}),(0,T.jsx)(te,{icon:\"star\",label:v?\"Unstar\":\"Star\",filled:v,pressed:v,className:v?\"star on\":\"star\",disabled:!o,onClick:()=>{h(t.threadId,{starred:!v})}})]})]})});function BS({rows:e,accountId:t}){let n=xe(\"clearSelection\",null,j),a=xe(\"archiveSelected\",null,j),l=xe(\"trashSelected\",null,j),{navigate:i}=I(),{show:o}=qe(),u=(r,c)=>{r(null).then(m=>o({text:m.outcome===\"observed\"?c:m.message??\"Couldn't finish. Try again.\"}))};return(0,T.jsxs)(\"header\",{className:\"selection-bar\",children:[(0,T.jsx)(te,{icon:\"close\",label:\"Clear selection\",onClick:()=>{n(null)}}),(0,T.jsxs)(\"h1\",{children:[e.length,\" selected\"]}),(0,T.jsx)(\"span\",{className:\"spacer\"}),(0,T.jsx)(te,{icon:\"archive\",label:\"Archive selected\",onClick:()=>u(a,`${e.length} archived`)}),(0,T.jsx)(te,{icon:\"trash\",label:\"Delete selected\",onClick:()=>u(l,`${e.length} moved to Trash`)}),(0,T.jsx)(te,{icon:\"bell\",label:\"Save for later\",onClick:()=>i({screen:\"bulk\",params:{emails:JSON.stringify(e.map(r=>My(r,t)))}})})]})}function LS({query:e}){let{navigate:t,back:n}=I();return(0,T.jsx)(\"header\",{className:\"mail-header\",children:(0,T.jsxs)(\"div\",{className:\"search-pill\",children:[(0,T.jsx)(te,{icon:\"back\",label:\"Back\",onClick:n}),(0,T.jsx)(\"button\",{type:\"button\",className:\"search-pill-text filled\",onClick:()=>t({screen:\"search\",params:{q:e}}),children:e}),(0,T.jsx)(te,{icon:\"close\",label:\"Clear search\",onClick:()=>t({screen:\"search\",params:{q:\"\"}})})]})})}function GS({query:e,count:t,complete:n}){let a=Ve(),l=e.split(/\\s+/).filter(Boolean),i=r=>{let c=l.includes(r)?l.filter(m=>m!==r):[...l,r];c.length&&a.search(c.join(\" \"),\"replace\")},o=Zf(e).join(\" \"),u=Ay.filter(r=>l.includes(r.term));return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(\"nav\",{className:\"filter-chips\",\"aria-label\":\"Filters\",children:Ay.map(r=>(0,T.jsxs)(\"button\",{type:\"button\",className:\"filter-chip\",\"aria-pressed\":l.includes(r.term),onClick:()=>i(r.term),children:[l.includes(r.term)&&(0,T.jsx)(E,{name:\"check\",size:14}),r.label]},r.id))}),(0,T.jsxs)(\"p\",{className:\"results-line\",children:[(0,T.jsxs)(\"strong\",{children:[t,n?\"\":t?\"+\":\"\",\" results\"]}),o?` for \\u201C${o}\\u201D`:\"\",u.length?` \\xB7 ${u.map(r=>r.label.toLowerCase()).join(\", \")}`:\"\",(0,T.jsx)(\"span\",{className:\"muted\",children:\" \\xB7 Most recent\"})]})]})}function qS({query:e,items:t}){let n=el(),a=Le(),l=Zf(e).map(o=>o.toLowerCase()),i=l.length?t.filter(o=>!o.snooze&&l.every(u=>`${o.title} ${o.note} ${o.link?.subject??\"\"} ${o.link?.sender??\"\"}`.toLowerCase().includes(u))).slice(0,4):[];return i.length?(0,T.jsxs)(\"section\",{className:\"also\",children:[(0,T.jsx)(\"h2\",{className:\"section-label\",children:\"Also in your to-do\"}),(0,T.jsx)(\"ul\",{className:\"item-list card\",children:i.map(o=>(0,T.jsx)(tl,{item:o,now:a,onOpen:()=>n(o.id)},o.id))})]}):null}function YS({items:e}){let t=Ve(),{save:n,complete:a}=Se(),{show:l}=qe(),i=o=>{(o.snooze?a(o,!0):n({...o,returned:!0})).then(()=>l({text:\"Dismissed\",undo:()=>n(o)}),()=>l({text:\"Couldn't save. Try again.\"}))};return(0,T.jsxs)(\"section\",{className:\"back-section\",\"aria-label\":\"Back in your inbox\",children:[(0,T.jsxs)(\"h2\",{className:\"section-label\",children:[(0,T.jsx)(E,{name:\"bell\",size:14}),\" Back in your inbox\"]}),(0,T.jsx)(\"ul\",{className:\"back-list\",children:e.slice(0,5).map(o=>(0,T.jsxs)(\"li\",{className:\"back-row\",children:[(0,T.jsxs)(\"button\",{type:\"button\",className:\"back-main\",onClick:()=>{n({...o,returned:!0}),o.link?.threadId&&t.email(o.link.threadId,o.accountId)},children:[(0,T.jsx)(\"strong\",{children:o.link?.subject??o.title}),(0,T.jsxs)(\"span\",{children:[o.snooze?\"Snoozed\":o.title,\" \\xB7 \",o.link?.sender]})]}),(0,T.jsx)(te,{icon:\"check\",label:`Dismiss ${o.title}`,onClick:()=>i(o)})]},o.id))})]})}function jS({items:e,all:t,now:n}){let{navigate:a}=I(),l=e.filter(c=>c.type===\"todo\").length,i=e.length-l,o=t.filter(c=>c.done&&c.completedAt&&pe(new Date(c.completedAt))===pe(n)).length,u=o/(o+e.length),r=[...e].sort((c,m)=>(c.dueTime??\"\").localeCompare(m.dueTime??\"\")).slice(0,2);return(0,T.jsxs)(\"section\",{className:\"today-card\",children:[(0,T.jsxs)(\"button\",{type:\"button\",className:\"today-head\",onClick:()=>a({screen:\"todo\",mode:\"root\"}),children:[(0,T.jsxs)(\"span\",{children:[(0,T.jsx)(\"strong\",{children:\"Today\"}),\" \",(0,T.jsx)(\"span\",{className:\"muted\",children:[l&&`${l} to-do${l>1?\"s\":\"\"}`,i&&`${i} reminder${i>1?\"s\":\"\"}`].filter(Boolean).join(\" \\xB7 \")})]}),(0,T.jsx)(E,{name:\"right\"})]}),(0,T.jsx)(\"ul\",{children:r.map(c=>(0,T.jsx)(XS,{item:c,now:n},c.id))}),(0,T.jsx)(\"div\",{className:\"progress\",role:\"progressbar\",\"aria-label\":\"Done today\",\"aria-valuemin\":0,\"aria-valuemax\":100,\"aria-valuenow\":Math.round(u*100),children:(0,T.jsx)(\"span\",{style:{width:`${Math.round(u*100)}%`}})})]})}function XS({item:e,now:t}){let{navigate:n}=I(),{checking:a,toggle:l}=Xf(e);return(0,T.jsxs)(\"li\",{className:`today-row${a?\" is-done\":\"\"}`,children:[(0,T.jsx)(fu,{item:e,onToggle:l,checking:a}),(0,T.jsx)(\"button\",{type:\"button\",className:\"today-title\",onClick:()=>n({screen:\"item\",params:{id:e.id}}),children:e.title}),(0,T.jsx)(\"span\",{className:`tag ${e.type===\"reminder\"?\"reminder\":\"due\"}`,children:e.dueTime?Fn(e,t).replace(/^Today /,\"by \"):Fn(e,t)})]})}var ha=Y(Ke(),1);var z=Y(P(),1),If={archive:\"Archive\",trash:\"Delete\",deleteForever:\"Delete forever\",notSpam:\"Not spam\",moveToInbox:\"Move to inbox\",mute:\"Mute\",markUnread:\"Mark unread\",spam:\"Report spam\"},VS={archive:\"Archived\",trash:\"Moved to Trash\",deleteForever:\"Deleted forever\",notSpam:\"Moved to inbox\",moveToInbox:\"Moved to inbox\",mute:\"Muted\",markUnread:\"Marked unread\",spam:\"Reported as spam\"};function zy({threadId:e,list:t}){let n=hn(j),l=vn(\"conversation\",null,j)?.data,{items:i}=Se(),{settings:o}=yt(),u=Ee(),{back:r,navigate:c}=I(),{show:m}=qe(),d=el(),f=Le(),[s,h]=(0,ha.useState)(null),y=n.status===\"ready\"&&!n.stale&&l!==void 0,S=Vi(i,e).filter(k=>!k.snooze||!k.done),p=u.current,{save:g}=Se();(0,ha.useEffect)(()=>{for(let k of S)k.bringBack&&!k.returned&&k.dueDate&&new Date(`${k.dueDate}T${k.dueTime??\"00:00\"}`)<=f&&g({...k,returned:!0})},[S.length]);let v={archive:xe(\"archive\",\"conversation\",j),trash:xe(\"trash\",\"conversation\",j),deleteForever:xe(\"deleteForever\",\"conversation\",j),notSpam:xe(\"notSpam\",\"conversation\",j),moveToInbox:xe(\"moveToInbox\",\"conversation\",j),mute:xe(\"mute\",\"conversation\",j),markUnread:xe(\"markUnread\",\"conversation\",j),spam:xe(\"spam\",\"conversation\",j)},x=xe(\"setStarred\",\"conversation\",j),w=xe(\"respond\",\"conversation\",j);(0,ha.useEffect)(()=>{!y||cu.threadId!==e||(cu.threadId=null,w(null,{mode:\"reply\"}))},[y,e]);let[U,C]=(0,ha.useState)(null),D=k=>{h(null),C(k),v[k](null).then(ue=>{C(null),m({text:ue.outcome===\"observed\"?VS[k]??\"Done\":ue.message??\"Couldn't finish. Try again.\"})})},Q=[...ic(\"conversation\",null,j)].reverse().find(k=>k.name===\"setStarred\"),O=Q?!!Q.args.starred:l?.starred??!1,ne=fc(!l),Ne=()=>{if(!l)return null;let k=l.messages[0],ue=l.messages[l.messages.length-1];return{threadId:e,subject:l.subject,sender:k?.sender??\"\",snippet:(ue?.snippet||QS(ue?.body??[])).slice(0,200),receivedAt:ue?.time??\"\",accountId:p?.id??\"unknown\"}},he=k=>{let ue=Ne();h(null),ue&&c({screen:\"add\",params:{type:k,emails:JSON.stringify([ue]),archive:\"conversation\"}})},{saveMany:K,removeMany:q}=Se(),ln=async k=>{let ue=Ne();if(h(null),!ue)return;let Nt=_l(\"reminder\",ue,p?.id??\"unknown\",{title:Wn(ue.subject),dueDate:pe(k),dueTime:ut(k)});try{await K([Nt]),m({text:`Reminder set \\xB7 ${$n(Nt,f)}`,undo:()=>q([Nt.id]),view:()=>d(Nt.id)})}catch{m({text:\"Couldn't save. Try again.\"})}},Cn;l?Cn=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\"div\",{className:\"subject-row\",children:[(0,z.jsx)(\"h1\",{className:\"conversation-subject\",children:l.subject}),(0,z.jsx)(te,{icon:\"star\",label:O?\"Unstar\":\"Star\",filled:O,pressed:O,className:O?\"star on\":\"star\",disabled:!y,onClick:()=>{x(null,{starred:!O})}})]}),(0,z.jsxs)(\"div\",{className:\"conversation-meta\",children:[p&&(0,z.jsxs)(\"span\",{className:\"account-line\",children:[(0,z.jsx)(Ze,{color:p.color}),\" \",p.name]}),l.labels.slice(0,3).map(k=>(0,z.jsx)(\"span\",{className:\"chip-small label\",children:k},k)),l.messages.length>1&&(0,z.jsxs)(\"span\",{className:\"muted\",children:[l.messages.length,\" messages\"]})]}),S.length>0&&(0,z.jsxs)(\"section\",{className:\"linked-items\",\"aria-label\":\"Linked items\",children:[(0,z.jsx)(\"h2\",{className:\"section-label\",children:S.length===1?\"1 item linked\":`${S.length} items linked`}),(0,z.jsx)(\"ul\",{className:\"item-list card\",children:S.map(k=>(0,z.jsx)(tl,{item:k,now:f,onOpen:()=>d(k.id)},k.id))})]}),(0,z.jsx)(\"ol\",{className:\"messages\",children:l.messages.map((k,ue)=>(0,z.jsx)(ZS,{message:k,last:ue===l.messages.length-1},k.id))}),(0,z.jsxs)(\"div\",{className:\"reply-row\",children:[(0,z.jsxs)(\"button\",{type:\"button\",className:\"outline\",disabled:!y,onClick:()=>{w(null,{mode:\"reply\"})},children:[(0,z.jsx)(E,{name:\"reply\"}),\" Reply\"]}),(0,z.jsxs)(\"button\",{type:\"button\",className:\"outline\",disabled:!y,onClick:()=>{w(null,{mode:\"replyAll\"})},children:[(0,z.jsx)(E,{name:\"replyAll\"}),\" Reply all\"]}),(0,z.jsxs)(\"button\",{type:\"button\",className:\"outline\",disabled:!y,onClick:()=>{w(null,{mode:\"forward\"})},children:[(0,z.jsx)(E,{name:\"forward\"}),\" Forward\"]})]})]}):Cn=n.status===\"error\"?(0,z.jsx)(kt,{title:\"Couldn't open this email\",role:\"alert\",icon:\"alert\",children:(0,z.jsx)(\"p\",{children:n.error?.message})}):(0,z.jsx)(nn,{label:\"Loading email\",kind:\"email\",rows:6});let H=l?.commands??[],_t=H.includes(\"moveToInbox\")?[\"moveToInbox\",\"trash\",\"markUnread\"]:[\"archive\",\"trash\",\"markUnread\"],J=H.filter(k=>!_t.includes(k)),Ie={archive:\"archive\",trash:\"trash\",markUnread:\"unread\",moveToInbox:\"inbox\"};return(0,z.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,z.jsxs)(\"header\",{className:\"top-bar\",children:[(0,z.jsx)(te,{icon:\"back\",label:`Back to ${t.title}`,onClick:r}),(0,z.jsx)(\"span\",{className:\"spacer\"}),_t.map(k=>(0,z.jsx)(te,{icon:Ie[k],label:If[k],disabled:!y||U!==null||!H.includes(k),onClick:()=>D(k)},k)),(0,z.jsx)(te,{icon:\"clock\",label:\"Snooze\",disabled:!y||U!==null,onClick:()=>he(\"snooze\")}),(0,z.jsx)(te,{icon:\"more\",label:\"More\",disabled:!y||U!==null,pressed:s===\"more\",onClick:()=>h(s===\"more\"?null:\"more\")})]}),s===\"more\"&&(0,z.jsxs)(iu,{onClose:()=>h(null),className:\"more-menu\",children:[J.map(k=>(0,z.jsx)(\"button\",{type:\"button\",role:\"menuitem\",onClick:()=>D(k),children:If[k]},k)),(0,z.jsx)(\"button\",{type:\"button\",role:\"menuitem\",onClick:()=>{h(null),c({screen:\"settings\"})},children:\"Gmail Only settings\"})]}),(0,z.jsx)(dc,{active:U!==null||!!l&&n.stale,label:U?If[U]:\"Updating\"}),(0,z.jsxs)(Xe,{className:`screen conversation${ne&&l?\" reveal\":\"\"}`,\"aria-busy\":!y,children:[o.showAddTo&&(0,z.jsxs)(\"div\",{className:\"add-to\",children:[(0,z.jsxs)(\"button\",{type:\"button\",className:\"add-pill\",\"aria-expanded\":s===\"add\",disabled:!l,onClick:()=>h(s===\"add\"?null:\"add\"),children:[(0,z.jsx)(E,{name:\"plus\"}),\" Add to\\u2026 \",(0,z.jsx)(E,{name:s===\"add\"?\"up\":\"down\"})]}),(0,z.jsx)(\"span\",{className:\"muted\",children:\"Save this email as a reminder or to-do\"})]}),s===\"add\"&&(0,z.jsxs)(iu,{onClose:()=>h(null),className:\"add-menu\",children:[(0,z.jsxs)(\"button\",{type:\"button\",role:\"menuitem\",className:\"add-option\",onClick:()=>he(\"reminder\"),children:[(0,z.jsx)(\"span\",{className:\"tile reminder\",children:(0,z.jsx)(E,{name:\"bell\"})}),(0,z.jsxs)(\"span\",{children:[(0,z.jsx)(\"strong\",{children:\"Add a reminder\"}),(0,z.jsx)(\"small\",{children:\"Get notified at a set time\"})]})]}),(0,z.jsxs)(\"button\",{type:\"button\",role:\"menuitem\",className:\"add-option\",onClick:()=>he(\"todo\"),children:[(0,z.jsx)(\"span\",{className:\"tile todo\",children:(0,z.jsx)(E,{name:\"check2\"})}),(0,z.jsxs)(\"span\",{children:[(0,z.jsx)(\"strong\",{children:\"Add to to-do\"}),(0,z.jsx)(\"small\",{children:\"A task to finish, due date optional\"})]})]}),(0,z.jsxs)(\"div\",{className:\"quick-row\",children:[(0,z.jsx)(\"span\",{className:\"section-label\",children:\"Quick\"}),cy(o.defaultReminderTime,f).map(k=>(0,z.jsxs)(\"button\",{type:\"button\",className:\"chip\",onClick:()=>{ln(k.date)},children:[(0,z.jsx)(E,{name:\"clock\",size:14}),\" \",k.label]},k.id))]})]}),Cn]})]})}var QS=e=>e.map(t=>t.text).join(\"\").replace(/\\s+/g,\" \").trim();function ZS({message:e,last:t}){let{navigate:n}=I(),a=xe(\"expandMessage\",\"conversation\",j),[l,i]=(0,ha.useState)(t||e.body.length>0),[o,u]=(0,ha.useState)(!1),[r,c]=(0,ha.useState)(null),m=e.body.length>0;return(0,z.jsxs)(\"li\",{className:\"message\",children:[(0,z.jsxs)(\"button\",{type:\"button\",className:\"message-head\",\"aria-expanded\":l&&m,\"aria-busy\":o,disabled:o,onClick:()=>{if(m){i(!l);return}u(!0),c(null);let f=(s,h)=>{u(!1),s?i(!0):c(h??\"Couldn't open this message. Try again.\")};a(null,{id:e.id}).then(s=>f(s.outcome===\"observed\",s.message),()=>f(!1))},children:[(0,z.jsx)(Wa,{name:e.sender,size:36}),(0,z.jsxs)(\"span\",{className:\"message-who\",children:[(0,z.jsx)(\"strong\",{children:e.sender}),(0,z.jsxs)(\"span\",{className:\"muted\",children:[e.recipients,e.time&&e.time!==e.recipients?` \\xB7 ${e.time}`:\"\"]})]})]}),l&&m?(0,z.jsxs)(\"div\",{className:\"message-body\",dir:\"auto\",children:[e.body.map((f,s)=>f.href?(0,z.jsx)(\"a\",{href:f.href,onClick:h=>{h.preventDefault(),n({url:f.href})},children:f.text},s):f.bold?(0,z.jsx)(\"strong\",{children:f.text},s):(0,z.jsx)(\"span\",{children:f.text},s)),e.truncated&&(0,z.jsx)(\"p\",{className:\"muted\",children:\"This message is long. The rest is in Gmail.\"})]}):(0,z.jsx)(\"p\",{className:\"message-snippet\",children:o?\"Opening\\u2026\":r??e.snippet}),e.attachments.length>0&&(0,z.jsx)(\"ul\",{className:\"attachments\",children:e.attachments.map((f,s)=>{let h=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\"span\",{className:\"file-tile\",children:(f.name.split(\".\").pop()??\"file\").slice(0,4).toUpperCase()}),(0,z.jsxs)(\"span\",{children:[(0,z.jsx)(\"strong\",{children:f.name}),(0,z.jsx)(\"small\",{children:[f.size,f.href?\"Opens in Gmail\":\"\"].filter(Boolean).join(\" \\xB7 \")})]})]});return(0,z.jsx)(\"li\",{children:f.href?(0,z.jsx)(\"a\",{className:\"attachment-card\",href:f.href,onClick:y=>{y.preventDefault(),n({url:f.href})},children:h}):(0,z.jsx)(\"span\",{className:\"attachment-card\",children:h})},s)})})]})}var Ul=Y(Ke(),1);var W=Y(P(),1),IS=3,Kf=\"10:00\";function KS(e){let t=_e(vt(e),IS);for(;t.getDay()===0||t.getDay()===6;)t=_e(t,1);return ot(t,Kf)}function Cy(){let e=hn(j),t=vn(\"compose\",null,j)?.data,n=xe(\"fill\",\"compose\",j),a=xe(\"discard\",\"compose\",j),{viewWebsite:l,back:i}=I(),{current:o}=Ee(),{saveMany:u,removeMany:r}=Se(),{show:c}=qe(),m=Le(),[d,f]=(0,Ul.useState)({to:\"\",cc:\"\",bcc:\"\",subject:\"\"}),[s,h]=(0,Ul.useState)(!1),[y,S]=(0,Ul.useState)(!1),[p,g]=(0,Ul.useState)(!1),v=e.status===\"ready\"&&!e.stale&&t!==void 0;(0,Ul.useEffect)(()=>{!t||s||(f({to:t.to,cc:t.cc,bcc:t.bcc,subject:t.subject}),(t.cc||t.bcc)&&S(!0),h(!0))},[t,s]);let x=/^re:/i.test(t?.subject??\"\"),w=/^fwd?:/i.test(t?.subject??\"\"),U=x?\"Reply\":w?\"Forward\":\"New message\",C=KS(m),D=()=>n(null,d);async function Q(){if((await D()).outcome!==\"observed\"&&c({text:\"Couldn't copy the fields to Gmail. Check them there.\"}),p){let he=d.subject.trim()||\"(no subject)\",K=_l(\"todo\",{threadId:null,sender:d.to.trim()||\"Recipient\",subject:he,snippet:\"Sent by you\",receivedAt:\"\",accountId:o?.id??\"unknown\"},o?.id??\"unknown\",{title:`Follow up: ${Wn(he)}`.slice(0,200),dueDate:pe(C),dueTime:Kf,notify:!0,bringBack:!1});try{await u([K]),c({text:`Follow-up added for ${Jn(C)}`,undo:()=>r([K.id])})}catch{c({text:\"Couldn't save the follow-up.\"})}}l()}async function O(){(await a(null)).outcome!==\"observed\"&&i()}if(!t)return(0,W.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,W.jsxs)(\"header\",{className:\"top-bar\",children:[(0,W.jsx)(te,{icon:\"close\",label:\"Close\",onClick:i}),(0,W.jsx)(\"h1\",{children:\"Compose\"})]}),(0,W.jsx)(nn,{label:\"Opening compose\",kind:\"text\",rows:4})]});let ne=(Ne,he,K=\"text\")=>(0,W.jsxs)(\"label\",{className:\"compose-field\",children:[(0,W.jsx)(\"span\",{children:he}),(0,W.jsx)(\"input\",{type:K,value:d[Ne],inputMode:K===\"email\"?\"email\":void 0,autoComplete:\"off\",onChange:q=>f(ln=>({...ln,[Ne]:q.target.value})),onBlur:()=>{D()}})]});return(0,W.jsxs)(\"div\",{className:\"screen-frame compose-screen\",children:[(0,W.jsxs)(\"header\",{className:\"top-bar\",children:[(0,W.jsx)(te,{icon:\"close\",label:\"Discard draft\",onClick:()=>{O()}}),(0,W.jsx)(\"h1\",{children:U}),(0,W.jsx)(\"span\",{className:\"spacer\"}),(0,W.jsxs)(\"button\",{type:\"button\",className:\"accent send\",disabled:!v,onClick:()=>{Q()},children:[(0,W.jsx)(E,{name:\"send\"}),\" Continue\"]})]}),(0,W.jsxs)(Xe,{className:\"screen\",\"aria-busy\":!v,children:[(0,W.jsxs)(\"div\",{className:\"compose-card\",children:[(0,W.jsxs)(\"div\",{className:\"compose-field from\",children:[(0,W.jsx)(\"span\",{children:\"From\"}),o&&(0,W.jsx)(Ze,{color:o.color}),(0,W.jsx)(\"span\",{className:\"from-value\",children:t.from||o?.email})]}),(0,W.jsxs)(\"div\",{className:\"compose-to\",children:[ne(\"to\",\"To\",\"email\"),!y&&(0,W.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:()=>S(!0),children:\"Cc/Bcc\"})]}),y&&(0,W.jsxs)(W.Fragment,{children:[ne(\"cc\",\"Cc\",\"email\"),ne(\"bcc\",\"Bcc\",\"email\")]}),ne(\"subject\",\"Subject\"),(0,W.jsxs)(\"div\",{className:\"compose-body-note\",children:[(0,W.jsx)(E,{name:\"pencil\"}),(0,W.jsxs)(\"p\",{children:[\"Write your message in Gmail. Gmail Only copies the fields above, then opens Gmail's compose so you can write and send.\",t.body?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(\"br\",{}),(0,W.jsxs)(\"span\",{className:\"muted\",children:[\"Already written: \\u201C\",t.body.slice(0,120),t.body.length>120?\"\\u2026\":\"\",\"\\u201D\"]})]}):null]})]})]}),(0,W.jsx)(\"div\",{className:\"card remind-card\",children:(0,W.jsx)(tn,{icon:(0,W.jsx)(\"span\",{className:\"tile reminder small\",children:(0,W.jsx)(E,{name:\"bell\"})}),label:\"Remind me if no reply\",detail:`Adds a to-do for ${Jn(C)} \\xB7 ${Ct(Kf).replace(\":00\",\"\")}`,checked:p,onChange:g})}),(0,W.jsx)(\"p\",{className:\"hint padded\",children:\"Gmail's mobile web has no scheduled send, and Gmail Only never sends for you. The follow-up stays on your list until you tick it off.\"}),(0,W.jsxs)(\"button\",{type:\"button\",className:\"accent block padded-x\",disabled:!v,onClick:()=>{Q()},children:[\"Continue in Gmail \",(0,W.jsx)(E,{name:\"external\"})]})]})]})}var Oy=Y(Ke(),1);var Te=Y(P(),1);function ky(){let e=lc(\"menu\",j),t=vn(\"menuAccount\",null,j)?.data,n=xe(\"open\",\"menu\",j),{navigate:a,back:l}=I(),i=Ve(),{current:o}=Ee(),{items:u}=Se(),r=Le(),c=e.order.map(S=>e.get(S)?.data).filter(S=>!!S),m=new Map(c.map(S=>[S.arg,S])),d=c.filter(S=>S.kind===\"label\"),f=u.filter(S=>Fa(S,r)).length,s=u.filter(S=>S.snooze&&!S.done).length,h=o?.email??t?.email??\"\";(0,Oy.useEffect)(()=>{for(let S of Ja){let p=m.get(S.arg);p&&gc(S.id,p.count??0)}},[c,o?.id]);let y=(S,p,g,v,x,w)=>(0,Te.jsx)(\"li\",{children:(0,Te.jsxs)(\"button\",{type:\"button\",className:`drawer-row ${w??\"\"}`,onClick:x,children:[(0,Te.jsx)(E,{name:p}),(0,Te.jsx)(\"span\",{children:g}),v?(0,Te.jsx)(\"span\",{className:\"count\",children:v}):null]})},S);return(0,Te.jsxs)(\"div\",{className:\"screen-frame drawer\",children:[(0,Te.jsxs)(\"header\",{className:\"top-bar\",children:[(0,Te.jsx)(mc,{}),(0,Te.jsx)(\"span\",{className:\"spacer\"}),(0,Te.jsx)(te,{icon:\"close\",label:\"Close menu\",onClick:l})]}),(0,Te.jsxs)(Xe,{className:\"screen\",\"aria-busy\":e.status!==\"ready\",children:[(0,Te.jsxs)(\"button\",{type:\"button\",className:\"account-card\",onClick:()=>a({screen:\"accounts\"}),children:[o&&(0,Te.jsx)(Ze,{color:o.color}),(0,Te.jsxs)(\"span\",{children:[(0,Te.jsx)(\"strong\",{children:o?.name??\"Account\"}),(0,Te.jsx)(\"small\",{children:h})]}),(0,Te.jsx)(E,{name:\"down\"})]}),(0,Te.jsxs)(\"ul\",{className:\"drawer-list\",children:[y(\"todo\",\"todo\",\"To-do & reminders\",f,()=>a({screen:\"todo\",mode:\"root\"}),\"accent\"),y(\"snoozed\",\"clock\",\"Snoozed\",s,()=>a({screen:\"snoozed\"}))]}),(0,Te.jsx)(\"h2\",{className:\"section-label\",children:\"Gmail\"}),!c.length&&e.status!==\"ready\"?(0,Te.jsx)(nn,{label:\"Loading folders\",rows:6,kind:\"text\"}):(0,Te.jsx)(\"ul\",{className:\"drawer-list\",children:Ja.map(S=>y(S.id,S.icon,S.title,m.get(S.arg)?.count??null,()=>i.list(S.path,\"replace\")))}),d.length>0&&(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(\"h2\",{className:\"section-label\",children:\"Labels\"}),(0,Te.jsx)(\"ul\",{className:\"drawer-list\",children:d.map(S=>y(S.arg,\"label\",S.label,S.count,()=>{n(S.arg)}))})]}),(0,Te.jsx)(\"ul\",{className:\"drawer-list end\",children:y(\"settings\",\"settings\",\"Gmail Only settings\",null,()=>a({screen:\"settings\"}))})]})]})}var X=Y(P(),1);function _y(){let e=hn(j),t=vn(\"view\",null,j)?.data,{view:n}=ru();if(e.status===\"auth\")return(0,X.jsx)($S,{});if(e.status===\"error\"&&!t)return(0,X.jsx)(Jf,{children:(0,X.jsx)(xy,{error:e.error})});switch(t?.view?JS(t.view):n.kind===\"other\"?\"loading\":n.kind){case\"list\":return(0,X.jsx)(Dy,{list:n.kind===\"list\"||n.kind===\"conversation\"?n.list:yn});case\"conversation\":return n.kind===\"conversation\"?(0,X.jsx)(zy,{threadId:n.threadId,list:n.list}):(0,X.jsx)(Jf,{children:(0,X.jsx)(nn,{label:\"Loading email\",kind:\"email\",rows:6})});case\"compose\":return(0,X.jsx)(Cy,{});case\"menu\":return(0,X.jsx)(ky,{});case\"settings\":return(0,X.jsx)(FS,{});case\"loading\":return(0,X.jsx)(Jf,{children:(0,X.jsx)(nn,{label:\"Loading Gmail\"})});default:return(0,X.jsx)(WS,{})}}function JS(e){switch(e){case\"tl_\":return\"list\";case\"cv_\":return\"conversation\";case\"co_\":return\"compose\";case\"mn_\":return\"menu\";case\"pr_\":return\"settings\";default:return\"loading\"}}function Jf({children:e}){return(0,X.jsx)(\"div\",{className:\"screen-frame\",children:(0,X.jsx)(\"div\",{className:\"screen\",children:e})})}function $S(){let{viewWebsite:e}=I();return(0,X.jsx)(\"div\",{className:\"screen-frame\",children:(0,X.jsx)(\"div\",{className:\"screen centered\",children:(0,X.jsxs)(\"div\",{className:\"welcome\",children:[(0,X.jsx)(mc,{}),(0,X.jsx)(\"h1\",{children:\"Sign in to Gmail\"}),(0,X.jsx)(\"p\",{children:\"Gmail Only works over your own Gmail session. Sign in on Google's page; your reminders and to-dos stay on this device.\"}),(0,X.jsxs)(\"button\",{type:\"button\",className:\"accent block\",onClick:()=>e(),children:[\"Sign in with Google \",(0,X.jsx)(E,{name:\"external\"})]})]})})})}function FS(){let{viewWebsite:e,navigate:t}=I(),n=Ve();return(0,X.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,X.jsxs)(\"header\",{className:\"top-bar\",children:[(0,X.jsx)(te,{icon:\"back\",label:\"Back to inbox\",onClick:()=>n.inbox(\"replace\")}),(0,X.jsx)(\"h1\",{children:\"Gmail settings\"})]}),(0,X.jsxs)(\"div\",{className:\"screen\",children:[(0,X.jsxs)(\"div\",{className:\"card settings-links\",children:[(0,X.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>e(),children:[(0,X.jsx)(\"span\",{className:\"tile neutral\",children:(0,X.jsx)(E,{name:\"mail\"})}),(0,X.jsxs)(\"span\",{children:[(0,X.jsx)(\"strong\",{children:\"Signature, vacation reply and more\"}),(0,X.jsx)(\"small\",{children:\"Opens Gmail's settings page\"})]}),(0,X.jsx)(E,{name:\"external\"})]}),(0,X.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>t({screen:\"settings\"}),children:[(0,X.jsx)(\"span\",{className:\"tile todo\",children:(0,X.jsx)(E,{name:\"settings\"})}),(0,X.jsxs)(\"span\",{children:[(0,X.jsx)(\"strong\",{children:\"Gmail Only settings\"}),(0,X.jsx)(\"small\",{children:\"Reminders, to-dos, swipe and theme\"})]}),(0,X.jsx)(E,{name:\"right\"})]})]}),(0,X.jsx)(\"p\",{className:\"hint padded\",children:\"Gmail's settings change your Google account, so Gmail Only opens them in Gmail rather than redrawing them.\"})]})]})}function WS(){let{viewWebsite:e}=I(),t=Ve();return(0,X.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,X.jsxs)(\"header\",{className:\"top-bar\",children:[(0,X.jsx)(te,{icon:\"back\",label:\"Back to inbox\",onClick:()=>t.inbox(\"replace\")}),(0,X.jsx)(\"h1\",{children:\"Gmail\"})]}),(0,X.jsx)(\"div\",{className:\"screen\",children:(0,X.jsxs)(kt,{title:\"This part of Gmail opens in Gmail\",icon:\"mail\",children:[(0,X.jsx)(\"p\",{children:\"Gmail Only doesn't have its own screen for this page yet.\"}),(0,X.jsxs)(\"div\",{className:\"row-buttons\",children:[(0,X.jsxs)(\"button\",{type:\"button\",className:\"accent\",onClick:()=>e(),children:[\"Open in Gmail \",(0,X.jsx)(E,{name:\"external\"})]}),(0,X.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t.inbox(\"replace\"),children:\"Go to inbox\"})]})]})})]})}var nl=Y(Ke(),1);var M=Y(P(),1),PS={overdue:\"Overdue\",today:\"Today\",tomorrow:\"Tomorrow\",week:\"This week\",later:\"Later\",none:\"No date yet\",done:\"Done\"},eT=[\"overdue\",\"today\",\"tomorrow\",\"week\",\"later\",\"none\",\"done\"];function Ry(){let{items:e,loading:t,error:n,saveMany:a}=Se(),l=Ee(),{settings:i,update:o}=yt(),{navigate:u}=I(),{show:r}=qe(),c=el(),m=Le(),[d,f]=(0,nl.useState)(i.defaultSort),[s,h]=(0,nl.useState)(\"all\"),[y,S]=(0,nl.useState)(null),[p,g]=(0,nl.useState)(null),[v,x]=(0,nl.useState)(!1),w=i.todoAccount,U=(0,nl.useMemo)(()=>{let K=(p??\"\").toLowerCase().split(/\\s+/).filter(Boolean);return e.filter(q=>!q.snooze).filter(q=>w===\"all\"||q.accountId===w).filter(q=>l.byId(q.accountId)?.showInTodo!==!1||w===q.accountId).filter(q=>!K.length||K.every(ln=>tT(q).includes(ln)))},[e,w,l,p]),C=pe(m),D=U.filter(K=>Ol(K,m)===\"overdue\"),Q=async()=>{let K=D.map(q=>({...q,dueDate:C}));try{await a(K),r({text:`${K.length} moved to today`,undo:()=>a(D)})}catch{r({text:\"Couldn't move them. Try again.\"})}},O=()=>u({screen:\"add\",params:{type:\"todo\"}}),ne=w===\"all\"?null:l.byId(w),Ne=!0,he;return t&&!e.length?he=(0,M.jsx)(nn,{label:\"Loading your to-dos\",kind:\"text\",rows:6}):n&&!e.length?he=(0,M.jsx)(kt,{title:\"Couldn't load your to-dos\",role:\"alert\",icon:\"alert\",children:(0,M.jsx)(\"p\",{children:\"Try closing and reopening Gmail Only.\"})}):U.length?d===\"due\"?he=(0,M.jsx)(aT,{items:U,now:m,day:y,keepDays:i.keepDoneDays,terms:p?p.split(/\\s+/):[],onOpen:c,onMoveAll:()=>{Q()}}):he=(0,M.jsx)(lT,{items:U,now:m,filter:s,onFilter:h,terms:p?p.split(/\\s+/):[],onOpen:c,onSetDate:K=>u({screen:\"add\",params:{type:K.type,itemId:K.id}})}):he=p?(0,M.jsx)(kt,{title:\"No matches\",icon:\"search\",children:(0,M.jsxs)(\"p\",{children:[\"Nothing in your to-dos matches \\u201C\",p,\"\\u201D.\"]})}):(0,M.jsxs)(kt,{title:\"Nothing due\",icon:\"check2\",children:[(0,M.jsxs)(\"p\",{children:[\"Save emails as reminders from any message. Open an email and tap \",(0,M.jsx)(\"strong\",{children:\"Add to\\u2026\"}),\", or swipe it right.\"]}),(0,M.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:O,children:[(0,M.jsx)(E,{name:\"plus\"}),\" Add a to-do\"]})]}),(0,M.jsxs)(\"div\",{className:\"screen-frame todo\",children:[(0,M.jsx)(\"header\",{className:\"todo-header\",children:p===null?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(\"h1\",{children:\"To-do\"}),(0,M.jsx)(\"span\",{className:\"spacer\"}),Ne&&(0,M.jsxs)(\"button\",{type:\"button\",className:\"account-filter\",\"aria-expanded\":v,onClick:()=>x(!v),children:[ne?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Ze,{color:ne.color}),\" \",ne.name]}):\"All accounts\",\" \",(0,M.jsx)(E,{name:\"down\",size:16})]}),(0,M.jsx)(te,{icon:\"search\",label:\"Search to-dos\",onClick:()=>g(\"\")})]}):(0,M.jsxs)(\"div\",{className:\"search-pill todo-search\",children:[(0,M.jsx)(E,{name:\"search\"}),(0,M.jsx)(\"input\",{type:\"search\",autoFocus:!0,placeholder:\"Search to-dos\",\"aria-label\":\"Search to-dos\",value:p,onChange:K=>g(K.target.value)}),(0,M.jsx)(te,{icon:\"close\",label:\"Close search\",onClick:()=>g(null)})]})}),v&&(0,M.jsxs)(iu,{onClose:()=>x(!1),className:\"account-menu\",children:[(0,M.jsx)(\"button\",{type:\"button\",role:\"menuitemradio\",\"aria-checked\":w===\"all\",onClick:()=>{o({todoAccount:\"all\"}),x(!1)},children:\"All accounts\"}),l.accounts.map(K=>(0,M.jsxs)(\"button\",{type:\"button\",role:\"menuitemradio\",\"aria-checked\":w===K.id,onClick:()=>{o({todoAccount:K.id}),x(!1)},children:[(0,M.jsx)(Ze,{color:K.color}),\" \",K.name,\" \",(0,M.jsx)(\"small\",{children:K.email})]},K.id))]}),(0,M.jsxs)(Xe,{className:\"screen\",\"aria-busy\":t,children:[(0,M.jsx)(\"div\",{className:\"segmented\",role:\"tablist\",\"aria-label\":\"Sort\",\"data-index\":d===\"due\"?0:1,children:[\"due\",\"added\"].map(K=>(0,M.jsx)(\"button\",{type:\"button\",role:\"tab\",\"aria-selected\":d===K,onClick:()=>f(K),children:K===\"due\"?\"When it's due\":\"When I added it\"},K))}),(0,M.jsxs)(\"div\",{className:\"crossfade\",children:[d===\"due\"&&(0,M.jsx)(nT,{items:U,now:m,day:y,onDay:S}),he]},d)]}),(0,M.jsx)(\"button\",{type:\"button\",className:\"fab round\",\"aria-label\":\"Add a to-do\",onClick:O,children:(0,M.jsx)(E,{name:\"plus\"})})]})}var tT=e=>`${e.title} ${e.note} ${e.link?.subject??\"\"} ${e.link?.sender??\"\"}`.toLowerCase();function nT({items:e,now:t,day:n,onDay:a}){let l=vt(t),i=Array.from({length:7},(u,r)=>_e(l,r)),o=new Set(e.filter(u=>!u.done&&u.dueDate).map(u=>u.dueDate));return(0,M.jsx)(\"div\",{className:\"week-strip\",role:\"group\",\"aria-label\":\"This week\",children:i.map(u=>{let r=pe(u),c=n===r,m=e.filter(d=>!d.done&&d.dueDate===r).length;return(0,M.jsxs)(\"button\",{type:\"button\",\"aria-pressed\":c,className:`week-day ${$a(u,t)===0?\"today\":\"\"}`,\"aria-label\":`${Jn(u)}${m?`, ${m} due`:\"\"}`,onClick:()=>a(c?null:r),children:[(0,M.jsx)(\"span\",{children:Xi(u).slice(0,1)}),(0,M.jsx)(\"strong\",{children:u.getDate()}),(0,M.jsx)(\"i\",{className:o.has(r)?\"dot\":\"dot none\",\"aria-hidden\":\"true\"})]},r)})})}function aT({items:e,now:t,day:n,terms:a,keepDays:l,onOpen:i,onMoveAll:o}){if(n){let r=e.filter(m=>m.dueDate===n&&!m.done).sort(au),c=en(n);return(0,M.jsxs)(\"section\",{className:\"group\",children:[(0,M.jsxs)(\"h2\",{className:\"group-head\",children:[(0,M.jsx)(\"span\",{children:Jn(c)}),(0,M.jsx)(\"small\",{children:r.length?`${r.length} due`:\"Nothing due\"})]}),r.length>0&&(0,M.jsx)(\"ul\",{className:\"item-list card\",children:r.map(m=>(0,M.jsx)($f,{item:m,now:t,terms:a,onOpen:i},m.id))})]})}let u=new Map;for(let r of e){let c=Ol(r,t);u.set(c,[...u.get(c)??[],r])}return(0,M.jsx)(M.Fragment,{children:eT.filter(r=>u.get(r)?.length).map(r=>{let c=u.get(r).sort(r===\"done\"?(d,f)=>(f.completedAt??0)-(d.completedAt??0):au),m=null;return r===\"today\"?m=`${c.length} left`:r===\"none\"?m=`${c.length} to schedule`:r===\"done\"&&(m=`Kept for ${l} days`),(0,M.jsxs)(\"section\",{className:`group ${r}`,children:[(0,M.jsxs)(\"h2\",{className:\"group-head\",children:[(0,M.jsx)(\"span\",{children:PS[r]}),r===\"overdue\"?(0,M.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:o,children:\"Move all to today\"}):m&&(0,M.jsx)(\"small\",{children:m})]}),(0,M.jsx)(\"ul\",{className:\"item-list card\",children:c.map(d=>(0,M.jsx)($f,{item:d,now:t,terms:a,onOpen:i},d.id))})]},r)})})}function lT({items:e,now:t,filter:n,onFilter:a,terms:l,onOpen:i,onSetDate:o}){let u={all:e.filter(d=>!d.done).length,reminder:e.filter(d=>!d.done&&d.type===\"reminder\").length,todo:e.filter(d=>!d.done&&d.type===\"todo\").length,done:e.filter(d=>d.done).length},r=e.filter(d=>n===\"all\"?!0:n===\"done\"?d.done:d.type===n&&!d.done).sort((d,f)=>f.createdAt-d.createdAt),c=new Map;for(let d of r){let f=pe(new Date(d.createdAt));c.set(f,[...c.get(f)??[],d])}let m=d=>{let f=$a(en(d),t);return f===0?\"Today\":f===-1?\"Yesterday\":Jn(en(d))};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(zn,{label:\"Show\",value:n,onChange:a,className:\"filters\",options:[{id:\"all\",label:(0,M.jsxs)(M.Fragment,{children:[\"All \",(0,M.jsx)(\"span\",{className:\"count\",children:u.all})]})},{id:\"reminder\",label:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{name:\"bell\",size:14}),\" Reminders \",(0,M.jsx)(\"span\",{className:\"count\",children:u.reminder})]})},{id:\"todo\",label:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{name:\"check2\",size:14}),\" To-dos \",(0,M.jsx)(\"span\",{className:\"count\",children:u.todo})]})},{id:\"done\",label:(0,M.jsxs)(M.Fragment,{children:[\"Done \",(0,M.jsx)(\"span\",{className:\"count\",children:u.done})]})}]}),!r.length&&(0,M.jsx)(\"p\",{className:\"muted padded\",children:\"Nothing here.\"}),[...c].map(([d,f])=>(0,M.jsxs)(\"section\",{className:\"group\",children:[(0,M.jsxs)(\"h2\",{className:\"group-head\",children:[(0,M.jsx)(\"span\",{children:m(d)}),(0,M.jsxs)(\"small\",{children:[f.length,\" added\"]})]}),(0,M.jsx)(\"ul\",{className:\"item-list card\",children:f.map(s=>(0,M.jsx)($f,{item:s,now:t,terms:l,onOpen:i,mode:\"added\",onSetDate:()=>o(s)},s.id))})]},d))]})}function $f({item:e,now:t,terms:n,onOpen:a,mode:l=\"due\",onSetDate:i}){return(0,M.jsx)(tl,{item:e,now:t,mode:l,onOpen:()=>a(e.id),onSetDate:i,trailing:n.length&&e.link?(0,M.jsx)(\"span\",{className:\"match\",children:(0,M.jsx)(ou,{text:e.link.subject,terms:n})}):void 0})}var Uy=Y(Ke(),1);var L=Y(P(),1);function Hy(){let{back:e,navigate:t}=I(),{items:n,loading:a,complete:l,save:i,remove:o}=Se(),u=Ee(),{settings:r}=yt(),{show:c}=qe(),m=Ve(),d=Le(),[f,s]=(0,Uy.useState)(!1),h=Qi(),y=n.find(O=>O.id===h.id);if(!y)return(0,L.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,L.jsx)(bn,{title:\"Item\"}),(0,L.jsx)(\"div\",{className:\"screen\",children:a?null:(0,L.jsx)(kt,{title:\"This item is gone\",icon:\"check2\",children:(0,L.jsxs)(\"p\",{children:[\"It was deleted, or removed after being done for \",r.keepDoneDays,\" days.\"]})})})]});let S=u.byId(y.accountId),p=y.type===\"reminder\",g=Ol(y,d)===\"overdue\",v=()=>t({screen:\"add\",params:{type:y.type,itemId:y.id}}),x=async()=>{let O=y;await l(y,!y.done);let ne=!y.done&&p&&y.repeat!==\"never\";c({text:y.done?\"Marked not done\":ne?\"Done. Next one scheduled\":\"Marked done\",undo:()=>i(O)})},w=async O=>{s(!1);let ne=y;await i({...y,dueDate:pe(O),dueTime:ut(O),returned:!1}),c({text:`Snoozed to ${$n({dueDate:pe(O),dueTime:ut(O)},d)}`,undo:()=>i(ne)})},U=async()=>{let O=y;e(),await o(y.id),c({text:p?\"Reminder deleted\":\"To-do deleted\",undo:()=>i(O)})},C=(O=!1)=>{y.link?.threadId&&(O&&(cu.threadId=y.link.threadId),m.email(y.link.threadId,y.accountId))},D=vt(d),Q=[{label:\"In 1 hour\",date:new Date(Math.ceil((d.getTime()+36e5)/3e5)*3e5)},{label:`Tomorrow ${Ct(r.defaultReminderTime).replace(\":00\",\"\")}`,date:ot(_e(D,1),r.defaultReminderTime)},{label:\"Next week\",date:ot(_e(D,(8-D.getDay())%7||7),r.defaultReminderTime)}];return(0,L.jsxs)(\"div\",{className:\"screen-frame item-screen\",children:[(0,L.jsxs)(bn,{title:(0,L.jsxs)(\"span\",{className:`type-label ${y.type}`,children:[(0,L.jsx)(E,{name:p?\"bell\":\"check2\",size:16}),\" \",p?\"Reminder\":\"To-do\"]}),children:[(0,L.jsx)(te,{icon:\"pencil\",label:\"Edit\",onClick:v}),(0,L.jsx)(te,{icon:\"trash\",label:\"Delete\",onClick:()=>{U()}})]}),(0,L.jsxs)(Xe,{className:\"screen\",children:[(0,L.jsxs)(\"div\",{className:\"item-hero\",children:[(0,L.jsx)(fu,{item:y,large:!0,onToggle:()=>{x()}}),(0,L.jsx)(\"h1\",{className:y.done?\"is-done\":void 0,children:y.title||\"Untitled\"})]}),(0,L.jsxs)(\"dl\",{className:\"card detail-rows\",children:[(0,L.jsxs)(Hl,{icon:p?\"bell\":\"calendar\",label:\"When\",children:[(0,L.jsx)(\"span\",{className:g?\"danger\":void 0,children:y.dueDate?$n(y,d):\"No date yet\"}),(0,L.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:v,children:y.dueDate?\"Change\":\"Set date\"})]}),p&&(0,L.jsx)(Hl,{icon:\"repeat\",label:\"Repeat\",children:nu[y.repeat]}),p&&y.link&&(0,L.jsx)(Hl,{icon:\"inbox\",label:\"Bring email back\",children:y.bringBack?\"On\":\"Off\"}),y.priority===\"high\"&&(0,L.jsx)(Hl,{icon:\"flag\",label:\"Priority\",children:\"High\"}),(0,L.jsx)(Hl,{icon:\"user\",label:\"Account\",children:S?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ze,{color:S.color}),\" \",S.name,\" \",(0,L.jsx)(\"small\",{className:\"muted\",children:S.email})]}):\"Unknown account\"}),(0,L.jsx)(Hl,{icon:\"pencil\",label:\"Added by you\",children:cc(y.createdAt,d)}),y.note&&(0,L.jsx)(Hl,{icon:\"note\",label:\"Note\",children:(0,L.jsx)(\"span\",{className:\"note-text\",children:y.note})})]}),y.link&&(0,L.jsxs)(\"section\",{\"aria-label\":\"From this email\",children:[(0,L.jsx)(\"h2\",{className:\"section-label\",children:\"From this email\"}),y.link.deleted||!y.link.threadId?(0,L.jsxs)(\"div\",{className:\"card email-card gone\",children:[(0,L.jsx)(E,{name:\"trash\"}),(0,L.jsxs)(\"span\",{children:[(0,L.jsx)(\"strong\",{children:\"Email deleted\"}),(0,L.jsx)(\"small\",{children:y.link.subject})]})]}):(0,L.jsxs)(\"button\",{type:\"button\",className:\"card email-card\",onClick:()=>C(),children:[(0,L.jsx)(Wa,{name:y.link.sender,size:40}),(0,L.jsxs)(\"span\",{children:[(0,L.jsx)(\"strong\",{children:Pa(y.link.sender)}),(0,L.jsx)(\"span\",{className:\"email-subject\",children:y.link.subject}),(0,L.jsx)(\"small\",{children:y.link.snippet})]}),(0,L.jsx)(E,{name:\"right\"})]}),y.link.threadId&&!y.link.deleted&&(0,L.jsx)(\"p\",{className:\"hint\",children:\"If the email was archived, this opens it from All mail.\"})]}),f&&(0,L.jsxs)(\"div\",{className:\"chips snooze-chips\",role:\"group\",\"aria-label\":\"Snooze until\",children:[Q.map(O=>(0,L.jsx)(\"button\",{type:\"button\",className:\"chip\",onClick:()=>{w(O.date)},children:O.label},O.label)),(0,L.jsx)(\"button\",{type:\"button\",className:\"chip\",onClick:v,children:\"Pick\\u2026\"})]})]}),(0,L.jsxs)(\"footer\",{className:\"action-bar\",children:[y.link?.threadId&&!y.link.deleted&&(0,L.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>C(!0),children:[(0,L.jsx)(E,{name:\"reply\"}),\" Reply\"]}),!y.done&&(0,L.jsxs)(\"button\",{type:\"button\",className:\"secondary\",\"aria-expanded\":f,onClick:()=>s(!f),children:[(0,L.jsx)(E,{name:\"clock\"}),\" Snooze\"]}),(0,L.jsxs)(\"button\",{type:\"button\",className:y.done?\"secondary\":\"accent\",onClick:()=>{x()},children:[(0,L.jsx)(E,{name:y.done?\"back\":\"check\"}),\" \",y.done?\"Undo\":\"Mark done\"]})]})]})}function Hl({icon:e,label:t,children:n}){return(0,L.jsxs)(\"div\",{className:\"detail-row\",children:[(0,L.jsxs)(\"dt\",{children:[(0,L.jsx)(E,{name:e,size:18}),\" \",t]}),(0,L.jsx)(\"dd\",{children:n})]})}var Bl=Y(Ke(),1);var _=Y(P(),1);function iT(e){let t=vt(e),n=[],a=ot(t,\"18:00\");a.getTime()-e.getTime()>30*6e4&&n.push({id:\"evening\",label:\"Later today\",date:a,detail:Dn(a,e)});let l=ot(_e(t,1),\"08:00\");n.push({id:\"tomorrow\",label:\"Tomorrow\",date:l,detail:Dn(l,e)});let i=ot(_e(t,(8-t.getDay())%7||7),\"08:00\");return n.push({id:\"week\",label:\"Next week\",date:i,detail:Dn(i,e)}),n}function Ff(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n?.subject==\"string\").slice(0,100):[]}catch{return[]}}function oT(){let e=xe(\"archive\",\"conversation\",j),t=xe(\"archive\",\"threads\",j),n=xe(\"archiveSelected\",null,j);return(a,l)=>a===\"conversation\"?e(null):a===\"row\"&&l[0]?.threadId?t(l[0].threadId):a===\"selected\"?n(null):Promise.resolve(null)}function By(){let{saveMany:e,removeMany:t}=Se(),{back:n,navigate:a}=I(),{show:l}=qe(),i=oT();return async(o,u,r,c=[])=>{try{await e(o)}catch{return l({text:\"Couldn't save. Try again.\"}),!1}n();let m=r?await i(r,c).catch(()=>({outcome:\"failed\"})):null,d=m?.outcome===\"observed\";return l({text:m!==null&&!d?`${u}. Gmail didn't archive the email, so it's still in the inbox.`:u,undo:async()=>{await t(o.map(s=>s.id)),d&&l({text:\"Item removed. The email is in All mail.\"})},view:o.length===1?()=>a({screen:\"item\",params:{id:o[0].id}}):()=>a({screen:\"todo\",mode:\"root\"})}),!0}}function uT(e,t,n,a,l,i){let o={type:e,title:n.length===1?Wn(n[0].subject):\"\",note:\"\",preset:\"\",picked:\"\",repeat:\"never\",bringBack:!0,due:\"today\",pickedDate:pe(_e(i,1)),notify:!1,time:l,priority:\"normal\",archive:a};if(!t)return o;let u=t.dueDate??\"\",r=t.dueDate&&t.dueTime?`${t.dueDate}T${t.dueTime}`:\"\";return{...o,type:t.type,title:t.title,note:t.note,repeat:t.repeat,bringBack:t.bringBack,priority:t.priority,preset:t.type===\"reminder\"&&r?\"pick\":\"\",picked:r,due:t.dueDate?\"pick\":\"none\",pickedDate:u||o.pickedDate,notify:t.type===\"todo\"&&!!t.dueTime,time:t.dueTime??l,archive:!1}}function Ly(){let{screen:e,back:t}=I(),n=e?.params??{},a=Le(),{items:l}=Se(),i=Ee(),{settings:o}=yt(),u=By(),r=n.itemId?l.find(H=>H.id===n.itemId):void 0,c=(0,Bl.useMemo)(()=>r?.link?[{...r.link,accountId:r.accountId}]:Ff(n.emails),[r,n.emails]),m=n.type===\"snooze\"?\"snooze\":null,[d,f]=(0,Bl.useState)(()=>uT(n.type===\"todo\"?\"todo\":\"reminder\",r,c,o.archiveAfterAdding,o.defaultReminderTime,a)),s=H=>f(_t=>({..._t,...H})),[h,y]=(0,Bl.useState)(!1),S=ry(o.defaultReminderTime,a),p=d.preset||(S.find(H=>H.id===\"later\")??S.find(H=>H.id===\"tomorrow\")??S[0]).id,g=`${pe(a)}T${ut(a)}`,v=p===\"pick\"?d.picked?new Date(d.picked):null:S.find(H=>H.id===p)?.date??null,x=v!==null&&v>a,w=c[0]?i.byId(c[0].accountId):i.current,U=w?.id??i.current?.id??\"unknown\",C=c.length===1?Vi(l,c[0].threadId).filter(H=>H.id!==r?.id).length:0,D=c.length>1,Q=sy(d.due,d.due===\"pick\"?d.pickedDate:null,a),O=d.notify&&!Q?pe(a):Q,ne=!d.notify||ot(en(O),d.time)>a;if(m===\"snooze\")return(0,_.jsx)(cT,{emails:c,archive:n.archive});let Ne=()=>t(),he=()=>s({type:d.type===\"reminder\"?\"todo\":\"reminder\"});async function K(){if(h)return;let H=d.type===\"reminder\";if(H&&!x||!H&&!ne)return;y(!0);let _t=H?{type:\"reminder\",dueDate:pe(v),dueTime:ut(v),notify:!0,repeat:d.repeat,bringBack:d.bringBack,priority:d.priority}:{type:\"todo\",dueDate:O,dueTime:d.notify?d.time:null,notify:d.notify,repeat:\"never\",bringBack:!1,priority:d.priority},J=d.note.trim().slice(0,2e3),k=(c.length?c:[null]).map(Pn=>{let Ki=(D?Wn(Pn.subject):d.title.trim())||(Pn?Wn(Pn.subject):\"\");return r?{...r,..._t,title:Ki,note:J,returned:!1}:_l(_t.type,Pn,U,{..._t,title:Ki,note:J})}).filter(Pn=>Pn.title);if(!k.length){y(!1);return}let ue=$n(k[0]),Nt=r?\"Saved\":H?D?`${k.length} reminders set \\xB7 ${ue}`:`Reminder set \\xB7 ${ue}`:D?`${k.length} to-dos added`:\"Added to to-do\",Gl=!r&&!H&&d.archive?n.archive:void 0;await u(k,Nt,Gl,c)||y(!1)}let q=d.type===\"reminder\",ln=r?q?\"Edit reminder\":\"Edit to-do\":q?D?`Add ${c.length} reminders`:\"Add a reminder\":D?`Add ${c.length} to-dos`:\"Add to to-do\",Cn=q?`Save reminder${x?` \\xB7 ${$n({dueDate:pe(v),dueTime:ut(v)},a)}`:\"\"}`:r?\"Save to-do\":D?`Add ${c.length} to to-do`:\"Add to to-do\";return(0,_.jsxs)(lu,{title:ln,icon:q?\"bell\":\"check2\",tone:q?\"reminder\":\"todo\",onClose:Ne,footer:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(\"button\",{type:\"button\",className:q?\"primary block\":\"accent block\",disabled:h||(q?!x:!ne),onClick:()=>{K()},children:h?\"Saving\\u2026\":Cn}),(0,_.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:he,children:q?\"Make it a to-do instead\":\"Make it a reminder instead\"})]}),children:[D?(0,_.jsx)(\"p\",{className:\"sheet-lead\",children:\"Each email becomes its own item, linked to its email. Titles come from the subjects.\"}):(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:q?\"Remind me to\":\"Task\"}),(0,_.jsx)(\"input\",{value:d.title,autoFocus:!r,maxLength:200,placeholder:q?\"What should we remind you of?\":\"What needs doing?\",onChange:H=>s({title:H.target.value}),enterKeyHint:\"done\"})]}),!q&&!D&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsxs)(\"span\",{children:[\"Note \",(0,_.jsx)(\"small\",{children:\"optional\"})]}),(0,_.jsx)(\"textarea\",{rows:2,value:d.note,maxLength:2e3,placeholder:\"Add details\",onChange:H=>s({note:H.target.value})})]}),c.length>0&&(0,_.jsxs)(\"div\",{className:\"linked-card\",children:[w&&(0,_.jsx)(Ze,{color:w.color,label:w.name}),(0,_.jsxs)(\"span\",{children:[(0,_.jsx)(\"strong\",{children:\"Linked:\"}),\" \",D?`${c.length} emails`:`${Pa(c[0].sender)} \\xB7 ${c[0].subject}`]})]}),C>0&&(0,_.jsxs)(\"p\",{className:\"hint\",children:[(0,_.jsx)(E,{name:\"check\",size:14}),\" \",C===1?\"1 item\":`${C} items`,\" already linked to this email\"]}),q?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(\"h3\",{className:\"section-label\",children:\"When\"}),(0,_.jsxs)(\"div\",{className:\"preset-grid\",role:\"radiogroup\",\"aria-label\":\"When\",children:[S.map(H=>(0,_.jsxs)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":p===H.id,className:\"preset\",onClick:()=>s({preset:H.id}),children:[(0,_.jsx)(\"strong\",{children:H.label}),(0,_.jsx)(\"span\",{children:H.detail})]},H.id)),(0,_.jsxs)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":p===\"pick\",className:\"preset\",onClick:()=>s({preset:\"pick\",picked:d.picked||`${pe(_e(a,1))}T${o.defaultReminderTime}`}),children:[(0,_.jsx)(\"strong\",{children:\"Pick date & time\"}),(0,_.jsx)(\"span\",{children:p===\"pick\"&&v?Dn(v,a):\"Custom\"})]})]}),p===\"pick\"&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Date and time\"}),(0,_.jsx)(\"input\",{type:\"datetime-local\",min:g,value:d.picked,onChange:H=>s({picked:H.target.value})}),d.picked&&!x&&(0,_.jsx)(\"small\",{className:\"error-text\",children:\"Pick a time that hasn't passed.\"})]}),(0,_.jsxs)(\"label\",{className:\"select-row\",children:[(0,_.jsx)(E,{name:\"repeat\"}),(0,_.jsx)(\"span\",{children:\"Repeat\"}),(0,_.jsx)(\"select\",{value:d.repeat,onChange:H=>s({repeat:H.target.value}),children:Object.keys(nu).map(H=>(0,_.jsx)(\"option\",{value:H,children:nu[H]},H))})]}),c.length>0&&(0,_.jsx)(tn,{label:\"Bring email back to top of inbox\",detail:\"When the reminder is due\",checked:d.bringBack,onChange:H=>s({bringBack:H})})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(\"h3\",{className:\"section-label\",children:\"Due\"}),(0,_.jsx)(zn,{label:\"Due\",value:d.due,onChange:H=>s({due:H}),options:[{id:\"none\",label:\"No date\"},{id:\"today\",label:\"Today\"},{id:\"tomorrow\",label:\"Tomorrow\"},{id:\"week\",label:\"This week\"},{id:\"pick\",label:\"Pick date\"}]}),d.due===\"pick\"&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Due date\"}),(0,_.jsx)(\"input\",{type:\"date\",min:pe(a),value:d.pickedDate,onChange:H=>s({pickedDate:H.target.value})})]}),(0,_.jsx)(\"p\",{className:\"hint\",children:rT(d.due,Q,a)}),(0,_.jsx)(tn,{label:\"Add a time & notify me\",checked:d.notify,onChange:H=>s({notify:H})}),d.notify&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Time\"}),(0,_.jsx)(\"input\",{type:\"time\",value:d.time,onChange:H=>s({time:H.target.value})}),!ne&&(0,_.jsx)(\"small\",{className:\"error-text\",children:\"That time has passed today.\"})]}),(0,_.jsx)(\"h3\",{className:\"section-label\",children:\"Priority\"}),(0,_.jsx)(zn,{label:\"Priority\",value:d.priority,onChange:H=>s({priority:H}),options:[{id:\"normal\",label:\"Normal\"},{id:\"high\",label:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(E,{name:\"flag\",size:14}),\" High\"]}),tone:\"high\"}]}),!r&&c.length>0&&n.archive&&(0,_.jsx)(tn,{label:D?\"Archive emails after adding\":\"Archive email after adding\",checked:d.archive,onChange:H=>s({archive:H})})]})]})}function rT(e,t,n){if(e===\"none\"||!t)return\"Goes to No date yet. You'll be nudged to schedule it.\";let a=en(t),l=Math.round((vt(a).getTime()-vt(n).getTime())/864e5),i=l===0?\"Today\":l===1?\"Tomorrow\":l<7?\"This week\":\"Later\";return`Due by ${Jn(a).replace(\",\",\"\")}. Shows in ${i}.`}function cT({emails:e,archive:t}){let{back:n}=I(),a=Le(),l=Ee(),i=By(),[o,u]=(0,Bl.useState)(\"\"),[r,c]=(0,Bl.useState)(!1),m=iT(a),d=e[0]?.accountId??l.current?.id??\"unknown\";async function f(h){if(r||h<=a||!e.length)return;c(!0);let y=e.map(p=>_l(\"reminder\",p,d,{title:Wn(p.subject),dueDate:pe(h),dueTime:ut(h),bringBack:!0,snooze:!0}));await i(y,`Snoozed until ${Dn(h,a)}`,t,e)||c(!1)}let s=o?new Date(o):null;return(0,_.jsxs)(lu,{title:e.length>1?`Snooze ${e.length} emails`:\"Snooze until\",icon:\"clock\",tone:\"neutral\",onClose:n,children:[(0,_.jsx)(\"p\",{className:\"sheet-lead\",children:\"The email leaves your inbox now and comes back to the top at this time.\"}),(0,_.jsx)(\"ul\",{className:\"option-list\",children:m.map(h=>(0,_.jsx)(\"li\",{children:(0,_.jsxs)(\"button\",{type:\"button\",className:\"option\",disabled:r,onClick:()=>{f(h.date)},children:[(0,_.jsx)(E,{name:\"clock\"}),(0,_.jsx)(\"span\",{children:h.label}),(0,_.jsx)(\"small\",{children:h.detail})]})},h.id))}),(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Pick date & time\"}),(0,_.jsx)(\"input\",{type:\"datetime-local\",min:`${pe(a)}T${ut(a)}`,value:o,onChange:h=>u(h.target.value)})]}),(0,_.jsx)(\"button\",{type:\"button\",className:\"primary block\",disabled:r||!s||s<=a,onClick:()=>s&&void f(s),children:s&&s>a?`Snooze until ${Dn(s,a)}`:\"Snooze\"}),(0,_.jsx)(\"p\",{className:\"hint\",children:\"Gmail's mobile web has no snooze, so Gmail Only archives the email and keeps the time. Snoozed emails are listed in the menu.\"})]})}var an=Y(P(),1);function Gy(){let{screen:e,back:t,navigate:n}=I(),a=e?.params.emails,l=Ff(a),i=u=>n({screen:\"add\",mode:\"replace\",params:{type:u,emails:a??\"[]\",archive:\"selected\"}}),o=(u,r,c,m,d)=>(0,an.jsx)(\"li\",{children:(0,an.jsxs)(\"button\",{type:\"button\",className:\"add-option\",onClick:()=>i(u),children:[(0,an.jsx)(\"span\",{className:`tile ${c}`,children:(0,an.jsx)(E,{name:r})}),(0,an.jsxs)(\"span\",{children:[(0,an.jsx)(\"strong\",{children:m}),(0,an.jsx)(\"small\",{children:d})]}),(0,an.jsx)(E,{name:\"right\"})]})});return(0,an.jsx)(lu,{title:`Save ${l.length} ${l.length===1?\"email\":\"emails\"} for later`,icon:\"bell\",tone:\"neutral\",onClose:t,children:l.length?(0,an.jsxs)(\"ul\",{className:\"option-list\",children:[o(\"reminder\",\"bell\",\"reminder\",\"Add reminders\",\"One per email, all at the same time\"),o(\"todo\",\"check2\",\"todo\",\"Add to to-do\",\"One task per email; archive them if you like\"),o(\"snooze\",\"clock\",\"neutral\",\"Snooze\",\"Archive now, back at the top later\")]}):(0,an.jsx)(\"p\",{className:\"sheet-lead\",children:\"Nothing is selected.\"})})}var qy=Y(Ke(),1);var De=Y(P(),1),sT=[{label:\"Unread\",query:\"is:unread\"},{label:\"Starred\",query:\"is:starred\"},{label:\"Has attachment\",query:\"has:attachment\"},{label:\"Last 7 days\",query:\"newer_than:7d\"}];function Yy(){let{back:e}=I(),t=Ve(),{settings:n,update:a}=yt(),{items:l}=Se(),i=el(),o=Le(),u=Qi(),[r,c]=(0,qy.useState)(u.q??\"\"),m=s=>{let h=s.trim();h&&(a({recentSearches:[h,...n.recentSearches.filter(y=>y!==h)].slice(0,8)}),t.search(h))},d=r.toLowerCase().split(/\\s+/).filter(s=>s.length>1&&!s.includes(\":\")),f=d.length?l.filter(s=>!s.snooze&&d.every(h=>`${s.title} ${s.note} ${s.link?.subject??\"\"} ${s.link?.sender??\"\"}`.toLowerCase().includes(h))).slice(0,5):[];return(0,De.jsxs)(\"div\",{className:\"screen-frame search-screen\",children:[(0,De.jsx)(\"header\",{className:\"mail-header\",children:(0,De.jsxs)(\"form\",{className:\"search-pill\",role:\"search\",onSubmit:s=>{s.preventDefault(),m(r)},children:[(0,De.jsx)(te,{icon:\"back\",label:\"Back\",onClick:e}),(0,De.jsx)(\"input\",{type:\"search\",autoFocus:!0,enterKeyHint:\"search\",placeholder:\"Search in mail\",\"aria-label\":\"Search in mail\",value:r,onChange:s=>c(s.target.value)}),r&&(0,De.jsx)(te,{icon:\"close\",label:\"Clear\",onClick:()=>c(\"\")})]})}),(0,De.jsxs)(Xe,{className:\"screen\",children:[(0,De.jsx)(\"nav\",{className:\"filter-chips\",\"aria-label\":\"Search for\",children:sT.map(s=>(0,De.jsx)(\"button\",{type:\"button\",className:\"filter-chip\",onClick:()=>m(r?`${r} ${s.query}`:s.query),children:s.label},s.query))}),f.length>0&&(0,De.jsxs)(\"section\",{children:[(0,De.jsx)(\"h2\",{className:\"section-label\",children:\"In your to-do\"}),(0,De.jsx)(\"ul\",{className:\"item-list card\",children:f.map(s=>(0,De.jsx)(tl,{item:s,now:o,onOpen:()=>i(s.id)},s.id))})]}),n.recentSearches.length>0&&(0,De.jsxs)(\"section\",{children:[(0,De.jsxs)(\"h2\",{className:\"section-label with-action\",children:[(0,De.jsx)(\"span\",{children:\"Recent\"}),(0,De.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:()=>{a({recentSearches:[]})},children:\"Clear\"})]}),(0,De.jsx)(\"ul\",{className:\"plain-list card\",children:n.recentSearches.map(s=>(0,De.jsx)(\"li\",{children:(0,De.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>m(s),children:[(0,De.jsx)(E,{name:\"clock\"}),(0,De.jsx)(\"span\",{children:s}),(0,De.jsx)(E,{name:\"up\"})]})},s))})]}),r.trim()&&(0,De.jsxs)(\"button\",{type:\"button\",className:\"accent block padded-x\",onClick:()=>m(r),children:[(0,De.jsx)(E,{name:\"search\"}),\" Search for \\u201C\",r.trim(),\"\\u201D\"]})]})]})}var G=Y(P(),1);function jy(){let{settings:e,update:t}=yt(),{accounts:n}=Ee(),{navigate:a,viewWebsite:l}=I(),i=u=>{t(u)},o=[{id:\"remind\",label:\"Remind\"},{id:\"archive\",label:\"Archive\"},{id:\"none\",label:\"Off\"}];return(0,G.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,G.jsx)(bn,{title:\"Settings\"}),(0,G.jsxs)(Xe,{className:\"screen settings\",children:[(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Reminders & to-dos\"}),(0,G.jsxs)(\"div\",{className:\"card\",children:[(0,G.jsx)(tn,{label:\"Show Add to\\u2026 on emails\",detail:\"The pill above every open email\",checked:e.showAddTo,onChange:u=>i({showAddTo:u})}),(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsx)(\"span\",{children:\"Default sort\"}),(0,G.jsx)(zn,{label:\"Default sort\",value:e.defaultSort,onChange:u=>i({defaultSort:u}),options:[{id:\"due\",label:\"When it's due\"},{id:\"added\",label:\"When I added it\"}]})]}),(0,G.jsxs)(\"label\",{className:\"setting-row\",children:[(0,G.jsxs)(\"span\",{children:[\"Default reminder time\",(0,G.jsx)(\"small\",{children:\"Used by Tomorrow and Next week\"})]}),(0,G.jsx)(\"input\",{type:\"time\",value:e.defaultReminderTime,onChange:u=>u.target.value&&i({defaultReminderTime:u.target.value})})]}),(0,G.jsx)(tn,{label:\"Morning summary\",detail:e.morningSummary?`Today's card at ${Ct(e.morningSummary)}`:\"Off\",checked:e.morningSummary!==null,onChange:u=>i({morningSummary:u?\"08:00\":null})}),e.morningSummary!==null&&(0,G.jsxs)(\"label\",{className:\"setting-row nested\",children:[(0,G.jsx)(\"span\",{children:\"Summary time\"}),(0,G.jsx)(\"input\",{type:\"time\",value:e.morningSummary,onChange:u=>u.target.value&&i({morningSummary:u.target.value})})]}),(0,G.jsx)(tn,{label:\"Archive email after adding to to-do\",checked:e.archiveAfterAdding,onChange:u=>i({archiveAfterAdding:u})}),(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsx)(\"span\",{children:\"Keep done items\"}),(0,G.jsx)(zn,{label:\"Keep done items\",value:String(e.keepDoneDays),onChange:u=>i({keepDoneDays:Number(u)}),options:[{id:\"1\",label:\"1 day\"},{id:\"7\",label:\"7 days\"},{id:\"30\",label:\"30 days\"}]})]})]}),(0,G.jsx)(\"p\",{className:\"hint padded\",children:`Gmail Only shows what's due inside the app: the To-do badge, the Today card and \"Back in your inbox\". It doesn't send phone notifications.`}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Swipe on emails\"}),(0,G.jsxs)(\"div\",{className:\"card\",children:[(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(E,{name:\"right\",size:16}),\" Swipe right\"]}),(0,G.jsx)(zn,{label:\"Swipe right\",value:e.swipeRight,onChange:u=>i({swipeRight:u}),options:o})]}),(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(E,{name:\"back\",size:16}),\" Swipe left\"]}),(0,G.jsx)(zn,{label:\"Swipe left\",value:e.swipeLeft,onChange:u=>i({swipeLeft:u}),options:o})]})]}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Appearance\"}),(0,G.jsx)(\"div\",{className:\"card\",children:(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsx)(\"span\",{children:\"Theme\"}),(0,G.jsx)(zn,{label:\"Theme\",value:e.theme,onChange:u=>i({theme:u}),options:[{id:\"system\",label:\"System\"},{id:\"light\",label:\"Light\"},{id:\"dark\",label:\"Dark\"}]})]})}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Accounts\"}),(0,G.jsxs)(\"ul\",{className:\"plain-list card\",children:[n.map(u=>(0,G.jsx)(\"li\",{children:(0,G.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>a({screen:\"account-setup\",params:{id:u.id}}),children:[(0,G.jsx)(Ze,{color:u.color}),(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(\"strong\",{children:u.name}),(0,G.jsx)(\"small\",{children:u.email})]}),(0,G.jsx)(E,{name:\"right\"})]})},u.id)),(0,G.jsx)(\"li\",{children:(0,G.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>a({screen:\"accounts\"}),children:[(0,G.jsx)(E,{name:\"user\"}),(0,G.jsx)(\"span\",{children:\"Manage accounts\"}),(0,G.jsx)(E,{name:\"right\"})]})})]}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Gmail\"}),(0,G.jsx)(\"ul\",{className:\"plain-list card\",children:(0,G.jsx)(\"li\",{children:(0,G.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>l(),children:[(0,G.jsx)(E,{name:\"mail\"}),(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(\"strong\",{children:\"Open Gmail itself\"}),(0,G.jsx)(\"small\",{children:\"For anything Gmail Only doesn't draw\"})]}),(0,G.jsx)(E,{name:\"external\"})]})})})]})]})}var ct=Y(P(),1);function Xy(){let{accounts:e,current:t}=Ee(),{items:n}=Se(),{navigate:a}=I(),l=Ve(),i=Le(),o=c=>n.filter(m=>m.accountId===c.id&&Fa(m,i)).length,u=c=>{c.id!==t?.id&&l.inboxOf(c)},r=()=>{let c=e.reduce((d,f)=>Math.max(d,f.sessionIndex),-1)+1,m=`${ji}/mail/u/${c}/`;a({url:`https://accounts.google.com/AddSession?continue=${encodeURIComponent(m)}`,context:\"primary\"})};return(0,ct.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,ct.jsx)(bn,{title:\"Accounts\"}),(0,ct.jsxs)(Xe,{className:\"screen\",children:[(0,ct.jsxs)(\"ul\",{className:\"plain-list card\",children:[e.map(c=>{let m=c.id===t?.id,d=o(c);return(0,ct.jsxs)(\"li\",{className:\"account-row\",children:[(0,ct.jsxs)(\"button\",{type:\"button\",className:\"list-button\",\"aria-current\":m?\"true\":void 0,disabled:!!0&&!m,onClick:()=>u(c),children:[(0,ct.jsx)(Ze,{color:c.color}),(0,ct.jsxs)(\"span\",{children:[(0,ct.jsx)(\"strong\",{children:c.name}),(0,ct.jsxs)(\"small\",{children:[c.email,d?` \\xB7 ${d} due`:\"\"]})]}),m&&(0,ct.jsx)(E,{name:\"check\"})]}),(0,ct.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:()=>a({screen:\"account-setup\",params:{id:c.id}}),children:\"Edit\"})]},c.id)}),!e.length&&(0,ct.jsx)(\"li\",{className:\"muted padded\",children:\"Gmail Only records your account once Gmail shows it.\"})]}),(0,ct.jsxs)(\"button\",{type:\"button\",className:\"secondary block padded-x\",onClick:r,children:[(0,ct.jsx)(E,{name:\"plus\"}),\" Add another account\"]})]})]})}var Ll=Y(Ke(),1);var Ue=Y(P(),1);function Vy(){let{back:e}=I(),{byId:t,save:n}=Ee(),{show:a}=qe(),l=t(Qi().id??\"\"),[i,o]=(0,Ll.useState)(l?.name??\"\"),[u,r]=(0,Ll.useState)(l?.color??Cl[0]),[c,m]=(0,Ll.useState)(l?.showInInbox??!0),[d,f]=(0,Ll.useState)(l?.showInTodo??!0);if((0,Ll.useEffect)(()=>{l&&(o(l.name),r(l.color),m(l.showInInbox),f(l.showInTodo))},[l?.id]),!l)return(0,Ue.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,Ue.jsx)(bn,{title:\"Account\"}),(0,Ue.jsx)(\"div\",{className:\"screen\"})]});let s=async()=>{try{await n({...l,name:i.trim()||l.name,color:u,showInInbox:c,showInTodo:d}),e(),a({text:\"Account saved\"})}catch{a({text:\"Couldn't save. Try again.\"})}};return(0,Ue.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,Ue.jsx)(bn,{title:\"Set up account\"}),(0,Ue.jsxs)(Xe,{className:\"screen\",children:[(0,Ue.jsxs)(\"div\",{className:\"account-preview\",style:{\"--account\":u},children:[(0,Ue.jsx)(\"span\",{className:\"account-badge\",children:(i||l.email)[0]?.toUpperCase()}),(0,Ue.jsx)(\"strong\",{children:i||l.name}),(0,Ue.jsx)(\"small\",{children:l.email})]}),(0,Ue.jsxs)(\"label\",{className:\"field padded-x\",children:[(0,Ue.jsx)(\"span\",{children:\"Name\"}),(0,Ue.jsx)(\"input\",{value:i,maxLength:40,placeholder:\"Personal, Work\\u2026\",onChange:h=>o(h.target.value)})]}),(0,Ue.jsx)(\"h2\",{className:\"section-label\",children:\"Color\"}),(0,Ue.jsx)(\"div\",{className:\"swatches\",role:\"radiogroup\",\"aria-label\":\"Color\",children:Cl.map((h,y)=>(0,Ue.jsx)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":h===u,\"aria-label\":ty[y],className:\"swatch\",style:{background:h},onClick:()=>r(h),children:h===u&&(0,Ue.jsx)(E,{name:\"check\"})},h))}),(0,Ue.jsx)(\"p\",{className:\"hint padded\",children:\"The color marks this account's emails, reminders and to-dos.\"}),(0,Ue.jsxs)(\"div\",{className:\"card\",children:[(0,Ue.jsx)(tn,{label:\"Show in inbox\",checked:c,onChange:m}),(0,Ue.jsx)(tn,{label:\"Show in To-do\",checked:d,onChange:f})]}),(0,Ue.jsx)(\"p\",{className:\"hint padded\",children:\"Show in inbox puts this account's due items on the inbox's Today card. Show in To-do lists them under All accounts.\"})]}),(0,Ue.jsx)(\"footer\",{className:\"action-bar\",children:(0,Ue.jsx)(\"button\",{type:\"button\",className:\"accent block\",onClick:()=>{s()},children:\"Save\"})})]})}var bt=Y(P(),1);function Qy(){let{items:e,save:t,complete:n}=Se(),{show:a}=qe(),l=Ve(),i=Le(),o=e.filter(c=>c.snooze&&!c.done).sort(au),u=async c=>{await t({...c,dueDate:pe(i),dueTime:ut(i),returned:!1}),a({text:\"Back in your inbox\",undo:()=>t(c)})},r=async c=>{await n(c,!0),a({text:\"Snooze removed. The email stays in All mail.\",undo:()=>t(c)})};return(0,bt.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,bt.jsx)(bn,{title:\"Snoozed\"}),(0,bt.jsx)(Xe,{className:\"screen\",children:o.length?(0,bt.jsx)(\"ul\",{className:\"plain-list card\",children:o.map(c=>(0,bt.jsxs)(\"li\",{className:\"snooze-row\",children:[(0,bt.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>c.link?.threadId&&l.email(c.link.threadId,c.accountId),children:[(0,bt.jsx)(Wa,{name:c.link?.sender??c.title,size:36}),(0,bt.jsxs)(\"span\",{children:[(0,bt.jsx)(\"strong\",{children:c.link?.subject??c.title}),(0,bt.jsxs)(\"small\",{children:[Pa(c.link?.sender??\"\"),\" \\xB7 \",(0,bt.jsx)(E,{name:\"clock\",size:12}),\" \",$n(c,i)]})]})]}),(0,bt.jsx)(te,{icon:\"inbox\",label:\"Bring back now\",onClick:()=>{u(c)}}),(0,bt.jsx)(te,{icon:\"close\",label:\"Remove snooze\",onClick:()=>{r(c)}})]},c.id))}):(0,bt.jsx)(kt,{title:\"Nothing snoozed\",icon:\"clock\",children:(0,bt.jsx)(\"p\",{children:\"Snooze an email from its toolbar to hide it until later.\"})})})]})}var ge=Y(P(),1),Zy={mail:_y,todo:Ry,item:Hy,add:Ly,bulk:Gy,search:Yy,settings:jy,accounts:Xy,\"account-setup\":Vy,snoozed:Qy},dT=new Set([\"add\",\"bulk\"]),fT=10,mT=30;function Iy(){return(0,ge.jsx)(hy,{children:(0,ge.jsx)(by,{children:(0,ge.jsx)(hT,{})})})}function pT(e){return e&&{key:e.key,id:e.id,overlay:!0,params:e.params}}function gT(e){switch(e.kind){case\"list\":return`list:${e.list.path}`;case\"conversation\":return`cv:${e.threadId}`;case\"other\":return`other:${e.hash}`;default:return e.kind}}function hT(){let{screen:e,overlay:t,select:n,navigate:a,back:l}=I(),{view:i}=ru(),o=Ve(),{items:u}=Se(),{settings:r}=yt(),{toast:c}=qe(),m=Le(),d=hc(yn.id),f=Ee().current?.id??null,s=(0,Yt.useRef)(f);(0,Yt.useLayoutEffect)(()=>{f&&s.current&&f!==s.current&&Sy(),f&&(s.current=f)},[f]);let h=(0,Yt.useRef)(null);vy(),(0,Yt.useEffect)(()=>{r.theme===\"system\"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=r.theme},[r.theme]);let y=e&&dT.has(e.id)?e:null,S=e?.id===\"menu\",p=(0,Yt.useRef)(null);e&&!y&&!S&&(p.current=e);let g=y||S?p.current??pT(t[t.length-2])??{key:`${j}:base`,id:\"mail\",overlay:!1,params:{}}:e??{key:`${j}:base`,id:\"mail\",overlay:!1,params:{}},v=Zy[g.id],x=y?Zy[y.id]:void 0,w=g.id===\"todo\",U=g.id===\"mail\"&&i.kind===\"list\",C=!y&&(w||U),D=u.filter(q=>Fa(q,m)).length,Q=(0,Yt.useRef)(0),O=g.overlay?null:/:(\\d+)$/.exec(g.key);O&&(Q.current=Number(O[1]));let ne={id:g.id===\"mail\"?`${g.key}|${gT(i)}`:g.key,index:Q.current,depth:y||S?Math.max(0,t.length-1):t.length,tab:w||U,drawer:g.id===\"mail\"&&i.kind===\"menu\"},Ne=wy(ne);(0,Yt.useEffect)(()=>{S&&sc.count===0&&l()},[S,l]);let he=vT(y?.key??null),K=()=>{t.length&&i.kind===\"list\"?n(j):t.length?o.inbox(\"replace\"):i.kind===\"list\"&&i.list.id===yn.id?document.querySelector(\".stage .screen\")?.scrollTo({top:0,behavior:\"smooth\"}):o.inbox()};return(0,ge.jsxs)(\"div\",{className:`app${C?\" has-tabs\":\"\"}${c?\" has-toast\":\"\"}`,children:[(0,ge.jsxs)(\"main\",{className:\"content\",children:[(0,ge.jsx)(Yf,{id:ne.id,motion:Ne,layer:h,zIndex:fT,inert:!!y,children:v&&(0,ge.jsx)(qf.Provider,{value:g.params,children:(0,ge.jsx)(v,{},g.key)})}),(0,ge.jsx)(Yf,{id:y?.key??null,motion:he,layer:h,zIndex:mT,children:x&&(0,ge.jsx)(x,{},y.key)}),(0,ge.jsx)(Ny,{layer:h})]}),C&&(0,ge.jsxs)(\"nav\",{className:\"tabs\",\"aria-label\":\"Sections\",children:[(0,ge.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":w?void 0:\"page\",onClick:K,children:[(0,ge.jsxs)(\"span\",{className:\"tab-icon\",children:[(0,ge.jsx)(E,{name:\"mail\",filled:!w}),d?(0,ge.jsx)(\"span\",{className:\"badge\",children:d>99?\"99+\":d},d):null]}),(0,ge.jsx)(\"span\",{children:\"Mail\"})]}),(0,ge.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":w?\"page\":void 0,onClick:()=>w?document.querySelector(\".stage .screen\")?.scrollTo({top:0,behavior:\"smooth\"}):a({screen:\"todo\",mode:\"root\"}),children:[(0,ge.jsxs)(\"span\",{className:\"tab-icon\",children:[(0,ge.jsx)(E,{name:\"todo\"}),D?(0,ge.jsx)(\"span\",{className:\"badge due\",children:D>99?\"99+\":D},D):null]}),(0,ge.jsx)(\"span\",{children:\"To-do\"})]})]}),(0,ge.jsx)(bT,{})]})}function vT(e){let t=(0,Yt.useRef)({key:e,motion:\"none\"});return t.current.key!==e&&(t.current={key:e,motion:e===null?\"sheet-close\":t.current.key?\"sheet-swap\":\"none\"}),t.current.motion}function yT(e,t){let n=()=>t({text:\"Couldn't undo. Try again.\"});try{let a=e();a&&a.then(void 0,n)}catch{n()}}function bT(){let{toast:e,clear:t,show:n}=qe(),[a,l]=(0,Yt.useState)(e?{toast:e,leaving:!1}:null);(0,Yt.useEffect)(()=>{if(e){l({toast:e,leaving:!1});return}l(u=>u&&{...u,leaving:!0});let o=window.setTimeout(()=>l(u=>u?.leaving?null:u),180);return()=>window.clearTimeout(o)},[e]);let i=a?.toast;return(0,ge.jsx)(\"div\",{className:\"toast-region\",role:\"status\",\"aria-live\":\"polite\",children:i&&(0,ge.jsxs)(\"div\",{className:`toast${a.leaving?\" leaving\":\"\"}`,children:[(0,ge.jsx)(\"span\",{children:i.text}),i.undo&&(0,ge.jsx)(\"button\",{type:\"button\",disabled:a.leaving,onClick:()=>{let o=i.undo;t(),yT(o,n)},children:\"Undo\"}),i.view&&(0,ge.jsx)(\"button\",{type:\"button\",disabled:a.leaving,onClick:()=>{let o=i.view;t(),o()},children:\"View\"})]},i.id)})}var Ky=Y(P(),1);I0((0,Ky.jsx)(Iy,{}));})();\n"},{"path":"index.html","encoding":"utf8","content":"\n\n\n\n\nGmail Only\n\n\n\n\n
\n\n\n\n"}]} \ No newline at end of file diff --git a/gmail-only/published/applet-gmail-only.release.json b/gmail-only/published/applet-gmail-only.release.json new file mode 100644 index 0000000..c4383ba --- /dev/null +++ b/gmail-only/published/applet-gmail-only.release.json @@ -0,0 +1,38 @@ +{ + "releaseFormat": 1, + "appletId": "gmail-only", + "name": "Gmail Only", + "version": "0.1.0", + "bundle": { + "file": "applet-gmail-only.bundle.json", + "sha256": "e9c94c854254f2b8f6a57b3807f69bd1238d53f5ca1fa9d29b6b7cca98966ff7", + "size": 444989 + }, + "compat": { + "manifestSchema": 6, + "bundleFormat": 3, + "protocol": 1, + "adapterApi": 1, + "sdk": "0.0.0", + "tools": "0.0.0", + "builtAt": "2026-11-09T11:21:15Z" + }, + "origins": [ + "https://mail.google.com" + ], + "capabilities": { + "storage": true, + "services": [] + }, + "toolchain": { + "genesisCommit": "655ce128bce13bd8a376a3630766fb18182ba928", + "node": "24.15.0", + "tools": "0.0.0", + "sdk": "0.0.0" + }, + "home": { + "fullName": "nirvanacp/applets", + "path": "gmail-only" + }, + "builtAt": "2026-11-09T11:21:15Z" +} From ef3c7b93f7bf8d4d3a76d1d4e13ef2614b690fef Mon Sep 17 00:00:00 2001 From: Rit Date: Mon, 9 Nov 2026 18:03:54 +0530 Subject: [PATCH 5/9] feat/(ci): run the Genesis check and release workflows only by hand Co-Authored-By: Claude Opus 5.5 --- .github/workflows/genesis-check.yml | 5 ++--- .github/workflows/genesis-release.yml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/genesis-check.yml b/.github/workflows/genesis-check.yml index 3366e8d..9c71c87 100644 --- a/.github/workflows/genesis-check.yml +++ b/.github/workflows/genesis-check.yml @@ -3,10 +3,9 @@ # unless the rebuild equals the committed published/ build. name: Genesis check +# Disabled until CI is set up for this repository: runs only when started by hand. on: - pull_request: - push: - branches: [main] + workflow_dispatch: permissions: contents: read diff --git a/.github/workflows/genesis-release.yml b/.github/workflows/genesis-release.yml index 130cb7a..a226fa5 100644 --- a/.github/workflows/genesis-release.yml +++ b/.github/workflows/genesis-release.yml @@ -4,9 +4,9 @@ # with the bundle, its release record and build provenance attestations. name: Genesis release +# Disabled until CI is set up for this repository: runs only when started by hand. on: - push: - tags: ['v*', '*/v*'] + workflow_dispatch: permissions: contents: read From 541b9d1d8efdc8b0987128fe6a47c12e84c7dce4 Mon Sep 17 00:00:00 2001 From: Rit Date: Mon, 9 Nov 2026 18:15:25 +0530 Subject: [PATCH 6/9] feat/(ci): pin the Genesis workflows that install their tools before verifying Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 2 +- .github/workflows/genesis-check.yml | 4 ++-- .github/workflows/genesis-release.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8280208..6048910 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,4 @@ -# From the Genesis factory template. +# From the Genesis factory template. Dependabot proposes updates to the pinned workflow shas, # including the Genesis reusable workflows; update genesis-ref to the same sha in each update. version: 2 updates: diff --git a/.github/workflows/genesis-check.yml b/.github/workflows/genesis-check.yml index 9c71c87..688d07f 100644 --- a/.github/workflows/genesis-check.yml +++ b/.github/workflows/genesis-check.yml @@ -12,6 +12,6 @@ permissions: jobs: check: - uses: nirvanacp/genesis/.github/workflows/applet-check.yml@655ce128bce13bd8a376a3630766fb18182ba928 + uses: nirvanacp/genesis/.github/workflows/applet-check.yml@6defec34ed43efe6bd92ee3e03b891c86269c3fc with: - genesis-ref: 655ce128bce13bd8a376a3630766fb18182ba928 + genesis-ref: 6defec34ed43efe6bd92ee3e03b891c86269c3fc diff --git a/.github/workflows/genesis-release.yml b/.github/workflows/genesis-release.yml index a226fa5..e5a1b1a 100644 --- a/.github/workflows/genesis-release.yml +++ b/.github/workflows/genesis-release.yml @@ -13,9 +13,9 @@ permissions: jobs: release: - uses: nirvanacp/genesis/.github/workflows/applet-release.yml@655ce128bce13bd8a376a3630766fb18182ba928 + uses: nirvanacp/genesis/.github/workflows/applet-release.yml@6defec34ed43efe6bd92ee3e03b891c86269c3fc with: - genesis-ref: 655ce128bce13bd8a376a3630766fb18182ba928 + genesis-ref: 6defec34ed43efe6bd92ee3e03b891c86269c3fc permissions: contents: write id-token: write From b0d78093c8f10262680ff7a70615a454f6930043 Mon Sep 17 00:00:00 2001 From: Rit Date: Mon, 9 Nov 2026 18:38:27 +0530 Subject: [PATCH 7/9] feat/(hn-bookmarks): reset the version to 0.0.0 and republish Co-Authored-By: Claude Opus 5.5 --- .../2026-11-09-183819-reset-version-0.0.0.md | 6 ++++++ hn-bookmarks/.specs/current.md | 2 +- hn-bookmarks/package.json | 2 +- hn-bookmarks/published/applet-hn-bookmarks.bundle.json | 2 +- .../published/applet-hn-bookmarks.release.json | 10 +++++----- 5 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 hn-bookmarks/.changelog/2026-11-09-183819-reset-version-0.0.0.md diff --git a/hn-bookmarks/.changelog/2026-11-09-183819-reset-version-0.0.0.md b/hn-bookmarks/.changelog/2026-11-09-183819-reset-version-0.0.0.md new file mode 100644 index 0000000..cb97f74 --- /dev/null +++ b/hn-bookmarks/.changelog/2026-11-09-183819-reset-version-0.0.0.md @@ -0,0 +1,6 @@ +# Reset the version to 0.0.0 + +- Goal: Start the applet's version history at 0.0.0 before its first pushed release, as the developer asked for every applet in this collection. +- Changes: `package.json` version 0.1.0 became 0.0.0. `genesis-applet publish` rewrote `published/applet-hn-bookmarks.bundle.json` (SHA-256 `772317249424139b…`, 353552 bytes) and `published/applet-hn-bookmarks.release.json` for 0.0.0, built with Genesis commit `aebef4c113b0`. The current spec names the new published version. Sources, id, service ids and stored data are unchanged. +- Decisions: The developer chose 0.0.0 as the starting version. The local tag `hn-bookmarks/v0.1.0` was never pushed, so it was deleted; the release tool would otherwise refuse 0.0.0 as lower than the last tag. No new tag was created. Later changes raise the patch version before each pull request and ask the developer before a minor or major raise, per the Genesis applet builder instructions. +- Verification: `genesis-applet publish` passed its checks. The Genesis commit must be pushed before CI can rebuild this build at that commit. diff --git a/hn-bookmarks/.specs/current.md b/hn-bookmarks/.specs/current.md index cf9daac..bcf5be1 100644 --- a/hn-bookmarks/.specs/current.md +++ b/hn-bookmarks/.specs/current.md @@ -6,7 +6,7 @@ - Three contexts, each with its own website session history: `primary` (Home, start URL `/`), `post` (`/submit`) and `me` (`/news?account=1`). The adapter is [src/adapter.ts](../src/adapter.ts) with pages `feed`, `private-feed`, `item`, `user`, `info`, `account` and `submit` in [src/adapter](../src/adapter). - Screens: route screens `feed`, `item`, `user`, `info`, `post` and `me`; overlay screens `search`, `saved`, `categories` and `save`. Service: `bookmarks`, used by Saved, Categories and Save. - Manifest schema 6, `@genesis/sdk` 0.0.0, `genesis-applet` tools 0.0.0, protocol 1, adapter API 1. Kit version: not exported for this in-repository applet. The [manifest](../applet.json) is the authority for routes and contexts. -- Published release: version 0.1.0, tag `hn-bookmarks/v0.1.0`, build and release record in `published/` (built with Genesis `655ce128bce1`). Raise the version and run `genesis-applet publish` again before the next release. +- Published release: version 0.0.0, build and release record in `published/` (built with Genesis `aebef4c113b0`), not tagged yet. Before a pull request that changes this applet, raise the version and run `genesis-applet publish` again. ## Product scope diff --git a/hn-bookmarks/package.json b/hn-bookmarks/package.json index 2e63fae..697dce6 100644 --- a/hn-bookmarks/package.json +++ b/hn-bookmarks/package.json @@ -1,6 +1,6 @@ { "name": "@genesis/applet-hacker-news", - "version": "0.1.0", + "version": "0.0.0", "private": true, "type": "module", "scripts": { diff --git a/hn-bookmarks/published/applet-hn-bookmarks.bundle.json b/hn-bookmarks/published/applet-hn-bookmarks.bundle.json index 62086f0..d778e35 100644 --- a/hn-bookmarks/published/applet-hn-bookmarks.bundle.json +++ b/hn-bookmarks/published/applet-hn-bookmarks.bundle.json @@ -1 +1 @@ -{"envelope":1,"bundle":{"format":3,"compat":{"manifestSchema":6,"bundleFormat":3,"protocol":1,"adapterApi":1,"sdk":"0.0.0","tools":"0.0.0","builtAt":"2026-11-09T11:21:14Z"},"manifest":{"schemaVersion":6,"id":"hn-bookmarks","name":"Hacker News","origins":["https://news.ycombinator.com"],"foreground":{"entry":"src/main.tsx","screens":["feed","item","user","info","search","post","saved","categories","save","me"]},"adapter":"src/adapter.ts","contexts":[{"id":"primary","startUrl":"https://news.ycombinator.com/"},{"id":"post","startUrl":"https://news.ycombinator.com/submit"},{"id":"me","startUrl":"https://news.ycombinator.com/news?account=1"}],"routes":[{"id":"account","pattern":"/news","query":["account"],"page":"account","screen":"me","context":"me"},{"id":"home","pattern":"/","page":"feed","screen":"feed","context":"primary"},{"id":"news","pattern":"/news","page":"feed","screen":"feed","context":"primary"},{"id":"newest","pattern":"/newest","page":"feed","screen":"feed"},{"id":"front","pattern":"/front","page":"feed","screen":"feed"},{"id":"newcomments","pattern":"/newcomments","page":"feed","screen":"feed"},{"id":"ask","pattern":"/ask","page":"feed","screen":"feed"},{"id":"show","pattern":"/show","page":"feed","screen":"feed"},{"id":"shownew","pattern":"/shownew","page":"feed","screen":"feed"},{"id":"asknew","pattern":"/asknew","page":"feed","screen":"feed"},{"id":"jobs","pattern":"/jobs","page":"feed","screen":"feed"},{"id":"best","pattern":"/best","page":"feed","screen":"feed"},{"id":"active","pattern":"/active","page":"feed","screen":"feed"},{"id":"from","pattern":"/from","page":"feed","screen":"feed"},{"id":"submitted","pattern":"/submitted","query":["id"],"page":"feed","screen":"feed"},{"id":"threads","pattern":"/threads","query":["id"],"page":"feed","screen":"feed"},{"id":"favorites","pattern":"/favorites","query":["id"],"page":"feed","screen":"feed"},{"id":"hidden","pattern":"/hidden","query":["id"],"page":"private-feed","screen":"feed"},{"id":"upvoted","pattern":"/upvoted","query":["id"],"page":"private-feed","screen":"feed"},{"id":"item","pattern":"/item","query":["id"],"page":"item","screen":"item"},{"id":"user","pattern":"/user","query":["id"],"page":"user","screen":"user"},{"id":"formatdoc","pattern":"/formatdoc","page":"info","screen":"info"},{"id":"faq","pattern":"/newsfaq.html","page":"info","screen":"info"},{"id":"guidelines","pattern":"/newsguidelines.html","page":"info","screen":"info"},{"id":"lists","pattern":"/lists","page":"info","screen":"info"},{"id":"leaders","pattern":"/leaders","page":"info","screen":"info"},{"id":"submit","pattern":"/submit","page":"submit","screen":"post","context":"post"},{"id":"submit-result","pattern":"/r","page":"submit","screen":"post"}],"capabilities":{"services":[{"id":"bookmarks","config":"backend/service.json"}]},"shell":{"accent":"#ff6600"}},"files":[{"path":"adapter.js","sha256":"ebe2db0683874c95b1f141d153e0db09ad24c4ff1754481f9e1b9123c8449821"},{"path":"assets/yc.png","sha256":"6759dc96b4c3d8e08bf3f3f1d8996a7a5743a72bd7567f2b9a0e7c7e26ee42d9"},{"path":"foreground.css","sha256":"ee20a9ba479eed976305d1a0c9777cb9f6d8ca9a7cf87290bae5064a1af5bc19"},{"path":"foreground.js","sha256":"e7b9b22272226d195cb03d426165bf6b1125ed92ea3ac317f663186d5e94efe3"},{"path":"index.html","sha256":"aa44f6b87ac40170d4ad8d891021e384d535858ab2a4098e6d9025e79cfc79cf"}]},"entries":[{"path":"adapter.js","encoding":"utf8","content":"(()=>{var j={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1};var ut=/^:[A-Za-z][A-Za-z0-9_]*$/,ft=/^[A-Za-z0-9_.~@-]+$/,fe=new Map;function dt(e){if(fe.has(e))return fe.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),r=n.at(-1)===\"*\";r&&n.pop();let i=[],o=!0;for(let s of n)ut.test(s)?i.push({param:s.slice(1)}):ft.test(s)&&s!==\".\"&&s!==\"..\"?i.push({literal:s}):o=!1;o&&(t={segments:i,rest:r})}return fe.set(e,t),t}function pe(e){try{return new URL(e).href}catch{return null}}function me(e,t){let n=pt(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let r;try{r=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}r.at(-1)===\"\"&&r.pop();for(let i of e.routes){let o=dt(i.pattern);if(!o)continue;let s=mt(o,r);if(!s||!(i.query??[]).every(f=>n.searchParams.has(f)))continue;for(let f of i.query??[])s[f]=n.searchParams.get(f);let a={kind:\"route\",routeId:i.id,page:i.page,screen:i.screen,params:s};return i.context!==void 0&&(a.context=i.context),a}return{kind:\"website\",url:t}}function pt(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function mt(e,t){if(e.rest?t.length{let i=null,o=!1,s=1,a=new Map,f=new Map,u={get bound(){return i},get retired(){return o},request(w,h={}){if(o)return Promise.reject(new O(\"RETIRED\",\"This page was closed\"));let x=s++;return new Promise((R,P)=>{let L=setTimeout(()=>{a.delete(x),P(new O(\"DEADLINE\",`${w} did not answer in time`))},i.limits.rpcDeadlineMs+gt);a.set(x,{resolve:R,reject:P,timer:L}),e.postMessage(JSON.stringify({type:\"request\",documentId:i.documentId,requestId:x,method:w,params:h}))})},on(w,h){let x=f.get(w);return x||f.set(w,x=new Set),x.add(h),()=>{x.delete(h)}}};function p(){o=!0;for(let w of a.values())clearTimeout(w.timer),w.reject(new O(\"RETIRED\",\"This page was closed\"));a.clear()}function g(w,h){for(let x of[...f.get(w)??[]])try{x(h)}catch(R){console.error(`Genesis ${w} handler failed`,R)}}e.addEventListener(\"message\",w=>{if(o||typeof w.data!=\"string\")return;let h;try{h=JSON.parse(w.data)}catch{return}if(h?.type===\"refused\"&&!i){o=!0,r(new O(h.error?.code??\"PROTOCOL_MISMATCH\",h.error?.message??\"The host refused this page\"));return}if(h?.type===\"bound\"){if(i)return;i=h,n(u);return}if(!(!i||h?.documentId!==i.documentId))if(h.type===\"response\"){let x=a.get(h.requestId);if(!x)return;a.delete(h.requestId),clearTimeout(x.timer),h.error?x.reject(new O(h.error.code,h.error.message)):x.resolve(h.result??null)}else h.type===\"event\"&&(h.name===\"retired\"?(p(),g(\"retired\",{})):g(h.name,h.data))}),addEventListener(\"pagehide\",()=>{o||(g(\"pagehide\",{}),p())});let b={type:\"hello\",protocol:j.protocol,url:t};e.postMessage(JSON.stringify(b))})}var ht=100;function yt(e){let t=new Map,n=Promise.resolve();return{act(r){let i={request:r,arrived:Date.now(),view:e.view(),cancelled:!1,dispatched:!1,stopped:!1};t.set(r.actionId,i),n=n.then(()=>vt(e,i)).catch(o=>{console.error(\"Genesis action failed\",o)}).finally(()=>{t.delete(r.actionId)})},cancel(r){let i=t.get(r);i&&!i.dispatched&&(i.cancelled=!0)},retire(){for(let r of t.values())r.stopped=!0}}}async function vt(e,t){let{connection:n,limits:r}=e,{actionId:i}=t.request,o,s=(T,A,$)=>{if(t.stopped)return Promise.resolve();let _={actionId:i,state:T};return $&&(_.navigating=!0),$&&o&&(_.expect=o),A&&(_.result=A),n.request(\"context.actionResult\",_).then(()=>{},()=>{})},a=(T,A,$)=>{let _={outcome:\"failed\",code:T,message:A};return $!==void 0&&Object.assign(_,{completedSteps:$,partial:$>0}),s(\"failed\",_)},f=()=>s(\"cancelled\",{outcome:\"cancelled\"});if(t.stopped)return;if(t.cancelled)return f();if((t.request.view??t.view)!==t.view||e.view()!==t.view)return a(\"CONTEXT_REPLACED\",\"The page the action was for has been replaced\");let u=e.find(t.request);if(\"error\"in u)return a(u.error.code,u.error.message);let p=u.element();if(p===void 0)return a(\"TARGET_NOT_FOUND\",\"The item is no longer on the page\");let g;try{g=u.action(p,t.request.args)}catch(T){return a(\"INVALID_STEPS\",Pe(T))}if(typeof g?.then==\"function\")return a(\"INVALID_STEPS\",\"An action must return its steps synchronously\");if(g&&\"satisfied\"in g&&g.satisfied===!0)return s(\"observed\",{outcome:\"observed\",noop:!0});let b=wt(g);if(b)return a(\"INVALID_STEPS\",b);let{steps:w,until:h,deadlineMs:x}=g;o=g.expect;let R=g.navigates===!0||je(w.at(-1)),P=t.arrived+(x??r.actionTimeoutMs),L=0,J=T=>(t.dispatched=!0,s(\"dispatched\",void 0,T)),Y=n.on(\"pagehide\",()=>{!t.dispatched&&!t.stopped&&L>0&&J(!0),t.stopped=!0}),ee=()=>t.stopped||t.cancelled;try{for(let[T,A]of w.entries()){if(t.stopped)return;if(t.cancelled)return f();if(Date.now()>=P)return a(\"DEADLINE\",\"The action did not finish in time\",L);if(T>0&&Me(w[T-1])&&u.element()===void 0)return a(\"TARGET_NOT_FOUND\",\"The item left the page during the action\",L);if(R&&T===w.length-1&&!Me(A)){if(ye(A),await J(!0),t.stopped)return;ye(A)();return}await kt(A,P,ee),L++}if(t.stopped)return;if(t.cancelled)return f();if(await J(R),R)return;if(h!==void 0){let T=typeof h==\"string\"?()=>document.querySelector(h)!==null:()=>h(document)===!0;try{await ve(T,P-Date.now(),\"the action to take effect\",()=>t.stopped)}catch{return s(\"failed\",{outcome:\"unknown\",code:\"DEADLINE\",message:\"The page did not show the action's effect in time\",completedSteps:L,partial:L>0})}}if(t.stopped)return;e.flush(),await s(\"observed\",{outcome:\"observed\"})}catch(T){let A=T instanceof O?T.code:\"INVALID_ARGUMENT\";return a(A,Pe(T),L)}finally{Y()}}function wt(e){if(typeof e!=\"object\"||e===null)return\"An action must return { satisfied: true } or { steps }\";let{steps:t,until:n}=e;if(!Array.isArray(t))return\"An action must return { satisfied: true } or { steps }\";for(let[r,i]of t.entries()){let o=Et(i);if(o)return`Step ${r}: ${o}`;if(je(i)&&r!==t.length-1)return\"A navigate or submit step must be the last step\"}return n!==void 0&&typeof n!=\"string\"&&typeof n!=\"function\"?\"until must be a selector or a function\":null}function Et(e){if(typeof e!=\"object\"||e===null)return\"must be an object\";let t=e,n=r=>typeof r==\"string\"&&r!==\"\";if(\"click\"in t)return n(t.click)?null:\"click needs a selector\";if(\"fill\"in t)return n(t.fill)&&typeof t.value==\"string\"?null:\"fill needs a selector and a string value\";if(\"submit\"in t)return n(t.submit)?null:\"submit needs a selector\";if(\"navigate\"in t)return n(t.navigate)?null:\"navigate needs a URL\";if(\"waitFor\"in t||\"waitForUrl\"in t)return n(t.waitFor??t.waitForUrl)&&typeof t.timeoutMs==\"number\"?null:\"a wait needs a selector or pattern and timeoutMs\";if(\"scroll\"in t){let r=t.scroll;return r&&n(r.target)&&(r.to===\"end\"||typeof r.to==\"number\")?null:\"scroll needs a target and to\"}return\"unknown step\"}var je=e=>e!==void 0&&(\"navigate\"in e||\"submit\"in e),Me=e=>\"waitFor\"in e||\"waitForUrl\"in e,Pe=e=>String(e?.message??e);function te(e){let t=document.querySelector(e);if(!t)throw new O(\"NOT_FOUND\",`Nothing matches ${e}`);return t}async function kt(e,t,n){let r=()=>Math.max(0,t-Date.now());if(\"waitFor\"in e)await ve(()=>document.querySelector(e.waitFor)!==null,Math.min(e.timeoutMs,r()),e.waitFor,n);else if(\"waitForUrl\"in e){let i=new RegExp(e.waitForUrl);await ve(()=>i.test(location.href),Math.min(e.timeoutMs,r()),e.waitForUrl,n)}else ye(e)()}function ye(e){if(\"click\"in e){let t=te(e.click);return()=>t.click()}if(\"fill\"in e){let t=te(e.fill);return()=>xt(t,e.value)}if(\"submit\"in e){let t=te(e.submit),n=t instanceof HTMLFormElement?t:t.closest(\"form\");if(!n)throw new O(\"NOT_FOUND\",`${e.submit} is not in a form`);let r=t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t:void 0;return()=>n.requestSubmit(r)}if(\"navigate\"in e){let t=e.navigate;return()=>location.assign(t)}if(\"scroll\"in e){let{target:t,to:n}=e.scroll,r=t===\"window\"?document.scrollingElement??document.documentElement:te(t);return()=>{r.scrollTop=n===\"end\"?r.scrollHeight:n}}throw new O(\"INVALID_STEPS\",\"A wait step does not run on its own\")}function xt(e,t){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new O(\"INVALID_STEPS\",\"fill needs an input or textarea\");let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(n,\"value\")?.set?.call(e,t),e.dispatchEvent(new Event(\"input\",{bubbles:!0})),e.dispatchEvent(new Event(\"change\",{bubbles:!0}))}function ve(e,t,n,r){let i=Date.now()+t;return new Promise((o,s)=>{let a=()=>{try{return e()}catch{return!1}},f=()=>{r()||a()?o():Date.now()>=i?s(new O(\"DEADLINE\",`Timed out waiting for ${n}`)):setTimeout(f,ht)};f()})}var $e=new WeakMap;function Ce(e){let t=$e.get(e);return t===void 0&&$e.set(e,t=JSON.stringify(e)),t}function we(e,t){return e===t?!0:e!==null&&t!==null&&Ce(e)===Ce(t)}function re(e,t){return e?.code===t?.code&&e?.message===t?.message}function bt(e,t){if(e.kind!==t.kind)return{kind:\"replace\",region:t};if(t.kind===\"single\"){let p=e;if(we(p.record,t.record)&&p.status===t.status&&re(p.error,t.error))return null;let g={kind:\"single\",record:t.record};return p.status!==t.status&&(g.status=t.status),re(p.error,t.error)||(g.error=t.error??null),g}let n=e;if(!!n.ephemeral!=!!t.ephemeral||t.ephemeral)return It(n,t)?null:{kind:\"replace\",region:t};let r=new Map(n.items.map(p=>[p.key,p])),i=new Set,o=[];for(let p of t.items){i.add(p.key);let g=r.get(p.key);(!g||!we(g,p))&&o.push(p)}let s=n.items.filter(p=>!i.has(p.key)).map(p=>p.key),a=t.items.map(p=>p.key),f=a.length!==n.items.length||a.some((p,g)=>n.items[g].key!==p),u={kind:\"collection\"};return o.length&&(u.upsert=o),s.length&&(u.remove=s),f&&(u.order=a),n.complete!==t.complete&&(u.complete=t.complete),n.status!==t.status&&(u.status=t.status),re(n.error,t.error)||(u.error=t.error??null),Object.keys(u).length>1?u:null}function It(e,t){return e.complete===t.complete&&e.status===t.status&&re(e.error,t.error)&&!!e.ephemeral==!!t.ephemeral&&e.items.length===t.items.length&&e.items.every((n,r)=>we(n,t.items[r]))}function Tt(e,t,n=1/0){let r=e.slice(),i=s=>r.findIndex(a=>a.key===s),o=-1;for(let[s,a]of t.entries()){let f=i(a.key);if(f!==-1){r[f]=a,o=f;continue}let u=o+1;o===-1&&(u=t.slice(s+1).map(g=>i(g.key)).find(g=>g!==-1)??r.length),r.splice(u,0,a),o=u}return r.length>n?Ve(r,new Set(t.map(s=>s.key)),n):r}function Ve(e,t,n){if(e.length<=n)return e;let r=-1,i=0;for(let[a,f]of e.entries())t.has(f.key)&&(r===-1&&(r=a),i=a);r===-1&&(r=0);let o=Math.max(n,i-r+1),s=Math.min(Math.max(0,Math.floor((r+i+1-o)/2)),e.length-o);return e.slice(s,s+o)}function At(e){return new Set(e).size===e.length?{keys:e,ephemeral:!1}:{keys:e.map((t,n)=>String(n)),ephemeral:!0}}function St(e,t,n){let r=new Map,i=o=>{let s=r.get(o);return s||r.set(o,s={keys:new Set,whole:!1,membership:!1,resolve:!1}),s};for(let[o,s]of Object.entries(e)){let a=t.some(f=>f.kind===\"childList\");if(!s.root){a&&(i(o).resolve=!0);continue}if(!ge(s.root,n)){i(o).resolve=!0;continue}(s.dependsOn.some(f=>!ge(f,n))||s.dependsOnMissing&&a)&&(i(o).whole=!0);for(let f of t){if(f.kind===\"field\"&&!s.fields||f.kind===\"resize\"&&!s.measure)continue;f.removed&&ge(s.root,f.target)&&(i(o).whole=!0);let u=He(s,f.target);u.dependent&&(i(o).whole=!0),u.inRoot&&(f.kind===\"childList\"&&(i(o).membership=!0),u.key===void 0?i(o).whole=!0:i(o).keys.add(u.key))}}return r}function Ot(e,t){let n=He(e,t);return n.inRoot||n.dependent}function He(e,t){let n,r=!1,i=!1;for(let o=t;o;o=o.parentNode)n??=e.items.get(o),o===e.root&&(r=!0),e.dependsOn.includes(o)&&(i=!0);return n!==void 0&&(r=!0),{key:n,inRoot:r,dependent:i}}function ge(e,t){for(let n=e;n;n=n.parentNode)if(n===t)return!0;return!1}function Nt(e){let t=new MutationObserver(o=>{let s=[];for(let a of o){s.push({target:a.target,kind:a.type});for(let f of a.removedNodes)s.push({target:f,kind:\"childList\",removed:!0})}e(s)});t.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let n=o=>{o.target instanceof Node&&e([{target:o.target,kind:\"field\"}])};document.addEventListener(\"input\",n,!0),document.addEventListener(\"change\",n,!0);let r=new WeakMap,i=typeof ResizeObserver==\"function\"?new ResizeObserver(o=>{let s=[];for(let a of o){let f=`${a.contentRect.width}x${a.contentRect.height}`,u=r.get(a.target);r.set(a.target,f),u!==void 0&&u!==f&&s.push({target:a.target,kind:\"resize\"})}s.length&&e(s)}):null;return{measure(o){if(i){i.disconnect();for(let s of o)i.observe(s)}},disconnect(){t.disconnect(),i?.disconnect(),document.removeEventListener(\"input\",n,!0),document.removeEventListener(\"change\",n,!0)}}}function Rt(e){for(let t of[\"pushState\",\"replaceState\"]){let n=History.prototype[t];History.prototype[t]=function(...r){let i=n.apply(this,r);try{e()}catch(o){console.error(\"Genesis navigation handler failed\",o)}return i}}addEventListener(\"popstate\",e),addEventListener(\"hashchange\",e)}var _t=new TextEncoder,ne=e=>_t.encode(JSON.stringify(e)).length,Dt=class{constructor(e,t,n=()=>null){this.send=e,this.limits=t,this.shrink=n}send;limits;shrink;epoch=0;seq=0;last=null;page(e){let t={...e,epoch:++this.epoch};for(;ne(t)>this.limits.pageMaxBytes;){let n=this.shrink(t);if(!n){t={...t,status:\"error\",error:{code:\"PAGE_TOO_LARGE\",message:\"The page is too large to show\"},regions:{}};break}t={...n,epoch:t.epoch}}this.seq=0,this.last=t,this.post({page:t})}update(e){let t=this.last;if(!t||!Lt(t,e))return this.page(e);let n={};for(let[o,s]of Object.entries(e.regions)){let a=bt(t.regions[o],s);a&&(n[o]=a)}let r=e.account!==void 0&&e.account!==t.account;if(!r&&Object.keys(n).length===0)return;let i=this.split(n);if(r&&(i[i.length-1].account=e.account),i.some(o=>ne(o)>this.limits.patchMaxBytes))return this.page(e);this.last={...e,epoch:this.epoch};for(let o of i)this.post({patch:o})}split(e){let t=[],n={};for(let[f,u]of Object.entries(e)){if(u.kind!==\"collection\"||!u.upsert){n[f]=u;continue}let{upsert:p,...g}=u;for(let b of p)t.push([f,b]);Object.keys(g).length>1&&(n[f]=g)}let r=this.limits.patchMaxBytes-ne(n)-256,i=[],o=[],s=0;for(let f of t){let u=ne(f[1])+1;o.length&&(o.length>=this.limits.patchRecordsMax||s+u>r)&&(i.push(o),o=[],s=0),o.push(f),s+=u}i.push(o);let a=this.last.view;return i.map((f,u)=>{let p={view:a,epoch:this.epoch,base:this.seq,seq:++this.seq,regions:{}};for(let[g,b]of f)(p.regions[g]??={kind:\"collection\",upsert:[]}).upsert.push(b);if(u===i.length-1)for(let[g,b]of Object.entries(n))p.regions[g]={...p.regions[g],...b};return p})}post(e){this.send(e).catch(t=>{let n=t instanceof O?t.code:null;if(n!==\"RETIRED\"){if(\"patch\"in e&&this.last&&e.patch.epoch===this.epoch){let{epoch:r,...i}=this.last;return this.page(i)}if(\"page\"in e&&n===\"PAGE_TOO_LARGE\"&&e.page.status!==\"error\"){let{epoch:r,...i}=e.page;return this.page({...i,status:\"error\",error:{code:n,message:\"The page is too large to show\"},regions:{}})}console.error(\"Genesis could not publish the page\",t)}})}};function Lt(e,t){let n=Object.keys(t.regions);return e.view.generation===t.view.generation&&e.view.n===t.view.n&&e.view.url===t.view.url&&e.status===t.status&&e.pageId===t.pageId&&e.routeId===t.routeId&&e.error?.code===t.error?.code&&e.error?.message===t.error?.message&&e.signInUrl===t.signInUrl&&JSON.stringify(e.params)===JSON.stringify(t.params)&&n.length===Object.keys(e.regions).length&&n.every(r=>e.regions[r]?.kind===t.regions[r].kind)}function Mt(e,t,n){let r,i,o=()=>{clearTimeout(r),r=void 0,i=void 0,e()};return{schedule(){let s=Date.now();i??=s,clearTimeout(r),r=setTimeout(o,Math.min(t,Math.max(0,i+n-s)))},now(){r!==void 0&&o()},cancel(){clearTimeout(r),r=void 0,i=void 0}}}var Pt=1e4,Ue=!1;function Ee(e){if(typeof window>\"u\"||window.top!==window||Ue)return;Ue=!0;let t=window,n=t.__genesisBridge;try{delete t.__genesisBridge}catch{t.__genesisBridge=void 0}if(!n)return;let r=null;Rt(()=>r?.navigated());let i=()=>Le(n,location.href).then(o=>{r=$t(o,e)},o=>console.error(\"Genesis could not bind this page\",o));i(),addEventListener(\"pageshow\",o=>{o.persisted&&(r?.stop(),r=null,i())})}function $t(e,t){let{manifest:n,limits:r,generation:i}=e.bound,o={batches:0,reads:0,lastBatchReads:0,pages:0,patches:0,lastPublishBytes:0,resyncs:0,startedAt:Date.now()},s=!1;s&&(window.__genesisStats=o);let a=new Dt(c=>(s&&(\"page\"in c?o.pages++:o.patches++,o.lastPublishBytes=JSON.stringify(c).length),e.request(\"context.publish\",c)),r,ct),f={generation:i,n:0,url:location.href};if(e.bound.compat.adapterApi!==j.adapterApi){let c=`This applet uses adapter API ${j.adapterApi}; this Genesis uses ${e.bound.compat.adapterApi}`;return console.error(`Genesis: ${c}`),a.page({view:f,pageId:null,routeId:null,params:{},status:\"error\",error:{code:\"PROTOCOL_MISMATCH\",message:c},account:null,regions:{}}),{navigated(){},stop(){}}}let u=!1,p=pe(location.href),g=me(n,location.href),b=P(g),w=null,h=new Map,x=[],R=!1;function P(c){return c.kind===\"route\"?t.pages[c.page]??null:null}function L(){let c=b?.account??t.account;try{let l=c?.(document);return l===void 0&&c?{account:void 0,failed:!1}:{account:typeof l==\"string\"&&l!==\"\"?l:null,failed:!1}}catch(l){return console.error(\"Genesis adapter account failed\",l),{account:void 0,failed:!0}}}function J(){let c=t.signInUrl;try{if(typeof c==\"string\")return new URL(c,n.origins[0]).href;if(typeof c==\"function\")return new URL(c(location.href),location.href).href}catch(l){console.error(\"Genesis adapter signInUrl failed\",l)}return null}function Y({account:c,failed:l}){if(g.kind!==\"route\")return{status:\"unsupported\"};if(!b)return{status:\"error\",error:{code:\"NOT_FOUND\",message:`The adapter declares no page ${g.page}`}};let m;try{m=b.ready(document)===!0}catch(y){return{status:\"error\",error:{code:\"INVALID_ARGUMENT\",message:Fe(y)}}}if(b.requiresAccount===!0&&l)return{status:\"loading\"};let d=b.requiresAccount===!0&&c===null;return m?{status:d?\"auth\":\"ready\"}:d&&document.readyState!==\"loading\"?{status:\"auth\"}:{status:\"loading\"}}function ee(c,l){let m={view:f,pageId:g.kind===\"route\"?g.page:null,routeId:g.kind===\"route\"?g.routeId:null,params:g.kind===\"route\"?g.params:{},status:l.status,signInUrl:J(),regions:{}};c!==void 0&&(m.account=c),l.error&&(m.error=l.error);for(let[d,y]of h)m.regions[d]=y.value;return m}function T(c,l,m){let d={name:c,def:l,root:null,items:new WeakMap,elements:new Map,dependsOn:[],dependsOnMissing:!1,value:m?.value??Ct(l)};for(let y of l.dependsOn??[]){let v=[...document.querySelectorAll(y)];v.length===0&&(d.dependsOnMissing=!0),d.dependsOn.push(...v)}return d.root=document.querySelector(l.root),A(d,()=>l.kind===\"collection\"?_(d,l,\"all\"):$(d,l)),d}function A(c,l){try{c.value=l()}catch(m){let d=m instanceof O?m.code:\"INVALID_ARGUMENT\";c.value={...c.value,status:\"error\",error:{code:d,message:`${c.name}: ${Fe(m)}`}}}}function $(c,l){let m=c.root;return m?{kind:\"single\",status:\"ready\",record:Se(l,m,l.key?oe(l.key,m):c.name)}:{kind:\"single\",status:\"ready\",record:null}}function _(c,l,m){let d=c.value,y=c.root?[...c.root.querySelectorAll(l.items)]:[],{keys:v,ephemeral:E}=At(y.map(M=>oe(l.key,M))),I=d.ephemeral?new Map:new Map(d.items.map(M=>[M.key,M])),D=c.elements;c.elements=new Map;let S=y.map((M,lt)=>{let W=v[lt];c.elements.set(W,M);let _e=I.get(W);return m!==\"all\"&&_e&&!m.has(W)&&D.get(W)===M?_e:Ae(c,l,M,W)}),G={kind:\"collection\",status:\"ready\",items:l.virtualized&&!E&&!d.ephemeral?Tt(d.items,S,r.patchRecordsMax):S,complete:he(l)};return E&&(G.ephemeral=!0),G}function Ae(c,l,m,d){let y=Se(l,m,d);c.items.set(m,d);for(let v of l.extent?.(m)??[])v&&c.items.set(v,d);return y}function Se(c,l,m){o.reads++;let d=c.read(l);if(typeof d?.then==\"function\")throw new O(\"ASYNC_READ\",\"read must return its data synchronously\");let y={key:m,data:d===void 0?null:d};return c.entity&&(y.entity=c.entity(l)),c.entityType&&(y.entityType=c.entityType),y}function it(c,l,m){let d=c.value;if(d.ephemeral||d.status===\"error\")return A(c,()=>_(c,l,m));let y=d.items.slice();for(let v of m){let E=c.elements.get(v),I=y.findIndex(S=>S.key===v);if(!(E?.isConnected&&c.root?.contains(E)&&E.matches(l.items))||I===-1||oe(l.key,E)!==v)return A(c,()=>_(c,l,m));try{y[I]=Ae(c,l,E,v)}catch{return A(c,()=>_(c,l,m))}}c.value={...d,items:y,complete:he(l)}}function st(c,l){let{def:m}=c;l.resolve||l.whole||m.kind===\"single\"?h.set(c.name,T(c.name,m,c)):l.membership?A(c,()=>_(c,m,l.keys)):it(c,m,l.keys)}function ct(c){if(c.view.n!==f.n)return null;let l={...c,regions:{...c.regions}},m=!1;for(let[d,y]of Object.entries(c.regions)){let v=h.get(d);if(v?.def.kind!==\"collection\"||!v.def.virtualized||y.kind!==\"collection\"||y.ephemeral)continue;let E=Ve(y.items,new Set(v.elements.keys()),Math.floor(y.items.length*3/4));E.length!==y.items.length&&(l.regions[d]={...y,items:E},v.value===y&&(v.value=l.regions[d]),m=!0)}return m?l:null}function ae(c=!1){if(u)return;x=[],R=!1;let l=L(),{account:m}=l,d=Y(l),y=h;if(h=new Map,d.status===\"ready\")for(let[E,I]of Object.entries(b?.regions??{}))h.set(E,T(E,I,y.get(E)));w=d.status;let v=ee(m,d);c?a.page(v):a.update(v),Ne()}function Oe(){if(u)return;o.batches++;let c=o.reads,l=x,m=R;x=[],R=!1;let d=L(),{account:y}=d,v=Y(d);if(v.status!==\"ready\"||w!==\"ready\"||m)ae();else{let E={};for(let[I,D]of h)E[I]=qe(D);for(let[I,D]of St(E,l,document))st(h.get(I),D);for(let I of h.values()){let D=I.value;if(I.def.kind===\"collection\"&&D.kind===\"collection\"&&I.def.more){let S=he(I.def);S!==D.complete&&(I.value={...D,complete:S})}}a.update(ee(y,v)),Ne()}o.lastBatchReads=o.reads-c}function Ne(){let c=[];for(let l of h.values())l.def.measure&&(l.def.kind===\"single\"?l.root&&c.push(l.root):c.push(...l.elements.values()));Re.measure(c)}let q=Mt(Oe,r.publishQuietMs,r.publishMaxDelayMs),Re=Nt(c=>{if(!u){if(w===\"ready\"&&!R){let l=[...h.values()].map(qe);x.push(...c.filter(m=>m.kind!==\"attributes\"||l.some(d=>Ot(d,m.target)))),x.length>Pt&&(x=[],R=!0)}q.schedule()}}),le=yt({connection:e,limits:r,flush:()=>{q.cancel(),Oe()},find:at,view:()=>f.n});function at(c){let l=(S,G)=>({error:{code:S,message:G}});if(w!==\"ready\"||!b)return l(\"NOT_READY\",\"The page is not ready\");let m=f.n;if(c.region===null){let S=b.actions?.[c.name];return S?{action:S,element:()=>null}:l(\"INVALID_ARGUMENT\",`The page has no action ${c.name}`)}let d=c.region,y=h.get(d);if(!y)return l(\"NOT_FOUND\",`The page has no region ${d}`);let v=y.def.actions?.[c.name];if(!v)return l(\"INVALID_ARGUMENT\",`Region ${d} has no action ${c.name}`);let E=y.def;if(E.kind===\"single\")return{action:v,element:()=>f.n===m?document.querySelector(E.root)??void 0:void 0};if(y.value.ephemeral)return l(\"PRECONDITION_FAILED\",`Region ${d} repeats keys, so its records have no actions`);let I=c.key;if(I===null)return l(\"INVALID_ARGUMENT\",`Action ${c.name} needs a record key`);let D=()=>{if(f.n!==m)return;let S=h.get(d)?.elements.get(I);if(S?.isConnected&&Ge(E,S)===I)return S;let G=document.querySelector(E.root);return G?[...G.querySelectorAll(E.items)].find(M=>Ge(E,M)===I):void 0};return D()===void 0?l(\"TARGET_NOT_FOUND\",`No ${d} item has key ${I}`):{action:v,element:D}}function ue(c=!0){u||(u=!0,q.cancel(),Re.disconnect(),c&&le.retire())}return e.on(\"resync\",()=>{o.resyncs++,q.cancel(),ae(!0)}),e.on(\"act\",c=>le.act(c)),e.on(\"cancel\",({actionId:c})=>le.cancel(c)),e.on(\"ping\",()=>{}),e.on(\"retired\",()=>ue()),e.on(\"pagehide\",()=>ue(!1)),document.readyState===\"loading\"&&document.addEventListener(\"DOMContentLoaded\",()=>q.schedule(),{once:!0}),ae(),{navigated(){if(u)return;let c=pe(location.href);c!==p&&(p=c,f={generation:i,n:f.n+1,url:location.href},g=me(n,location.href),b=P(g),w=null,h=new Map,q.cancel(),q.schedule())},stop:()=>ue()}}function qe(e){return{root:e.root,items:e.items,dependsOn:e.dependsOn,dependsOnMissing:e.dependsOnMissing,fields:e.def.fields===!0,measure:e.def.measure===!0}}function Ct(e){return e.kind===\"collection\"?{kind:\"collection\",status:\"ready\",items:[],complete:!0}:{kind:\"single\",status:\"ready\",record:null}}function he(e){return e.more?document.querySelector(e.more)===null:!0}function oe(e,t){let n=e(t);if(typeof n!=\"string\"||n===\"\")throw new O(\"INVALID_ARGUMENT\",\"key must return a non-empty string\");return n}function Ge(e,t){try{return oe(e.key,t)}catch{return null}}function Fe(e){return String(e?.message??e)}function H(e){return{...e,kind:\"collection\"}}function N(e){return{...e,kind:\"single\"}}function ke(e){let t=(o,s)=>{throw new Error(`Adapter ${o} ${s}`)},n=(o,s)=>{o!==void 0&&typeof o!=\"function\"&&t(s,\"must be a function\")},r=(o,s)=>{(typeof o!=\"string\"||o.trim()===\"\")&&t(s,\"must be a CSS selector\")},i=(o,s)=>{if(o!==void 0){V(o)||t(s,\"must be an object of functions\");for(let[a,f]of Object.entries(o))typeof f!=\"function\"&&t(`${s}.${a}`,\"must be a function\")}};V(e)||t(\"definition\",\"must be an object\"),n(e.account,\"account\"),e.signInUrl!==void 0&&typeof e.signInUrl!=\"string\"&&typeof e.signInUrl!=\"function\"&&t(\"signInUrl\",\"must be a path or a function\"),V(e.pages)||t(\"pages\",\"must be an object\");for(let[o,s]of Object.entries(e.pages)){let a=`pages.${o}`;V(s)||t(a,\"must be an object\"),typeof s.ready!=\"function\"&&t(`${a}.ready`,\"must be a function\"),n(s.account,`${a}.account`),i(s.actions,`${a}.actions`),s.regions!==void 0&&!V(s.regions)&&t(`${a}.regions`,\"must be an object\");for(let[f,u]of Object.entries(s.regions??{})){let p=`${a}.regions.${f}`;(!V(u)||u.kind!==\"collection\"&&u.kind!==\"single\")&&t(p,\"must be made with collection() or single()\"),r(u.root,`${p}.root`),typeof u.read!=\"function\"&&t(`${p}.read`,\"must be a function\"),n(u.entity,`${p}.entity`),u.dependsOn!==void 0&&(Array.isArray(u.dependsOn)||t(`${p}.dependsOn`,\"must be an array of selectors\"),u.dependsOn.forEach((g,b)=>r(g,`${p}.dependsOn.${b}`))),i(u.actions,`${p}.actions`),u.kind===\"collection\"?(r(u.items,`${p}.items`),typeof u.key!=\"function\"&&t(`${p}.key`,\"must be a function\"),n(u.extent,`${p}.extent`),u.more!==void 0&&r(u.more,`${p}.more`)):n(u.key,`${p}.key`)}}return e}function V(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var K=\"https://news.ycombinator.com\";var C=e=>typeof e==\"string\"&&e.length<=20&&/^[1-9][0-9]*$/.test(e);function xe(e,t=K){try{let n=new URL(e,t);return(n.protocol===\"https:\"||n.protocol===\"http:\")&&!n.username&&!n.password&&n.href.length<=2048?n.href:null}catch{return null}}function ie(e){try{let t=new URL(e,K),n=t.searchParams.get(\"id\");return t.origin===K&&t.pathname===\"/item\"&&C(n)?n:null}catch{return null}}var Ut=3,qt=1;function k(e,t=300){return(e??\"\").replace(/\\s+/g,\" \").trim().slice(0,t)}function Be(e){return e.ownerDocument?.location?.href??`${K}/`}function Z(e){let t=e.getAttribute(\"href\");return t?xe(t,Be(e)):null}var ze=e=>k((e?.querySelector(\".hnuser\")??e?.querySelector(\"a[href^='user?id=']\"))?.textContent,64)||null,U=e=>e.readyState!==\"loading\"&&e.querySelector(\"#hnmain\")!==null,B=e=>k(e.querySelector(\"#me\")?.textContent,64)||null;function F(e,t=12e3){let n=[],r=0,i=(o,s)=>{if(r>=t)return;if(o.nodeType===Ut){let u=(o.textContent??\"\").slice(0,t-r);r+=u.length,u&&n.push({text:u,...s});return}if(o.nodeType!==qt)return;let a=o;if(a.matches(\"script,style,input,textarea,select,button,noscript,form,img,.reply,.pagetop\"))return;let f={...s};if(a.tagName===\"A\"){let u=Z(a);u&&(f.href=u)}a.matches(\"b,strong\")&&(f.strong=!0),a.matches(\"i,em\")&&(f.em=!0),a.matches(\"code,pre\")&&(f.code=!0),a.matches(\"p,br,pre,li,tr,h1,h2,h3\")&&r>0&&(n.push({text:`\n\n`}),r+=2);for(let u of a.childNodes)i(u,f)};return e&&i(e,{}),n}function be(e,...t){let n=o=>{for(let s of t){let a=s?.querySelector(`[id=\"${o}_${e}\"]`);if(a)return a}return null},r=n(\"up\"),i=r?.classList.contains(\"nosee\")===!0||n(\"un\")!==null;return{canVote:r!==null&&!i,voted:i}}function se(e){if(!C(e.id))return null;let t=e.querySelector(\".titleline > a\"),n=k(t?.textContent,400);if(!t||!n)return null;let r=Z(t),i=e.nextElementSibling?.querySelector(\".subtext\")??null,o=[...i?.querySelectorAll(\"a[href^='item?id=']\")??[]].reverse().find(s=>/comment|discuss/i.test(s.textContent??\"\"));return{id:e.id,title:n,articleUrl:r&&ie(r)!==e.id?r:null,domain:k(e.querySelector(\".sitestr\")?.textContent,120)||null,submitter:ze(i),score:k(i?.querySelector(\".score\")?.textContent,40)||null,age:k(i?.querySelector(\".age\")?.textContent,40)||null,comments:o?k(o.textContent,40):null,rank:k(e.querySelector(\".rank\")?.textContent,8).replace(/\\.$/,\"\")||null,...be(e.id,e,i)}}function Gt(e){let n=[...e.querySelectorAll(\".navs a[href]\")].find(i=>k(i.textContent,20)===\"parent\")?.getAttribute(\"href\")??\"\",r=n.startsWith(\"#\")?n.slice(1):ie(xe(n,Be(e))??\"\")??\"\";return C(r)?r:null}function X(e,{links:t=!1}={}){if(!C(e.id))return null;let n=e.querySelector(\".comment\");if(!n)return null;let r=n.querySelector(\".commtext\"),i=e.querySelector(\".onstory a[href]\"),o=i?ie(Z(i)??\"\"):null;return{id:e.id,author:ze(e.querySelector(\".comhead\")),age:k(e.querySelector(\".age\")?.textContent,40)||null,depth:Math.min(20,Math.max(0,Number(e.querySelector(\".ind\")?.getAttribute(\"indent\")??0)||0)),parent:Gt(e),parts:r?F(r,8e3):[{text:k(n.textContent,100)||\"[no text]\"}],onStory:o?{id:o,title:k(i.getAttribute(\"title\")||i.textContent,400)}:null,links:t?[...e.querySelectorAll(\".navs a[href]\")].flatMap(s=>{let a=k(s.textContent,20),f=Z(s);return f&&a&&!s.classList.contains(\"togg\")&&s.closest(\".onstory\")===null?[{label:a,url:f}]:[]}).slice(0,6):[],canReply:n.querySelector(\".reply a[href^='reply?id=']\")!==null,...be(e.id,e)}}function ce(e){let t=Z(e);return t?{url:t}:null}function z(e,t,n){let r=n?.voted;if(typeof r!=\"boolean\")throw new Error(\"setVoted needs { voted: boolean }\");if(!C(t))throw new Error(\"Not a Hacker News item\");let i=s=>be(t,s.documentElement).voted;if(i(e)===r)return{satisfied:!0};let o=`[id=\"${r?\"up\":\"un\"}_${t}\"]`;if(!e.querySelector(o))throw new Error(r?\"This item cannot be upvoted here\":\"This vote cannot be undone here\");return{steps:[{click:o}],until:s=>i(s)===r}}function Ft(e){let t=k(e.querySelector(\"#me\")?.textContent,64);return t?{name:t,karma:k(e.querySelector(\"#karma\")?.textContent,20)||null}:null}var Je={ready:U,requiresAccount:!0,regions:{account:N({root:\"#hnmain\",read:Ft,actions:{signOut:e=>{if(B(e.ownerDocument)===null)return{satisfied:!0};if(!e.querySelector(\"a#logout\"))throw new Error(\"Hacker News shows no logout link\");return{steps:[{click:\"a#logout\"}],navigates:!0}}}})}};var Ie={ready:U,regions:{stories:H({root:\"#hnmain\",items:\"tr.athing.submission\",key:e=>e.id,entityType:\"story\",read:se,extent:e=>[e.nextElementSibling],more:\"a.morelink\",actions:{setVoted:(e,t)=>z(e.ownerDocument,e.id,t)}}),comments:H({root:\"#hnmain\",items:\"tr.athing:not(.submission)\",key:e=>e.id,entityType:\"comment\",read:e=>X(e),more:\"a.morelink\",actions:{setVoted:(e,t)=>z(e.ownerDocument,e.id,t)}}),more:N({root:\"a.morelink\",read:ce})},actions:{loadMore:()=>({steps:[{click:\"a.morelink\"}],navigates:!0,expect:{page:[\"feed\",\"private-feed\"]}})}},We={...Ie,requiresAccount:!0};var Te=`\n\n`,Ke=e=>!e.href&&e.text.trim()===\"\";function jt(e,t){let n=[],r=()=>n[n.length-1];for(let i of e)if(i.text===Te)n.length>0&&r().text!==Te&&n.push(i);else if(i.code)n.push(i);else{let o=i.text.replace(/\\s*\\n\\s*/g,\" \");(n.length===0||r().text===Te)&&(o=o.trimStart()),o&&n.push({...i,text:o})}for(;n.length>0&&Ke(r());)n.pop();for(n[0]?.text.trim()===t&&n.shift();n.length>0&&Ke(n[0]);)n.shift();return n}function Vt(e){let t=e.ownerDocument,n=e.querySelector(\"#bigbox\")??e.querySelector(\"body\"),r=k(t.title.replace(/\\s*\\|\\s*Hacker News$/,\"\"),120)||\"Hacker News\";return{title:r,parts:jt(F(n,6e4),r)}}var Ze={ready:e=>e.readyState!==\"loading\"&&e.body!==null,account:e=>e.querySelector(\"#hnmain\")?B(e):void 0,regions:{sections:N({root:\"html\",read:Vt})}};function Ht(e){let t=e.querySelector(\"tr.athing\"),n=t?.matches(\".submission\")?se(t):null;return{story:n,comment:t&&!n?X(t,{links:!0}):null,text:F(e.querySelector(\".toptext\")),canComment:e.querySelector(\"form[action='comment'] textarea\")!==null}}function Xe(e){let t=e.querySelector(\"tr.athing\")?.id;if(t)return t;let n=new URLSearchParams(e.ownerDocument?.location?.search??\"\").get(\"id\");return C(n)?n:\"item\"}var Qe={ready:U,regions:{story:N({root:\"table.fatitem\",key:Xe,entityType:\"story\",read:Ht,actions:{setVoted:(e,t)=>z(e.ownerDocument,Xe(e),t)}}),comments:H({root:\"table.comment-tree\",items:\"tr.athing.comtr\",key:e=>e.id,entityType:\"comment\",read:e=>X(e),more:\"a.morelink\",actions:{setVoted:(e,t)=>z(e.ownerDocument,e.id,t)}}),more:N({root:\"a.morelink\",read:ce})}};var Q=\"form[action='/r']\",et=[\"title\",\"url\",\"text\"],tt=(e,t)=>e.querySelector(`[name='${t}']`);function Bt(e){let t=Object.fromEntries(et.map(i=>[i,tt(e,i)?.value??\"\"])),n=e.closest(\"#bigbox, td\")??e.parentElement,r=\"\";for(let i of n?.childNodes??[])i===e||i.tagName===\"SCRIPT\"||i.contains?.(e)||(r+=` ${i.textContent??\"\"}`);return{...t,error:k(r,300)||null}}var zt=e=>et.includes(e),nt={ready:e=>e.readyState!==\"loading\"&&e.querySelector(\"#hnmain\")!==null,account:e=>e.querySelector(Q)?void 0:null,requiresAccount:!0,regions:{form:N({root:Q,dependsOn:[\"#hnmain\"],fields:!0,read:Bt,actions:{setField:(e,t)=>{let{name:n,value:r}=t??{};if(!zt(n)||typeof r!=\"string\")throw new Error(\"setField needs { name: title | url | text, value }\");if(n===\"title\"&&r.length>80)throw new Error(`Titles are at most ${80} characters`);let i=tt(e,n);if(!i)throw new Error(`The form has no ${n} field`);return i.value===r?{satisfied:!0}:{steps:[{fill:`${Q} [name='${n}']`,value:r}],until:o=>o.querySelector(`${Q} [name='${n}']`)?.value===r}},submit:()=>({steps:[{submit:Q}],navigates:!0,expect:{page:[\"item\",\"feed\"],notPage:\"submit\"}})}})}};function Jt(e){let t=new Map;for(let r of e.querySelectorAll(\"tr\")){let[i,o]=r.querySelectorAll(\":scope > td\"),s=k(i?.textContent,20).replace(/:$/,\"\").toLowerCase();s&&o&&!t.has(s)&&t.set(s,o)}let n=k(t.get(\"user\")?.textContent,64);return n?{name:n,created:k(t.get(\"created\")?.textContent,40)||null,karma:k(t.get(\"karma\")?.textContent,20)||null,about:F(t.get(\"about\")??null,6e3)}:null}var rt={ready:U,regions:{profile:N({root:\"#bigbox\",read:Jt})}};var Wt=e=>{let{pathname:t,search:n}=new URL(e);return`/login?goto=${encodeURIComponent(t.slice(1)+n)}`},ot=ke({account:B,signInUrl:Wt,pages:{feed:Ie,\"private-feed\":We,item:Qe,user:rt,info:Ze,account:Je,submit:nt}});Ee(ot);})();\n"},{"path":"assets/yc.png","encoding":"base64","content":"iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABAKADAAQAAAABAAABAAAAAABn6hpJAAASy0lEQVR4Ae2dC7BVVRnHv8tDXgIiGYKaZqaJpphvMzV8oEim5Tg6mk2T+ZryNZlWSvioTC0zHRtL03FirCwQEAN8oKiQD3wiCgahkIC8BAR5yW1912vA5t7DOXt965y9zvqtGeWuffb6r2/9vnv/e52999q7ofF8uVXWy5nSID2lUSgQgEC9E2hwA2yURdJGhjY0nicLXaWH29Sm3sfN+CAAgf8TWO8O+kvauWrP/2/iBwhAIBUCesDv2YZpfyr5ZpwQyBBwX/mZ9meYUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCHQLlOnWopAhy4inbqX2qOyz1avEPlwaWVt6nHvtu1Fum5nMzLlqVwpZRHAAMrC1LzTtp8RGfyaSJu2lbRqfd/500WG9BVZ/1Hr+6TwyYAfiXz9ev+RKsdr9hKZN81fKxEFvgJUkui5b4hMureSFqX37bW7yIFnlN6n3j/t2FXkmMtsRvnM3fzxV0gSA6gQmIy6RmTtqkpbtb7/iVeJNCSchqMvEemybet8yv1EczLaYBZRbn91sl/Cv3k5M7hktsj423M2bqFZrz3cLOD0Fj5IYFPT0f9Sm4GOv01Ec0OpiAAGUBGu5p3H3GB78m5gorMAnfp37pEnA5u2WbVMZMyvNt1GrSwCGEBZmDI7rVgkMvbGzEaPau89RQ44zUMgwqZ6NUWn/xZF//g1J5SKCWAAFSNrbvD4rSLL5uVtvXm71GYBTUf/bTbnUOmWZfNFNBeUXAQwgFzYXCO91qwnBK1KH3f5av9TrdSKrdNZj/4X28T40BCu+3uQxAA84Iledloww0dh07YnXp3GFYFjf2hzQ9XCmSJPuxxQchPAAHKjcw0/Wivy4E99FDZt22dvkf2+sem2eqvpSb/+F9mM6kF38lRzQMlNAAPIja654eQHRGa/5KuyoX29zwKOc0f/jt02jDfvT3NeFXnhr3lb066ZAAbg+6vQuF5k2JW+Khva77iPSL+TN9Tr6acu7uj/1R/YjGjYFSLKnuJFAAPwwtfceOo4kWnjLZQ+1qjXWcBx7p5/vfnHt7z1lMjrY3xVaO8IYABWvwaWs4Cd+onse5JVZMXQ6dLTHf2/bxPLcMMZl01E0apgAFapm/WcyIv/sFITGTTYTqsISgMuF+mwtX8kr4wQmTHRXweFJgIYgOUvwgh3RcBqae9O+9XPLGBrd/Q/yuDor9/59cw/xYwABmCG0gnpOvSJ99gpnlgns4AB7oSdPkzFt0y6T+TdKb4qtN+IAAawEQyTH/XONKvlwjvvL7LPIJOwaiaiT/o58kL/7tetEXnI8M5L/4jqQgEDsE7jkv/a3pse+yzA6uj/5B0ii2ZZZyt5PQwgxK/AWLc6zepZf7scKLL3wBBRhtfs1ssd/S/w72f1ByL//IW/DgqbEcAANkNisGHFErc+3T0zwKrEekVAj/5bdfanMO5mkeUL/HVQ2IwABrAZEqMNukR16Vwbsc8eLLLX8TZa1VLptr07+p/v39sHC0Ue/Y2/DgotEsAAWsRisHHNh7YnrWKbBRzvbtZp38kf5OjrRFYt99dBoUUCGECLWIw2Pn2XyHtv2YjteqhI3+NstEKrdHdH/yPO8+9l8TsiE+7010GhVQIYQKtoDD7Qm4JGGN64MuhnBkFVQeKEn7ijf0f/jka45yOsW+2vg0KrBDCAVtEYfTD57yLvvGgj9rnDRPY8xkYrlMo2fUQO/56/+typIs/+2V8HhZIEMICSeAw+bFou7M6GW5WizwKsjv7Df8xyX6vfmRI6GEAJOGYfvfGoyJuP28jtdrjIF/rbaFmr9NjBHf3P8Ved+S+RV0b666CwRQIYwBYRGe1guYS1qLOAE9xiqHYd/IFZsvKPpq4VMIBqpXfW8265sDsfYFE+f4TI7kdZKNlp9NhJ5Mvf9deb8rDI9Cf9dVAoiwAGUBYmo510Kev6dTZiXyvYFYGBevTfym9sjY0iw50OpWoEMICqoXYdzZ8m8syfbHrUGYDOBIpQtt1Z5LDv+Efy/P0ic17210GhbAIYQNmojHZ86Fq3XNjdJWhRinIuYKC77u979NfHe48cbEEFjQoIYAAVwDLZ9X1dLvw7E6mmqwF6VaCWpecuNkf/p/5g+5KVWjKJqG8MoBbJ0pdZrnzfpudazwL0u3/b9n5jWbNSZPT1fhq0zkUAA8iFzbPRSsPlwnpnoN4hWIvyqV1FDv22f8+P3mL7olX/iJJRwABqlWr9GvD+uza912oWYHH0X7FYZNxNNhxQqZgABlAxMqMGeiLQ6hl3ukpw14ONAitTpunof3aZO5fYbcwv7Z6eVKIbPmqZAAbQMpfqbNW3C8+fbtPXoCE2OuWq6NuL2rQrd++W99MTouNva/kztlaFAAZQFcytdKLLha3eLqxPDNrloFY6Mt786d1EDjnLX3Sku5lpLct9/UHmV8AA8rOzafnSMJG3X7DRqtbdgRZHf70patK9NuNGJTcBDCA3OqOGulxYl75aFH16sL5LIGTRo/9BZ/r3oDMfq7co+UeTrAIGUITU63LhNx6xiST0uQC94tCmrV+sOuOxfI+iXzRJt8YAipL+pgdgNPpHo28SCjUL6LWHyIFn+MdoNePxjyR5BQygKL8Cb08WmfyATTSh3iakTyb2PfrrTEdnPJRCEMAACpGG5iBGuktrFsuF9z1JRN8ubFm216P/6f6KHP39GRoqYACGML2l9J6Ap929ARZlkDMTy6LnFho8f110hqMzHUphCHhmtDDjqJ9ARl9rs1x435NFduxnw6V3X5EDTvPTanpEurEp+UVEa0cAAyjar4GuD3jMvVbMtzQ0iFjNAvS7v+/Rv+muR3ftn1IoAhhAodLRHMzYG9xyYbdi0Lf0O0Vkhy/6qfRxR//9PY/+a1e5dQ9uZkMpHAEMoHApcQGtXOpeh+0WyfiWplmAO3r7lKbv/m424VP0Ral63z+lcAQwgMKlpDmg8bfb/NHs902RPnvnG6XOHr50ar62n7T60JnZWPcAFEohCWAAhUyLC0qXC48a4h+dzgL0mX15StN3f8+jv/7xrzD4OpMnftpskQAGsEVENdxh4j0fP0nYNwT9Dq/38FdSdNagswefsmyeO6H5Wx8F2gYmgAEEBuwlb7VcWO/eO/7KykLRFX86e/Apo64RWeNmMpTCEsAACpua5sB00Yy+Vci3HPwtkW12KE+l957uzL/nd/8FM9w7EO4urz/2qhkBDKBm6Cvo2OJdefrc/mMuLa9TfcOv73X/EVeJ6LP+KYUmgAEUOj3NwembhaeO84/0K+eKdO5eWkfPFfiu+Jv9ssgLfyvdD58WggAGUIg0lBGExXLhjl1FjrigdGd6rsB3xV9TrOtL98OnhSCAARQiDWUE8c6LbrmwwVG1/0XuNV6tvMhD3/B7yNllBFNiF32z7+tjSuzAR0UigAEUKRtbikW/V/suF+7e2z3S66yWexpwuf9bfoZf0bI2WwtJAAMoZFpaCeq9f7vlwne18mEFm4+9bPOdu24ncvg5m2+vZMvLw0VmPltJC/atMQEMoMYJqLh7fZmIvkvPp+hNPvoykY3L0e4KQftOG2+p7Gd9uOmDboZCiYoABhBVulywS43urtv4kqCeHDzqQj8Sk+4TmTvVT4PWVSeAAVQduUGHY29099cv9hPqO0BEH/Ol5Uj3x99pC5cHP96z5f+vW22zbqFldbYGJIABBIQbTFpX2Ok79XyK3ubb/2J3RaCDu0HoEh8lkSfuEFn8tp8GrWtCAAOoCXaDTvWdekvm+AnpJb+jnQl02z6/zqrl7tkFP8/fnpY1JYAB1BS/R+f6Tj3f5cIduoic4jmTeORmkQ8WeQyEprUkgAHUkr5v35PuFZn3pp+Kzz3/yxeIPPJrv/5pXVMCGEBN8Xt2brVcOG8YD18vsnpF3ta0KwABDKAASfAKQd8u/J8a3HyzaJbIhN97hU7j2hPAAGqfA/8IhrkFPNUuIweLrGO5b7WxW/eHAVgTrYXe9CfcApyx1ev53Skizw6tXn/0FIwABhAMbZWFLZYLlxvycPfAEL31lxI9AQwg+hQ2D2D2S+4hHH8JP5oZE0VeHRW+H3qoCgEMoCqYq9TJiKvDP4aLt/tWKZnV6QYDqA7n6vSiD+J86o/h+npttMhbE8Lpo1x1AhhA1ZEH7nD0dWGuzTct9835gpHAQ0Y+PwEMID+7YrYM9TKO5+4XmfNqMcdMVLkJYAC50RW44bib3HJhw/vz9fHeet2fUncEMIC6S6kbkC4Xtni78CdsJtwpsnDmJzX+rSMCGEAdJXOToTzh3i68ZPYmm3JV9F5/veefUpcEMIC6TKsblC4Xnjbef3SP3SKybL6/DgqFJIABFDItBQpqCs/4L1A2zEPBAMyRIgiBeAhgAPHkikghYE4AAzBHiiAE4iGAAcSTKyKFgDkBDMAcKYIQiIcABhBProgUAuYEMABzpAhCIB4CGEA8uSJSCJgTwADMkSIIgXgIYADx5IpIIWBOAAMwR4ogBOIhgAHEkysihYA5AQzAHCmCEIiHAAYQT66IFALmBDAAc6QIQiAeAhhAPLkiUgiYE8AAzJEiCIF4CGAA8eSKSCFgTgADMEeKIATiIYABxJMrIoWAOQEMwBwpghCIhwAGEE+uiBQC5gQwAHOkCEIgHgIYQDy5IlIImBPAAMyRIgiBeAhgAPHkikghYE4AAzBHiiAE4iGAAcSTKyKFgDkBDMAcKYIQiIcABhBProgUAuYEMABzpAhCIB4CGEA8uSJSCJgTwADMkSIIgXgIYADx5IpIIWBOAAMwR4ogBOIhgAHEkysihYA5AQzAHCmCEIiHAAYQT66IFALmBDAAc6QIQiAeAhhAPLkiUgiYE8AAzJEiCIF4CGAA8eSKSCFgTgADMEeKIATiIYABxJMrIoWAOQEMwBwpghCIhwAGEE+uiBQC5gQwAHOkCEIgHgIYQDy5IlIImBPAAMyRIgiBeAhgAPHkikghYE4AAzBHiiAE4iGAAcSTKyKFgDmBhsZzpdFcFUEIQCAKAswAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAyBNtIQRhhVCECg4ATc377OABa5/9YXPFTCgwAEbAno3/winQEMdT8sYSZgSxc1CBSWwMezfv2bH/o/4JuJLNSc5H4AAAAASUVORK5CYII="},{"path":"foreground.css","encoding":"utf8","content":":root{color-scheme:light;--paper: #faf7f2;--card: #ffffff;--ink: #24211c;--muted: #655d53;--accent: #b93800;--wash: #f3e9dc;--line: #e5d9ca;--danger: #a52525;--skeleton: #e9e6e1;--font: Verdana, Geneva, \"DejaVu Sans\", sans-serif;--edge: 16px;--radius: 12px;--tabs: 64px}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--paper: #1d1b18;--card: #282520;--ink: #f5eee4;--muted: #c4b8a9;--accent: #ff995f;--wash: #363027;--line: #52483c;--danger: #ff9d96;--skeleton: #34312d}}@media(prefers-contrast:more){:root{--line: var(--muted)}}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}html,body{background:var(--paper);color:var(--ink);font:15px/1.5 var(--font)}button,input,textarea{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}a{color:inherit;text-underline-offset:2px}a,button{overflow-wrap:anywhere}button{cursor:pointer}button:disabled{opacity:.55;cursor:default}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}svg.filled{fill:currentColor}.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.app{display:flex;flex-direction:column;height:100%}.content{flex:1;min-height:0}.screen{height:100%;overflow-y:auto;padding:8px var(--edge) 32px}.screen:before{content:\"\";float:right;width:44px;height:44px}.screen-title{font-size:1.45rem;line-height:1.25;margin:12px 0 8px;overflow-wrap:anywhere}.section-title{font-size:1rem;margin:24px 0 4px}.eyebrow{margin:12px 0 0;color:var(--muted);font-size:.8rem;letter-spacing:.06em;text-transform:uppercase}.meta{margin:2px 0 0;color:var(--muted);font-size:.85rem}.meta a{color:var(--muted)}.tabs{display:flex;flex:none;min-height:var(--tabs);background:var(--card);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;border:0;background:none;color:var(--muted);font-size:.72rem}.tab[aria-current=page]{color:var(--accent);font-weight:700}.primary,.secondary,.danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:0 18px;margin:8px 8px 0 0;border-radius:999px;font-weight:700}.primary{border:0;background:var(--accent);color:var(--card)}.secondary{border:1px solid var(--line);background:var(--card)}.danger{border:0;background:var(--danger);color:var(--card)}.secondary svg,.primary svg{width:16px;height:16px}.text-button{min-height:48px;min-width:48px;padding:0 8px;border:0;background:none;color:var(--accent);font-weight:700}.danger-text{color:var(--danger)}.icon-button{display:inline-grid;place-items:center;width:48px;height:48px;flex:none;border:0;border-radius:50%;background:none;color:var(--muted)}.more{width:100%;margin:16px 0 0}input:not([type=checkbox]),textarea{width:100%;min-height:48px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--card)}textarea{resize:vertical}.chips{display:flex;gap:8px;overflow-x:auto;margin:4px 0;padding:8px 0;scrollbar-width:none}.chip{flex:none;min-height:40px;padding:0 16px;border:1px solid var(--line);border-radius:999px;background:var(--card)}.chip[aria-pressed=true]{border-color:var(--accent);background:var(--wash);color:var(--accent);font-weight:700}.story{display:flex;align-items:flex-start;gap:4px;padding:10px 0;border-bottom:1px solid var(--line)}.story-body{flex:1;min-width:0;padding-top:4px}.story-title{margin:0;font-size:15px;font-weight:400;line-height:21px;overflow-wrap:anywhere}h1.story-title{font-size:1.25rem;line-height:1.3;font-weight:700}.story-title a{text-decoration:none}.domain{color:var(--muted);font-size:.8rem;font-weight:400}.rank{width:24px;flex:none;padding-top:16px;color:var(--muted);font-size:.8rem;text-align:right}.vote{display:inline-grid;place-items:center;width:40px;min-height:48px;flex:none;color:var(--muted)}.vote.voted{color:var(--accent)}.vote svg{width:18px;height:18px}.vote.small{width:32px;min-height:40px;margin-left:-8px}.vote.small svg{width:14px;height:14px}.comment{padding:10px 0 10px calc(var(--depth, 0) * 12px);border-bottom:1px solid var(--line)}.comment>*{border-left:2px solid transparent}.comment[style*=\"--depth: 0\"]>*{border-left:0}.comment-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.comment-head .meta{flex:1}.comment-head .text-button{min-height:40px;font-size:.8rem}.comment-links{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:4px;font-size:.8rem}.comment-links a{color:var(--muted);display:inline-flex;align-items:center;gap:3px;min-height:32px}.comment-links svg{width:12px;height:12px}.rich{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:4px}.rich a{color:var(--accent)}.rich code{font-family:ui-monospace,Menlo,monospace;font-size:.9em}.toptext{padding:12px 0;border-bottom:1px solid var(--line)}.card{margin:12px 0;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}.card h2{margin:0;font-size:1.15rem}.list{display:flex;flex-direction:column;margin:12px 0;border:1px solid var(--line);border-radius:var(--radius);background:var(--card);overflow:hidden}.list button{display:flex;align-items:center;justify-content:space-between;min-height:52px;padding:0 16px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.list button:last-child{border-bottom:0}.list svg{width:16px;height:16px;color:var(--muted)}.facts{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;margin:8px 0}.facts dt{color:var(--muted)}.facts dd{margin:0}.notice{margin:24px 0;padding:20px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}.notice h2{margin:0 0 6px;font-size:1.05rem}.notice p{margin:0;color:var(--muted)}.inline-error,.field-error{color:var(--danger);font-size:.9rem}.status{padding:10px 12px;border-radius:10px;background:var(--wash)}.confirm{margin:12px 0;padding:12px 14px;border:1px solid var(--danger);border-radius:var(--radius)}.confirm p{margin:0}.form{display:flex;flex-direction:column;gap:14px;margin-top:8px}.form label{display:flex;flex-direction:column;gap:6px;font-weight:700}.form label .meta,.form .field-error{font-weight:400}.form .primary{margin-right:0}fieldset{min-width:0}fieldset.card legend{padding:0 4px;font-weight:700}.check{display:flex;align-items:center;gap:12px;min-height:48px}.check input{width:22px;height:22px;accent-color:var(--accent)}.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}.row .grow{flex:1 1 160px}.row .primary,.row .secondary{margin:0}.actions{display:flex;flex-wrap:wrap;align-items:center;margin-top:8px}.search-field{display:block;margin:4px 0 8px}.category{padding:8px 0;border-top:1px solid var(--line)}.skeleton{padding-top:8px}.skeleton-row{padding:14px 0;border-bottom:1px solid var(--line)}.skeleton-row span{display:block;height:14px;border-radius:4px;background:var(--skeleton)}.skeleton-row span+span{width:45%;height:10px;margin-top:8px}.skeleton.text .skeleton-row{border-bottom:0;padding:8px 0}\n"},{"path":"foreground.js","encoding":"utf8","content":"\"use strict\";(()=>{var h0=Object.create;var Kf=Object.defineProperty;var p0=Object.getOwnPropertyDescriptor;var b0=Object.getOwnPropertyNames;var S0=Object.getPrototypeOf,E0=Object.prototype.hasOwnProperty;var $t=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var T0=(e,t,n,l)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let a of b0(t))!E0.call(e,a)&&a!==n&&Kf(e,a,{get:()=>t[a],enumerable:!(l=p0(t,a))||l.enumerable});return e};var U=(e,t,n)=>(n=e!=null?h0(S0(e)):{},T0(t||!e||!e.__esModule?Kf(n,\"default\",{value:e,enumerable:!0}):n,e));var Ed=$t(D=>{\"use strict\";var Ac=Symbol.for(\"react.transitional.element\"),Z0=Symbol.for(\"react.portal\"),K0=Symbol.for(\"react.fragment\"),J0=Symbol.for(\"react.strict_mode\"),I0=Symbol.for(\"react.profiler\"),F0=Symbol.for(\"react.consumer\"),$0=Symbol.for(\"react.context\"),W0=Symbol.for(\"react.forward_ref\"),P0=Symbol.for(\"react.suspense\"),ep=Symbol.for(\"react.memo\"),md=Symbol.for(\"react.lazy\"),tp=Symbol.for(\"react.activity\"),np=Symbol.for(\"react.view_transition\"),rd=Symbol.iterator;function lp(e){return e===null||typeof e!=\"object\"?null:(e=rd&&e[rd]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var gd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vd=Object.assign,yd={};function $l(e,t,n){this.props=e,this.context=t,this.refs=yd,this.updater=n||gd}$l.prototype.isReactComponent={};$l.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};$l.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function hd(){}hd.prototype=$l.prototype;function zc(e,t,n){this.props=e,this.context=t,this.refs=yd,this.updater=n||gd}var _c=zc.prototype=new hd;_c.constructor=zc;vd(_c,$l.prototype);_c.isPureReactComponent=!0;var sd=Array.isArray;function Oc(){}var se={H:null,A:null,T:null,S:null},pd=Object.prototype.hasOwnProperty;function Cc(e,t,n){var l=n.ref;return{$$typeof:Ac,type:e,key:t,ref:l!==void 0?l:null,props:n}}function ap(e,t){return Cc(e.type,t,e.props)}function Mc(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===Ac}function up(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(n){return t[n]})}var fd=/\\/+/g;function Nc(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?up(\"\"+e.key):t.toString(36)}function ip(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(Oc,Oc):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function Fl(e,t,n,l,a){var u=typeof e;(u===\"undefined\"||u===\"boolean\")&&(e=null);var i=!1;if(e===null)i=!0;else switch(u){case\"bigint\":case\"string\":case\"number\":i=!0;break;case\"object\":switch(e.$$typeof){case Ac:case Z0:i=!0;break;case md:return i=e._init,Fl(i(e._payload),t,n,l,a)}}if(i)return a=a(e),i=l===\"\"?\".\"+Nc(e,0):l,sd(a)?(n=\"\",i!=null&&(n=i.replace(fd,\"$&/\")+\"/\"),Fl(a,t,n,\"\",function(f){return f})):a!=null&&(Mc(a)&&(a=ap(a,n+(a.key==null||e&&e.key===a.key?\"\":(\"\"+a.key).replace(fd,\"$&/\")+\"/\")+i)),t.push(a)),1;i=0;var o=l===\"\"?\".\":l+\":\";if(sd(e))for(var c=0;c{\"use strict\";Td.exports=Ed()});var Dd=$t(ge=>{\"use strict\";function wc(e,t){var n=e.length;e.push(t);e:for(;0>>1,a=e[l];if(0>>1;lvi(o,n))cvi(f,o)?(e[l]=f,e[c]=n,l=c):(e[l]=o,e[i]=n,l=i);else if(cvi(f,n))e[l]=f,e[c]=n,l=c;else break e}}return t}function vi(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}ge.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(Nd=performance,ge.unstable_now=function(){return Nd.now()}):(xc=Date,Od=xc.now(),ge.unstable_now=function(){return xc.now()-Od});var Nd,xc,Od,hn=[],Gn=[],rp=1,Mt=null,Qe=3,Uc=!1,tu=!1,nu=!1,Hc=!1,_d=typeof setTimeout==\"function\"?setTimeout:null,Cd=typeof clearTimeout==\"function\"?clearTimeout:null,Ad=typeof setImmediate<\"u\"?setImmediate:null;function yi(e){for(var t=Wt(Gn);t!==null;){if(t.callback===null)hi(Gn);else if(t.startTime<=e)hi(Gn),t.sortIndex=t.expirationTime,wc(hn,t);else break;t=Wt(Gn)}}function Gc(e){if(nu=!1,yi(e),!tu)if(Wt(hn)!==null)tu=!0,Pl||(Pl=!0,Wl());else{var t=Wt(Gn);t!==null&&Lc(Gc,t.startTime-e)}}var Pl=!1,lu=-1,Md=5,xd=-1;function Rd(){return Hc?!0:!(ge.unstable_now()-xde&&Rd());){var l=Mt.callback;if(typeof l==\"function\"){Mt.callback=null,Qe=Mt.priorityLevel;var a=l(Mt.expirationTime<=e);if(e=ge.unstable_now(),typeof a==\"function\"){Mt.callback=a,yi(e),t=!0;break t}Mt===Wt(hn)&&hi(hn),yi(e)}else hi(hn);Mt=Wt(hn)}if(Mt!==null)t=!0;else{var u=Wt(Gn);u!==null&&Lc(Gc,u.startTime-e),t=!1}}break e}finally{Mt=null,Qe=n,Uc=!1}t=void 0}}finally{t?Wl():Pl=!1}}}var Wl;typeof Ad==\"function\"?Wl=function(){Ad(Rc)}:typeof MessageChannel<\"u\"?(Dc=new MessageChannel,zd=Dc.port2,Dc.port1.onmessage=Rc,Wl=function(){zd.postMessage(null)}):Wl=function(){_d(Rc,0)};var Dc,zd;function Lc(e,t){lu=_d(function(){e(ge.unstable_now())},t)}ge.unstable_IdlePriority=5;ge.unstable_ImmediatePriority=1;ge.unstable_LowPriority=4;ge.unstable_NormalPriority=3;ge.unstable_Profiling=null;ge.unstable_UserBlockingPriority=2;ge.unstable_cancelCallback=function(e){e.callback=null};ge.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=n,wc(Gn,e),Wt(hn)===null&&e===Wt(Gn)&&(nu?(Cd(lu),lu=-1):nu=!0,Lc(Gc,n-l))):(e.sortIndex=a,wc(hn,e),tu||Uc||(tu=!0,Pl||(Pl=!0,Wl()))),e};ge.unstable_shouldYield=Rd;ge.unstable_wrapCallback=function(e){var t=Qe;return function(){var n=Qe;Qe=t;try{return e.apply(this,arguments)}finally{Qe=n}}}});var Ud=$t((tE,wd)=>{\"use strict\";wd.exports=Dd()});var Ld=$t(Xe=>{\"use strict\";var sp=mt();function Gd(e){var t=\"https://react.dev/errors/\"+e;if(1{\"use strict\";function Bd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bd)}catch(e){console.error(e)}}Bd(),qd.exports=Ld()});var zh=$t(ec=>{\"use strict\";var Ce=Ud(),Ag=mt(),gp=Vd();function E(e){var t=\"https://react.dev/errors/\"+e;if(1ca||(e.current=Nr[ca],Nr[ca]=null,ca--)}function me(e,t){ca++,Nr[ca]=e.current,e.current=t}var rn=dn(null),Mu=dn(null),Fn=dn(null),uo=dn(null);function io(e,t){switch(me(Fn,t),me(Mu,e),me(rn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ag(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ag(t),e=th(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}Ve(rn),me(rn,e)}function Ca(){Ve(rn),Ve(Mu),Ve(Fn)}function Or(e){var t=e.memoizedState;t!==null&&(Ba._currentValue=t.memoizedState,me(uo,e)),t=rn.current;var n=th(t,e.type);t!==n&&(me(Mu,e),me(rn,n))}function oo(e){Mu.current===e&&(Ve(rn),Ve(Mu)),uo.current===e&&(Ve(uo),Ba._currentValue=Ol)}var Bc,Xd;function qn(e){if(Bc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);Bc=t&&t[1]||\"\",Xd=-1)\":-1a||c[l]!==f[a]){var g=`\n`+c[l].replace(\" at new \",\" at \");return e.displayName&&g.includes(\"\")&&(g=g.replace(\"\",e.displayName)),g}while(1<=l&&0<=a);break}}}finally{qc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?qn(n):\"\"}function Np(e,t){switch(e.tag){case 26:case 27:case 5:return qn(e.type);case 16:return qn(\"Lazy\");case 13:return e.child!==t&&t!==null?qn(\"Suspense Fallback\"):qn(\"Suspense\");case 19:return qn(\"SuspenseList\");case 0:case 15:return Vc(e.type,!1);case 11:return Vc(e.type.render,!1);case 1:return Vc(e.type,!0);case 31:return qn(\"Activity\");case 30:return qn(\"ViewTransition\");default:return\"\"}}function Zd(e){try{var t=\"\",n=null;do t+=Np(e,n),n=e,e=e.return;while(e);return t}catch(l){return`\nError generating stack: `+l.message+`\n`+l.stack}}var Ar=Object.prototype.hasOwnProperty,Cs=Ce.unstable_scheduleCallback,Yc=Ce.unstable_cancelCallback,Op=Ce.unstable_shouldYield,Ap=Ce.unstable_requestPaint,bt=Ce.unstable_now,zp=Ce.unstable_getCurrentPriorityLevel,Ug=Ce.unstable_ImmediatePriority,Hg=Ce.unstable_UserBlockingPriority,co=Ce.unstable_NormalPriority,_p=Ce.unstable_LowPriority,Gg=Ce.unstable_IdlePriority,Cp=Ce.log,Mp=Ce.unstable_setDisableYieldValue,Zu=null,St=null;function Qn(e){if(typeof Cp==\"function\"&&Mp(e),St&&typeof St.setStrictMode==\"function\")try{St.setStrictMode(Zu,e)}catch{}}var Et=Math.clz32?Math.clz32:Dp,xp=Math.log,Rp=Math.LN2;function Dp(e){return e>>>=0,e===0?32:31-(xp(e)/Rp|0)|0}var Si=256,Ei=262144,Ti=4194304;function bl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ho(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,u=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~u,l!==0?a=bl(l):(i&=o,i!==0?a=bl(i):n||(n=o&~e,n!==0&&(a=bl(n))))):(o=l&~u,o!==0?a=bl(o):i!==0?a=bl(i):n||(n=l&~e,n!==0&&(a=bl(n)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:a}function Ku(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Lg(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Ju(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Up(e,t,n,l,a,u){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,f=e.hiddenUpdates;for(n=i&~n;0\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),Mr=!1;if(On)try{ea={},Object.defineProperty(ea,\"passive\",{get:function(){Mr=!0}}),window.addEventListener(\"test\",ea,ea),window.removeEventListener(\"test\",ea,ea)}catch{Mr=!1}var ea,Xn=null,ws=null,ki=null;function Pg(){if(ki)return ki;var e,t=ws,n=t.length,l,a=\"value\"in Xn?Xn.value:Xn.textContent,u=a.length;for(e=0;e=yu),um=\" \",im=!1;function tv(e,t){switch(e){case\"keyup\":return y1.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function nv(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var sa=!1;function p1(e,t){switch(e){case\"compositionend\":return nv(t);case\"keypress\":return t.which!==32?null:(im=!0,um);case\"textInput\":return e=t.data,e===um&&im?null:e;default:return null}}function b1(e,t){if(sa)return e===\"compositionend\"||!Hs&&tv(e,t)?(e=Pg(),ki=ws=Xn=null,sa=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function sm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fm(e,t){var n=sm(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sm(n)}}function iv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?iv(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ov(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=xr(e.document)}return t}function Gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var _1=On&&\"documentMode\"in document&&11>=document.documentMode,fa=null,Rr=null,pu=null,Dr=!1;function dm(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||fa==null||fa!==xr(l)||(l=fa,\"selectionStart\"in l&&Gs(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),pu&&Du(pu,l)||(pu=l,l=Do(Rr,\"onSelect\"),0>=i,a-=i,on=1<<32-Et(t)+a|n<_?(Y=A,A=null):Y=A.sibling;var M=r(v,A,h[_],S);if(M===null){A===null&&(A=Y);break}e&&A&&M.alternate===null&&t(v,A),d=u(M,d,_),C===null?O=M:C.sibling=M,C=M,A=Y}if(_===h.length)return n(v,A),H&&Sn(v,_),O;if(A===null){for(;__?(Y=A,A=null):Y=A.sibling;var F=r(v,A,M.value,S);if(F===null){A===null&&(A=Y);break}e&&A&&F.alternate===null&&t(v,A),d=u(F,d,_),C===null?O=F:C.sibling=F,C=F,A=Y}if(M.done)return n(v,A),H&&Sn(v,_),O;if(A===null){for(;!M.done;_++,M=h.next())M=m(v,M.value,S),M!==null&&(d=u(M,d,_),C===null?O=M:C.sibling=M,C=M);return H&&Sn(v,_),O}for(A=l(A);!M.done;_++,M=h.next())M=s(A,v,_,M.value,S),M!==null&&(e&&(Y=M.alternate,Y!==null&&A.delete(Y.key===null?_:Y.key)),d=u(M,d,_),C===null?O=M:C.sibling=M,C=M);return e&&A.forEach(function(Fe){return t(v,Fe)}),H&&Sn(v,_),O}function T(v,d,h,S){if(typeof h==\"object\"&&h!==null&&h.type===oa&&h.key===null&&h.props.ref===void 0&&(h=h.props.children),typeof h==\"object\"&&h!==null){switch(h.$$typeof){case bi:e:{for(var O=h.key;d!==null;){if(d.key===O){if(O=h.type,O===oa){if(d.tag===7){n(v,d.sibling),S=a(d,h.props.children),Bn(S,h),S.return=v,v=S;break e}}else if(d.elementType===O||typeof O==\"object\"&&O!==null&&O.$$typeof===Yn&&Sl(O)===d.type){n(v,d.sibling),S=a(d,h.props),Bn(S,h),S.return=v,v=S;break e}n(v,d);break}else t(v,d);d=d.sibling}h.type===oa?(S=Al(h.props.children,v.mode,S,h.key),Bn(S,h),S.return=v,v=S):(S=Qi(h.type,h.key,h.props,null,v.mode,S),Bn(S,h),S.return=v,v=S)}return i(v);case fu:e:{for(O=h.key;d!==null;){if(d.key===O)if(d.tag===4&&d.stateNode.containerInfo===h.containerInfo&&d.stateNode.implementation===h.implementation){n(v,d.sibling),S=a(d,h.children||[]),S.return=v,v=S;break e}else{n(v,d);break}else t(v,d);d=d.sibling}S=$c(h,v.mode,S),S.return=v,v=S}return i(v);case Yn:return h=Sl(h),T(v,d,h,S)}if(du(h))return p(v,d,h,S);if(uu(h)){if(O=uu(h),typeof O!=\"function\")throw Error(E(150));return h=O.call(h),b(v,d,h,S)}if(typeof h.then==\"function\")return T(v,d,Ci(h),S);if(h.$$typeof===an)return T(v,d,_i(v,h),S);Mi(v,h)}return typeof h==\"string\"&&h!==\"\"||typeof h==\"number\"||typeof h==\"bigint\"?(h=\"\"+h,d!==null&&d.tag===6?(n(v,d.sibling),S=a(d,h),S.return=v,v=S):(n(v,d),S=Fc(h,v.mode,S),S.return=v,v=S),i(v)):n(v,d)}return function(v,d,h,S){try{Hu=0;var O=T(v,d,h,S);return Ta=null,O}catch(A){if(A===ja||A===jo)throw A;var C=ct(29,A,null,v.mode);return C.lanes=S,C.return=v,C}}}var wl=Tv(!0),Nv=Tv(!1),kn=!1;function Qs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Br(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(X&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=fo(e),gv(e,null,n),t}return Yo(e,l,t,n),fo(e)}function Su(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Vg(e,n)}}function Pc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?a=u=i:u=u.next=i,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qr=!1;function Eu(){if(qr){var e=Ea;if(e!==null)throw e}}function Tu(e,t,n,l){qr=!1;var a=e.updateQueue;kn=!1;var u=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,f=c.next;c.next=null,i===null?u=f:i.next=f,i=c;var g=e.alternate;g!==null&&(g=g.updateQueue,o=g.lastBaseUpdate,o!==i&&(o===null?g.firstBaseUpdate=f:o.next=f,g.lastBaseUpdate=c))}if(u!==null){var m=a.baseState;i=0,g=f=c=null,o=u;do{var r=o.lane&-536870913,s=r!==o.lane;if(s?(B&r)===r:(l&r)===r){r!==0&&r===Dl&&(qr=!0),g!==null&&(g=g.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var p=e,b=o;r=t;var T=n;switch(b.tag){case 1:if(p=b.payload,typeof p==\"function\"){m=p.call(T,m,r);break e}m=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=b.payload,r=typeof p==\"function\"?p.call(T,m,r):p,r==null)break e;m=ue({},m,r);break e;case 2:kn=!0}}r=o.callback,r!==null&&(e.flags|=64,s&&(e.flags|=8192),s=a.callbacks,s===null?a.callbacks=[r]:s.push(r))}else s={lane:r,tag:o.tag,payload:o.payload,callback:o.callback,next:null},g===null?(f=g=s,c=m):g=g.next=s,i|=r;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;s=o,o=s.next,s.next=null,a.lastBaseUpdate=s,a.shared.pending=null}}while(!0);g===null&&(c=m),a.baseState=c,a.firstBaseUpdate=f,a.lastBaseUpdate=g,u===null&&(a.shared.lanes=0),sl|=i,e.lanes=i,e.memoizedState=m}}function Ov(e,t){if(typeof e!=\"function\")throw Error(E(191,e));e.call(t)}function Av(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eu?u:8;var i=R.T,o={};o.types=i!==null?i.types:null,R.T=o,af(e,!1,t,n);try{var c=a(),f=R.S;if(f!==null&&f(o,c),c!==null&&typeof c==\"object\"&&typeof c.then==\"function\"){var g=B1(c,l);Nu(e,t,g,Tt(e))}else Nu(e,t,l,Tt(e))}catch(m){Nu(e,t,{then:function(){},status:\"rejected\",reason:m},Tt())}finally{Z.p=u,i!==null&&o.types!==null&&(i.types=o.types),R.T=i}}function Q1(){}function Qr(e,t,n,l){if(e.tag!==5)throw Error(E(476));var a=Fv(e).queue;Iv(e,a,t,Ol,n===null?Q1:function(){return $v(e),n(l)})}function Fv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ol,baseState:Ol,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_n,lastRenderedState:Ol},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_n,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $v(e){var t=Fv(e);t.next===null&&(t=e.alternate.memoizedState),Nu(e,t.next.queue,{},Tt())}function lf(){return qe(Ba)}function Wv(){return Ee().memoizedState}function Pv(){return Ee().memoizedState}function X1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=Wn(n);var l=Pn(t,e,n);l!==null&&(rt(l,t,n),Su(l,t,n)),t={cache:Ys()},e.payload=t;return}t=t.return}}function Z1(e,t,n){var l=Tt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ko(e)?ty(t,n):(n=Bs(e,t,n,l),n!==null&&(rt(n,e,l),ny(n,t,l)))}function ey(e,t,n){var l=Tt();Nu(e,t,n,l)}function Nu(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ko(e))ty(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,o=u(i,n);if(a.hasEagerState=!0,a.eagerState=o,Nt(o,i))return Yo(e,t,a,0),ae===null&&Vo(),!1}catch{}if(n=Bs(e,t,a,l),n!==null)return rt(n,e,l),ny(n,t,l),!0}return!1}function af(e,t,n,l){if(l={lane:2,revertLane:yf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ko(e)){if(t)throw Error(E(479))}else t=Bs(e,n,l,2),t!==null&&rt(t,e,2)}function Ko(e){var t=e.alternate;return e===w||t!==null&&t===w}function ty(e,t){Na=bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ny(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Vg(e,n)}}var Eo={readContext:qe,use:Xo,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useLayoutEffect:he,useInsertionEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useSyncExternalStore:he,useId:he,useHostTransitionStatus:he,useFormState:he,useActionState:he,useOptimistic:he,useMemoCache:he,useCacheRefresh:he,useEffectEvent:he},ly={readContext:qe,use:Xo,useCallback:function(e,t){return nt().memoizedState=[e,t===void 0?null:t],e},useContext:qe,useEffect:Cm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ji(4194308,4,Qv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ji(4194308,4,e,t)},useInsertionEffect:function(e,t){Ji(4,2,e,t)},useMemo:function(e,t){var n=nt();t=t===void 0?null:t;var l=e();if(Ul){Qn(!0);try{e()}finally{Qn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=nt();if(n!==void 0){var a=n(t);if(Ul){Qn(!0);try{n(t)}finally{Qn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Z1.bind(null,w,e),[l.memoizedState,e]},useRef:function(e){var t=nt();return e={current:e},t.memoizedState=e},useState:function(e){e=kr(e);var t=e.queue,n=ey.bind(null,w,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:tf,useDeferredValue:function(e,t){var n=nt();return nf(n,e,t)},useTransition:function(){var e=kr(!1);return e=Iv.bind(null,w,e.queue,!0,!1),nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=w,a=nt();if(H){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),ae===null)throw Error(E(349));(B&127)!==0||xv(l,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,Cm(Dv.bind(null,l,u,e),[e]),l.flags|=2048,Ra(9,{destroy:void 0},Rv.bind(null,l,u,n,t),null),n},useId:function(){var e=nt(),t=ae.identifierPrefix;if(H){var n=cn,l=on;n=(l&~(1<<32-Et(l)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=So++,0<\\/script>\",u=u.removeChild(u.firstChild);break;case\"select\":u=typeof l.is==\"string\"?i.createElement(\"select\",{is:l.is}):i.createElement(\"select\"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is==\"string\"?i.createElement(a,{is:l.is}):i.createElement(a)}}u[Be]=t,u[ft]=l;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=u;e:switch(ke(u,a,l),a){case\"button\":case\"input\":case\"select\":case\"textarea\":l=!!l.autoFocus;break e;case\"img\":l=!0;break e;default:l=!1}l&&bn(t)}}return fe(t),t.subtreeFlags&=-33554433,lr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&bn(t);else{if(typeof l!=\"string\"&&t.stateNode===null)throw Error(E(166));if(e=Fn.current,ta(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=De,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Be]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||eh(e.nodeValue,n)),e||ol(t,!0)}else e=Vu(e).createTextNode(l),e[Be]=t,t.stateNode=e}return fe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=ta(t),n!==null){if(e===null){if(!l)throw Error(E(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(557));e[Be]=t}else Ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;fe(t),e=!1}else n=Wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(E(558))}return fe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ta(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(E(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(E(317));a[Be]=t}else Ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;fe(t),a=!1}else a=Wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Di(t,t.updateQueue),fe(t),null);case 4:return Ca(),e===null&&hf(t.stateNode.containerInfo),t.flags|=67108864,fe(t),null;case 10:return Nn(t.type),fe(t),null;case 19:if(Zs(t),l=t.memoizedState,l===null)return fe(t),null;if(a=(t.flags&128)!==0,u=l.rendering,u===null)if(a)ou(l,!1);else{if(pe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=po(e),u!==null){for(t.flags|=128,ou(l,!1),e=u.updateQueue,t.updateQueue=e,Di(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vv(n,e),n=n.sibling;return Gu(t,Ye.current&1|2),H&&Sn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&bt()>Co&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304)}else{if(!a)if(e=po(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Di(t,e),ou(l,!0),l.tail===null&&l.tailMode!==\"collapsed\"&&l.tailMode!==\"visible\"&&!u.alternate&&!H)return fe(t),null}else 2*bt()-l.renderingStartTime>Co&&n!==536870912&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=bt(),e.sibling=null,u=Ye.current,u=a?u&1|2:u&1,l.tailMode===\"visible\"||l.tailMode===\"collapsed\"||!n||H?Gu(t,u):(n=u,me(je,t),me(Ye,n),Ze===null&&(Ze=t)),H&&Sn(t,l.treeForkCount),e}return fe(t),null;case 22:case 23:return yt(t),Xs(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(fe(t),t.subtreeFlags&6&&(t.flags|=8192)):fe(t),n=t.updateQueue,n!==null&&Di(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Ve(zl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Nn(Oe),fe(t),null;case 25:return null;case 30:return t.flags|=33554432,fe(t),null}throw Error(E(156,t.tag))}function P1(e,t){switch(Vs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nn(Oe),Ca(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return oo(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(E(340));Ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));Ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zs(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ca(),null;case 10:return Nn(t.type),null;case 22:case 23:return yt(t),Xs(),e!==null&&Ve(zl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Nn(Oe),null;case 25:return null;default:return null}}function gy(e,t){switch(Vs(t),t.tag){case 3:Nn(Oe),Ca();break;case 26:case 27:case 5:oo(t);break;case 4:Ca();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:Zs(t);break;case 10:Nn(t.type);break;case 22:case 23:yt(t),Xs(),e!==null&&Ve(zl);break;case 24:Nn(Oe)}}function Pu(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var u=n.create,i=n.inst;l=u(),i.destroy=l}n=n.next}while(n!==a)}}catch(o){P(t,t.return,o)}}function rl(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var u=a.next;l=u;do{if((l.tag&e)===e){var i=l.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,a=t;var c=n,f=o;try{f()}catch(g){P(a,c,g)}}}l=l.next}while(l!==u)}}catch(g){P(t,t.return,g)}}function vy(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Av(t,n)}catch(l){P(e,e.return,l)}}}function yy(e,t,n){n.props=Hl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){P(e,t,l)}}function nn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var a=e.stateNode,u=An(e.memoizedProps,a);(a.ref===null||a.ref.name!==u)&&(a.ref=ih(u)),l=a.ref;break;case 7:if(e.stateNode===null){var i=new Ot(e);st(e.child,!1,Yb,i,void 0,void 0),e.stateNode=i}l=e.stateNode;break;default:l=e.stateNode}typeof n==\"function\"?e.refCleanup=n(l):n.current=l}}catch(o){P(e,t,o)}}function Le(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l==\"function\")try{l()}catch(a){P(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(a){P(e,t,a)}else n.current=null}function No(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title\"))),ke(l,t,n),l[Be]=e,Re(l),t=l;break e;case\"link\":if(u=yg(\"link\",\"href\",a).get(t+(n.href||\"\"))){for(i=0;iT&&(i=T,T=b,b=i);var v=fm(o,b),d=fm(o,T);if(v&&d&&(s.rangeCount!==1||s.anchorNode!==v.node||s.anchorOffset!==v.offset||s.focusNode!==d.node||s.focusOffset!==d.offset)){var h=m.createRange();h.setStart(v.node,v.offset),s.removeAllRanges(),b>T?(s.addRange(h),s.extend(d.node,d.offset)):(h.setEnd(d.node,d.offset),s.addRange(h))}}}}for(m=[],s=o;s=s.parentNode;)s.nodeType===1&&m.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof o.focus==\"function\"&&o.focus(),o=0;on?32:n,R.T=null,n=rs,rs=null;var u=Xt,i=sn;if(ye=0,Gl=Xt=null,sn=0,(X&6)!==0)throw Error(E(331));var o=X;if(X|=4,Hy(u.current),Dy(u,u.current,i,n),X=o,ei(0,!1),St&&typeof St.onPostCommitFiberRoot==\"function\")try{St.onPostCommitFiberRoot(Zu,u)}catch{}return!0}finally{Z.p=a,R.T=l,Ky(e,t)}}function Fm(e,t,n){t=Ht(n,t),t=Zr(e.stateNode,t,2),e=Pn(e,t,2),e!==null&&(Ju(e,2),mn(e))}function P(e,t,n){if(e.tag===3)Fm(e,e,n);else for(;t!==null;){if(t.tag===3){Fm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof l.componentDidCatch==\"function\"&&(nl===null||!nl.has(l))){e=Ht(n,e),n=cy(2),l=Pn(t,n,2),l!==null&&(ry(n,l,t,e),Ju(l,2),mn(l));break}}t=t.return}}function cr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new lb;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(gf=!0,a.add(n),e=fb.bind(null,e,t,n),t.then(e,e))}function fb(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ae===e&&(B&n)===n&&((pe===4||pe===3&&(B&62914560)===B&&300>bt()-Io)&&(X&2)===0?Ua(e,0):_o|=n,Da===B&&(Da=0)),mn(e)}function Jy(e,t){t===0&&(t=Bg()),e=Vl(e,t),e!==null&&(Ju(e,t),mn(e))}function db(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jy(e,n)}function mb(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(E(314))}l!==null&&l.delete(t),Jy(e,n)}function gb(e,t){return Cs(e,t)}var Ha=null,ua=null,gs=!1,Ro=!1,rr=!1,In=0;function mn(e){e!==ua&&e.next===null&&(ua===null?Ha=ua=e:ua=ua.next=e),Ro=!0,gs||(gs=!0,yb())}function ei(e,t){if(!rr&&Ro){rr=!0;do for(var n=!1,l=Ha;l!==null;){if(!t)if(e!==0){var a=l.pendingLanes;if(a===0)var u=0;else{var i=l.suspendedLanes,o=l.pingedLanes;u=(1<<31-Et(42|e)+1)-1,u&=a&~(i&~o),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,$m(l,u))}else u=B,u=Ho(l,l===ae?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Ku(l,u)||(n=!0,$m(l,u));l=l.next}while(n);rr=!1}}function vb(){Iy()}function Iy(){Ro=gs=!1;var e=0;In!==0&&Ab()&&(e=In);for(var t=bt(),n=null,l=Ha;l!==null;){var a=l.next,u=Fy(l,t);u===0?(l.next=null,n===null?Ha=a:n.next=a,a===null&&(ua=n)):(n=l,(e!==0||(u&3)!==0)&&(Ro=!0)),l=a}ye!==0&&ye!==5||ei(e,!1),In!==0&&(In=0)}function Fy(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0o)break;var g=c.transferSize,m=c.initiatorType;g&&lg(m)&&(c=c.responseEnd,i+=g*(cno){b.length=p;break}h=new Promise(Rb.bind(h)),b.push(h)}}}if(0\"u\"?null:document;function gh(e,t,n){var l=Za;if(l&&typeof t==\"string\"&&t){var a=Ut(t);a='link[rel=\"'+e+'\"][href=\"'+a+'\"]',typeof n==\"string\"&&(a+='[crossorigin=\"'+n+'\"]'),mg.has(a)||(mg.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement(\"link\"),ke(t,\"link\",e),Re(t),l.head.appendChild(t)))}}function Fb(e){Dn.D(e),gh(\"dns-prefetch\",e,null)}function $b(e,t){Dn.C(e,t),gh(\"preconnect\",e,t)}function Wb(e,t,n){Dn.L(e,t,n);var l=Za;if(l&&e&&t){var a='link[rel=\"preload\"][as=\"'+Ut(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(a+='[imagesrcset=\"'+Ut(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(a+='[imagesizes=\"'+Ut(n.imageSizes)+'\"]')):a+='[href=\"'+Ut(e)+'\"]';var u=a;switch(t){case\"style\":u=La(e);break;case\"script\":u=Ka(e)}if(!(Bt.has(u)||(e=ue({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),Bt.set(u,e),l.querySelector(a)!==null||t===\"style\"&&l.querySelector(ti(u))||t===\"script\"&&l.querySelector(ni(u))))){var i=l.createElement(\"link\");ke(i,\"link\",e),t===\"style\"&&(i[ro]=!0,i.onload=i.onerror=function(){jg(i)}),Re(i),l.head.appendChild(i)}}}function Pb(e,t){Dn.m(e,t);var n=Za;if(n&&e){var l=t&&typeof t.as==\"string\"?t.as:\"script\",a='link[rel=\"modulepreload\"][as=\"'+Ut(l)+'\"][href=\"'+Ut(e)+'\"]',u=a;switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":u=Ka(e)}if(!Bt.has(u)&&(e=ue({rel:\"modulepreload\",href:e},t),Bt.set(u,e),n.querySelector(a)===null)){switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(ni(u)))return}l=n.createElement(\"link\"),ke(l,\"link\",e),Re(l),n.head.appendChild(l)}}}function eS(e,t,n){Dn.S(e,t,n);var l=Za;if(l&&e){var a=pa(l).hoistableStyles,u=La(e);t=t||\"default\";var i=a.get(u);if(!i){var o={loading:0,preload:null};if(i=l.querySelector(ti(u)))o.loading=5;else{e=ue({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=Bt.get(u))&&Ef(e,n);var c=i=l.createElement(\"link\");Re(c),ke(c,\"link\",e),c._p=new Promise(function(f,g){c.onload=f,c.onerror=g}),c.addEventListener(\"load\",function(){o.loading|=1}),c.addEventListener(\"error\",function(){o.loading|=2}),o.loading|=4,eo(i,t,l)}i={type:\"stylesheet\",instance:i,count:1,state:o},a.set(u,i)}}}function tS(e,t){Dn.X(e,t);var n=Za;if(n&&e){var l=pa(n).hoistableScripts,a=Ka(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ue({src:e,async:!0},t),(t=Bt.get(a))&&Tf(e,t),u=n.createElement(\"script\"),Re(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function nS(e,t){Dn.M(e,t);var n=Za;if(n&&e){var l=pa(n).hoistableScripts,a=Ka(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ue({src:e,async:!0,type:\"module\"},t),(t=Bt.get(a))&&Tf(e,t),u=n.createElement(\"script\"),Re(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function gg(e,t,n,l){var a=(a=Fn.current)?Yu(a):null;if(!a)throw Error(E(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(n=La(n.href),t=pa(a).hoistableStyles,l=t.get(n),l||(l={type:\"style\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=La(n.href);var u=pa(a).hoistableStyles,i=u.get(e);if(i||(a=a.ownerDocument||a,i={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,i),(u=a.querySelector(ti(e)))?u._p||(i.instance=u,i.state.loading=5):(u=Bt.get(e),u||(u={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Bt.set(e,u)),lS(a,e,u,i.state))),t&&l===null)throw Error(E(528,\"\"));return i}if(t&&l!==null)throw Error(E(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(n=Ka(n),t=pa(a).hoistableScripts,l=t.get(n),l||(l={type:\"script\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};default:throw Error(E(444,e))}}function La(e){return'href=\"'+Ut(e)+'\"'}function ti(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function vh(e){return ue({},e,{\"data-precedence\":e.precedence,precedence:null})}function lS(e,t,n,l){if(t=e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")){if(t[ro]!==!0){l.loading=1;return}}else t=e.createElement(\"link\"),t[ro]=!0,t.onload=t.onerror=jg.bind(null,t),ke(t,\"link\",n),Re(t),e.head.appendChild(t);l.preload=t,t.addEventListener(\"load\",function(){return l.loading|=1}),t.addEventListener(\"error\",function(){return l.loading|=2})}function Ka(e){return'[src=\"'+Ut(e)+'\"]'}function ni(e){return\"script[async]\"+e}function vg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var l=e.querySelector('style[data-href~=\"'+Ut(n.href)+'\"]');if(l)return t.instance=l,Re(l),l;var a=ue({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement(\"style\"),Re(l),ke(l,\"style\",a),eo(l,n.precedence,e),t.instance=l;case\"stylesheet\":a=La(n.href);var u=e.querySelector(ti(a));if(u)return t.state.loading|=4,t.instance=u,Re(u),u;l=vh(n),(a=Bt.get(a))&&Ef(l,a),u=(e.ownerDocument||e).createElement(\"link\"),Re(u);var i=u;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),t.state.loading|=4,eo(u,n.precedence,e),t.instance=u;case\"script\":return u=Ka(n.src),(a=e.querySelector(ni(u)))?(t.instance=a,Re(a),a):(l=n,(a=Bt.get(u))&&(l=ue({},n),Tf(l,a)),e=e.ownerDocument||e,a=e.createElement(\"script\"),Re(a),ke(a,\"link\",l),e.head.appendChild(a),t.instance=a);case\"void\":return null;default:throw Error(E(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,eo(l,n.precedence,e));return t.instance}function eo(e,t,n){for(var l=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,u=a,i=0;i title\"):null)}function aS(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function hg(e,t){return e===\"img\"&&t.src!=null&&t.src!==\"\"&&t.onLoad==null&&t.loading!==\"lazy\"}function yh(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function hh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==\"number\"?devicePixelRatio:1)*.25}function pg(e,t){typeof t.decode==\"function\"&&(e.imgCount++,t.complete||(e.imgBytes+=hh(t),e.suspenseyImages.push(t)),e=oS.bind(e),t.decode().then(e,e))}function uS(e,t,n,l){if(n.type===\"stylesheet\"&&(typeof l.media!=\"string\"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=La(l.href),u=t.querySelector(ti(a));if(u){t=u._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=ku.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,Re(u);return}u=t.ownerDocument||t,l=vh(l),(a=Bt.get(a))&&Ef(l,a),u=u.createElement(\"link\"),Re(u);var i=u;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ku.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var no=0;function iS(e,t){return e.stylesheets&&e.count===0&&lo(e,e.stylesheets),0no?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function ph(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lo(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ku(){this.count--,ph(this)}function oS(){this.imgCount--,ph(this)}var wo=null;function lo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wo=new Map,t.forEach(cS,e),wo=null,ku.call(e))}function cS(e,t){if(!(t.state.loading&4)){var n=wo.get(e);if(n)var l=n.get(null);else{n=new Map,wo.set(e,n);for(var a=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),u=0;u{\"use strict\";function _h(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_h)}catch(e){console.error(e)}}_h(),Ch.exports=zh()});var Rh=$t(tc=>{\"use strict\";var yS=Symbol.for(\"react.transitional.element\"),hS=Symbol.for(\"react.fragment\");function xh(e,t,n){var l=null;if(n!==void 0&&(l=\"\"+n),t.key!==void 0&&(l=\"\"+t.key),\"key\"in t){n={};for(var a in t)a!==\"key\"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:yS,type:e,key:l,ref:t!==void 0?t:null,props:n}}tc.Fragment=hS;tc.jsx=xh;tc.jsxs=xh});var J=$t((oE,Dh)=>{\"use strict\";Dh.exports=Rh()});var yn={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1},N0=[\"RETIRED\",\"CONFLICT\",\"NOT_FOUND\",\"DOCUMENT_TOO_LARGE\",\"STORAGE_FAILURE\",\"ORIGIN_NOT_DECLARED\",\"MESSAGE_TOO_LARGE\",\"PAGE_TOO_LARGE\",\"PATCH_TOO_LARGE\",\"DEADLINE\",\"INVALID_STEPS\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"CONFIGURATION_REQUIRED\",\"NOT_READY\",\"UNKNOWN_METHOD\",\"INVALID_ARGUMENT\",\"QUOTA_EXCEEDED\",\"PROTOCOL_MISMATCH\",\"APPLET_INCOMPATIBLE\",\"ENVELOPE_INVALID\",\"CONTEXT_REPLACED\",\"TARGET_NOT_FOUND\",\"PRECONDITION_FAILED\",\"ASYNC_READ\",\"AUTH_REQUIRED\",\"REJECTED\"];function Pf(e){return typeof e==\"string\"&&N0.includes(e)}var O0=/^:[A-Za-z][A-Za-z0-9_]*$/,A0=/^[A-Za-z0-9_.~@-]+$/,yc=new Map;function z0(e){if(yc.has(e))return yc.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),l=n.at(-1)===\"*\";l&&n.pop();let a=[],u=!0;for(let i of n)O0.test(i)?a.push({param:i.slice(1)}):A0.test(i)&&i!==\".\"&&i!==\"..\"?a.push({literal:i}):u=!1;u&&(t={segments:a,rest:l})}return yc.set(e,t),t}function Te(e){try{return new URL(e).href}catch{return null}}function yl(e,t){let n=_0(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let l;try{l=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}l.at(-1)===\"\"&&l.pop();for(let a of e.routes){let u=z0(a.pattern);if(!u)continue;let i=C0(u,l);if(!i||!(a.query??[]).every(c=>n.searchParams.has(c)))continue;for(let c of a.query??[])i[c]=n.searchParams.get(c);let o={kind:\"route\",routeId:a.id,page:a.page,screen:a.screen,params:i};return a.context!==void 0&&(o.context=a.context),o}return{kind:\"website\",url:t}}function _0(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function C0(e,t){if(e.rest?t.lengthb.id===u.id)?.startUrl;f={index:o.index,start:p!==void 0&&Te(p)===Te(t.view.url),url:s}}}else t.status===\"ready\"&&t.account!==null&&c===\"auth\"&&(c=\"none\",f=null);o.page.status===\"ready\"&&(t.status===\"loading\"||t.status===\"error\")&&(g++,m=!1,l.push({type:\"schedule\",id:u.id,token:g}));let r={...o,seen:Math.max(o.seen,t.view.n),pin:c,signIn:f,deadline:g,page:{status:t.status,pageId:t.pageId,routeId:t.routeId,view:t.view,stale:t.stale,expired:m}};return{state:vl($f(e,u,r),r),effects:l}}case\"deadline\":{let u=e.contexts[t.id];return!u||t.token!==u.deadline||u.page.status===\"ready\"||u.page.expired?a:{state:vl(e,{...u,page:{...u.page,expired:!0}}),effects:l}}case\"user.viewWebsite\":{let u=e.contexts[t.id];return!u||u.pin===\"user\"?a:{state:vl(e,{...u,pin:\"user\"}),effects:l}}case\"user.done\":{let u=e.contexts[t.id];if(!u)return a;if(u.pin===\"auth\"&&u.signIn)return Jf(e,u,n)??a;let i=u.pin===\"none\"?u:{...u,pin:\"none\"},o=i===u?e:vl(e,i);if(di(i,n)!==\"website\")return{state:o,effects:l};if(i.canGoBack)l.push({type:\"context.back\",id:u.id});else{let c=n.contexts.find(f=>f.id===u.id)?.startUrl;c&&l.push({type:\"context.navigate\",id:u.id,url:c,mode:\"push\"})}return{state:o,effects:l}}case\"navigate.url\":{let u=t.context??e.active;return e.contexts[u]?(l.push({type:\"context.navigate\",id:u,url:t.url,mode:t.mode}),{state:{...e,active:u,overlay:[],leaveGuard:null},effects:l}):a}case\"navigate.screen\":{let u=t.mode===\"root\"?[t.screen]:t.mode===\"replace\"?[...e.overlay.slice(0,-1),t.screen]:[...e.overlay,t.screen];return{state:{...e,overlay:u,leaveGuard:null},effects:l}}case\"select\":{let u=e.contexts[t.id];if(!u)return a;if(t.id!==e.active||e.overlay.length>0)return{state:{...e,active:t.id,overlay:[],leaveGuard:null},effects:l};let i=n.contexts.find(o=>o.id===t.id)?.startUrl;return i&&(u.url===null||Te(u.url)!==Te(i))&&l.push({type:\"context.navigate\",id:t.id,url:i,mode:\"push\"}),{state:{...e,leaveGuard:null},effects:l}}case\"back\":{if(e.leaveGuard)return{state:e,effects:[{type:\"confirmLeave\",message:e.leaveGuard.message}]};if(e.overlay.length>0)return{state:{...e,overlay:e.overlay.slice(0,-1)},effects:l};let u=e.contexts[e.active];return u?.pin===\"auth\"&&u.signIn?Jf(e,u,n)??{state:e,effects:[{type:\"leave\"}]}:e.contexts[e.active]?.canGoBack?{state:e,effects:[{type:\"context.back\",id:e.active}]}:{state:e,effects:[{type:\"leave\"}]}}case\"guard\":return{state:{...e,leaveGuard:t.guard},effects:l};case\"context.gone\":{let u=e.contexts[t.id];return u?{state:vl(e,{...u,page:{...pc,status:\"unsupported\"}}),effects:l}:a}}}function Jf(e,t,n){let{index:l,start:a}=t.signIn,u=n.contexts[0].id,i=vl(e,{...t,pin:\"none\",signIn:null});if(!a&&l>0){let o=Math.max(1,t.index-l+1);return{state:i,effects:[{type:\"context.back\",id:t.id,steps:o}]}}return t.id===u?null:{state:{...i,active:u,overlay:[],leaveGuard:null},effects:[]}}function If(e,t,n){return t===e.generation&&e.url!==null&&Te(n)===Te(e.url)}function Ff(e,t,n,l){let a=e.deadline+1;return l.push({type:\"schedule\",id:e.id,token:a}),{...e,url:n,seen:t===e.generation?e.seen:-1,generation:t,page:pc,deadline:a}}function $f(e,t,n){return!e.leaveGuard||t.id!==e.active||e.overlay.length>0||t.index===n.index&&t.url!==null&&n.url!==null&&Te(t.url)===Te(n.url)?e:{...e,leaveGuard:null}}function vl(e,t){return{...e,contexts:{...e.contexts,[t.id]:t}}}function bc(e){let t={};for(let[n,l]of Object.entries(e.contexts))t[n]={url:l.url};return{version:yn.sessionState,state:{active:e.active,overlay:e.overlay,contexts:t}}}function nd(e,t){let n=M0(t);if(!e||e.version!==yn.sessionState||!eu(e.state))return n;let{active:l,overlay:a,contexts:u}=e.state,i={...n,contexts:{...n.contexts}};if(typeof l==\"string\"&&i.contexts[l]&&(i.active=l),Array.isArray(a)&&(i.overlay=a.filter(o=>R0(o,t.foreground.screens))),eu(u))for(let o of Object.keys(i.contexts)){let c=eu(u[o])?u[o].url:void 0;typeof c==\"string\"&&(i.contexts[o]=ed(o,c))}return i}function R0(e,t){return eu(e)&&typeof e.key==\"string\"&&typeof e.id==\"string\"&&t.includes(e.id)&&eu(e.params)&&Object.values(e.params).every(n=>typeof n==\"string\")}function eu(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var XS=yn.bundleFormat,hc=\"(0|[1-9]\\\\d*)\",Wf=\"(?:0|[1-9]\\\\d*|\\\\d*[A-Za-z-][0-9A-Za-z-]*)\",ZS=new RegExp(`^${hc}\\\\.${hc}\\\\.${hc}(?:-(${Wf}(?:\\\\.${Wf})*))?$`),te=class extends Error{code;constructor(e,t){super(t),this.name=\"GenesisError\",this.code=e}},D0=2e3;function Sc(e,t){return new Promise((n,l)=>{let a=null,u=!1,i=1,o=new Map,c=new Map,f={get bound(){return a},get retired(){return u},request(s,p={}){if(u)return Promise.reject(new te(\"RETIRED\",\"This page was closed\"));let b=i++;return new Promise((T,v)=>{let d=setTimeout(()=>{o.delete(b),v(new te(\"DEADLINE\",`${s} did not answer in time`))},a.limits.rpcDeadlineMs+D0);o.set(b,{resolve:T,reject:v,timer:d}),e.postMessage(JSON.stringify({type:\"request\",documentId:a.documentId,requestId:b,method:s,params:p}))})},on(s,p){let b=c.get(s);return b||c.set(s,b=new Set),b.add(p),()=>{b.delete(p)}}};function g(){u=!0;for(let s of o.values())clearTimeout(s.timer),s.reject(new te(\"RETIRED\",\"This page was closed\"));o.clear()}function m(s,p){for(let b of[...c.get(s)??[]])try{b(p)}catch(T){console.error(`Genesis ${s} handler failed`,T)}}e.addEventListener(\"message\",s=>{if(u||typeof s.data!=\"string\")return;let p;try{p=JSON.parse(s.data)}catch{return}if(p?.type===\"refused\"&&!a){u=!0,l(new te(p.error?.code??\"PROTOCOL_MISMATCH\",p.error?.message??\"The host refused this page\"));return}if(p?.type===\"bound\"){if(a)return;a=p,n(f);return}if(!(!a||p?.documentId!==a.documentId))if(p.type===\"response\"){let b=o.get(p.requestId);if(!b)return;o.delete(p.requestId),clearTimeout(b.timer),p.error?b.reject(new te(p.error.code,p.error.message)):b.resolve(p.result??null)}else p.type===\"event\"&&(p.name===\"retired\"?(g(),m(\"retired\",{})):m(p.name,p.data))}),addEventListener(\"pagehide\",()=>{u||(m(\"pagehide\",{}),g())});let r={type:\"hello\",protocol:yn.protocol,url:t};e.postMessage(JSON.stringify(r))})}var w0={pageId:null,routeId:null,params:{}};function ad(e,t){let n={};for(let m of e)n[m]=U0();let l={account:null,contexts:n},a=!1,u=new Map;function i(m){let r=m===null?[...u.values()]:[u.get(null),...m.map(p=>u.get(p))],s=new Set;for(let p of r)for(let b of[...p??[]])s.has(b)||(s.add(b),b())}function o(m,r){l={...l,contexts:{...l.contexts,[m]:r}}}function c(m){let{entry:r}=m;if(!m.attached||m.status!==\"ready\"||!r||!Il(r.url,m.url))return;let{history:s}=m;for(s.delete(r.index),s.set(r.index,ud(m));s.size>t.historyEntriesMax;)s.delete(s.keys().next().value)}function f(m,r,s){if(r===void 0||s!==\"ready\"&&s!==\"auth\")return!1;if(!a)return a=!0,l.account!==r&&(l={...l,account:r}),!1;if(r===l.account)return!1;let p={};for(let[b,T]of Object.entries(l.contexts))T.history.clear(),p[b]=b===m||!T.content||T.stale?T:{...T,stale:!0};return l={account:r,contexts:p},c(p[m]),!0}let g=(m,r=!1)=>({outcome:m,accountChanged:r});return{state:()=>l,context:m=>l.contexts[m],applyPage(m,r,s){let p=l.contexts[m];if(!p||r=r.size||d===r.index&&!Il(h.url,r.url))&&b.delete(d)}let T={...p,generation:r.generation,entry:{index:r.index,url:r.url}},v;if(Il(p.url,r.url))p.attached&&p.view?.generation!==r.generation?v={...T,attached:!1,status:\"loading\",error:null,stale:p.content}:v=T;else{let d=b.get(r.index);v=d?{...T,...d,attached:!1,status:\"loading\",error:null,stale:!0,content:!0}:{...T,...s,url:r.url,regions:{},attached:!1,status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1}}o(m,v),c(v),i([m])},gone(m,r){let s=l.contexts[m];s&&(o(m,{...s,attached:!1,status:\"error\",error:r,stale:s.content}),i([m]))},subscribe(m,r){let s=r??null,p=u.get(s);return p||u.set(s,p=new Set),p.add(m),()=>{p.delete(m)}}}}function U0(){return{generation:0,view:null,epoch:0,seq:0,live:[],attached:!1,url:null,pageId:null,routeId:null,params:{},regions:{},status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1,entry:null,history:new Map}}function Il(e,t){return e!==null&&t!==null&&Te(e)===Te(t)}function ud(e){return{url:e.url,pageId:e.pageId,routeId:e.routeId,params:e.params,regions:e.regions}}function H0(e,t){if(e.content&&Il(e.url,t))return ud(e);let{entry:n}=e,l=n&&Il(n.url,t)?e.history.get(n.index):void 0;return l&&Il(l.url,t)?l:null}function id(e,t=Object.create(null)){for(let n of e)t[n.key]=n;return t}function od(e){return e.kind===\"single\"?{kind:\"single\",status:e.status,error:e.error??null,record:e.record}:{kind:\"collection\",status:e.status,error:e.error??null,order:e.items.map(t=>t.key),complete:e.complete,ephemeral:e.ephemeral===!0,records:id(e.items)}}function G0(e,t){let n={};for(let[l,a]of Object.entries(e)){let u=od(a),i=t[l];n[l]=i?L0(i,u):u}return n}var mi=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function L0(e,t){if(e.kind===\"single\"||t.kind===\"single\")return e.kind!==\"single\"||t.kind!==\"single\"?t:(mi(e.record,t.record)&&(t.record=e.record),e.record===t.record&&e.status===t.status&&mi(e.error,t.error)?e:t);let n=e.order.length===t.order.length&&e.complete===t.complete&&e.ephemeral===t.ephemeral&&e.status===t.status&&mi(e.error,t.error);for(let[l,a]of t.order.entries()){let u=e.records[a];u&&mi(u,t.records[a])?t.records[a]=u:n=!1,e.order[l]!==a&&(n=!1)}return n?e:t}function B0(e,t){let n=e.regions;for(let[l,a]of Object.entries(t)){let u=e.live.includes(l)?n[l]:void 0;if(!u)return null;let i;if(a.kind===\"replace\")i=od(a.region);else if(a.kind===\"single\"){if(u.kind!==\"single\")return null;i={...u,record:a.record,status:a.status??u.status,error:a.error===void 0?u.error:a.error}}else{if(u.kind!==\"collection\")return null;if(i={...u,complete:a.complete??u.complete,status:a.status??u.status,error:a.error===void 0?u.error:a.error},a.upsert?.length||a.remove?.length){i.records=id(a.upsert??[],Object.assign(Object.create(null),u.records));for(let o of a.remove??[])delete i.records[o]}if(a.order){i.order=a.order;let o=new Set(a.order);for(let c of Object.keys(i.records))o.has(c)||(i.records===u.records&&(i.records=Object.assign(Object.create(null),u.records)),delete i.records[c])}else if(a.remove?.length){let o=new Set(a.remove);i.order=u.order.filter(c=>!o.has(c))}}n===e.regions&&(n={...n}),n[l]=i}return n}var cd=class extends te{constructor(e,t){super(e,t),this.name=\"ServiceError\"}},q0=[\"CONFIGURATION_REQUIRED\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"SERVICE_UNREACHABLE\",\"DEADLINE\",\"SERVICE_FAILURE\",\"QUOTA_EXCEEDED\"];function Ec(e){let t=e?.code;return t&&q0.includes(t)?\"This feature is temporarily unavailable. Try again in a moment.\":e instanceof Error?e.message:\"Something went wrong. Please try again.\"}async function Tc(e=window.__genesisBridge){if(!e)throw new Error(\"Genesis bridge is missing; the foreground must run inside Genesis\");let t=await Sc(e,location.href),{compat:n}=t.bound;if(n.protocol!==yn.protocol||n.sessionState!==yn.sessionState)throw new te(\"PROTOCOL_MISMATCH\",\"This applet was built for another Genesis version\");return X0(t)}var V0=500,Y0=1e3,k0=64,j0=2e3,Q0=Object.freeze([]),ld=e=>e===void 0?null:Array.isArray(e)?e:[e];function X0(e){let{manifest:t,appletId:n,limits:l,session:a}=e.bound,u=t.contexts.map(y=>y.id),i=ad(u,{historyEntriesMax:l.historyEntriesMax}),o=(y,N)=>e.request(y,N).catch(z=>{e.retired||console.error(`Genesis ${y} failed`,z)}),c=nd(a,t),f=new Set,g=null,m=new Set;function r(y){let N=td(c,y,t),z=N.state!==c;c=N.state;let x=N.effects.filter(k=>!s(k));if(z){O=void 0,h();for(let k of[...f])k()}return x}function s(y){switch(y.type){case\"reveal\":return o(\"context.reveal\",{id:y.id}),!0;case\"cover\":return o(\"context.cover\"),!0;case\"context.navigate\":return fi(y.id),o(\"context.navigate\",{id:y.id,url:y.url,mode:y.mode}),!0;case\"context.back\":return fi(y.id),o(\"context.back\",y.steps?{id:y.id,steps:y.steps}:{id:y.id}),!0;case\"context.reload\":return fi(y.id),o(\"context.reload\",{id:y.id}),!0;case\"schedule\":return setTimeout(()=>r({type:\"deadline\",id:y.id,token:y.token}),l.documentReadyMs),!0;case\"leave\":case\"confirmLeave\":return!1}}function p(y,N){g?g(y,N):window.confirm(y)&&N()}function b(y){let N=c.leaveGuard;if(!N)return y();p(N.message,()=>{r({type:\"guard\",guard:null}),y()})}function T(y){let N=!0;for(let z of r({type:\"back\"}))if(z.type===\"leave\")N=!1;else if(z.type===\"confirmLeave\"){let x=()=>{r({type:\"guard\",guard:null}),!T(!1)&&y&&o(\"back.leave\")};setTimeout(()=>p(z.message,x),0)}return N}let v=null,d=a?JSON.stringify(bc(c)):\"\";function h(){v===null&&(v=setTimeout(S,V0))}function S(){v!==null&&clearTimeout(v),v=null;let y=bc(c),N=JSON.stringify(y);N!==d&&(d=N,o(\"session.save\",y))}e.on(\"suspended\",S);let O;function C(){if(O!==void 0)return O;let y=c.overlay[c.overlay.length-1],N=c.contexts[c.active],z=null;if(y)z={key:y.key,id:y.id,params:y.params,context:c.active,overlay:!0};else if(N?.url){let x=yl(t,N.url);x.kind===\"route\"&&(z={key:`${N.id}:${N.index}`,id:x.screen,params:x.params,context:N.id,overlay:!1})}return O=z}let A=1,_=new Set(c.overlay.map(y=>y.key));function Y(){let y;do y=`s${A++}`;while(_.has(y));return _.add(y),y}function M(y){if(\"screen\"in y){let Ft={key:Y(),id:y.screen,params:y.params??{}};b(()=>r({type:\"navigate.screen\",screen:Ft,mode:y.mode??\"push\"}));return}let z=c.contexts[c.active]?.url??t.contexts[0].startUrl,x;try{x=new URL(y.url,z).href}catch{throw new te(\"INVALID_ARGUMENT\",`Not a URL: ${y.url}`)}let k=y.context??F(x);if(!c.contexts[k])throw new te(\"NOT_FOUND\",`No context ${k}`);let We=c.contexts[k].url;if(We!==null&&Te(We)===Te(x)&&(y.mode??\"push\")===\"push\"){(k!==c.active||c.overlay.length>0)&&b(()=>r({type:\"select\",id:k}));return}b(()=>r({type:\"navigate.url\",url:x,context:k,mode:y.mode??\"push\"}))}function F(y){let N=yl(t,y);if(N.kind!==\"route\"||!N.context||!c.contexts[N.context])return c.active;let z=c.contexts[c.active],x=t.contexts.find(We=>We.id===c.active)?.startUrl,k=!z.url||x!==void 0&&Te(z.url)===Te(x);return c.overlay.length>0||k?N.context:c.active}function Fe(y){b(()=>{let N=y===c.active&&c.overlay.length===0,z=N&&c.contexts[y]?.url!==null&&Te(c.contexts[y].url)!==Te(t.contexts.find(x=>x.id===y)?.startUrl??\"\");if(r({type:\"select\",id:y}),N&&!z)for(let x of[...m])x(y)})}let Ct=new Set;function Zl(y){Ct.has(y)||(Ct.add(y),setTimeout(()=>Ct.delete(y),Y0),e.request(\"context.resync\",{id:y}).catch(()=>{}))}function re(y){let N=yl(t,y);return N.kind===\"route\"?{pageId:N.page,routeId:N.routeId,params:N.params}:{pageId:null,routeId:null,params:{}}}e.on(\"page\",({id:y,generation:N,page:z})=>{let x=i.applyPage(y,N,z);if(x.outcome!==\"applied\")return;Ct.delete(y);let k=i.context(y);f0(y,z),r({type:\"context.page\",id:y,generation:N,view:z.view,status:z.status,pageId:z.pageId,routeId:z.routeId,account:z.account,stale:k.stale&&k.content,signInUrl:z.signInUrl??null}),Se(y,x)}),e.on(\"patch\",({id:y,generation:N,patch:z})=>{let x=i.applyPatch(y,N,z);x.outcome===\"resync\"&&Zl(y),Se(y,x)});function Se(y,N){if(!N.accountChanged)return;let z=Jl(c,t);for(let x of u)x!==y&&(x===z?Zl(x):at(x));for(let x of[...$e.values()])x.context!==y&&It(x,{outcome:\"unknown\",code:\"CONTEXT_REPLACED\",message:\"The account changed\"})}function at(y){fi(y),o(\"context.reload\",{id:y})}e.on(\"context.navigated\",y=>{i.navigated(y.id,y,re(y.url)),r({type:\"context.navigated\",...y})}),e.on(\"context.gone\",y=>{i.gone(y.id,{code:y.code??\"NOT_READY\",message:y.message??\"The page cannot be read\"}),r({type:\"context.gone\",id:y.id})}),e.on(\"user.viewWebsite\",y=>{r({type:\"user.viewWebsite\",id:y?.id??c.active})}),e.on(\"user.done\",y=>{r({type:\"user.done\",id:y?.id??c.active}),Yf()}),e.on(\"back\",()=>{let y=T(!0);o(\"back.handled\",{handled:y})});let $e=new Map,Wa=new Map,Pa=new Map,rc=0,sc=new Set,fc=new Map,Lf=(y,N,z)=>JSON.stringify([y,N,z]);function Bf(){let y=new Map;for(let z of $e.values()){let x=Lf(z.context,z.region,z.key),k=y.get(x);k||y.set(x,k=[]),k.push({name:z.name,args:z.args})}let N=new Map;for(let[z,x]of y){let k=fc.get(z);N.set(z,k&&k.length===x.length&&k.every((We,Ft)=>We.name===x[Ft].name&&We.args===x[Ft].args)?k:x)}fc=N;for(let z of[...sc])z()}function It(y,N){$e.get(y.dedup)===y&&($e.delete(y.dedup),y.actionId!==null&&Wa.delete(y.actionId),y.timer!==null&&clearTimeout(y.timer),y.resolve(N),Bf())}function qf(y,N){y.timer!==null&&clearTimeout(y.timer),y.timer=setTimeout(()=>It(y,{outcome:\"unknown\",code:\"DEADLINE\",message:\"The action did not finish in time\"}),N)}function Vf(y,N){if(N.state===\"dispatched\"){if(!N.navigating)return;y.from=i.context(y.context)?.view??null,y.expect=N.expect??null,qf(y,l.actionTimeoutMs);return}let z=N.state===\"observed\"?\"observed\":N.state===\"cancelled\"?\"cancelled\":\"failed\";It(y,N.result??{outcome:z})}e.on(\"action.update\",y=>{let N=Wa.get(y.actionId);if(N)return Vf(N,y);if(rc===0)return;let z=Pa.get(y.actionId)??[];z.push(y),Pa.set(y.actionId,z)});function f0(y,N){for(let z of[...$e.values()]){if(z.context!==y||z.from===null)continue;let{from:x}=z;if(N.view.generation===x.generation&&N.view.n===x.n||N.status===\"loading\")continue;let k=yl(t,N.view.url),We=k.kind===\"route\"?k.page:null,Ft=ld(z.expect?.page);N.status===\"auth\"?It(z,{outcome:\"failed\",code:\"AUTH_REQUIRED\",message:\"Sign-in is needed\"}):We!==null&&ld(z.expect?.notPage)?.includes(We)?It(z,{outcome:\"failed\",code:\"REJECTED\",message:\"The website did not accept the action\"}):N.status===\"ready\"&&We!==null&&(Ft===null||Ft.includes(We))?It(z,{outcome:\"observed\"}):It(z,{outcome:\"unknown\",message:\"The action led to another page\"})}}function fi(y){for(let N of[...$e.values()])N.context===y&&N.from!==null&&It(N,{outcome:\"unknown\",message:\"The page changed before the action finished\"})}function d0(y){let N=i.context(y.context);if(!N?.view)return Promise.resolve({outcome:\"failed\",code:\"NOT_READY\",message:\"The page is not ready\"});let z=y.region===null?void 0:N.regions[y.region],x=z?.kind===\"collection\"?z.records[y.key??\"\"]:z?.record??void 0,k=JSON.stringify([y.context,x?.entityType??y.region,x?.entity??y.key,y.name,y.args??null]),We=$e.get(k);if(We)return We.promise;let Ft,Qf=new Promise(Vt=>{Ft=Vt}),gl={...y,dedup:k,actionId:null,promise:Qf,resolve:Ft,timer:null,from:null,expect:null};$e.set(k,gl),qf(gl,l.actionTimeoutMs+j0),Bf();let{view:Xf}=N,v0={region:y.region,key:y.key,name:y.name,args:y.args??null,view:Xf.n},Zf=()=>{--rc===0&&Pa.clear()};return rc++,e.request(\"context.act\",{id:y.context,generation:Xf.generation,action:v0}).then(({actionId:Vt})=>{let vc=Pa.get(Vt)??[];if(Pa.delete(Vt),Zf(),$e.get(k)===gl){gl.actionId=Vt,Wa.set(Vt,gl);for(let y0 of vc)Vf(gl,y0)}},Vt=>{Zf();let vc=Pf(Vt?.code)?Vt.code:void 0;It(gl,{outcome:\"failed\",code:vc,message:Vt instanceof Error?Vt.message:\"The action failed\"})}),Qf}let dc=new Set;e.on(\"storage.changed\",y=>{for(let N of[...dc])N(y)});let m0={get:(y,N)=>e.request(\"storage.get\",{collection:y,key:N}),list:(y,N={})=>e.request(\"storage.list\",{collection:y,...N}),commit:y=>e.request(\"storage.commit\",{checks:y.checks??[],puts:y.puts??[],deletes:y.deletes??[]}),onChanged(y){return dc.add(y),()=>{dc.delete(y)}}},g0={async request(y,N,z={}){try{return await e.request(\"services.request\",{serviceId:y,path:N,method:z.method??\"GET\",body:z.body??null})}catch(x){throw x instanceof te?new cd(x.code,x.message):x}}},mc=new Set;function Yf(){for(let y of[...mc])y()}e.on(\"resumed\",Yf);let gc=new Set;e.on(\"retired\",()=>{for(let y of[...$e.values()])It(y,{outcome:\"unknown\",code:\"RETIRED\",message:\"This page was closed\"});for(let y of[...gc])y()});let Kl=new Map;for(let y of u)e.request(\"context.resync\",{id:y}).catch(()=>{}),s({type:\"schedule\",id:y,token:c.contexts[y].deadline});let kf=Jl(c,t);kf!==null&&o(\"context.reveal\",{id:kf});let jf=!1;return{manifest:t,appletId:n,limits:l,restored:a!==null,store:i,navigation:{state:()=>c,screen:C,presentation:y=>di(c.contexts[y],t),revealed:()=>Jl(c,t),navigate:M,select:Fe,back:()=>{T(!1)},reload:y=>{at(y??c.active)},viewWebsite:y=>{r({type:\"user.viewWebsite\",id:y??c.active})},done:y=>{r({type:\"user.done\",id:y??c.active})},setLeaveGuard:y=>{r({type:\"guard\",guard:y===null?null:{message:y}})},onConfirmLeave(y){return g=y,()=>{g===y&&(g=null)}},onScrollToTop(y){return m.add(y),()=>{m.delete(y)}},subscribe(y){return f.add(y),()=>{f.delete(y)}}},actions:{act:d0,pending:(y,N,z)=>fc.get(Lf(y,N,z))??Q0,subscribe(y){return sc.add(y),()=>{sc.delete(y)}}},storage:m0,services:g0,scroll:{get:y=>Kl.get(y),set(y,N){for(Kl.delete(y),Kl.set(y,N);Kl.size>k0;)Kl.delete(Kl.keys().next().value)}},onResume(y){return mc.add(y),()=>{mc.delete(y)}},onRetired(y){return gc.add(y),()=>{gc.delete(y)}},ready(){jf||(jf=!0,o(\"ui.ready\"))}}}var Q=U(mt(),1),Uh=U(Mh(),1),li=U(J(),1),Hh=(0,Q.createContext)(null);function pS({foreground:e,children:t}){return(0,li.jsx)(Hh.Provider,{value:e,children:t})}function Kt(){let e=(0,Q.useContext)(Hh);if(!e)throw new Error(\"Genesis hooks need mountForeground or GenesisProvider\");return e}function bS({foreground:e,children:t}){return(0,Q.useLayoutEffect)(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e.ready()))},[e]),t}async function Gh(e,t){let n=t??document.getElementById(\"root\")??document.body.appendChild(document.createElement(\"div\")),l=await Tc(),a=(0,Uh.createRoot)(n);return l.onRetired(()=>a.unmount()),a.render((0,li.jsx)(pS,{foreground:l,children:(0,li.jsx)(bS,{foreground:l,children:e})})),l}function _f(){let e=Kt();return(0,Q.useSyncExternalStore)(e.navigation.subscribe,e.navigation.state)}function nc(e){let t=_f();return e??t.active}function Lh(e,t){let{store:n}=Kt(),l=(0,Q.useCallback)(a=>n.subscribe(a,e),[n,e]);return(0,Q.useSyncExternalStore)(l,()=>t(n.context(e)))}var SS=(e,t)=>e.pageId===t.pageId&&e.status===t.status&&e.stale===t.stale&&e.generation===t.generation&&e.params===t.params&&e.error===t.error&&e.account===t.account&&e.url===t.url;function ES(e,t){return{pageId:e?.pageId??null,status:e?.status??\"loading\",stale:e?e.stale&&e.content:!1,generation:e?.view?.generation??null,params:e?.params??TS,error:e?.error??null,account:t,url:e?.url??null}}function qt(e){let{store:t}=Kt(),n=nc(e),l=(0,Q.useRef)(null),a=(0,Q.useCallback)(i=>t.subscribe(i),[t]),u=(0,Q.useCallback)(()=>{let i=ES(t.context(n),t.state().account);return(!l.current||!SS(l.current,i))&&(l.current=i),l.current},[t,n]);return(0,Q.useSyncExternalStore)(a,u)}var TS=Object.freeze({}),wh=new WeakMap,NS=Object.freeze({order:Object.freeze([]),get:()=>{},complete:!1,status:\"missing\",error:null,ephemeral:!1});function OS(e){if(!e)return NS;let t=wh.get(e);if(t)return t;if(e.kind===\"collection\"){let{records:n}=e;t={order:e.order.filter(l=>n[l]!==void 0),get:l=>n[l],complete:e.complete,status:e.status,error:e.error,ephemeral:e.ephemeral}}else{let{record:n}=e;t={order:n?[n.key]:[],get:l=>n&&n.key===l?n:void 0,complete:!0,status:e.status,error:e.error,ephemeral:!1}}return wh.set(e,t),t}function ai(e,t){return Lh(nc(t),n=>OS(n?.regions[e]))}function At(e,t,n){return Lh(nc(n),l=>AS(l?.regions[e],t))}function AS(e,t){if(e)return e.kind===\"single\"?t===null||e.record?.key===t?e.record??void 0:void 0:t===null?void 0:e.records[t]}function wn(e,t,n){let l=Kt();return(0,Q.useCallback)((a,u)=>l.actions.act({context:n??l.navigation.state().active,region:t??null,key:a,name:e,args:u}),[l,e,t,n])}function Ja(e,t,n){let l=Kt(),a=nc(n);return(0,Q.useSyncExternalStore)(l.actions.subscribe,()=>l.actions.pending(a,e,t))}function Ke(){let e=Kt(),t=_f(),{navigation:n}=e;return(0,Q.useMemo)(()=>({presentation:n.presentation(t.active),active:t.active,contexts:t.contexts,overlay:t.overlay,screen:n.screen(),revealed:n.revealed(),navigate:n.navigate,back:n.back,select:n.select,reload:n.reload,viewWebsite:n.viewWebsite,done:n.done,setLeaveGuard:n.setLeaveGuard}),[n,t])}function Bh(e,t={}){let n=Kt(),l=t.storage??n.storage,[a,u]=(0,Q.useState)({records:[],loading:!0,error:null});(0,Q.useEffect)(()=>{let m=!0,r=0;async function s(){let b=++r;try{let T=[],v;do{let d=await l.list(e,v===void 0?{}:{afterKey:v});T.push(...d.entries),v=d.nextAfterKey??void 0}while(v!==void 0);m&&b===r&&u({records:T,loading:!1,error:null})}catch(T){m&&b===r&&u(v=>({...v,loading:!1,error:T}))}}s();let p=l.onChanged(b=>{b.changes.some(T=>T.collection===e)&&s()});return()=>{m=!1,p()}},[l,e]);let i=(0,Q.useRef)(a.records);i.current=a.records;let o=(0,Q.useCallback)(m=>i.current.find(r=>r.key===m)?.revision??null,[]),c=(0,Q.useCallback)(m=>l.commit(m),[l]),f=(0,Q.useCallback)((m,r,s)=>l.commit({checks:[{collection:e,key:m,expectedRevision:s===void 0?o(m):s}],puts:[{collection:e,key:m,value:r}]}),[l,e,o]),g=(0,Q.useCallback)(m=>l.commit({checks:[{collection:e,key:m,expectedRevision:o(m)}],deletes:[{collection:e,key:m}]}),[l,e,o]);return{...a,put:f,remove:g,commit:c}}var zS=1500;function _S(){let e=Kt();_f();let t=e.navigation.screen(),n=t?.key??`${e.navigation.state().active}:none`,l=t&&!t.overlay?t.context:null;return(0,Q.useCallback)(a=>{if(!a)return;let u=e.scroll.get(n)??0,i=u>0,o=performance.now(),c=0,f=()=>{i&&(a.scrollTop=u,Math.abs(a.scrollTop-u)<2||performance.now()-o>zS?i=!1:c=requestAnimationFrame(f))},g=()=>{i=!1},m=()=>{i||e.scroll.set(n,a.scrollTop)},r=e.navigation.onScrollToTop(s=>{s===l&&(i=!1,a.scrollTo({top:0,behavior:\"smooth\"}))});return f(),a.addEventListener(\"scroll\",m,{passive:!0}),a.addEventListener(\"touchstart\",g,{passive:!0}),a.addEventListener(\"wheel\",g,{passive:!0}),()=>{cancelAnimationFrame(c),r(),a.removeEventListener(\"scroll\",m),a.removeEventListener(\"touchstart\",g),a.removeEventListener(\"wheel\",g)}},[e,n,l])}function we(e){return(0,li.jsx)(\"div\",{...e,ref:_S()})}function qh(e){let t=Kt(),n=(0,Q.useRef)(e);n.current=e,(0,Q.useEffect)(()=>t.onResume(()=>n.current()),[t])}var Vh=U(mt(),1);var ie=\"https://news.ycombinator.com\";var ui=e=>typeof e==\"string\"&&e.length<=20&&/^[1-9][0-9]*$/.test(e);var kl=e=>`${ie}/item?id=${e}`,gn=e=>`${ie}/user?id=${encodeURIComponent(e)}`;function lc(e,t=ie){try{let n=new URL(e,t);return(n.protocol===\"https:\"||n.protocol===\"http:\")&&!n.username&&!n.password&&n.href.length<=2048?n.href:null}catch{return null}}var be=U(J(),1),CS={home:\"M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z\",search:\"M21 21l-5.2-5.2M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0\",post:\"M12 5v14M5 12h14\",bookmark:\"M6 3h12v18l-6-4-6 4z\",person:\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0\",up:\"M12 6l7 10H5z\",chevron:\"M9 6l6 6-6 6\",external:\"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6\"};function Ia({name:e,filled:t=!1}){return(0,be.jsx)(\"svg\",{viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",className:t?\"filled\":void 0,children:(0,be.jsx)(\"path\",{d:CS[e]})})}function Je(){let{navigate:e}=Ke();return(0,Vh.useCallback)(t=>{try{e({url:t})}catch(n){console.error(\"Genesis could not open\",t,n)}},[e])}function ml({parts:e,onLink:t}){let n=Je(),l=t??n;return(0,be.jsx)(\"div\",{className:\"rich\",children:e.map((a,u)=>{let i=a.text;if(a.code&&(i=(0,be.jsx)(\"code\",{children:i})),a.em&&(i=(0,be.jsx)(\"em\",{children:i})),a.strong&&(i=(0,be.jsx)(\"strong\",{children:i})),a.href){let o=a.href;i=(0,be.jsx)(\"a\",{href:o,onClick:c=>{c.preventDefault(),l(o)},children:i})}return(0,be.jsx)(\"span\",{children:i},u)})})}function Ue({label:e,rows:t=8,kind:n=\"list\"}){return(0,be.jsx)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:`skeleton ${n}`,children:Array.from({length:t},(l,a)=>(0,be.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[(0,be.jsx)(\"span\",{}),(0,be.jsx)(\"span\",{})]},a))})}function Ie({title:e,children:t,role:n}){return(0,be.jsxs)(\"section\",{className:\"notice\",role:n,children:[(0,be.jsx)(\"h2\",{children:e}),t]})}function zt({error:e}){let{viewWebsite:t}=Ke(),n=e?.code===\"NOT_READY\"||e?.code===\"DEADLINE\"?\"Hacker News did not answer in time.\":e?.message||\"This page could not be read.\";return(0,be.jsxs)(Ie,{title:\"Couldn't load this page\",role:\"alert\",children:[(0,be.jsx)(\"p\",{children:n}),(0,be.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t(),children:[\"Open on Hacker News \",(0,be.jsx)(Ia,{name:\"external\"})]})]})}var Yh=e=>`${ie}/login?goto=${encodeURIComponent(e)}`;function ii({parts:e}){let t=e.filter(Boolean);return(0,be.jsx)(\"p\",{className:\"meta\",children:t.map((n,l)=>(0,be.jsxs)(\"span\",{children:[l>0&&\" \\xB7 \",n]},l))})}var Fa=U(mt(),1);var Ql=U(mt(),1);var yE=new TextEncoder;var MS=new Set([\"CONFLICT\",\"INVALID_ARGUMENT\",\"NOT_FOUND\",\"QUOTA_EXCEEDED\",\"STORAGE_FAILURE\"]),kh=new WeakMap;function xS(e){let t=kh.get(e);if(t)return t;let n=new Set,l=i=>queueMicrotask(()=>{for(let o of n)try{o(i)}catch(c){console.error(\"Library change listener failed\",c)}});async function a(i,o){let c=await e.services.request(\"bookmarks\",\"/v1/documents\",{method:\"POST\",body:{operation:i,params:o}}),f=c.body?.error;if(c.status<200||c.status>=300||f){let m=f&&MS.has(f.code)?f.code:\"SERVICE_FAILURE\";throw new te(m,f?.message??\"The bookmarks service refused the request. Reload before retrying.\")}let g=c.body?.result;if(!g||typeof g!=\"object\")throw new te(\"SERVICE_FAILURE\",\"The bookmarks service sent an invalid answer.\");return i===\"commit\"&&l({changes:c.body.changes??[],namespaceRevision:g.namespaceRevision}),g}let u={get:(i,o)=>a(\"get\",{collection:i,key:o}),list:(i,o={})=>a(\"list\",{collection:i,limit:100,...o}),commit:i=>a(\"commit\",{checks:[],puts:[],deletes:[],...i}),onChanged(i){return n.add(i),()=>{n.delete(i)}},refresh:()=>l({changes:[\"bookmarks\",\"categories\",\"category-meta\"].map(i=>({collection:i,key:\"\"})),namespaceRevision:0})};return e.onRetired(()=>n.clear()),kh.set(e,u),u}var xf=e=>new TextEncoder().encode(e).length,uc=e=>typeof e==\"number\"&&Number.isSafeInteger(e)&&e>=0,Uf=e=>typeof e==\"string\"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e),Cf=e=>`hn:item:${e}`,Xh=(e,t)=>`${String(Number.MAX_SAFE_INTEGER-e).padStart(16,\"0\")}:${t}`,jl=()=>new te(\"STORAGE_FAILURE\",\"Category data has an unsupported format. Its data has been preserved.\"),oi=()=>new te(\"CONFLICT\",\"Categories changed. Review them before retrying.\"),jh=()=>new te(\"CONFLICT\",\"A category with this name already exists.\");function ac(e){let t=e;if(!t||t.schemaVersion!==1||!ui(t.itemId)||t.discussionUrl!==kl(t.itemId)||typeof t.title!=\"string\"||!t.title.trim()||xf(t.title)>2048||!(t.submitter===null||typeof t.submitter==\"string\"&&xf(t.submitter)<=256)||!(t.articleUrl===null||typeof t.articleUrl==\"string\"&&lc(t.articleUrl)===t.articleUrl)||typeof t.truncated!=\"boolean\"||!uc(t.savedAtMs)||!uc(t.capturedAtMs)||!Array.isArray(t.categoryIds)||t.categoryIds.length>50||!t.categoryIds.every(Uf)||new Set(t.categoryIds).size!==t.categoryIds.length||t.orderKey!==Xh(t.savedAtMs,t.itemId))throw new te(\"STORAGE_FAILURE\",\"This saved story has an unsupported format. Its data has been preserved.\");return t}function Rf(e){let t=e.trim(),n=t.normalize(\"NFKC\").trim().replace(/\\s+/gu,\" \").toLowerCase();if(!t||[...t].length>40||!n||xf(n)>512)throw new te(\"INVALID_ARGUMENT\",\"Use a category name of 1 to 40 characters.\");if([\"all\",\"uncategorized\"].includes(n))throw new te(\"INVALID_ARGUMENT\",\"All and Uncategorized are reserved filter names.\");return{name:t,normalizedName:n}}function Mf(e){let t=e;try{if(!t||t.schemaVersion!==1||!Uf(t.id)||typeof t.name!=\"string\"||!uc(t.createdAtMs)||!(t.deletedAtMs===null||uc(t.deletedAtMs)&&t.deletedAtMs>=t.createdAtMs))throw jl();let n=Rf(t.name);if(t.name!==n.name||t.normalizedName!==n.normalizedName)throw jl();return t}catch{throw jl()}}function RS(e){let t=e;if(!t||!Array.isArray(t.ids)||t.ids.length>50||!t.ids.every(Uf)||new Set(t.ids).size!==t.ids.length)throw jl();return{ids:t.ids}}function Qh(e,t){if(!e||e.value?.categoryId!==t)throw jl()}function Zh(e,t){if(t.length>50||new Set(t).size!==t.length)throw new te(\"INVALID_ARGUMENT\",\"Invalid category selection\");let n=[{collection:\"category-meta\",key:\"active\",expectedRevision:e.meta?.revision??null}];for(let l of t){let a=e.categories.find(u=>u.value.id===l);if(!a)throw oi();n.push({collection:\"categories\",key:l,expectedRevision:a.revision})}return n}var Xl=(e,t)=>e.filter(n=>t.categories.some(l=>l.value.id===n)),Kh=e=>({itemId:e.id,discussionUrl:kl(e.id),articleUrl:e.articleUrl,title:e.title,submitter:e.submitter,truncated:!1,capturedAtMs:Date.now()}),Df=class{constructor(t){this.storage=t}storage;async get(t){if(!ui(t))throw new te(\"INVALID_ARGUMENT\",\"Invalid story ID\");let{document:n}=await this.storage.get(\"bookmarks\",Cf(t));if(!n)return null;let l=ac(n.value);if(l.itemId!==t)throw new te(\"STORAGE_FAILURE\",\"Saved story identity mismatch. Data preserved.\");return{...n,value:l}}async save(t,n,l={}){if(n&&n.value.itemId!==t.itemId)throw new te(\"INVALID_ARGUMENT\",\"Story identity changed\");let a=n?.value.savedAtMs??Date.now(),u=Cf(t.itemId),i=ac({...n&&!l.refresh?n.value:t,schemaVersion:1,savedAtMs:a,orderKey:Xh(a,t.itemId),categoryIds:l.categoryIds??n?.value.categoryIds??[]}),o=[{collection:\"bookmarks\",key:u,expectedRevision:n?.revision??null},...l.checks??[]],c=[{collection:\"bookmarks\",key:u,value:i}];n||(o.push({collection:\"bookmark-order\",key:i.orderKey,expectedRevision:null}),c.push({collection:\"bookmark-order\",key:i.orderKey,value:{bookmarkKey:u}})),await this.storage.commit({checks:o,puts:c})}async remove(t){let n=ac(t.value),l=Cf(n.itemId),a=await this.storage.get(\"bookmark-order\",n.orderKey);if(a.document&&a.document.value.bookmarkKey!==l)throw new te(\"STORAGE_FAILURE\",\"Bookmark index mismatch. Data preserved.\");await this.storage.commit({checks:[{collection:\"bookmarks\",key:l,expectedRevision:t.revision},{collection:\"bookmark-order\",key:n.orderKey,expectedRevision:a.document?.revision??null}],deletes:[{collection:\"bookmarks\",key:l},{collection:\"bookmark-order\",key:n.orderKey}]})}},wf=class{constructor(t){this.storage=t}storage;async read(){for(let t=0;t<3;t++){let n=await this.storage.get(\"category-meta\",\"active\"),l=n.document?{...n.document,value:RS(n.document.value)}:null,a=[];for(let i of l?.value.ids??[])a.push(await this.storage.get(\"categories\",i));if(a.some(i=>i.namespaceRevision!==n.namespaceRevision))continue;let u=a.map((i,o)=>{if(!i.document)throw jl();let c=Mf(i.document.value);if(c.id!==l.value.ids[o]||c.deletedAtMs!==null)throw jl();return{...i.document,value:c}});return{meta:l,categories:u,namespaceRevision:n.namespaceRevision}}throw oi()}async create(t){let n=Rf(t),l=await this.read();if(l.categories.length>=50)throw new te(\"QUOTA_EXCEEDED\",\"You can have up to 50 active categories.\");if((await this.storage.get(\"category-names\",n.normalizedName)).document)throw jh();let a=crypto.randomUUID(),u={schemaVersion:1,id:a,...n,createdAtMs:Date.now(),deletedAtMs:null};return await this.storage.commit({checks:[{collection:\"category-meta\",key:\"active\",expectedRevision:l.meta?.revision??null},{collection:\"categories\",key:a,expectedRevision:null},{collection:\"category-names\",key:n.normalizedName,expectedRevision:null}],puts:[{collection:\"categories\",key:a,value:u},{collection:\"category-names\",key:n.normalizedName,value:{categoryId:a}},{collection:\"category-meta\",key:\"active\",value:{ids:[...l.meta?.value.ids??[],a]}}]}),a}async rename(t,n){let l=Mf(t.value),a=Rf(n);if(l.deletedAtMs!==null||(await this.storage.get(\"categories\",l.id)).document?.revision!==t.revision)throw oi();if(l.normalizedName===a.normalizedName){await this.storage.commit({checks:[{collection:\"categories\",key:l.id,expectedRevision:t.revision}],puts:[{collection:\"categories\",key:l.id,value:{...l,...a}}]});return}let[i,o]=await Promise.all([this.storage.get(\"category-names\",l.normalizedName),this.storage.get(\"category-names\",a.normalizedName)]);if(Qh(i.document,l.id),o.document)throw jh();await this.storage.commit({checks:[{collection:\"categories\",key:l.id,expectedRevision:t.revision},{collection:\"category-names\",key:l.normalizedName,expectedRevision:i.document.revision},{collection:\"category-names\",key:a.normalizedName,expectedRevision:null}],puts:[{collection:\"categories\",key:l.id,value:{...l,...a}},{collection:\"category-names\",key:a.normalizedName,value:{categoryId:l.id}}],deletes:[{collection:\"category-names\",key:l.normalizedName}]})}async remove(t){let n=Mf(t.value),l=await this.read();if(!l.categories.some(u=>u.value.id===n.id&&u.revision===t.revision))throw oi();let a=await this.storage.get(\"category-names\",n.normalizedName);Qh(a.document,n.id),await this.storage.commit({checks:[{collection:\"categories\",key:n.id,expectedRevision:t.revision},{collection:\"category-meta\",key:\"active\",expectedRevision:l.meta.revision},{collection:\"category-names\",key:n.normalizedName,expectedRevision:a.document.revision}],puts:[{collection:\"categories\",key:n.id,value:{...n,deletedAtMs:Math.max(Date.now(),n.createdAtMs)}},{collection:\"category-meta\",key:\"active\",value:{ids:l.meta.value.ids.filter(u=>u!==n.id)}}],deletes:[{collection:\"category-names\",key:n.normalizedName}]})}};function ci(){let e=xS(Kt());return(0,Ql.useMemo)(()=>({storage:e,bookmarkRepository:new Df(e),categoryRepository:new wf(e)}),[e])}function vn(e){return e?.code===\"CONFIGURATION_REQUIRED\"?\"Saved stories need the bookmarks service. Connect it under Service connections in the Genesis menu.\":Ec(e)}function ic(){let{storage:e,bookmarkRepository:t,categoryRepository:n}=ci(),l=Bh(\"bookmarks\",{storage:e}),[a,u]=(0,Ql.useState)({snapshot:null,error:null});return(0,Ql.useEffect)(()=>{let o=!0,c=0,f=()=>{let m=++c;n.read().then(r=>{o&&m===c&&u({snapshot:r,error:null})},r=>{o&&m===c&&u(s=>({...s,error:r}))})};f();let g=e.onChanged(m=>{m.changes.some(r=>r.collection.startsWith(\"categor\"))&&f()});return()=>{o=!1,g()}},[e,n]),qh(()=>e.refresh()),{bookmarks:(0,Ql.useMemo)(()=>l.records.flatMap(o=>{try{return[{...o,value:ac(o.value)}]}catch{return[]}}).sort((o,c)=>c.value.savedAtMs-o.value.savedAtMs),[l.records]),categories:a.snapshot,loading:l.loading||a.snapshot===null&&a.error===null,error:l.error??a.error,bookmarkRepository:t,categoryRepository:n}}var I=U(J(),1);function Jh(){let e=ic(),t;return!e.categories&&e.error?t=(0,I.jsx)(Ie,{title:\"Couldn't load categories\",role:\"alert\",children:(0,I.jsx)(\"p\",{children:vn(e.error)})}):e.categories?t=(0,I.jsx)(DS,{categories:e.categories}):t=(0,I.jsx)(Ue,{label:\"Loading categories\",rows:3,kind:\"text\"}),(0,I.jsxs)(we,{className:\"screen\",children:[(0,I.jsx)(\"p\",{className:\"eyebrow\",children:\"Saved stories\"}),(0,I.jsx)(\"h1\",{className:\"screen-title\",children:\"Categories\"}),t]})}function DS({categories:e}){let{categoryRepository:t,storage:n}=ci(),[l,a]=(0,Fa.useState)(\"\"),[u,i]=(0,Fa.useState)(!1),[o,c]=(0,Fa.useState)(\"\"),f=async(g,m)=>{if(!u){i(!0),c(\"\");try{await g(),c(m)}catch(r){n.refresh(),c(`${vn(r)} The list has been reread; review it before retrying.`)}finally{i(!1)}}};return(0,I.jsxs)(\"section\",{className:\"card manager\",\"aria-busy\":u,\"aria-label\":\"Manage categories\",children:[(0,I.jsx)(\"p\",{className:\"meta\",children:\"Changes save immediately. Deleting a category keeps its stories, which become Uncategorized.\"}),o&&(0,I.jsx)(\"p\",{role:\"status\",className:\"status\",children:o}),(0,I.jsxs)(\"form\",{className:\"row\",onSubmit:g=>{g.preventDefault(),f(async()=>{await t.create(l),a(\"\")},\"Category created.\")},children:[(0,I.jsxs)(\"label\",{className:\"grow\",children:[(0,I.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,I.jsx)(\"input\",{placeholder:\"New category\",value:l,disabled:u,onChange:g=>a(g.target.value)})]}),(0,I.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:u||!l.trim(),children:\"Create\"})]}),(0,I.jsxs)(\"p\",{className:\"meta\",children:[e.categories.length,\" of 50 categories\"]}),e.categories.map(g=>(0,I.jsx)(wS,{record:g,busy:u,rename:m=>{f(()=>t.rename(g,m),\"Category renamed.\")},remove:()=>{f(()=>t.remove(g),\"Category deleted.\")}},`${g.value.id}:${g.revision}`))]})}function wS({record:e,busy:t,rename:n,remove:l}){let[a,u]=(0,Fa.useState)(e.value.name),[i,o]=(0,Fa.useState)(!1);return(0,I.jsxs)(\"div\",{className:\"category\",children:[(0,I.jsxs)(\"div\",{className:\"row\",children:[(0,I.jsxs)(\"label\",{className:\"grow\",children:[(0,I.jsxs)(\"span\",{className:\"visually-hidden\",children:[\"Rename \",e.value.name]}),(0,I.jsx)(\"input\",{value:a,disabled:t,onChange:c=>u(c.target.value)})]}),(0,I.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t||!a.trim()||a===e.value.name,onClick:()=>n(a),children:\"Rename\"}),(0,I.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:t,onClick:()=>o(!0),children:\"Delete\"})]}),i&&(0,I.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":`Delete ${e.value.name}`,children:[(0,I.jsxs)(\"p\",{children:[\"Delete \\u201C\",e.value.name,\"\\u201D? Its stories stay saved.\"]}),(0,I.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:t,onClick:l,children:\"Delete category permanently\"}),(0,I.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t,onClick:()=>o(!1),children:\"Keep category\"})]})]})}var ri=U(mt(),1);var V=U(J(),1);function Fh(e,t,n){let l=Ja(e,t),a=wn(\"setVoted\",e),[u,i]=(0,ri.useState)(!1),o=[...l].reverse().find(g=>g.name===\"setVoted\"),c=o?o.args.voted:n;return{shown:c,busy:o!==void 0,failed:u,toggle:()=>{i(!1),a(t,{voted:!c}).then(g=>i(g.outcome===\"failed\"))}}}function $h({vote:e,canVote:t,title:n,signedIn:l,small:a=!1}){let u=`vote${a?\" small\":\"\"}${e.shown?\" voted\":\"\"}`;return!l||!t&&!e.shown?(0,V.jsx)(\"span\",{className:u,\"aria-hidden\":\"true\"}):(0,V.jsx)(\"button\",{type:\"button\",className:`${u} icon-button`,\"aria-pressed\":e.shown,disabled:e.busy,\"aria-label\":e.shown?`Remove upvote: ${n}`:`Upvote: ${n}`,onClick:e.toggle,children:(0,V.jsx)(Ia,{name:\"up\",filled:e.shown})})}var Wh=({vote:e})=>e.failed?(0,V.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"The vote didn't go through. Try again.\"}):null;function US(){let{navigate:e}=Ke();return t=>e({screen:\"save\",params:{snapshot:JSON.stringify(Kh(t)),fresh:\"1\"}})}var oc=(0,ri.memo)(function({story:t,region:n,signedIn:l,heading:a=!1}){let u=Je(),i=Fh(n,t.id,t.voted),o=US(),c=a?\"h1\":\"h2\",f=kl(t.id);return(0,V.jsxs)(\"article\",{className:\"story\",children:[t.rank&&!a&&(0,V.jsx)(\"span\",{className:\"rank\",\"aria-hidden\":\"true\",children:t.rank}),(0,V.jsx)($h,{vote:i,canVote:t.canVote,title:t.title,signedIn:l}),(0,V.jsxs)(\"div\",{className:\"story-body\",children:[(0,V.jsxs)(c,{className:\"story-title\",children:[(0,V.jsx)(\"a\",{href:t.articleUrl??f,onClick:g=>{g.preventDefault(),u(t.articleUrl??f)},children:t.title}),t.domain&&(0,V.jsxs)(\"span\",{className:\"domain\",children:[\" (\",t.domain,\")\"]})]}),(0,V.jsx)(ii,{parts:[t.score,t.submitter&&(0,V.jsx)(\"a\",{href:gn(t.submitter),onClick:g=>{g.preventDefault(),u(gn(t.submitter))},children:t.submitter}),t.age,t.comments&&!a&&(0,V.jsx)(\"a\",{href:f,onClick:g=>{g.preventDefault(),u(f)},children:t.comments})]}),(0,V.jsx)(Wh,{vote:i})]}),(0,V.jsx)(\"button\",{type:\"button\",className:\"icon-button\",\"aria-label\":`Save story: ${t.title}`,onClick:()=>o(t),children:(0,V.jsx)(Ia,{name:\"bookmark\"})})]})}),Ih=(e,t)=>`${ie}/reply?id=${e}&goto=${encodeURIComponent(`item?id=${t}#${e}`)}`,si=(0,ri.memo)(function({entry:t,region:n,storyId:l,signedIn:a,collapsed:u,hidden:i,onToggle:o,onLink:c,head:f=!1}){let g=Je(),m=Fh(n,t.id,t.voted),r=t.author;return(0,V.jsxs)(\"article\",{className:\"comment\",id:`comment-${t.id}`,style:{\"--depth\":Math.min(t.depth,8)},children:[(0,V.jsxs)(\"header\",{className:\"comment-head\",children:[(0,V.jsx)($h,{small:!0,vote:m,canVote:t.canVote,title:`comment by ${r??\"unknown\"}`,signedIn:a}),(0,V.jsx)(ii,{parts:[r&&(0,V.jsx)(\"a\",{href:gn(r),onClick:s=>{s.preventDefault(),g(gn(r))},children:(0,V.jsx)(\"strong\",{children:r})}),t.age,f&&t.onStory&&(0,V.jsxs)(\"a\",{href:kl(t.onStory.id),onClick:s=>{s.preventDefault(),g(kl(t.onStory.id))},children:[\"on: \",t.onStory.title]})]}),o&&(0,V.jsx)(\"button\",{type:\"button\",className:\"text-button\",\"aria-expanded\":!u,onClick:()=>o(t.id),children:u?`Show${i?` (${i+1})`:\"\"}`:\"Hide\"})]}),!u&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ml,{parts:t.parts,onLink:c}),(0,V.jsx)(Wh,{vote:m}),(0,V.jsxs)(\"nav\",{className:\"comment-links\",\"aria-label\":\"Comment links\",children:[t.links.map(s=>(0,V.jsx)(\"a\",{href:s.url,onClick:p=>{p.preventDefault(),c(s.url)},children:s.label},s.label+s.url)),t.canReply&&(0,V.jsx)(\"a\",{href:Ih(t.id,l),onClick:s=>{s.preventDefault(),g(Ih(t.id,l))},children:\"reply\"})]})]})]})});var He=U(J(),1),Ph=[{label:\"Top\",paths:[\"/\",\"/news\"]},{label:\"New\",paths:[\"/newest\"]},{label:\"Past\",paths:[\"/front\"]},{label:\"Comments\",paths:[\"/newcomments\"]},{label:\"Ask\",paths:[\"/ask\"]},{label:\"Show\",paths:[\"/show\"]},{label:\"Jobs\",paths:[\"/jobs\"]}],HS={\"/shownew\":\"New Show\",\"/asknew\":\"New Ask\",\"/best\":\"Best\",\"/active\":\"Active\",\"/from\":\"From site\",\"/submitted\":\"Submissions\",\"/threads\":\"Comments\",\"/favorites\":\"Favorites\",\"/hidden\":\"Hidden\",\"/upvoted\":\"Upvoted\"};function e0(){let e=qt(),{navigate:t}=Ke(),n=ai(\"stories\"),l=ai(\"comments\"),a=At(\"more\",null),u=wn(\"loadMore\"),i=Ja(null,null).some(T=>T.name===\"loadMore\"),o=Je(),c=e.account!==null,f=e.pageId===\"feed\"||e.pageId===\"private-feed\",g=e.url?new URL(e.url).pathname:\"/\",m=Ph.find(T=>T.paths.includes(g)),r=f?n.order:[],s=f&&r.length===0?l.order:[],p=()=>{u(null).then(T=>{T.outcome===\"failed\"&&a&&o(a.data.url)})},b;return r.length===0&&s.length===0?f&&e.status===\"ready\"&&n.status===\"ready\"?b=(0,He.jsx)(Ie,{title:\"Nothing here yet\",children:(0,He.jsx)(\"p\",{children:\"This list is empty on Hacker News.\"})}):e.status===\"error\"||n.status===\"error\"?b=(0,He.jsx)(zt,{error:e.error??n.error}):b=(0,He.jsx)(Ue,{label:\"Loading stories\"}):b=(0,He.jsxs)(He.Fragment,{children:[e.status===\"error\"&&(0,He.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),(n.status===\"error\"||l.status===\"error\")&&(0,He.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some rows couldn't be read.\"}),r.map(T=>{let v=n.get(T)?.data;return v&&(0,He.jsx)(oc,{story:v,region:\"stories\",signedIn:c},T)}),s.map(T=>{let v=l.get(T)?.data;return v&&(0,He.jsx)(si,{head:!0,entry:v,region:\"comments\",storyId:v.onStory?.id??T,signedIn:c,onLink:o},T)}),a&&(0,He.jsx)(\"button\",{type:\"button\",className:\"secondary more\",disabled:i||e.stale,onClick:p,children:i?\"Loading\\u2026\":\"More\"})]}),(0,He.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[m?(0,He.jsx)(\"nav\",{className:\"chips\",\"aria-label\":\"Feeds\",children:Ph.map(T=>(0,He.jsx)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":T===m,onClick:()=>T!==m&&t({url:ie+T.paths[0],mode:\"replace\"}),children:T.label},T.label))}):(0,He.jsx)(\"h1\",{className:\"screen-title\",children:HS[g]??\"Hacker News\"}),b]})}var Un=U(J(),1);function t0(){let e=qt(),t=At(\"sections\",null),n=e.pageId===\"info\"?t?.data??null:null;return n?(0,Un.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale,children:[(0,Un.jsx)(\"h1\",{className:\"screen-title\",children:n.title}),(0,Un.jsx)(\"div\",{className:\"card\",children:(0,Un.jsx)(ml,{parts:n.parts})})]}):(0,Un.jsx)(\"div\",{className:\"screen\",\"aria-busy\":e.status===\"loading\",children:e.status===\"error\"?(0,Un.jsx)(zt,{error:e.error}):(0,Un.jsx)(Ue,{label:\"Loading page\",rows:6,kind:\"text\"})})}var _t=U(mt(),1);var Ge=U(J(),1);function GS(e){let t=new Map,n=new Map,l=[];for(let a of e.order){let u=e.get(a)?.data;if(u){for(;l.length>0&&l[l.length-1].depth>=u.depth;)l.pop();t.set(a,l.map(i=>i.id));for(let i of l)n.set(i.id,(n.get(i.id)??0)+1);l.push({id:a,depth:u.depth})}}return{ancestors:t,replies:n}}function n0(){let e=qt(),t=At(\"story\",null),n=ai(\"comments\"),l=At(\"more\",null),a=Je(),[u,i]=(0,_t.useState)(new Set),[o,c]=(0,_t.useState)(null),f=(0,_t.useRef)(null),{ancestors:g,replies:m}=(0,_t.useMemo)(()=>GS(n),[n]),r=e.account!==null,s=e.pageId===\"item\"?t?.data??null:null,p=s?.story?.id??s?.comment?.id??e.params.id??\"\",b=s?.comment?.onStory?.id??p,T=(0,_t.useRef)({ancestors:g,url:e.url});T.current={ancestors:g,url:e.url},(0,_t.useEffect)(()=>{o&&(f.current?.querySelector(`[id=\"comment-${o}\"]`)?.scrollIntoView({block:\"start\"}),c(null))},[o]);let v=(0,_t.useCallback)(C=>{let{ancestors:A,url:_}=T.current,Y=new URL(C),M=Y.hash.slice(1);Y.hash=\"\";let F=_?new URL(_):null;F&&(F.hash=\"\"),M&&F&&Y.href===F.href&&A.has(M)?(i(Fe=>new Set([...Fe].filter(Ct=>Ct!==M&&!A.get(M).includes(Ct)))),c(M)):a(C)},[a]),d=(0,_t.useCallback)(C=>i(A=>{let _=new Set(A);return _.delete(C)||_.add(C),_}),[]);if(!s)return(0,Ge.jsx)(\"div\",{className:\"screen\",\"aria-busy\":e.status===\"loading\",children:e.status===\"error\"?(0,Ge.jsx)(zt,{error:e.error}):(0,Ge.jsx)(Ue,{label:\"Loading discussion\"})});let h=e.pageId===\"item\"?n.order:[],S=h.filter(C=>!g.get(C)?.some(A=>u.has(A))),O=`item?id=${p}`;return(0,Ge.jsx)(we,{className:\"screen\",\"aria-busy\":e.stale,children:(0,Ge.jsxs)(\"div\",{ref:f,children:[e.status===\"error\"&&(0,Ge.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),s.story&&(0,Ge.jsx)(oc,{heading:!0,story:s.story,region:\"story\",signedIn:r}),s.comment&&(0,Ge.jsx)(si,{head:!0,entry:s.comment,region:\"story\",storyId:b,signedIn:r,onLink:v}),s.text.length>0&&(0,Ge.jsx)(\"div\",{className:\"toptext\",children:(0,Ge.jsx)(ml,{parts:s.text,onLink:v})}),r&&s.canComment&&(0,Ge.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>a(`${ie}/reply?id=${p}&goto=${encodeURIComponent(O)}`),children:\"Add a comment\"}),!r&&(0,Ge.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>a(Yh(O)),children:\"Sign in to comment\"}),(0,Ge.jsx)(\"h2\",{className:\"section-title\",children:h.length===0?\"No comments yet\":\"Comments\"}),n.status===\"error\"&&(0,Ge.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some comments couldn't be read.\"}),S.map(C=>{let A=n.get(C)?.data;return A&&(0,Ge.jsx)(si,{entry:A,region:\"comments\",storyId:b,signedIn:r,collapsed:u.has(C),hidden:m.get(C)??0,onToggle:d,onLink:v},C)}),l&&(0,Ge.jsx)(\"button\",{type:\"button\",className:\"secondary more\",disabled:e.stale,onClick:()=>a(l.data.url),children:\"More comments\"})]})})}var Hf=U(mt(),1);var ee=U(J(),1);function l0(){let e=qt(),t=At(\"account\",null),n=wn(\"signOut\",\"account\"),l=Ja(\"account\",t?.key??null).length>0,a=Je(),[u,i]=(0,Hf.useState)(!1),[o,c]=(0,Hf.useState)(!1),f=e.pageId===\"account\"&&!e.stale?t?.data??null:null,g=()=>{c(!1),n(t.key).then(r=>{let s=r.outcome===\"observed\"||r.code===\"AUTH_REQUIRED\"||r.code===\"CONTEXT_REPLACED\";c(!s),s&&i(!1)})},m;if(!f)m=e.status===\"error\"?(0,ee.jsx)(zt,{error:e.error}):(0,ee.jsx)(Ue,{label:\"Loading account\",rows:4,kind:\"text\"});else{let r=encodeURIComponent(f.name);m=(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)(\"section\",{className:\"card account\",children:[(0,ee.jsx)(\"h2\",{children:f.name}),f.karma&&(0,ee.jsxs)(\"p\",{className:\"meta\",children:[f.karma,\" karma\"]})]}),(0,ee.jsxs)(\"nav\",{className:\"list\",\"aria-label\":\"Your Hacker News\",children:[(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(gn(f.name)),children:\"Profile\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/submitted?id=${r}`),children:\"My submissions\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/threads?id=${r}`),children:\"My comments\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/favorites?id=${r}`),children:\"HN favorites\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/upvoted?id=${r}`),children:\"Upvoted\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/hidden?id=${r}`),children:\"Hidden\"})]}),(0,ee.jsx)(\"p\",{className:\"meta\",children:\"Genesis Saved stories are separate from HN favorites.\"}),o&&(0,ee.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't sign out. Try again.\"}),u?(0,ee.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":\"Confirm sign out\",children:[(0,ee.jsx)(\"p\",{children:\"Sign out of Hacker News in this app?\"}),(0,ee.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:l,onClick:g,children:\"Sign out\"}),(0,ee.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:l,onClick:()=>i(!1),children:\"Stay signed in\"})]}):(0,ee.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>i(!0),children:\"Sign out\"})]})}return(0,ee.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,ee.jsx)(\"h1\",{className:\"screen-title\",children:\"Me\"}),m,(0,ee.jsxs)(\"nav\",{className:\"list\",\"aria-label\":\"About Hacker News\",children:[(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/newsguidelines.html`),children:\"Guidelines\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/newsfaq.html`),children:\"FAQ\"})]})]})}var Jt=U(mt(),1);var oe=U(J(),1);function a0(){let e=qt(),{setLeaveGuard:t}=Ke(),n=At(\"form\",null),l=wn(\"setField\",\"form\"),a=wn(\"submit\",\"form\"),u=Je(),[i,o]=(0,Jt.useState)(\"\"),[c,f]=(0,Jt.useState)(\"\"),[g,m]=(0,Jt.useState)(\"\"),[r,s]=(0,Jt.useState)(!1),[p,b]=(0,Jt.useState)(null),[T,v]=(0,Jt.useState)(null),d=e.pageId===\"submit\"&&!e.stale?n?.data??null:null,[h,S]=(0,Jt.useState)(!1);(0,Jt.useEffect)(()=>{h||!d||(S(!0),o(d.title),f(d.url),m(d.text))},[h,d]);let O=T===null&&(i.trim()!==\"\"||c.trim()!==\"\"||g.trim()!==\"\");(0,Jt.useEffect)(()=>t(O?\"Discard this post?\":null),[O,t]);let C=c.trim()&&!lc(c.trim())?\"Enter a web address that starts with http or https.\":null,A=i.trim()!==\"\"&&i.trim().length<=80&&!C&&!r&&n!==void 0,_=async()=>{s(!0),b(null);let F=n.key;for(let[Ct,Zl]of[[\"title\",i.trim()],[\"url\",c.trim()],[\"text\",g]])if((await l(F,{name:Ct,value:Zl})).outcome!==\"observed\"){s(!1),b(\"Couldn't fill in Hacker News's form. Try again.\");return}let Fe=await a(F);s(!1),Fe.outcome===\"observed\"?v(\"accepted\"):Fe.code===\"REJECTED\"?b(null):Fe.outcome===\"unknown\"?v(\"unknown\"):b(\"Hacker News didn't take the post. Check the form and try again.\")},Y=()=>{o(\"\"),f(\"\"),m(\"\"),v(null),u(`${ie}/submit`)};if(T)return(0,oe.jsxs)(\"div\",{className:\"screen\",children:[(0,oe.jsx)(\"h1\",{className:\"screen-title\",children:\"Post\"}),(0,oe.jsxs)(Ie,{title:T===\"accepted\"?\"Submitted to Hacker News\":\"Check Hacker News\",role:\"status\",children:[(0,oe.jsx)(\"p\",{children:T===\"accepted\"?\"New posts appear under New. Hacker News may point you to an existing discussion of the same link.\":\"Hacker News went to another page, so the app can't tell whether the post went through.\"}),(0,oe.jsx)(\"button\",{type:\"button\",className:\"primary\",onClick:()=>u(`${ie}/newest`),children:\"See New\"}),(0,oe.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:Y,children:\"Post another\"})]})]});let M;return d?M=(0,oe.jsxs)(\"form\",{className:\"form\",onSubmit:F=>{F.preventDefault(),A&&_()},children:[d.error&&(0,oe.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:d.error}),(0,oe.jsxs)(\"label\",{children:[\"Title\",(0,oe.jsx)(\"input\",{value:i,maxLength:80,required:!0,onChange:F=>o(F.target.value)}),(0,oe.jsxs)(\"span\",{className:\"meta\",children:[i.trim().length,\" of \",80]})]}),(0,oe.jsxs)(\"label\",{children:[\"URL\",(0,oe.jsx)(\"input\",{type:\"url\",inputMode:\"url\",value:c,\"aria-invalid\":C!==null,onChange:F=>f(F.target.value)}),C&&(0,oe.jsx)(\"span\",{className:\"field-error\",children:C})]}),(0,oe.jsxs)(\"label\",{children:[\"Text\",(0,oe.jsx)(\"textarea\",{rows:6,value:g,onChange:F=>m(F.target.value)})]}),(0,oe.jsx)(\"p\",{className:\"meta\",children:\"Leave the URL blank to ask a question. With a URL, the text appears as the first comment.\"}),p&&(0,oe.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:p}),(0,oe.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:!A,children:r?\"Posting\\u2026\":\"Post\"}),(0,oe.jsx)(\"button\",{type:\"button\",className:\"text-button\",onClick:()=>u(`${ie}/newsguidelines.html`),children:\"Read the guidelines\"})]}):M=e.status===\"error\"?(0,oe.jsx)(zt,{error:e.error}):e.status===\"ready\"?(0,oe.jsx)(zt,{error:{code:\"NOT_FOUND\",message:\"Hacker News didn't show its submit form.\"}}):(0,oe.jsx)(Ue,{label:\"Loading the post form\",rows:3,kind:\"text\"}),(0,oe.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,oe.jsx)(\"h1\",{className:\"screen-title\",children:\"Post\"}),M]})}var dt=U(mt(),1);var q=U(J(),1),LS=[\"DEADLINE\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\"];function BS(e){try{let t=JSON.parse(e??\"\");return ui(t?.itemId)&&typeof t.title==\"string\"?t:null}catch{return null}}function u0(){let{screen:e,back:t}=Ke(),{storage:n,bookmarkRepository:l,categoryRepository:a}=ci(),u=(0,dt.useMemo)(()=>BS(e?.params.snapshot),[e?.params.snapshot]),i=e?.params.fresh===\"1\",[o,c]=(0,dt.useState)(null),[f,g]=(0,dt.useState)(null),[m,r]=(0,dt.useState)(!1),[s,p]=(0,dt.useState)(0),[b,T]=(0,dt.useState)(!1),[v,d]=(0,dt.useState)(\"\"),[h,S]=(0,dt.useState)(\"\"),[O,C]=(0,dt.useState)(!1),[A,_]=(0,dt.useState)(!1),Y=async()=>{let[re,Se]=await Promise.all([l.get(u.itemId),a.read()]);return c({previous:re,categories:Se}),g(at=>at??Xl(re?.value.categoryIds??[],Se)),r(!1),Se};if((0,dt.useEffect)(()=>{if(!u)return;let re=!0;return Promise.all([l.get(u.itemId),a.read()]).then(([Se,at])=>{re&&(c({previous:Se,categories:at}),g($e=>$e??Xl(Se?.value.categoryIds??[],at)),r(!1))},Se=>{re&&(d(vn(Se)),r(!0))}),()=>{re=!1}},[u,l,a,s]),!u)return(0,q.jsx)(\"div\",{className:\"screen\",children:(0,q.jsx)(Ie,{title:\"Can't save this story\",role:\"alert\",children:(0,q.jsx)(\"p\",{children:\"The story details are missing.\"})})});let M=o?.previous??null,F=!o&&!m,Fe=b||F||m,Ct=async re=>{if(!(Fe||!o||!f)){T(!0),d(\"\");try{if(re&&M)await l.remove(M);else{let Se=Xl(f,o.categories);await l.save(u,M,{refresh:O&&i,categoryIds:Se,checks:Zh(o.categories,Se)})}t()}catch(Se){let at=Se.code??\"\";if(d(vn(Se)),at===\"CONFLICT\"||LS.includes(at))try{await Y(),d(at===\"CONFLICT\"?\"This story or its categories changed. Review the current record and your selections, then try again.\":\"The result of the save was uncertain. The current record was reloaded. Review it before retrying.\")}catch{r(!0),d(\"The current record could not be reloaded. Reload it before retrying.\")}}finally{T(!1)}}},Zl=async()=>{if(!Fe){T(!0),d(\"\");try{let re=await a.create(h);await Y(),g(Se=>[...new Set([...Se??[],re])]),S(\"\"),d(\"Category created. Save to apply your selection.\")}catch(re){try{await Y(),d(`${vn(re)} Categories were reloaded; review them before retrying.`)}catch{r(!0),d(\"The new category could not be confirmed. Reload before retrying.\")}}finally{T(!1),n.refresh()}}};return(0,q.jsxs)(we,{className:\"screen\",children:[(0,q.jsx)(\"p\",{className:\"eyebrow\",children:\"Saved stories\"}),(0,q.jsx)(\"h1\",{className:\"screen-title\",children:M?\"Edit saved story\":\"Save story\"}),(0,q.jsxs)(\"section\",{className:\"card\",children:[(0,q.jsx)(\"p\",{className:\"story-title\",children:M?.value.title??u.title}),(0,q.jsxs)(\"p\",{className:\"meta\",children:[u.submitter?`By ${u.submitter} \\xB7 `:\"\",\"HN item \",u.itemId]}),(0,q.jsx)(\"p\",{className:\"meta\",children:\"Saved in Genesis, separate from your HN favorites.\"})]}),F&&(0,q.jsx)(Ue,{label:\"Loading saved state\",rows:3,kind:\"text\"}),o&&f&&(0,q.jsxs)(\"fieldset\",{className:\"card\",disabled:Fe,children:[(0,q.jsx)(\"legend\",{children:\"Categories\"}),o.categories.categories.length===0&&(0,q.jsx)(\"p\",{className:\"meta\",children:\"No categories yet. Saving without one files the story under Uncategorized.\"}),o.categories.categories.map(re=>(0,q.jsxs)(\"label\",{className:\"check\",children:[(0,q.jsx)(\"input\",{type:\"checkbox\",checked:f.includes(re.value.id),onChange:Se=>{let at=re.value.id;g($e=>Se.target.checked?[...$e??[],at]:($e??[]).filter(Wa=>Wa!==at))}}),re.value.name]},re.value.id)),(0,q.jsxs)(\"div\",{className:\"row\",children:[(0,q.jsxs)(\"label\",{className:\"grow\",children:[(0,q.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,q.jsx)(\"input\",{placeholder:\"New category\",value:h,onChange:re=>S(re.target.value)})]}),(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:!h.trim(),onClick:()=>{Zl()},children:\"Create\"})]}),(0,q.jsx)(\"p\",{className:\"meta\",children:\"A new category is kept even if you leave without saving.\"})]}),M&&i&&(0,q.jsxs)(\"label\",{className:\"check\",children:[(0,q.jsx)(\"input\",{type:\"checkbox\",checked:O,disabled:b,onChange:re=>C(re.target.checked)}),\"Update the title and link from Hacker News\"]}),v&&(0,q.jsx)(\"p\",{role:\"status\",className:\"status\",children:v}),m&&(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:b,onClick:()=>{d(\"\"),p(re=>re+1)},children:\"Reload saved state\"}),(0,q.jsxs)(\"div\",{className:\"actions\",children:[(0,q.jsx)(\"button\",{type:\"button\",className:\"primary\",disabled:Fe,onClick:()=>{Ct(!1)},children:b?\"Saving\\u2026\":M?\"Save changes\":\"Save\"}),(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:b,onClick:t,children:\"Cancel\"}),M&&!A&&(0,q.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:Fe,onClick:()=>_(!0),children:\"Remove from Saved\"})]}),A&&(0,q.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":\"Confirm removal\",children:[(0,q.jsx)(\"p\",{children:\"Remove this saved story? This can't be undone.\"}),(0,q.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:b,onClick:()=>{Ct(!0)},children:\"Remove story\"}),(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:b,onClick:()=>_(!1),children:\"Keep story\"})]})]})}var cc=U(mt(),1);var le=U(J(),1),qS=(e,t,n)=>{let l=Xl(e.categoryIds,n);return t===\"all\"||(t===\"uncategorized\"?l.length===0:l.includes(t))};function i0(){let{screen:e,navigate:t}=Ke(),n=ic(),[l,a]=(0,cc.useState)(\"\"),u=n.categories,i=e?.params.filter,o=u?.categories.some(m=>m.value.id===i)||i===\"uncategorized\"?i:\"all\",c=m=>t({screen:\"saved\",params:{filter:m},mode:\"replace\"}),f=(0,cc.useMemo)(()=>{if(!u)return[];let m=l.trim().toLowerCase();return n.bookmarks.filter(r=>qS(r.value,o,u)&&(!m||r.value.title.toLowerCase().includes(m)))},[n.bookmarks,u,o,l]),g;return!u&&n.error?g=(0,le.jsx)(Ie,{title:\"Couldn't load saved stories\",role:\"alert\",children:(0,le.jsx)(\"p\",{children:vn(n.error)})}):!u||n.loading?g=(0,le.jsx)(Ue,{label:\"Loading saved stories\"}):g=(0,le.jsxs)(le.Fragment,{children:[n.error!=null&&(0,le.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:vn(n.error)}),(0,le.jsx)(\"nav\",{className:\"chips\",\"aria-label\":\"Filter saved stories\",children:[{id:\"all\",name:\"All\"},{id:\"uncategorized\",name:\"Uncategorized\"},...u.categories.map(m=>m.value)].map(m=>(0,le.jsx)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":o===m.id,onClick:()=>c(m.id),children:m.name},m.id))}),(0,le.jsxs)(\"label\",{className:\"search-field\",children:[(0,le.jsx)(\"span\",{className:\"visually-hidden\",children:\"Filter by title\"}),(0,le.jsx)(\"input\",{type:\"search\",placeholder:\"Filter by title\",value:l,onChange:m=>a(m.target.value)})]}),f.length===0?(0,le.jsx)(Ie,{title:n.bookmarks.length===0?\"No saved stories\":\"No matches\",children:(0,le.jsx)(\"p\",{children:n.bookmarks.length===0?\"Use the bookmark button on any story to save it here.\":\"Try another filter or title.\"})}):f.map(m=>(0,le.jsx)(VS,{record:m,categories:u},m.key)),(0,le.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t({screen:\"categories\"}),children:\"Manage categories\"})]}),(0,le.jsxs)(we,{className:\"screen\",children:[(0,le.jsx)(\"h1\",{className:\"screen-title\",children:\"Saved\"}),g]})}function VS({record:e,categories:t}){let{navigate:n}=Ke(),l=Je(),a=e.value,u=Xl(a.categoryIds,t).map(i=>t.categories.find(o=>o.value.id===i).value.name);return(0,le.jsxs)(\"article\",{className:\"story saved\",children:[(0,le.jsxs)(\"div\",{className:\"story-body\",children:[(0,le.jsx)(\"h2\",{className:\"story-title\",children:(0,le.jsx)(\"a\",{href:a.articleUrl??a.discussionUrl,onClick:i=>{i.preventDefault(),l(a.articleUrl??a.discussionUrl)},children:a.title})}),(0,le.jsx)(ii,{parts:[a.submitter&&(0,le.jsx)(\"a\",{href:gn(a.submitter),onClick:i=>{i.preventDefault(),l(gn(a.submitter))},children:a.submitter}),(0,le.jsx)(\"a\",{href:a.discussionUrl,onClick:i=>{i.preventDefault(),l(a.discussionUrl)},children:\"discussion\"}),u.length>0?u.join(\", \"):\"Uncategorized\"]})]}),(0,le.jsx)(\"button\",{type:\"button\",className:\"text-button\",\"aria-label\":`Edit saved story: ${a.title}`,onClick:()=>n({screen:\"save\",params:{snapshot:JSON.stringify(a)}}),children:\"Edit\"})]})}var $a=U(J(),1);function o0(){return(0,$a.jsxs)(\"div\",{className:\"screen\",children:[(0,$a.jsx)(\"h1\",{className:\"screen-title\",children:\"Search\"}),(0,$a.jsx)(Ie,{title:\"Search is coming\",children:(0,$a.jsx)(\"p\",{children:\"This space will connect to a separate search site. For now, browse Home or your Saved stories.\"})})]})}var ce=U(J(),1);function c0(){let e=qt(),t=At(\"profile\",null),n=Je(),l=e.pageId===\"user\"?t?.data??null:null;if(!l)return(0,ce.jsx)(\"div\",{className:\"screen\",\"aria-busy\":e.status===\"loading\",children:e.status===\"error\"?(0,ce.jsx)(zt,{error:e.error}):e.status===\"ready\"&&e.pageId===\"user\"?(0,ce.jsx)(Ie,{title:\"No such user\",children:(0,ce.jsx)(\"p\",{children:\"Hacker News has no profile with this name.\"})}):(0,ce.jsx)(Ue,{label:\"Loading profile\",rows:4,kind:\"text\"})});let a=encodeURIComponent(l.name);return(0,ce.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale,children:[e.status===\"error\"&&(0,ce.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),(0,ce.jsx)(\"h1\",{className:\"screen-title\",children:l.name}),(0,ce.jsxs)(\"dl\",{className:\"facts\",children:[l.karma&&(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(\"dt\",{children:\"Karma\"}),(0,ce.jsx)(\"dd\",{children:l.karma})]}),l.created&&(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(\"dt\",{children:\"Joined\"}),(0,ce.jsx)(\"dd\",{children:l.created})]})]}),l.about.length>0&&(0,ce.jsxs)(\"section\",{className:\"card\",children:[(0,ce.jsx)(\"h2\",{className:\"section-title\",children:\"About\"}),(0,ce.jsx)(ml,{parts:l.about})]}),(0,ce.jsxs)(\"nav\",{className:\"list\",\"aria-label\":`${l.name} on Hacker News`,children:[(0,ce.jsx)(\"button\",{type:\"button\",onClick:()=>n(`${ie}/submitted?id=${a}`),children:\"Submissions\"}),(0,ce.jsx)(\"button\",{type:\"button\",onClick:()=>n(`${ie}/threads?id=${a}`),children:\"Comments\"}),(0,ce.jsx)(\"button\",{type:\"button\",onClick:()=>n(`${ie}/favorites?id=${a}`),children:\"Favorites\"})]})]})}var Hn=U(J(),1),YS={feed:e0,item:n0,user:c0,info:t0,search:o0,post:a0,saved:i0,categories:Jh,save:u0,me:l0},kS=[{id:\"primary\",label:\"Home\",icon:\"home\",context:!0},{id:\"search\",label:\"Search\",icon:\"search\",context:!1},{id:\"post\",label:\"Post\",icon:\"post\",context:!0},{id:\"saved\",label:\"Saved\",icon:\"bookmark\",context:!1},{id:\"me\",label:\"Me\",icon:\"person\",context:!0}];function r0(){let{screen:e,active:t,overlay:n,select:l,navigate:a}=Ke(),u=e?YS[e.id]:void 0,i=n[0]?.id,o=i===\"search\"||i===\"saved\"?i:n.length>0?null:t;return(0,Hn.jsxs)(\"div\",{className:\"app\",children:[(0,Hn.jsx)(\"main\",{className:\"content\",children:u&&(0,Hn.jsx)(u,{},e.key)}),(0,Hn.jsx)(\"nav\",{className:\"tabs\",\"aria-label\":\"Sections\",children:kS.map(c=>{let f=c.id===o;return(0,Hn.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":f?\"page\":void 0,onClick:()=>c.context?l(c.id):a({screen:c.id,mode:\"root\"}),children:[(0,Hn.jsx)(Ia,{name:c.icon,filled:f}),(0,Hn.jsx)(\"span\",{children:c.label})]},c.id)})})]})}var s0=U(J(),1);Gh((0,s0.jsx)(r0,{}));})();\n"},{"path":"index.html","encoding":"utf8","content":"\n\n\n\n\nHacker News\n\n\n\n\n
\n\n\n\n"}]} \ No newline at end of file +{"envelope":1,"bundle":{"format":3,"compat":{"manifestSchema":6,"bundleFormat":3,"protocol":1,"adapterApi":1,"sdk":"0.0.0","tools":"0.0.0","builtAt":"2026-11-09T13:08:06Z"},"manifest":{"schemaVersion":6,"id":"hn-bookmarks","name":"Hacker News","origins":["https://news.ycombinator.com"],"foreground":{"entry":"src/main.tsx","screens":["feed","item","user","info","search","post","saved","categories","save","me"]},"adapter":"src/adapter.ts","contexts":[{"id":"primary","startUrl":"https://news.ycombinator.com/"},{"id":"post","startUrl":"https://news.ycombinator.com/submit"},{"id":"me","startUrl":"https://news.ycombinator.com/news?account=1"}],"routes":[{"id":"account","pattern":"/news","query":["account"],"page":"account","screen":"me","context":"me"},{"id":"home","pattern":"/","page":"feed","screen":"feed","context":"primary"},{"id":"news","pattern":"/news","page":"feed","screen":"feed","context":"primary"},{"id":"newest","pattern":"/newest","page":"feed","screen":"feed"},{"id":"front","pattern":"/front","page":"feed","screen":"feed"},{"id":"newcomments","pattern":"/newcomments","page":"feed","screen":"feed"},{"id":"ask","pattern":"/ask","page":"feed","screen":"feed"},{"id":"show","pattern":"/show","page":"feed","screen":"feed"},{"id":"shownew","pattern":"/shownew","page":"feed","screen":"feed"},{"id":"asknew","pattern":"/asknew","page":"feed","screen":"feed"},{"id":"jobs","pattern":"/jobs","page":"feed","screen":"feed"},{"id":"best","pattern":"/best","page":"feed","screen":"feed"},{"id":"active","pattern":"/active","page":"feed","screen":"feed"},{"id":"from","pattern":"/from","page":"feed","screen":"feed"},{"id":"submitted","pattern":"/submitted","query":["id"],"page":"feed","screen":"feed"},{"id":"threads","pattern":"/threads","query":["id"],"page":"feed","screen":"feed"},{"id":"favorites","pattern":"/favorites","query":["id"],"page":"feed","screen":"feed"},{"id":"hidden","pattern":"/hidden","query":["id"],"page":"private-feed","screen":"feed"},{"id":"upvoted","pattern":"/upvoted","query":["id"],"page":"private-feed","screen":"feed"},{"id":"item","pattern":"/item","query":["id"],"page":"item","screen":"item"},{"id":"user","pattern":"/user","query":["id"],"page":"user","screen":"user"},{"id":"formatdoc","pattern":"/formatdoc","page":"info","screen":"info"},{"id":"faq","pattern":"/newsfaq.html","page":"info","screen":"info"},{"id":"guidelines","pattern":"/newsguidelines.html","page":"info","screen":"info"},{"id":"lists","pattern":"/lists","page":"info","screen":"info"},{"id":"leaders","pattern":"/leaders","page":"info","screen":"info"},{"id":"submit","pattern":"/submit","page":"submit","screen":"post","context":"post"},{"id":"submit-result","pattern":"/r","page":"submit","screen":"post"}],"capabilities":{"services":[{"id":"bookmarks","config":"backend/service.json"}]},"shell":{"accent":"#ff6600"}},"files":[{"path":"adapter.js","sha256":"ebe2db0683874c95b1f141d153e0db09ad24c4ff1754481f9e1b9123c8449821"},{"path":"assets/yc.png","sha256":"6759dc96b4c3d8e08bf3f3f1d8996a7a5743a72bd7567f2b9a0e7c7e26ee42d9"},{"path":"foreground.css","sha256":"ee20a9ba479eed976305d1a0c9777cb9f6d8ca9a7cf87290bae5064a1af5bc19"},{"path":"foreground.js","sha256":"e7b9b22272226d195cb03d426165bf6b1125ed92ea3ac317f663186d5e94efe3"},{"path":"index.html","sha256":"aa44f6b87ac40170d4ad8d891021e384d535858ab2a4098e6d9025e79cfc79cf"}]},"entries":[{"path":"adapter.js","encoding":"utf8","content":"(()=>{var j={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1};var ut=/^:[A-Za-z][A-Za-z0-9_]*$/,ft=/^[A-Za-z0-9_.~@-]+$/,fe=new Map;function dt(e){if(fe.has(e))return fe.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),r=n.at(-1)===\"*\";r&&n.pop();let i=[],o=!0;for(let s of n)ut.test(s)?i.push({param:s.slice(1)}):ft.test(s)&&s!==\".\"&&s!==\"..\"?i.push({literal:s}):o=!1;o&&(t={segments:i,rest:r})}return fe.set(e,t),t}function pe(e){try{return new URL(e).href}catch{return null}}function me(e,t){let n=pt(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let r;try{r=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}r.at(-1)===\"\"&&r.pop();for(let i of e.routes){let o=dt(i.pattern);if(!o)continue;let s=mt(o,r);if(!s||!(i.query??[]).every(f=>n.searchParams.has(f)))continue;for(let f of i.query??[])s[f]=n.searchParams.get(f);let a={kind:\"route\",routeId:i.id,page:i.page,screen:i.screen,params:s};return i.context!==void 0&&(a.context=i.context),a}return{kind:\"website\",url:t}}function pt(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function mt(e,t){if(e.rest?t.length{let i=null,o=!1,s=1,a=new Map,f=new Map,u={get bound(){return i},get retired(){return o},request(w,h={}){if(o)return Promise.reject(new O(\"RETIRED\",\"This page was closed\"));let x=s++;return new Promise((R,P)=>{let L=setTimeout(()=>{a.delete(x),P(new O(\"DEADLINE\",`${w} did not answer in time`))},i.limits.rpcDeadlineMs+gt);a.set(x,{resolve:R,reject:P,timer:L}),e.postMessage(JSON.stringify({type:\"request\",documentId:i.documentId,requestId:x,method:w,params:h}))})},on(w,h){let x=f.get(w);return x||f.set(w,x=new Set),x.add(h),()=>{x.delete(h)}}};function p(){o=!0;for(let w of a.values())clearTimeout(w.timer),w.reject(new O(\"RETIRED\",\"This page was closed\"));a.clear()}function g(w,h){for(let x of[...f.get(w)??[]])try{x(h)}catch(R){console.error(`Genesis ${w} handler failed`,R)}}e.addEventListener(\"message\",w=>{if(o||typeof w.data!=\"string\")return;let h;try{h=JSON.parse(w.data)}catch{return}if(h?.type===\"refused\"&&!i){o=!0,r(new O(h.error?.code??\"PROTOCOL_MISMATCH\",h.error?.message??\"The host refused this page\"));return}if(h?.type===\"bound\"){if(i)return;i=h,n(u);return}if(!(!i||h?.documentId!==i.documentId))if(h.type===\"response\"){let x=a.get(h.requestId);if(!x)return;a.delete(h.requestId),clearTimeout(x.timer),h.error?x.reject(new O(h.error.code,h.error.message)):x.resolve(h.result??null)}else h.type===\"event\"&&(h.name===\"retired\"?(p(),g(\"retired\",{})):g(h.name,h.data))}),addEventListener(\"pagehide\",()=>{o||(g(\"pagehide\",{}),p())});let b={type:\"hello\",protocol:j.protocol,url:t};e.postMessage(JSON.stringify(b))})}var ht=100;function yt(e){let t=new Map,n=Promise.resolve();return{act(r){let i={request:r,arrived:Date.now(),view:e.view(),cancelled:!1,dispatched:!1,stopped:!1};t.set(r.actionId,i),n=n.then(()=>vt(e,i)).catch(o=>{console.error(\"Genesis action failed\",o)}).finally(()=>{t.delete(r.actionId)})},cancel(r){let i=t.get(r);i&&!i.dispatched&&(i.cancelled=!0)},retire(){for(let r of t.values())r.stopped=!0}}}async function vt(e,t){let{connection:n,limits:r}=e,{actionId:i}=t.request,o,s=(T,A,$)=>{if(t.stopped)return Promise.resolve();let _={actionId:i,state:T};return $&&(_.navigating=!0),$&&o&&(_.expect=o),A&&(_.result=A),n.request(\"context.actionResult\",_).then(()=>{},()=>{})},a=(T,A,$)=>{let _={outcome:\"failed\",code:T,message:A};return $!==void 0&&Object.assign(_,{completedSteps:$,partial:$>0}),s(\"failed\",_)},f=()=>s(\"cancelled\",{outcome:\"cancelled\"});if(t.stopped)return;if(t.cancelled)return f();if((t.request.view??t.view)!==t.view||e.view()!==t.view)return a(\"CONTEXT_REPLACED\",\"The page the action was for has been replaced\");let u=e.find(t.request);if(\"error\"in u)return a(u.error.code,u.error.message);let p=u.element();if(p===void 0)return a(\"TARGET_NOT_FOUND\",\"The item is no longer on the page\");let g;try{g=u.action(p,t.request.args)}catch(T){return a(\"INVALID_STEPS\",Pe(T))}if(typeof g?.then==\"function\")return a(\"INVALID_STEPS\",\"An action must return its steps synchronously\");if(g&&\"satisfied\"in g&&g.satisfied===!0)return s(\"observed\",{outcome:\"observed\",noop:!0});let b=wt(g);if(b)return a(\"INVALID_STEPS\",b);let{steps:w,until:h,deadlineMs:x}=g;o=g.expect;let R=g.navigates===!0||je(w.at(-1)),P=t.arrived+(x??r.actionTimeoutMs),L=0,J=T=>(t.dispatched=!0,s(\"dispatched\",void 0,T)),Y=n.on(\"pagehide\",()=>{!t.dispatched&&!t.stopped&&L>0&&J(!0),t.stopped=!0}),ee=()=>t.stopped||t.cancelled;try{for(let[T,A]of w.entries()){if(t.stopped)return;if(t.cancelled)return f();if(Date.now()>=P)return a(\"DEADLINE\",\"The action did not finish in time\",L);if(T>0&&Me(w[T-1])&&u.element()===void 0)return a(\"TARGET_NOT_FOUND\",\"The item left the page during the action\",L);if(R&&T===w.length-1&&!Me(A)){if(ye(A),await J(!0),t.stopped)return;ye(A)();return}await kt(A,P,ee),L++}if(t.stopped)return;if(t.cancelled)return f();if(await J(R),R)return;if(h!==void 0){let T=typeof h==\"string\"?()=>document.querySelector(h)!==null:()=>h(document)===!0;try{await ve(T,P-Date.now(),\"the action to take effect\",()=>t.stopped)}catch{return s(\"failed\",{outcome:\"unknown\",code:\"DEADLINE\",message:\"The page did not show the action's effect in time\",completedSteps:L,partial:L>0})}}if(t.stopped)return;e.flush(),await s(\"observed\",{outcome:\"observed\"})}catch(T){let A=T instanceof O?T.code:\"INVALID_ARGUMENT\";return a(A,Pe(T),L)}finally{Y()}}function wt(e){if(typeof e!=\"object\"||e===null)return\"An action must return { satisfied: true } or { steps }\";let{steps:t,until:n}=e;if(!Array.isArray(t))return\"An action must return { satisfied: true } or { steps }\";for(let[r,i]of t.entries()){let o=Et(i);if(o)return`Step ${r}: ${o}`;if(je(i)&&r!==t.length-1)return\"A navigate or submit step must be the last step\"}return n!==void 0&&typeof n!=\"string\"&&typeof n!=\"function\"?\"until must be a selector or a function\":null}function Et(e){if(typeof e!=\"object\"||e===null)return\"must be an object\";let t=e,n=r=>typeof r==\"string\"&&r!==\"\";if(\"click\"in t)return n(t.click)?null:\"click needs a selector\";if(\"fill\"in t)return n(t.fill)&&typeof t.value==\"string\"?null:\"fill needs a selector and a string value\";if(\"submit\"in t)return n(t.submit)?null:\"submit needs a selector\";if(\"navigate\"in t)return n(t.navigate)?null:\"navigate needs a URL\";if(\"waitFor\"in t||\"waitForUrl\"in t)return n(t.waitFor??t.waitForUrl)&&typeof t.timeoutMs==\"number\"?null:\"a wait needs a selector or pattern and timeoutMs\";if(\"scroll\"in t){let r=t.scroll;return r&&n(r.target)&&(r.to===\"end\"||typeof r.to==\"number\")?null:\"scroll needs a target and to\"}return\"unknown step\"}var je=e=>e!==void 0&&(\"navigate\"in e||\"submit\"in e),Me=e=>\"waitFor\"in e||\"waitForUrl\"in e,Pe=e=>String(e?.message??e);function te(e){let t=document.querySelector(e);if(!t)throw new O(\"NOT_FOUND\",`Nothing matches ${e}`);return t}async function kt(e,t,n){let r=()=>Math.max(0,t-Date.now());if(\"waitFor\"in e)await ve(()=>document.querySelector(e.waitFor)!==null,Math.min(e.timeoutMs,r()),e.waitFor,n);else if(\"waitForUrl\"in e){let i=new RegExp(e.waitForUrl);await ve(()=>i.test(location.href),Math.min(e.timeoutMs,r()),e.waitForUrl,n)}else ye(e)()}function ye(e){if(\"click\"in e){let t=te(e.click);return()=>t.click()}if(\"fill\"in e){let t=te(e.fill);return()=>xt(t,e.value)}if(\"submit\"in e){let t=te(e.submit),n=t instanceof HTMLFormElement?t:t.closest(\"form\");if(!n)throw new O(\"NOT_FOUND\",`${e.submit} is not in a form`);let r=t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t:void 0;return()=>n.requestSubmit(r)}if(\"navigate\"in e){let t=e.navigate;return()=>location.assign(t)}if(\"scroll\"in e){let{target:t,to:n}=e.scroll,r=t===\"window\"?document.scrollingElement??document.documentElement:te(t);return()=>{r.scrollTop=n===\"end\"?r.scrollHeight:n}}throw new O(\"INVALID_STEPS\",\"A wait step does not run on its own\")}function xt(e,t){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new O(\"INVALID_STEPS\",\"fill needs an input or textarea\");let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(n,\"value\")?.set?.call(e,t),e.dispatchEvent(new Event(\"input\",{bubbles:!0})),e.dispatchEvent(new Event(\"change\",{bubbles:!0}))}function ve(e,t,n,r){let i=Date.now()+t;return new Promise((o,s)=>{let a=()=>{try{return e()}catch{return!1}},f=()=>{r()||a()?o():Date.now()>=i?s(new O(\"DEADLINE\",`Timed out waiting for ${n}`)):setTimeout(f,ht)};f()})}var $e=new WeakMap;function Ce(e){let t=$e.get(e);return t===void 0&&$e.set(e,t=JSON.stringify(e)),t}function we(e,t){return e===t?!0:e!==null&&t!==null&&Ce(e)===Ce(t)}function re(e,t){return e?.code===t?.code&&e?.message===t?.message}function bt(e,t){if(e.kind!==t.kind)return{kind:\"replace\",region:t};if(t.kind===\"single\"){let p=e;if(we(p.record,t.record)&&p.status===t.status&&re(p.error,t.error))return null;let g={kind:\"single\",record:t.record};return p.status!==t.status&&(g.status=t.status),re(p.error,t.error)||(g.error=t.error??null),g}let n=e;if(!!n.ephemeral!=!!t.ephemeral||t.ephemeral)return It(n,t)?null:{kind:\"replace\",region:t};let r=new Map(n.items.map(p=>[p.key,p])),i=new Set,o=[];for(let p of t.items){i.add(p.key);let g=r.get(p.key);(!g||!we(g,p))&&o.push(p)}let s=n.items.filter(p=>!i.has(p.key)).map(p=>p.key),a=t.items.map(p=>p.key),f=a.length!==n.items.length||a.some((p,g)=>n.items[g].key!==p),u={kind:\"collection\"};return o.length&&(u.upsert=o),s.length&&(u.remove=s),f&&(u.order=a),n.complete!==t.complete&&(u.complete=t.complete),n.status!==t.status&&(u.status=t.status),re(n.error,t.error)||(u.error=t.error??null),Object.keys(u).length>1?u:null}function It(e,t){return e.complete===t.complete&&e.status===t.status&&re(e.error,t.error)&&!!e.ephemeral==!!t.ephemeral&&e.items.length===t.items.length&&e.items.every((n,r)=>we(n,t.items[r]))}function Tt(e,t,n=1/0){let r=e.slice(),i=s=>r.findIndex(a=>a.key===s),o=-1;for(let[s,a]of t.entries()){let f=i(a.key);if(f!==-1){r[f]=a,o=f;continue}let u=o+1;o===-1&&(u=t.slice(s+1).map(g=>i(g.key)).find(g=>g!==-1)??r.length),r.splice(u,0,a),o=u}return r.length>n?Ve(r,new Set(t.map(s=>s.key)),n):r}function Ve(e,t,n){if(e.length<=n)return e;let r=-1,i=0;for(let[a,f]of e.entries())t.has(f.key)&&(r===-1&&(r=a),i=a);r===-1&&(r=0);let o=Math.max(n,i-r+1),s=Math.min(Math.max(0,Math.floor((r+i+1-o)/2)),e.length-o);return e.slice(s,s+o)}function At(e){return new Set(e).size===e.length?{keys:e,ephemeral:!1}:{keys:e.map((t,n)=>String(n)),ephemeral:!0}}function St(e,t,n){let r=new Map,i=o=>{let s=r.get(o);return s||r.set(o,s={keys:new Set,whole:!1,membership:!1,resolve:!1}),s};for(let[o,s]of Object.entries(e)){let a=t.some(f=>f.kind===\"childList\");if(!s.root){a&&(i(o).resolve=!0);continue}if(!ge(s.root,n)){i(o).resolve=!0;continue}(s.dependsOn.some(f=>!ge(f,n))||s.dependsOnMissing&&a)&&(i(o).whole=!0);for(let f of t){if(f.kind===\"field\"&&!s.fields||f.kind===\"resize\"&&!s.measure)continue;f.removed&&ge(s.root,f.target)&&(i(o).whole=!0);let u=He(s,f.target);u.dependent&&(i(o).whole=!0),u.inRoot&&(f.kind===\"childList\"&&(i(o).membership=!0),u.key===void 0?i(o).whole=!0:i(o).keys.add(u.key))}}return r}function Ot(e,t){let n=He(e,t);return n.inRoot||n.dependent}function He(e,t){let n,r=!1,i=!1;for(let o=t;o;o=o.parentNode)n??=e.items.get(o),o===e.root&&(r=!0),e.dependsOn.includes(o)&&(i=!0);return n!==void 0&&(r=!0),{key:n,inRoot:r,dependent:i}}function ge(e,t){for(let n=e;n;n=n.parentNode)if(n===t)return!0;return!1}function Nt(e){let t=new MutationObserver(o=>{let s=[];for(let a of o){s.push({target:a.target,kind:a.type});for(let f of a.removedNodes)s.push({target:f,kind:\"childList\",removed:!0})}e(s)});t.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let n=o=>{o.target instanceof Node&&e([{target:o.target,kind:\"field\"}])};document.addEventListener(\"input\",n,!0),document.addEventListener(\"change\",n,!0);let r=new WeakMap,i=typeof ResizeObserver==\"function\"?new ResizeObserver(o=>{let s=[];for(let a of o){let f=`${a.contentRect.width}x${a.contentRect.height}`,u=r.get(a.target);r.set(a.target,f),u!==void 0&&u!==f&&s.push({target:a.target,kind:\"resize\"})}s.length&&e(s)}):null;return{measure(o){if(i){i.disconnect();for(let s of o)i.observe(s)}},disconnect(){t.disconnect(),i?.disconnect(),document.removeEventListener(\"input\",n,!0),document.removeEventListener(\"change\",n,!0)}}}function Rt(e){for(let t of[\"pushState\",\"replaceState\"]){let n=History.prototype[t];History.prototype[t]=function(...r){let i=n.apply(this,r);try{e()}catch(o){console.error(\"Genesis navigation handler failed\",o)}return i}}addEventListener(\"popstate\",e),addEventListener(\"hashchange\",e)}var _t=new TextEncoder,ne=e=>_t.encode(JSON.stringify(e)).length,Dt=class{constructor(e,t,n=()=>null){this.send=e,this.limits=t,this.shrink=n}send;limits;shrink;epoch=0;seq=0;last=null;page(e){let t={...e,epoch:++this.epoch};for(;ne(t)>this.limits.pageMaxBytes;){let n=this.shrink(t);if(!n){t={...t,status:\"error\",error:{code:\"PAGE_TOO_LARGE\",message:\"The page is too large to show\"},regions:{}};break}t={...n,epoch:t.epoch}}this.seq=0,this.last=t,this.post({page:t})}update(e){let t=this.last;if(!t||!Lt(t,e))return this.page(e);let n={};for(let[o,s]of Object.entries(e.regions)){let a=bt(t.regions[o],s);a&&(n[o]=a)}let r=e.account!==void 0&&e.account!==t.account;if(!r&&Object.keys(n).length===0)return;let i=this.split(n);if(r&&(i[i.length-1].account=e.account),i.some(o=>ne(o)>this.limits.patchMaxBytes))return this.page(e);this.last={...e,epoch:this.epoch};for(let o of i)this.post({patch:o})}split(e){let t=[],n={};for(let[f,u]of Object.entries(e)){if(u.kind!==\"collection\"||!u.upsert){n[f]=u;continue}let{upsert:p,...g}=u;for(let b of p)t.push([f,b]);Object.keys(g).length>1&&(n[f]=g)}let r=this.limits.patchMaxBytes-ne(n)-256,i=[],o=[],s=0;for(let f of t){let u=ne(f[1])+1;o.length&&(o.length>=this.limits.patchRecordsMax||s+u>r)&&(i.push(o),o=[],s=0),o.push(f),s+=u}i.push(o);let a=this.last.view;return i.map((f,u)=>{let p={view:a,epoch:this.epoch,base:this.seq,seq:++this.seq,regions:{}};for(let[g,b]of f)(p.regions[g]??={kind:\"collection\",upsert:[]}).upsert.push(b);if(u===i.length-1)for(let[g,b]of Object.entries(n))p.regions[g]={...p.regions[g],...b};return p})}post(e){this.send(e).catch(t=>{let n=t instanceof O?t.code:null;if(n!==\"RETIRED\"){if(\"patch\"in e&&this.last&&e.patch.epoch===this.epoch){let{epoch:r,...i}=this.last;return this.page(i)}if(\"page\"in e&&n===\"PAGE_TOO_LARGE\"&&e.page.status!==\"error\"){let{epoch:r,...i}=e.page;return this.page({...i,status:\"error\",error:{code:n,message:\"The page is too large to show\"},regions:{}})}console.error(\"Genesis could not publish the page\",t)}})}};function Lt(e,t){let n=Object.keys(t.regions);return e.view.generation===t.view.generation&&e.view.n===t.view.n&&e.view.url===t.view.url&&e.status===t.status&&e.pageId===t.pageId&&e.routeId===t.routeId&&e.error?.code===t.error?.code&&e.error?.message===t.error?.message&&e.signInUrl===t.signInUrl&&JSON.stringify(e.params)===JSON.stringify(t.params)&&n.length===Object.keys(e.regions).length&&n.every(r=>e.regions[r]?.kind===t.regions[r].kind)}function Mt(e,t,n){let r,i,o=()=>{clearTimeout(r),r=void 0,i=void 0,e()};return{schedule(){let s=Date.now();i??=s,clearTimeout(r),r=setTimeout(o,Math.min(t,Math.max(0,i+n-s)))},now(){r!==void 0&&o()},cancel(){clearTimeout(r),r=void 0,i=void 0}}}var Pt=1e4,Ue=!1;function Ee(e){if(typeof window>\"u\"||window.top!==window||Ue)return;Ue=!0;let t=window,n=t.__genesisBridge;try{delete t.__genesisBridge}catch{t.__genesisBridge=void 0}if(!n)return;let r=null;Rt(()=>r?.navigated());let i=()=>Le(n,location.href).then(o=>{r=$t(o,e)},o=>console.error(\"Genesis could not bind this page\",o));i(),addEventListener(\"pageshow\",o=>{o.persisted&&(r?.stop(),r=null,i())})}function $t(e,t){let{manifest:n,limits:r,generation:i}=e.bound,o={batches:0,reads:0,lastBatchReads:0,pages:0,patches:0,lastPublishBytes:0,resyncs:0,startedAt:Date.now()},s=!1;s&&(window.__genesisStats=o);let a=new Dt(c=>(s&&(\"page\"in c?o.pages++:o.patches++,o.lastPublishBytes=JSON.stringify(c).length),e.request(\"context.publish\",c)),r,ct),f={generation:i,n:0,url:location.href};if(e.bound.compat.adapterApi!==j.adapterApi){let c=`This applet uses adapter API ${j.adapterApi}; this Genesis uses ${e.bound.compat.adapterApi}`;return console.error(`Genesis: ${c}`),a.page({view:f,pageId:null,routeId:null,params:{},status:\"error\",error:{code:\"PROTOCOL_MISMATCH\",message:c},account:null,regions:{}}),{navigated(){},stop(){}}}let u=!1,p=pe(location.href),g=me(n,location.href),b=P(g),w=null,h=new Map,x=[],R=!1;function P(c){return c.kind===\"route\"?t.pages[c.page]??null:null}function L(){let c=b?.account??t.account;try{let l=c?.(document);return l===void 0&&c?{account:void 0,failed:!1}:{account:typeof l==\"string\"&&l!==\"\"?l:null,failed:!1}}catch(l){return console.error(\"Genesis adapter account failed\",l),{account:void 0,failed:!0}}}function J(){let c=t.signInUrl;try{if(typeof c==\"string\")return new URL(c,n.origins[0]).href;if(typeof c==\"function\")return new URL(c(location.href),location.href).href}catch(l){console.error(\"Genesis adapter signInUrl failed\",l)}return null}function Y({account:c,failed:l}){if(g.kind!==\"route\")return{status:\"unsupported\"};if(!b)return{status:\"error\",error:{code:\"NOT_FOUND\",message:`The adapter declares no page ${g.page}`}};let m;try{m=b.ready(document)===!0}catch(y){return{status:\"error\",error:{code:\"INVALID_ARGUMENT\",message:Fe(y)}}}if(b.requiresAccount===!0&&l)return{status:\"loading\"};let d=b.requiresAccount===!0&&c===null;return m?{status:d?\"auth\":\"ready\"}:d&&document.readyState!==\"loading\"?{status:\"auth\"}:{status:\"loading\"}}function ee(c,l){let m={view:f,pageId:g.kind===\"route\"?g.page:null,routeId:g.kind===\"route\"?g.routeId:null,params:g.kind===\"route\"?g.params:{},status:l.status,signInUrl:J(),regions:{}};c!==void 0&&(m.account=c),l.error&&(m.error=l.error);for(let[d,y]of h)m.regions[d]=y.value;return m}function T(c,l,m){let d={name:c,def:l,root:null,items:new WeakMap,elements:new Map,dependsOn:[],dependsOnMissing:!1,value:m?.value??Ct(l)};for(let y of l.dependsOn??[]){let v=[...document.querySelectorAll(y)];v.length===0&&(d.dependsOnMissing=!0),d.dependsOn.push(...v)}return d.root=document.querySelector(l.root),A(d,()=>l.kind===\"collection\"?_(d,l,\"all\"):$(d,l)),d}function A(c,l){try{c.value=l()}catch(m){let d=m instanceof O?m.code:\"INVALID_ARGUMENT\";c.value={...c.value,status:\"error\",error:{code:d,message:`${c.name}: ${Fe(m)}`}}}}function $(c,l){let m=c.root;return m?{kind:\"single\",status:\"ready\",record:Se(l,m,l.key?oe(l.key,m):c.name)}:{kind:\"single\",status:\"ready\",record:null}}function _(c,l,m){let d=c.value,y=c.root?[...c.root.querySelectorAll(l.items)]:[],{keys:v,ephemeral:E}=At(y.map(M=>oe(l.key,M))),I=d.ephemeral?new Map:new Map(d.items.map(M=>[M.key,M])),D=c.elements;c.elements=new Map;let S=y.map((M,lt)=>{let W=v[lt];c.elements.set(W,M);let _e=I.get(W);return m!==\"all\"&&_e&&!m.has(W)&&D.get(W)===M?_e:Ae(c,l,M,W)}),G={kind:\"collection\",status:\"ready\",items:l.virtualized&&!E&&!d.ephemeral?Tt(d.items,S,r.patchRecordsMax):S,complete:he(l)};return E&&(G.ephemeral=!0),G}function Ae(c,l,m,d){let y=Se(l,m,d);c.items.set(m,d);for(let v of l.extent?.(m)??[])v&&c.items.set(v,d);return y}function Se(c,l,m){o.reads++;let d=c.read(l);if(typeof d?.then==\"function\")throw new O(\"ASYNC_READ\",\"read must return its data synchronously\");let y={key:m,data:d===void 0?null:d};return c.entity&&(y.entity=c.entity(l)),c.entityType&&(y.entityType=c.entityType),y}function it(c,l,m){let d=c.value;if(d.ephemeral||d.status===\"error\")return A(c,()=>_(c,l,m));let y=d.items.slice();for(let v of m){let E=c.elements.get(v),I=y.findIndex(S=>S.key===v);if(!(E?.isConnected&&c.root?.contains(E)&&E.matches(l.items))||I===-1||oe(l.key,E)!==v)return A(c,()=>_(c,l,m));try{y[I]=Ae(c,l,E,v)}catch{return A(c,()=>_(c,l,m))}}c.value={...d,items:y,complete:he(l)}}function st(c,l){let{def:m}=c;l.resolve||l.whole||m.kind===\"single\"?h.set(c.name,T(c.name,m,c)):l.membership?A(c,()=>_(c,m,l.keys)):it(c,m,l.keys)}function ct(c){if(c.view.n!==f.n)return null;let l={...c,regions:{...c.regions}},m=!1;for(let[d,y]of Object.entries(c.regions)){let v=h.get(d);if(v?.def.kind!==\"collection\"||!v.def.virtualized||y.kind!==\"collection\"||y.ephemeral)continue;let E=Ve(y.items,new Set(v.elements.keys()),Math.floor(y.items.length*3/4));E.length!==y.items.length&&(l.regions[d]={...y,items:E},v.value===y&&(v.value=l.regions[d]),m=!0)}return m?l:null}function ae(c=!1){if(u)return;x=[],R=!1;let l=L(),{account:m}=l,d=Y(l),y=h;if(h=new Map,d.status===\"ready\")for(let[E,I]of Object.entries(b?.regions??{}))h.set(E,T(E,I,y.get(E)));w=d.status;let v=ee(m,d);c?a.page(v):a.update(v),Ne()}function Oe(){if(u)return;o.batches++;let c=o.reads,l=x,m=R;x=[],R=!1;let d=L(),{account:y}=d,v=Y(d);if(v.status!==\"ready\"||w!==\"ready\"||m)ae();else{let E={};for(let[I,D]of h)E[I]=qe(D);for(let[I,D]of St(E,l,document))st(h.get(I),D);for(let I of h.values()){let D=I.value;if(I.def.kind===\"collection\"&&D.kind===\"collection\"&&I.def.more){let S=he(I.def);S!==D.complete&&(I.value={...D,complete:S})}}a.update(ee(y,v)),Ne()}o.lastBatchReads=o.reads-c}function Ne(){let c=[];for(let l of h.values())l.def.measure&&(l.def.kind===\"single\"?l.root&&c.push(l.root):c.push(...l.elements.values()));Re.measure(c)}let q=Mt(Oe,r.publishQuietMs,r.publishMaxDelayMs),Re=Nt(c=>{if(!u){if(w===\"ready\"&&!R){let l=[...h.values()].map(qe);x.push(...c.filter(m=>m.kind!==\"attributes\"||l.some(d=>Ot(d,m.target)))),x.length>Pt&&(x=[],R=!0)}q.schedule()}}),le=yt({connection:e,limits:r,flush:()=>{q.cancel(),Oe()},find:at,view:()=>f.n});function at(c){let l=(S,G)=>({error:{code:S,message:G}});if(w!==\"ready\"||!b)return l(\"NOT_READY\",\"The page is not ready\");let m=f.n;if(c.region===null){let S=b.actions?.[c.name];return S?{action:S,element:()=>null}:l(\"INVALID_ARGUMENT\",`The page has no action ${c.name}`)}let d=c.region,y=h.get(d);if(!y)return l(\"NOT_FOUND\",`The page has no region ${d}`);let v=y.def.actions?.[c.name];if(!v)return l(\"INVALID_ARGUMENT\",`Region ${d} has no action ${c.name}`);let E=y.def;if(E.kind===\"single\")return{action:v,element:()=>f.n===m?document.querySelector(E.root)??void 0:void 0};if(y.value.ephemeral)return l(\"PRECONDITION_FAILED\",`Region ${d} repeats keys, so its records have no actions`);let I=c.key;if(I===null)return l(\"INVALID_ARGUMENT\",`Action ${c.name} needs a record key`);let D=()=>{if(f.n!==m)return;let S=h.get(d)?.elements.get(I);if(S?.isConnected&&Ge(E,S)===I)return S;let G=document.querySelector(E.root);return G?[...G.querySelectorAll(E.items)].find(M=>Ge(E,M)===I):void 0};return D()===void 0?l(\"TARGET_NOT_FOUND\",`No ${d} item has key ${I}`):{action:v,element:D}}function ue(c=!0){u||(u=!0,q.cancel(),Re.disconnect(),c&&le.retire())}return e.on(\"resync\",()=>{o.resyncs++,q.cancel(),ae(!0)}),e.on(\"act\",c=>le.act(c)),e.on(\"cancel\",({actionId:c})=>le.cancel(c)),e.on(\"ping\",()=>{}),e.on(\"retired\",()=>ue()),e.on(\"pagehide\",()=>ue(!1)),document.readyState===\"loading\"&&document.addEventListener(\"DOMContentLoaded\",()=>q.schedule(),{once:!0}),ae(),{navigated(){if(u)return;let c=pe(location.href);c!==p&&(p=c,f={generation:i,n:f.n+1,url:location.href},g=me(n,location.href),b=P(g),w=null,h=new Map,q.cancel(),q.schedule())},stop:()=>ue()}}function qe(e){return{root:e.root,items:e.items,dependsOn:e.dependsOn,dependsOnMissing:e.dependsOnMissing,fields:e.def.fields===!0,measure:e.def.measure===!0}}function Ct(e){return e.kind===\"collection\"?{kind:\"collection\",status:\"ready\",items:[],complete:!0}:{kind:\"single\",status:\"ready\",record:null}}function he(e){return e.more?document.querySelector(e.more)===null:!0}function oe(e,t){let n=e(t);if(typeof n!=\"string\"||n===\"\")throw new O(\"INVALID_ARGUMENT\",\"key must return a non-empty string\");return n}function Ge(e,t){try{return oe(e.key,t)}catch{return null}}function Fe(e){return String(e?.message??e)}function H(e){return{...e,kind:\"collection\"}}function N(e){return{...e,kind:\"single\"}}function ke(e){let t=(o,s)=>{throw new Error(`Adapter ${o} ${s}`)},n=(o,s)=>{o!==void 0&&typeof o!=\"function\"&&t(s,\"must be a function\")},r=(o,s)=>{(typeof o!=\"string\"||o.trim()===\"\")&&t(s,\"must be a CSS selector\")},i=(o,s)=>{if(o!==void 0){V(o)||t(s,\"must be an object of functions\");for(let[a,f]of Object.entries(o))typeof f!=\"function\"&&t(`${s}.${a}`,\"must be a function\")}};V(e)||t(\"definition\",\"must be an object\"),n(e.account,\"account\"),e.signInUrl!==void 0&&typeof e.signInUrl!=\"string\"&&typeof e.signInUrl!=\"function\"&&t(\"signInUrl\",\"must be a path or a function\"),V(e.pages)||t(\"pages\",\"must be an object\");for(let[o,s]of Object.entries(e.pages)){let a=`pages.${o}`;V(s)||t(a,\"must be an object\"),typeof s.ready!=\"function\"&&t(`${a}.ready`,\"must be a function\"),n(s.account,`${a}.account`),i(s.actions,`${a}.actions`),s.regions!==void 0&&!V(s.regions)&&t(`${a}.regions`,\"must be an object\");for(let[f,u]of Object.entries(s.regions??{})){let p=`${a}.regions.${f}`;(!V(u)||u.kind!==\"collection\"&&u.kind!==\"single\")&&t(p,\"must be made with collection() or single()\"),r(u.root,`${p}.root`),typeof u.read!=\"function\"&&t(`${p}.read`,\"must be a function\"),n(u.entity,`${p}.entity`),u.dependsOn!==void 0&&(Array.isArray(u.dependsOn)||t(`${p}.dependsOn`,\"must be an array of selectors\"),u.dependsOn.forEach((g,b)=>r(g,`${p}.dependsOn.${b}`))),i(u.actions,`${p}.actions`),u.kind===\"collection\"?(r(u.items,`${p}.items`),typeof u.key!=\"function\"&&t(`${p}.key`,\"must be a function\"),n(u.extent,`${p}.extent`),u.more!==void 0&&r(u.more,`${p}.more`)):n(u.key,`${p}.key`)}}return e}function V(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var K=\"https://news.ycombinator.com\";var C=e=>typeof e==\"string\"&&e.length<=20&&/^[1-9][0-9]*$/.test(e);function xe(e,t=K){try{let n=new URL(e,t);return(n.protocol===\"https:\"||n.protocol===\"http:\")&&!n.username&&!n.password&&n.href.length<=2048?n.href:null}catch{return null}}function ie(e){try{let t=new URL(e,K),n=t.searchParams.get(\"id\");return t.origin===K&&t.pathname===\"/item\"&&C(n)?n:null}catch{return null}}var Ut=3,qt=1;function k(e,t=300){return(e??\"\").replace(/\\s+/g,\" \").trim().slice(0,t)}function Be(e){return e.ownerDocument?.location?.href??`${K}/`}function Z(e){let t=e.getAttribute(\"href\");return t?xe(t,Be(e)):null}var ze=e=>k((e?.querySelector(\".hnuser\")??e?.querySelector(\"a[href^='user?id=']\"))?.textContent,64)||null,U=e=>e.readyState!==\"loading\"&&e.querySelector(\"#hnmain\")!==null,B=e=>k(e.querySelector(\"#me\")?.textContent,64)||null;function F(e,t=12e3){let n=[],r=0,i=(o,s)=>{if(r>=t)return;if(o.nodeType===Ut){let u=(o.textContent??\"\").slice(0,t-r);r+=u.length,u&&n.push({text:u,...s});return}if(o.nodeType!==qt)return;let a=o;if(a.matches(\"script,style,input,textarea,select,button,noscript,form,img,.reply,.pagetop\"))return;let f={...s};if(a.tagName===\"A\"){let u=Z(a);u&&(f.href=u)}a.matches(\"b,strong\")&&(f.strong=!0),a.matches(\"i,em\")&&(f.em=!0),a.matches(\"code,pre\")&&(f.code=!0),a.matches(\"p,br,pre,li,tr,h1,h2,h3\")&&r>0&&(n.push({text:`\n\n`}),r+=2);for(let u of a.childNodes)i(u,f)};return e&&i(e,{}),n}function be(e,...t){let n=o=>{for(let s of t){let a=s?.querySelector(`[id=\"${o}_${e}\"]`);if(a)return a}return null},r=n(\"up\"),i=r?.classList.contains(\"nosee\")===!0||n(\"un\")!==null;return{canVote:r!==null&&!i,voted:i}}function se(e){if(!C(e.id))return null;let t=e.querySelector(\".titleline > a\"),n=k(t?.textContent,400);if(!t||!n)return null;let r=Z(t),i=e.nextElementSibling?.querySelector(\".subtext\")??null,o=[...i?.querySelectorAll(\"a[href^='item?id=']\")??[]].reverse().find(s=>/comment|discuss/i.test(s.textContent??\"\"));return{id:e.id,title:n,articleUrl:r&&ie(r)!==e.id?r:null,domain:k(e.querySelector(\".sitestr\")?.textContent,120)||null,submitter:ze(i),score:k(i?.querySelector(\".score\")?.textContent,40)||null,age:k(i?.querySelector(\".age\")?.textContent,40)||null,comments:o?k(o.textContent,40):null,rank:k(e.querySelector(\".rank\")?.textContent,8).replace(/\\.$/,\"\")||null,...be(e.id,e,i)}}function Gt(e){let n=[...e.querySelectorAll(\".navs a[href]\")].find(i=>k(i.textContent,20)===\"parent\")?.getAttribute(\"href\")??\"\",r=n.startsWith(\"#\")?n.slice(1):ie(xe(n,Be(e))??\"\")??\"\";return C(r)?r:null}function X(e,{links:t=!1}={}){if(!C(e.id))return null;let n=e.querySelector(\".comment\");if(!n)return null;let r=n.querySelector(\".commtext\"),i=e.querySelector(\".onstory a[href]\"),o=i?ie(Z(i)??\"\"):null;return{id:e.id,author:ze(e.querySelector(\".comhead\")),age:k(e.querySelector(\".age\")?.textContent,40)||null,depth:Math.min(20,Math.max(0,Number(e.querySelector(\".ind\")?.getAttribute(\"indent\")??0)||0)),parent:Gt(e),parts:r?F(r,8e3):[{text:k(n.textContent,100)||\"[no text]\"}],onStory:o?{id:o,title:k(i.getAttribute(\"title\")||i.textContent,400)}:null,links:t?[...e.querySelectorAll(\".navs a[href]\")].flatMap(s=>{let a=k(s.textContent,20),f=Z(s);return f&&a&&!s.classList.contains(\"togg\")&&s.closest(\".onstory\")===null?[{label:a,url:f}]:[]}).slice(0,6):[],canReply:n.querySelector(\".reply a[href^='reply?id=']\")!==null,...be(e.id,e)}}function ce(e){let t=Z(e);return t?{url:t}:null}function z(e,t,n){let r=n?.voted;if(typeof r!=\"boolean\")throw new Error(\"setVoted needs { voted: boolean }\");if(!C(t))throw new Error(\"Not a Hacker News item\");let i=s=>be(t,s.documentElement).voted;if(i(e)===r)return{satisfied:!0};let o=`[id=\"${r?\"up\":\"un\"}_${t}\"]`;if(!e.querySelector(o))throw new Error(r?\"This item cannot be upvoted here\":\"This vote cannot be undone here\");return{steps:[{click:o}],until:s=>i(s)===r}}function Ft(e){let t=k(e.querySelector(\"#me\")?.textContent,64);return t?{name:t,karma:k(e.querySelector(\"#karma\")?.textContent,20)||null}:null}var Je={ready:U,requiresAccount:!0,regions:{account:N({root:\"#hnmain\",read:Ft,actions:{signOut:e=>{if(B(e.ownerDocument)===null)return{satisfied:!0};if(!e.querySelector(\"a#logout\"))throw new Error(\"Hacker News shows no logout link\");return{steps:[{click:\"a#logout\"}],navigates:!0}}}})}};var Ie={ready:U,regions:{stories:H({root:\"#hnmain\",items:\"tr.athing.submission\",key:e=>e.id,entityType:\"story\",read:se,extent:e=>[e.nextElementSibling],more:\"a.morelink\",actions:{setVoted:(e,t)=>z(e.ownerDocument,e.id,t)}}),comments:H({root:\"#hnmain\",items:\"tr.athing:not(.submission)\",key:e=>e.id,entityType:\"comment\",read:e=>X(e),more:\"a.morelink\",actions:{setVoted:(e,t)=>z(e.ownerDocument,e.id,t)}}),more:N({root:\"a.morelink\",read:ce})},actions:{loadMore:()=>({steps:[{click:\"a.morelink\"}],navigates:!0,expect:{page:[\"feed\",\"private-feed\"]}})}},We={...Ie,requiresAccount:!0};var Te=`\n\n`,Ke=e=>!e.href&&e.text.trim()===\"\";function jt(e,t){let n=[],r=()=>n[n.length-1];for(let i of e)if(i.text===Te)n.length>0&&r().text!==Te&&n.push(i);else if(i.code)n.push(i);else{let o=i.text.replace(/\\s*\\n\\s*/g,\" \");(n.length===0||r().text===Te)&&(o=o.trimStart()),o&&n.push({...i,text:o})}for(;n.length>0&&Ke(r());)n.pop();for(n[0]?.text.trim()===t&&n.shift();n.length>0&&Ke(n[0]);)n.shift();return n}function Vt(e){let t=e.ownerDocument,n=e.querySelector(\"#bigbox\")??e.querySelector(\"body\"),r=k(t.title.replace(/\\s*\\|\\s*Hacker News$/,\"\"),120)||\"Hacker News\";return{title:r,parts:jt(F(n,6e4),r)}}var Ze={ready:e=>e.readyState!==\"loading\"&&e.body!==null,account:e=>e.querySelector(\"#hnmain\")?B(e):void 0,regions:{sections:N({root:\"html\",read:Vt})}};function Ht(e){let t=e.querySelector(\"tr.athing\"),n=t?.matches(\".submission\")?se(t):null;return{story:n,comment:t&&!n?X(t,{links:!0}):null,text:F(e.querySelector(\".toptext\")),canComment:e.querySelector(\"form[action='comment'] textarea\")!==null}}function Xe(e){let t=e.querySelector(\"tr.athing\")?.id;if(t)return t;let n=new URLSearchParams(e.ownerDocument?.location?.search??\"\").get(\"id\");return C(n)?n:\"item\"}var Qe={ready:U,regions:{story:N({root:\"table.fatitem\",key:Xe,entityType:\"story\",read:Ht,actions:{setVoted:(e,t)=>z(e.ownerDocument,Xe(e),t)}}),comments:H({root:\"table.comment-tree\",items:\"tr.athing.comtr\",key:e=>e.id,entityType:\"comment\",read:e=>X(e),more:\"a.morelink\",actions:{setVoted:(e,t)=>z(e.ownerDocument,e.id,t)}}),more:N({root:\"a.morelink\",read:ce})}};var Q=\"form[action='/r']\",et=[\"title\",\"url\",\"text\"],tt=(e,t)=>e.querySelector(`[name='${t}']`);function Bt(e){let t=Object.fromEntries(et.map(i=>[i,tt(e,i)?.value??\"\"])),n=e.closest(\"#bigbox, td\")??e.parentElement,r=\"\";for(let i of n?.childNodes??[])i===e||i.tagName===\"SCRIPT\"||i.contains?.(e)||(r+=` ${i.textContent??\"\"}`);return{...t,error:k(r,300)||null}}var zt=e=>et.includes(e),nt={ready:e=>e.readyState!==\"loading\"&&e.querySelector(\"#hnmain\")!==null,account:e=>e.querySelector(Q)?void 0:null,requiresAccount:!0,regions:{form:N({root:Q,dependsOn:[\"#hnmain\"],fields:!0,read:Bt,actions:{setField:(e,t)=>{let{name:n,value:r}=t??{};if(!zt(n)||typeof r!=\"string\")throw new Error(\"setField needs { name: title | url | text, value }\");if(n===\"title\"&&r.length>80)throw new Error(`Titles are at most ${80} characters`);let i=tt(e,n);if(!i)throw new Error(`The form has no ${n} field`);return i.value===r?{satisfied:!0}:{steps:[{fill:`${Q} [name='${n}']`,value:r}],until:o=>o.querySelector(`${Q} [name='${n}']`)?.value===r}},submit:()=>({steps:[{submit:Q}],navigates:!0,expect:{page:[\"item\",\"feed\"],notPage:\"submit\"}})}})}};function Jt(e){let t=new Map;for(let r of e.querySelectorAll(\"tr\")){let[i,o]=r.querySelectorAll(\":scope > td\"),s=k(i?.textContent,20).replace(/:$/,\"\").toLowerCase();s&&o&&!t.has(s)&&t.set(s,o)}let n=k(t.get(\"user\")?.textContent,64);return n?{name:n,created:k(t.get(\"created\")?.textContent,40)||null,karma:k(t.get(\"karma\")?.textContent,20)||null,about:F(t.get(\"about\")??null,6e3)}:null}var rt={ready:U,regions:{profile:N({root:\"#bigbox\",read:Jt})}};var Wt=e=>{let{pathname:t,search:n}=new URL(e);return`/login?goto=${encodeURIComponent(t.slice(1)+n)}`},ot=ke({account:B,signInUrl:Wt,pages:{feed:Ie,\"private-feed\":We,item:Qe,user:rt,info:Ze,account:Je,submit:nt}});Ee(ot);})();\n"},{"path":"assets/yc.png","encoding":"base64","content":"iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABAKADAAQAAAABAAABAAAAAABn6hpJAAASy0lEQVR4Ae2dC7BVVRnHv8tDXgIiGYKaZqaJpphvMzV8oEim5Tg6mk2T+ZryNZlWSvioTC0zHRtL03FirCwQEAN8oKiQD3wiCgahkIC8BAR5yW1912vA5t7DOXt965y9zvqtGeWuffb6r2/9vnv/e52999q7ofF8uVXWy5nSID2lUSgQgEC9E2hwA2yURdJGhjY0nicLXaWH29Sm3sfN+CAAgf8TWO8O+kvauWrP/2/iBwhAIBUCesDv2YZpfyr5ZpwQyBBwX/mZ9meYUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCGAAWSAUIVASgQwgJSyzVghkCHQLlOnWopAhy4inbqX2qOyz1avEPlwaWVt6nHvtu1Fum5nMzLlqVwpZRHAAMrC1LzTtp8RGfyaSJu2lbRqfd/500WG9BVZ/1Hr+6TwyYAfiXz9ev+RKsdr9hKZN81fKxEFvgJUkui5b4hMureSFqX37bW7yIFnlN6n3j/t2FXkmMtsRvnM3fzxV0gSA6gQmIy6RmTtqkpbtb7/iVeJNCSchqMvEemybet8yv1EczLaYBZRbn91sl/Cv3k5M7hktsj423M2bqFZrz3cLOD0Fj5IYFPT0f9Sm4GOv01Ec0OpiAAGUBGu5p3H3GB78m5gorMAnfp37pEnA5u2WbVMZMyvNt1GrSwCGEBZmDI7rVgkMvbGzEaPau89RQ44zUMgwqZ6NUWn/xZF//g1J5SKCWAAFSNrbvD4rSLL5uVtvXm71GYBTUf/bTbnUOmWZfNFNBeUXAQwgFzYXCO91qwnBK1KH3f5av9TrdSKrdNZj/4X28T40BCu+3uQxAA84Iledloww0dh07YnXp3GFYFjf2hzQ9XCmSJPuxxQchPAAHKjcw0/Wivy4E99FDZt22dvkf2+sem2eqvpSb/+F9mM6kF38lRzQMlNAAPIja654eQHRGa/5KuyoX29zwKOc0f/jt02jDfvT3NeFXnhr3lb066ZAAbg+6vQuF5k2JW+Khva77iPSL+TN9Tr6acu7uj/1R/YjGjYFSLKnuJFAAPwwtfceOo4kWnjLZQ+1qjXWcBx7p5/vfnHt7z1lMjrY3xVaO8IYABWvwaWs4Cd+onse5JVZMXQ6dLTHf2/bxPLcMMZl01E0apgAFapm/WcyIv/sFITGTTYTqsISgMuF+mwtX8kr4wQmTHRXweFJgIYgOUvwgh3RcBqae9O+9XPLGBrd/Q/yuDor9/59cw/xYwABmCG0gnpOvSJ99gpnlgns4AB7oSdPkzFt0y6T+TdKb4qtN+IAAawEQyTH/XONKvlwjvvL7LPIJOwaiaiT/o58kL/7tetEXnI8M5L/4jqQgEDsE7jkv/a3pse+yzA6uj/5B0ii2ZZZyt5PQwgxK/AWLc6zepZf7scKLL3wBBRhtfs1ssd/S/w72f1ByL//IW/DgqbEcAANkNisGHFErc+3T0zwKrEekVAj/5bdfanMO5mkeUL/HVQ2IwABrAZEqMNukR16Vwbsc8eLLLX8TZa1VLptr07+p/v39sHC0Ue/Y2/DgotEsAAWsRisHHNh7YnrWKbBRzvbtZp38kf5OjrRFYt99dBoUUCGECLWIw2Pn2XyHtv2YjteqhI3+NstEKrdHdH/yPO8+9l8TsiE+7010GhVQIYQKtoDD7Qm4JGGN64MuhnBkFVQeKEn7ijf0f/jka45yOsW+2vg0KrBDCAVtEYfTD57yLvvGgj9rnDRPY8xkYrlMo2fUQO/56/+typIs/+2V8HhZIEMICSeAw+bFou7M6GW5WizwKsjv7Df8xyX6vfmRI6GEAJOGYfvfGoyJuP28jtdrjIF/rbaFmr9NjBHf3P8Ved+S+RV0b666CwRQIYwBYRGe1guYS1qLOAE9xiqHYd/IFZsvKPpq4VMIBqpXfW8265sDsfYFE+f4TI7kdZKNlp9NhJ5Mvf9deb8rDI9Cf9dVAoiwAGUBYmo510Kev6dTZiXyvYFYGBevTfym9sjY0iw50OpWoEMICqoXYdzZ8m8syfbHrUGYDOBIpQtt1Z5LDv+Efy/P0ic17210GhbAIYQNmojHZ86Fq3XNjdJWhRinIuYKC77u979NfHe48cbEEFjQoIYAAVwDLZ9X1dLvw7E6mmqwF6VaCWpecuNkf/p/5g+5KVWjKJqG8MoBbJ0pdZrnzfpudazwL0u3/b9n5jWbNSZPT1fhq0zkUAA8iFzbPRSsPlwnpnoN4hWIvyqV1FDv22f8+P3mL7olX/iJJRwABqlWr9GvD+uza912oWYHH0X7FYZNxNNhxQqZgABlAxMqMGeiLQ6hl3ukpw14ONAitTpunof3aZO5fYbcwv7Z6eVKIbPmqZAAbQMpfqbNW3C8+fbtPXoCE2OuWq6NuL2rQrd++W99MTouNva/kztlaFAAZQFcytdKLLha3eLqxPDNrloFY6Mt786d1EDjnLX3Sku5lpLct9/UHmV8AA8rOzafnSMJG3X7DRqtbdgRZHf70patK9NuNGJTcBDCA3OqOGulxYl75aFH16sL5LIGTRo/9BZ/r3oDMfq7co+UeTrAIGUITU63LhNx6xiST0uQC94tCmrV+sOuOxfI+iXzRJt8YAipL+pgdgNPpHo28SCjUL6LWHyIFn+MdoNePxjyR5BQygKL8Cb08WmfyATTSh3iakTyb2PfrrTEdnPJRCEMAACpGG5iBGuktrFsuF9z1JRN8ubFm216P/6f6KHP39GRoqYACGML2l9J6Ap929ARZlkDMTy6LnFho8f110hqMzHUphCHhmtDDjqJ9ARl9rs1x435NFduxnw6V3X5EDTvPTanpEurEp+UVEa0cAAyjar4GuD3jMvVbMtzQ0iFjNAvS7v+/Rv+muR3ftn1IoAhhAodLRHMzYG9xyYbdi0Lf0O0Vkhy/6qfRxR//9PY/+a1e5dQ9uZkMpHAEMoHApcQGtXOpeh+0WyfiWplmAO3r7lKbv/m424VP0Ral63z+lcAQwgMKlpDmg8bfb/NHs902RPnvnG6XOHr50ar62n7T60JnZWPcAFEohCWAAhUyLC0qXC48a4h+dzgL0mX15StN3f8+jv/7xrzD4OpMnftpskQAGsEVENdxh4j0fP0nYNwT9Dq/38FdSdNagswefsmyeO6H5Wx8F2gYmgAEEBuwlb7VcWO/eO/7KykLRFX86e/Apo64RWeNmMpTCEsAACpua5sB00Yy+Vci3HPwtkW12KE+l957uzL/nd/8FM9w7EO4urz/2qhkBDKBm6Cvo2OJdefrc/mMuLa9TfcOv73X/EVeJ6LP+KYUmgAEUOj3NwembhaeO84/0K+eKdO5eWkfPFfiu+Jv9ssgLfyvdD58WggAGUIg0lBGExXLhjl1FjrigdGd6rsB3xV9TrOtL98OnhSCAARQiDWUE8c6LbrmwwVG1/0XuNV6tvMhD3/B7yNllBFNiF32z7+tjSuzAR0UigAEUKRtbikW/V/suF+7e2z3S66yWexpwuf9bfoZf0bI2WwtJAAMoZFpaCeq9f7vlwne18mEFm4+9bPOdu24ncvg5m2+vZMvLw0VmPltJC/atMQEMoMYJqLh7fZmIvkvPp+hNPvoykY3L0e4KQftOG2+p7Gd9uOmDboZCiYoABhBVulywS43urtv4kqCeHDzqQj8Sk+4TmTvVT4PWVSeAAVQduUGHY29099cv9hPqO0BEH/Ol5Uj3x99pC5cHP96z5f+vW22zbqFldbYGJIABBIQbTFpX2Ok79XyK3ubb/2J3RaCDu0HoEh8lkSfuEFn8tp8GrWtCAAOoCXaDTvWdekvm+AnpJb+jnQl02z6/zqrl7tkFP8/fnpY1JYAB1BS/R+f6Tj3f5cIduoic4jmTeORmkQ8WeQyEprUkgAHUkr5v35PuFZn3pp+Kzz3/yxeIPPJrv/5pXVMCGEBN8Xt2brVcOG8YD18vsnpF3ta0KwABDKAASfAKQd8u/J8a3HyzaJbIhN97hU7j2hPAAGqfA/8IhrkFPNUuIweLrGO5b7WxW/eHAVgTrYXe9CfcApyx1ev53Skizw6tXn/0FIwABhAMbZWFLZYLlxvycPfAEL31lxI9AQwg+hQ2D2D2S+4hHH8JP5oZE0VeHRW+H3qoCgEMoCqYq9TJiKvDP4aLt/tWKZnV6QYDqA7n6vSiD+J86o/h+npttMhbE8Lpo1x1AhhA1ZEH7nD0dWGuzTct9835gpHAQ0Y+PwEMID+7YrYM9TKO5+4XmfNqMcdMVLkJYAC50RW44bib3HJhw/vz9fHeet2fUncEMIC6S6kbkC4Xtni78CdsJtwpsnDmJzX+rSMCGEAdJXOToTzh3i68ZPYmm3JV9F5/veefUpcEMIC6TKsblC4Xnjbef3SP3SKybL6/DgqFJIABFDItBQpqCs/4L1A2zEPBAMyRIgiBeAhgAPHkikghYE4AAzBHiiAE4iGAAcSTKyKFgDkBDMAcKYIQiIcABhBProgUAuYEMABzpAhCIB4CGEA8uSJSCJgTwADMkSIIgXgIYADx5IpIIWBOAAMwR4ogBOIhgAHEkysihYA5AQzAHCmCEIiHAAYQT66IFALmBDAAc6QIQiAeAhhAPLkiUgiYE8AAzJEiCIF4CGAA8eSKSCFgTgADMEeKIATiIYABxJMrIoWAOQEMwBwpghCIhwAGEE+uiBQC5gQwAHOkCEIgHgIYQDy5IlIImBPAAMyRIgiBeAhgAPHkikghYE4AAzBHiiAE4iGAAcSTKyKFgDkBDMAcKYIQiIcABhBProgUAuYEMABzpAhCIB4CGEA8uSJSCJgTwADMkSIIgXgIYADx5IpIIWBOAAMwR4ogBOIhgAHEkysihYA5AQzAHCmCEIiHAAYQT66IFALmBDAAc6QIQiAeAhhAPLkiUgiYE8AAzJEiCIF4CGAA8eSKSCFgTgADMEeKIATiIYABxJMrIoWAOQEMwBwpghCIhwAGEE+uiBQC5gQwAHOkCEIgHgIYQDy5IlIImBPAAMyRIgiBeAhgAPHkikghYE4AAzBHiiAE4iGAAcSTKyKFgDmBhsZzpdFcFUEIQCAKAswAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAwBDCAMV1QhEAUBDCCKNBEkBMIQwADCcEUVAlEQwACiSBNBQiAMAQwgDFdUIRAFAQwgijQRJATCEMAAwnBFFQJREMAAokgTQUIgDAEMIAxXVCEQBQEMIIo0ESQEwhDAAMJwRRUCURDAAKJIE0FCIAyBNtIQRhhVCECg4ATc377OABa5/9YXPFTCgwAEbAno3/winQEMdT8sYSZgSxc1CBSWwMezfv2bH/o/4JuJLNSc5H4AAAAASUVORK5CYII="},{"path":"foreground.css","encoding":"utf8","content":":root{color-scheme:light;--paper: #faf7f2;--card: #ffffff;--ink: #24211c;--muted: #655d53;--accent: #b93800;--wash: #f3e9dc;--line: #e5d9ca;--danger: #a52525;--skeleton: #e9e6e1;--font: Verdana, Geneva, \"DejaVu Sans\", sans-serif;--edge: 16px;--radius: 12px;--tabs: 64px}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--paper: #1d1b18;--card: #282520;--ink: #f5eee4;--muted: #c4b8a9;--accent: #ff995f;--wash: #363027;--line: #52483c;--danger: #ff9d96;--skeleton: #34312d}}@media(prefers-contrast:more){:root{--line: var(--muted)}}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}html,body{background:var(--paper);color:var(--ink);font:15px/1.5 var(--font)}button,input,textarea{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}a{color:inherit;text-underline-offset:2px}a,button{overflow-wrap:anywhere}button{cursor:pointer}button:disabled{opacity:.55;cursor:default}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}svg.filled{fill:currentColor}.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.app{display:flex;flex-direction:column;height:100%}.content{flex:1;min-height:0}.screen{height:100%;overflow-y:auto;padding:8px var(--edge) 32px}.screen:before{content:\"\";float:right;width:44px;height:44px}.screen-title{font-size:1.45rem;line-height:1.25;margin:12px 0 8px;overflow-wrap:anywhere}.section-title{font-size:1rem;margin:24px 0 4px}.eyebrow{margin:12px 0 0;color:var(--muted);font-size:.8rem;letter-spacing:.06em;text-transform:uppercase}.meta{margin:2px 0 0;color:var(--muted);font-size:.85rem}.meta a{color:var(--muted)}.tabs{display:flex;flex:none;min-height:var(--tabs);background:var(--card);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;border:0;background:none;color:var(--muted);font-size:.72rem}.tab[aria-current=page]{color:var(--accent);font-weight:700}.primary,.secondary,.danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:0 18px;margin:8px 8px 0 0;border-radius:999px;font-weight:700}.primary{border:0;background:var(--accent);color:var(--card)}.secondary{border:1px solid var(--line);background:var(--card)}.danger{border:0;background:var(--danger);color:var(--card)}.secondary svg,.primary svg{width:16px;height:16px}.text-button{min-height:48px;min-width:48px;padding:0 8px;border:0;background:none;color:var(--accent);font-weight:700}.danger-text{color:var(--danger)}.icon-button{display:inline-grid;place-items:center;width:48px;height:48px;flex:none;border:0;border-radius:50%;background:none;color:var(--muted)}.more{width:100%;margin:16px 0 0}input:not([type=checkbox]),textarea{width:100%;min-height:48px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--card)}textarea{resize:vertical}.chips{display:flex;gap:8px;overflow-x:auto;margin:4px 0;padding:8px 0;scrollbar-width:none}.chip{flex:none;min-height:40px;padding:0 16px;border:1px solid var(--line);border-radius:999px;background:var(--card)}.chip[aria-pressed=true]{border-color:var(--accent);background:var(--wash);color:var(--accent);font-weight:700}.story{display:flex;align-items:flex-start;gap:4px;padding:10px 0;border-bottom:1px solid var(--line)}.story-body{flex:1;min-width:0;padding-top:4px}.story-title{margin:0;font-size:15px;font-weight:400;line-height:21px;overflow-wrap:anywhere}h1.story-title{font-size:1.25rem;line-height:1.3;font-weight:700}.story-title a{text-decoration:none}.domain{color:var(--muted);font-size:.8rem;font-weight:400}.rank{width:24px;flex:none;padding-top:16px;color:var(--muted);font-size:.8rem;text-align:right}.vote{display:inline-grid;place-items:center;width:40px;min-height:48px;flex:none;color:var(--muted)}.vote.voted{color:var(--accent)}.vote svg{width:18px;height:18px}.vote.small{width:32px;min-height:40px;margin-left:-8px}.vote.small svg{width:14px;height:14px}.comment{padding:10px 0 10px calc(var(--depth, 0) * 12px);border-bottom:1px solid var(--line)}.comment>*{border-left:2px solid transparent}.comment[style*=\"--depth: 0\"]>*{border-left:0}.comment-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.comment-head .meta{flex:1}.comment-head .text-button{min-height:40px;font-size:.8rem}.comment-links{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:4px;font-size:.8rem}.comment-links a{color:var(--muted);display:inline-flex;align-items:center;gap:3px;min-height:32px}.comment-links svg{width:12px;height:12px}.rich{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:4px}.rich a{color:var(--accent)}.rich code{font-family:ui-monospace,Menlo,monospace;font-size:.9em}.toptext{padding:12px 0;border-bottom:1px solid var(--line)}.card{margin:12px 0;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}.card h2{margin:0;font-size:1.15rem}.list{display:flex;flex-direction:column;margin:12px 0;border:1px solid var(--line);border-radius:var(--radius);background:var(--card);overflow:hidden}.list button{display:flex;align-items:center;justify-content:space-between;min-height:52px;padding:0 16px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.list button:last-child{border-bottom:0}.list svg{width:16px;height:16px;color:var(--muted)}.facts{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;margin:8px 0}.facts dt{color:var(--muted)}.facts dd{margin:0}.notice{margin:24px 0;padding:20px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}.notice h2{margin:0 0 6px;font-size:1.05rem}.notice p{margin:0;color:var(--muted)}.inline-error,.field-error{color:var(--danger);font-size:.9rem}.status{padding:10px 12px;border-radius:10px;background:var(--wash)}.confirm{margin:12px 0;padding:12px 14px;border:1px solid var(--danger);border-radius:var(--radius)}.confirm p{margin:0}.form{display:flex;flex-direction:column;gap:14px;margin-top:8px}.form label{display:flex;flex-direction:column;gap:6px;font-weight:700}.form label .meta,.form .field-error{font-weight:400}.form .primary{margin-right:0}fieldset{min-width:0}fieldset.card legend{padding:0 4px;font-weight:700}.check{display:flex;align-items:center;gap:12px;min-height:48px}.check input{width:22px;height:22px;accent-color:var(--accent)}.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}.row .grow{flex:1 1 160px}.row .primary,.row .secondary{margin:0}.actions{display:flex;flex-wrap:wrap;align-items:center;margin-top:8px}.search-field{display:block;margin:4px 0 8px}.category{padding:8px 0;border-top:1px solid var(--line)}.skeleton{padding-top:8px}.skeleton-row{padding:14px 0;border-bottom:1px solid var(--line)}.skeleton-row span{display:block;height:14px;border-radius:4px;background:var(--skeleton)}.skeleton-row span+span{width:45%;height:10px;margin-top:8px}.skeleton.text .skeleton-row{border-bottom:0;padding:8px 0}\n"},{"path":"foreground.js","encoding":"utf8","content":"\"use strict\";(()=>{var h0=Object.create;var Kf=Object.defineProperty;var p0=Object.getOwnPropertyDescriptor;var b0=Object.getOwnPropertyNames;var S0=Object.getPrototypeOf,E0=Object.prototype.hasOwnProperty;var $t=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var T0=(e,t,n,l)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let a of b0(t))!E0.call(e,a)&&a!==n&&Kf(e,a,{get:()=>t[a],enumerable:!(l=p0(t,a))||l.enumerable});return e};var U=(e,t,n)=>(n=e!=null?h0(S0(e)):{},T0(t||!e||!e.__esModule?Kf(n,\"default\",{value:e,enumerable:!0}):n,e));var Ed=$t(D=>{\"use strict\";var Ac=Symbol.for(\"react.transitional.element\"),Z0=Symbol.for(\"react.portal\"),K0=Symbol.for(\"react.fragment\"),J0=Symbol.for(\"react.strict_mode\"),I0=Symbol.for(\"react.profiler\"),F0=Symbol.for(\"react.consumer\"),$0=Symbol.for(\"react.context\"),W0=Symbol.for(\"react.forward_ref\"),P0=Symbol.for(\"react.suspense\"),ep=Symbol.for(\"react.memo\"),md=Symbol.for(\"react.lazy\"),tp=Symbol.for(\"react.activity\"),np=Symbol.for(\"react.view_transition\"),rd=Symbol.iterator;function lp(e){return e===null||typeof e!=\"object\"?null:(e=rd&&e[rd]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var gd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vd=Object.assign,yd={};function $l(e,t,n){this.props=e,this.context=t,this.refs=yd,this.updater=n||gd}$l.prototype.isReactComponent={};$l.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};$l.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function hd(){}hd.prototype=$l.prototype;function zc(e,t,n){this.props=e,this.context=t,this.refs=yd,this.updater=n||gd}var _c=zc.prototype=new hd;_c.constructor=zc;vd(_c,$l.prototype);_c.isPureReactComponent=!0;var sd=Array.isArray;function Oc(){}var se={H:null,A:null,T:null,S:null},pd=Object.prototype.hasOwnProperty;function Cc(e,t,n){var l=n.ref;return{$$typeof:Ac,type:e,key:t,ref:l!==void 0?l:null,props:n}}function ap(e,t){return Cc(e.type,t,e.props)}function Mc(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===Ac}function up(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(n){return t[n]})}var fd=/\\/+/g;function Nc(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?up(\"\"+e.key):t.toString(36)}function ip(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(Oc,Oc):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function Fl(e,t,n,l,a){var u=typeof e;(u===\"undefined\"||u===\"boolean\")&&(e=null);var i=!1;if(e===null)i=!0;else switch(u){case\"bigint\":case\"string\":case\"number\":i=!0;break;case\"object\":switch(e.$$typeof){case Ac:case Z0:i=!0;break;case md:return i=e._init,Fl(i(e._payload),t,n,l,a)}}if(i)return a=a(e),i=l===\"\"?\".\"+Nc(e,0):l,sd(a)?(n=\"\",i!=null&&(n=i.replace(fd,\"$&/\")+\"/\"),Fl(a,t,n,\"\",function(f){return f})):a!=null&&(Mc(a)&&(a=ap(a,n+(a.key==null||e&&e.key===a.key?\"\":(\"\"+a.key).replace(fd,\"$&/\")+\"/\")+i)),t.push(a)),1;i=0;var o=l===\"\"?\".\":l+\":\";if(sd(e))for(var c=0;c{\"use strict\";Td.exports=Ed()});var Dd=$t(ge=>{\"use strict\";function wc(e,t){var n=e.length;e.push(t);e:for(;0>>1,a=e[l];if(0>>1;lvi(o,n))cvi(f,o)?(e[l]=f,e[c]=n,l=c):(e[l]=o,e[i]=n,l=i);else if(cvi(f,n))e[l]=f,e[c]=n,l=c;else break e}}return t}function vi(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}ge.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(Nd=performance,ge.unstable_now=function(){return Nd.now()}):(xc=Date,Od=xc.now(),ge.unstable_now=function(){return xc.now()-Od});var Nd,xc,Od,hn=[],Gn=[],rp=1,Mt=null,Qe=3,Uc=!1,tu=!1,nu=!1,Hc=!1,_d=typeof setTimeout==\"function\"?setTimeout:null,Cd=typeof clearTimeout==\"function\"?clearTimeout:null,Ad=typeof setImmediate<\"u\"?setImmediate:null;function yi(e){for(var t=Wt(Gn);t!==null;){if(t.callback===null)hi(Gn);else if(t.startTime<=e)hi(Gn),t.sortIndex=t.expirationTime,wc(hn,t);else break;t=Wt(Gn)}}function Gc(e){if(nu=!1,yi(e),!tu)if(Wt(hn)!==null)tu=!0,Pl||(Pl=!0,Wl());else{var t=Wt(Gn);t!==null&&Lc(Gc,t.startTime-e)}}var Pl=!1,lu=-1,Md=5,xd=-1;function Rd(){return Hc?!0:!(ge.unstable_now()-xde&&Rd());){var l=Mt.callback;if(typeof l==\"function\"){Mt.callback=null,Qe=Mt.priorityLevel;var a=l(Mt.expirationTime<=e);if(e=ge.unstable_now(),typeof a==\"function\"){Mt.callback=a,yi(e),t=!0;break t}Mt===Wt(hn)&&hi(hn),yi(e)}else hi(hn);Mt=Wt(hn)}if(Mt!==null)t=!0;else{var u=Wt(Gn);u!==null&&Lc(Gc,u.startTime-e),t=!1}}break e}finally{Mt=null,Qe=n,Uc=!1}t=void 0}}finally{t?Wl():Pl=!1}}}var Wl;typeof Ad==\"function\"?Wl=function(){Ad(Rc)}:typeof MessageChannel<\"u\"?(Dc=new MessageChannel,zd=Dc.port2,Dc.port1.onmessage=Rc,Wl=function(){zd.postMessage(null)}):Wl=function(){_d(Rc,0)};var Dc,zd;function Lc(e,t){lu=_d(function(){e(ge.unstable_now())},t)}ge.unstable_IdlePriority=5;ge.unstable_ImmediatePriority=1;ge.unstable_LowPriority=4;ge.unstable_NormalPriority=3;ge.unstable_Profiling=null;ge.unstable_UserBlockingPriority=2;ge.unstable_cancelCallback=function(e){e.callback=null};ge.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=n,wc(Gn,e),Wt(hn)===null&&e===Wt(Gn)&&(nu?(Cd(lu),lu=-1):nu=!0,Lc(Gc,n-l))):(e.sortIndex=a,wc(hn,e),tu||Uc||(tu=!0,Pl||(Pl=!0,Wl()))),e};ge.unstable_shouldYield=Rd;ge.unstable_wrapCallback=function(e){var t=Qe;return function(){var n=Qe;Qe=t;try{return e.apply(this,arguments)}finally{Qe=n}}}});var Ud=$t((tE,wd)=>{\"use strict\";wd.exports=Dd()});var Ld=$t(Xe=>{\"use strict\";var sp=mt();function Gd(e){var t=\"https://react.dev/errors/\"+e;if(1{\"use strict\";function Bd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bd)}catch(e){console.error(e)}}Bd(),qd.exports=Ld()});var zh=$t(ec=>{\"use strict\";var Ce=Ud(),Ag=mt(),gp=Vd();function E(e){var t=\"https://react.dev/errors/\"+e;if(1ca||(e.current=Nr[ca],Nr[ca]=null,ca--)}function me(e,t){ca++,Nr[ca]=e.current,e.current=t}var rn=dn(null),Mu=dn(null),Fn=dn(null),uo=dn(null);function io(e,t){switch(me(Fn,t),me(Mu,e),me(rn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ag(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ag(t),e=th(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}Ve(rn),me(rn,e)}function Ca(){Ve(rn),Ve(Mu),Ve(Fn)}function Or(e){var t=e.memoizedState;t!==null&&(Ba._currentValue=t.memoizedState,me(uo,e)),t=rn.current;var n=th(t,e.type);t!==n&&(me(Mu,e),me(rn,n))}function oo(e){Mu.current===e&&(Ve(rn),Ve(Mu)),uo.current===e&&(Ve(uo),Ba._currentValue=Ol)}var Bc,Xd;function qn(e){if(Bc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);Bc=t&&t[1]||\"\",Xd=-1)\":-1a||c[l]!==f[a]){var g=`\n`+c[l].replace(\" at new \",\" at \");return e.displayName&&g.includes(\"\")&&(g=g.replace(\"\",e.displayName)),g}while(1<=l&&0<=a);break}}}finally{qc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?qn(n):\"\"}function Np(e,t){switch(e.tag){case 26:case 27:case 5:return qn(e.type);case 16:return qn(\"Lazy\");case 13:return e.child!==t&&t!==null?qn(\"Suspense Fallback\"):qn(\"Suspense\");case 19:return qn(\"SuspenseList\");case 0:case 15:return Vc(e.type,!1);case 11:return Vc(e.type.render,!1);case 1:return Vc(e.type,!0);case 31:return qn(\"Activity\");case 30:return qn(\"ViewTransition\");default:return\"\"}}function Zd(e){try{var t=\"\",n=null;do t+=Np(e,n),n=e,e=e.return;while(e);return t}catch(l){return`\nError generating stack: `+l.message+`\n`+l.stack}}var Ar=Object.prototype.hasOwnProperty,Cs=Ce.unstable_scheduleCallback,Yc=Ce.unstable_cancelCallback,Op=Ce.unstable_shouldYield,Ap=Ce.unstable_requestPaint,bt=Ce.unstable_now,zp=Ce.unstable_getCurrentPriorityLevel,Ug=Ce.unstable_ImmediatePriority,Hg=Ce.unstable_UserBlockingPriority,co=Ce.unstable_NormalPriority,_p=Ce.unstable_LowPriority,Gg=Ce.unstable_IdlePriority,Cp=Ce.log,Mp=Ce.unstable_setDisableYieldValue,Zu=null,St=null;function Qn(e){if(typeof Cp==\"function\"&&Mp(e),St&&typeof St.setStrictMode==\"function\")try{St.setStrictMode(Zu,e)}catch{}}var Et=Math.clz32?Math.clz32:Dp,xp=Math.log,Rp=Math.LN2;function Dp(e){return e>>>=0,e===0?32:31-(xp(e)/Rp|0)|0}var Si=256,Ei=262144,Ti=4194304;function bl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ho(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,u=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~u,l!==0?a=bl(l):(i&=o,i!==0?a=bl(i):n||(n=o&~e,n!==0&&(a=bl(n))))):(o=l&~u,o!==0?a=bl(o):i!==0?a=bl(i):n||(n=l&~e,n!==0&&(a=bl(n)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:a}function Ku(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Lg(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Ju(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Up(e,t,n,l,a,u){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,f=e.hiddenUpdates;for(n=i&~n;0\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),Mr=!1;if(On)try{ea={},Object.defineProperty(ea,\"passive\",{get:function(){Mr=!0}}),window.addEventListener(\"test\",ea,ea),window.removeEventListener(\"test\",ea,ea)}catch{Mr=!1}var ea,Xn=null,ws=null,ki=null;function Pg(){if(ki)return ki;var e,t=ws,n=t.length,l,a=\"value\"in Xn?Xn.value:Xn.textContent,u=a.length;for(e=0;e=yu),um=\" \",im=!1;function tv(e,t){switch(e){case\"keyup\":return y1.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function nv(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var sa=!1;function p1(e,t){switch(e){case\"compositionend\":return nv(t);case\"keypress\":return t.which!==32?null:(im=!0,um);case\"textInput\":return e=t.data,e===um&&im?null:e;default:return null}}function b1(e,t){if(sa)return e===\"compositionend\"||!Hs&&tv(e,t)?(e=Pg(),ki=ws=Xn=null,sa=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function sm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fm(e,t){var n=sm(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sm(n)}}function iv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?iv(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ov(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=xr(e.document)}return t}function Gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var _1=On&&\"documentMode\"in document&&11>=document.documentMode,fa=null,Rr=null,pu=null,Dr=!1;function dm(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||fa==null||fa!==xr(l)||(l=fa,\"selectionStart\"in l&&Gs(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),pu&&Du(pu,l)||(pu=l,l=Do(Rr,\"onSelect\"),0>=i,a-=i,on=1<<32-Et(t)+a|n<_?(Y=A,A=null):Y=A.sibling;var M=r(v,A,h[_],S);if(M===null){A===null&&(A=Y);break}e&&A&&M.alternate===null&&t(v,A),d=u(M,d,_),C===null?O=M:C.sibling=M,C=M,A=Y}if(_===h.length)return n(v,A),H&&Sn(v,_),O;if(A===null){for(;__?(Y=A,A=null):Y=A.sibling;var F=r(v,A,M.value,S);if(F===null){A===null&&(A=Y);break}e&&A&&F.alternate===null&&t(v,A),d=u(F,d,_),C===null?O=F:C.sibling=F,C=F,A=Y}if(M.done)return n(v,A),H&&Sn(v,_),O;if(A===null){for(;!M.done;_++,M=h.next())M=m(v,M.value,S),M!==null&&(d=u(M,d,_),C===null?O=M:C.sibling=M,C=M);return H&&Sn(v,_),O}for(A=l(A);!M.done;_++,M=h.next())M=s(A,v,_,M.value,S),M!==null&&(e&&(Y=M.alternate,Y!==null&&A.delete(Y.key===null?_:Y.key)),d=u(M,d,_),C===null?O=M:C.sibling=M,C=M);return e&&A.forEach(function(Fe){return t(v,Fe)}),H&&Sn(v,_),O}function T(v,d,h,S){if(typeof h==\"object\"&&h!==null&&h.type===oa&&h.key===null&&h.props.ref===void 0&&(h=h.props.children),typeof h==\"object\"&&h!==null){switch(h.$$typeof){case bi:e:{for(var O=h.key;d!==null;){if(d.key===O){if(O=h.type,O===oa){if(d.tag===7){n(v,d.sibling),S=a(d,h.props.children),Bn(S,h),S.return=v,v=S;break e}}else if(d.elementType===O||typeof O==\"object\"&&O!==null&&O.$$typeof===Yn&&Sl(O)===d.type){n(v,d.sibling),S=a(d,h.props),Bn(S,h),S.return=v,v=S;break e}n(v,d);break}else t(v,d);d=d.sibling}h.type===oa?(S=Al(h.props.children,v.mode,S,h.key),Bn(S,h),S.return=v,v=S):(S=Qi(h.type,h.key,h.props,null,v.mode,S),Bn(S,h),S.return=v,v=S)}return i(v);case fu:e:{for(O=h.key;d!==null;){if(d.key===O)if(d.tag===4&&d.stateNode.containerInfo===h.containerInfo&&d.stateNode.implementation===h.implementation){n(v,d.sibling),S=a(d,h.children||[]),S.return=v,v=S;break e}else{n(v,d);break}else t(v,d);d=d.sibling}S=$c(h,v.mode,S),S.return=v,v=S}return i(v);case Yn:return h=Sl(h),T(v,d,h,S)}if(du(h))return p(v,d,h,S);if(uu(h)){if(O=uu(h),typeof O!=\"function\")throw Error(E(150));return h=O.call(h),b(v,d,h,S)}if(typeof h.then==\"function\")return T(v,d,Ci(h),S);if(h.$$typeof===an)return T(v,d,_i(v,h),S);Mi(v,h)}return typeof h==\"string\"&&h!==\"\"||typeof h==\"number\"||typeof h==\"bigint\"?(h=\"\"+h,d!==null&&d.tag===6?(n(v,d.sibling),S=a(d,h),S.return=v,v=S):(n(v,d),S=Fc(h,v.mode,S),S.return=v,v=S),i(v)):n(v,d)}return function(v,d,h,S){try{Hu=0;var O=T(v,d,h,S);return Ta=null,O}catch(A){if(A===ja||A===jo)throw A;var C=ct(29,A,null,v.mode);return C.lanes=S,C.return=v,C}}}var wl=Tv(!0),Nv=Tv(!1),kn=!1;function Qs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Br(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(X&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=fo(e),gv(e,null,n),t}return Yo(e,l,t,n),fo(e)}function Su(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Vg(e,n)}}function Pc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?a=u=i:u=u.next=i,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qr=!1;function Eu(){if(qr){var e=Ea;if(e!==null)throw e}}function Tu(e,t,n,l){qr=!1;var a=e.updateQueue;kn=!1;var u=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,f=c.next;c.next=null,i===null?u=f:i.next=f,i=c;var g=e.alternate;g!==null&&(g=g.updateQueue,o=g.lastBaseUpdate,o!==i&&(o===null?g.firstBaseUpdate=f:o.next=f,g.lastBaseUpdate=c))}if(u!==null){var m=a.baseState;i=0,g=f=c=null,o=u;do{var r=o.lane&-536870913,s=r!==o.lane;if(s?(B&r)===r:(l&r)===r){r!==0&&r===Dl&&(qr=!0),g!==null&&(g=g.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var p=e,b=o;r=t;var T=n;switch(b.tag){case 1:if(p=b.payload,typeof p==\"function\"){m=p.call(T,m,r);break e}m=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=b.payload,r=typeof p==\"function\"?p.call(T,m,r):p,r==null)break e;m=ue({},m,r);break e;case 2:kn=!0}}r=o.callback,r!==null&&(e.flags|=64,s&&(e.flags|=8192),s=a.callbacks,s===null?a.callbacks=[r]:s.push(r))}else s={lane:r,tag:o.tag,payload:o.payload,callback:o.callback,next:null},g===null?(f=g=s,c=m):g=g.next=s,i|=r;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;s=o,o=s.next,s.next=null,a.lastBaseUpdate=s,a.shared.pending=null}}while(!0);g===null&&(c=m),a.baseState=c,a.firstBaseUpdate=f,a.lastBaseUpdate=g,u===null&&(a.shared.lanes=0),sl|=i,e.lanes=i,e.memoizedState=m}}function Ov(e,t){if(typeof e!=\"function\")throw Error(E(191,e));e.call(t)}function Av(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eu?u:8;var i=R.T,o={};o.types=i!==null?i.types:null,R.T=o,af(e,!1,t,n);try{var c=a(),f=R.S;if(f!==null&&f(o,c),c!==null&&typeof c==\"object\"&&typeof c.then==\"function\"){var g=B1(c,l);Nu(e,t,g,Tt(e))}else Nu(e,t,l,Tt(e))}catch(m){Nu(e,t,{then:function(){},status:\"rejected\",reason:m},Tt())}finally{Z.p=u,i!==null&&o.types!==null&&(i.types=o.types),R.T=i}}function Q1(){}function Qr(e,t,n,l){if(e.tag!==5)throw Error(E(476));var a=Fv(e).queue;Iv(e,a,t,Ol,n===null?Q1:function(){return $v(e),n(l)})}function Fv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ol,baseState:Ol,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_n,lastRenderedState:Ol},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_n,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $v(e){var t=Fv(e);t.next===null&&(t=e.alternate.memoizedState),Nu(e,t.next.queue,{},Tt())}function lf(){return qe(Ba)}function Wv(){return Ee().memoizedState}function Pv(){return Ee().memoizedState}function X1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=Wn(n);var l=Pn(t,e,n);l!==null&&(rt(l,t,n),Su(l,t,n)),t={cache:Ys()},e.payload=t;return}t=t.return}}function Z1(e,t,n){var l=Tt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ko(e)?ty(t,n):(n=Bs(e,t,n,l),n!==null&&(rt(n,e,l),ny(n,t,l)))}function ey(e,t,n){var l=Tt();Nu(e,t,n,l)}function Nu(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ko(e))ty(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,o=u(i,n);if(a.hasEagerState=!0,a.eagerState=o,Nt(o,i))return Yo(e,t,a,0),ae===null&&Vo(),!1}catch{}if(n=Bs(e,t,a,l),n!==null)return rt(n,e,l),ny(n,t,l),!0}return!1}function af(e,t,n,l){if(l={lane:2,revertLane:yf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ko(e)){if(t)throw Error(E(479))}else t=Bs(e,n,l,2),t!==null&&rt(t,e,2)}function Ko(e){var t=e.alternate;return e===w||t!==null&&t===w}function ty(e,t){Na=bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ny(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Vg(e,n)}}var Eo={readContext:qe,use:Xo,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useLayoutEffect:he,useInsertionEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useSyncExternalStore:he,useId:he,useHostTransitionStatus:he,useFormState:he,useActionState:he,useOptimistic:he,useMemoCache:he,useCacheRefresh:he,useEffectEvent:he},ly={readContext:qe,use:Xo,useCallback:function(e,t){return nt().memoizedState=[e,t===void 0?null:t],e},useContext:qe,useEffect:Cm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ji(4194308,4,Qv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ji(4194308,4,e,t)},useInsertionEffect:function(e,t){Ji(4,2,e,t)},useMemo:function(e,t){var n=nt();t=t===void 0?null:t;var l=e();if(Ul){Qn(!0);try{e()}finally{Qn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=nt();if(n!==void 0){var a=n(t);if(Ul){Qn(!0);try{n(t)}finally{Qn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Z1.bind(null,w,e),[l.memoizedState,e]},useRef:function(e){var t=nt();return e={current:e},t.memoizedState=e},useState:function(e){e=kr(e);var t=e.queue,n=ey.bind(null,w,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:tf,useDeferredValue:function(e,t){var n=nt();return nf(n,e,t)},useTransition:function(){var e=kr(!1);return e=Iv.bind(null,w,e.queue,!0,!1),nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=w,a=nt();if(H){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),ae===null)throw Error(E(349));(B&127)!==0||xv(l,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,Cm(Dv.bind(null,l,u,e),[e]),l.flags|=2048,Ra(9,{destroy:void 0},Rv.bind(null,l,u,n,t),null),n},useId:function(){var e=nt(),t=ae.identifierPrefix;if(H){var n=cn,l=on;n=(l&~(1<<32-Et(l)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=So++,0<\\/script>\",u=u.removeChild(u.firstChild);break;case\"select\":u=typeof l.is==\"string\"?i.createElement(\"select\",{is:l.is}):i.createElement(\"select\"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is==\"string\"?i.createElement(a,{is:l.is}):i.createElement(a)}}u[Be]=t,u[ft]=l;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=u;e:switch(ke(u,a,l),a){case\"button\":case\"input\":case\"select\":case\"textarea\":l=!!l.autoFocus;break e;case\"img\":l=!0;break e;default:l=!1}l&&bn(t)}}return fe(t),t.subtreeFlags&=-33554433,lr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&bn(t);else{if(typeof l!=\"string\"&&t.stateNode===null)throw Error(E(166));if(e=Fn.current,ta(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=De,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Be]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||eh(e.nodeValue,n)),e||ol(t,!0)}else e=Vu(e).createTextNode(l),e[Be]=t,t.stateNode=e}return fe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=ta(t),n!==null){if(e===null){if(!l)throw Error(E(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(557));e[Be]=t}else Ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;fe(t),e=!1}else n=Wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(E(558))}return fe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ta(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(E(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(E(317));a[Be]=t}else Ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;fe(t),a=!1}else a=Wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Di(t,t.updateQueue),fe(t),null);case 4:return Ca(),e===null&&hf(t.stateNode.containerInfo),t.flags|=67108864,fe(t),null;case 10:return Nn(t.type),fe(t),null;case 19:if(Zs(t),l=t.memoizedState,l===null)return fe(t),null;if(a=(t.flags&128)!==0,u=l.rendering,u===null)if(a)ou(l,!1);else{if(pe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=po(e),u!==null){for(t.flags|=128,ou(l,!1),e=u.updateQueue,t.updateQueue=e,Di(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vv(n,e),n=n.sibling;return Gu(t,Ye.current&1|2),H&&Sn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&bt()>Co&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304)}else{if(!a)if(e=po(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Di(t,e),ou(l,!0),l.tail===null&&l.tailMode!==\"collapsed\"&&l.tailMode!==\"visible\"&&!u.alternate&&!H)return fe(t),null}else 2*bt()-l.renderingStartTime>Co&&n!==536870912&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=bt(),e.sibling=null,u=Ye.current,u=a?u&1|2:u&1,l.tailMode===\"visible\"||l.tailMode===\"collapsed\"||!n||H?Gu(t,u):(n=u,me(je,t),me(Ye,n),Ze===null&&(Ze=t)),H&&Sn(t,l.treeForkCount),e}return fe(t),null;case 22:case 23:return yt(t),Xs(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(fe(t),t.subtreeFlags&6&&(t.flags|=8192)):fe(t),n=t.updateQueue,n!==null&&Di(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Ve(zl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Nn(Oe),fe(t),null;case 25:return null;case 30:return t.flags|=33554432,fe(t),null}throw Error(E(156,t.tag))}function P1(e,t){switch(Vs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nn(Oe),Ca(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return oo(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(E(340));Ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));Ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zs(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ca(),null;case 10:return Nn(t.type),null;case 22:case 23:return yt(t),Xs(),e!==null&&Ve(zl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Nn(Oe),null;case 25:return null;default:return null}}function gy(e,t){switch(Vs(t),t.tag){case 3:Nn(Oe),Ca();break;case 26:case 27:case 5:oo(t);break;case 4:Ca();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:Zs(t);break;case 10:Nn(t.type);break;case 22:case 23:yt(t),Xs(),e!==null&&Ve(zl);break;case 24:Nn(Oe)}}function Pu(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var u=n.create,i=n.inst;l=u(),i.destroy=l}n=n.next}while(n!==a)}}catch(o){P(t,t.return,o)}}function rl(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var u=a.next;l=u;do{if((l.tag&e)===e){var i=l.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,a=t;var c=n,f=o;try{f()}catch(g){P(a,c,g)}}}l=l.next}while(l!==u)}}catch(g){P(t,t.return,g)}}function vy(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Av(t,n)}catch(l){P(e,e.return,l)}}}function yy(e,t,n){n.props=Hl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){P(e,t,l)}}function nn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var a=e.stateNode,u=An(e.memoizedProps,a);(a.ref===null||a.ref.name!==u)&&(a.ref=ih(u)),l=a.ref;break;case 7:if(e.stateNode===null){var i=new Ot(e);st(e.child,!1,Yb,i,void 0,void 0),e.stateNode=i}l=e.stateNode;break;default:l=e.stateNode}typeof n==\"function\"?e.refCleanup=n(l):n.current=l}}catch(o){P(e,t,o)}}function Le(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l==\"function\")try{l()}catch(a){P(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(a){P(e,t,a)}else n.current=null}function No(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title\"))),ke(l,t,n),l[Be]=e,Re(l),t=l;break e;case\"link\":if(u=yg(\"link\",\"href\",a).get(t+(n.href||\"\"))){for(i=0;iT&&(i=T,T=b,b=i);var v=fm(o,b),d=fm(o,T);if(v&&d&&(s.rangeCount!==1||s.anchorNode!==v.node||s.anchorOffset!==v.offset||s.focusNode!==d.node||s.focusOffset!==d.offset)){var h=m.createRange();h.setStart(v.node,v.offset),s.removeAllRanges(),b>T?(s.addRange(h),s.extend(d.node,d.offset)):(h.setEnd(d.node,d.offset),s.addRange(h))}}}}for(m=[],s=o;s=s.parentNode;)s.nodeType===1&&m.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof o.focus==\"function\"&&o.focus(),o=0;on?32:n,R.T=null,n=rs,rs=null;var u=Xt,i=sn;if(ye=0,Gl=Xt=null,sn=0,(X&6)!==0)throw Error(E(331));var o=X;if(X|=4,Hy(u.current),Dy(u,u.current,i,n),X=o,ei(0,!1),St&&typeof St.onPostCommitFiberRoot==\"function\")try{St.onPostCommitFiberRoot(Zu,u)}catch{}return!0}finally{Z.p=a,R.T=l,Ky(e,t)}}function Fm(e,t,n){t=Ht(n,t),t=Zr(e.stateNode,t,2),e=Pn(e,t,2),e!==null&&(Ju(e,2),mn(e))}function P(e,t,n){if(e.tag===3)Fm(e,e,n);else for(;t!==null;){if(t.tag===3){Fm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof l.componentDidCatch==\"function\"&&(nl===null||!nl.has(l))){e=Ht(n,e),n=cy(2),l=Pn(t,n,2),l!==null&&(ry(n,l,t,e),Ju(l,2),mn(l));break}}t=t.return}}function cr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new lb;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(gf=!0,a.add(n),e=fb.bind(null,e,t,n),t.then(e,e))}function fb(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ae===e&&(B&n)===n&&((pe===4||pe===3&&(B&62914560)===B&&300>bt()-Io)&&(X&2)===0?Ua(e,0):_o|=n,Da===B&&(Da=0)),mn(e)}function Jy(e,t){t===0&&(t=Bg()),e=Vl(e,t),e!==null&&(Ju(e,t),mn(e))}function db(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jy(e,n)}function mb(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(E(314))}l!==null&&l.delete(t),Jy(e,n)}function gb(e,t){return Cs(e,t)}var Ha=null,ua=null,gs=!1,Ro=!1,rr=!1,In=0;function mn(e){e!==ua&&e.next===null&&(ua===null?Ha=ua=e:ua=ua.next=e),Ro=!0,gs||(gs=!0,yb())}function ei(e,t){if(!rr&&Ro){rr=!0;do for(var n=!1,l=Ha;l!==null;){if(!t)if(e!==0){var a=l.pendingLanes;if(a===0)var u=0;else{var i=l.suspendedLanes,o=l.pingedLanes;u=(1<<31-Et(42|e)+1)-1,u&=a&~(i&~o),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,$m(l,u))}else u=B,u=Ho(l,l===ae?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Ku(l,u)||(n=!0,$m(l,u));l=l.next}while(n);rr=!1}}function vb(){Iy()}function Iy(){Ro=gs=!1;var e=0;In!==0&&Ab()&&(e=In);for(var t=bt(),n=null,l=Ha;l!==null;){var a=l.next,u=Fy(l,t);u===0?(l.next=null,n===null?Ha=a:n.next=a,a===null&&(ua=n)):(n=l,(e!==0||(u&3)!==0)&&(Ro=!0)),l=a}ye!==0&&ye!==5||ei(e,!1),In!==0&&(In=0)}function Fy(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0o)break;var g=c.transferSize,m=c.initiatorType;g&&lg(m)&&(c=c.responseEnd,i+=g*(cno){b.length=p;break}h=new Promise(Rb.bind(h)),b.push(h)}}}if(0\"u\"?null:document;function gh(e,t,n){var l=Za;if(l&&typeof t==\"string\"&&t){var a=Ut(t);a='link[rel=\"'+e+'\"][href=\"'+a+'\"]',typeof n==\"string\"&&(a+='[crossorigin=\"'+n+'\"]'),mg.has(a)||(mg.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement(\"link\"),ke(t,\"link\",e),Re(t),l.head.appendChild(t)))}}function Fb(e){Dn.D(e),gh(\"dns-prefetch\",e,null)}function $b(e,t){Dn.C(e,t),gh(\"preconnect\",e,t)}function Wb(e,t,n){Dn.L(e,t,n);var l=Za;if(l&&e&&t){var a='link[rel=\"preload\"][as=\"'+Ut(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(a+='[imagesrcset=\"'+Ut(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(a+='[imagesizes=\"'+Ut(n.imageSizes)+'\"]')):a+='[href=\"'+Ut(e)+'\"]';var u=a;switch(t){case\"style\":u=La(e);break;case\"script\":u=Ka(e)}if(!(Bt.has(u)||(e=ue({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),Bt.set(u,e),l.querySelector(a)!==null||t===\"style\"&&l.querySelector(ti(u))||t===\"script\"&&l.querySelector(ni(u))))){var i=l.createElement(\"link\");ke(i,\"link\",e),t===\"style\"&&(i[ro]=!0,i.onload=i.onerror=function(){jg(i)}),Re(i),l.head.appendChild(i)}}}function Pb(e,t){Dn.m(e,t);var n=Za;if(n&&e){var l=t&&typeof t.as==\"string\"?t.as:\"script\",a='link[rel=\"modulepreload\"][as=\"'+Ut(l)+'\"][href=\"'+Ut(e)+'\"]',u=a;switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":u=Ka(e)}if(!Bt.has(u)&&(e=ue({rel:\"modulepreload\",href:e},t),Bt.set(u,e),n.querySelector(a)===null)){switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(ni(u)))return}l=n.createElement(\"link\"),ke(l,\"link\",e),Re(l),n.head.appendChild(l)}}}function eS(e,t,n){Dn.S(e,t,n);var l=Za;if(l&&e){var a=pa(l).hoistableStyles,u=La(e);t=t||\"default\";var i=a.get(u);if(!i){var o={loading:0,preload:null};if(i=l.querySelector(ti(u)))o.loading=5;else{e=ue({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=Bt.get(u))&&Ef(e,n);var c=i=l.createElement(\"link\");Re(c),ke(c,\"link\",e),c._p=new Promise(function(f,g){c.onload=f,c.onerror=g}),c.addEventListener(\"load\",function(){o.loading|=1}),c.addEventListener(\"error\",function(){o.loading|=2}),o.loading|=4,eo(i,t,l)}i={type:\"stylesheet\",instance:i,count:1,state:o},a.set(u,i)}}}function tS(e,t){Dn.X(e,t);var n=Za;if(n&&e){var l=pa(n).hoistableScripts,a=Ka(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ue({src:e,async:!0},t),(t=Bt.get(a))&&Tf(e,t),u=n.createElement(\"script\"),Re(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function nS(e,t){Dn.M(e,t);var n=Za;if(n&&e){var l=pa(n).hoistableScripts,a=Ka(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ue({src:e,async:!0,type:\"module\"},t),(t=Bt.get(a))&&Tf(e,t),u=n.createElement(\"script\"),Re(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function gg(e,t,n,l){var a=(a=Fn.current)?Yu(a):null;if(!a)throw Error(E(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(n=La(n.href),t=pa(a).hoistableStyles,l=t.get(n),l||(l={type:\"style\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=La(n.href);var u=pa(a).hoistableStyles,i=u.get(e);if(i||(a=a.ownerDocument||a,i={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,i),(u=a.querySelector(ti(e)))?u._p||(i.instance=u,i.state.loading=5):(u=Bt.get(e),u||(u={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Bt.set(e,u)),lS(a,e,u,i.state))),t&&l===null)throw Error(E(528,\"\"));return i}if(t&&l!==null)throw Error(E(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(n=Ka(n),t=pa(a).hoistableScripts,l=t.get(n),l||(l={type:\"script\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};default:throw Error(E(444,e))}}function La(e){return'href=\"'+Ut(e)+'\"'}function ti(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function vh(e){return ue({},e,{\"data-precedence\":e.precedence,precedence:null})}function lS(e,t,n,l){if(t=e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")){if(t[ro]!==!0){l.loading=1;return}}else t=e.createElement(\"link\"),t[ro]=!0,t.onload=t.onerror=jg.bind(null,t),ke(t,\"link\",n),Re(t),e.head.appendChild(t);l.preload=t,t.addEventListener(\"load\",function(){return l.loading|=1}),t.addEventListener(\"error\",function(){return l.loading|=2})}function Ka(e){return'[src=\"'+Ut(e)+'\"]'}function ni(e){return\"script[async]\"+e}function vg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var l=e.querySelector('style[data-href~=\"'+Ut(n.href)+'\"]');if(l)return t.instance=l,Re(l),l;var a=ue({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement(\"style\"),Re(l),ke(l,\"style\",a),eo(l,n.precedence,e),t.instance=l;case\"stylesheet\":a=La(n.href);var u=e.querySelector(ti(a));if(u)return t.state.loading|=4,t.instance=u,Re(u),u;l=vh(n),(a=Bt.get(a))&&Ef(l,a),u=(e.ownerDocument||e).createElement(\"link\"),Re(u);var i=u;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),t.state.loading|=4,eo(u,n.precedence,e),t.instance=u;case\"script\":return u=Ka(n.src),(a=e.querySelector(ni(u)))?(t.instance=a,Re(a),a):(l=n,(a=Bt.get(u))&&(l=ue({},n),Tf(l,a)),e=e.ownerDocument||e,a=e.createElement(\"script\"),Re(a),ke(a,\"link\",l),e.head.appendChild(a),t.instance=a);case\"void\":return null;default:throw Error(E(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,eo(l,n.precedence,e));return t.instance}function eo(e,t,n){for(var l=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,u=a,i=0;i title\"):null)}function aS(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function hg(e,t){return e===\"img\"&&t.src!=null&&t.src!==\"\"&&t.onLoad==null&&t.loading!==\"lazy\"}function yh(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function hh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==\"number\"?devicePixelRatio:1)*.25}function pg(e,t){typeof t.decode==\"function\"&&(e.imgCount++,t.complete||(e.imgBytes+=hh(t),e.suspenseyImages.push(t)),e=oS.bind(e),t.decode().then(e,e))}function uS(e,t,n,l){if(n.type===\"stylesheet\"&&(typeof l.media!=\"string\"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=La(l.href),u=t.querySelector(ti(a));if(u){t=u._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=ku.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,Re(u);return}u=t.ownerDocument||t,l=vh(l),(a=Bt.get(a))&&Ef(l,a),u=u.createElement(\"link\"),Re(u);var i=u;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ku.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var no=0;function iS(e,t){return e.stylesheets&&e.count===0&&lo(e,e.stylesheets),0no?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function ph(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lo(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ku(){this.count--,ph(this)}function oS(){this.imgCount--,ph(this)}var wo=null;function lo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wo=new Map,t.forEach(cS,e),wo=null,ku.call(e))}function cS(e,t){if(!(t.state.loading&4)){var n=wo.get(e);if(n)var l=n.get(null);else{n=new Map,wo.set(e,n);for(var a=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),u=0;u{\"use strict\";function _h(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_h)}catch(e){console.error(e)}}_h(),Ch.exports=zh()});var Rh=$t(tc=>{\"use strict\";var yS=Symbol.for(\"react.transitional.element\"),hS=Symbol.for(\"react.fragment\");function xh(e,t,n){var l=null;if(n!==void 0&&(l=\"\"+n),t.key!==void 0&&(l=\"\"+t.key),\"key\"in t){n={};for(var a in t)a!==\"key\"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:yS,type:e,key:l,ref:t!==void 0?t:null,props:n}}tc.Fragment=hS;tc.jsx=xh;tc.jsxs=xh});var J=$t((oE,Dh)=>{\"use strict\";Dh.exports=Rh()});var yn={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1},N0=[\"RETIRED\",\"CONFLICT\",\"NOT_FOUND\",\"DOCUMENT_TOO_LARGE\",\"STORAGE_FAILURE\",\"ORIGIN_NOT_DECLARED\",\"MESSAGE_TOO_LARGE\",\"PAGE_TOO_LARGE\",\"PATCH_TOO_LARGE\",\"DEADLINE\",\"INVALID_STEPS\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"CONFIGURATION_REQUIRED\",\"NOT_READY\",\"UNKNOWN_METHOD\",\"INVALID_ARGUMENT\",\"QUOTA_EXCEEDED\",\"PROTOCOL_MISMATCH\",\"APPLET_INCOMPATIBLE\",\"ENVELOPE_INVALID\",\"CONTEXT_REPLACED\",\"TARGET_NOT_FOUND\",\"PRECONDITION_FAILED\",\"ASYNC_READ\",\"AUTH_REQUIRED\",\"REJECTED\"];function Pf(e){return typeof e==\"string\"&&N0.includes(e)}var O0=/^:[A-Za-z][A-Za-z0-9_]*$/,A0=/^[A-Za-z0-9_.~@-]+$/,yc=new Map;function z0(e){if(yc.has(e))return yc.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),l=n.at(-1)===\"*\";l&&n.pop();let a=[],u=!0;for(let i of n)O0.test(i)?a.push({param:i.slice(1)}):A0.test(i)&&i!==\".\"&&i!==\"..\"?a.push({literal:i}):u=!1;u&&(t={segments:a,rest:l})}return yc.set(e,t),t}function Te(e){try{return new URL(e).href}catch{return null}}function yl(e,t){let n=_0(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let l;try{l=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}l.at(-1)===\"\"&&l.pop();for(let a of e.routes){let u=z0(a.pattern);if(!u)continue;let i=C0(u,l);if(!i||!(a.query??[]).every(c=>n.searchParams.has(c)))continue;for(let c of a.query??[])i[c]=n.searchParams.get(c);let o={kind:\"route\",routeId:a.id,page:a.page,screen:a.screen,params:i};return a.context!==void 0&&(o.context=a.context),o}return{kind:\"website\",url:t}}function _0(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function C0(e,t){if(e.rest?t.lengthb.id===u.id)?.startUrl;f={index:o.index,start:p!==void 0&&Te(p)===Te(t.view.url),url:s}}}else t.status===\"ready\"&&t.account!==null&&c===\"auth\"&&(c=\"none\",f=null);o.page.status===\"ready\"&&(t.status===\"loading\"||t.status===\"error\")&&(g++,m=!1,l.push({type:\"schedule\",id:u.id,token:g}));let r={...o,seen:Math.max(o.seen,t.view.n),pin:c,signIn:f,deadline:g,page:{status:t.status,pageId:t.pageId,routeId:t.routeId,view:t.view,stale:t.stale,expired:m}};return{state:vl($f(e,u,r),r),effects:l}}case\"deadline\":{let u=e.contexts[t.id];return!u||t.token!==u.deadline||u.page.status===\"ready\"||u.page.expired?a:{state:vl(e,{...u,page:{...u.page,expired:!0}}),effects:l}}case\"user.viewWebsite\":{let u=e.contexts[t.id];return!u||u.pin===\"user\"?a:{state:vl(e,{...u,pin:\"user\"}),effects:l}}case\"user.done\":{let u=e.contexts[t.id];if(!u)return a;if(u.pin===\"auth\"&&u.signIn)return Jf(e,u,n)??a;let i=u.pin===\"none\"?u:{...u,pin:\"none\"},o=i===u?e:vl(e,i);if(di(i,n)!==\"website\")return{state:o,effects:l};if(i.canGoBack)l.push({type:\"context.back\",id:u.id});else{let c=n.contexts.find(f=>f.id===u.id)?.startUrl;c&&l.push({type:\"context.navigate\",id:u.id,url:c,mode:\"push\"})}return{state:o,effects:l}}case\"navigate.url\":{let u=t.context??e.active;return e.contexts[u]?(l.push({type:\"context.navigate\",id:u,url:t.url,mode:t.mode}),{state:{...e,active:u,overlay:[],leaveGuard:null},effects:l}):a}case\"navigate.screen\":{let u=t.mode===\"root\"?[t.screen]:t.mode===\"replace\"?[...e.overlay.slice(0,-1),t.screen]:[...e.overlay,t.screen];return{state:{...e,overlay:u,leaveGuard:null},effects:l}}case\"select\":{let u=e.contexts[t.id];if(!u)return a;if(t.id!==e.active||e.overlay.length>0)return{state:{...e,active:t.id,overlay:[],leaveGuard:null},effects:l};let i=n.contexts.find(o=>o.id===t.id)?.startUrl;return i&&(u.url===null||Te(u.url)!==Te(i))&&l.push({type:\"context.navigate\",id:t.id,url:i,mode:\"push\"}),{state:{...e,leaveGuard:null},effects:l}}case\"back\":{if(e.leaveGuard)return{state:e,effects:[{type:\"confirmLeave\",message:e.leaveGuard.message}]};if(e.overlay.length>0)return{state:{...e,overlay:e.overlay.slice(0,-1)},effects:l};let u=e.contexts[e.active];return u?.pin===\"auth\"&&u.signIn?Jf(e,u,n)??{state:e,effects:[{type:\"leave\"}]}:e.contexts[e.active]?.canGoBack?{state:e,effects:[{type:\"context.back\",id:e.active}]}:{state:e,effects:[{type:\"leave\"}]}}case\"guard\":return{state:{...e,leaveGuard:t.guard},effects:l};case\"context.gone\":{let u=e.contexts[t.id];return u?{state:vl(e,{...u,page:{...pc,status:\"unsupported\"}}),effects:l}:a}}}function Jf(e,t,n){let{index:l,start:a}=t.signIn,u=n.contexts[0].id,i=vl(e,{...t,pin:\"none\",signIn:null});if(!a&&l>0){let o=Math.max(1,t.index-l+1);return{state:i,effects:[{type:\"context.back\",id:t.id,steps:o}]}}return t.id===u?null:{state:{...i,active:u,overlay:[],leaveGuard:null},effects:[]}}function If(e,t,n){return t===e.generation&&e.url!==null&&Te(n)===Te(e.url)}function Ff(e,t,n,l){let a=e.deadline+1;return l.push({type:\"schedule\",id:e.id,token:a}),{...e,url:n,seen:t===e.generation?e.seen:-1,generation:t,page:pc,deadline:a}}function $f(e,t,n){return!e.leaveGuard||t.id!==e.active||e.overlay.length>0||t.index===n.index&&t.url!==null&&n.url!==null&&Te(t.url)===Te(n.url)?e:{...e,leaveGuard:null}}function vl(e,t){return{...e,contexts:{...e.contexts,[t.id]:t}}}function bc(e){let t={};for(let[n,l]of Object.entries(e.contexts))t[n]={url:l.url};return{version:yn.sessionState,state:{active:e.active,overlay:e.overlay,contexts:t}}}function nd(e,t){let n=M0(t);if(!e||e.version!==yn.sessionState||!eu(e.state))return n;let{active:l,overlay:a,contexts:u}=e.state,i={...n,contexts:{...n.contexts}};if(typeof l==\"string\"&&i.contexts[l]&&(i.active=l),Array.isArray(a)&&(i.overlay=a.filter(o=>R0(o,t.foreground.screens))),eu(u))for(let o of Object.keys(i.contexts)){let c=eu(u[o])?u[o].url:void 0;typeof c==\"string\"&&(i.contexts[o]=ed(o,c))}return i}function R0(e,t){return eu(e)&&typeof e.key==\"string\"&&typeof e.id==\"string\"&&t.includes(e.id)&&eu(e.params)&&Object.values(e.params).every(n=>typeof n==\"string\")}function eu(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var XS=yn.bundleFormat,hc=\"(0|[1-9]\\\\d*)\",Wf=\"(?:0|[1-9]\\\\d*|\\\\d*[A-Za-z-][0-9A-Za-z-]*)\",ZS=new RegExp(`^${hc}\\\\.${hc}\\\\.${hc}(?:-(${Wf}(?:\\\\.${Wf})*))?$`),te=class extends Error{code;constructor(e,t){super(t),this.name=\"GenesisError\",this.code=e}},D0=2e3;function Sc(e,t){return new Promise((n,l)=>{let a=null,u=!1,i=1,o=new Map,c=new Map,f={get bound(){return a},get retired(){return u},request(s,p={}){if(u)return Promise.reject(new te(\"RETIRED\",\"This page was closed\"));let b=i++;return new Promise((T,v)=>{let d=setTimeout(()=>{o.delete(b),v(new te(\"DEADLINE\",`${s} did not answer in time`))},a.limits.rpcDeadlineMs+D0);o.set(b,{resolve:T,reject:v,timer:d}),e.postMessage(JSON.stringify({type:\"request\",documentId:a.documentId,requestId:b,method:s,params:p}))})},on(s,p){let b=c.get(s);return b||c.set(s,b=new Set),b.add(p),()=>{b.delete(p)}}};function g(){u=!0;for(let s of o.values())clearTimeout(s.timer),s.reject(new te(\"RETIRED\",\"This page was closed\"));o.clear()}function m(s,p){for(let b of[...c.get(s)??[]])try{b(p)}catch(T){console.error(`Genesis ${s} handler failed`,T)}}e.addEventListener(\"message\",s=>{if(u||typeof s.data!=\"string\")return;let p;try{p=JSON.parse(s.data)}catch{return}if(p?.type===\"refused\"&&!a){u=!0,l(new te(p.error?.code??\"PROTOCOL_MISMATCH\",p.error?.message??\"The host refused this page\"));return}if(p?.type===\"bound\"){if(a)return;a=p,n(f);return}if(!(!a||p?.documentId!==a.documentId))if(p.type===\"response\"){let b=o.get(p.requestId);if(!b)return;o.delete(p.requestId),clearTimeout(b.timer),p.error?b.reject(new te(p.error.code,p.error.message)):b.resolve(p.result??null)}else p.type===\"event\"&&(p.name===\"retired\"?(g(),m(\"retired\",{})):m(p.name,p.data))}),addEventListener(\"pagehide\",()=>{u||(m(\"pagehide\",{}),g())});let r={type:\"hello\",protocol:yn.protocol,url:t};e.postMessage(JSON.stringify(r))})}var w0={pageId:null,routeId:null,params:{}};function ad(e,t){let n={};for(let m of e)n[m]=U0();let l={account:null,contexts:n},a=!1,u=new Map;function i(m){let r=m===null?[...u.values()]:[u.get(null),...m.map(p=>u.get(p))],s=new Set;for(let p of r)for(let b of[...p??[]])s.has(b)||(s.add(b),b())}function o(m,r){l={...l,contexts:{...l.contexts,[m]:r}}}function c(m){let{entry:r}=m;if(!m.attached||m.status!==\"ready\"||!r||!Il(r.url,m.url))return;let{history:s}=m;for(s.delete(r.index),s.set(r.index,ud(m));s.size>t.historyEntriesMax;)s.delete(s.keys().next().value)}function f(m,r,s){if(r===void 0||s!==\"ready\"&&s!==\"auth\")return!1;if(!a)return a=!0,l.account!==r&&(l={...l,account:r}),!1;if(r===l.account)return!1;let p={};for(let[b,T]of Object.entries(l.contexts))T.history.clear(),p[b]=b===m||!T.content||T.stale?T:{...T,stale:!0};return l={account:r,contexts:p},c(p[m]),!0}let g=(m,r=!1)=>({outcome:m,accountChanged:r});return{state:()=>l,context:m=>l.contexts[m],applyPage(m,r,s){let p=l.contexts[m];if(!p||r=r.size||d===r.index&&!Il(h.url,r.url))&&b.delete(d)}let T={...p,generation:r.generation,entry:{index:r.index,url:r.url}},v;if(Il(p.url,r.url))p.attached&&p.view?.generation!==r.generation?v={...T,attached:!1,status:\"loading\",error:null,stale:p.content}:v=T;else{let d=b.get(r.index);v=d?{...T,...d,attached:!1,status:\"loading\",error:null,stale:!0,content:!0}:{...T,...s,url:r.url,regions:{},attached:!1,status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1}}o(m,v),c(v),i([m])},gone(m,r){let s=l.contexts[m];s&&(o(m,{...s,attached:!1,status:\"error\",error:r,stale:s.content}),i([m]))},subscribe(m,r){let s=r??null,p=u.get(s);return p||u.set(s,p=new Set),p.add(m),()=>{p.delete(m)}}}}function U0(){return{generation:0,view:null,epoch:0,seq:0,live:[],attached:!1,url:null,pageId:null,routeId:null,params:{},regions:{},status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1,entry:null,history:new Map}}function Il(e,t){return e!==null&&t!==null&&Te(e)===Te(t)}function ud(e){return{url:e.url,pageId:e.pageId,routeId:e.routeId,params:e.params,regions:e.regions}}function H0(e,t){if(e.content&&Il(e.url,t))return ud(e);let{entry:n}=e,l=n&&Il(n.url,t)?e.history.get(n.index):void 0;return l&&Il(l.url,t)?l:null}function id(e,t=Object.create(null)){for(let n of e)t[n.key]=n;return t}function od(e){return e.kind===\"single\"?{kind:\"single\",status:e.status,error:e.error??null,record:e.record}:{kind:\"collection\",status:e.status,error:e.error??null,order:e.items.map(t=>t.key),complete:e.complete,ephemeral:e.ephemeral===!0,records:id(e.items)}}function G0(e,t){let n={};for(let[l,a]of Object.entries(e)){let u=od(a),i=t[l];n[l]=i?L0(i,u):u}return n}var mi=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function L0(e,t){if(e.kind===\"single\"||t.kind===\"single\")return e.kind!==\"single\"||t.kind!==\"single\"?t:(mi(e.record,t.record)&&(t.record=e.record),e.record===t.record&&e.status===t.status&&mi(e.error,t.error)?e:t);let n=e.order.length===t.order.length&&e.complete===t.complete&&e.ephemeral===t.ephemeral&&e.status===t.status&&mi(e.error,t.error);for(let[l,a]of t.order.entries()){let u=e.records[a];u&&mi(u,t.records[a])?t.records[a]=u:n=!1,e.order[l]!==a&&(n=!1)}return n?e:t}function B0(e,t){let n=e.regions;for(let[l,a]of Object.entries(t)){let u=e.live.includes(l)?n[l]:void 0;if(!u)return null;let i;if(a.kind===\"replace\")i=od(a.region);else if(a.kind===\"single\"){if(u.kind!==\"single\")return null;i={...u,record:a.record,status:a.status??u.status,error:a.error===void 0?u.error:a.error}}else{if(u.kind!==\"collection\")return null;if(i={...u,complete:a.complete??u.complete,status:a.status??u.status,error:a.error===void 0?u.error:a.error},a.upsert?.length||a.remove?.length){i.records=id(a.upsert??[],Object.assign(Object.create(null),u.records));for(let o of a.remove??[])delete i.records[o]}if(a.order){i.order=a.order;let o=new Set(a.order);for(let c of Object.keys(i.records))o.has(c)||(i.records===u.records&&(i.records=Object.assign(Object.create(null),u.records)),delete i.records[c])}else if(a.remove?.length){let o=new Set(a.remove);i.order=u.order.filter(c=>!o.has(c))}}n===e.regions&&(n={...n}),n[l]=i}return n}var cd=class extends te{constructor(e,t){super(e,t),this.name=\"ServiceError\"}},q0=[\"CONFIGURATION_REQUIRED\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"SERVICE_UNREACHABLE\",\"DEADLINE\",\"SERVICE_FAILURE\",\"QUOTA_EXCEEDED\"];function Ec(e){let t=e?.code;return t&&q0.includes(t)?\"This feature is temporarily unavailable. Try again in a moment.\":e instanceof Error?e.message:\"Something went wrong. Please try again.\"}async function Tc(e=window.__genesisBridge){if(!e)throw new Error(\"Genesis bridge is missing; the foreground must run inside Genesis\");let t=await Sc(e,location.href),{compat:n}=t.bound;if(n.protocol!==yn.protocol||n.sessionState!==yn.sessionState)throw new te(\"PROTOCOL_MISMATCH\",\"This applet was built for another Genesis version\");return X0(t)}var V0=500,Y0=1e3,k0=64,j0=2e3,Q0=Object.freeze([]),ld=e=>e===void 0?null:Array.isArray(e)?e:[e];function X0(e){let{manifest:t,appletId:n,limits:l,session:a}=e.bound,u=t.contexts.map(y=>y.id),i=ad(u,{historyEntriesMax:l.historyEntriesMax}),o=(y,N)=>e.request(y,N).catch(z=>{e.retired||console.error(`Genesis ${y} failed`,z)}),c=nd(a,t),f=new Set,g=null,m=new Set;function r(y){let N=td(c,y,t),z=N.state!==c;c=N.state;let x=N.effects.filter(k=>!s(k));if(z){O=void 0,h();for(let k of[...f])k()}return x}function s(y){switch(y.type){case\"reveal\":return o(\"context.reveal\",{id:y.id}),!0;case\"cover\":return o(\"context.cover\"),!0;case\"context.navigate\":return fi(y.id),o(\"context.navigate\",{id:y.id,url:y.url,mode:y.mode}),!0;case\"context.back\":return fi(y.id),o(\"context.back\",y.steps?{id:y.id,steps:y.steps}:{id:y.id}),!0;case\"context.reload\":return fi(y.id),o(\"context.reload\",{id:y.id}),!0;case\"schedule\":return setTimeout(()=>r({type:\"deadline\",id:y.id,token:y.token}),l.documentReadyMs),!0;case\"leave\":case\"confirmLeave\":return!1}}function p(y,N){g?g(y,N):window.confirm(y)&&N()}function b(y){let N=c.leaveGuard;if(!N)return y();p(N.message,()=>{r({type:\"guard\",guard:null}),y()})}function T(y){let N=!0;for(let z of r({type:\"back\"}))if(z.type===\"leave\")N=!1;else if(z.type===\"confirmLeave\"){let x=()=>{r({type:\"guard\",guard:null}),!T(!1)&&y&&o(\"back.leave\")};setTimeout(()=>p(z.message,x),0)}return N}let v=null,d=a?JSON.stringify(bc(c)):\"\";function h(){v===null&&(v=setTimeout(S,V0))}function S(){v!==null&&clearTimeout(v),v=null;let y=bc(c),N=JSON.stringify(y);N!==d&&(d=N,o(\"session.save\",y))}e.on(\"suspended\",S);let O;function C(){if(O!==void 0)return O;let y=c.overlay[c.overlay.length-1],N=c.contexts[c.active],z=null;if(y)z={key:y.key,id:y.id,params:y.params,context:c.active,overlay:!0};else if(N?.url){let x=yl(t,N.url);x.kind===\"route\"&&(z={key:`${N.id}:${N.index}`,id:x.screen,params:x.params,context:N.id,overlay:!1})}return O=z}let A=1,_=new Set(c.overlay.map(y=>y.key));function Y(){let y;do y=`s${A++}`;while(_.has(y));return _.add(y),y}function M(y){if(\"screen\"in y){let Ft={key:Y(),id:y.screen,params:y.params??{}};b(()=>r({type:\"navigate.screen\",screen:Ft,mode:y.mode??\"push\"}));return}let z=c.contexts[c.active]?.url??t.contexts[0].startUrl,x;try{x=new URL(y.url,z).href}catch{throw new te(\"INVALID_ARGUMENT\",`Not a URL: ${y.url}`)}let k=y.context??F(x);if(!c.contexts[k])throw new te(\"NOT_FOUND\",`No context ${k}`);let We=c.contexts[k].url;if(We!==null&&Te(We)===Te(x)&&(y.mode??\"push\")===\"push\"){(k!==c.active||c.overlay.length>0)&&b(()=>r({type:\"select\",id:k}));return}b(()=>r({type:\"navigate.url\",url:x,context:k,mode:y.mode??\"push\"}))}function F(y){let N=yl(t,y);if(N.kind!==\"route\"||!N.context||!c.contexts[N.context])return c.active;let z=c.contexts[c.active],x=t.contexts.find(We=>We.id===c.active)?.startUrl,k=!z.url||x!==void 0&&Te(z.url)===Te(x);return c.overlay.length>0||k?N.context:c.active}function Fe(y){b(()=>{let N=y===c.active&&c.overlay.length===0,z=N&&c.contexts[y]?.url!==null&&Te(c.contexts[y].url)!==Te(t.contexts.find(x=>x.id===y)?.startUrl??\"\");if(r({type:\"select\",id:y}),N&&!z)for(let x of[...m])x(y)})}let Ct=new Set;function Zl(y){Ct.has(y)||(Ct.add(y),setTimeout(()=>Ct.delete(y),Y0),e.request(\"context.resync\",{id:y}).catch(()=>{}))}function re(y){let N=yl(t,y);return N.kind===\"route\"?{pageId:N.page,routeId:N.routeId,params:N.params}:{pageId:null,routeId:null,params:{}}}e.on(\"page\",({id:y,generation:N,page:z})=>{let x=i.applyPage(y,N,z);if(x.outcome!==\"applied\")return;Ct.delete(y);let k=i.context(y);f0(y,z),r({type:\"context.page\",id:y,generation:N,view:z.view,status:z.status,pageId:z.pageId,routeId:z.routeId,account:z.account,stale:k.stale&&k.content,signInUrl:z.signInUrl??null}),Se(y,x)}),e.on(\"patch\",({id:y,generation:N,patch:z})=>{let x=i.applyPatch(y,N,z);x.outcome===\"resync\"&&Zl(y),Se(y,x)});function Se(y,N){if(!N.accountChanged)return;let z=Jl(c,t);for(let x of u)x!==y&&(x===z?Zl(x):at(x));for(let x of[...$e.values()])x.context!==y&&It(x,{outcome:\"unknown\",code:\"CONTEXT_REPLACED\",message:\"The account changed\"})}function at(y){fi(y),o(\"context.reload\",{id:y})}e.on(\"context.navigated\",y=>{i.navigated(y.id,y,re(y.url)),r({type:\"context.navigated\",...y})}),e.on(\"context.gone\",y=>{i.gone(y.id,{code:y.code??\"NOT_READY\",message:y.message??\"The page cannot be read\"}),r({type:\"context.gone\",id:y.id})}),e.on(\"user.viewWebsite\",y=>{r({type:\"user.viewWebsite\",id:y?.id??c.active})}),e.on(\"user.done\",y=>{r({type:\"user.done\",id:y?.id??c.active}),Yf()}),e.on(\"back\",()=>{let y=T(!0);o(\"back.handled\",{handled:y})});let $e=new Map,Wa=new Map,Pa=new Map,rc=0,sc=new Set,fc=new Map,Lf=(y,N,z)=>JSON.stringify([y,N,z]);function Bf(){let y=new Map;for(let z of $e.values()){let x=Lf(z.context,z.region,z.key),k=y.get(x);k||y.set(x,k=[]),k.push({name:z.name,args:z.args})}let N=new Map;for(let[z,x]of y){let k=fc.get(z);N.set(z,k&&k.length===x.length&&k.every((We,Ft)=>We.name===x[Ft].name&&We.args===x[Ft].args)?k:x)}fc=N;for(let z of[...sc])z()}function It(y,N){$e.get(y.dedup)===y&&($e.delete(y.dedup),y.actionId!==null&&Wa.delete(y.actionId),y.timer!==null&&clearTimeout(y.timer),y.resolve(N),Bf())}function qf(y,N){y.timer!==null&&clearTimeout(y.timer),y.timer=setTimeout(()=>It(y,{outcome:\"unknown\",code:\"DEADLINE\",message:\"The action did not finish in time\"}),N)}function Vf(y,N){if(N.state===\"dispatched\"){if(!N.navigating)return;y.from=i.context(y.context)?.view??null,y.expect=N.expect??null,qf(y,l.actionTimeoutMs);return}let z=N.state===\"observed\"?\"observed\":N.state===\"cancelled\"?\"cancelled\":\"failed\";It(y,N.result??{outcome:z})}e.on(\"action.update\",y=>{let N=Wa.get(y.actionId);if(N)return Vf(N,y);if(rc===0)return;let z=Pa.get(y.actionId)??[];z.push(y),Pa.set(y.actionId,z)});function f0(y,N){for(let z of[...$e.values()]){if(z.context!==y||z.from===null)continue;let{from:x}=z;if(N.view.generation===x.generation&&N.view.n===x.n||N.status===\"loading\")continue;let k=yl(t,N.view.url),We=k.kind===\"route\"?k.page:null,Ft=ld(z.expect?.page);N.status===\"auth\"?It(z,{outcome:\"failed\",code:\"AUTH_REQUIRED\",message:\"Sign-in is needed\"}):We!==null&&ld(z.expect?.notPage)?.includes(We)?It(z,{outcome:\"failed\",code:\"REJECTED\",message:\"The website did not accept the action\"}):N.status===\"ready\"&&We!==null&&(Ft===null||Ft.includes(We))?It(z,{outcome:\"observed\"}):It(z,{outcome:\"unknown\",message:\"The action led to another page\"})}}function fi(y){for(let N of[...$e.values()])N.context===y&&N.from!==null&&It(N,{outcome:\"unknown\",message:\"The page changed before the action finished\"})}function d0(y){let N=i.context(y.context);if(!N?.view)return Promise.resolve({outcome:\"failed\",code:\"NOT_READY\",message:\"The page is not ready\"});let z=y.region===null?void 0:N.regions[y.region],x=z?.kind===\"collection\"?z.records[y.key??\"\"]:z?.record??void 0,k=JSON.stringify([y.context,x?.entityType??y.region,x?.entity??y.key,y.name,y.args??null]),We=$e.get(k);if(We)return We.promise;let Ft,Qf=new Promise(Vt=>{Ft=Vt}),gl={...y,dedup:k,actionId:null,promise:Qf,resolve:Ft,timer:null,from:null,expect:null};$e.set(k,gl),qf(gl,l.actionTimeoutMs+j0),Bf();let{view:Xf}=N,v0={region:y.region,key:y.key,name:y.name,args:y.args??null,view:Xf.n},Zf=()=>{--rc===0&&Pa.clear()};return rc++,e.request(\"context.act\",{id:y.context,generation:Xf.generation,action:v0}).then(({actionId:Vt})=>{let vc=Pa.get(Vt)??[];if(Pa.delete(Vt),Zf(),$e.get(k)===gl){gl.actionId=Vt,Wa.set(Vt,gl);for(let y0 of vc)Vf(gl,y0)}},Vt=>{Zf();let vc=Pf(Vt?.code)?Vt.code:void 0;It(gl,{outcome:\"failed\",code:vc,message:Vt instanceof Error?Vt.message:\"The action failed\"})}),Qf}let dc=new Set;e.on(\"storage.changed\",y=>{for(let N of[...dc])N(y)});let m0={get:(y,N)=>e.request(\"storage.get\",{collection:y,key:N}),list:(y,N={})=>e.request(\"storage.list\",{collection:y,...N}),commit:y=>e.request(\"storage.commit\",{checks:y.checks??[],puts:y.puts??[],deletes:y.deletes??[]}),onChanged(y){return dc.add(y),()=>{dc.delete(y)}}},g0={async request(y,N,z={}){try{return await e.request(\"services.request\",{serviceId:y,path:N,method:z.method??\"GET\",body:z.body??null})}catch(x){throw x instanceof te?new cd(x.code,x.message):x}}},mc=new Set;function Yf(){for(let y of[...mc])y()}e.on(\"resumed\",Yf);let gc=new Set;e.on(\"retired\",()=>{for(let y of[...$e.values()])It(y,{outcome:\"unknown\",code:\"RETIRED\",message:\"This page was closed\"});for(let y of[...gc])y()});let Kl=new Map;for(let y of u)e.request(\"context.resync\",{id:y}).catch(()=>{}),s({type:\"schedule\",id:y,token:c.contexts[y].deadline});let kf=Jl(c,t);kf!==null&&o(\"context.reveal\",{id:kf});let jf=!1;return{manifest:t,appletId:n,limits:l,restored:a!==null,store:i,navigation:{state:()=>c,screen:C,presentation:y=>di(c.contexts[y],t),revealed:()=>Jl(c,t),navigate:M,select:Fe,back:()=>{T(!1)},reload:y=>{at(y??c.active)},viewWebsite:y=>{r({type:\"user.viewWebsite\",id:y??c.active})},done:y=>{r({type:\"user.done\",id:y??c.active})},setLeaveGuard:y=>{r({type:\"guard\",guard:y===null?null:{message:y}})},onConfirmLeave(y){return g=y,()=>{g===y&&(g=null)}},onScrollToTop(y){return m.add(y),()=>{m.delete(y)}},subscribe(y){return f.add(y),()=>{f.delete(y)}}},actions:{act:d0,pending:(y,N,z)=>fc.get(Lf(y,N,z))??Q0,subscribe(y){return sc.add(y),()=>{sc.delete(y)}}},storage:m0,services:g0,scroll:{get:y=>Kl.get(y),set(y,N){for(Kl.delete(y),Kl.set(y,N);Kl.size>k0;)Kl.delete(Kl.keys().next().value)}},onResume(y){return mc.add(y),()=>{mc.delete(y)}},onRetired(y){return gc.add(y),()=>{gc.delete(y)}},ready(){jf||(jf=!0,o(\"ui.ready\"))}}}var Q=U(mt(),1),Uh=U(Mh(),1),li=U(J(),1),Hh=(0,Q.createContext)(null);function pS({foreground:e,children:t}){return(0,li.jsx)(Hh.Provider,{value:e,children:t})}function Kt(){let e=(0,Q.useContext)(Hh);if(!e)throw new Error(\"Genesis hooks need mountForeground or GenesisProvider\");return e}function bS({foreground:e,children:t}){return(0,Q.useLayoutEffect)(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e.ready()))},[e]),t}async function Gh(e,t){let n=t??document.getElementById(\"root\")??document.body.appendChild(document.createElement(\"div\")),l=await Tc(),a=(0,Uh.createRoot)(n);return l.onRetired(()=>a.unmount()),a.render((0,li.jsx)(pS,{foreground:l,children:(0,li.jsx)(bS,{foreground:l,children:e})})),l}function _f(){let e=Kt();return(0,Q.useSyncExternalStore)(e.navigation.subscribe,e.navigation.state)}function nc(e){let t=_f();return e??t.active}function Lh(e,t){let{store:n}=Kt(),l=(0,Q.useCallback)(a=>n.subscribe(a,e),[n,e]);return(0,Q.useSyncExternalStore)(l,()=>t(n.context(e)))}var SS=(e,t)=>e.pageId===t.pageId&&e.status===t.status&&e.stale===t.stale&&e.generation===t.generation&&e.params===t.params&&e.error===t.error&&e.account===t.account&&e.url===t.url;function ES(e,t){return{pageId:e?.pageId??null,status:e?.status??\"loading\",stale:e?e.stale&&e.content:!1,generation:e?.view?.generation??null,params:e?.params??TS,error:e?.error??null,account:t,url:e?.url??null}}function qt(e){let{store:t}=Kt(),n=nc(e),l=(0,Q.useRef)(null),a=(0,Q.useCallback)(i=>t.subscribe(i),[t]),u=(0,Q.useCallback)(()=>{let i=ES(t.context(n),t.state().account);return(!l.current||!SS(l.current,i))&&(l.current=i),l.current},[t,n]);return(0,Q.useSyncExternalStore)(a,u)}var TS=Object.freeze({}),wh=new WeakMap,NS=Object.freeze({order:Object.freeze([]),get:()=>{},complete:!1,status:\"missing\",error:null,ephemeral:!1});function OS(e){if(!e)return NS;let t=wh.get(e);if(t)return t;if(e.kind===\"collection\"){let{records:n}=e;t={order:e.order.filter(l=>n[l]!==void 0),get:l=>n[l],complete:e.complete,status:e.status,error:e.error,ephemeral:e.ephemeral}}else{let{record:n}=e;t={order:n?[n.key]:[],get:l=>n&&n.key===l?n:void 0,complete:!0,status:e.status,error:e.error,ephemeral:!1}}return wh.set(e,t),t}function ai(e,t){return Lh(nc(t),n=>OS(n?.regions[e]))}function At(e,t,n){return Lh(nc(n),l=>AS(l?.regions[e],t))}function AS(e,t){if(e)return e.kind===\"single\"?t===null||e.record?.key===t?e.record??void 0:void 0:t===null?void 0:e.records[t]}function wn(e,t,n){let l=Kt();return(0,Q.useCallback)((a,u)=>l.actions.act({context:n??l.navigation.state().active,region:t??null,key:a,name:e,args:u}),[l,e,t,n])}function Ja(e,t,n){let l=Kt(),a=nc(n);return(0,Q.useSyncExternalStore)(l.actions.subscribe,()=>l.actions.pending(a,e,t))}function Ke(){let e=Kt(),t=_f(),{navigation:n}=e;return(0,Q.useMemo)(()=>({presentation:n.presentation(t.active),active:t.active,contexts:t.contexts,overlay:t.overlay,screen:n.screen(),revealed:n.revealed(),navigate:n.navigate,back:n.back,select:n.select,reload:n.reload,viewWebsite:n.viewWebsite,done:n.done,setLeaveGuard:n.setLeaveGuard}),[n,t])}function Bh(e,t={}){let n=Kt(),l=t.storage??n.storage,[a,u]=(0,Q.useState)({records:[],loading:!0,error:null});(0,Q.useEffect)(()=>{let m=!0,r=0;async function s(){let b=++r;try{let T=[],v;do{let d=await l.list(e,v===void 0?{}:{afterKey:v});T.push(...d.entries),v=d.nextAfterKey??void 0}while(v!==void 0);m&&b===r&&u({records:T,loading:!1,error:null})}catch(T){m&&b===r&&u(v=>({...v,loading:!1,error:T}))}}s();let p=l.onChanged(b=>{b.changes.some(T=>T.collection===e)&&s()});return()=>{m=!1,p()}},[l,e]);let i=(0,Q.useRef)(a.records);i.current=a.records;let o=(0,Q.useCallback)(m=>i.current.find(r=>r.key===m)?.revision??null,[]),c=(0,Q.useCallback)(m=>l.commit(m),[l]),f=(0,Q.useCallback)((m,r,s)=>l.commit({checks:[{collection:e,key:m,expectedRevision:s===void 0?o(m):s}],puts:[{collection:e,key:m,value:r}]}),[l,e,o]),g=(0,Q.useCallback)(m=>l.commit({checks:[{collection:e,key:m,expectedRevision:o(m)}],deletes:[{collection:e,key:m}]}),[l,e,o]);return{...a,put:f,remove:g,commit:c}}var zS=1500;function _S(){let e=Kt();_f();let t=e.navigation.screen(),n=t?.key??`${e.navigation.state().active}:none`,l=t&&!t.overlay?t.context:null;return(0,Q.useCallback)(a=>{if(!a)return;let u=e.scroll.get(n)??0,i=u>0,o=performance.now(),c=0,f=()=>{i&&(a.scrollTop=u,Math.abs(a.scrollTop-u)<2||performance.now()-o>zS?i=!1:c=requestAnimationFrame(f))},g=()=>{i=!1},m=()=>{i||e.scroll.set(n,a.scrollTop)},r=e.navigation.onScrollToTop(s=>{s===l&&(i=!1,a.scrollTo({top:0,behavior:\"smooth\"}))});return f(),a.addEventListener(\"scroll\",m,{passive:!0}),a.addEventListener(\"touchstart\",g,{passive:!0}),a.addEventListener(\"wheel\",g,{passive:!0}),()=>{cancelAnimationFrame(c),r(),a.removeEventListener(\"scroll\",m),a.removeEventListener(\"touchstart\",g),a.removeEventListener(\"wheel\",g)}},[e,n,l])}function we(e){return(0,li.jsx)(\"div\",{...e,ref:_S()})}function qh(e){let t=Kt(),n=(0,Q.useRef)(e);n.current=e,(0,Q.useEffect)(()=>t.onResume(()=>n.current()),[t])}var Vh=U(mt(),1);var ie=\"https://news.ycombinator.com\";var ui=e=>typeof e==\"string\"&&e.length<=20&&/^[1-9][0-9]*$/.test(e);var kl=e=>`${ie}/item?id=${e}`,gn=e=>`${ie}/user?id=${encodeURIComponent(e)}`;function lc(e,t=ie){try{let n=new URL(e,t);return(n.protocol===\"https:\"||n.protocol===\"http:\")&&!n.username&&!n.password&&n.href.length<=2048?n.href:null}catch{return null}}var be=U(J(),1),CS={home:\"M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z\",search:\"M21 21l-5.2-5.2M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0\",post:\"M12 5v14M5 12h14\",bookmark:\"M6 3h12v18l-6-4-6 4z\",person:\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0\",up:\"M12 6l7 10H5z\",chevron:\"M9 6l6 6-6 6\",external:\"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6\"};function Ia({name:e,filled:t=!1}){return(0,be.jsx)(\"svg\",{viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",className:t?\"filled\":void 0,children:(0,be.jsx)(\"path\",{d:CS[e]})})}function Je(){let{navigate:e}=Ke();return(0,Vh.useCallback)(t=>{try{e({url:t})}catch(n){console.error(\"Genesis could not open\",t,n)}},[e])}function ml({parts:e,onLink:t}){let n=Je(),l=t??n;return(0,be.jsx)(\"div\",{className:\"rich\",children:e.map((a,u)=>{let i=a.text;if(a.code&&(i=(0,be.jsx)(\"code\",{children:i})),a.em&&(i=(0,be.jsx)(\"em\",{children:i})),a.strong&&(i=(0,be.jsx)(\"strong\",{children:i})),a.href){let o=a.href;i=(0,be.jsx)(\"a\",{href:o,onClick:c=>{c.preventDefault(),l(o)},children:i})}return(0,be.jsx)(\"span\",{children:i},u)})})}function Ue({label:e,rows:t=8,kind:n=\"list\"}){return(0,be.jsx)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:`skeleton ${n}`,children:Array.from({length:t},(l,a)=>(0,be.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[(0,be.jsx)(\"span\",{}),(0,be.jsx)(\"span\",{})]},a))})}function Ie({title:e,children:t,role:n}){return(0,be.jsxs)(\"section\",{className:\"notice\",role:n,children:[(0,be.jsx)(\"h2\",{children:e}),t]})}function zt({error:e}){let{viewWebsite:t}=Ke(),n=e?.code===\"NOT_READY\"||e?.code===\"DEADLINE\"?\"Hacker News did not answer in time.\":e?.message||\"This page could not be read.\";return(0,be.jsxs)(Ie,{title:\"Couldn't load this page\",role:\"alert\",children:[(0,be.jsx)(\"p\",{children:n}),(0,be.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t(),children:[\"Open on Hacker News \",(0,be.jsx)(Ia,{name:\"external\"})]})]})}var Yh=e=>`${ie}/login?goto=${encodeURIComponent(e)}`;function ii({parts:e}){let t=e.filter(Boolean);return(0,be.jsx)(\"p\",{className:\"meta\",children:t.map((n,l)=>(0,be.jsxs)(\"span\",{children:[l>0&&\" \\xB7 \",n]},l))})}var Fa=U(mt(),1);var Ql=U(mt(),1);var yE=new TextEncoder;var MS=new Set([\"CONFLICT\",\"INVALID_ARGUMENT\",\"NOT_FOUND\",\"QUOTA_EXCEEDED\",\"STORAGE_FAILURE\"]),kh=new WeakMap;function xS(e){let t=kh.get(e);if(t)return t;let n=new Set,l=i=>queueMicrotask(()=>{for(let o of n)try{o(i)}catch(c){console.error(\"Library change listener failed\",c)}});async function a(i,o){let c=await e.services.request(\"bookmarks\",\"/v1/documents\",{method:\"POST\",body:{operation:i,params:o}}),f=c.body?.error;if(c.status<200||c.status>=300||f){let m=f&&MS.has(f.code)?f.code:\"SERVICE_FAILURE\";throw new te(m,f?.message??\"The bookmarks service refused the request. Reload before retrying.\")}let g=c.body?.result;if(!g||typeof g!=\"object\")throw new te(\"SERVICE_FAILURE\",\"The bookmarks service sent an invalid answer.\");return i===\"commit\"&&l({changes:c.body.changes??[],namespaceRevision:g.namespaceRevision}),g}let u={get:(i,o)=>a(\"get\",{collection:i,key:o}),list:(i,o={})=>a(\"list\",{collection:i,limit:100,...o}),commit:i=>a(\"commit\",{checks:[],puts:[],deletes:[],...i}),onChanged(i){return n.add(i),()=>{n.delete(i)}},refresh:()=>l({changes:[\"bookmarks\",\"categories\",\"category-meta\"].map(i=>({collection:i,key:\"\"})),namespaceRevision:0})};return e.onRetired(()=>n.clear()),kh.set(e,u),u}var xf=e=>new TextEncoder().encode(e).length,uc=e=>typeof e==\"number\"&&Number.isSafeInteger(e)&&e>=0,Uf=e=>typeof e==\"string\"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e),Cf=e=>`hn:item:${e}`,Xh=(e,t)=>`${String(Number.MAX_SAFE_INTEGER-e).padStart(16,\"0\")}:${t}`,jl=()=>new te(\"STORAGE_FAILURE\",\"Category data has an unsupported format. Its data has been preserved.\"),oi=()=>new te(\"CONFLICT\",\"Categories changed. Review them before retrying.\"),jh=()=>new te(\"CONFLICT\",\"A category with this name already exists.\");function ac(e){let t=e;if(!t||t.schemaVersion!==1||!ui(t.itemId)||t.discussionUrl!==kl(t.itemId)||typeof t.title!=\"string\"||!t.title.trim()||xf(t.title)>2048||!(t.submitter===null||typeof t.submitter==\"string\"&&xf(t.submitter)<=256)||!(t.articleUrl===null||typeof t.articleUrl==\"string\"&&lc(t.articleUrl)===t.articleUrl)||typeof t.truncated!=\"boolean\"||!uc(t.savedAtMs)||!uc(t.capturedAtMs)||!Array.isArray(t.categoryIds)||t.categoryIds.length>50||!t.categoryIds.every(Uf)||new Set(t.categoryIds).size!==t.categoryIds.length||t.orderKey!==Xh(t.savedAtMs,t.itemId))throw new te(\"STORAGE_FAILURE\",\"This saved story has an unsupported format. Its data has been preserved.\");return t}function Rf(e){let t=e.trim(),n=t.normalize(\"NFKC\").trim().replace(/\\s+/gu,\" \").toLowerCase();if(!t||[...t].length>40||!n||xf(n)>512)throw new te(\"INVALID_ARGUMENT\",\"Use a category name of 1 to 40 characters.\");if([\"all\",\"uncategorized\"].includes(n))throw new te(\"INVALID_ARGUMENT\",\"All and Uncategorized are reserved filter names.\");return{name:t,normalizedName:n}}function Mf(e){let t=e;try{if(!t||t.schemaVersion!==1||!Uf(t.id)||typeof t.name!=\"string\"||!uc(t.createdAtMs)||!(t.deletedAtMs===null||uc(t.deletedAtMs)&&t.deletedAtMs>=t.createdAtMs))throw jl();let n=Rf(t.name);if(t.name!==n.name||t.normalizedName!==n.normalizedName)throw jl();return t}catch{throw jl()}}function RS(e){let t=e;if(!t||!Array.isArray(t.ids)||t.ids.length>50||!t.ids.every(Uf)||new Set(t.ids).size!==t.ids.length)throw jl();return{ids:t.ids}}function Qh(e,t){if(!e||e.value?.categoryId!==t)throw jl()}function Zh(e,t){if(t.length>50||new Set(t).size!==t.length)throw new te(\"INVALID_ARGUMENT\",\"Invalid category selection\");let n=[{collection:\"category-meta\",key:\"active\",expectedRevision:e.meta?.revision??null}];for(let l of t){let a=e.categories.find(u=>u.value.id===l);if(!a)throw oi();n.push({collection:\"categories\",key:l,expectedRevision:a.revision})}return n}var Xl=(e,t)=>e.filter(n=>t.categories.some(l=>l.value.id===n)),Kh=e=>({itemId:e.id,discussionUrl:kl(e.id),articleUrl:e.articleUrl,title:e.title,submitter:e.submitter,truncated:!1,capturedAtMs:Date.now()}),Df=class{constructor(t){this.storage=t}storage;async get(t){if(!ui(t))throw new te(\"INVALID_ARGUMENT\",\"Invalid story ID\");let{document:n}=await this.storage.get(\"bookmarks\",Cf(t));if(!n)return null;let l=ac(n.value);if(l.itemId!==t)throw new te(\"STORAGE_FAILURE\",\"Saved story identity mismatch. Data preserved.\");return{...n,value:l}}async save(t,n,l={}){if(n&&n.value.itemId!==t.itemId)throw new te(\"INVALID_ARGUMENT\",\"Story identity changed\");let a=n?.value.savedAtMs??Date.now(),u=Cf(t.itemId),i=ac({...n&&!l.refresh?n.value:t,schemaVersion:1,savedAtMs:a,orderKey:Xh(a,t.itemId),categoryIds:l.categoryIds??n?.value.categoryIds??[]}),o=[{collection:\"bookmarks\",key:u,expectedRevision:n?.revision??null},...l.checks??[]],c=[{collection:\"bookmarks\",key:u,value:i}];n||(o.push({collection:\"bookmark-order\",key:i.orderKey,expectedRevision:null}),c.push({collection:\"bookmark-order\",key:i.orderKey,value:{bookmarkKey:u}})),await this.storage.commit({checks:o,puts:c})}async remove(t){let n=ac(t.value),l=Cf(n.itemId),a=await this.storage.get(\"bookmark-order\",n.orderKey);if(a.document&&a.document.value.bookmarkKey!==l)throw new te(\"STORAGE_FAILURE\",\"Bookmark index mismatch. Data preserved.\");await this.storage.commit({checks:[{collection:\"bookmarks\",key:l,expectedRevision:t.revision},{collection:\"bookmark-order\",key:n.orderKey,expectedRevision:a.document?.revision??null}],deletes:[{collection:\"bookmarks\",key:l},{collection:\"bookmark-order\",key:n.orderKey}]})}},wf=class{constructor(t){this.storage=t}storage;async read(){for(let t=0;t<3;t++){let n=await this.storage.get(\"category-meta\",\"active\"),l=n.document?{...n.document,value:RS(n.document.value)}:null,a=[];for(let i of l?.value.ids??[])a.push(await this.storage.get(\"categories\",i));if(a.some(i=>i.namespaceRevision!==n.namespaceRevision))continue;let u=a.map((i,o)=>{if(!i.document)throw jl();let c=Mf(i.document.value);if(c.id!==l.value.ids[o]||c.deletedAtMs!==null)throw jl();return{...i.document,value:c}});return{meta:l,categories:u,namespaceRevision:n.namespaceRevision}}throw oi()}async create(t){let n=Rf(t),l=await this.read();if(l.categories.length>=50)throw new te(\"QUOTA_EXCEEDED\",\"You can have up to 50 active categories.\");if((await this.storage.get(\"category-names\",n.normalizedName)).document)throw jh();let a=crypto.randomUUID(),u={schemaVersion:1,id:a,...n,createdAtMs:Date.now(),deletedAtMs:null};return await this.storage.commit({checks:[{collection:\"category-meta\",key:\"active\",expectedRevision:l.meta?.revision??null},{collection:\"categories\",key:a,expectedRevision:null},{collection:\"category-names\",key:n.normalizedName,expectedRevision:null}],puts:[{collection:\"categories\",key:a,value:u},{collection:\"category-names\",key:n.normalizedName,value:{categoryId:a}},{collection:\"category-meta\",key:\"active\",value:{ids:[...l.meta?.value.ids??[],a]}}]}),a}async rename(t,n){let l=Mf(t.value),a=Rf(n);if(l.deletedAtMs!==null||(await this.storage.get(\"categories\",l.id)).document?.revision!==t.revision)throw oi();if(l.normalizedName===a.normalizedName){await this.storage.commit({checks:[{collection:\"categories\",key:l.id,expectedRevision:t.revision}],puts:[{collection:\"categories\",key:l.id,value:{...l,...a}}]});return}let[i,o]=await Promise.all([this.storage.get(\"category-names\",l.normalizedName),this.storage.get(\"category-names\",a.normalizedName)]);if(Qh(i.document,l.id),o.document)throw jh();await this.storage.commit({checks:[{collection:\"categories\",key:l.id,expectedRevision:t.revision},{collection:\"category-names\",key:l.normalizedName,expectedRevision:i.document.revision},{collection:\"category-names\",key:a.normalizedName,expectedRevision:null}],puts:[{collection:\"categories\",key:l.id,value:{...l,...a}},{collection:\"category-names\",key:a.normalizedName,value:{categoryId:l.id}}],deletes:[{collection:\"category-names\",key:l.normalizedName}]})}async remove(t){let n=Mf(t.value),l=await this.read();if(!l.categories.some(u=>u.value.id===n.id&&u.revision===t.revision))throw oi();let a=await this.storage.get(\"category-names\",n.normalizedName);Qh(a.document,n.id),await this.storage.commit({checks:[{collection:\"categories\",key:n.id,expectedRevision:t.revision},{collection:\"category-meta\",key:\"active\",expectedRevision:l.meta.revision},{collection:\"category-names\",key:n.normalizedName,expectedRevision:a.document.revision}],puts:[{collection:\"categories\",key:n.id,value:{...n,deletedAtMs:Math.max(Date.now(),n.createdAtMs)}},{collection:\"category-meta\",key:\"active\",value:{ids:l.meta.value.ids.filter(u=>u!==n.id)}}],deletes:[{collection:\"category-names\",key:n.normalizedName}]})}};function ci(){let e=xS(Kt());return(0,Ql.useMemo)(()=>({storage:e,bookmarkRepository:new Df(e),categoryRepository:new wf(e)}),[e])}function vn(e){return e?.code===\"CONFIGURATION_REQUIRED\"?\"Saved stories need the bookmarks service. Connect it under Service connections in the Genesis menu.\":Ec(e)}function ic(){let{storage:e,bookmarkRepository:t,categoryRepository:n}=ci(),l=Bh(\"bookmarks\",{storage:e}),[a,u]=(0,Ql.useState)({snapshot:null,error:null});return(0,Ql.useEffect)(()=>{let o=!0,c=0,f=()=>{let m=++c;n.read().then(r=>{o&&m===c&&u({snapshot:r,error:null})},r=>{o&&m===c&&u(s=>({...s,error:r}))})};f();let g=e.onChanged(m=>{m.changes.some(r=>r.collection.startsWith(\"categor\"))&&f()});return()=>{o=!1,g()}},[e,n]),qh(()=>e.refresh()),{bookmarks:(0,Ql.useMemo)(()=>l.records.flatMap(o=>{try{return[{...o,value:ac(o.value)}]}catch{return[]}}).sort((o,c)=>c.value.savedAtMs-o.value.savedAtMs),[l.records]),categories:a.snapshot,loading:l.loading||a.snapshot===null&&a.error===null,error:l.error??a.error,bookmarkRepository:t,categoryRepository:n}}var I=U(J(),1);function Jh(){let e=ic(),t;return!e.categories&&e.error?t=(0,I.jsx)(Ie,{title:\"Couldn't load categories\",role:\"alert\",children:(0,I.jsx)(\"p\",{children:vn(e.error)})}):e.categories?t=(0,I.jsx)(DS,{categories:e.categories}):t=(0,I.jsx)(Ue,{label:\"Loading categories\",rows:3,kind:\"text\"}),(0,I.jsxs)(we,{className:\"screen\",children:[(0,I.jsx)(\"p\",{className:\"eyebrow\",children:\"Saved stories\"}),(0,I.jsx)(\"h1\",{className:\"screen-title\",children:\"Categories\"}),t]})}function DS({categories:e}){let{categoryRepository:t,storage:n}=ci(),[l,a]=(0,Fa.useState)(\"\"),[u,i]=(0,Fa.useState)(!1),[o,c]=(0,Fa.useState)(\"\"),f=async(g,m)=>{if(!u){i(!0),c(\"\");try{await g(),c(m)}catch(r){n.refresh(),c(`${vn(r)} The list has been reread; review it before retrying.`)}finally{i(!1)}}};return(0,I.jsxs)(\"section\",{className:\"card manager\",\"aria-busy\":u,\"aria-label\":\"Manage categories\",children:[(0,I.jsx)(\"p\",{className:\"meta\",children:\"Changes save immediately. Deleting a category keeps its stories, which become Uncategorized.\"}),o&&(0,I.jsx)(\"p\",{role:\"status\",className:\"status\",children:o}),(0,I.jsxs)(\"form\",{className:\"row\",onSubmit:g=>{g.preventDefault(),f(async()=>{await t.create(l),a(\"\")},\"Category created.\")},children:[(0,I.jsxs)(\"label\",{className:\"grow\",children:[(0,I.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,I.jsx)(\"input\",{placeholder:\"New category\",value:l,disabled:u,onChange:g=>a(g.target.value)})]}),(0,I.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:u||!l.trim(),children:\"Create\"})]}),(0,I.jsxs)(\"p\",{className:\"meta\",children:[e.categories.length,\" of 50 categories\"]}),e.categories.map(g=>(0,I.jsx)(wS,{record:g,busy:u,rename:m=>{f(()=>t.rename(g,m),\"Category renamed.\")},remove:()=>{f(()=>t.remove(g),\"Category deleted.\")}},`${g.value.id}:${g.revision}`))]})}function wS({record:e,busy:t,rename:n,remove:l}){let[a,u]=(0,Fa.useState)(e.value.name),[i,o]=(0,Fa.useState)(!1);return(0,I.jsxs)(\"div\",{className:\"category\",children:[(0,I.jsxs)(\"div\",{className:\"row\",children:[(0,I.jsxs)(\"label\",{className:\"grow\",children:[(0,I.jsxs)(\"span\",{className:\"visually-hidden\",children:[\"Rename \",e.value.name]}),(0,I.jsx)(\"input\",{value:a,disabled:t,onChange:c=>u(c.target.value)})]}),(0,I.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t||!a.trim()||a===e.value.name,onClick:()=>n(a),children:\"Rename\"}),(0,I.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:t,onClick:()=>o(!0),children:\"Delete\"})]}),i&&(0,I.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":`Delete ${e.value.name}`,children:[(0,I.jsxs)(\"p\",{children:[\"Delete \\u201C\",e.value.name,\"\\u201D? Its stories stay saved.\"]}),(0,I.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:t,onClick:l,children:\"Delete category permanently\"}),(0,I.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t,onClick:()=>o(!1),children:\"Keep category\"})]})]})}var ri=U(mt(),1);var V=U(J(),1);function Fh(e,t,n){let l=Ja(e,t),a=wn(\"setVoted\",e),[u,i]=(0,ri.useState)(!1),o=[...l].reverse().find(g=>g.name===\"setVoted\"),c=o?o.args.voted:n;return{shown:c,busy:o!==void 0,failed:u,toggle:()=>{i(!1),a(t,{voted:!c}).then(g=>i(g.outcome===\"failed\"))}}}function $h({vote:e,canVote:t,title:n,signedIn:l,small:a=!1}){let u=`vote${a?\" small\":\"\"}${e.shown?\" voted\":\"\"}`;return!l||!t&&!e.shown?(0,V.jsx)(\"span\",{className:u,\"aria-hidden\":\"true\"}):(0,V.jsx)(\"button\",{type:\"button\",className:`${u} icon-button`,\"aria-pressed\":e.shown,disabled:e.busy,\"aria-label\":e.shown?`Remove upvote: ${n}`:`Upvote: ${n}`,onClick:e.toggle,children:(0,V.jsx)(Ia,{name:\"up\",filled:e.shown})})}var Wh=({vote:e})=>e.failed?(0,V.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"The vote didn't go through. Try again.\"}):null;function US(){let{navigate:e}=Ke();return t=>e({screen:\"save\",params:{snapshot:JSON.stringify(Kh(t)),fresh:\"1\"}})}var oc=(0,ri.memo)(function({story:t,region:n,signedIn:l,heading:a=!1}){let u=Je(),i=Fh(n,t.id,t.voted),o=US(),c=a?\"h1\":\"h2\",f=kl(t.id);return(0,V.jsxs)(\"article\",{className:\"story\",children:[t.rank&&!a&&(0,V.jsx)(\"span\",{className:\"rank\",\"aria-hidden\":\"true\",children:t.rank}),(0,V.jsx)($h,{vote:i,canVote:t.canVote,title:t.title,signedIn:l}),(0,V.jsxs)(\"div\",{className:\"story-body\",children:[(0,V.jsxs)(c,{className:\"story-title\",children:[(0,V.jsx)(\"a\",{href:t.articleUrl??f,onClick:g=>{g.preventDefault(),u(t.articleUrl??f)},children:t.title}),t.domain&&(0,V.jsxs)(\"span\",{className:\"domain\",children:[\" (\",t.domain,\")\"]})]}),(0,V.jsx)(ii,{parts:[t.score,t.submitter&&(0,V.jsx)(\"a\",{href:gn(t.submitter),onClick:g=>{g.preventDefault(),u(gn(t.submitter))},children:t.submitter}),t.age,t.comments&&!a&&(0,V.jsx)(\"a\",{href:f,onClick:g=>{g.preventDefault(),u(f)},children:t.comments})]}),(0,V.jsx)(Wh,{vote:i})]}),(0,V.jsx)(\"button\",{type:\"button\",className:\"icon-button\",\"aria-label\":`Save story: ${t.title}`,onClick:()=>o(t),children:(0,V.jsx)(Ia,{name:\"bookmark\"})})]})}),Ih=(e,t)=>`${ie}/reply?id=${e}&goto=${encodeURIComponent(`item?id=${t}#${e}`)}`,si=(0,ri.memo)(function({entry:t,region:n,storyId:l,signedIn:a,collapsed:u,hidden:i,onToggle:o,onLink:c,head:f=!1}){let g=Je(),m=Fh(n,t.id,t.voted),r=t.author;return(0,V.jsxs)(\"article\",{className:\"comment\",id:`comment-${t.id}`,style:{\"--depth\":Math.min(t.depth,8)},children:[(0,V.jsxs)(\"header\",{className:\"comment-head\",children:[(0,V.jsx)($h,{small:!0,vote:m,canVote:t.canVote,title:`comment by ${r??\"unknown\"}`,signedIn:a}),(0,V.jsx)(ii,{parts:[r&&(0,V.jsx)(\"a\",{href:gn(r),onClick:s=>{s.preventDefault(),g(gn(r))},children:(0,V.jsx)(\"strong\",{children:r})}),t.age,f&&t.onStory&&(0,V.jsxs)(\"a\",{href:kl(t.onStory.id),onClick:s=>{s.preventDefault(),g(kl(t.onStory.id))},children:[\"on: \",t.onStory.title]})]}),o&&(0,V.jsx)(\"button\",{type:\"button\",className:\"text-button\",\"aria-expanded\":!u,onClick:()=>o(t.id),children:u?`Show${i?` (${i+1})`:\"\"}`:\"Hide\"})]}),!u&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ml,{parts:t.parts,onLink:c}),(0,V.jsx)(Wh,{vote:m}),(0,V.jsxs)(\"nav\",{className:\"comment-links\",\"aria-label\":\"Comment links\",children:[t.links.map(s=>(0,V.jsx)(\"a\",{href:s.url,onClick:p=>{p.preventDefault(),c(s.url)},children:s.label},s.label+s.url)),t.canReply&&(0,V.jsx)(\"a\",{href:Ih(t.id,l),onClick:s=>{s.preventDefault(),g(Ih(t.id,l))},children:\"reply\"})]})]})]})});var He=U(J(),1),Ph=[{label:\"Top\",paths:[\"/\",\"/news\"]},{label:\"New\",paths:[\"/newest\"]},{label:\"Past\",paths:[\"/front\"]},{label:\"Comments\",paths:[\"/newcomments\"]},{label:\"Ask\",paths:[\"/ask\"]},{label:\"Show\",paths:[\"/show\"]},{label:\"Jobs\",paths:[\"/jobs\"]}],HS={\"/shownew\":\"New Show\",\"/asknew\":\"New Ask\",\"/best\":\"Best\",\"/active\":\"Active\",\"/from\":\"From site\",\"/submitted\":\"Submissions\",\"/threads\":\"Comments\",\"/favorites\":\"Favorites\",\"/hidden\":\"Hidden\",\"/upvoted\":\"Upvoted\"};function e0(){let e=qt(),{navigate:t}=Ke(),n=ai(\"stories\"),l=ai(\"comments\"),a=At(\"more\",null),u=wn(\"loadMore\"),i=Ja(null,null).some(T=>T.name===\"loadMore\"),o=Je(),c=e.account!==null,f=e.pageId===\"feed\"||e.pageId===\"private-feed\",g=e.url?new URL(e.url).pathname:\"/\",m=Ph.find(T=>T.paths.includes(g)),r=f?n.order:[],s=f&&r.length===0?l.order:[],p=()=>{u(null).then(T=>{T.outcome===\"failed\"&&a&&o(a.data.url)})},b;return r.length===0&&s.length===0?f&&e.status===\"ready\"&&n.status===\"ready\"?b=(0,He.jsx)(Ie,{title:\"Nothing here yet\",children:(0,He.jsx)(\"p\",{children:\"This list is empty on Hacker News.\"})}):e.status===\"error\"||n.status===\"error\"?b=(0,He.jsx)(zt,{error:e.error??n.error}):b=(0,He.jsx)(Ue,{label:\"Loading stories\"}):b=(0,He.jsxs)(He.Fragment,{children:[e.status===\"error\"&&(0,He.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),(n.status===\"error\"||l.status===\"error\")&&(0,He.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some rows couldn't be read.\"}),r.map(T=>{let v=n.get(T)?.data;return v&&(0,He.jsx)(oc,{story:v,region:\"stories\",signedIn:c},T)}),s.map(T=>{let v=l.get(T)?.data;return v&&(0,He.jsx)(si,{head:!0,entry:v,region:\"comments\",storyId:v.onStory?.id??T,signedIn:c,onLink:o},T)}),a&&(0,He.jsx)(\"button\",{type:\"button\",className:\"secondary more\",disabled:i||e.stale,onClick:p,children:i?\"Loading\\u2026\":\"More\"})]}),(0,He.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[m?(0,He.jsx)(\"nav\",{className:\"chips\",\"aria-label\":\"Feeds\",children:Ph.map(T=>(0,He.jsx)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":T===m,onClick:()=>T!==m&&t({url:ie+T.paths[0],mode:\"replace\"}),children:T.label},T.label))}):(0,He.jsx)(\"h1\",{className:\"screen-title\",children:HS[g]??\"Hacker News\"}),b]})}var Un=U(J(),1);function t0(){let e=qt(),t=At(\"sections\",null),n=e.pageId===\"info\"?t?.data??null:null;return n?(0,Un.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale,children:[(0,Un.jsx)(\"h1\",{className:\"screen-title\",children:n.title}),(0,Un.jsx)(\"div\",{className:\"card\",children:(0,Un.jsx)(ml,{parts:n.parts})})]}):(0,Un.jsx)(\"div\",{className:\"screen\",\"aria-busy\":e.status===\"loading\",children:e.status===\"error\"?(0,Un.jsx)(zt,{error:e.error}):(0,Un.jsx)(Ue,{label:\"Loading page\",rows:6,kind:\"text\"})})}var _t=U(mt(),1);var Ge=U(J(),1);function GS(e){let t=new Map,n=new Map,l=[];for(let a of e.order){let u=e.get(a)?.data;if(u){for(;l.length>0&&l[l.length-1].depth>=u.depth;)l.pop();t.set(a,l.map(i=>i.id));for(let i of l)n.set(i.id,(n.get(i.id)??0)+1);l.push({id:a,depth:u.depth})}}return{ancestors:t,replies:n}}function n0(){let e=qt(),t=At(\"story\",null),n=ai(\"comments\"),l=At(\"more\",null),a=Je(),[u,i]=(0,_t.useState)(new Set),[o,c]=(0,_t.useState)(null),f=(0,_t.useRef)(null),{ancestors:g,replies:m}=(0,_t.useMemo)(()=>GS(n),[n]),r=e.account!==null,s=e.pageId===\"item\"?t?.data??null:null,p=s?.story?.id??s?.comment?.id??e.params.id??\"\",b=s?.comment?.onStory?.id??p,T=(0,_t.useRef)({ancestors:g,url:e.url});T.current={ancestors:g,url:e.url},(0,_t.useEffect)(()=>{o&&(f.current?.querySelector(`[id=\"comment-${o}\"]`)?.scrollIntoView({block:\"start\"}),c(null))},[o]);let v=(0,_t.useCallback)(C=>{let{ancestors:A,url:_}=T.current,Y=new URL(C),M=Y.hash.slice(1);Y.hash=\"\";let F=_?new URL(_):null;F&&(F.hash=\"\"),M&&F&&Y.href===F.href&&A.has(M)?(i(Fe=>new Set([...Fe].filter(Ct=>Ct!==M&&!A.get(M).includes(Ct)))),c(M)):a(C)},[a]),d=(0,_t.useCallback)(C=>i(A=>{let _=new Set(A);return _.delete(C)||_.add(C),_}),[]);if(!s)return(0,Ge.jsx)(\"div\",{className:\"screen\",\"aria-busy\":e.status===\"loading\",children:e.status===\"error\"?(0,Ge.jsx)(zt,{error:e.error}):(0,Ge.jsx)(Ue,{label:\"Loading discussion\"})});let h=e.pageId===\"item\"?n.order:[],S=h.filter(C=>!g.get(C)?.some(A=>u.has(A))),O=`item?id=${p}`;return(0,Ge.jsx)(we,{className:\"screen\",\"aria-busy\":e.stale,children:(0,Ge.jsxs)(\"div\",{ref:f,children:[e.status===\"error\"&&(0,Ge.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),s.story&&(0,Ge.jsx)(oc,{heading:!0,story:s.story,region:\"story\",signedIn:r}),s.comment&&(0,Ge.jsx)(si,{head:!0,entry:s.comment,region:\"story\",storyId:b,signedIn:r,onLink:v}),s.text.length>0&&(0,Ge.jsx)(\"div\",{className:\"toptext\",children:(0,Ge.jsx)(ml,{parts:s.text,onLink:v})}),r&&s.canComment&&(0,Ge.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>a(`${ie}/reply?id=${p}&goto=${encodeURIComponent(O)}`),children:\"Add a comment\"}),!r&&(0,Ge.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>a(Yh(O)),children:\"Sign in to comment\"}),(0,Ge.jsx)(\"h2\",{className:\"section-title\",children:h.length===0?\"No comments yet\":\"Comments\"}),n.status===\"error\"&&(0,Ge.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some comments couldn't be read.\"}),S.map(C=>{let A=n.get(C)?.data;return A&&(0,Ge.jsx)(si,{entry:A,region:\"comments\",storyId:b,signedIn:r,collapsed:u.has(C),hidden:m.get(C)??0,onToggle:d,onLink:v},C)}),l&&(0,Ge.jsx)(\"button\",{type:\"button\",className:\"secondary more\",disabled:e.stale,onClick:()=>a(l.data.url),children:\"More comments\"})]})})}var Hf=U(mt(),1);var ee=U(J(),1);function l0(){let e=qt(),t=At(\"account\",null),n=wn(\"signOut\",\"account\"),l=Ja(\"account\",t?.key??null).length>0,a=Je(),[u,i]=(0,Hf.useState)(!1),[o,c]=(0,Hf.useState)(!1),f=e.pageId===\"account\"&&!e.stale?t?.data??null:null,g=()=>{c(!1),n(t.key).then(r=>{let s=r.outcome===\"observed\"||r.code===\"AUTH_REQUIRED\"||r.code===\"CONTEXT_REPLACED\";c(!s),s&&i(!1)})},m;if(!f)m=e.status===\"error\"?(0,ee.jsx)(zt,{error:e.error}):(0,ee.jsx)(Ue,{label:\"Loading account\",rows:4,kind:\"text\"});else{let r=encodeURIComponent(f.name);m=(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)(\"section\",{className:\"card account\",children:[(0,ee.jsx)(\"h2\",{children:f.name}),f.karma&&(0,ee.jsxs)(\"p\",{className:\"meta\",children:[f.karma,\" karma\"]})]}),(0,ee.jsxs)(\"nav\",{className:\"list\",\"aria-label\":\"Your Hacker News\",children:[(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(gn(f.name)),children:\"Profile\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/submitted?id=${r}`),children:\"My submissions\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/threads?id=${r}`),children:\"My comments\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/favorites?id=${r}`),children:\"HN favorites\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/upvoted?id=${r}`),children:\"Upvoted\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/hidden?id=${r}`),children:\"Hidden\"})]}),(0,ee.jsx)(\"p\",{className:\"meta\",children:\"Genesis Saved stories are separate from HN favorites.\"}),o&&(0,ee.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't sign out. Try again.\"}),u?(0,ee.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":\"Confirm sign out\",children:[(0,ee.jsx)(\"p\",{children:\"Sign out of Hacker News in this app?\"}),(0,ee.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:l,onClick:g,children:\"Sign out\"}),(0,ee.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:l,onClick:()=>i(!1),children:\"Stay signed in\"})]}):(0,ee.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>i(!0),children:\"Sign out\"})]})}return(0,ee.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,ee.jsx)(\"h1\",{className:\"screen-title\",children:\"Me\"}),m,(0,ee.jsxs)(\"nav\",{className:\"list\",\"aria-label\":\"About Hacker News\",children:[(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/newsguidelines.html`),children:\"Guidelines\"}),(0,ee.jsx)(\"button\",{type:\"button\",onClick:()=>a(`${ie}/newsfaq.html`),children:\"FAQ\"})]})]})}var Jt=U(mt(),1);var oe=U(J(),1);function a0(){let e=qt(),{setLeaveGuard:t}=Ke(),n=At(\"form\",null),l=wn(\"setField\",\"form\"),a=wn(\"submit\",\"form\"),u=Je(),[i,o]=(0,Jt.useState)(\"\"),[c,f]=(0,Jt.useState)(\"\"),[g,m]=(0,Jt.useState)(\"\"),[r,s]=(0,Jt.useState)(!1),[p,b]=(0,Jt.useState)(null),[T,v]=(0,Jt.useState)(null),d=e.pageId===\"submit\"&&!e.stale?n?.data??null:null,[h,S]=(0,Jt.useState)(!1);(0,Jt.useEffect)(()=>{h||!d||(S(!0),o(d.title),f(d.url),m(d.text))},[h,d]);let O=T===null&&(i.trim()!==\"\"||c.trim()!==\"\"||g.trim()!==\"\");(0,Jt.useEffect)(()=>t(O?\"Discard this post?\":null),[O,t]);let C=c.trim()&&!lc(c.trim())?\"Enter a web address that starts with http or https.\":null,A=i.trim()!==\"\"&&i.trim().length<=80&&!C&&!r&&n!==void 0,_=async()=>{s(!0),b(null);let F=n.key;for(let[Ct,Zl]of[[\"title\",i.trim()],[\"url\",c.trim()],[\"text\",g]])if((await l(F,{name:Ct,value:Zl})).outcome!==\"observed\"){s(!1),b(\"Couldn't fill in Hacker News's form. Try again.\");return}let Fe=await a(F);s(!1),Fe.outcome===\"observed\"?v(\"accepted\"):Fe.code===\"REJECTED\"?b(null):Fe.outcome===\"unknown\"?v(\"unknown\"):b(\"Hacker News didn't take the post. Check the form and try again.\")},Y=()=>{o(\"\"),f(\"\"),m(\"\"),v(null),u(`${ie}/submit`)};if(T)return(0,oe.jsxs)(\"div\",{className:\"screen\",children:[(0,oe.jsx)(\"h1\",{className:\"screen-title\",children:\"Post\"}),(0,oe.jsxs)(Ie,{title:T===\"accepted\"?\"Submitted to Hacker News\":\"Check Hacker News\",role:\"status\",children:[(0,oe.jsx)(\"p\",{children:T===\"accepted\"?\"New posts appear under New. Hacker News may point you to an existing discussion of the same link.\":\"Hacker News went to another page, so the app can't tell whether the post went through.\"}),(0,oe.jsx)(\"button\",{type:\"button\",className:\"primary\",onClick:()=>u(`${ie}/newest`),children:\"See New\"}),(0,oe.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:Y,children:\"Post another\"})]})]});let M;return d?M=(0,oe.jsxs)(\"form\",{className:\"form\",onSubmit:F=>{F.preventDefault(),A&&_()},children:[d.error&&(0,oe.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:d.error}),(0,oe.jsxs)(\"label\",{children:[\"Title\",(0,oe.jsx)(\"input\",{value:i,maxLength:80,required:!0,onChange:F=>o(F.target.value)}),(0,oe.jsxs)(\"span\",{className:\"meta\",children:[i.trim().length,\" of \",80]})]}),(0,oe.jsxs)(\"label\",{children:[\"URL\",(0,oe.jsx)(\"input\",{type:\"url\",inputMode:\"url\",value:c,\"aria-invalid\":C!==null,onChange:F=>f(F.target.value)}),C&&(0,oe.jsx)(\"span\",{className:\"field-error\",children:C})]}),(0,oe.jsxs)(\"label\",{children:[\"Text\",(0,oe.jsx)(\"textarea\",{rows:6,value:g,onChange:F=>m(F.target.value)})]}),(0,oe.jsx)(\"p\",{className:\"meta\",children:\"Leave the URL blank to ask a question. With a URL, the text appears as the first comment.\"}),p&&(0,oe.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:p}),(0,oe.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:!A,children:r?\"Posting\\u2026\":\"Post\"}),(0,oe.jsx)(\"button\",{type:\"button\",className:\"text-button\",onClick:()=>u(`${ie}/newsguidelines.html`),children:\"Read the guidelines\"})]}):M=e.status===\"error\"?(0,oe.jsx)(zt,{error:e.error}):e.status===\"ready\"?(0,oe.jsx)(zt,{error:{code:\"NOT_FOUND\",message:\"Hacker News didn't show its submit form.\"}}):(0,oe.jsx)(Ue,{label:\"Loading the post form\",rows:3,kind:\"text\"}),(0,oe.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,oe.jsx)(\"h1\",{className:\"screen-title\",children:\"Post\"}),M]})}var dt=U(mt(),1);var q=U(J(),1),LS=[\"DEADLINE\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\"];function BS(e){try{let t=JSON.parse(e??\"\");return ui(t?.itemId)&&typeof t.title==\"string\"?t:null}catch{return null}}function u0(){let{screen:e,back:t}=Ke(),{storage:n,bookmarkRepository:l,categoryRepository:a}=ci(),u=(0,dt.useMemo)(()=>BS(e?.params.snapshot),[e?.params.snapshot]),i=e?.params.fresh===\"1\",[o,c]=(0,dt.useState)(null),[f,g]=(0,dt.useState)(null),[m,r]=(0,dt.useState)(!1),[s,p]=(0,dt.useState)(0),[b,T]=(0,dt.useState)(!1),[v,d]=(0,dt.useState)(\"\"),[h,S]=(0,dt.useState)(\"\"),[O,C]=(0,dt.useState)(!1),[A,_]=(0,dt.useState)(!1),Y=async()=>{let[re,Se]=await Promise.all([l.get(u.itemId),a.read()]);return c({previous:re,categories:Se}),g(at=>at??Xl(re?.value.categoryIds??[],Se)),r(!1),Se};if((0,dt.useEffect)(()=>{if(!u)return;let re=!0;return Promise.all([l.get(u.itemId),a.read()]).then(([Se,at])=>{re&&(c({previous:Se,categories:at}),g($e=>$e??Xl(Se?.value.categoryIds??[],at)),r(!1))},Se=>{re&&(d(vn(Se)),r(!0))}),()=>{re=!1}},[u,l,a,s]),!u)return(0,q.jsx)(\"div\",{className:\"screen\",children:(0,q.jsx)(Ie,{title:\"Can't save this story\",role:\"alert\",children:(0,q.jsx)(\"p\",{children:\"The story details are missing.\"})})});let M=o?.previous??null,F=!o&&!m,Fe=b||F||m,Ct=async re=>{if(!(Fe||!o||!f)){T(!0),d(\"\");try{if(re&&M)await l.remove(M);else{let Se=Xl(f,o.categories);await l.save(u,M,{refresh:O&&i,categoryIds:Se,checks:Zh(o.categories,Se)})}t()}catch(Se){let at=Se.code??\"\";if(d(vn(Se)),at===\"CONFLICT\"||LS.includes(at))try{await Y(),d(at===\"CONFLICT\"?\"This story or its categories changed. Review the current record and your selections, then try again.\":\"The result of the save was uncertain. The current record was reloaded. Review it before retrying.\")}catch{r(!0),d(\"The current record could not be reloaded. Reload it before retrying.\")}}finally{T(!1)}}},Zl=async()=>{if(!Fe){T(!0),d(\"\");try{let re=await a.create(h);await Y(),g(Se=>[...new Set([...Se??[],re])]),S(\"\"),d(\"Category created. Save to apply your selection.\")}catch(re){try{await Y(),d(`${vn(re)} Categories were reloaded; review them before retrying.`)}catch{r(!0),d(\"The new category could not be confirmed. Reload before retrying.\")}}finally{T(!1),n.refresh()}}};return(0,q.jsxs)(we,{className:\"screen\",children:[(0,q.jsx)(\"p\",{className:\"eyebrow\",children:\"Saved stories\"}),(0,q.jsx)(\"h1\",{className:\"screen-title\",children:M?\"Edit saved story\":\"Save story\"}),(0,q.jsxs)(\"section\",{className:\"card\",children:[(0,q.jsx)(\"p\",{className:\"story-title\",children:M?.value.title??u.title}),(0,q.jsxs)(\"p\",{className:\"meta\",children:[u.submitter?`By ${u.submitter} \\xB7 `:\"\",\"HN item \",u.itemId]}),(0,q.jsx)(\"p\",{className:\"meta\",children:\"Saved in Genesis, separate from your HN favorites.\"})]}),F&&(0,q.jsx)(Ue,{label:\"Loading saved state\",rows:3,kind:\"text\"}),o&&f&&(0,q.jsxs)(\"fieldset\",{className:\"card\",disabled:Fe,children:[(0,q.jsx)(\"legend\",{children:\"Categories\"}),o.categories.categories.length===0&&(0,q.jsx)(\"p\",{className:\"meta\",children:\"No categories yet. Saving without one files the story under Uncategorized.\"}),o.categories.categories.map(re=>(0,q.jsxs)(\"label\",{className:\"check\",children:[(0,q.jsx)(\"input\",{type:\"checkbox\",checked:f.includes(re.value.id),onChange:Se=>{let at=re.value.id;g($e=>Se.target.checked?[...$e??[],at]:($e??[]).filter(Wa=>Wa!==at))}}),re.value.name]},re.value.id)),(0,q.jsxs)(\"div\",{className:\"row\",children:[(0,q.jsxs)(\"label\",{className:\"grow\",children:[(0,q.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,q.jsx)(\"input\",{placeholder:\"New category\",value:h,onChange:re=>S(re.target.value)})]}),(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:!h.trim(),onClick:()=>{Zl()},children:\"Create\"})]}),(0,q.jsx)(\"p\",{className:\"meta\",children:\"A new category is kept even if you leave without saving.\"})]}),M&&i&&(0,q.jsxs)(\"label\",{className:\"check\",children:[(0,q.jsx)(\"input\",{type:\"checkbox\",checked:O,disabled:b,onChange:re=>C(re.target.checked)}),\"Update the title and link from Hacker News\"]}),v&&(0,q.jsx)(\"p\",{role:\"status\",className:\"status\",children:v}),m&&(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:b,onClick:()=>{d(\"\"),p(re=>re+1)},children:\"Reload saved state\"}),(0,q.jsxs)(\"div\",{className:\"actions\",children:[(0,q.jsx)(\"button\",{type:\"button\",className:\"primary\",disabled:Fe,onClick:()=>{Ct(!1)},children:b?\"Saving\\u2026\":M?\"Save changes\":\"Save\"}),(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:b,onClick:t,children:\"Cancel\"}),M&&!A&&(0,q.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:Fe,onClick:()=>_(!0),children:\"Remove from Saved\"})]}),A&&(0,q.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":\"Confirm removal\",children:[(0,q.jsx)(\"p\",{children:\"Remove this saved story? This can't be undone.\"}),(0,q.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:b,onClick:()=>{Ct(!0)},children:\"Remove story\"}),(0,q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:b,onClick:()=>_(!1),children:\"Keep story\"})]})]})}var cc=U(mt(),1);var le=U(J(),1),qS=(e,t,n)=>{let l=Xl(e.categoryIds,n);return t===\"all\"||(t===\"uncategorized\"?l.length===0:l.includes(t))};function i0(){let{screen:e,navigate:t}=Ke(),n=ic(),[l,a]=(0,cc.useState)(\"\"),u=n.categories,i=e?.params.filter,o=u?.categories.some(m=>m.value.id===i)||i===\"uncategorized\"?i:\"all\",c=m=>t({screen:\"saved\",params:{filter:m},mode:\"replace\"}),f=(0,cc.useMemo)(()=>{if(!u)return[];let m=l.trim().toLowerCase();return n.bookmarks.filter(r=>qS(r.value,o,u)&&(!m||r.value.title.toLowerCase().includes(m)))},[n.bookmarks,u,o,l]),g;return!u&&n.error?g=(0,le.jsx)(Ie,{title:\"Couldn't load saved stories\",role:\"alert\",children:(0,le.jsx)(\"p\",{children:vn(n.error)})}):!u||n.loading?g=(0,le.jsx)(Ue,{label:\"Loading saved stories\"}):g=(0,le.jsxs)(le.Fragment,{children:[n.error!=null&&(0,le.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:vn(n.error)}),(0,le.jsx)(\"nav\",{className:\"chips\",\"aria-label\":\"Filter saved stories\",children:[{id:\"all\",name:\"All\"},{id:\"uncategorized\",name:\"Uncategorized\"},...u.categories.map(m=>m.value)].map(m=>(0,le.jsx)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":o===m.id,onClick:()=>c(m.id),children:m.name},m.id))}),(0,le.jsxs)(\"label\",{className:\"search-field\",children:[(0,le.jsx)(\"span\",{className:\"visually-hidden\",children:\"Filter by title\"}),(0,le.jsx)(\"input\",{type:\"search\",placeholder:\"Filter by title\",value:l,onChange:m=>a(m.target.value)})]}),f.length===0?(0,le.jsx)(Ie,{title:n.bookmarks.length===0?\"No saved stories\":\"No matches\",children:(0,le.jsx)(\"p\",{children:n.bookmarks.length===0?\"Use the bookmark button on any story to save it here.\":\"Try another filter or title.\"})}):f.map(m=>(0,le.jsx)(VS,{record:m,categories:u},m.key)),(0,le.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t({screen:\"categories\"}),children:\"Manage categories\"})]}),(0,le.jsxs)(we,{className:\"screen\",children:[(0,le.jsx)(\"h1\",{className:\"screen-title\",children:\"Saved\"}),g]})}function VS({record:e,categories:t}){let{navigate:n}=Ke(),l=Je(),a=e.value,u=Xl(a.categoryIds,t).map(i=>t.categories.find(o=>o.value.id===i).value.name);return(0,le.jsxs)(\"article\",{className:\"story saved\",children:[(0,le.jsxs)(\"div\",{className:\"story-body\",children:[(0,le.jsx)(\"h2\",{className:\"story-title\",children:(0,le.jsx)(\"a\",{href:a.articleUrl??a.discussionUrl,onClick:i=>{i.preventDefault(),l(a.articleUrl??a.discussionUrl)},children:a.title})}),(0,le.jsx)(ii,{parts:[a.submitter&&(0,le.jsx)(\"a\",{href:gn(a.submitter),onClick:i=>{i.preventDefault(),l(gn(a.submitter))},children:a.submitter}),(0,le.jsx)(\"a\",{href:a.discussionUrl,onClick:i=>{i.preventDefault(),l(a.discussionUrl)},children:\"discussion\"}),u.length>0?u.join(\", \"):\"Uncategorized\"]})]}),(0,le.jsx)(\"button\",{type:\"button\",className:\"text-button\",\"aria-label\":`Edit saved story: ${a.title}`,onClick:()=>n({screen:\"save\",params:{snapshot:JSON.stringify(a)}}),children:\"Edit\"})]})}var $a=U(J(),1);function o0(){return(0,$a.jsxs)(\"div\",{className:\"screen\",children:[(0,$a.jsx)(\"h1\",{className:\"screen-title\",children:\"Search\"}),(0,$a.jsx)(Ie,{title:\"Search is coming\",children:(0,$a.jsx)(\"p\",{children:\"This space will connect to a separate search site. For now, browse Home or your Saved stories.\"})})]})}var ce=U(J(),1);function c0(){let e=qt(),t=At(\"profile\",null),n=Je(),l=e.pageId===\"user\"?t?.data??null:null;if(!l)return(0,ce.jsx)(\"div\",{className:\"screen\",\"aria-busy\":e.status===\"loading\",children:e.status===\"error\"?(0,ce.jsx)(zt,{error:e.error}):e.status===\"ready\"&&e.pageId===\"user\"?(0,ce.jsx)(Ie,{title:\"No such user\",children:(0,ce.jsx)(\"p\",{children:\"Hacker News has no profile with this name.\"})}):(0,ce.jsx)(Ue,{label:\"Loading profile\",rows:4,kind:\"text\"})});let a=encodeURIComponent(l.name);return(0,ce.jsxs)(we,{className:\"screen\",\"aria-busy\":e.stale,children:[e.status===\"error\"&&(0,ce.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),(0,ce.jsx)(\"h1\",{className:\"screen-title\",children:l.name}),(0,ce.jsxs)(\"dl\",{className:\"facts\",children:[l.karma&&(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(\"dt\",{children:\"Karma\"}),(0,ce.jsx)(\"dd\",{children:l.karma})]}),l.created&&(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(\"dt\",{children:\"Joined\"}),(0,ce.jsx)(\"dd\",{children:l.created})]})]}),l.about.length>0&&(0,ce.jsxs)(\"section\",{className:\"card\",children:[(0,ce.jsx)(\"h2\",{className:\"section-title\",children:\"About\"}),(0,ce.jsx)(ml,{parts:l.about})]}),(0,ce.jsxs)(\"nav\",{className:\"list\",\"aria-label\":`${l.name} on Hacker News`,children:[(0,ce.jsx)(\"button\",{type:\"button\",onClick:()=>n(`${ie}/submitted?id=${a}`),children:\"Submissions\"}),(0,ce.jsx)(\"button\",{type:\"button\",onClick:()=>n(`${ie}/threads?id=${a}`),children:\"Comments\"}),(0,ce.jsx)(\"button\",{type:\"button\",onClick:()=>n(`${ie}/favorites?id=${a}`),children:\"Favorites\"})]})]})}var Hn=U(J(),1),YS={feed:e0,item:n0,user:c0,info:t0,search:o0,post:a0,saved:i0,categories:Jh,save:u0,me:l0},kS=[{id:\"primary\",label:\"Home\",icon:\"home\",context:!0},{id:\"search\",label:\"Search\",icon:\"search\",context:!1},{id:\"post\",label:\"Post\",icon:\"post\",context:!0},{id:\"saved\",label:\"Saved\",icon:\"bookmark\",context:!1},{id:\"me\",label:\"Me\",icon:\"person\",context:!0}];function r0(){let{screen:e,active:t,overlay:n,select:l,navigate:a}=Ke(),u=e?YS[e.id]:void 0,i=n[0]?.id,o=i===\"search\"||i===\"saved\"?i:n.length>0?null:t;return(0,Hn.jsxs)(\"div\",{className:\"app\",children:[(0,Hn.jsx)(\"main\",{className:\"content\",children:u&&(0,Hn.jsx)(u,{},e.key)}),(0,Hn.jsx)(\"nav\",{className:\"tabs\",\"aria-label\":\"Sections\",children:kS.map(c=>{let f=c.id===o;return(0,Hn.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":f?\"page\":void 0,onClick:()=>c.context?l(c.id):a({screen:c.id,mode:\"root\"}),children:[(0,Hn.jsx)(Ia,{name:c.icon,filled:f}),(0,Hn.jsx)(\"span\",{children:c.label})]},c.id)})})]})}var s0=U(J(),1);Gh((0,s0.jsx)(r0,{}));})();\n"},{"path":"index.html","encoding":"utf8","content":"\n\n\n\n\nHacker News\n\n\n\n\n
\n\n\n\n"}]} \ No newline at end of file diff --git a/hn-bookmarks/published/applet-hn-bookmarks.release.json b/hn-bookmarks/published/applet-hn-bookmarks.release.json index 0d983f9..bc2668a 100644 --- a/hn-bookmarks/published/applet-hn-bookmarks.release.json +++ b/hn-bookmarks/published/applet-hn-bookmarks.release.json @@ -2,10 +2,10 @@ "releaseFormat": 1, "appletId": "hn-bookmarks", "name": "Hacker News", - "version": "0.1.0", + "version": "0.0.0", "bundle": { "file": "applet-hn-bookmarks.bundle.json", - "sha256": "22df9e1db4ebe8248f8bd08517b57dc628eb0323f09c70056b01c559b1ec617c", + "sha256": "772317249424139b71793ca729b7eee7dda32eb8c8e763680fa5375fd530c509", "size": 353552 }, "compat": { @@ -15,7 +15,7 @@ "adapterApi": 1, "sdk": "0.0.0", "tools": "0.0.0", - "builtAt": "2026-11-09T11:21:14Z" + "builtAt": "2026-11-09T13:08:06Z" }, "origins": [ "https://news.ycombinator.com" @@ -27,7 +27,7 @@ ] }, "toolchain": { - "genesisCommit": "655ce128bce13bd8a376a3630766fb18182ba928", + "genesisCommit": "aebef4c113b0fc4fc676435237eb027e2035f816", "node": "24.15.0", "tools": "0.0.0", "sdk": "0.0.0" @@ -36,5 +36,5 @@ "fullName": "nirvanacp/applets", "path": "hn-bookmarks" }, - "builtAt": "2026-11-09T11:21:14Z" + "builtAt": "2026-11-09T13:08:06Z" } From 91a551f34a9a4295d62f2b4695b26856567941e5 Mon Sep 17 00:00:00 2001 From: Rit Date: Mon, 9 Nov 2026 18:38:27 +0530 Subject: [PATCH 8/9] feat/(x-bookmarks): reset the version to 0.0.0 and republish Co-Authored-By: Claude Opus 5.5 --- .../2026-11-09-183819-reset-version-0.0.0.md | 6 ++++++ x-bookmarks/.specs/current.md | 2 +- x-bookmarks/package.json | 2 +- x-bookmarks/published/applet-x-bookmarks.bundle.json | 2 +- x-bookmarks/published/applet-x-bookmarks.release.json | 10 +++++----- 5 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 x-bookmarks/.changelog/2026-11-09-183819-reset-version-0.0.0.md diff --git a/x-bookmarks/.changelog/2026-11-09-183819-reset-version-0.0.0.md b/x-bookmarks/.changelog/2026-11-09-183819-reset-version-0.0.0.md new file mode 100644 index 0000000..933522c --- /dev/null +++ b/x-bookmarks/.changelog/2026-11-09-183819-reset-version-0.0.0.md @@ -0,0 +1,6 @@ +# Reset the version to 0.0.0 + +- Goal: Start the applet's version history at 0.0.0 before its first pushed release, as the developer asked for every applet in this collection. +- Changes: `package.json` version 0.1.0 became 0.0.0. `genesis-applet publish` rewrote `published/applet-x-bookmarks.bundle.json` (SHA-256 `80e6fb3079decb5d…`, 357380 bytes) and `published/applet-x-bookmarks.release.json` for 0.0.0, built with Genesis commit `aebef4c113b0`. The current spec names the new published version. Sources, id, service ids and stored data are unchanged. +- Decisions: The developer chose 0.0.0 as the starting version. The local tag `x-bookmarks/v0.1.0` was never pushed, so it was deleted; the release tool would otherwise refuse 0.0.0 as lower than the last tag. No new tag was created. Later changes raise the patch version before each pull request and ask the developer before a minor or major raise, per the Genesis applet builder instructions. +- Verification: `genesis-applet publish` passed its checks. The Genesis commit must be pushed before CI can rebuild this build at that commit. diff --git a/x-bookmarks/.specs/current.md b/x-bookmarks/.specs/current.md index 75046e3..8defc86 100644 --- a/x-bookmarks/.specs/current.md +++ b/x-bookmarks/.specs/current.md @@ -6,7 +6,7 @@ - Three contexts, each with its own website session history: `primary` (Home, Notifications and Saved, start URL `/home`), `explore` (`/explore`) and `account` (`/settings/account`, the Profile tab). The adapter is [src/adapter.ts](../src/adapter.ts) with pages `timeline`, `post`, `profile`, `explore`, `media` and `account` in [src/adapter](../src/adapter). - Screens: route screens `home`, `notifications`, `saved`, `explore`, `post`, `profile`, `media` and `account`; overlay screens `categories`, `save` and `manage`. Service: `bookmarks`. - Manifest schema 6, `@genesis/sdk` 0.0.0, `genesis-applet` tools 0.0.0, protocol 1, adapter API 1. Kit version: not exported for this in-repository applet. The [manifest](../applet.json) is the authority for routes and contexts. -- Published release: version 0.1.0, tag `x-bookmarks/v0.1.0`, build and release record in `published/` (built with Genesis `655ce128bce1`). Raise the version and run `genesis-applet publish` again before the next release. +- Published release: version 0.0.0, build and release record in `published/` (built with Genesis `aebef4c113b0`), not tagged yet. Before a pull request that changes this applet, raise the version and run `genesis-applet publish` again. - Installed for development with `dev install`; it is not bundled into the APK. ## Product scope diff --git a/x-bookmarks/package.json b/x-bookmarks/package.json index 74e41f1..9ef5aeb 100644 --- a/x-bookmarks/package.json +++ b/x-bookmarks/package.json @@ -1,6 +1,6 @@ { "name": "@genesis/applet-x", - "version": "0.1.0", + "version": "0.0.0", "private": true, "type": "module", "scripts": { diff --git a/x-bookmarks/published/applet-x-bookmarks.bundle.json b/x-bookmarks/published/applet-x-bookmarks.bundle.json index 27dd909..887afa8 100644 --- a/x-bookmarks/published/applet-x-bookmarks.bundle.json +++ b/x-bookmarks/published/applet-x-bookmarks.bundle.json @@ -1 +1 @@ -{"envelope":1,"bundle":{"format":3,"compat":{"manifestSchema":6,"bundleFormat":3,"protocol":1,"adapterApi":1,"sdk":"0.0.0","tools":"0.0.0","builtAt":"2026-11-09T11:21:14Z"},"manifest":{"schemaVersion":6,"id":"x-bookmarks","name":"X","origins":["https://x.com"],"foreground":{"entry":"src/main.tsx","screens":["home","explore","notifications","saved","post","profile","media","account","categories","save","manage"]},"adapter":"src/adapter.ts","contexts":[{"id":"primary","startUrl":"https://x.com/home"},{"id":"explore","startUrl":"https://x.com/explore"},{"id":"account","startUrl":"https://x.com/settings/account"}],"routes":[{"id":"home","pattern":"/home","page":"timeline","screen":"home","context":"primary"},{"id":"notifications","pattern":"/notifications","page":"timeline","screen":"notifications","context":"primary"},{"id":"bookmarks","pattern":"/i/history","page":"timeline","screen":"saved","context":"primary"},{"id":"own-likes","pattern":"/i/history/likes","page":"timeline","screen":"saved","context":"primary"},{"id":"bookmarks-alias","pattern":"/i/bookmarks","page":"timeline","screen":"saved","context":"primary"},{"id":"explore","pattern":"/explore/*","page":"explore","screen":"explore","context":"explore"},{"id":"search","pattern":"/search","query":["q"],"page":"explore","screen":"explore","context":"explore"},{"id":"hashtag","pattern":"/hashtag/:tag","page":"explore","screen":"explore","context":"explore"},{"id":"account","pattern":"/settings/account","page":"account","screen":"account","context":"account"},{"id":"photo","pattern":"/:handle/status/:id/photo/:index","page":"media","screen":"media"},{"id":"post","pattern":"/:handle/status/:id","page":"post","screen":"post"},{"id":"likes","pattern":"/:handle/likes","page":"timeline","screen":"saved"},{"id":"replies","pattern":"/:handle/with_replies","page":"profile","screen":"profile"},{"id":"profile-media","pattern":"/:handle/media","page":"profile","screen":"profile"},{"id":"profile","pattern":"/:handle","page":"profile","screen":"profile"}],"capabilities":{"storage":true,"services":[{"id":"bookmarks","config":"backend/service.json"}]},"shell":{"accent":"#1d9bf0"}},"files":[{"path":"adapter.js","sha256":"6919c36aefa790f8a6dba84682ce9630a451098181856cac4600503e4e8ec540"},{"path":"assets/x.png","sha256":"7b11fa53318a4ae13d8fe37d7720c435209990edd274e39ff7111d068ef44d66"},{"path":"foreground.css","sha256":"57538bd3fd841af3d98f7954bd826e4c1e408cfef647dba0ee4ca8badf9e0ca9"},{"path":"foreground.js","sha256":"33ff4e5715c2bddbbb88aec97fbaca57bac2b034c2de8db7ba03ecce1183836e"},{"path":"index.html","sha256":"f5ba0d8e362f8a300a7c903ef44798981b18c35394edde0de326012f1cb2bad5"}]},"entries":[{"path":"adapter.js","encoding":"utf8","content":"(()=>{var j={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1};var At=/^:[A-Za-z][A-Za-z0-9_]*$/,Et=/^[A-Za-z0-9_.~@-]+$/,me=new Map;function It(e){if(me.has(e))return me.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),r=n.at(-1)===\"*\";r&&n.pop();let i=[],o=!0;for(let s of n)At.test(s)?i.push({param:s.slice(1)}):Et.test(s)&&s!==\".\"&&s!==\"..\"?i.push({literal:s}):o=!1;o&&(t={segments:i,rest:r})}return me.set(e,t),t}function ye(e){try{return new URL(e).href}catch{return null}}function we(e,t){let n=Tt(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let r;try{r=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}r.at(-1)===\"\"&&r.pop();for(let i of e.routes){let o=It(i.pattern);if(!o)continue;let s=St(o,r);if(!s||!(i.query??[]).every(u=>n.searchParams.has(u)))continue;for(let u of i.query??[])s[u]=n.searchParams.get(u);let c={kind:\"route\",routeId:i.id,page:i.page,screen:i.screen,params:s};return i.context!==void 0&&(c.context=i.context),c}return{kind:\"website\",url:t}}function Tt(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function St(e,t){if(e.rest?t.length{let i=null,o=!1,s=1,c=new Map,u=new Map,d={get bound(){return i},get retired(){return o},request(k,h={}){if(o)return Promise.reject(new O(\"RETIRED\",\"This page was closed\"));let v=s++;return new Promise((N,D)=>{let L=setTimeout(()=>{c.delete(v),D(new O(\"DEADLINE\",`${k} did not answer in time`))},i.limits.rpcDeadlineMs+Ot);c.set(v,{resolve:N,reject:D,timer:L}),e.postMessage(JSON.stringify({type:\"request\",documentId:i.documentId,requestId:v,method:k,params:h}))})},on(k,h){let v=u.get(k);return v||u.set(k,v=new Set),v.add(h),()=>{v.delete(h)}}};function f(){o=!0;for(let k of c.values())clearTimeout(k.timer),k.reject(new O(\"RETIRED\",\"This page was closed\"));c.clear()}function g(k,h){for(let v of[...u.get(k)??[]])try{v(h)}catch(N){console.error(`Genesis ${k} handler failed`,N)}}e.addEventListener(\"message\",k=>{if(o||typeof k.data!=\"string\")return;let h;try{h=JSON.parse(k.data)}catch{return}if(h?.type===\"refused\"&&!i){o=!0,r(new O(h.error?.code??\"PROTOCOL_MISMATCH\",h.error?.message??\"The host refused this page\"));return}if(h?.type===\"bound\"){if(i)return;i=h,n(d);return}if(!(!i||h?.documentId!==i.documentId))if(h.type===\"response\"){let v=c.get(h.requestId);if(!v)return;c.delete(h.requestId),clearTimeout(v.timer),h.error?v.reject(new O(h.error.code,h.error.message)):v.resolve(h.result??null)}else h.type===\"event\"&&(h.name===\"retired\"?(f(),g(\"retired\",{})):g(h.name,h.data))}),addEventListener(\"pagehide\",()=>{o||(g(\"pagehide\",{}),f())});let y={type:\"hello\",protocol:j.protocol,url:t};e.postMessage(JSON.stringify(y))})}var Nt=100;function Mt(e){let t=new Map,n=Promise.resolve();return{act(r){let i={request:r,arrived:Date.now(),view:e.view(),cancelled:!1,dispatched:!1,stopped:!1};t.set(r.actionId,i),n=n.then(()=>_t(e,i)).catch(o=>{console.error(\"Genesis action failed\",o)}).finally(()=>{t.delete(r.actionId)})},cancel(r){let i=t.get(r);i&&!i.dispatched&&(i.cancelled=!0)},retire(){for(let r of t.values())r.stopped=!0}}}async function _t(e,t){let{connection:n,limits:r}=e,{actionId:i}=t.request,o,s=(E,T,C)=>{if(t.stopped)return Promise.resolve();let M={actionId:i,state:E};return C&&(M.navigating=!0),C&&o&&(M.expect=o),T&&(M.result=T),n.request(\"context.actionResult\",M).then(()=>{},()=>{})},c=(E,T,C)=>{let M={outcome:\"failed\",code:E,message:T};return C!==void 0&&Object.assign(M,{completedSteps:C,partial:C>0}),s(\"failed\",M)},u=()=>s(\"cancelled\",{outcome:\"cancelled\"});if(t.stopped)return;if(t.cancelled)return u();if((t.request.view??t.view)!==t.view||e.view()!==t.view)return c(\"CONTEXT_REPLACED\",\"The page the action was for has been replaced\");let d=e.find(t.request);if(\"error\"in d)return c(d.error.code,d.error.message);let f=d.element();if(f===void 0)return c(\"TARGET_NOT_FOUND\",\"The item is no longer on the page\");let g;try{g=d.action(f,t.request.args)}catch(E){return c(\"INVALID_STEPS\",je(E))}if(typeof g?.then==\"function\")return c(\"INVALID_STEPS\",\"An action must return its steps synchronously\");if(g&&\"satisfied\"in g&&g.satisfied===!0)return s(\"observed\",{outcome:\"observed\",noop:!0});let y=Rt(g);if(y)return c(\"INVALID_STEPS\",y);let{steps:k,until:h,deadlineMs:v}=g;o=g.expect;let N=g.navigates===!0||Ze(k.at(-1)),D=t.arrived+(v??r.actionTimeoutMs),L=0,W=E=>(t.dispatched=!0,s(\"dispatched\",void 0,E)),Q=n.on(\"pagehide\",()=>{!t.dispatched&&!t.stopped&&L>0&&W(!0),t.stopped=!0}),ee=()=>t.stopped||t.cancelled;try{for(let[E,T]of k.entries()){if(t.stopped)return;if(t.cancelled)return u();if(Date.now()>=D)return c(\"DEADLINE\",\"The action did not finish in time\",L);if(E>0&&Fe(k[E-1])&&d.element()===void 0)return c(\"TARGET_NOT_FOUND\",\"The item left the page during the action\",L);if(N&&E===k.length-1&&!Fe(T)){if(be(T),await W(!0),t.stopped)return;be(T)();return}await Pt(T,D,ee),L++}if(t.stopped)return;if(t.cancelled)return u();if(await W(N),N)return;if(h!==void 0){let E=typeof h==\"string\"?()=>document.querySelector(h)!==null:()=>h(document)===!0;try{await ve(E,D-Date.now(),\"the action to take effect\",()=>t.stopped)}catch{return s(\"failed\",{outcome:\"unknown\",code:\"DEADLINE\",message:\"The page did not show the action's effect in time\",completedSteps:L,partial:L>0})}}if(t.stopped)return;e.flush(),await s(\"observed\",{outcome:\"observed\"})}catch(E){let T=E instanceof O?E.code:\"INVALID_ARGUMENT\";return c(T,je(E),L)}finally{Q()}}function Rt(e){if(typeof e!=\"object\"||e===null)return\"An action must return { satisfied: true } or { steps }\";let{steps:t,until:n}=e;if(!Array.isArray(t))return\"An action must return { satisfied: true } or { steps }\";for(let[r,i]of t.entries()){let o=Lt(i);if(o)return`Step ${r}: ${o}`;if(Ze(i)&&r!==t.length-1)return\"A navigate or submit step must be the last step\"}return n!==void 0&&typeof n!=\"string\"&&typeof n!=\"function\"?\"until must be a selector or a function\":null}function Lt(e){if(typeof e!=\"object\"||e===null)return\"must be an object\";let t=e,n=r=>typeof r==\"string\"&&r!==\"\";if(\"click\"in t)return n(t.click)?null:\"click needs a selector\";if(\"fill\"in t)return n(t.fill)&&typeof t.value==\"string\"?null:\"fill needs a selector and a string value\";if(\"submit\"in t)return n(t.submit)?null:\"submit needs a selector\";if(\"navigate\"in t)return n(t.navigate)?null:\"navigate needs a URL\";if(\"waitFor\"in t||\"waitForUrl\"in t)return n(t.waitFor??t.waitForUrl)&&typeof t.timeoutMs==\"number\"?null:\"a wait needs a selector or pattern and timeoutMs\";if(\"scroll\"in t){let r=t.scroll;return r&&n(r.target)&&(r.to===\"end\"||typeof r.to==\"number\")?null:\"scroll needs a target and to\"}return\"unknown step\"}var Ze=e=>e!==void 0&&(\"navigate\"in e||\"submit\"in e),Fe=e=>\"waitFor\"in e||\"waitForUrl\"in e,je=e=>String(e?.message??e);function te(e){let t=document.querySelector(e);if(!t)throw new O(\"NOT_FOUND\",`Nothing matches ${e}`);return t}async function Pt(e,t,n){let r=()=>Math.max(0,t-Date.now());if(\"waitFor\"in e)await ve(()=>document.querySelector(e.waitFor)!==null,Math.min(e.timeoutMs,r()),e.waitFor,n);else if(\"waitForUrl\"in e){let i=new RegExp(e.waitForUrl);await ve(()=>i.test(location.href),Math.min(e.timeoutMs,r()),e.waitForUrl,n)}else be(e)()}function be(e){if(\"click\"in e){let t=te(e.click);return()=>t.click()}if(\"fill\"in e){let t=te(e.fill);return()=>$t(t,e.value)}if(\"submit\"in e){let t=te(e.submit),n=t instanceof HTMLFormElement?t:t.closest(\"form\");if(!n)throw new O(\"NOT_FOUND\",`${e.submit} is not in a form`);let r=t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t:void 0;return()=>n.requestSubmit(r)}if(\"navigate\"in e){let t=e.navigate;return()=>location.assign(t)}if(\"scroll\"in e){let{target:t,to:n}=e.scroll,r=t===\"window\"?document.scrollingElement??document.documentElement:te(t);return()=>{r.scrollTop=n===\"end\"?r.scrollHeight:n}}throw new O(\"INVALID_STEPS\",\"A wait step does not run on its own\")}function $t(e,t){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new O(\"INVALID_STEPS\",\"fill needs an input or textarea\");let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(n,\"value\")?.set?.call(e,t),e.dispatchEvent(new Event(\"input\",{bubbles:!0})),e.dispatchEvent(new Event(\"change\",{bubbles:!0}))}function ve(e,t,n,r){let i=Date.now()+t;return new Promise((o,s)=>{let c=()=>{try{return e()}catch{return!1}},u=()=>{r()||c()?o():Date.now()>=i?s(new O(\"DEADLINE\",`Timed out waiting for ${n}`)):setTimeout(u,Nt)};u()})}var He=new WeakMap;function Ve(e){let t=He.get(e);return t===void 0&&He.set(e,t=JSON.stringify(e)),t}function Ae(e,t){return e===t?!0:e!==null&&t!==null&&Ve(e)===Ve(t)}function re(e,t){return e?.code===t?.code&&e?.message===t?.message}function Dt(e,t){if(e.kind!==t.kind)return{kind:\"replace\",region:t};if(t.kind===\"single\"){let f=e;if(Ae(f.record,t.record)&&f.status===t.status&&re(f.error,t.error))return null;let g={kind:\"single\",record:t.record};return f.status!==t.status&&(g.status=t.status),re(f.error,t.error)||(g.error=t.error??null),g}let n=e;if(!!n.ephemeral!=!!t.ephemeral||t.ephemeral)return Ct(n,t)?null:{kind:\"replace\",region:t};let r=new Map(n.items.map(f=>[f.key,f])),i=new Set,o=[];for(let f of t.items){i.add(f.key);let g=r.get(f.key);(!g||!Ae(g,f))&&o.push(f)}let s=n.items.filter(f=>!i.has(f.key)).map(f=>f.key),c=t.items.map(f=>f.key),u=c.length!==n.items.length||c.some((f,g)=>n.items[g].key!==f),d={kind:\"collection\"};return o.length&&(d.upsert=o),s.length&&(d.remove=s),u&&(d.order=c),n.complete!==t.complete&&(d.complete=t.complete),n.status!==t.status&&(d.status=t.status),re(n.error,t.error)||(d.error=t.error??null),Object.keys(d).length>1?d:null}function Ct(e,t){return e.complete===t.complete&&e.status===t.status&&re(e.error,t.error)&&!!e.ephemeral==!!t.ephemeral&&e.items.length===t.items.length&&e.items.every((n,r)=>Ae(n,t.items[r]))}function Ut(e,t,n=1/0){let r=e.slice(),i=s=>r.findIndex(c=>c.key===s),o=-1;for(let[s,c]of t.entries()){let u=i(c.key);if(u!==-1){r[u]=c,o=u;continue}let d=o+1;o===-1&&(d=t.slice(s+1).map(g=>i(g.key)).find(g=>g!==-1)??r.length),r.splice(d,0,c),o=d}return r.length>n?Xe(r,new Set(t.map(s=>s.key)),n):r}function Xe(e,t,n){if(e.length<=n)return e;let r=-1,i=0;for(let[c,u]of e.entries())t.has(u.key)&&(r===-1&&(r=c),i=c);r===-1&&(r=0);let o=Math.max(n,i-r+1),s=Math.min(Math.max(0,Math.floor((r+i+1-o)/2)),e.length-o);return e.slice(s,s+o)}function qt(e){return new Set(e).size===e.length?{keys:e,ephemeral:!1}:{keys:e.map((t,n)=>String(n)),ephemeral:!0}}function Gt(e,t,n){let r=new Map,i=o=>{let s=r.get(o);return s||r.set(o,s={keys:new Set,whole:!1,membership:!1,resolve:!1}),s};for(let[o,s]of Object.entries(e)){let c=t.some(u=>u.kind===\"childList\");if(!s.root){c&&(i(o).resolve=!0);continue}if(!ke(s.root,n)){i(o).resolve=!0;continue}(s.dependsOn.some(u=>!ke(u,n))||s.dependsOnMissing&&c)&&(i(o).whole=!0);for(let u of t){if(u.kind===\"field\"&&!s.fields||u.kind===\"resize\"&&!s.measure)continue;u.removed&&ke(s.root,u.target)&&(i(o).whole=!0);let d=Ye(s,u.target);d.dependent&&(i(o).whole=!0),d.inRoot&&(u.kind===\"childList\"&&(i(o).membership=!0),d.key===void 0?i(o).whole=!0:i(o).keys.add(d.key))}}return r}function Bt(e,t){let n=Ye(e,t);return n.inRoot||n.dependent}function Ye(e,t){let n,r=!1,i=!1;for(let o=t;o;o=o.parentNode)n??=e.items.get(o),o===e.root&&(r=!0),e.dependsOn.includes(o)&&(i=!0);return n!==void 0&&(r=!0),{key:n,inRoot:r,dependent:i}}function ke(e,t){for(let n=e;n;n=n.parentNode)if(n===t)return!0;return!1}function Ft(e){let t=new MutationObserver(o=>{let s=[];for(let c of o){s.push({target:c.target,kind:c.type});for(let u of c.removedNodes)s.push({target:u,kind:\"childList\",removed:!0})}e(s)});t.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let n=o=>{o.target instanceof Node&&e([{target:o.target,kind:\"field\"}])};document.addEventListener(\"input\",n,!0),document.addEventListener(\"change\",n,!0);let r=new WeakMap,i=typeof ResizeObserver==\"function\"?new ResizeObserver(o=>{let s=[];for(let c of o){let u=`${c.contentRect.width}x${c.contentRect.height}`,d=r.get(c.target);r.set(c.target,u),d!==void 0&&d!==u&&s.push({target:c.target,kind:\"resize\"})}s.length&&e(s)}):null;return{measure(o){if(i){i.disconnect();for(let s of o)i.observe(s)}},disconnect(){t.disconnect(),i?.disconnect(),document.removeEventListener(\"input\",n,!0),document.removeEventListener(\"change\",n,!0)}}}function jt(e){for(let t of[\"pushState\",\"replaceState\"]){let n=History.prototype[t];History.prototype[t]=function(...r){let i=n.apply(this,r);try{e()}catch(o){console.error(\"Genesis navigation handler failed\",o)}return i}}addEventListener(\"popstate\",e),addEventListener(\"hashchange\",e)}var Ht=new TextEncoder,ne=e=>Ht.encode(JSON.stringify(e)).length,Vt=class{constructor(e,t,n=()=>null){this.send=e,this.limits=t,this.shrink=n}send;limits;shrink;epoch=0;seq=0;last=null;page(e){let t={...e,epoch:++this.epoch};for(;ne(t)>this.limits.pageMaxBytes;){let n=this.shrink(t);if(!n){t={...t,status:\"error\",error:{code:\"PAGE_TOO_LARGE\",message:\"The page is too large to show\"},regions:{}};break}t={...n,epoch:t.epoch}}this.seq=0,this.last=t,this.post({page:t})}update(e){let t=this.last;if(!t||!zt(t,e))return this.page(e);let n={};for(let[o,s]of Object.entries(e.regions)){let c=Dt(t.regions[o],s);c&&(n[o]=c)}let r=e.account!==void 0&&e.account!==t.account;if(!r&&Object.keys(n).length===0)return;let i=this.split(n);if(r&&(i[i.length-1].account=e.account),i.some(o=>ne(o)>this.limits.patchMaxBytes))return this.page(e);this.last={...e,epoch:this.epoch};for(let o of i)this.post({patch:o})}split(e){let t=[],n={};for(let[u,d]of Object.entries(e)){if(d.kind!==\"collection\"||!d.upsert){n[u]=d;continue}let{upsert:f,...g}=d;for(let y of f)t.push([u,y]);Object.keys(g).length>1&&(n[u]=g)}let r=this.limits.patchMaxBytes-ne(n)-256,i=[],o=[],s=0;for(let u of t){let d=ne(u[1])+1;o.length&&(o.length>=this.limits.patchRecordsMax||s+d>r)&&(i.push(o),o=[],s=0),o.push(u),s+=d}i.push(o);let c=this.last.view;return i.map((u,d)=>{let f={view:c,epoch:this.epoch,base:this.seq,seq:++this.seq,regions:{}};for(let[g,y]of u)(f.regions[g]??={kind:\"collection\",upsert:[]}).upsert.push(y);if(d===i.length-1)for(let[g,y]of Object.entries(n))f.regions[g]={...f.regions[g],...y};return f})}post(e){this.send(e).catch(t=>{let n=t instanceof O?t.code:null;if(n!==\"RETIRED\"){if(\"patch\"in e&&this.last&&e.patch.epoch===this.epoch){let{epoch:r,...i}=this.last;return this.page(i)}if(\"page\"in e&&n===\"PAGE_TOO_LARGE\"&&e.page.status!==\"error\"){let{epoch:r,...i}=e.page;return this.page({...i,status:\"error\",error:{code:n,message:\"The page is too large to show\"},regions:{}})}console.error(\"Genesis could not publish the page\",t)}})}};function zt(e,t){let n=Object.keys(t.regions);return e.view.generation===t.view.generation&&e.view.n===t.view.n&&e.view.url===t.view.url&&e.status===t.status&&e.pageId===t.pageId&&e.routeId===t.routeId&&e.error?.code===t.error?.code&&e.error?.message===t.error?.message&&e.signInUrl===t.signInUrl&&JSON.stringify(e.params)===JSON.stringify(t.params)&&n.length===Object.keys(e.regions).length&&n.every(r=>e.regions[r]?.kind===t.regions[r].kind)}function Kt(e,t,n){let r,i,o=()=>{clearTimeout(r),r=void 0,i=void 0,e()};return{schedule(){let s=Date.now();i??=s,clearTimeout(r),r=setTimeout(o,Math.min(t,Math.max(0,i+n-s)))},now(){r!==void 0&&o()},cancel(){clearTimeout(r),r=void 0,i=void 0}}}var Wt=1e4,ze=!1;function Ee(e){if(typeof window>\"u\"||window.top!==window||ze)return;ze=!0;let t=window,n=t.__genesisBridge;try{delete t.__genesisBridge}catch{t.__genesisBridge=void 0}if(!n)return;let r=null;jt(()=>r?.navigated());let i=()=>Be(n,location.href).then(o=>{r=Jt(o,e)},o=>console.error(\"Genesis could not bind this page\",o));i(),addEventListener(\"pageshow\",o=>{o.persisted&&(r?.stop(),r=null,i())})}function Jt(e,t){let{manifest:n,limits:r,generation:i}=e.bound,o={batches:0,reads:0,lastBatchReads:0,pages:0,patches:0,lastPublishBytes:0,resyncs:0,startedAt:Date.now()},s=!1;s&&(window.__genesisStats=o);let c=new Vt(a=>(s&&(\"page\"in a?o.pages++:o.patches++,o.lastPublishBytes=JSON.stringify(a).length),e.request(\"context.publish\",a)),r,xt),u={generation:i,n:0,url:location.href};if(e.bound.compat.adapterApi!==j.adapterApi){let a=`This applet uses adapter API ${j.adapterApi}; this Genesis uses ${e.bound.compat.adapterApi}`;return console.error(`Genesis: ${a}`),c.page({view:u,pageId:null,routeId:null,params:{},status:\"error\",error:{code:\"PROTOCOL_MISMATCH\",message:a},account:null,regions:{}}),{navigated(){},stop(){}}}let d=!1,f=ye(location.href),g=we(n,location.href),y=D(g),k=null,h=new Map,v=[],N=!1;function D(a){return a.kind===\"route\"?t.pages[a.page]??null:null}function L(){let a=y?.account??t.account;try{let l=a?.(document);return l===void 0&&a?{account:void 0,failed:!1}:{account:typeof l==\"string\"&&l!==\"\"?l:null,failed:!1}}catch(l){return console.error(\"Genesis adapter account failed\",l),{account:void 0,failed:!0}}}function W(){let a=t.signInUrl;try{if(typeof a==\"string\")return new URL(a,n.origins[0]).href;if(typeof a==\"function\")return new URL(a(location.href),location.href).href}catch(l){console.error(\"Genesis adapter signInUrl failed\",l)}return null}function Q({account:a,failed:l}){if(g.kind!==\"route\")return{status:\"unsupported\"};if(!y)return{status:\"error\",error:{code:\"NOT_FOUND\",message:`The adapter declares no page ${g.page}`}};let m;try{m=y.ready(document)===!0}catch(w){return{status:\"error\",error:{code:\"INVALID_ARGUMENT\",message:Je(w)}}}if(y.requiresAccount===!0&&l)return{status:\"loading\"};let p=y.requiresAccount===!0&&a===null;return m?{status:p?\"auth\":\"ready\"}:p&&document.readyState!==\"loading\"?{status:\"auth\"}:{status:\"loading\"}}function ee(a,l){let m={view:u,pageId:g.kind===\"route\"?g.page:null,routeId:g.kind===\"route\"?g.routeId:null,params:g.kind===\"route\"?g.params:{},status:l.status,signInUrl:W(),regions:{}};a!==void 0&&(m.account=a),l.error&&(m.error=l.error);for(let[p,w]of h)m.regions[p]=w.value;return m}function E(a,l,m){let p={name:a,def:l,root:null,items:new WeakMap,elements:new Map,dependsOn:[],dependsOnMissing:!1,value:m?.value??Zt(l)};for(let w of l.dependsOn??[]){let x=[...document.querySelectorAll(w)];x.length===0&&(p.dependsOnMissing=!0),p.dependsOn.push(...x)}return p.root=document.querySelector(l.root),T(p,()=>l.kind===\"collection\"?M(p,l,\"all\"):C(p,l)),p}function T(a,l){try{a.value=l()}catch(m){let p=m instanceof O?m.code:\"INVALID_ARGUMENT\";a.value={...a.value,status:\"error\",error:{code:p,message:`${a.name}: ${Je(m)}`}}}}function C(a,l){let m=a.root;return m?{kind:\"single\",status:\"ready\",record:$e(l,m,l.key?oe(l.key,m):a.name)}:{kind:\"single\",status:\"ready\",record:null}}function M(a,l,m){let p=a.value,w=a.root?[...a.root.querySelectorAll(l.items)]:[],{keys:x,ephemeral:b}=qt(w.map($=>oe(l.key,$))),A=p.ephemeral?new Map:new Map(p.items.map($=>[$.key,$])),_=a.elements;a.elements=new Map;let S=w.map(($,vt)=>{let J=x[vt];a.elements.set(J,$);let qe=A.get(J);return m!==\"all\"&&qe&&!m.has(J)&&_.get(J)===$?qe:Pe(a,l,$,J)}),G={kind:\"collection\",status:\"ready\",items:l.virtualized&&!b&&!p.ephemeral?Ut(p.items,S,r.patchRecordsMax):S,complete:xe(l)};return b&&(G.ephemeral=!0),G}function Pe(a,l,m,p){let w=$e(l,m,p);a.items.set(m,p);for(let x of l.extent?.(m)??[])x&&a.items.set(x,p);return w}function $e(a,l,m){o.reads++;let p=a.read(l);if(typeof p?.then==\"function\")throw new O(\"ASYNC_READ\",\"read must return its data synchronously\");let w={key:m,data:p===void 0?null:p};return a.entity&&(w.entity=a.entity(l)),a.entityType&&(w.entityType=a.entityType),w}function wt(a,l,m){let p=a.value;if(p.ephemeral||p.status===\"error\")return T(a,()=>M(a,l,m));let w=p.items.slice();for(let x of m){let b=a.elements.get(x),A=w.findIndex(S=>S.key===x);if(!(b?.isConnected&&a.root?.contains(b)&&b.matches(l.items))||A===-1||oe(l.key,b)!==x)return T(a,()=>M(a,l,m));try{w[A]=Pe(a,l,b,x)}catch{return T(a,()=>M(a,l,m))}}a.value={...p,items:w,complete:xe(l)}}function kt(a,l){let{def:m}=a;l.resolve||l.whole||m.kind===\"single\"?h.set(a.name,E(a.name,m,a)):l.membership?T(a,()=>M(a,m,l.keys)):wt(a,m,l.keys)}function xt(a){if(a.view.n!==u.n)return null;let l={...a,regions:{...a.regions}},m=!1;for(let[p,w]of Object.entries(a.regions)){let x=h.get(p);if(x?.def.kind!==\"collection\"||!x.def.virtualized||w.kind!==\"collection\"||w.ephemeral)continue;let b=Xe(w.items,new Set(x.elements.keys()),Math.floor(w.items.length*3/4));b.length!==w.items.length&&(l.regions[p]={...w,items:b},x.value===w&&(x.value=l.regions[p]),m=!0)}return m?l:null}function fe(a=!1){if(d)return;v=[],N=!1;let l=L(),{account:m}=l,p=Q(l),w=h;if(h=new Map,p.status===\"ready\")for(let[b,A]of Object.entries(y?.regions??{}))h.set(b,E(b,A,w.get(b)));k=p.status;let x=ee(m,p);a?c.page(x):c.update(x),Ce()}function De(){if(d)return;o.batches++;let a=o.reads,l=v,m=N;v=[],N=!1;let p=L(),{account:w}=p,x=Q(p);if(x.status!==\"ready\"||k!==\"ready\"||m)fe();else{let b={};for(let[A,_]of h)b[A]=Ke(_);for(let[A,_]of Gt(b,l,document))kt(h.get(A),_);for(let A of h.values()){let _=A.value;if(A.def.kind===\"collection\"&&_.kind===\"collection\"&&A.def.more){let S=xe(A.def);S!==_.complete&&(A.value={..._,complete:S})}}c.update(ee(w,x)),Ce()}o.lastBatchReads=o.reads-a}function Ce(){let a=[];for(let l of h.values())l.def.measure&&(l.def.kind===\"single\"?l.root&&a.push(l.root):a.push(...l.elements.values()));Ue.measure(a)}let q=Kt(De,r.publishQuietMs,r.publishMaxDelayMs),Ue=Ft(a=>{if(!d){if(k===\"ready\"&&!N){let l=[...h.values()].map(Ke);v.push(...a.filter(m=>m.kind!==\"attributes\"||l.some(p=>Bt(p,m.target)))),v.length>Wt&&(v=[],N=!0)}q.schedule()}}),pe=Mt({connection:e,limits:r,flush:()=>{q.cancel(),De()},find:bt,view:()=>u.n});function bt(a){let l=(S,G)=>({error:{code:S,message:G}});if(k!==\"ready\"||!y)return l(\"NOT_READY\",\"The page is not ready\");let m=u.n;if(a.region===null){let S=y.actions?.[a.name];return S?{action:S,element:()=>null}:l(\"INVALID_ARGUMENT\",`The page has no action ${a.name}`)}let p=a.region,w=h.get(p);if(!w)return l(\"NOT_FOUND\",`The page has no region ${p}`);let x=w.def.actions?.[a.name];if(!x)return l(\"INVALID_ARGUMENT\",`Region ${p} has no action ${a.name}`);let b=w.def;if(b.kind===\"single\")return{action:x,element:()=>u.n===m?document.querySelector(b.root)??void 0:void 0};if(w.value.ephemeral)return l(\"PRECONDITION_FAILED\",`Region ${p} repeats keys, so its records have no actions`);let A=a.key;if(A===null)return l(\"INVALID_ARGUMENT\",`Action ${a.name} needs a record key`);let _=()=>{if(u.n!==m)return;let S=h.get(p)?.elements.get(A);if(S?.isConnected&&We(b,S)===A)return S;let G=document.querySelector(b.root);return G?[...G.querySelectorAll(b.items)].find($=>We(b,$)===A):void 0};return _()===void 0?l(\"TARGET_NOT_FOUND\",`No ${p} item has key ${A}`):{action:x,element:_}}function ge(a=!0){d||(d=!0,q.cancel(),Ue.disconnect(),a&&pe.retire())}return e.on(\"resync\",()=>{o.resyncs++,q.cancel(),fe(!0)}),e.on(\"act\",a=>pe.act(a)),e.on(\"cancel\",({actionId:a})=>pe.cancel(a)),e.on(\"ping\",()=>{}),e.on(\"retired\",()=>ge()),e.on(\"pagehide\",()=>ge(!1)),document.readyState===\"loading\"&&document.addEventListener(\"DOMContentLoaded\",()=>q.schedule(),{once:!0}),fe(),{navigated(){if(d)return;let a=ye(location.href);a!==f&&(f=a,u={generation:i,n:u.n+1,url:location.href},g=we(n,location.href),y=D(g),k=null,h=new Map,q.cancel(),q.schedule())},stop:()=>ge()}}function Ke(e){return{root:e.root,items:e.items,dependsOn:e.dependsOn,dependsOnMissing:e.dependsOnMissing,fields:e.def.fields===!0,measure:e.def.measure===!0}}function Zt(e){return e.kind===\"collection\"?{kind:\"collection\",status:\"ready\",items:[],complete:!0}:{kind:\"single\",status:\"ready\",record:null}}function xe(e){return e.more?document.querySelector(e.more)===null:!0}function oe(e,t){let n=e(t);if(typeof n!=\"string\"||n===\"\")throw new O(\"INVALID_ARGUMENT\",\"key must return a non-empty string\");return n}function We(e,t){try{return oe(e.key,t)}catch{return null}}function Je(e){return String(e?.message??e)}function V(e){return{...e,kind:\"collection\"}}function z(e){return{...e,kind:\"single\"}}function Ie(e){let t=(o,s)=>{throw new Error(`Adapter ${o} ${s}`)},n=(o,s)=>{o!==void 0&&typeof o!=\"function\"&&t(s,\"must be a function\")},r=(o,s)=>{(typeof o!=\"string\"||o.trim()===\"\")&&t(s,\"must be a CSS selector\")},i=(o,s)=>{if(o!==void 0){H(o)||t(s,\"must be an object of functions\");for(let[c,u]of Object.entries(o))typeof u!=\"function\"&&t(`${s}.${c}`,\"must be a function\")}};H(e)||t(\"definition\",\"must be an object\"),n(e.account,\"account\"),e.signInUrl!==void 0&&typeof e.signInUrl!=\"string\"&&typeof e.signInUrl!=\"function\"&&t(\"signInUrl\",\"must be a path or a function\"),H(e.pages)||t(\"pages\",\"must be an object\");for(let[o,s]of Object.entries(e.pages)){let c=`pages.${o}`;H(s)||t(c,\"must be an object\"),typeof s.ready!=\"function\"&&t(`${c}.ready`,\"must be a function\"),n(s.account,`${c}.account`),i(s.actions,`${c}.actions`),s.regions!==void 0&&!H(s.regions)&&t(`${c}.regions`,\"must be an object\");for(let[u,d]of Object.entries(s.regions??{})){let f=`${c}.regions.${u}`;(!H(d)||d.kind!==\"collection\"&&d.kind!==\"single\")&&t(f,\"must be made with collection() or single()\"),r(d.root,`${f}.root`),typeof d.read!=\"function\"&&t(`${f}.read`,\"must be a function\"),n(d.entity,`${f}.entity`),d.dependsOn!==void 0&&(Array.isArray(d.dependsOn)||t(`${f}.dependsOn`,\"must be an array of selectors\"),d.dependsOn.forEach((g,y)=>r(g,`${f}.dependsOn.${y}`))),i(d.actions,`${f}.actions`),d.kind===\"collection\"?(r(d.items,`${f}.items`),typeof d.key!=\"function\"&&t(`${f}.key`,\"must be a function\"),n(d.extent,`${f}.extent`),d.more!==void 0&&r(d.more,`${f}.more`)):n(d.key,`${f}.key`)}}return e}function H(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var Te=\"https://x.com\";var Z=e=>typeof e==\"string\"&&/^[A-Za-z0-9_]{1,15}$/.test(e);function X(e,t){if(typeof e!=\"string\"||e.length>2048)return null;try{let n=new URL(e,t);return[\"https:\",\"http:\"].includes(n.protocol)&&!n.username&&!n.password?n.href:null}catch{return null}}function U(e){let t=X(e);if(!t)return null;let n=new URL(t);return n.protocol===\"https:\"&&[\"pbs.twimg.com\",\"abs.twimg.com\"].includes(n.hostname)&&!n.port?n.href:null}function B(e){if(typeof e!=\"string\")return null;try{let t=new URL(e,Te),n=/^\\/([A-Za-z0-9_]{1,15})\\/status\\/([0-9]{1,25})$/.exec(t.pathname);return t.origin===Te&&!t.username&&!t.password&&n?{postId:n[2],handle:n[1],url:`${Te}/${n[1]}/status/${n[2]}`}:null}catch{return null}}var R='article[data-testid=\"tweet\"]',se=`${R}, [data-testid=\"notification\"]`;function I(e,t=300){return[...(e??\"\").replace(/\\s+/g,\" \").trim()].slice(0,t).join(\"\")}function ae(e){return(e instanceof HTMLElement?e.innerText:e?.textContent??\"\").split(`\n`).map(n=>I(n,300)).filter(Boolean)}function K(e){let t=5381;for(let n of e)t=t*33+n.charCodeAt(0)>>>0;return t.toString(36)}function tt(e){let t=[...e.querySelectorAll(\"span\")].find(n=>/^Something went wrong/i.test(n.textContent??\"\"));return t&&e.querySelector('[role=\"button\"], button')?I(t.textContent,200):null}var Xt=e=>e.querySelector('[data-testid=\"loginButton\"]')!==null,Yt=(e,t)=>e.closest(R)===t&&!e.parentElement?.closest('div[role=\"link\"]'),P=(e,t)=>[...e.querySelectorAll(t)].filter(n=>Yt(n,e));function Y(e){let t=P(e,\"a[href]\").filter(r=>r.querySelector(\"time\")).map(r=>({link:r,id:B(r.getAttribute(\"href\"))})).filter(r=>r.id!==null),n=t[0];return!n||t.some(r=>r.id.postId!==n.id.postId)?null:{link:n.link,...n.id}}var nt=e=>Y(e)?.postId??null;function ce(e){return e.matches(R)?Y(e)?.postId??`p:${K(I(e.textContent,600))}`:`n:${K(I(e.textContent,600))}`}function Qt(e,t=7e3){let n=[],r=0,i=(s,c)=>{if(r>=t||!s)return;let u=[...s].slice(0,t-r).join(\"\");r+=[...u].length,n.push(c?{text:u,href:c}:{text:u})},o=(s,c)=>{if(s.nodeType===Node.TEXT_NODE)return i(s.textContent??\"\",c);if(!(s instanceof Element))return;if(s.tagName===\"IMG\")return i(s.getAttribute(\"alt\")??\"\",c);if(s.matches(\"script,style,button,svg\"))return;let u=s.tagName===\"A\"?X(s.getAttribute(\"href\"),s.ownerDocument.location.href)??void 0:c;for(let d of s.childNodes)o(d,u)};return e&&o(e),n}var en=e=>e.map(t=>t.text).join(\"\"),ie=e=>I(e?.textContent,20);function Se(e){let t=Y(e);if(!t)return null;let n=t.link.querySelector(\"time\"),r=P(e,'[data-testid=\"tweetText\"]')[0]??null,i=r?Qt(r):[],o=r?.textContent??\"\",s=P(e,'[data-testid=\"User-Name\"] a')[0],c=y=>P(e,`[data-testid=\"${y}\"]`)[0],u=P(e,'[data-testid=\"tweetPhoto\"] img').filter(y=>B(y.closest(\"a[href]\")?.getAttribute(\"href\")?.replace(/\\/photo\\/[0-9]+$/,\"\"))?.postId===t.postId).map(y=>U(y.getAttribute(\"src\"))).filter(y=>y!==null).slice(0,4),d=P(e,'[data-testid=\"socialContext\"]')[0],f=[...e.querySelectorAll('div[role=\"link\"]')].find(y=>y.closest(R)===e&&y.querySelector('[data-testid=\"User-Name\"]')),g=null;if(f){let y=ae(f.querySelector('[data-testid=\"User-Name\"]')),k=y.find(h=>h.startsWith(\"@\"))?.slice(1)??null;g={name:y[0]??\"\",handle:Z(k)?k:null,text:I(f.querySelector('[data-testid=\"tweetText\"]')?.textContent,1200),url:B(f.querySelector('a[href*=\"/status/\"]')?.getAttribute(\"href\")?.replace(/\\/(photo|video)\\/[0-9]+$/,\"\"))?.url??null}}return{postId:t.postId,url:t.url,handle:t.handle,name:I(s?.textContent,200)||t.handle,avatar:U(P(e,'[data-testid=\"Tweet-User-Avatar\"] img')[0]?.getAttribute(\"src\")),verified:P(e,'[data-testid=\"User-Name\"] [data-testid=\"icon-verified\"]').length>0,time:I(n?.textContent,60),dateTime:n?.getAttribute(\"datetime\")?.slice(0,40)??null,parts:i,textState:o?en(i).lengthB(r.getAttribute(\"href\"))).find(Boolean);return{id:K(t),text:t,url:n?.url??null,avatars:[...e.querySelectorAll(\"img\")].map(r=>U(r.getAttribute(\"src\"))).filter(r=>r!==null).slice(0,4)}}function rt(e){if(e.matches(R)){let n=Se(e);return n&&{kind:\"post\",post:n}}let t=tn(e);return t&&{kind:\"notice\",notice:t}}function ot(e){return it(e)??`u:${K(I(e.textContent,300))}`}function it(e){return[...e.querySelectorAll(\"a[href]\")].map(t=>/^\\/([A-Za-z0-9_]{1,15})$/.exec(t.getAttribute(\"href\")??\"\")?.[1]).find(Z)??null}function st(e){let t=it(e);if(!t)return null;let n=ae(e),r=n.findIndex(i=>i.toLowerCase()===`@${t.toLowerCase()}`);return{handle:t,name:(r>0?n[0]:null)??t,avatar:U(e.querySelector(\"img\")?.getAttribute(\"src\")),verified:e.querySelector('[data-testid=\"icon-verified\"]')!==null,description:I(n.slice(r+1).filter(i=>!/^(Follow|Following|Follows you|Unfollow)$/.test(i)).join(\" \"),300)}}var Qe=e=>/\\b(posts?|tweets?)$/i.test(e)||/^[0-9][0-9.,]*[KMB]?$/i.test(e),nn=e=>e.length<=80&&/trending|^[^·]{1,40} · [^·]{1,40}$|^(sports|politics|entertainment|news|technology|business|music|gaming)$/i.test(e);function Oe(e){let t=ae(e).filter(o=>o!==\"\\xB7\"),n=t.find(nn)??\"\",r=t.filter(o=>o!==n),i=I(r.find(o=>!Qe(o))??\"\",200);return i?{context:n,name:i,meta:r.filter(o=>o!==i&&Qe(o)).join(\" \\xB7 \").slice(0,120)}:null}function Ne(e){let t=e.ownerDocument.location.pathname.split(\"/\")[1]??\"\",n=e.querySelector('[data-testid=\"UserName\"]'),r=ae(n);if(!n||!r.some(o=>o.toLowerCase()===`@${t.toLowerCase()}`))return null;let i=o=>U(e.querySelector(`a[href=\"/${t}/${o}\" i] img`)?.getAttribute(\"src\"));return{handle:t,name:r[0],verified:n.querySelector('[data-testid=\"icon-verified\"]')!==null,avatar:i(\"photo\"),banner:i(\"header_photo\"),description:I(e.querySelector('[data-testid=\"UserDescription\"]')?.textContent,1e3),details:I([...e.querySelector('[data-testid=\"UserProfileHeader_Items\"]')?.children??[]].map(o=>o.textContent?.trim()).filter(Boolean).join(\" \\xB7 \"),300),links:[...e.querySelectorAll(\"a[href]\")].filter(o=>new RegExp(`^/${t}/(following|followers|verified_followers)$`,\"i\").test(o.getAttribute(\"href\")??\"\")).slice(0,2).flatMap(o=>{let s=X(o.getAttribute(\"href\"),e.ownerDocument.location.href);return s?[{label:I(o.textContent,60),url:s}]:[]}),own:e.querySelector('[data-testid=\"editProfileButton\"]')!==null}}function at(e){let t=e.ownerDocument.defaultView?.innerWidth??0,n=[...e.querySelectorAll(\"img\")].filter(s=>{let c=U(s.getAttribute(\"src\"));return c&&new URL(c).pathname.startsWith(\"/media/\")}),r=t/2,i=n.find(s=>{let c=s.getBoundingClientRect();return c.width>0&&c.left<=r&&c.right>=r});if(!i)return null;let o=new URL(U(i.getAttribute(\"src\")));return o.searchParams.has(\"name\")&&o.searchParams.set(\"name\",\"large\"),{image:o.href,hasNext:n.some(s=>s.getBoundingClientRect().left>=t-2)}}var et=\"window.__INITIAL_STATE__=\";function rn(e){let t=[...e.scripts].find(n=>n.textContent?.startsWith(et));if(!t)return null;try{let n=t.textContent??\"\",r=n.indexOf(\";window.\"),i=JSON.parse(n.slice(et.length,r<0?void 0:r)),o=i.entities?.users?.entities?.[i.session?.user_id];return Z(o?.screen_name)&&typeof o.name==\"string\"?{handle:o.screen_name.toLowerCase(),name:o.name}:null}catch{return null}}function Me(e){let t=e.querySelector('[data-testid=\"AppTabBar_Profile_Link\"]')?.getAttribute(\"href\")?.match(/^\\/([A-Za-z0-9_]{1,15})$/)?.[1],n=rn(e);if(Z(t))return{handle:t.toLowerCase(),name:n?.handle===t.toLowerCase()?n.name:null};if(!n)return null;let r=e.querySelector('[data-testid=\"DashButton_ProfileIcon_Link\"]');return r?r.getAttribute(\"aria-label\")===`Profile menu ${n.name}`?n:null:e.querySelector('[data-testid=\"AppTabBar_Notifications_Link\"]')?n:null}function le(e){if(e.readyState!==\"loading\")return Xt(e)?null:Me(e)?.handle??void 0}function _e(e,t,n){if(typeof t!=\"boolean\")throw new Error(\"Needs a boolean\");if(!e?.matches(R))throw new Error(\"Not a post\");let r=Y(e);if(!r)throw new Error(\"This post has no clear identity\");let i=c=>P(c,`[data-testid=\"${n.off}\"]`).length>0;if(i(e)===t)return{satisfied:!0};let o=`a[href$=\"/status/${r.postId}\"] time`,s=`${R}:has(${o}):not(:has(div[role=\"link\"] ${o}))`;if(!P(e,`[data-testid=\"${t?n.on:n.off}\"]`).length)throw new Error(\"X shows no control for this here\");return{steps:[{click:`${s} [data-testid=\"${t?n.on:n.off}\"]`}],until:c=>{let u=[...c.querySelectorAll(R)].find(d=>Y(d)?.postId===r.postId);return u!==void 0&&i(u)===t}}}var F=\"main\",lt='[data-testid=\"emptyState\"]';function ue(e,t){if(e.readyState===\"loading\")return!1;let n=e.querySelector(F);if(!n)return!1;let r=tt(n);if(r)throw new Error(r);return n.querySelector(lt)?!0:typeof t==\"string\"?n.querySelector(t)!==null:t(n)}var ut={setLiked:(e,t)=>_e(e,t?.liked,{on:\"like\",off:\"unlike\"}),setBookmarked:(e,t)=>_e(e,t?.bookmarked,{on:\"bookmark\",off:\"removeBookmark\"})},Re=(e=se)=>V({root:F,items:e,key:ce,entityType:\"post\",read:rt,virtualized:!0,actions:ut}),de=z({root:lt,read:e=>I(e.textContent,200)||null}),ct=e=>{let t=e.querySelectorAll(`${F} :is(${se})`);return t.length?ce(t[t.length-1]):null};function Le(){let e=ct(document);return{steps:[{scroll:{target:\"window\",to:\"end\"}}],until:t=>ct(t)!==e,deadlineMs:1e4}}var dt={ready:e=>ue(e,se),requiresAccount:!0,regions:{timeline:Re(),empty:de},actions:{loadMore:Le}},ft={ready:e=>{let t=B(e.location.href)?.postId;return ue(e,n=>[...n.querySelectorAll(R)].some(r=>nt(r)===t))},regions:{thread:Re(R),empty:de}},on=new Set([\"home\",\"explore\",\"notifications\",\"messages\",\"settings\",\"i\",\"login\",\"logout\",\"signup\",\"tos\",\"privacy\",\"about\",\"download\",\"compose\",\"search\",\"jobs\",\"communities\",\"premium\",\"lists\",\"bookmarks\",\"account\"]),pt={ready:e=>{let t=e.location.pathname.split(\"/\")[1]??\"\";if(on.has(t.toLowerCase())||!/^[A-Za-z0-9_]{1,15}$/.test(t))throw new Error(\"This X page isn't a profile\");return ue(e,n=>Ne(n)!==null)},regions:{header:z({root:F,read:Ne}),posts:Re(),empty:de},actions:{loadMore:Le}};function sn(e){let t=e.querySelector(\"a[href]\")?.getAttribute(\"href\")??e.closest(\"a[href]\")?.getAttribute(\"href\"),n=Oe(e)?.name??I(e.textContent,300);return`t:${K(t??n)}`}var gt={ready:e=>ue(e,`${R}, [data-testid=\"trend\"], [data-testid=\"UserCell\"]`),regions:{trends:V({root:F,items:'[data-testid=\"trend\"]',key:sn,read:Oe}),people:V({root:F,items:'[data-testid=\"UserCell\"]',key:ot,read:st}),results:V({root:F,items:R,key:ce,entityType:\"post\",read:e=>Se(e),virtualized:!0,actions:ut}),empty:de},actions:{loadMore:Le}},mt={ready:e=>e.readyState!==\"loading\"&&e.querySelector('[data-testid=\"swipe-to-dismiss\"]')!==null,regions:{photos:z({root:'[data-testid=\"swipe-to-dismiss\"]',read:at,measure:!0})}},ht={ready:e=>le(e)!==void 0,requiresAccount:!0,regions:{handle:z({root:\"html\",read:e=>Me(e.ownerDocument)})}};var yt=Ie({account:le,signInUrl:\"/i/flow/login\",pages:{timeline:dt,post:ft,profile:pt,explore:gt,media:mt,account:ht}});Ee(yt);})();\n"},{"path":"assets/x.png","encoding":"base64","content":"iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAB6UlEQVR4nO3cQa7CMBRDUXbAhAn7XyisANSkyfN1nit59qW6Pgwo+u3j+Xp/El0e6gLdE4AA9E4AAtA7AQhA7wQgAL0TgAD0TgAC0DsBCEDvBCAAvROA0wD+HeqLXXU9AQjAHIAbQsU1lAO4IFR1lwDQESo7b/kW5IxQ3XXb11BHBEXHrfcBTgiqbttvxBwQlJ1K7oTJCOouAegAQEUgdCj9MY6EQBi/HICCQBlfAqBGII0vA1Ah0MaXAlQjEMeXA1QhUMcPQAD2I5DHxwDsQqCPjwJYjeAwPg5gFYLL+EiAuwhO42MBZhHcxkcDjCI4jo8HuIrw6+/U3dsAuH76LQBmEdSdjwIYRVB3PRJgBEHd81iAExGOBXBBsAKYOdSdjwG4c6i7BwDQ3xrg37DuCHiAK4M6I6ABRoZ0RcACzAzoiIAEuDOcGwIOYMVgTggogJVDuSAEIADrx3dCQADsHIaOIAeoGISMgPz39MpzqRFwD2gozqlEQD2ipDy3CgHzkB6hg6ITAqC6w1WE4wAIn/4RgIpu8iflFeOTEKTvilCOT0GQva5GPTwFQfLCJvXgJITyV5aph6YhlL60Tz3wKgQ8QBIAmwQgAL0TgAD0TgAC0DsBCEDvBCAAvROAAPROAALQOwEIQO98ASr29V3LMWMvAAAAAElFTkSuQmCC"},{"path":"foreground.css","encoding":"utf8","content":":root{color-scheme:light;--paper: #ffffff;--ink: #0f1419;--muted: #536471;--line: #eff3f4;--control-line: #cfd9de;--wash: #f7f9f9;--accent: #1d9bf0;--link: #0078b8;--accent-wash: #e8f5fd;--danger: #b42336;--like: #f91880;--repost: #00875a;--skeleton: #eff3f4;--font: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;--edge: 16px;--radius: 16px;--tabs: 64px}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--paper: #000000;--ink: #e7e9ea;--muted: #71767b;--line: #2f3336;--control-line: #536471;--wash: #16181c;--link: #1d9bf0;--accent-wash: #071e2d;--danger: #ff9aa5;--repost: #00ba7c;--skeleton: #202327}}@media(prefers-contrast:more){:root{--line: var(--muted);--control-line: var(--muted)}}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}html,body{background:var(--paper);color:var(--ink);font:15px/20px var(--font)}button,input,textarea{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}a{color:var(--link);text-decoration:none}a,button{overflow-wrap:anywhere}button{cursor:pointer}button:disabled{opacity:.5;cursor:default}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}svg.filled{fill:currentColor}.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.app{display:flex;flex-direction:column;height:100%}.content{flex:1;min-height:0}.screen{height:100%;overflow-y:auto;padding:8px var(--edge) 32px}.screen:before{content:\"\";float:right;width:44px;height:44px}.screen-title{font-size:20px;line-height:24px;font-weight:800;margin:12px 0 8px;overflow-wrap:anywhere}.section-title{font-size:17px;font-weight:800;margin:20px 0 4px}.post-meta{margin:0;color:var(--muted)}.grow{flex:1;min-width:0}.tabs{display:flex;flex:none;min-height:var(--tabs);background:var(--paper);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:56px;border:0;background:none;color:var(--muted);font-size:11px;line-height:13px}.tab[aria-current=page]{color:var(--ink);font-weight:700}.tab svg{width:24px;height:24px}.viewing .tabs{display:none}.primary,.secondary,.danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 18px;margin:8px 8px 0 0;border-radius:999px;font-weight:700}.primary{border:0;background:var(--ink);color:var(--paper)}.secondary{border:1px solid var(--control-line);background:var(--paper)}.danger{border:0;background:var(--danger);color:var(--paper)}.secondary svg,.primary svg{width:16px;height:16px}.text-button{min-height:44px;min-width:44px;padding:0 8px;border:0;background:none;color:var(--link);font-weight:700}.danger-text{color:var(--danger)}.icon-button{display:inline-grid;place-items:center;width:48px;height:48px;flex:none;border:0;border-radius:50%;background:none;color:inherit}.more{margin:16px 0 0}input:not([type=checkbox]){width:100%;min-height:44px;padding:10px 14px;border:1px solid var(--control-line);border-radius:999px;background:var(--paper)}input:not([type=checkbox]):focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 1px var(--accent)}.mode-tabs{display:flex;margin:0 calc(-1 * var(--edge));border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none}.mode-tab{flex:1 0 auto;min-height:53px;padding:0 16px;border:0;background:none;color:var(--muted);font-weight:500;position:relative}.mode-tab[aria-current=page]{color:var(--ink);font-weight:700}.mode-tab[aria-current=page]:after{content:\"\";position:absolute;left:50%;bottom:0;width:56px;height:4px;margin-left:-28px;border-radius:2px;background:var(--accent)}.chips{display:flex;gap:8px;overflow-x:auto;margin:4px 0;padding:8px 0;scrollbar-width:none}.chip{flex:none;min-height:36px;padding:0 14px;border:1px solid var(--control-line);border-radius:999px;background:var(--paper);font-weight:600}.chip[aria-pressed=true]{border-color:var(--ink);background:var(--ink);color:var(--paper)}.chip-count{margin-left:4px;opacity:.7;font-weight:400}.search-form{margin:4px 0 8px}.search-field{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border-radius:999px;background:var(--wash);color:var(--muted)}.search-field input,.search-field input:focus{min-height:42px;padding:0;border:0;border-radius:0;background:none;color:var(--ink);box-shadow:none}.search-field svg{width:18px;height:18px}.feed{margin:0 calc(-1 * var(--edge))}.post{padding:12px var(--edge);border-bottom:1px solid var(--line)}.post-context{display:flex;align-items:center;gap:8px;margin:0 0 4px 28px;color:var(--muted);font-size:13px;font-weight:700}.post-context svg{width:16px;height:16px}.post-context a{color:inherit}.post-grid{display:grid;grid-template-columns:40px minmax(0,1fr);gap:12px}.focus .post-grid{grid-template-columns:48px minmax(0,1fr)}.avatar{display:block;border-radius:50%;background:var(--skeleton);object-fit:cover}.avatar-button{padding:0;border:0;background:none;align-self:start;border-radius:50%}.post-body{min-width:0}.post-head{display:flex;align-items:center;flex-wrap:wrap;gap:0 4px;margin:0;min-width:0}.post-name{display:inline-flex;align-items:center;gap:2px;min-width:0;color:var(--ink)}.post-name strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.verified{width:18px;height:18px;fill:var(--accent);stroke:none}.verified .tick{fill:none;stroke:#fff;stroke-width:2}.post-content{cursor:pointer}.post-content.plain{display:block;width:100%;padding:0;border:0;background:none;text-align:left}.post-text{margin:2px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.post-text.large{font-size:20px;line-height:28px;margin-top:12px}.clamp{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}.show-more{color:var(--link)}.photos{display:grid;gap:2px;margin-top:12px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}.photos button{padding:0;border:0;background:var(--skeleton);min-height:0}.photos img{display:block;width:100%;height:100%;object-fit:cover}.photos.n1 img{max-height:510px;height:auto}.photos.n2,.photos.n3,.photos.n4{grid-template-columns:1fr 1fr;aspect-ratio:16 / 9}.photos.n3 button:first-child{grid-row:span 2}.photos.n2 button,.photos.n3 button,.photos.n4 button{overflow:hidden}.video-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;aspect-ratio:16 / 9;margin-top:12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--wash);font-weight:700}.video-tile svg{width:14px;height:14px;vertical-align:-2px}.quote{display:block;width:100%;margin-top:12px;padding:12px;border:1px solid var(--control-line);border-radius:var(--radius);background:none;text-align:left}.quote-text{display:block;margin-top:2px;white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden}.focus-time{padding:16px 0;border-bottom:1px solid var(--line)}.actions-bar{display:flex;justify-content:space-between;margin:4px -8px -4px;max-width:440px}.action{display:inline-flex;align-items:center;gap:4px;min-width:40px;min-height:40px;padding:0 6px;white-space:nowrap;border:0;background:none;color:var(--muted);font-size:13px}.action svg{width:18px;height:18px}.action.liked{color:var(--like)}.action.reposted{color:var(--repost)}.action.bookmarked{color:var(--accent)}.thread .post:not(:last-child){border-bottom:0}.notification{display:flex;flex-direction:column;gap:8px;width:100%;padding:12px var(--edge) 12px 68px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.notice-avatars{display:flex;gap:4px}.notice-text{overflow-wrap:anywhere}.trend,.person{display:flex;flex-direction:column;align-items:flex-start;width:calc(100% + 2 * var(--edge));margin:0 calc(-1 * var(--edge));padding:12px var(--edge);border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.trend strong{font-size:15px}.trend .post-meta{font-size:13px}.person{flex-direction:row;gap:12px}.person-body{display:flex;flex-direction:column;min-width:0}.person-bio{margin-top:4px;overflow-wrap:anywhere}.profile-screen{padding-top:0}.profile-screen:before{display:none}.profile{margin:0 calc(-1 * var(--edge));padding:0 var(--edge) 12px}.banner{margin:0 calc(-1 * var(--edge));aspect-ratio:3 / 1;background:var(--control-line);overflow:hidden}.banner img{display:block;width:100%;height:100%;object-fit:cover}.profile-top{display:flex;align-items:flex-end;justify-content:space-between;margin-top:-40px}.profile-top .avatar{border:4px solid var(--paper);box-sizing:content-box}.profile-name{display:flex;align-items:center;gap:2px;margin:8px 0 0;font-size:20px;line-height:24px;font-weight:800;overflow-wrap:anywhere}.profile .post-text,.profile .post-meta{margin-top:8px}.profile-links{display:flex;flex-wrap:wrap;gap:4px 16px;margin:8px 0 0}.profile-links a{display:inline-flex;align-items:center;min-height:32px}.media-viewer{position:fixed;inset:0;z-index:1;display:flex;flex-direction:column;background:#000;color:#fff}.media-close{position:absolute;top:8px;left:8px;z-index:1;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:#0009;color:#fff}.media-stage{flex:1;min-height:0;display:grid;place-items:center}.media-stage img{max-width:100%;max-height:100%;object-fit:contain}.media-message{margin:0;padding:16px;text-align:center}.media-message .secondary{background:none;color:#fff;border-color:#536471}.media-nav{display:flex;align-items:center;justify-content:center;gap:24px;padding:8px 0 calc(8px + env(safe-area-inset-bottom))}.saved-post .post-head{margin-bottom:2px}.pills{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px}.pill{padding:2px 10px;border-radius:999px;background:var(--accent-wash);color:var(--link);font-size:13px;font-weight:600}.pills .text-button{min-height:36px;margin-left:auto}.category-list{margin-top:8px}.category{padding:8px 0;border-top:1px solid var(--line)}.category-head{display:flex;align-items:center;gap:4px}.card{margin:12px 0;padding:12px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--paper)}.card .post-text{margin-top:4px}.card .post-meta{margin-top:8px;font-size:13px}fieldset{min-width:0}fieldset.card legend{padding:0 4px;font-weight:800}.check{display:flex;align-items:center;gap:12px;min-height:48px}.check input{width:22px;height:22px;accent-color:var(--accent)}.row{display:flex;align-items:center;gap:8px;margin-top:8px}.row .primary,.row .secondary{margin:0}.actions{display:flex;flex-wrap:wrap;align-items:center;margin-top:4px}.notice{margin:24px 0;padding:20px;border:1px solid var(--line);border-radius:var(--radius)}.notice h2{margin:0 0 6px;font-size:20px;line-height:24px;font-weight:800}.notice p{margin:0;color:var(--muted)}.inline-error,.field-error{color:var(--danger)}.status{padding:10px 12px;border-radius:12px;background:var(--wash)}.confirm{margin:12px 0;padding:12px 14px;border:1px solid var(--danger);border-radius:var(--radius)}.confirm p{margin:0}.skeleton{padding-top:8px}.skeleton-row{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}.skeleton-row>div{flex:1}.skeleton-avatar{width:40px;height:40px;flex:none;border-radius:50%;background:var(--skeleton)}.skeleton-row span:not(.skeleton-avatar){display:block;height:12px;border-radius:4px;background:var(--skeleton)}.skeleton-row span+span{width:80%;margin-top:8px}.skeleton-row span+span+span{width:45%}.skeleton.text .skeleton-row{border-bottom:0;padding:8px 0}\n"},{"path":"foreground.js","encoding":"utf8","content":"\"use strict\";(()=>{var h0=Object.create;var Jf=Object.defineProperty;var y0=Object.getOwnPropertyDescriptor;var b0=Object.getOwnPropertyNames;var S0=Object.getPrototypeOf,T0=Object.prototype.hasOwnProperty;var Ft=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var N0=(e,t,n,l)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let a of b0(t))!T0.call(e,a)&&a!==n&&Jf(e,a,{get:()=>t[a],enumerable:!(l=y0(t,a))||l.enumerable});return e};var L=(e,t,n)=>(n=e!=null?h0(S0(e)):{},N0(t||!e||!e.__esModule?Jf(n,\"default\",{value:e,enumerable:!0}):n,e));var Nd=Ft(D=>{\"use strict\";var _c=Symbol.for(\"react.transitional.element\"),Z0=Symbol.for(\"react.portal\"),K0=Symbol.for(\"react.fragment\"),J0=Symbol.for(\"react.strict_mode\"),I0=Symbol.for(\"react.profiler\"),$0=Symbol.for(\"react.consumer\"),F0=Symbol.for(\"react.context\"),W0=Symbol.for(\"react.forward_ref\"),P0=Symbol.for(\"react.suspense\"),ey=Symbol.for(\"react.memo\"),gd=Symbol.for(\"react.lazy\"),ty=Symbol.for(\"react.activity\"),ny=Symbol.for(\"react.view_transition\"),sd=Symbol.iterator;function ly(e){return e===null||typeof e!=\"object\"?null:(e=sd&&e[sd]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var pd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vd=Object.assign,hd={};function Il(e,t,n){this.props=e,this.context=t,this.refs=hd,this.updater=n||pd}Il.prototype.isReactComponent={};Il.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};Il.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function yd(){}yd.prototype=Il.prototype;function Mc(e,t,n){this.props=e,this.context=t,this.refs=hd,this.updater=n||pd}var zc=Mc.prototype=new yd;zc.constructor=Mc;vd(zc,Il.prototype);zc.isPureReactComponent=!0;var fd=Array.isArray;function Ac(){}var oe={H:null,A:null,T:null,S:null},bd=Object.prototype.hasOwnProperty;function wc(e,t,n){var l=n.ref;return{$$typeof:_c,type:e,key:t,ref:l!==void 0?l:null,props:n}}function ay(e,t){return wc(e.type,t,e.props)}function Cc(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===_c}function uy(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(n){return t[n]})}var dd=/\\/+/g;function Oc(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?uy(\"\"+e.key):t.toString(36)}function iy(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(Ac,Ac):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function Jl(e,t,n,l,a){var u=typeof e;(u===\"undefined\"||u===\"boolean\")&&(e=null);var i=!1;if(e===null)i=!0;else switch(u){case\"bigint\":case\"string\":case\"number\":i=!0;break;case\"object\":switch(e.$$typeof){case _c:case Z0:i=!0;break;case gd:return i=e._init,Jl(i(e._payload),t,n,l,a)}}if(i)return a=a(e),i=l===\"\"?\".\"+Oc(e,0):l,fd(a)?(n=\"\",i!=null&&(n=i.replace(dd,\"$&/\")+\"/\"),Jl(a,t,n,\"\",function(f){return f})):a!=null&&(Cc(a)&&(a=ay(a,n+(a.key==null||e&&e.key===a.key?\"\":(\"\"+a.key).replace(dd,\"$&/\")+\"/\")+i)),t.push(a)),1;i=0;var o=l===\"\"?\".\":l+\":\";if(fd(e))for(var c=0;c{\"use strict\";Ed.exports=Nd()});var Dd=Ft(de=>{\"use strict\";function Hc(e,t){var n=e.length;e.push(t);e:for(;0>>1,a=e[l];if(0>>1;lgi(o,n))cgi(f,o)?(e[l]=f,e[c]=n,l=c):(e[l]=o,e[i]=n,l=i);else if(cgi(f,n))e[l]=f,e[c]=n,l=c;else break e}}return t}function gi(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}de.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(xd=performance,de.unstable_now=function(){return xd.now()}):(Rc=Date,Od=Rc.now(),de.unstable_now=function(){return Rc.now()-Od});var xd,Rc,Od,bn=[],qn=[],ry=1,At=null,Ve=3,Lc=!1,tu=!1,nu=!1,qc=!1,Md=typeof setTimeout==\"function\"?setTimeout:null,zd=typeof clearTimeout==\"function\"?clearTimeout:null,Ad=typeof setImmediate<\"u\"?setImmediate:null;function pi(e){for(var t=Wt(qn);t!==null;){if(t.callback===null)vi(qn);else if(t.startTime<=e)vi(qn),t.sortIndex=t.expirationTime,Hc(bn,t);else break;t=Wt(qn)}}function Gc(e){if(nu=!1,pi(e),!tu)if(Wt(bn)!==null)tu=!0,Fl||(Fl=!0,$l());else{var t=Wt(qn);t!==null&&Bc(Gc,t.startTime-e)}}var Fl=!1,lu=-1,wd=5,Cd=-1;function Rd(){return qc?!0:!(de.unstable_now()-Cde&&Rd());){var l=At.callback;if(typeof l==\"function\"){At.callback=null,Ve=At.priorityLevel;var a=l(At.expirationTime<=e);if(e=de.unstable_now(),typeof a==\"function\"){At.callback=a,pi(e),t=!0;break t}At===Wt(bn)&&vi(bn),pi(e)}else vi(bn);At=Wt(bn)}if(At!==null)t=!0;else{var u=Wt(qn);u!==null&&Bc(Gc,u.startTime-e),t=!1}}break e}finally{At=null,Ve=n,Lc=!1}t=void 0}}finally{t?$l():Fl=!1}}}var $l;typeof Ad==\"function\"?$l=function(){Ad(Dc)}:typeof MessageChannel<\"u\"?(Uc=new MessageChannel,_d=Uc.port2,Uc.port1.onmessage=Dc,$l=function(){_d.postMessage(null)}):$l=function(){Md(Dc,0)};var Uc,_d;function Bc(e,t){lu=Md(function(){e(de.unstable_now())},t)}de.unstable_IdlePriority=5;de.unstable_ImmediatePriority=1;de.unstable_LowPriority=4;de.unstable_NormalPriority=3;de.unstable_Profiling=null;de.unstable_UserBlockingPriority=2;de.unstable_cancelCallback=function(e){e.callback=null};de.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=n,Hc(qn,e),Wt(bn)===null&&e===Wt(qn)&&(nu?(zd(lu),lu=-1):nu=!0,Bc(Gc,n-l))):(e.sortIndex=a,Hc(bn,e),tu||Lc||(tu=!0,Fl||(Fl=!0,$l()))),e};de.unstable_shouldYield=Rd;de.unstable_wrapCallback=function(e){var t=Ve;return function(){var n=Ve;Ve=t;try{return e.apply(this,arguments)}finally{Ve=n}}}});var Hd=Ft((uT,Ud)=>{\"use strict\";Ud.exports=Dd()});var Gd=Ft(je=>{\"use strict\";var sy=et();function qd(e){var t=\"https://react.dev/errors/\"+e;if(1{\"use strict\";function Bd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bd)}catch(e){console.error(e)}}Bd(),kd.exports=Gd()});var _h=Ft(Po=>{\"use strict\";var _e=Hd(),Ag=et(),gy=Yd();function T(e){var t=\"https://react.dev/errors/\"+e;if(1ia||(e.current=Or[ia],Or[ia]=null,ia--)}function se(e,t){ia++,Or[ia]=e.current,e.current=t}var rn=dn(null),zu=dn(null),Fn=dn(null),ao=dn(null);function uo(e,t){switch(se(Fn,t),se(zu,e),se(rn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ug(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ug(t),e=nh(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}Ge(rn),se(rn,e)}function Aa(){Ge(rn),Ge(zu),Ge(Fn)}function Ar(e){var t=e.memoizedState;t!==null&&(La._currentValue=t.memoizedState,se(ao,e)),t=rn.current;var n=nh(t,e.type);t!==n&&(se(zu,e),se(rn,n))}function io(e){zu.current===e&&(Ge(rn),Ge(zu)),ao.current===e&&(Ge(ao),La._currentValue=Ol)}var kc,Zd;function kn(e){if(kc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);kc=t&&t[1]||\"\",Zd=-1)\":-1a||c[l]!==f[a]){var d=`\n`+c[l].replace(\" at new \",\" at \");return e.displayName&&d.includes(\"\")&&(d=d.replace(\"\",e.displayName)),d}while(1<=l&&0<=a);break}}}finally{Yc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?kn(n):\"\"}function Ey(e,t){switch(e.tag){case 26:case 27:case 5:return kn(e.type);case 16:return kn(\"Lazy\");case 13:return e.child!==t&&t!==null?kn(\"Suspense Fallback\"):kn(\"Suspense\");case 19:return kn(\"SuspenseList\");case 0:case 15:return Vc(e.type,!1);case 11:return Vc(e.type.render,!1);case 1:return Vc(e.type,!0);case 31:return kn(\"Activity\");case 30:return kn(\"ViewTransition\");default:return\"\"}}function Kd(e){try{var t=\"\",n=null;do t+=Ey(e,n),n=e,e=e.return;while(e);return t}catch(l){return`\nError generating stack: `+l.message+`\n`+l.stack}}var _r=Object.prototype.hasOwnProperty,ws=_e.unstable_scheduleCallback,jc=_e.unstable_cancelCallback,xy=_e.unstable_shouldYield,Oy=_e.unstable_requestPaint,vt=_e.unstable_now,Ay=_e.unstable_getCurrentPriorityLevel,Hg=_e.unstable_ImmediatePriority,Lg=_e.unstable_UserBlockingPriority,oo=_e.unstable_NormalPriority,_y=_e.unstable_LowPriority,qg=_e.unstable_IdlePriority,My=_e.log,zy=_e.unstable_setDisableYieldValue,Zu=null,ht=null;function Qn(e){if(typeof My==\"function\"&&zy(e),ht&&typeof ht.setStrictMode==\"function\")try{ht.setStrictMode(Zu,e)}catch{}}var yt=Math.clz32?Math.clz32:Ry,wy=Math.log,Cy=Math.LN2;function Ry(e){return e>>>=0,e===0?32:31-(wy(e)/Cy|0)|0}var bi=256,Si=262144,Ti=4194304;function Sl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Uo(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,u=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~u,l!==0?a=Sl(l):(i&=o,i!==0?a=Sl(i):n||(n=o&~e,n!==0&&(a=Sl(n))))):(o=l&~u,o!==0?a=Sl(o):i!==0?a=Sl(i):n||(n=l&~e,n!==0&&(a=Sl(n)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:a}function Ku(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Gg(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Ju(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Uy(e,t,n,l,a,u){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,f=e.hiddenUpdates;for(n=i&~n;0\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),Cr=!1;if(An)try{Wl={},Object.defineProperty(Wl,\"passive\",{get:function(){Cr=!0}}),window.addEventListener(\"test\",Wl,Wl),window.removeEventListener(\"test\",Wl,Wl)}catch{Cr=!1}var Wl,Zn=null,Hs=null,Yi=null;function ep(){if(Yi)return Yi;var e,t=Hs,n=t.length,l,a=\"value\"in Zn?Zn.value:Zn.textContent,u=a.length;for(e=0;e=vu),im=\" \",om=!1;function np(e,t){switch(e){case\"keyup\":return v1.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function lp(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var ca=!1;function y1(e,t){switch(e){case\"compositionend\":return lp(t);case\"keypress\":return t.which!==32?null:(om=!0,im);case\"textInput\":return e=t.data,e===im&&om?null:e;default:return null}}function b1(e,t){if(ca)return e===\"compositionend\"||!qs&&np(e,t)?(e=ep(),Yi=Hs=Zn=null,ca=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function fm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dm(e,t){var n=fm(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fm(n)}}function op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?op(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rr(e.document)}return t}function Gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var _1=An&&\"documentMode\"in document&&11>=document.documentMode,ra=null,Dr=null,yu=null,Ur=!1;function mm(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ur||ra==null||ra!==Rr(l)||(l=ra,\"selectionStart\"in l&&Gs(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),yu&&Ru(yu,l)||(yu=l,l=Co(Dr,\"onSelect\"),0>=i,a-=i,on=1<<32-yt(t)+a|n<z?(fe=A,A=null):fe=A.sibling;var G=r(p,A,h[z],b);if(G===null){A===null&&(A=fe);break}e&&A&&G.alternate===null&&t(p,A),m=u(G,m,z),M===null?N=G:M.sibling=G,M=G,A=fe}if(z===h.length)return n(p,A),q&&Nn(p,z),N;if(A===null){for(;zz?(fe=A,A=null):fe=A.sibling;var rt=r(p,A,G.value,b);if(rt===null){A===null&&(A=fe);break}e&&A&&rt.alternate===null&&t(p,A),m=u(rt,m,z),M===null?N=rt:M.sibling=rt,M=rt,A=fe}if(G.done)return n(p,A),q&&Nn(p,z),N;if(A===null){for(;!G.done;z++,G=h.next())G=g(p,G.value,b),G!==null&&(m=u(G,m,z),M===null?N=G:M.sibling=G,M=G);return q&&Nn(p,z),N}for(A=l(A);!G.done;z++,G=h.next())G=s(A,p,z,G.value,b),G!==null&&(e&&(fe=G.alternate,fe!==null&&A.delete(fe.key===null?z:fe.key)),m=u(G,m,z),M===null?N=G:M.sibling=G,M=G);return e&&A.forEach(function($){return t(p,$)}),q&&Nn(p,z),N}function x(p,m,h,b){if(typeof h==\"object\"&&h!==null&&h.type===ua&&h.key===null&&h.props.ref===void 0&&(h=h.props.children),typeof h==\"object\"&&h!==null){switch(h.$$typeof){case yi:e:{for(var N=h.key;m!==null;){if(m.key===N){if(N=h.type,N===ua){if(m.tag===7){n(p,m.sibling),b=a(m,h.props.children),Bn(b,h),b.return=p,p=b;break e}}else if(m.elementType===N||typeof N==\"object\"&&N!==null&&N.$$typeof===Vn&&Tl(N)===m.type){n(p,m.sibling),b=a(m,h.props),Bn(b,h),b.return=p,p=b;break e}n(p,m);break}else t(p,m);m=m.sibling}h.type===ua?(b=Al(h.props.children,p.mode,b,h.key),Bn(b,h),b.return=p,p=b):(b=ji(h.type,h.key,h.props,null,p.mode,b),Bn(b,h),b.return=p,p=b)}return i(p);case fu:e:{for(N=h.key;m!==null;){if(m.key===N)if(m.tag===4&&m.stateNode.containerInfo===h.containerInfo&&m.stateNode.implementation===h.implementation){n(p,m.sibling),b=a(m,h.children||[]),b.return=p,p=b;break e}else{n(p,m);break}else t(p,m);m=m.sibling}b=Pc(h,p.mode,b),b.return=p,p=b}return i(p);case Vn:return h=Tl(h),x(p,m,h,b)}if(du(h))return y(p,m,h,b);if(uu(h)){if(N=uu(h),typeof N!=\"function\")throw Error(T(150));return h=N.call(h),S(p,m,h,b)}if(typeof h.then==\"function\")return x(p,m,_i(h),b);if(h.$$typeof===an)return x(p,m,Ai(p,h),b);Mi(p,h)}return typeof h==\"string\"&&h!==\"\"||typeof h==\"number\"||typeof h==\"bigint\"?(h=\"\"+h,m!==null&&m.tag===6?(n(p,m.sibling),b=a(m,h),b.return=p,p=b):(n(p,m),b=Wc(h,p.mode,b),b.return=p,p=b),i(p)):n(p,m)}return function(p,m,h,b){try{Hu=0;var N=x(p,m,h,b);return Sa=null,N}catch(A){if(A===Ya||A===Vo)throw A;var M=at(29,A,null,p.mode);return M.lanes=b,M.return=p,M}}}var Ul=Ep(!0),xp=Ep(!1),jn=!1;function Zs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Pn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function el(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(F&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=so(e),pp(e,null,n),t}return ko(e,l,t,n),so(e)}function Su(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Yg(e,n)}}function tr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?a=u=i:u=u.next=i,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Yr=!1;function Tu(){if(Yr){var e=ba;if(e!==null)throw e}}function Nu(e,t,n,l){Yr=!1;var a=e.updateQueue;jn=!1;var u=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,f=c.next;c.next=null,i===null?u=f:i.next=f,i=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==i&&(o===null?d.firstBaseUpdate=f:o.next=f,d.lastBaseUpdate=c))}if(u!==null){var g=a.baseState;i=0,d=f=c=null,o=u;do{var r=o.lane&-536870913,s=r!==o.lane;if(s?(V&r)===r:(l&r)===r){r!==0&&r===Dl&&(Yr=!0),d!==null&&(d=d.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var y=e,S=o;r=t;var x=n;switch(S.tag){case 1:if(y=S.payload,typeof y==\"function\"){g=y.call(x,g,r);break e}g=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=S.payload,r=typeof y==\"function\"?y.call(x,g,r):y,r==null)break e;g=ie({},g,r);break e;case 2:jn=!0}}r=o.callback,r!==null&&(e.flags|=64,s&&(e.flags|=8192),s=a.callbacks,s===null?a.callbacks=[r]:s.push(r))}else s={lane:r,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(f=d=s,c=g):d=d.next=s,i|=r;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;s=o,o=s.next,s.next=null,a.lastBaseUpdate=s,a.shared.pending=null}}while(!0);d===null&&(c=g),a.baseState=c,a.firstBaseUpdate=f,a.lastBaseUpdate=d,u===null&&(a.shared.lanes=0),fl|=i,e.lanes=i,e.memoizedState=g}}function Op(e,t){if(typeof e!=\"function\")throw Error(T(191,e));e.call(t)}function Ap(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eu?u:8;var i=C.T,o={};o.types=i!==null?i.types:null,C.T=o,of(e,!1,t,n);try{var c=a(),f=C.S;if(f!==null&&f(o,c),c!==null&&typeof c==\"object\"&&typeof c.then==\"function\"){var d=G1(c,l);Eu(e,t,d,bt(e))}else Eu(e,t,l,bt(e))}catch(g){Eu(e,t,{then:function(){},status:\"rejected\",reason:g},bt())}finally{W.p=u,i!==null&&o.types!==null&&(i.types=o.types),C.T=i}}function X1(){}function Zr(e,t,n,l){if(e.tag!==5)throw Error(T(476));var a=Fp(e).queue;$p(e,a,t,Ol,n===null?X1:function(){return Wp(e),n(l)})}function Fp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ol,baseState:Ol,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:Ol},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wp(e){var t=Fp(e);t.next===null&&(t=e.alternate.memoizedState),Eu(e,t.next.queue,{},bt())}function uf(){return qe(La)}function Pp(){return be().memoizedState}function ev(){return be().memoizedState}function Q1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=bt();e=Pn(n);var l=el(t,e,n);l!==null&&(ut(l,t,n),Su(l,t,n)),t={cache:js()},e.payload=t;return}t=t.return}}function Z1(e,t,n){var l=bt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Zo(e)?nv(t,n):(n=ks(e,t,n,l),n!==null&&(ut(n,e,l),lv(n,t,l)))}function tv(e,t,n){var l=bt();Eu(e,t,n,l)}function Eu(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zo(e))nv(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,o=u(i,n);if(a.hasEagerState=!0,a.eagerState=o,St(o,i))return ko(e,t,a,0),ue===null&&Bo(),!1}catch{}if(n=ks(e,t,a,l),n!==null)return ut(n,e,l),lv(n,t,l),!0}return!1}function of(e,t,n,l){if(l={lane:2,revertLane:yf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Zo(e)){if(t)throw Error(T(479))}else t=ks(e,n,l,2),t!==null&&ut(t,e,2)}function Zo(e){var t=e.alternate;return e===H||t!==null&&t===H}function nv(e,t){Ta=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lv(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Yg(e,n)}}var So={readContext:qe,use:Xo,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useLayoutEffect:he,useInsertionEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useSyncExternalStore:he,useId:he,useHostTransitionStatus:he,useFormState:he,useActionState:he,useOptimistic:he,useMemoCache:he,useCacheRefresh:he,useEffectEvent:he},av={readContext:qe,use:Xo,useCallback:function(e,t){return Fe().memoizedState=[e,t===void 0?null:t],e},useContext:qe,useEffect:zm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ki(4194308,4,Qp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ki(4194308,4,e,t)},useInsertionEffect:function(e,t){Ki(4,2,e,t)},useMemo:function(e,t){var n=Fe();t=t===void 0?null:t;var l=e();if(Hl){Qn(!0);try{e()}finally{Qn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Fe();if(n!==void 0){var a=n(t);if(Hl){Qn(!0);try{n(t)}finally{Qn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Z1.bind(null,H,e),[l.memoizedState,e]},useRef:function(e){var t=Fe();return e={current:e},t.memoizedState=e},useState:function(e){e=Xr(e);var t=e.queue,n=tv.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:lf,useDeferredValue:function(e,t){var n=Fe();return af(n,e,t)},useTransition:function(){var e=Xr(!1);return e=$p.bind(null,H,e.queue,!0,!1),Fe().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=H,a=Fe();if(q){if(n===void 0)throw Error(T(407));n=n()}else{if(n=t(),ue===null)throw Error(T(349));(V&127)!==0||Cp(l,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,zm(Dp.bind(null,l,u,e),[e]),l.flags|=2048,za(9,{destroy:void 0},Rp.bind(null,l,u,n,t),null),n},useId:function(){var e=Fe(),t=ue.identifierPrefix;if(q){var n=cn,l=on;n=(l&~(1<<32-yt(l)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=bo++,0<\\/script>\",u=u.removeChild(u.firstChild);break;case\"select\":u=typeof l.is==\"string\"?i.createElement(\"select\",{is:l.is}):i.createElement(\"select\"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is==\"string\"?i.createElement(a,{is:l.is}):i.createElement(a)}}u[Le]=t,u[ot]=l;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=u;e:switch(ke(u,a,l),a){case\"button\":case\"input\":case\"select\":case\"textarea\":l=!!l.autoFocus;break e;case\"img\":l=!0;break e;default:l=!1}l&&Tn(t)}}return ce(t),t.subtreeFlags&=-33554433,ur(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Tn(t);else{if(typeof l!=\"string\"&&t.stateNode===null)throw Error(T(166));if(e=Fn.current,Pl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Ce,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Le]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||th(e.nodeValue,n)),e||cl(t,!0)}else e=ku(e).createTextNode(l),e[Le]=t,t.stateNode=e}return ce(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Pl(t),n!==null){if(e===null){if(!l)throw Error(T(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(557));e[Le]=t}else wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ce(t),e=!1}else n=er(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(mt(t),t):(mt(t),null);if((t.flags&128)!==0)throw Error(T(558))}return ce(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Pl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(T(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(T(317));a[Le]=t}else wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ce(t),a=!1}else a=er(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(mt(t),t):(mt(t),null)}return mt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ci(t,t.updateQueue),ce(t),null);case 4:return Aa(),e===null&&bf(t.stateNode.containerInfo),t.flags|=67108864,ce(t),null;case 10:return On(t.type),ce(t),null;case 19:if(Js(t),l=t.memoizedState,l===null)return ce(t),null;if(a=(t.flags&128)!==0,u=l.rendering,u===null)if(a)ou(l,!1);else{if(ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=ho(e),u!==null){for(t.flags|=128,ou(l,!1),e=u.updateQueue,t.updateQueue=e,Ci(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vp(n,e),n=n.sibling;return Lu(t,Be.current&1|2),q&&Nn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&vt()>_o&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304)}else{if(!a)if(e=ho(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ci(t,e),ou(l,!0),l.tail===null&&l.tailMode!==\"collapsed\"&&l.tailMode!==\"visible\"&&!u.alternate&&!q)return ce(t),null}else 2*vt()-l.renderingStartTime>_o&&n!==536870912&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=vt(),e.sibling=null,u=Be.current,u=a?u&1|2:u&1,l.tailMode===\"visible\"||l.tailMode===\"collapsed\"||!n||q?Lu(t,u):(n=u,se(Ye,t),se(Be,n),Xe===null&&(Xe=t)),q&&Nn(t,l.treeForkCount),e}return ce(t),null;case 22:case 23:return mt(t),Ks(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(ce(t),t.subtreeFlags&6&&(t.flags|=8192)):ce(t),n=t.updateQueue,n!==null&&Ci(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Ge(_l),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),On(Ne),ce(t),null;case 25:return null;case 30:return t.flags|=33554432,ce(t),null}throw Error(T(156,t.tag))}function P1(e,t){switch(Vs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return On(Ne),Aa(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return io(t),null;case 31:if(t.memoizedState!==null){if(mt(t),t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Js(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Aa(),null;case 10:return On(t.type),null;case 22:case 23:return mt(t),Ks(),e!==null&&Ge(_l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return On(Ne),null;case 25:return null;default:return null}}function pv(e,t){switch(Vs(t),t.tag){case 3:On(Ne),Aa();break;case 26:case 27:case 5:io(t);break;case 4:Aa();break;case 31:t.memoizedState!==null&&mt(t);break;case 13:mt(t);break;case 19:Js(t);break;case 10:On(t.type);break;case 22:case 23:mt(t),Ks(),e!==null&&Ge(_l);break;case 24:On(Ne)}}function Pu(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var u=n.create,i=n.inst;l=u(),i.destroy=l}n=n.next}while(n!==a)}}catch(o){ne(t,t.return,o)}}function sl(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var u=a.next;l=u;do{if((l.tag&e)===e){var i=l.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,a=t;var c=n,f=o;try{f()}catch(d){ne(a,c,d)}}}l=l.next}while(l!==u)}}catch(d){ne(t,t.return,d)}}function vv(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ap(t,n)}catch(l){ne(e,e.return,l)}}}function hv(e,t,n){n.props=Ll(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){ne(e,t,l)}}function nn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var a=e.stateNode,u=_n(e.memoizedProps,a);(a.ref===null||a.ref.name!==u)&&(a.ref=oh(u)),l=a.ref;break;case 7:if(e.stateNode===null){var i=new Tt(e);it(e.child,!1,Yb,i,void 0,void 0),e.stateNode=i}l=e.stateNode;break;default:l=e.stateNode}typeof n==\"function\"?e.refCleanup=n(l):n.current=l}}catch(o){ne(e,t,o)}}function He(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l==\"function\")try{l()}catch(a){ne(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(a){ne(e,t,a)}else n.current=null}function No(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title\"))),ke(l,t,n),l[Le]=e,we(l),t=l;break e;case\"link\":if(u=hg(\"link\",\"href\",a).get(t+(n.href||\"\"))){for(i=0;ix&&(i=x,x=S,S=i);var p=dm(o,S),m=dm(o,x);if(p&&m&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==m.node||s.focusOffset!==m.offset)){var h=g.createRange();h.setStart(p.node,p.offset),s.removeAllRanges(),S>x?(s.addRange(h),s.extend(m.node,m.offset)):(h.setEnd(m.node,m.offset),s.addRange(h))}}}}for(g=[],s=o;s=s.parentNode;)s.nodeType===1&&g.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof o.focus==\"function\"&&o.focus(),o=0;on?32:n,C.T=null,n=fs,fs=null;var u=Xt,i=sn;if(pe=0,ql=Xt=null,sn=0,(F&6)!==0)throw Error(T(331));var o=F;if(F|=4,Lv(u.current),Dv(u,u.current,i,n),F=o,ei(0,!1),ht&&typeof ht.onPostCommitFiberRoot==\"function\")try{ht.onPostCommitFiberRoot(Zu,u)}catch{}return!0}finally{W.p=a,C.T=l,Jv(e,t)}}function Fm(e,t,n){t=Rt(n,t),t=Jr(e.stateNode,t,2),e=el(e,t,2),e!==null&&(Ju(e,2),mn(e))}function ne(e,t,n){if(e.tag===3)Fm(e,e,n);else for(;t!==null;){if(t.tag===3){Fm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof l.componentDidCatch==\"function\"&&(ll===null||!ll.has(l))){e=Rt(n,e),n=rv(2),l=el(t,n,2),l!==null&&(sv(n,l,t,e),Ju(l,2),mn(l));break}}t=t.return}}function sr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new lb;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(vf=!0,a.add(n),e=fb.bind(null,e,t,n),t.then(e,e))}function fb(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ue===e&&(V&n)===n&&((ye===4||ye===3&&(V&62914560)===V&&300>vt()-Jo)&&(F&2)===0?Ra(e,0):Ao|=n,wa===V&&(wa=0)),mn(e)}function Iv(e,t){t===0&&(t=Bg()),e=Yl(e,t),e!==null&&(Ju(e,t),mn(e))}function db(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Iv(e,n)}function mb(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(T(314))}l!==null&&l.delete(t),Iv(e,n)}function gb(e,t){return ws(e,t)}var Da=null,la=null,vs=!1,wo=!1,fr=!1,$n=0;function mn(e){e!==la&&e.next===null&&(la===null?Da=la=e:la=la.next=e),wo=!0,vs||(vs=!0,vb())}function ei(e,t){if(!fr&&wo){fr=!0;do for(var n=!1,l=Da;l!==null;){if(!t)if(e!==0){var a=l.pendingLanes;if(a===0)var u=0;else{var i=l.suspendedLanes,o=l.pingedLanes;u=(1<<31-yt(42|e)+1)-1,u&=a&~(i&~o),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Wm(l,u))}else u=V,u=Uo(l,l===ue?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Ku(l,u)||(n=!0,Wm(l,u));l=l.next}while(n);fr=!1}}function pb(){$v()}function $v(){wo=vs=!1;var e=0;$n!==0&&Ob()&&(e=$n);for(var t=vt(),n=null,l=Da;l!==null;){var a=l.next,u=Fv(l,t);u===0?(l.next=null,n===null?Da=a:n.next=a,a===null&&(la=n)):(n=l,(e!==0||(u&3)!==0)&&(wo=!0)),l=a}pe!==0&&pe!==5||ei(e,!1),$n!==0&&($n=0)}function Fv(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0o)break;var d=c.transferSize,g=c.initiatorType;d&&ag(g)&&(c=c.responseEnd,i+=d*(cto){S.length=y;break}h=new Promise(Cb.bind(h)),S.push(h)}}}if(0\"u\"?null:document;function ph(e,t,n){var l=Xa;if(l&&typeof t==\"string\"&&t){var a=Ct(t);a='link[rel=\"'+e+'\"][href=\"'+a+'\"]',typeof n==\"string\"&&(a+='[crossorigin=\"'+n+'\"]'),gg.has(a)||(gg.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement(\"link\"),ke(t,\"link\",e),we(t),l.head.appendChild(t)))}}function $b(e){Un.D(e),ph(\"dns-prefetch\",e,null)}function Fb(e,t){Un.C(e,t),ph(\"preconnect\",e,t)}function Wb(e,t,n){Un.L(e,t,n);var l=Xa;if(l&&e&&t){var a='link[rel=\"preload\"][as=\"'+Ct(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(a+='[imagesrcset=\"'+Ct(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(a+='[imagesizes=\"'+Ct(n.imageSizes)+'\"]')):a+='[href=\"'+Ct(e)+'\"]';var u=a;switch(t){case\"style\":u=Ha(e);break;case\"script\":u=Qa(e)}if(!(Ht.has(u)||(e=ie({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ht.set(u,e),l.querySelector(a)!==null||t===\"style\"&&l.querySelector(ti(u))||t===\"script\"&&l.querySelector(ni(u))))){var i=l.createElement(\"link\");ke(i,\"link\",e),t===\"style\"&&(i[co]=!0,i.onload=i.onerror=function(){Xg(i)}),we(i),l.head.appendChild(i)}}}function Pb(e,t){Un.m(e,t);var n=Xa;if(n&&e){var l=t&&typeof t.as==\"string\"?t.as:\"script\",a='link[rel=\"modulepreload\"][as=\"'+Ct(l)+'\"][href=\"'+Ct(e)+'\"]',u=a;switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":u=Qa(e)}if(!Ht.has(u)&&(e=ie({rel:\"modulepreload\",href:e},t),Ht.set(u,e),n.querySelector(a)===null)){switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(ni(u)))return}l=n.createElement(\"link\"),ke(l,\"link\",e),we(l),n.head.appendChild(l)}}}function eS(e,t,n){Un.S(e,t,n);var l=Xa;if(l&&e){var a=va(l).hoistableStyles,u=Ha(e);t=t||\"default\";var i=a.get(u);if(!i){var o={loading:0,preload:null};if(i=l.querySelector(ti(u)))o.loading=5;else{e=ie({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=Ht.get(u))&&Ef(e,n);var c=i=l.createElement(\"link\");we(c),ke(c,\"link\",e),c._p=new Promise(function(f,d){c.onload=f,c.onerror=d}),c.addEventListener(\"load\",function(){o.loading|=1}),c.addEventListener(\"error\",function(){o.loading|=2}),o.loading|=4,Pi(i,t,l)}i={type:\"stylesheet\",instance:i,count:1,state:o},a.set(u,i)}}}function tS(e,t){Un.X(e,t);var n=Xa;if(n&&e){var l=va(n).hoistableScripts,a=Qa(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ie({src:e,async:!0},t),(t=Ht.get(a))&&xf(e,t),u=n.createElement(\"script\"),we(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function nS(e,t){Un.M(e,t);var n=Xa;if(n&&e){var l=va(n).hoistableScripts,a=Qa(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ie({src:e,async:!0,type:\"module\"},t),(t=Ht.get(a))&&xf(e,t),u=n.createElement(\"script\"),we(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function pg(e,t,n,l){var a=(a=Fn.current)?Yu(a):null;if(!a)throw Error(T(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(n=Ha(n.href),t=va(a).hoistableStyles,l=t.get(n),l||(l={type:\"style\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=Ha(n.href);var u=va(a).hoistableStyles,i=u.get(e);if(i||(a=a.ownerDocument||a,i={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,i),(u=a.querySelector(ti(e)))?u._p||(i.instance=u,i.state.loading=5):(u=Ht.get(e),u||(u={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ht.set(e,u)),lS(a,e,u,i.state))),t&&l===null)throw Error(T(528,\"\"));return i}if(t&&l!==null)throw Error(T(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(n=Qa(n),t=va(a).hoistableScripts,l=t.get(n),l||(l={type:\"script\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};default:throw Error(T(444,e))}}function Ha(e){return'href=\"'+Ct(e)+'\"'}function ti(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function vh(e){return ie({},e,{\"data-precedence\":e.precedence,precedence:null})}function lS(e,t,n,l){if(t=e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")){if(t[co]!==!0){l.loading=1;return}}else t=e.createElement(\"link\"),t[co]=!0,t.onload=t.onerror=Xg.bind(null,t),ke(t,\"link\",n),we(t),e.head.appendChild(t);l.preload=t,t.addEventListener(\"load\",function(){return l.loading|=1}),t.addEventListener(\"error\",function(){return l.loading|=2})}function Qa(e){return'[src=\"'+Ct(e)+'\"]'}function ni(e){return\"script[async]\"+e}function vg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var l=e.querySelector('style[data-href~=\"'+Ct(n.href)+'\"]');if(l)return t.instance=l,we(l),l;var a=ie({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement(\"style\"),we(l),ke(l,\"style\",a),Pi(l,n.precedence,e),t.instance=l;case\"stylesheet\":a=Ha(n.href);var u=e.querySelector(ti(a));if(u)return t.state.loading|=4,t.instance=u,we(u),u;l=vh(n),(a=Ht.get(a))&&Ef(l,a),u=(e.ownerDocument||e).createElement(\"link\"),we(u);var i=u;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),t.state.loading|=4,Pi(u,n.precedence,e),t.instance=u;case\"script\":return u=Qa(n.src),(a=e.querySelector(ni(u)))?(t.instance=a,we(a),a):(l=n,(a=Ht.get(u))&&(l=ie({},n),xf(l,a)),e=e.ownerDocument||e,a=e.createElement(\"script\"),we(a),ke(a,\"link\",l),e.head.appendChild(a),t.instance=a);case\"void\":return null;default:throw Error(T(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Pi(l,n.precedence,e));return t.instance}function Pi(e,t,n){for(var l=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,u=a,i=0;i title\"):null)}function aS(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function yg(e,t){return e===\"img\"&&t.src!=null&&t.src!==\"\"&&t.onLoad==null&&t.loading!==\"lazy\"}function hh(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function yh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==\"number\"?devicePixelRatio:1)*.25}function bg(e,t){typeof t.decode==\"function\"&&(e.imgCount++,t.complete||(e.imgBytes+=yh(t),e.suspenseyImages.push(t)),e=oS.bind(e),t.decode().then(e,e))}function uS(e,t,n,l){if(n.type===\"stylesheet\"&&(typeof l.media!=\"string\"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Ha(l.href),u=t.querySelector(ti(a));if(u){t=u._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=Vu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,we(u);return}u=t.ownerDocument||t,l=vh(l),(a=Ht.get(a))&&Ef(l,a),u=u.createElement(\"link\"),we(u);var i=u;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Vu.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var to=0;function iS(e,t){return e.stylesheets&&e.count===0&&no(e,e.stylesheets),0to?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function bh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)no(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Vu(){this.count--,bh(this)}function oS(){this.imgCount--,bh(this)}var Ro=null;function no(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ro=new Map,t.forEach(cS,e),Ro=null,Vu.call(e))}function cS(e,t){if(!(t.state.loading&4)){var n=Ro.get(e);if(n)var l=n.get(null);else{n=new Map,Ro.set(e,n);for(var a=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),u=0;u{\"use strict\";function Mh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mh)}catch(e){console.error(e)}}Mh(),zh.exports=_h()});var Rh=Ft(ec=>{\"use strict\";var vS=Symbol.for(\"react.transitional.element\"),hS=Symbol.for(\"react.fragment\");function Ch(e,t,n){var l=null;if(n!==void 0&&(l=\"\"+n),t.key!==void 0&&(l=\"\"+t.key),\"key\"in t){n={};for(var a in t)a!==\"key\"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:vS,type:e,key:l,ref:t!==void 0?t:null,props:n}}ec.Fragment=hS;ec.jsx=Ch;ec.jsxs=Ch});var ae=Ft((fT,Dh)=>{\"use strict\";Dh.exports=Rh()});var yn={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1},E0=[\"RETIRED\",\"CONFLICT\",\"NOT_FOUND\",\"DOCUMENT_TOO_LARGE\",\"STORAGE_FAILURE\",\"ORIGIN_NOT_DECLARED\",\"MESSAGE_TOO_LARGE\",\"PAGE_TOO_LARGE\",\"PATCH_TOO_LARGE\",\"DEADLINE\",\"INVALID_STEPS\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"CONFIGURATION_REQUIRED\",\"NOT_READY\",\"UNKNOWN_METHOD\",\"INVALID_ARGUMENT\",\"QUOTA_EXCEEDED\",\"PROTOCOL_MISMATCH\",\"APPLET_INCOMPATIBLE\",\"ENVELOPE_INVALID\",\"CONTEXT_REPLACED\",\"TARGET_NOT_FOUND\",\"PRECONDITION_FAILED\",\"ASYNC_READ\",\"AUTH_REQUIRED\",\"REJECTED\"];function ed(e){return typeof e==\"string\"&&E0.includes(e)}var x0=/^:[A-Za-z][A-Za-z0-9_]*$/,O0=/^[A-Za-z0-9_.~@-]+$/,yc=new Map;function A0(e){if(yc.has(e))return yc.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),l=n.at(-1)===\"*\";l&&n.pop();let a=[],u=!0;for(let i of n)x0.test(i)?a.push({param:i.slice(1)}):O0.test(i)&&i!==\".\"&&i!==\"..\"?a.push({literal:i}):u=!1;u&&(t={segments:a,rest:l})}return yc.set(e,t),t}function Se(e){try{return new URL(e).href}catch{return null}}function hl(e,t){let n=_0(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let l;try{l=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}l.at(-1)===\"\"&&l.pop();for(let a of e.routes){let u=A0(a.pattern);if(!u)continue;let i=M0(u,l);if(!i||!(a.query??[]).every(c=>n.searchParams.has(c)))continue;for(let c of a.query??[])i[c]=n.searchParams.get(c);let o={kind:\"route\",routeId:a.id,page:a.page,screen:a.screen,params:i};return a.context!==void 0&&(o.context=a.context),o}return{kind:\"website\",url:t}}function _0(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function M0(e,t){if(e.rest?t.lengthS.id===u.id)?.startUrl;f={index:o.index,start:y!==void 0&&Se(y)===Se(t.view.url),url:s}}}else t.status===\"ready\"&&t.account!==null&&c===\"auth\"&&(c=\"none\",f=null);o.page.status===\"ready\"&&(t.status===\"loading\"||t.status===\"error\")&&(d++,g=!1,l.push({type:\"schedule\",id:u.id,token:d}));let r={...o,seen:Math.max(o.seen,t.view.n),pin:c,signIn:f,deadline:d,page:{status:t.status,pageId:t.pageId,routeId:t.routeId,view:t.view,stale:t.stale,expired:g}};return{state:vl(Wf(e,u,r),r),effects:l}}case\"deadline\":{let u=e.contexts[t.id];return!u||t.token!==u.deadline||u.page.status===\"ready\"||u.page.expired?a:{state:vl(e,{...u,page:{...u.page,expired:!0}}),effects:l}}case\"user.viewWebsite\":{let u=e.contexts[t.id];return!u||u.pin===\"user\"?a:{state:vl(e,{...u,pin:\"user\"}),effects:l}}case\"user.done\":{let u=e.contexts[t.id];if(!u)return a;if(u.pin===\"auth\"&&u.signIn)return If(e,u,n)??a;let i=u.pin===\"none\"?u:{...u,pin:\"none\"},o=i===u?e:vl(e,i);if(fi(i,n)!==\"website\")return{state:o,effects:l};if(i.canGoBack)l.push({type:\"context.back\",id:u.id});else{let c=n.contexts.find(f=>f.id===u.id)?.startUrl;c&&l.push({type:\"context.navigate\",id:u.id,url:c,mode:\"push\"})}return{state:o,effects:l}}case\"navigate.url\":{let u=t.context??e.active;return e.contexts[u]?(l.push({type:\"context.navigate\",id:u,url:t.url,mode:t.mode}),{state:{...e,active:u,overlay:[],leaveGuard:null},effects:l}):a}case\"navigate.screen\":{let u=t.mode===\"root\"?[t.screen]:t.mode===\"replace\"?[...e.overlay.slice(0,-1),t.screen]:[...e.overlay,t.screen];return{state:{...e,overlay:u,leaveGuard:null},effects:l}}case\"select\":{let u=e.contexts[t.id];if(!u)return a;if(t.id!==e.active||e.overlay.length>0)return{state:{...e,active:t.id,overlay:[],leaveGuard:null},effects:l};let i=n.contexts.find(o=>o.id===t.id)?.startUrl;return i&&(u.url===null||Se(u.url)!==Se(i))&&l.push({type:\"context.navigate\",id:t.id,url:i,mode:\"push\"}),{state:{...e,leaveGuard:null},effects:l}}case\"back\":{if(e.leaveGuard)return{state:e,effects:[{type:\"confirmLeave\",message:e.leaveGuard.message}]};if(e.overlay.length>0)return{state:{...e,overlay:e.overlay.slice(0,-1)},effects:l};let u=e.contexts[e.active];return u?.pin===\"auth\"&&u.signIn?If(e,u,n)??{state:e,effects:[{type:\"leave\"}]}:e.contexts[e.active]?.canGoBack?{state:e,effects:[{type:\"context.back\",id:e.active}]}:{state:e,effects:[{type:\"leave\"}]}}case\"guard\":return{state:{...e,leaveGuard:t.guard},effects:l};case\"context.gone\":{let u=e.contexts[t.id];return u?{state:vl(e,{...u,page:{...Sc,status:\"unsupported\"}}),effects:l}:a}}}function If(e,t,n){let{index:l,start:a}=t.signIn,u=n.contexts[0].id,i=vl(e,{...t,pin:\"none\",signIn:null});if(!a&&l>0){let o=Math.max(1,t.index-l+1);return{state:i,effects:[{type:\"context.back\",id:t.id,steps:o}]}}return t.id===u?null:{state:{...i,active:u,overlay:[],leaveGuard:null},effects:[]}}function $f(e,t,n){return t===e.generation&&e.url!==null&&Se(n)===Se(e.url)}function Ff(e,t,n,l){let a=e.deadline+1;return l.push({type:\"schedule\",id:e.id,token:a}),{...e,url:n,seen:t===e.generation?e.seen:-1,generation:t,page:Sc,deadline:a}}function Wf(e,t,n){return!e.leaveGuard||t.id!==e.active||e.overlay.length>0||t.index===n.index&&t.url!==null&&n.url!==null&&Se(t.url)===Se(n.url)?e:{...e,leaveGuard:null}}function vl(e,t){return{...e,contexts:{...e.contexts,[t.id]:t}}}function Tc(e){let t={};for(let[n,l]of Object.entries(e.contexts))t[n]={url:l.url};return{version:yn.sessionState,state:{active:e.active,overlay:e.overlay,contexts:t}}}function ld(e,t){let n=z0(t);if(!e||e.version!==yn.sessionState||!eu(e.state))return n;let{active:l,overlay:a,contexts:u}=e.state,i={...n,contexts:{...n.contexts}};if(typeof l==\"string\"&&i.contexts[l]&&(i.active=l),Array.isArray(a)&&(i.overlay=a.filter(o=>C0(o,t.foreground.screens))),eu(u))for(let o of Object.keys(i.contexts)){let c=eu(u[o])?u[o].url:void 0;typeof c==\"string\"&&(i.contexts[o]=td(o,c))}return i}function C0(e,t){return eu(e)&&typeof e.key==\"string\"&&typeof e.id==\"string\"&&t.includes(e.id)&&eu(e.params)&&Object.values(e.params).every(n=>typeof n==\"string\")}function eu(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var IS=yn.bundleFormat,bc=\"(0|[1-9]\\\\d*)\",Pf=\"(?:0|[1-9]\\\\d*|\\\\d*[A-Za-z-][0-9A-Za-z-]*)\",$S=new RegExp(`^${bc}\\\\.${bc}\\\\.${bc}(?:-(${Pf}(?:\\\\.${Pf})*))?$`),st=class extends Error{code;constructor(e,t){super(t),this.name=\"GenesisError\",this.code=e}},R0=2e3;function Nc(e,t){return new Promise((n,l)=>{let a=null,u=!1,i=1,o=new Map,c=new Map,f={get bound(){return a},get retired(){return u},request(s,y={}){if(u)return Promise.reject(new st(\"RETIRED\",\"This page was closed\"));let S=i++;return new Promise((x,p)=>{let m=setTimeout(()=>{o.delete(S),p(new st(\"DEADLINE\",`${s} did not answer in time`))},a.limits.rpcDeadlineMs+R0);o.set(S,{resolve:x,reject:p,timer:m}),e.postMessage(JSON.stringify({type:\"request\",documentId:a.documentId,requestId:S,method:s,params:y}))})},on(s,y){let S=c.get(s);return S||c.set(s,S=new Set),S.add(y),()=>{S.delete(y)}}};function d(){u=!0;for(let s of o.values())clearTimeout(s.timer),s.reject(new st(\"RETIRED\",\"This page was closed\"));o.clear()}function g(s,y){for(let S of[...c.get(s)??[]])try{S(y)}catch(x){console.error(`Genesis ${s} handler failed`,x)}}e.addEventListener(\"message\",s=>{if(u||typeof s.data!=\"string\")return;let y;try{y=JSON.parse(s.data)}catch{return}if(y?.type===\"refused\"&&!a){u=!0,l(new st(y.error?.code??\"PROTOCOL_MISMATCH\",y.error?.message??\"The host refused this page\"));return}if(y?.type===\"bound\"){if(a)return;a=y,n(f);return}if(!(!a||y?.documentId!==a.documentId))if(y.type===\"response\"){let S=o.get(y.requestId);if(!S)return;o.delete(y.requestId),clearTimeout(S.timer),y.error?S.reject(new st(y.error.code,y.error.message)):S.resolve(y.result??null)}else y.type===\"event\"&&(y.name===\"retired\"?(d(),g(\"retired\",{})):g(y.name,y.data))}),addEventListener(\"pagehide\",()=>{u||(g(\"pagehide\",{}),d())});let r={type:\"hello\",protocol:yn.protocol,url:t};e.postMessage(JSON.stringify(r))})}var D0={pageId:null,routeId:null,params:{}};function ud(e,t){let n={};for(let g of e)n[g]=U0();let l={account:null,contexts:n},a=!1,u=new Map;function i(g){let r=g===null?[...u.values()]:[u.get(null),...g.map(y=>u.get(y))],s=new Set;for(let y of r)for(let S of[...y??[]])s.has(S)||(s.add(S),S())}function o(g,r){l={...l,contexts:{...l.contexts,[g]:r}}}function c(g){let{entry:r}=g;if(!g.attached||g.status!==\"ready\"||!r||!Kl(r.url,g.url))return;let{history:s}=g;for(s.delete(r.index),s.set(r.index,id(g));s.size>t.historyEntriesMax;)s.delete(s.keys().next().value)}function f(g,r,s){if(r===void 0||s!==\"ready\"&&s!==\"auth\")return!1;if(!a)return a=!0,l.account!==r&&(l={...l,account:r}),!1;if(r===l.account)return!1;let y={};for(let[S,x]of Object.entries(l.contexts))x.history.clear(),y[S]=S===g||!x.content||x.stale?x:{...x,stale:!0};return l={account:r,contexts:y},c(y[g]),!0}let d=(g,r=!1)=>({outcome:g,accountChanged:r});return{state:()=>l,context:g=>l.contexts[g],applyPage(g,r,s){let y=l.contexts[g];if(!y||r=r.size||m===r.index&&!Kl(h.url,r.url))&&S.delete(m)}let x={...y,generation:r.generation,entry:{index:r.index,url:r.url}},p;if(Kl(y.url,r.url))y.attached&&y.view?.generation!==r.generation?p={...x,attached:!1,status:\"loading\",error:null,stale:y.content}:p=x;else{let m=S.get(r.index);p=m?{...x,...m,attached:!1,status:\"loading\",error:null,stale:!0,content:!0}:{...x,...s,url:r.url,regions:{},attached:!1,status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1}}o(g,p),c(p),i([g])},gone(g,r){let s=l.contexts[g];s&&(o(g,{...s,attached:!1,status:\"error\",error:r,stale:s.content}),i([g]))},subscribe(g,r){let s=r??null,y=u.get(s);return y||u.set(s,y=new Set),y.add(g),()=>{y.delete(g)}}}}function U0(){return{generation:0,view:null,epoch:0,seq:0,live:[],attached:!1,url:null,pageId:null,routeId:null,params:{},regions:{},status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1,entry:null,history:new Map}}function Kl(e,t){return e!==null&&t!==null&&Se(e)===Se(t)}function id(e){return{url:e.url,pageId:e.pageId,routeId:e.routeId,params:e.params,regions:e.regions}}function H0(e,t){if(e.content&&Kl(e.url,t))return id(e);let{entry:n}=e,l=n&&Kl(n.url,t)?e.history.get(n.index):void 0;return l&&Kl(l.url,t)?l:null}function od(e,t=Object.create(null)){for(let n of e)t[n.key]=n;return t}function cd(e){return e.kind===\"single\"?{kind:\"single\",status:e.status,error:e.error??null,record:e.record}:{kind:\"collection\",status:e.status,error:e.error??null,order:e.items.map(t=>t.key),complete:e.complete,ephemeral:e.ephemeral===!0,records:od(e.items)}}function L0(e,t){let n={};for(let[l,a]of Object.entries(e)){let u=cd(a),i=t[l];n[l]=i?q0(i,u):u}return n}var di=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function q0(e,t){if(e.kind===\"single\"||t.kind===\"single\")return e.kind!==\"single\"||t.kind!==\"single\"?t:(di(e.record,t.record)&&(t.record=e.record),e.record===t.record&&e.status===t.status&&di(e.error,t.error)?e:t);let n=e.order.length===t.order.length&&e.complete===t.complete&&e.ephemeral===t.ephemeral&&e.status===t.status&&di(e.error,t.error);for(let[l,a]of t.order.entries()){let u=e.records[a];u&&di(u,t.records[a])?t.records[a]=u:n=!1,e.order[l]!==a&&(n=!1)}return n?e:t}function G0(e,t){let n=e.regions;for(let[l,a]of Object.entries(t)){let u=e.live.includes(l)?n[l]:void 0;if(!u)return null;let i;if(a.kind===\"replace\")i=cd(a.region);else if(a.kind===\"single\"){if(u.kind!==\"single\")return null;i={...u,record:a.record,status:a.status??u.status,error:a.error===void 0?u.error:a.error}}else{if(u.kind!==\"collection\")return null;if(i={...u,complete:a.complete??u.complete,status:a.status??u.status,error:a.error===void 0?u.error:a.error},a.upsert?.length||a.remove?.length){i.records=od(a.upsert??[],Object.assign(Object.create(null),u.records));for(let o of a.remove??[])delete i.records[o]}if(a.order){i.order=a.order;let o=new Set(a.order);for(let c of Object.keys(i.records))o.has(c)||(i.records===u.records&&(i.records=Object.assign(Object.create(null),u.records)),delete i.records[c])}else if(a.remove?.length){let o=new Set(a.remove);i.order=u.order.filter(c=>!o.has(c))}}n===e.regions&&(n={...n}),n[l]=i}return n}var rd=class extends st{constructor(e,t){super(e,t),this.name=\"ServiceError\"}},B0=[\"CONFIGURATION_REQUIRED\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"SERVICE_UNREACHABLE\",\"DEADLINE\",\"SERVICE_FAILURE\",\"QUOTA_EXCEEDED\"];function Ec(e){let t=e?.code;return t&&B0.includes(t)?\"This feature is temporarily unavailable. Try again in a moment.\":e instanceof Error?e.message:\"Something went wrong. Please try again.\"}async function xc(e=window.__genesisBridge){if(!e)throw new Error(\"Genesis bridge is missing; the foreground must run inside Genesis\");let t=await Nc(e,location.href),{compat:n}=t.bound;if(n.protocol!==yn.protocol||n.sessionState!==yn.sessionState)throw new st(\"PROTOCOL_MISMATCH\",\"This applet was built for another Genesis version\");return Q0(t)}var k0=500,Y0=1e3,V0=64,j0=2e3,X0=Object.freeze([]),ad=e=>e===void 0?null:Array.isArray(e)?e:[e];function Q0(e){let{manifest:t,appletId:n,limits:l,session:a}=e.bound,u=t.contexts.map(v=>v.id),i=ud(u,{historyEntriesMax:l.historyEntriesMax}),o=(v,E)=>e.request(v,E).catch(O=>{e.retired||console.error(`Genesis ${v} failed`,O)}),c=ld(a,t),f=new Set,d=null,g=new Set;function r(v){let E=nd(c,v,t),O=E.state!==c;c=E.state;let w=E.effects.filter(Z=>!s(Z));if(O){N=void 0,h();for(let Z of[...f])Z()}return w}function s(v){switch(v.type){case\"reveal\":return o(\"context.reveal\",{id:v.id}),!0;case\"cover\":return o(\"context.cover\"),!0;case\"context.navigate\":return si(v.id),o(\"context.navigate\",{id:v.id,url:v.url,mode:v.mode}),!0;case\"context.back\":return si(v.id),o(\"context.back\",v.steps?{id:v.id,steps:v.steps}:{id:v.id}),!0;case\"context.reload\":return si(v.id),o(\"context.reload\",{id:v.id}),!0;case\"schedule\":return setTimeout(()=>r({type:\"deadline\",id:v.id,token:v.token}),l.documentReadyMs),!0;case\"leave\":case\"confirmLeave\":return!1}}function y(v,E){d?d(v,E):window.confirm(v)&&E()}function S(v){let E=c.leaveGuard;if(!E)return v();y(E.message,()=>{r({type:\"guard\",guard:null}),v()})}function x(v){let E=!0;for(let O of r({type:\"back\"}))if(O.type===\"leave\")E=!1;else if(O.type===\"confirmLeave\"){let w=()=>{r({type:\"guard\",guard:null}),!x(!1)&&v&&o(\"back.leave\")};setTimeout(()=>y(O.message,w),0)}return E}let p=null,m=a?JSON.stringify(Tc(c)):\"\";function h(){p===null&&(p=setTimeout(b,k0))}function b(){p!==null&&clearTimeout(p),p=null;let v=Tc(c),E=JSON.stringify(v);E!==m&&(m=E,o(\"session.save\",v))}e.on(\"suspended\",b);let N;function M(){if(N!==void 0)return N;let v=c.overlay[c.overlay.length-1],E=c.contexts[c.active],O=null;if(v)O={key:v.key,id:v.id,params:v.params,context:c.active,overlay:!0};else if(E?.url){let w=hl(t,E.url);w.kind===\"route\"&&(O={key:`${E.id}:${E.index}`,id:w.screen,params:w.params,context:E.id,overlay:!1})}return N=O}let A=1,z=new Set(c.overlay.map(v=>v.key));function fe(){let v;do v=`s${A++}`;while(z.has(v));return z.add(v),v}function G(v){if(\"screen\"in v){let $t={key:fe(),id:v.screen,params:v.params??{}};S(()=>r({type:\"navigate.screen\",screen:$t,mode:v.mode??\"push\"}));return}let O=c.contexts[c.active]?.url??t.contexts[0].startUrl,w;try{w=new URL(v.url,O).href}catch{throw new st(\"INVALID_ARGUMENT\",`Not a URL: ${v.url}`)}let Z=v.context??rt(w);if(!c.contexts[Z])throw new st(\"NOT_FOUND\",`No context ${Z}`);let Ke=c.contexts[Z].url;if(Ke!==null&&Se(Ke)===Se(w)&&(v.mode??\"push\")===\"push\"){(Z!==c.active||c.overlay.length>0)&&S(()=>r({type:\"select\",id:Z}));return}S(()=>r({type:\"navigate.url\",url:w,context:Z,mode:v.mode??\"push\"}))}function rt(v){let E=hl(t,v);if(E.kind!==\"route\"||!E.context||!c.contexts[E.context])return c.active;let O=c.contexts[c.active],w=t.contexts.find(Ke=>Ke.id===c.active)?.startUrl,Z=!O.url||w!==void 0&&Se(O.url)===Se(w);return c.overlay.length>0||Z?E.context:c.active}function $(v){S(()=>{let E=v===c.active&&c.overlay.length===0,O=E&&c.contexts[v]?.url!==null&&Se(c.contexts[v].url)!==Se(t.contexts.find(w=>w.id===v)?.startUrl??\"\");if(r({type:\"select\",id:v}),E&&!O)for(let w of[...g])w(v)})}let xe=new Set;function Kt(v){xe.has(v)||(xe.add(v),setTimeout(()=>xe.delete(v),Y0),e.request(\"context.resync\",{id:v}).catch(()=>{}))}function ci(v){let E=hl(t,v);return E.kind===\"route\"?{pageId:E.page,routeId:E.routeId,params:E.params}:{pageId:null,routeId:null,params:{}}}e.on(\"page\",({id:v,generation:E,page:O})=>{let w=i.applyPage(v,E,O);if(w.outcome!==\"applied\")return;xe.delete(v);let Z=i.context(v);f0(v,O),r({type:\"context.page\",id:v,generation:E,view:O.view,status:O.status,pageId:O.pageId,routeId:O.routeId,account:O.account,stale:Z.stale&&Z.content,signInUrl:O.signInUrl??null}),Wa(v,w)}),e.on(\"patch\",({id:v,generation:E,patch:O})=>{let w=i.applyPatch(v,E,O);w.outcome===\"resync\"&&Kt(v),Wa(v,w)});function Wa(v,E){if(!E.accountChanged)return;let O=Zl(c,t);for(let w of u)w!==v&&(w===O?Kt(w):ri(w));for(let w of[...Jt.values()])w.context!==v&&It(w,{outcome:\"unknown\",code:\"CONTEXT_REPLACED\",message:\"The account changed\"})}function ri(v){si(v),o(\"context.reload\",{id:v})}e.on(\"context.navigated\",v=>{i.navigated(v.id,v,ci(v.url)),r({type:\"context.navigated\",...v})}),e.on(\"context.gone\",v=>{i.gone(v.id,{code:v.code??\"NOT_READY\",message:v.message??\"The page cannot be read\"}),r({type:\"context.gone\",id:v.id})}),e.on(\"user.viewWebsite\",v=>{r({type:\"user.viewWebsite\",id:v?.id??c.active})}),e.on(\"user.done\",v=>{r({type:\"user.done\",id:v?.id??c.active}),Vf()}),e.on(\"back\",()=>{let v=x(!0);o(\"back.handled\",{handled:v})});let Jt=new Map,sc=new Map,Pa=new Map,fc=0,dc=new Set,mc=new Map,Gf=(v,E,O)=>JSON.stringify([v,E,O]);function Bf(){let v=new Map;for(let O of Jt.values()){let w=Gf(O.context,O.region,O.key),Z=v.get(w);Z||v.set(w,Z=[]),Z.push({name:O.name,args:O.args})}let E=new Map;for(let[O,w]of v){let Z=mc.get(O);E.set(O,Z&&Z.length===w.length&&Z.every((Ke,$t)=>Ke.name===w[$t].name&&Ke.args===w[$t].args)?Z:w)}mc=E;for(let O of[...dc])O()}function It(v,E){Jt.get(v.dedup)===v&&(Jt.delete(v.dedup),v.actionId!==null&&sc.delete(v.actionId),v.timer!==null&&clearTimeout(v.timer),v.resolve(E),Bf())}function kf(v,E){v.timer!==null&&clearTimeout(v.timer),v.timer=setTimeout(()=>It(v,{outcome:\"unknown\",code:\"DEADLINE\",message:\"The action did not finish in time\"}),E)}function Yf(v,E){if(E.state===\"dispatched\"){if(!E.navigating)return;v.from=i.context(v.context)?.view??null,v.expect=E.expect??null,kf(v,l.actionTimeoutMs);return}let O=E.state===\"observed\"?\"observed\":E.state===\"cancelled\"?\"cancelled\":\"failed\";It(v,E.result??{outcome:O})}e.on(\"action.update\",v=>{let E=sc.get(v.actionId);if(E)return Yf(E,v);if(fc===0)return;let O=Pa.get(v.actionId)??[];O.push(v),Pa.set(v.actionId,O)});function f0(v,E){for(let O of[...Jt.values()]){if(O.context!==v||O.from===null)continue;let{from:w}=O;if(E.view.generation===w.generation&&E.view.n===w.n||E.status===\"loading\")continue;let Z=hl(t,E.view.url),Ke=Z.kind===\"route\"?Z.page:null,$t=ad(O.expect?.page);E.status===\"auth\"?It(O,{outcome:\"failed\",code:\"AUTH_REQUIRED\",message:\"Sign-in is needed\"}):Ke!==null&&ad(O.expect?.notPage)?.includes(Ke)?It(O,{outcome:\"failed\",code:\"REJECTED\",message:\"The website did not accept the action\"}):E.status===\"ready\"&&Ke!==null&&($t===null||$t.includes(Ke))?It(O,{outcome:\"observed\"}):It(O,{outcome:\"unknown\",message:\"The action led to another page\"})}}function si(v){for(let E of[...Jt.values()])E.context===v&&E.from!==null&&It(E,{outcome:\"unknown\",message:\"The page changed before the action finished\"})}function d0(v){let E=i.context(v.context);if(!E?.view)return Promise.resolve({outcome:\"failed\",code:\"NOT_READY\",message:\"The page is not ready\"});let O=v.region===null?void 0:E.regions[v.region],w=O?.kind===\"collection\"?O.records[v.key??\"\"]:O?.record??void 0,Z=JSON.stringify([v.context,w?.entityType??v.region,w?.entity??v.key,v.name,v.args??null]),Ke=Jt.get(Z);if(Ke)return Ke.promise;let $t,Qf=new Promise(Bt=>{$t=Bt}),pl={...v,dedup:Z,actionId:null,promise:Qf,resolve:$t,timer:null,from:null,expect:null};Jt.set(Z,pl),kf(pl,l.actionTimeoutMs+j0),Bf();let{view:Zf}=E,p0={region:v.region,key:v.key,name:v.name,args:v.args??null,view:Zf.n},Kf=()=>{--fc===0&&Pa.clear()};return fc++,e.request(\"context.act\",{id:v.context,generation:Zf.generation,action:p0}).then(({actionId:Bt})=>{let hc=Pa.get(Bt)??[];if(Pa.delete(Bt),Kf(),Jt.get(Z)===pl){pl.actionId=Bt,sc.set(Bt,pl);for(let v0 of hc)Yf(pl,v0)}},Bt=>{Kf();let hc=ed(Bt?.code)?Bt.code:void 0;It(pl,{outcome:\"failed\",code:hc,message:Bt instanceof Error?Bt.message:\"The action failed\"})}),Qf}let gc=new Set;e.on(\"storage.changed\",v=>{for(let E of[...gc])E(v)});let m0={get:(v,E)=>e.request(\"storage.get\",{collection:v,key:E}),list:(v,E={})=>e.request(\"storage.list\",{collection:v,...E}),commit:v=>e.request(\"storage.commit\",{checks:v.checks??[],puts:v.puts??[],deletes:v.deletes??[]}),onChanged(v){return gc.add(v),()=>{gc.delete(v)}}},g0={async request(v,E,O={}){try{return await e.request(\"services.request\",{serviceId:v,path:E,method:O.method??\"GET\",body:O.body??null})}catch(w){throw w instanceof st?new rd(w.code,w.message):w}}},pc=new Set;function Vf(){for(let v of[...pc])v()}e.on(\"resumed\",Vf);let vc=new Set;e.on(\"retired\",()=>{for(let v of[...Jt.values()])It(v,{outcome:\"unknown\",code:\"RETIRED\",message:\"This page was closed\"});for(let v of[...vc])v()});let Ql=new Map;for(let v of u)e.request(\"context.resync\",{id:v}).catch(()=>{}),s({type:\"schedule\",id:v,token:c.contexts[v].deadline});let jf=Zl(c,t);jf!==null&&o(\"context.reveal\",{id:jf});let Xf=!1;return{manifest:t,appletId:n,limits:l,restored:a!==null,store:i,navigation:{state:()=>c,screen:M,presentation:v=>fi(c.contexts[v],t),revealed:()=>Zl(c,t),navigate:G,select:$,back:()=>{x(!1)},reload:v=>{ri(v??c.active)},viewWebsite:v=>{r({type:\"user.viewWebsite\",id:v??c.active})},done:v=>{r({type:\"user.done\",id:v??c.active})},setLeaveGuard:v=>{r({type:\"guard\",guard:v===null?null:{message:v}})},onConfirmLeave(v){return d=v,()=>{d===v&&(d=null)}},onScrollToTop(v){return g.add(v),()=>{g.delete(v)}},subscribe(v){return f.add(v),()=>{f.delete(v)}}},actions:{act:d0,pending:(v,E,O)=>mc.get(Gf(v,E,O))??X0,subscribe(v){return dc.add(v),()=>{dc.delete(v)}}},storage:m0,services:g0,scroll:{get:v=>Ql.get(v),set(v,E){for(Ql.delete(v),Ql.set(v,E);Ql.size>V0;)Ql.delete(Ql.keys().next().value)}},onResume(v){return pc.add(v),()=>{pc.delete(v)}},onRetired(v){return vc.add(v),()=>{vc.delete(v)}},ready(){Xf||(Xf=!0,o(\"ui.ready\"))}}}var X=L(et(),1),Hh=L(wh(),1),li=L(ae(),1),Lh=(0,X.createContext)(null);function yS({foreground:e,children:t}){return(0,li.jsx)(Lh.Provider,{value:e,children:t})}function gn(){let e=(0,X.useContext)(Lh);if(!e)throw new Error(\"Genesis hooks need mountForeground or GenesisProvider\");return e}function bS({foreground:e,children:t}){return(0,X.useLayoutEffect)(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e.ready()))},[e]),t}async function qh(e,t){let n=t??document.getElementById(\"root\")??document.body.appendChild(document.createElement(\"div\")),l=await xc(),a=(0,Hh.createRoot)(n);return l.onRetired(()=>a.unmount()),a.render((0,li.jsx)(yS,{foreground:l,children:(0,li.jsx)(bS,{foreground:l,children:e})})),l}function zf(){let e=gn();return(0,X.useSyncExternalStore)(e.navigation.subscribe,e.navigation.state)}function tc(e){let t=zf();return e??t.active}function Gh(e,t){let{store:n}=gn(),l=(0,X.useCallback)(a=>n.subscribe(a,e),[n,e]);return(0,X.useSyncExternalStore)(l,()=>t(n.context(e)))}var SS=(e,t)=>e.pageId===t.pageId&&e.status===t.status&&e.stale===t.stale&&e.generation===t.generation&&e.params===t.params&&e.error===t.error&&e.account===t.account&&e.url===t.url;function TS(e,t){return{pageId:e?.pageId??null,status:e?.status??\"loading\",stale:e?e.stale&&e.content:!1,generation:e?.view?.generation??null,params:e?.params??NS,error:e?.error??null,account:t,url:e?.url??null}}function ct(e){let{store:t}=gn(),n=tc(e),l=(0,X.useRef)(null),a=(0,X.useCallback)(i=>t.subscribe(i),[t]),u=(0,X.useCallback)(()=>{let i=TS(t.context(n),t.state().account);return(!l.current||!SS(l.current,i))&&(l.current=i),l.current},[t,n]);return(0,X.useSyncExternalStore)(a,u)}var NS=Object.freeze({}),Uh=new WeakMap,ES=Object.freeze({order:Object.freeze([]),get:()=>{},complete:!1,status:\"missing\",error:null,ephemeral:!1});function xS(e){if(!e)return ES;let t=Uh.get(e);if(t)return t;if(e.kind===\"collection\"){let{records:n}=e;t={order:e.order.filter(l=>n[l]!==void 0),get:l=>n[l],complete:e.complete,status:e.status,error:e.error,ephemeral:e.ephemeral}}else{let{record:n}=e;t={order:n?[n.key]:[],get:l=>n&&n.key===l?n:void 0,complete:!0,status:e.status,error:e.error,ephemeral:!1}}return Uh.set(e,t),t}function pn(e,t){return Gh(tc(t),n=>xS(n?.regions[e]))}function Nt(e,t,n){return Gh(tc(n),l=>OS(l?.regions[e],t))}function OS(e,t){if(e)return e.kind===\"single\"?t===null||e.record?.key===t?e.record??void 0:void 0:t===null?void 0:e.records[t]}function nc(e,t,n){let l=gn();return(0,X.useCallback)((a,u)=>l.actions.act({context:n??l.navigation.state().active,region:t??null,key:a,name:e,args:u}),[l,e,t,n])}function lc(e,t,n){let l=gn(),a=tc(n);return(0,X.useSyncExternalStore)(l.actions.subscribe,()=>l.actions.pending(a,e,t))}function ge(){let e=gn(),t=zf(),{navigation:n}=e;return(0,X.useMemo)(()=>({presentation:n.presentation(t.active),active:t.active,contexts:t.contexts,overlay:t.overlay,screen:n.screen(),revealed:n.revealed(),navigate:n.navigate,back:n.back,select:n.select,reload:n.reload,viewWebsite:n.viewWebsite,done:n.done,setLeaveGuard:n.setLeaveGuard}),[n,t])}function ac(e,t={}){let n=gn(),l=t.storage??n.storage,[a,u]=(0,X.useState)({records:[],loading:!0,error:null});(0,X.useEffect)(()=>{let g=!0,r=0;async function s(){let S=++r;try{let x=[],p;do{let m=await l.list(e,p===void 0?{}:{afterKey:p});x.push(...m.entries),p=m.nextAfterKey??void 0}while(p!==void 0);g&&S===r&&u({records:x,loading:!1,error:null})}catch(x){g&&S===r&&u(p=>({...p,loading:!1,error:x}))}}s();let y=l.onChanged(S=>{S.changes.some(x=>x.collection===e)&&s()});return()=>{g=!1,y()}},[l,e]);let i=(0,X.useRef)(a.records);i.current=a.records;let o=(0,X.useCallback)(g=>i.current.find(r=>r.key===g)?.revision??null,[]),c=(0,X.useCallback)(g=>l.commit(g),[l]),f=(0,X.useCallback)((g,r,s)=>l.commit({checks:[{collection:e,key:g,expectedRevision:s===void 0?o(g):s}],puts:[{collection:e,key:g,value:r}]}),[l,e,o]),d=(0,X.useCallback)(g=>l.commit({checks:[{collection:e,key:g,expectedRevision:o(g)}],deletes:[{collection:e,key:g}]}),[l,e,o]);return{...a,put:f,remove:d,commit:c}}function Bh(e){let t=gn();return(0,X.useCallback)((n,l={})=>t.services.request(e,n,l),[t,e])}var AS=1500;function _S(){let e=gn();zf();let t=e.navigation.screen(),n=t?.key??`${e.navigation.state().active}:none`,l=t&&!t.overlay?t.context:null;return(0,X.useCallback)(a=>{if(!a)return;let u=e.scroll.get(n)??0,i=u>0,o=performance.now(),c=0,f=()=>{i&&(a.scrollTop=u,Math.abs(a.scrollTop-u)<2||performance.now()-o>AS?i=!1:c=requestAnimationFrame(f))},d=()=>{i=!1},g=()=>{i||e.scroll.set(n,a.scrollTop)},r=e.navigation.onScrollToTop(s=>{s===l&&(i=!1,a.scrollTo({top:0,behavior:\"smooth\"}))});return f(),a.addEventListener(\"scroll\",g,{passive:!0}),a.addEventListener(\"touchstart\",d,{passive:!0}),a.addEventListener(\"wheel\",d,{passive:!0}),()=>{cancelAnimationFrame(c),r(),a.removeEventListener(\"scroll\",g),a.removeEventListener(\"touchstart\",d),a.removeEventListener(\"wheel\",d)}},[e,n,l])}function Qe(e){return(0,li.jsx)(\"div\",{...e,ref:_S()})}function uc(e){let t=gn(),n=(0,X.useRef)(e);n.current=e,(0,X.useEffect)(()=>t.onResume(()=>n.current()),[t])}var c0=L(et(),1);var Re=\"https://x.com\";var kh=e=>typeof e==\"string\"&&/^[A-Za-z0-9_]{1,15}$/.test(e),wf=e=>typeof e==\"string\"&&/^[0-9]{1,25}$/.test(e),Et=e=>!!e&&typeof e==\"object\"&&!Array.isArray(e),Lt=e=>Number.isSafeInteger(e)&&e>=0,ic=e=>typeof e==\"string\"&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e);function MS(e,t){if(typeof e!=\"string\"||e.length>2048)return null;try{let n=new URL(e,t);return[\"https:\",\"http:\"].includes(n.protocol)&&!n.username&&!n.password?n.href:null}catch{return null}}function Cf(e){if(typeof e!=\"string\")return null;try{let t=new URL(e,Re),n=/^\\/([A-Za-z0-9_]{1,15})\\/status\\/([0-9]{1,25})$/.exec(t.pathname);return t.origin===Re&&!t.username&&!t.password&&n?{postId:n[2],handle:n[1],url:`${Re}/${n[1]}/status/${n[2]}`}:null}catch{return null}}function Rf(e){return Et(e)&&wf(e.postId)&&Lt(e.revision)&&e.revision>0&&Array.isArray(e.categoryIds)&&e.categoryIds.length<=10&&e.categoryIds.every(ic)}function Df(e){return!Et(e)||!kh(e.authorHandle)||typeof e.authorName!=\"string\"||e.authorName.length>800||typeof e.text!=\"string\"||e.text.length>16e3||!Lt(e.capturedAtMs)||![\"complete\",\"excerpt\",\"unavailable\"].includes(String(e.textState))||!Et(e.media)||![\"none\",\"photo\",\"video\",\"mixed\"].includes(String(e.media.kind))||!Lt(e.media.count)||e.media.count>16?!1:Array.isArray(e.links)&&e.links.length<=8&&e.links.every(t=>Et(t)&&typeof t.text==\"string\"&&!!MS(t.href))}function Yh(e){return Rf(e)&&Et(e)&&e.version===1&&Df(e.snapshot)&&Cf(e.url)?.postId===e.postId&&Lt(e.savedAtMs)&&Lt(e.updatedAtMs)}function Vh(e){return Et(e)&&e.version===1&&ic(e.id)&&typeof e.name==\"string\"&&e.name.length<=320&&typeof e.nameKey==\"string\"&&Lt(e.revision)&&e.revision>0&&Lt(e.count)&&Lt(e.createdAtMs)&&Lt(e.updatedAtMs)}var jh=e=>Et(e)&&e.version===1&&ic(e.libraryId)&&kh(e.expectedHandle)&&Lt(e.revision),Uf=e=>Et(e)&&ic(e.operationId)&&e.status===\"committed\"&&typeof e.kind==\"string\"&&Lt(e.libraryRevision)&&Lt(e.createdAtMs)&&Et(e.result);function ai(e){let t=e.normalize(\"NFKC\").trim().replace(/\\s+/gu,\" \");return t?[...t].length>80||new TextEncoder().encode(t).length>320?\"Use 80 characters or fewer.\":/[\\u0000-\\u001f\\u007f]/u.test(t)?\"Use a name without control characters.\":null:\"Enter a category name.\"}var xt=e=>`${Re}/${e}`,oc=(e,t)=>`${Re}/search?q=${encodeURIComponent(e)}&src=typed_query${t?`&f=${t}`:\"\"}`;var Xh=L(et(),1);var J=L(ae(),1),zS={home:\"M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z\",search:\"M21 21l-5.2-5.2M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0\",bell:\"M6 16V11a6 6 0 1 1 12 0v5l2 2H4zM10 21h4\",bookmark:\"M6 3h12v18l-6-4-6 4z\",person:\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0\",reply:\"M4 5h16v11H9l-5 4z\",repost:\"M7 4 3 8l4 4M3 8h13a4 4 0 0 1 4 4M17 20l4-4-4-4M21 16H8a4 4 0 0 1-4-4\",heart:\"M12 20s-8-4.9-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 9c0 6.1-8 11-8 11z\",views:\"M5 20V12M10 20V6M15 20v-9M20 20V4\",folder:\"M3 6a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z\",external:\"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6\",close:\"M6 6l12 12M18 6 6 18\",left:\"M15 5l-7 7 7 7\",right:\"M9 5l7 7-7 7\",check:\"M5 12.5 10 17 19 7\"};function ve({name:e,filled:t=!1}){return(0,J.jsx)(\"svg\",{viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",className:t?\"filled\":void 0,children:(0,J.jsx)(\"path\",{d:zS[e]})})}function Ot(){let{navigate:e}=ge();return(0,Xh.useCallback)(t=>{try{e({url:t})}catch(n){console.error(\"Genesis could not open\",t,n)}},[e])}function Qh({parts:e,className:t}){let n=Ot();return(0,J.jsx)(\"p\",{className:t??\"post-text\",dir:\"auto\",children:e.map((l,a)=>l.href?(0,J.jsx)(\"a\",{href:l.href,onClick:u=>{u.preventDefault(),u.stopPropagation(),n(l.href)},children:l.text},a):(0,J.jsx)(\"span\",{children:l.text},a))})}function gl({src:e,size:t=40}){return e?(0,J.jsx)(\"img\",{className:\"avatar\",src:e,alt:\"\",width:t,height:t,loading:\"lazy\",referrerPolicy:\"no-referrer\"}):(0,J.jsx)(\"span\",{className:\"avatar\",style:{width:t,height:t},\"aria-hidden\":\"true\"})}function Za(){return(0,J.jsxs)(\"svg\",{viewBox:\"0 0 24 24\",className:\"verified\",role:\"img\",\"aria-label\":\"Verified account\",children:[(0,J.jsx)(\"path\",{d:\"M12 2.5l2.4 1.8 3-.2.9 2.8 2.5 1.7-1 2.9 1 2.9-2.5 1.7-.9 2.8-3-.2L12 21.5l-2.4-1.8-3 .2-.9-2.8-2.5-1.7 1-2.9-1-2.9 2.5-1.7.9-2.8 3 .2z\"}),(0,J.jsx)(\"path\",{d:\"M8 12.2l2.6 2.6L16 9.4\",className:\"tick\"})]})}function Pe({label:e,rows:t=6,kind:n=\"posts\"}){return(0,J.jsx)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:`skeleton ${n}`,children:Array.from({length:t},(l,a)=>(0,J.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[n===\"posts\"&&(0,J.jsx)(\"span\",{className:\"skeleton-avatar\"}),(0,J.jsxs)(\"div\",{children:[(0,J.jsx)(\"span\",{}),(0,J.jsx)(\"span\",{}),(0,J.jsx)(\"span\",{})]})]},a))})}function Ze({title:e,children:t,role:n}){return(0,J.jsxs)(\"section\",{className:\"notice\",role:n,children:[(0,J.jsx)(\"h2\",{children:e}),t]})}function Hf({url:e,label:t=\"Open on X\"}){let{navigate:n,viewWebsite:l}=ge();return(0,J.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>e?n({url:e}):l(),children:[t,\" \",(0,J.jsx)(ve,{name:\"external\"})]})}function vn({error:e}){let t=e?.code===\"NOT_READY\"||e?.code===\"DEADLINE\"?\"X did not answer in time.\":e?.message||\"This page could not be read.\";return(0,J.jsxs)(Ze,{title:\"Couldn't load this page\",role:\"alert\",children:[(0,J.jsx)(\"p\",{children:t}),(0,J.jsx)(Hf,{})]})}function Ka({reason:e}){let{navigate:t}=ge();return(0,J.jsxs)(Ze,{title:\"Sign in to X\",children:[(0,J.jsx)(\"p\",{children:e}),(0,J.jsxs)(\"button\",{type:\"button\",className:\"primary\",onClick:()=>t({url:`${Re}/i/flow/login`}),children:[\"Sign in \",(0,J.jsx)(ve,{name:\"external\"})]})]})}function Ja({label:e,options:t,active:n}){return(0,J.jsx)(\"nav\",{className:\"mode-tabs\",\"aria-label\":e,children:t.map(l=>(0,J.jsx)(\"button\",{type:\"button\",className:\"mode-tab\",\"aria-current\":l.id===n?\"page\":void 0,onClick:()=>l.id!==n&&l.go(),children:l.label},l.id))})}var Zh=L(et(),1);var jl=L(ae(),1);function Kh(){let{navigate:e}=ge(),t=ct(),n=Nt(\"handle\",null),l=t.stale||t.pageId!==\"account\"?null:n?.data?.handle??t.account;(0,Zh.useEffect)(()=>{l&&e({url:xt(l),context:\"account\",mode:\"replace\"})},[l,e]);let a;return t.status===\"auth\"?a=(0,jl.jsx)(Ka,{reason:\"Sign in to see your profile and use Saved categories.\"}):t.status===\"error\"?a=(0,jl.jsx)(vn,{error:t.error}):a=(0,jl.jsx)(Pe,{label:\"Loading your profile\",rows:3,kind:\"text\"}),(0,jl.jsxs)(Qe,{className:\"screen\",children:[(0,jl.jsx)(\"h1\",{className:\"screen-title\",children:\"Profile\"}),a]})}var qt=L(et(),1);var Hn=L(et(),1);var xT=new TextEncoder;var Zt=class extends Error{constructor(n,l,a=!1){super(l);this.code=n;this.uncertain=a;this.name=\"LibraryError\"}code;uncertain},Ia={CONFLICT:\"This item changed. Refresh before saving again.\",CATEGORY_NAME_EXISTS:\"A category with this name already exists.\",CATEGORY_NOT_EMPTY:\"Move or remove its saved posts before deleting this category.\",CATEGORY_MISSING:\"A selected category no longer exists. Review your choices.\",CURSOR_STALE:\"The list changed while loading. Refresh to see it.\",LIMIT_REACHED:\"This would go over a library limit.\",ACCOUNT_MISMATCH:\"These categories belong to a different X account. Switch accounts on X to use them.\",SIGN_IN:\"Sign in to X to use your categories.\",UNCERTAIN:\"The last change may not have finished. Check it before making another.\"};function hn(e){let t=e?.code;return t&&Ia[t]?Ia[t]:e instanceof Zt?e.message:Ec(e)}function wS(){let e=Bh(\"bookmarks\");return(0,Hn.useMemo)(()=>{async function t(l,a){let u=await e(l,a===void 0?{}:{method:\"POST\",body:a});if(u.status>=200&&u.status<300)return u.body?.result;let i=u.body?.error;throw new Zt(i?.code??\"SERVICE_FAILURE\",i?.message??\"The bookmarks service refused the request.\",u.status>=500)}let n=(l,a)=>{if(!a(l))throw new Zt(\"SERVICE_FAILURE\",\"The bookmarks service sent an invalid answer.\");return l};return{library:async()=>n(await t(\"/v1/library\"),jh),categories:async()=>{let l=await t(\"/v1/categories\");return n(Et(l)?l.categories:void 0,a=>Array.isArray(a)&&a.every(Vh))},lookup:async l=>{let a=await t(\"/v1/bookmarks/lookup\",{postIds:[l]});return n(Et(a)?a.records:void 0,i=>Array.isArray(i)&&i.every(Rf)).find(i=>i.postId===l)??null},query:async(l,a,u)=>n(await t(\"/v1/bookmarks/query\",{categoryId:l,query:a,cursor:u,limit:20}),i=>Et(i)&&Array.isArray(i.entries)&&i.entries.every(Yh)),operate:async(l,a,u)=>n(await t(\"/v1/operations\",{operationId:l,kind:a,payload:u}),Uf),receipt:async l=>n(await t(`/v1/operations/${l}`),Uf)}},[e])}function CS(){let e=ct(\"account\");return{account:e.account?{handle:e.account,name:null}:null,signedOut:e.status===\"auth\"}}function $a(){let e=wS(),{account:t,signedOut:n}=CS(),l=ac(\"operations\"),[a,u]=(0,Hn.useState)({library:null,categories:[],loading:!0,error:null}),[i,o]=(0,Hn.useState)(0),c=(0,Hn.useCallback)(()=>o(y=>y+1),[]);uc(c),(0,Hn.useEffect)(()=>{let y=!0;return u(S=>({...S,loading:!0})),Promise.all([e.library(),e.categories()]).then(([S,x])=>{y&&u({library:S,categories:x,loading:!1,error:null})},S=>{y&&u(x=>({...x,loading:!1,error:S}))}),()=>{y=!1}},[e,i]);let f=a.library,d=f?l.records.find(y=>y.key===`pending:${f.libraryId}`)?.value??null:null,g=a.error;return!g&&f&&!t&&(g=new Zt(n?\"SIGN_IN\":\"ACCOUNT_UNKNOWN\",n?Ia.SIGN_IN:\"Checking your X account\\u2026\")),!g&&f&&t&&t.handle.toLowerCase()!==f.expectedHandle.toLowerCase()&&(g=new Zt(\"ACCOUNT_MISMATCH\",Ia.ACCOUNT_MISMATCH)),{...a,error:g,pending:d,reload:c,service:e,operate:async(y,S,x)=>{if(!f||g)throw g??new Zt(\"SERVICE_FAILURE\",\"The library isn't loaded.\");if(d)throw new Zt(\"UNCERTAIN\",Ia.UNCERTAIN);let p=`pending:${f.libraryId}`,m=crypto.randomUUID();await l.put(p,{operationId:m,kind:y,libraryId:f.libraryId,createdAtMs:Date.now(),recordId:x});try{let h=await e.operate(m,y,S);return await l.remove(p),h}catch(h){let b=!(h instanceof Zt)||h.uncertain;throw b||await l.remove(p),b?new Zt(\"UNCERTAIN\",Ia.UNCERTAIN,!0):h}finally{c()}},check:async()=>{if(!(!f||!d)){try{await e.receipt(d.operationId)}catch(y){if(y.code!==\"OPERATION_NOT_FOUND\")throw y}await l.remove(`pending:${f.libraryId}`),c()}},loading:a.loading||l.loading}}function Jh(e){let t=e.parts.map(a=>a.text).join(\"\"),n=e.photos.length&&e.videos?\"mixed\":e.videos?\"video\":e.photos.length?\"photo\":\"none\",l=e.parts.filter(a=>a.href).map(a=>({text:a.text.slice(0,300),href:a.href})).slice(0,8);return{authorHandle:e.handle.toLowerCase(),authorName:e.name,text:t,textState:e.textState,capturedAtMs:Date.now(),media:{kind:n,count:Math.min(16,e.photos.length+e.videos)},links:l}}var Fh=L(et(),1);var cc=L(et(),1);var _=L(ae(),1);function Ih(e,t,n,l,a){let u=lc(e,t),i=nc(n,e),[o,c]=(0,cc.useState)(!1),f=[...u].reverse().find(r=>r.name===n),d=f?f.args[l]:a;return{shown:d,busy:f!==void 0,failed:o,toggle:()=>{c(!1),i(t,{[l]:!d}).then(r=>c(r.outcome===\"failed\"))}}}function RS(){let{navigate:e}=ge();return t=>e({screen:\"save\",params:{post:JSON.stringify({postId:t.postId,url:t.url,snapshot:Jh(t)})}})}var Fa=(0,cc.memo)(function({post:t,region:n,actionable:l,focus:a=!1}){let u=Ot(),{viewWebsite:i}=ge(),o=RS(),c=()=>{a||u(t.url)},f=()=>{a||u(t.url),i()};return(0,_.jsxs)(\"article\",{className:a?\"post focus\":\"post\",\"aria-label\":`Post by ${t.name}`,children:[t.context&&(0,_.jsxs)(\"p\",{className:\"post-context\",children:[(0,_.jsx)(ve,{name:/pinned/i.test(t.context.text)?\"bookmark\":\"repost\"}),t.context.url?(0,_.jsx)(\"a\",{href:t.context.url,onClick:d=>{d.preventDefault(),u(t.context.url)},children:t.context.text}):t.context.text]}),(0,_.jsxs)(\"div\",{className:\"post-grid\",children:[(0,_.jsx)(\"button\",{type:\"button\",className:\"avatar-button\",\"aria-label\":`Profile of ${t.name}`,onClick:()=>u(xt(t.handle)),children:(0,_.jsx)(gl,{src:t.avatar,size:a?48:40})}),(0,_.jsxs)(\"div\",{className:\"post-body\",children:[(0,_.jsxs)(\"header\",{className:\"post-head\",children:[(0,_.jsxs)(\"a\",{className:\"post-name\",href:xt(t.handle),onClick:d=>{d.preventDefault(),u(xt(t.handle))},children:[(0,_.jsx)(\"strong\",{children:t.name}),t.verified&&(0,_.jsx)(Za,{})]}),(0,_.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",t.handle,!a&&t.time&&(0,_.jsxs)(_.Fragment,{children:[\" \\xB7 \",(0,_.jsx)(\"time\",{dateTime:t.dateTime??void 0,children:t.time})]})]})]}),(0,_.jsxs)(\"div\",{className:\"post-content\",onClick:c,children:[t.parts.length>0&&(0,_.jsx)(Qh,{parts:t.parts,className:a?\"post-text large\":\"post-text\"}),t.textState===\"excerpt\"&&!a&&(0,_.jsx)(\"span\",{className:\"show-more\",children:\"Show more\"}),t.textState===\"unavailable\"&&t.photos.length===0&&t.videos===0&&!t.quote&&(0,_.jsx)(\"p\",{className:\"post-meta\",children:\"X didn't show this post's text.\"})]}),t.photos.length>0&&(0,_.jsx)(\"div\",{className:`photos n${t.photos.length}`,children:t.photos.map((d,g)=>(0,_.jsx)(\"button\",{type:\"button\",\"aria-label\":`Photo ${g+1} of ${t.photos.length}`,onClick:()=>u(`${t.url}/photo/${g+1}`),children:(0,_.jsx)(\"img\",{src:d,alt:\"\",loading:\"lazy\",referrerPolicy:\"no-referrer\"})},d))}),t.videos>0&&(0,_.jsxs)(\"button\",{type:\"button\",className:\"video-tile\",onClick:f,children:[(0,_.jsx)(\"span\",{children:\"Video\"}),(0,_.jsxs)(\"span\",{className:\"post-meta\",children:[\"Play on X \",(0,_.jsx)(ve,{name:\"external\"})]})]}),t.quote&&(0,_.jsxs)(\"button\",{type:\"button\",className:\"quote\",disabled:!t.quote.url,onClick:()=>t.quote?.url&&u(t.quote.url),children:[(0,_.jsxs)(\"span\",{className:\"post-head\",children:[(0,_.jsx)(\"strong\",{children:t.quote.name}),t.quote.handle&&(0,_.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",t.quote.handle]})]}),t.quote.text&&(0,_.jsx)(\"span\",{className:\"quote-text\",children:t.quote.text})]}),a&&t.time&&(0,_.jsxs)(\"p\",{className:\"post-meta focus-time\",children:[(0,_.jsx)(\"time\",{dateTime:t.dateTime??void 0,children:t.time}),t.views&&(0,_.jsxs)(_.Fragment,{children:[\" \\xB7 \",(0,_.jsx)(\"strong\",{children:t.views}),\" views\"]})]}),(0,_.jsx)(DS,{post:t,region:n,actionable:l,save:()=>o(t)})]})]})]})});function DS({post:e,region:t,actionable:n,save:l}){let a=Ot(),u=Ih(t,e.postId,\"setLiked\",\"liked\",e.liked),i=Ih(t,e.postId,\"setBookmarked\",\"bookmarked\",e.bookmarked);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(\"div\",{className:\"actions-bar\",children:[(0,_.jsxs)(\"button\",{type:\"button\",className:\"action\",\"aria-label\":`Reply${e.replies?`, ${e.replies} replies`:\"\"}`,onClick:()=>a(`${Re}/compose/post?in_reply_to=${e.postId}`),children:[(0,_.jsx)(ve,{name:\"reply\"}),(0,_.jsx)(\"span\",{children:e.replies})]}),(0,_.jsxs)(\"span\",{className:e.reposted?\"action reposted\":\"action\",\"aria-label\":`${e.reposts||\"No\"} reposts`,role:\"img\",children:[(0,_.jsx)(ve,{name:\"repost\"}),(0,_.jsx)(\"span\",{children:e.reposts})]}),(0,_.jsxs)(\"button\",{type:\"button\",className:u.shown?\"action liked\":\"action\",\"aria-pressed\":u.shown,disabled:!n||!e.canLike||u.busy,\"aria-label\":`${u.shown?\"Unlike\":\"Like\"}${e.likes?`, ${e.likes} likes`:\"\"}`,onClick:u.toggle,children:[(0,_.jsx)(ve,{name:\"heart\",filled:u.shown}),(0,_.jsx)(\"span\",{children:e.likes})]}),(0,_.jsxs)(\"button\",{type:\"button\",className:\"action\",\"aria-label\":`${e.views||\"No\"} views`,disabled:!e.views,onClick:()=>a(`${e.url}/analytics`),children:[(0,_.jsx)(ve,{name:\"views\"}),(0,_.jsx)(\"span\",{children:e.views})]}),(0,_.jsx)(\"button\",{type:\"button\",className:i.shown?\"action bookmarked\":\"action\",\"aria-pressed\":i.shown,disabled:!n||!e.canBookmark||i.busy,\"aria-label\":i.shown?\"Remove bookmark\":\"Bookmark\",onClick:i.toggle,children:(0,_.jsx)(ve,{name:\"bookmark\",filled:i.shown})}),(0,_.jsx)(\"button\",{type:\"button\",className:\"action\",\"aria-label\":\"Save to categories\",onClick:l,children:(0,_.jsx)(ve,{name:\"folder\"})})]}),(u.failed||i.failed)&&(0,_.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"That didn't go through on X. Try again.\"})]})}var I=L(ae(),1);function Lf({active:e}){let{navigate:t}=ge();return(0,I.jsx)(Ja,{label:\"Saved\",options:[{id:\"bookmarks\",label:\"Bookmarks\",go:()=>t({url:`${Re}/i/history`,context:\"primary\",mode:e===\"categories\"?\"push\":\"replace\"})},{id:\"likes\",label:\"Likes\",go:()=>t({url:`${Re}/i/history/likes`,context:\"primary\",mode:e===\"categories\"?\"push\":\"replace\"})},{id:\"categories\",label:\"Categories\",go:()=>t({screen:\"categories\",mode:\"root\"})}],active:e})}var $h={home:\"Home\",notifications:\"Notifications\",saved:\"Saved\"},US={home:\"Sign in to see your timeline.\",notifications:\"Sign in to see your notifications.\",saved:\"Sign in to see your bookmarks and likes.\"};function HS(e,t){if(e===\"/home\")return{kind:\"home\",likes:!1,handle:null};if(e===\"/notifications\")return{kind:\"notifications\",likes:!1,handle:null};if(e===\"/i/history/likes\")return{kind:\"saved\",likes:!0,handle:null};let n=/^\\/([A-Za-z0-9_]{1,15})\\/likes$/.exec(e)?.[1]??null;return n?n.toLowerCase()===t?.toLowerCase()?{kind:\"saved\",likes:!0,handle:null}:{kind:\"likes\",likes:!0,handle:n}:{kind:\"saved\",likes:!1,handle:null}}function rc(){let e=ct(),t=pn(\"timeline\"),n=Nt(\"empty\",null),l=e.url?new URL(e.url).pathname:\"/home\",{kind:a,likes:u,handle:i}=HS(l,e.account),o=e.pageId===\"timeline\"?t.order:[],c=e.account!==null&&!e.stale&&!t.ephemeral,f=e.pageId===\"timeline\"&&t.status===\"error\",d;return e.status===\"auth\"?d=(0,I.jsx)(Ka,{reason:US[a]??\"Sign in to see this page.\"}):o.length===0?f?d=(0,I.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}):e.status===\"ready\"&&e.pageId===\"timeline\"?d=(0,I.jsx)(Ze,{title:n?.data??\"Nothing here yet\",children:(0,I.jsx)(\"p\",{children:a===\"notifications\"?\"New activity shows up here.\":a===\"saved\"?\"Posts you bookmark or like on X appear here.\":\"X has nothing to show here right now.\"})}):d=e.status===\"error\"?(0,I.jsx)(vn,{error:e.error}):(0,I.jsx)(Pe,{label:`Loading ${$h[a]??\"posts\"}`}):d=(0,I.jsxs)(I.Fragment,{children:[e.status===\"error\"&&(0,I.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),f&&(0,I.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}),(0,I.jsx)(qf,{region:\"timeline\",items:t,actionable:c}),(0,I.jsx)(ui,{stale:e.stale})]}),(0,I.jsxs)(Qe,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,I.jsx)(\"h1\",{className:\"screen-title\",children:a===\"likes\"?`@${i}\\u2019s likes`:$h[a]??\"Posts\"}),a===\"saved\"&&(0,I.jsx)(Lf,{active:u?\"likes\":\"bookmarks\"}),d]})}function qf({region:e,items:t,actionable:n}){return(0,I.jsx)(\"div\",{className:\"feed\",children:t.order.map(l=>{let a=t.get(l)?.data;return a?a.kind===\"post\"?(0,I.jsx)(Fa,{post:a.post,region:e,actionable:n},l):(0,I.jsx)(LS,{notice:a.notice},l):null})})}function ui({stale:e}){let t=nc(\"loadMore\"),n=lc(null,null).some(i=>i.name===\"loadMore\"),[l,a]=(0,Fh.useState)(!1);return(0,I.jsxs)(\"div\",{className:\"more\",children:[l&&(0,I.jsx)(\"p\",{className:\"post-meta\",role:\"status\",children:\"No more posts right now.\"}),(0,I.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:n||e,onClick:()=>{t(null).then(i=>a(i.outcome!==\"observed\"))},children:n?\"Loading\\u2026\":\"Show more\"})]})}function LS({notice:e}){let t=Ot(),n=(0,I.jsxs)(I.Fragment,{children:[e.avatars.length>0&&(0,I.jsx)(\"span\",{className:\"notice-avatars\",children:e.avatars.map(l=>(0,I.jsx)(gl,{src:l,size:32},l))}),(0,I.jsx)(\"span\",{className:\"notice-text\",children:e.text})]});return e.url?(0,I.jsx)(\"button\",{type:\"button\",className:\"notification\",onClick:()=>t(e.url),children:n}):(0,I.jsx)(\"div\",{className:\"notification\",children:n})}var R=L(ae(),1);function ii({library:e,children:t}){let[n,l]=(0,qt.useState)(!1),[a,u]=(0,qt.useState)(\"\"),i=e.error?.code;return i===\"SIGN_IN\"?(0,R.jsx)(Ka,{reason:\"Categories belong to your X account. Sign in to use them.\"}):i===\"ACCOUNT_UNKNOWN\"||e.loading&&!e.library?(0,R.jsx)(Pe,{label:\"Loading categories\",rows:4,kind:\"text\"}):e.error?(0,R.jsxs)(Ze,{title:i===\"ACCOUNT_MISMATCH\"?\"Different account\":\"Categories are unavailable\",role:\"alert\",children:[(0,R.jsx)(\"p\",{children:hn(e.error)}),i!==\"ACCOUNT_MISMATCH\"&&(0,R.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:e.reload,children:\"Try again\"})]}):e.pending?(0,R.jsxs)(Ze,{title:\"Check the last change\",role:\"alert\",children:[(0,R.jsx)(\"p\",{children:\"The last change to your categories may not have finished. Check it before making another.\"}),a&&(0,R.jsx)(\"p\",{className:\"inline-error\",children:a}),(0,R.jsx)(\"button\",{type:\"button\",className:\"primary\",disabled:n,onClick:()=>{l(!0),u(\"\"),e.check().catch(o=>u(hn(o))).finally(()=>l(!1))},children:n?\"Checking\\u2026\":\"Check last change\"})]}):(0,R.jsx)(R.Fragment,{children:t})}function Wh(){let{navigate:e}=ge(),t=$a(),[n,l]=(0,qt.useState)(null),[a,u]=(0,qt.useState)(\"\"),[i,o]=(0,qt.useState)(\"\"),[c,f]=(0,qt.useState)({entries:[],cursor:null,loading:!0,error:null}),d=t.library?.revision,{service:g}=t,r=ac(\"preferences\"),s=t.library?`library:${t.library.libraryId}`:null,y=s?(r.records.find(N=>N.key===s)??r.records.find(N=>N.key===\"library\"))?.value??null:null,[S,x]=(0,qt.useState)(null);(0,qt.useEffect)(()=>{!s||r.loading||S===s||(x(s),typeof y?.query==\"string\"&&(o(y.query),u(y.query)),y?.categoryId&&t.categories.some(N=>N.id===y.categoryId)&&l(y.categoryId))},[s,r.loading,S,y,t.categories]),(0,qt.useEffect)(()=>{let N=y?y.query===i&&y.categoryId===n:!i&&n===null;!s||S!==s||N||r.put(s,{query:i,categoryId:n,scroll:y?.scroll??0}).catch(()=>{})},[s,S,i,n]);let p=!!t.library&&!t.error&&!t.pending&&S===s;(0,qt.useEffect)(()=>{if(!p)return;let N=!0;return f(M=>({...M,loading:!0,error:null})),g.query(n,i,null).then(M=>{N&&f({entries:M.entries,cursor:M.nextCursor,loading:!1,error:null})},M=>{N&&f(A=>({...A,loading:!1,error:M}))}),()=>{N=!1}},[p,g,n,i,d]);let m=()=>{!c.cursor||c.loading||(f(N=>({...N,loading:!0})),g.query(n,i,c.cursor).then(N=>{f(M=>({entries:[...M.entries,...N.entries],cursor:N.nextCursor,loading:!1,error:null}))},N=>f(M=>({...M,loading:!1,error:N}))))},h=new Map(t.categories.map(N=>[N.id,N.name])),b=t.categories.reduce((N,M)=>N+M.count,0);return(0,R.jsxs)(Qe,{className:\"screen\",children:[(0,R.jsx)(\"h1\",{className:\"screen-title\",children:\"Saved\"}),(0,R.jsx)(Lf,{active:\"categories\"}),(0,R.jsxs)(ii,{library:t,children:[(0,R.jsxs)(\"div\",{className:\"chips\",role:\"group\",\"aria-label\":\"Filter by category\",children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":n===null,onClick:()=>l(null),children:\"All\"}),t.categories.map(N=>(0,R.jsxs)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":n===N.id,onClick:()=>l(N.id),children:[N.name,\" \",(0,R.jsx)(\"span\",{className:\"chip-count\",children:N.count})]},N.id))]}),(0,R.jsx)(\"form\",{className:\"search-form\",role:\"search\",onSubmit:N=>{N.preventDefault(),o(a.trim())},children:(0,R.jsxs)(\"label\",{className:\"search-field\",children:[(0,R.jsx)(ve,{name:\"search\"}),(0,R.jsx)(\"span\",{className:\"visually-hidden\",children:\"Search saved posts\"}),(0,R.jsx)(\"input\",{type:\"search\",placeholder:\"Search saved posts\",value:a,enterKeyHint:\"search\",onChange:N=>{u(N.target.value),N.target.value||o(\"\")}})]})}),(0,R.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>e({screen:\"manage\"}),children:[(0,R.jsx)(ve,{name:\"folder\"}),\" Manage categories\"]}),c.error!=null&&(0,R.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:hn(c.error)}),c.entries.length===0&&!c.loading&&!c.error&&(0,R.jsx)(Ze,{title:i?\"No matches\":t.categories.length?\"Nothing filed here\":\"No categories yet\",children:(0,R.jsx)(\"p\",{children:i?\"Try other words.\":t.categories.length?b?\"No saved posts in this category.\":\"Tap the folder on any post to file it.\":\"Create a category, then tap the folder on any post to file it.\"})}),(0,R.jsx)(\"div\",{className:\"feed\",children:c.entries.map(N=>(0,R.jsx)(qS,{entry:N,names:h},N.postId))}),c.loading&&(0,R.jsx)(Pe,{label:\"Loading saved posts\",rows:c.entries.length?1:4}),c.cursor&&!c.loading&&(0,R.jsx)(\"button\",{type:\"button\",className:\"secondary more\",onClick:m,children:\"Load more\"})]})]})}function qS({entry:e,names:t}){let n=Ot(),{navigate:l}=ge(),{snapshot:a}=e;return(0,R.jsx)(\"article\",{className:\"post saved-post\",children:(0,R.jsxs)(\"div\",{className:\"post-body\",children:[(0,R.jsxs)(\"header\",{className:\"post-head\",children:[(0,R.jsx)(\"a\",{className:\"post-name\",href:xt(a.authorHandle),onClick:u=>{u.preventDefault(),n(xt(a.authorHandle))},children:(0,R.jsx)(\"strong\",{children:a.authorName})}),(0,R.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",a.authorHandle]})]}),(0,R.jsx)(\"button\",{type:\"button\",className:\"post-content plain\",onClick:()=>n(e.url),children:(0,R.jsx)(\"span\",{className:\"post-text\",dir:\"auto\",children:a.text||(a.media.count?`${a.media.count} ${a.media.kind===\"video\"?\"video\":\"media\"}`:\"Post\")})}),(0,R.jsxs)(\"div\",{className:\"pills\",children:[e.categoryIds.map(u=>t.has(u)&&(0,R.jsx)(\"span\",{className:\"pill\",children:t.get(u)},u)),(0,R.jsx)(\"button\",{type:\"button\",className:\"text-button\",onClick:()=>l({screen:\"save\",params:{post:JSON.stringify({postId:e.postId,url:e.url,snapshot:a})}}),children:\"Edit\"})]})]})})}var Ph=L(et(),1);var B=L(ae(),1),GS=[{id:\"\",label:\"Top\"},{id:\"live\",label:\"Latest\"},{id:\"user\",label:\"People\"},{id:\"media\",label:\"Media\"}];function e0(){let{navigate:e}=ge(),t=ct(),n=pn(\"trends\"),l=pn(\"people\"),a=pn(\"results\"),u=Nt(\"empty\",null),i=Ot(),o=new URL(t.url??\"https://x.com/explore\"),c=o.pathname,f=c===\"/search\"?t.params.q??\"\":c.startsWith(\"/hashtag/\")?`#${t.params.tag}`:\"\",d=o.searchParams.get(\"f\")??\"\",[g,r]=(0,Ph.useState)(f),s=t.pageId===\"explore\",y={trends:s?n.order:[],people:s?l.order:[],results:s?a.order:[]},S=t.account!==null&&!t.stale&&!a.ephemeral,x=s&&[n,l,a].some(h=>h.status===\"error\"),p=x&&(0,B.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some results couldn't be read.\"}),m;return!y.trends.length&&!y.people.length&&!y.results.length?m=x?p:s&&t.status===\"ready\"?(0,B.jsx)(Ze,{title:u?.data??\"No results\",children:(0,B.jsx)(\"p\",{children:\"Try a different search.\"})}):t.status===\"error\"?(0,B.jsx)(vn,{error:t.error}):(0,B.jsx)(Pe,{label:f?\"Searching\":\"Loading trends\"}):m=(0,B.jsxs)(B.Fragment,{children:[t.status===\"error\"&&(0,B.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),p,y.trends.length>0&&(0,B.jsxs)(\"section\",{\"aria-label\":\"Trends\",children:[!f&&(0,B.jsx)(\"h2\",{className:\"section-title\",children:\"Trends for you\"}),y.trends.map(h=>{let b=n.get(h)?.data;return b&&(0,B.jsxs)(\"button\",{type:\"button\",className:\"trend\",onClick:()=>i(oc(b.name)),children:[b.context&&(0,B.jsx)(\"span\",{className:\"post-meta\",children:b.context}),(0,B.jsx)(\"strong\",{children:b.name}),b.meta&&(0,B.jsx)(\"span\",{className:\"post-meta\",children:b.meta})]},h)})]}),y.people.length>0&&(0,B.jsxs)(\"section\",{\"aria-label\":\"People\",children:[d!==\"user\"&&(0,B.jsx)(\"h2\",{className:\"section-title\",children:\"People\"}),y.people.map(h=>{let b=l.get(h)?.data;return b&&(0,B.jsx)(BS,{person:b},h)})]}),y.results.length>0&&(0,B.jsx)(\"div\",{className:\"feed\",children:y.results.map(h=>{let b=a.get(h)?.data;return b&&(0,B.jsx)(Fa,{post:b,region:\"results\",actionable:S},h)})}),f&&(0,B.jsx)(ui,{stale:t.stale})]}),(0,B.jsxs)(Qe,{className:\"screen\",\"aria-busy\":t.stale||t.status===\"loading\",children:[(0,B.jsx)(\"form\",{role:\"search\",className:\"search-form\",onSubmit:h=>{h.preventDefault();let b=g.trim();b&&e({url:oc(b,d||void 0),mode:f?\"replace\":\"push\"})},children:(0,B.jsxs)(\"label\",{className:\"search-field\",children:[(0,B.jsx)(ve,{name:\"search\"}),(0,B.jsx)(\"span\",{className:\"visually-hidden\",children:\"Search X\"}),(0,B.jsx)(\"input\",{type:\"search\",enterKeyHint:\"search\",placeholder:\"Search\",value:g,onChange:h=>r(h.target.value)})]})}),f&&(0,B.jsx)(Ja,{label:\"Result type\",active:d,options:GS.map(h=>({...h,go:()=>e({url:oc(f,h.id||void 0),mode:\"replace\"})}))}),m]})}function BS({person:e}){let t=Ot();return(0,B.jsxs)(\"button\",{type:\"button\",className:\"person\",onClick:()=>t(xt(e.handle)),children:[(0,B.jsx)(gl,{src:e.avatar}),(0,B.jsxs)(\"span\",{className:\"person-body\",children:[(0,B.jsxs)(\"span\",{className:\"post-head\",children:[(0,B.jsx)(\"strong\",{children:e.name}),e.verified&&(0,B.jsx)(Za,{})]}),(0,B.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",e.handle]}),e.description&&(0,B.jsx)(\"span\",{className:\"person-bio\",children:e.description})]})]})}var Xl=L(et(),1);var Q=L(ae(),1);function t0(){let e=$a(),[t,n]=(0,Xl.useState)(\"\"),[l,a]=(0,Xl.useState)(!1),[u,i]=(0,Xl.useState)(\"\"),o=async(d,g,r)=>{a(!0),i(\"\");try{return await e.operate(d,g,r),!0}catch(s){return i(hn(s)),!1}finally{a(!1)}},c=async()=>{let d=ai(t);if(d){i(d);return}let g=crypto.randomUUID();await o(\"category.create\",{id:g,name:t},g)&&n(\"\")},f=e.categories.length;return(0,Q.jsxs)(Qe,{className:\"screen\",children:[(0,Q.jsx)(\"h1\",{className:\"screen-title\",children:\"Manage categories\"}),(0,Q.jsxs)(ii,{library:e,children:[(0,Q.jsxs)(\"p\",{className:\"post-meta\",children:[f,\" of \",50,\" categories\"]}),f<50&&(0,Q.jsxs)(\"form\",{className:\"row\",onSubmit:d=>{d.preventDefault(),c()},children:[(0,Q.jsxs)(\"label\",{className:\"grow\",children:[(0,Q.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,Q.jsx)(\"input\",{placeholder:\"New category\",value:t,maxLength:80,enterKeyHint:\"done\",disabled:l,onChange:d=>n(d.target.value)})]}),(0,Q.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:l||!t.trim(),children:\"Create\"})]}),u&&(0,Q.jsx)(\"p\",{role:\"status\",className:\"status\",children:u}),(0,Q.jsx)(\"div\",{className:\"category-list\",children:e.categories.map(d=>(0,Q.jsx)(kS,{category:d,busy:l,run:o},d.id))})]})]})}function kS({category:e,busy:t,run:n}){let[l,a]=(0,Xl.useState)(\"view\"),[u,i]=(0,Xl.useState)(e.name),[o,c]=(0,Xl.useState)(\"\");return l===\"rename\"?(0,Q.jsxs)(\"form\",{className:\"category\",onSubmit:async f=>{f.preventDefault();let d=ai(u);if(d){c(d);return}await n(\"category.rename\",{id:e.id,expectedRevision:e.revision,name:u},e.id)&&a(\"view\")},children:[(0,Q.jsxs)(\"label\",{children:[(0,Q.jsxs)(\"span\",{className:\"visually-hidden\",children:[\"Name for \",e.name]}),(0,Q.jsx)(\"input\",{value:u,maxLength:80,autoFocus:!0,enterKeyHint:\"done\",onChange:f=>{i(f.target.value),c(\"\")}})]}),o&&(0,Q.jsx)(\"p\",{className:\"field-error\",children:o}),(0,Q.jsxs)(\"div\",{className:\"actions\",children:[(0,Q.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:t||!u.trim(),children:\"Save\"}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t,onClick:()=>{i(e.name),a(\"view\")},children:\"Cancel\"})]})]}):(0,Q.jsxs)(\"div\",{className:\"category\",children:[(0,Q.jsxs)(\"div\",{className:\"category-head\",children:[(0,Q.jsxs)(\"span\",{className:\"grow\",children:[(0,Q.jsx)(\"strong\",{children:e.name}),\" \",(0,Q.jsxs)(\"span\",{className:\"post-meta\",children:[e.count,\" \",e.count===1?\"post\":\"posts\"]})]}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"text-button\",disabled:t,onClick:()=>a(\"rename\"),children:\"Rename\"}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:t,onClick:()=>a(\"delete\"),children:\"Delete\"})]}),l===\"delete\"&&(0,Q.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":`Confirm deleting ${e.name}`,children:[(0,Q.jsx)(\"p\",{children:e.count?`Delete \\u201C${e.name}\\u201D? Move or remove its ${e.count} saved posts first.`:`Delete \\u201C${e.name}\\u201D?`}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:t,onClick:async()=>{await n(\"category.delete\",{id:e.id,expectedRevision:e.revision},e.id)&&a(\"view\")},children:\"Delete\"}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t,onClick:()=>a(\"view\"),children:\"Keep\"})]})]})}var De=L(ae(),1);function n0(){let{navigate:e,back:t,viewWebsite:n}=ge(),l=ct(),a=Nt(\"photos\",null),{handle:u,id:i,index:o}=l.params,c=Number(o)||1,f=g=>e({url:`${Re}/${u}/status/${i}/photo/${g}`,mode:\"replace\"}),d=l.stale||l.pageId!==\"media\"?null:a?.data??null;return(0,De.jsxs)(\"div\",{className:\"media-viewer\",children:[(0,De.jsx)(\"button\",{type:\"button\",className:\"media-close\",\"aria-label\":\"Close\",onClick:t,children:(0,De.jsx)(ve,{name:\"close\"})}),(0,De.jsx)(\"div\",{className:\"media-stage\",children:d?.image?(0,De.jsx)(\"img\",{src:d.image,alt:`Photo ${c}`,referrerPolicy:\"no-referrer\"}):l.status===\"error\"?(0,De.jsxs)(\"div\",{className:\"media-message\",children:[(0,De.jsx)(\"p\",{children:\"This photo couldn't be shown.\"}),(0,De.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>n(),children:[\"Open on X \",(0,De.jsx)(ve,{name:\"external\"})]})]}):(0,De.jsx)(\"p\",{className:\"media-message\",role:\"status\",children:\"Loading photo\\u2026\"})}),(0,De.jsxs)(\"div\",{className:\"media-nav\",children:[(0,De.jsx)(\"button\",{type:\"button\",className:\"icon-button\",\"aria-label\":\"Previous photo\",disabled:c<=1,onClick:()=>f(c-1),children:(0,De.jsx)(ve,{name:\"left\"})}),(0,De.jsx)(\"span\",{children:c}),(0,De.jsx)(\"button\",{type:\"button\",className:\"icon-button\",\"aria-label\":\"Next photo\",disabled:!d?.hasNext,onClick:()=>f(c+1),children:(0,De.jsx)(ve,{name:\"right\"})})]})]})}var Ue=L(ae(),1);function l0(){let e=ct(),t=pn(\"thread\"),n=Nt(\"empty\",null),a=(e.pageId===\"post\"?t.order:[]).flatMap(d=>{let g=t.get(d)?.data;return g?.kind===\"post\"?[{key:d,post:g.post}]:[]}),u=a.findIndex(({post:d})=>d.postId===e.params.id),i=e.account!==null&&!e.stale&&!t.ephemeral,o=({key:d,post:g},r=!1)=>(0,Ue.jsx)(Fa,{post:g,region:\"thread\",actionable:i,focus:r},d),c=e.pageId===\"post\"&&t.status===\"error\",f;if(u<0)f=e.status===\"error\"?(0,Ue.jsx)(vn,{error:e.error}):c?(0,Ue.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"This post couldn't be read.\"}):e.status===\"ready\"&&e.pageId===\"post\"?(0,Ue.jsx)(Ze,{title:n?.data??\"This post isn't available\",children:(0,Ue.jsx)(\"p\",{children:\"X has nothing to show for it.\"})}):(0,Ue.jsx)(Pe,{label:\"Loading post\",rows:3});else{let d=a.slice(u+1);f=(0,Ue.jsxs)(Ue.Fragment,{children:[e.status===\"error\"&&(0,Ue.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),c&&(0,Ue.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some replies couldn't be read.\"}),(0,Ue.jsxs)(\"div\",{className:\"feed thread\",children:[a.slice(0,u).map(g=>o(g)),o(a[u],!0)]}),d.length>0&&(0,Ue.jsx)(\"h2\",{className:\"section-title\",children:\"Replies\"}),(0,Ue.jsx)(\"div\",{className:\"feed\",children:d.map(g=>o(g))})]})}return(0,Ue.jsxs)(Qe,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,Ue.jsx)(\"h1\",{className:\"screen-title\",children:\"Post\"}),f]})}var j=L(ae(),1),a0=[{id:\"\",label:\"Posts\"},{id:\"/with_replies\",label:\"Replies\"},{id:\"/media\",label:\"Media\"}];function u0(){let{navigate:e}=ge(),t=ct(),n=Nt(\"header\",null),l=pn(\"posts\"),a=Nt(\"empty\",null),u=t.params.handle??\"\",i=t.url?new URL(t.url).pathname:\"\",o=a0.find(y=>y.id&&i.endsWith(y.id))?.id??\"\",c=t.pageId===\"profile\",f=c?n?.data??null:null,d=c?l.order:[],g=t.account!==null&&!t.stale&&!l.ephemeral,r=c&&l.status===\"error\",s;return!f&&d.length===0?s=t.status===\"error\"?(0,j.jsx)(vn,{error:t.error}):r?(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}):(0,j.jsx)(Pe,{label:\"Loading profile\"}):s=(0,j.jsxs)(j.Fragment,{children:[t.status===\"error\"&&(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),f?(0,j.jsx)(YS,{profile:f}):(0,j.jsxs)(\"h1\",{className:\"screen-title\",children:[\"@\",u]}),(0,j.jsx)(Ja,{label:\"Profile sections\",active:o,options:a0.map(y=>({...y,go:()=>e({url:`${xt(u)}${y.id}`,mode:\"replace\"})}))}),d.length===0&&r?(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}):d.length===0?(0,j.jsx)(Ze,{title:a?.data??\"No posts yet\",children:(0,j.jsx)(\"p\",{children:f?\"Posts show up here.\":\"X has nothing to show for this account.\"})}):(0,j.jsxs)(j.Fragment,{children:[r&&(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}),(0,j.jsx)(qf,{region:\"posts\",items:l,actionable:g}),(0,j.jsx)(ui,{stale:t.stale})]})]}),(0,j.jsx)(Qe,{className:\"screen profile-screen\",\"aria-busy\":t.stale||t.status===\"loading\",children:s})}function YS({profile:e}){let t=Ot();return(0,j.jsxs)(\"header\",{className:\"profile\",children:[(0,j.jsx)(\"div\",{className:\"banner\",children:e.banner&&(0,j.jsx)(\"img\",{src:e.banner,alt:\"\",referrerPolicy:\"no-referrer\"})}),(0,j.jsxs)(\"div\",{className:\"profile-top\",children:[(0,j.jsx)(gl,{src:e.avatar,size:80}),e.own&&(0,j.jsx)(Hf,{url:`${Re}/settings/profile`,label:\"Edit profile\"})]}),(0,j.jsxs)(\"h1\",{className:\"profile-name\",children:[e.name,e.verified&&(0,j.jsx)(Za,{})]}),(0,j.jsxs)(\"p\",{className:\"post-meta\",children:[\"@\",e.handle]}),e.description&&(0,j.jsx)(\"p\",{className:\"post-text\",dir:\"auto\",children:e.description}),e.details&&(0,j.jsx)(\"p\",{className:\"post-meta\",children:e.details}),e.links.length>0&&(0,j.jsx)(\"p\",{className:\"profile-links\",children:e.links.map(n=>(0,j.jsx)(\"a\",{href:n.url,onClick:l=>{l.preventDefault(),t(n.url)},children:n.label},n.url))})]})}var Gt=L(et(),1);var U=L(ae(),1);function VS(e){try{let t=JSON.parse(e??\"\");return wf(t?.postId)&&Cf(t.url)?.postId===t.postId&&Df(t.snapshot)?t:null}catch{return null}}function o0(){let{screen:e,back:t}=ge(),n=$a(),l=(0,Gt.useMemo)(()=>VS(e?.params.post),[e?.params.post]),[a,u]=(0,Gt.useState)(void 0),[i,o]=(0,Gt.useState)(null),[c,f]=(0,Gt.useState)(0),[d,g]=(0,Gt.useState)(!1),[r,s]=(0,Gt.useState)(\"\"),[y,S]=(0,Gt.useState)(\"\"),[x,p]=(0,Gt.useState)(!1),{service:m}=n,h=!!n.library&&!n.error&&!n.pending;if((0,Gt.useEffect)(()=>{if(!l||!h)return;let $=!0;return m.lookup(l.postId).then(xe=>{$&&(u(xe),o(xe?.categoryIds??[]))},xe=>{$&&s(hn(xe))}),()=>{$=!1}},[l,h,m,c]),!l)return(0,U.jsx)(\"div\",{className:\"screen\",children:(0,U.jsx)(Ze,{title:\"Can't file this post\",role:\"alert\",children:(0,U.jsx)(\"p\",{children:\"The post details are missing.\"})})});let b=new Set(n.categories.map($=>$.id)),N=(i??[]).filter($=>b.has($)),M=N.length>=10,A=$=>{let xe=$.code;s(xe===\"CONFLICT\"?\"This post's categories changed elsewhere. They were reloaded; review them and save again.\":hn($)),xe===\"CONFLICT\"&&(o(null),f(Kt=>Kt+1))},z=async()=>{g(!0),s(\"\");try{await n.operate(\"bookmark.setCategories\",{postId:l.postId,expectedRevision:a?.revision??null,categoryIds:N,...a?{}:{url:l.url,snapshot:l.snapshot}},l.postId),t()}catch($){A($)}finally{g(!1)}},fe=async()=>{if(a){g(!0),s(\"\");try{await n.operate(\"bookmark.remove\",{postId:l.postId,expectedRevision:a.revision},l.postId),t()}catch($){p(!1),A($)}finally{g(!1)}}},G=async()=>{let $=ai(y);if($){s($);return}g(!0),s(\"\");let xe=crypto.randomUUID();try{await n.operate(\"category.create\",{id:xe,name:y},xe),S(\"\"),M||o(Kt=>[...new Set([...Kt??[],xe])])}catch(Kt){s(hn(Kt))}finally{g(!1)}},rt=h&&a!==void 0&&i!==null;return(0,U.jsxs)(Qe,{className:\"screen\",children:[(0,U.jsx)(\"h1\",{className:\"screen-title\",children:a?\"Edit categories\":\"Save to categories\"}),(0,U.jsxs)(\"section\",{className:\"card\",children:[(0,U.jsxs)(\"p\",{className:\"post-head\",children:[(0,U.jsx)(\"strong\",{children:l.snapshot.authorName}),\" \",(0,U.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",l.snapshot.authorHandle]})]}),l.snapshot.text&&(0,U.jsx)(\"p\",{className:\"post-text clamp\",dir:\"auto\",children:l.snapshot.text}),(0,U.jsx)(\"p\",{className:\"post-meta\",children:\"Categories are kept by this app, separate from your X bookmarks.\"})]}),(0,U.jsx)(ii,{library:n,children:rt?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(\"fieldset\",{className:\"card\",disabled:d,children:[(0,U.jsx)(\"legend\",{children:\"Categories\"}),n.categories.length===0&&(0,U.jsx)(\"p\",{className:\"post-meta\",children:\"No categories yet. Create one below.\"}),n.categories.map($=>{let xe=N.includes($.id);return(0,U.jsxs)(\"label\",{className:\"check\",children:[(0,U.jsx)(\"input\",{type:\"checkbox\",checked:xe,disabled:!xe&&M,onChange:Kt=>{let ci=$.id;o(Wa=>Kt.target.checked?[...Wa??[],ci]:(Wa??[]).filter(ri=>ri!==ci))}}),(0,U.jsx)(\"span\",{className:\"grow\",children:$.name}),(0,U.jsx)(\"span\",{className:\"post-meta\",children:$.count})]},$.id)}),M&&(0,U.jsxs)(\"p\",{className:\"post-meta\",children:[\"A post can be in up to \",10,\" categories.\"]}),n.categories.length<50?(0,U.jsxs)(\"form\",{className:\"row\",onSubmit:$=>{$.preventDefault(),G()},children:[(0,U.jsxs)(\"label\",{className:\"grow\",children:[(0,U.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,U.jsx)(\"input\",{placeholder:\"New category\",value:y,maxLength:80,enterKeyHint:\"done\",onChange:$=>S($.target.value)})]}),(0,U.jsx)(\"button\",{type:\"submit\",className:\"secondary\",disabled:!y.trim(),children:\"Create\"})]}):(0,U.jsxs)(\"p\",{className:\"post-meta\",children:[\"You have \",50,\" categories, the most allowed.\"]})]}),r&&(0,U.jsx)(\"p\",{role:\"status\",className:\"status\",children:r}),(0,U.jsxs)(\"div\",{className:\"actions\",children:[(0,U.jsx)(\"button\",{type:\"button\",className:\"primary\",disabled:d||N.length===0,onClick:()=>{z()},children:d?\"Saving\\u2026\":\"Save\"}),(0,U.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:d,onClick:t,children:\"Cancel\"}),a&&!x&&(0,U.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:d,onClick:()=>p(!0),children:\"Remove from Categories\"})]}),N.length===0&&(0,U.jsx)(\"p\",{className:\"post-meta\",children:a?\"Choose a category, or remove the post from Categories.\":\"Choose at least one category.\"}),x&&(0,U.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":\"Confirm removal\",children:[(0,U.jsx)(\"p\",{children:\"Remove this post from Categories? Its X bookmark will stay unchanged.\"}),(0,U.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:d,onClick:()=>{fe()},children:\"Remove\"}),(0,U.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:d,onClick:()=>p(!1),children:\"Keep\"})]})]}):(0,U.jsx)(Pe,{label:\"Loading categories\",rows:3,kind:\"text\"})}),!n.error&&r&&!rt&&(0,U.jsx)(\"p\",{role:\"status\",className:\"status\",children:r})]})}var Ln=L(ae(),1),jS={home:rc,notifications:rc,saved:rc,explore:e0,post:l0,profile:u0,media:n0,account:Kh,categories:Wh,save:o0,manage:t0},XS=[{id:\"home\",label:\"Home\",icon:\"home\"},{id:\"explore\",label:\"Explore\",icon:\"search\"},{id:\"notifications\",label:\"Notifications\",icon:\"bell\"},{id:\"saved\",label:\"Saved\",icon:\"bookmark\"},{id:\"profile\",label:\"Profile\",icon:\"person\"}],QS={home:\"/home\",notifications:\"/notifications\",saved:\"/i/history\"};function ZS(e){let t=e?new URL(e).pathname:\"/home\";return t===\"/home\"?\"home\":t===\"/notifications\"?\"notifications\":t.startsWith(\"/i/history\")||t===\"/i/bookmarks\"?\"saved\":null}function r0(){let{screen:e,active:t,contexts:n,overlay:l,select:a,navigate:u,reload:i}=ge();uc(()=>i(\"account\"));let o=(0,c0.useRef)(\"home\"),c=ZS(n.primary?.url??null);c&&(o.current=c);let f=l.length>0?\"saved\":t===\"explore\"?\"explore\":t===\"account\"?\"profile\":c??o.current,d=r=>{r===\"explore\"?a(\"explore\"):r===\"profile\"?a(\"account\"):r===o.current&&(t!==\"primary\"||l.length>0||r===\"home\")?a(\"primary\"):u({url:`${Re}${QS[r]}`,context:\"primary\"})},g=e?jS[e.id]:void 0;return(0,Ln.jsxs)(\"div\",{className:e?.id===\"media\"?\"app viewing\":\"app\",children:[(0,Ln.jsx)(\"main\",{className:\"content\",children:g&&(0,Ln.jsx)(g,{},e.key)}),(0,Ln.jsx)(\"nav\",{className:\"tabs\",\"aria-label\":\"Sections\",children:XS.map(r=>{let s=r.id===f;return(0,Ln.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":s?\"page\":void 0,onClick:()=>{s&&l.length===0&&c===r.id&&r.id!==\"home\"?document.querySelector(\".screen\")?.scrollTo({top:0,behavior:\"smooth\"}):d(r.id)},children:[(0,Ln.jsx)(ve,{name:r.icon,filled:s}),(0,Ln.jsx)(\"span\",{children:r.label})]},r.id)})})]})}var s0=L(ae(),1);qh((0,s0.jsx)(r0,{}));})();\n"},{"path":"index.html","encoding":"utf8","content":"\n\n\n\n\nX\n\n\n\n\n
\n\n\n\n"}]} \ No newline at end of file +{"envelope":1,"bundle":{"format":3,"compat":{"manifestSchema":6,"bundleFormat":3,"protocol":1,"adapterApi":1,"sdk":"0.0.0","tools":"0.0.0","builtAt":"2026-11-09T13:08:07Z"},"manifest":{"schemaVersion":6,"id":"x-bookmarks","name":"X","origins":["https://x.com"],"foreground":{"entry":"src/main.tsx","screens":["home","explore","notifications","saved","post","profile","media","account","categories","save","manage"]},"adapter":"src/adapter.ts","contexts":[{"id":"primary","startUrl":"https://x.com/home"},{"id":"explore","startUrl":"https://x.com/explore"},{"id":"account","startUrl":"https://x.com/settings/account"}],"routes":[{"id":"home","pattern":"/home","page":"timeline","screen":"home","context":"primary"},{"id":"notifications","pattern":"/notifications","page":"timeline","screen":"notifications","context":"primary"},{"id":"bookmarks","pattern":"/i/history","page":"timeline","screen":"saved","context":"primary"},{"id":"own-likes","pattern":"/i/history/likes","page":"timeline","screen":"saved","context":"primary"},{"id":"bookmarks-alias","pattern":"/i/bookmarks","page":"timeline","screen":"saved","context":"primary"},{"id":"explore","pattern":"/explore/*","page":"explore","screen":"explore","context":"explore"},{"id":"search","pattern":"/search","query":["q"],"page":"explore","screen":"explore","context":"explore"},{"id":"hashtag","pattern":"/hashtag/:tag","page":"explore","screen":"explore","context":"explore"},{"id":"account","pattern":"/settings/account","page":"account","screen":"account","context":"account"},{"id":"photo","pattern":"/:handle/status/:id/photo/:index","page":"media","screen":"media"},{"id":"post","pattern":"/:handle/status/:id","page":"post","screen":"post"},{"id":"likes","pattern":"/:handle/likes","page":"timeline","screen":"saved"},{"id":"replies","pattern":"/:handle/with_replies","page":"profile","screen":"profile"},{"id":"profile-media","pattern":"/:handle/media","page":"profile","screen":"profile"},{"id":"profile","pattern":"/:handle","page":"profile","screen":"profile"}],"capabilities":{"storage":true,"services":[{"id":"bookmarks","config":"backend/service.json"}]},"shell":{"accent":"#1d9bf0"}},"files":[{"path":"adapter.js","sha256":"6919c36aefa790f8a6dba84682ce9630a451098181856cac4600503e4e8ec540"},{"path":"assets/x.png","sha256":"7b11fa53318a4ae13d8fe37d7720c435209990edd274e39ff7111d068ef44d66"},{"path":"foreground.css","sha256":"57538bd3fd841af3d98f7954bd826e4c1e408cfef647dba0ee4ca8badf9e0ca9"},{"path":"foreground.js","sha256":"33ff4e5715c2bddbbb88aec97fbaca57bac2b034c2de8db7ba03ecce1183836e"},{"path":"index.html","sha256":"f5ba0d8e362f8a300a7c903ef44798981b18c35394edde0de326012f1cb2bad5"}]},"entries":[{"path":"adapter.js","encoding":"utf8","content":"(()=>{var j={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1};var At=/^:[A-Za-z][A-Za-z0-9_]*$/,Et=/^[A-Za-z0-9_.~@-]+$/,me=new Map;function It(e){if(me.has(e))return me.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),r=n.at(-1)===\"*\";r&&n.pop();let i=[],o=!0;for(let s of n)At.test(s)?i.push({param:s.slice(1)}):Et.test(s)&&s!==\".\"&&s!==\"..\"?i.push({literal:s}):o=!1;o&&(t={segments:i,rest:r})}return me.set(e,t),t}function ye(e){try{return new URL(e).href}catch{return null}}function we(e,t){let n=Tt(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let r;try{r=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}r.at(-1)===\"\"&&r.pop();for(let i of e.routes){let o=It(i.pattern);if(!o)continue;let s=St(o,r);if(!s||!(i.query??[]).every(u=>n.searchParams.has(u)))continue;for(let u of i.query??[])s[u]=n.searchParams.get(u);let c={kind:\"route\",routeId:i.id,page:i.page,screen:i.screen,params:s};return i.context!==void 0&&(c.context=i.context),c}return{kind:\"website\",url:t}}function Tt(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function St(e,t){if(e.rest?t.length{let i=null,o=!1,s=1,c=new Map,u=new Map,d={get bound(){return i},get retired(){return o},request(k,h={}){if(o)return Promise.reject(new O(\"RETIRED\",\"This page was closed\"));let v=s++;return new Promise((N,D)=>{let L=setTimeout(()=>{c.delete(v),D(new O(\"DEADLINE\",`${k} did not answer in time`))},i.limits.rpcDeadlineMs+Ot);c.set(v,{resolve:N,reject:D,timer:L}),e.postMessage(JSON.stringify({type:\"request\",documentId:i.documentId,requestId:v,method:k,params:h}))})},on(k,h){let v=u.get(k);return v||u.set(k,v=new Set),v.add(h),()=>{v.delete(h)}}};function f(){o=!0;for(let k of c.values())clearTimeout(k.timer),k.reject(new O(\"RETIRED\",\"This page was closed\"));c.clear()}function g(k,h){for(let v of[...u.get(k)??[]])try{v(h)}catch(N){console.error(`Genesis ${k} handler failed`,N)}}e.addEventListener(\"message\",k=>{if(o||typeof k.data!=\"string\")return;let h;try{h=JSON.parse(k.data)}catch{return}if(h?.type===\"refused\"&&!i){o=!0,r(new O(h.error?.code??\"PROTOCOL_MISMATCH\",h.error?.message??\"The host refused this page\"));return}if(h?.type===\"bound\"){if(i)return;i=h,n(d);return}if(!(!i||h?.documentId!==i.documentId))if(h.type===\"response\"){let v=c.get(h.requestId);if(!v)return;c.delete(h.requestId),clearTimeout(v.timer),h.error?v.reject(new O(h.error.code,h.error.message)):v.resolve(h.result??null)}else h.type===\"event\"&&(h.name===\"retired\"?(f(),g(\"retired\",{})):g(h.name,h.data))}),addEventListener(\"pagehide\",()=>{o||(g(\"pagehide\",{}),f())});let y={type:\"hello\",protocol:j.protocol,url:t};e.postMessage(JSON.stringify(y))})}var Nt=100;function Mt(e){let t=new Map,n=Promise.resolve();return{act(r){let i={request:r,arrived:Date.now(),view:e.view(),cancelled:!1,dispatched:!1,stopped:!1};t.set(r.actionId,i),n=n.then(()=>_t(e,i)).catch(o=>{console.error(\"Genesis action failed\",o)}).finally(()=>{t.delete(r.actionId)})},cancel(r){let i=t.get(r);i&&!i.dispatched&&(i.cancelled=!0)},retire(){for(let r of t.values())r.stopped=!0}}}async function _t(e,t){let{connection:n,limits:r}=e,{actionId:i}=t.request,o,s=(E,T,C)=>{if(t.stopped)return Promise.resolve();let M={actionId:i,state:E};return C&&(M.navigating=!0),C&&o&&(M.expect=o),T&&(M.result=T),n.request(\"context.actionResult\",M).then(()=>{},()=>{})},c=(E,T,C)=>{let M={outcome:\"failed\",code:E,message:T};return C!==void 0&&Object.assign(M,{completedSteps:C,partial:C>0}),s(\"failed\",M)},u=()=>s(\"cancelled\",{outcome:\"cancelled\"});if(t.stopped)return;if(t.cancelled)return u();if((t.request.view??t.view)!==t.view||e.view()!==t.view)return c(\"CONTEXT_REPLACED\",\"The page the action was for has been replaced\");let d=e.find(t.request);if(\"error\"in d)return c(d.error.code,d.error.message);let f=d.element();if(f===void 0)return c(\"TARGET_NOT_FOUND\",\"The item is no longer on the page\");let g;try{g=d.action(f,t.request.args)}catch(E){return c(\"INVALID_STEPS\",je(E))}if(typeof g?.then==\"function\")return c(\"INVALID_STEPS\",\"An action must return its steps synchronously\");if(g&&\"satisfied\"in g&&g.satisfied===!0)return s(\"observed\",{outcome:\"observed\",noop:!0});let y=Rt(g);if(y)return c(\"INVALID_STEPS\",y);let{steps:k,until:h,deadlineMs:v}=g;o=g.expect;let N=g.navigates===!0||Ze(k.at(-1)),D=t.arrived+(v??r.actionTimeoutMs),L=0,W=E=>(t.dispatched=!0,s(\"dispatched\",void 0,E)),Q=n.on(\"pagehide\",()=>{!t.dispatched&&!t.stopped&&L>0&&W(!0),t.stopped=!0}),ee=()=>t.stopped||t.cancelled;try{for(let[E,T]of k.entries()){if(t.stopped)return;if(t.cancelled)return u();if(Date.now()>=D)return c(\"DEADLINE\",\"The action did not finish in time\",L);if(E>0&&Fe(k[E-1])&&d.element()===void 0)return c(\"TARGET_NOT_FOUND\",\"The item left the page during the action\",L);if(N&&E===k.length-1&&!Fe(T)){if(be(T),await W(!0),t.stopped)return;be(T)();return}await Pt(T,D,ee),L++}if(t.stopped)return;if(t.cancelled)return u();if(await W(N),N)return;if(h!==void 0){let E=typeof h==\"string\"?()=>document.querySelector(h)!==null:()=>h(document)===!0;try{await ve(E,D-Date.now(),\"the action to take effect\",()=>t.stopped)}catch{return s(\"failed\",{outcome:\"unknown\",code:\"DEADLINE\",message:\"The page did not show the action's effect in time\",completedSteps:L,partial:L>0})}}if(t.stopped)return;e.flush(),await s(\"observed\",{outcome:\"observed\"})}catch(E){let T=E instanceof O?E.code:\"INVALID_ARGUMENT\";return c(T,je(E),L)}finally{Q()}}function Rt(e){if(typeof e!=\"object\"||e===null)return\"An action must return { satisfied: true } or { steps }\";let{steps:t,until:n}=e;if(!Array.isArray(t))return\"An action must return { satisfied: true } or { steps }\";for(let[r,i]of t.entries()){let o=Lt(i);if(o)return`Step ${r}: ${o}`;if(Ze(i)&&r!==t.length-1)return\"A navigate or submit step must be the last step\"}return n!==void 0&&typeof n!=\"string\"&&typeof n!=\"function\"?\"until must be a selector or a function\":null}function Lt(e){if(typeof e!=\"object\"||e===null)return\"must be an object\";let t=e,n=r=>typeof r==\"string\"&&r!==\"\";if(\"click\"in t)return n(t.click)?null:\"click needs a selector\";if(\"fill\"in t)return n(t.fill)&&typeof t.value==\"string\"?null:\"fill needs a selector and a string value\";if(\"submit\"in t)return n(t.submit)?null:\"submit needs a selector\";if(\"navigate\"in t)return n(t.navigate)?null:\"navigate needs a URL\";if(\"waitFor\"in t||\"waitForUrl\"in t)return n(t.waitFor??t.waitForUrl)&&typeof t.timeoutMs==\"number\"?null:\"a wait needs a selector or pattern and timeoutMs\";if(\"scroll\"in t){let r=t.scroll;return r&&n(r.target)&&(r.to===\"end\"||typeof r.to==\"number\")?null:\"scroll needs a target and to\"}return\"unknown step\"}var Ze=e=>e!==void 0&&(\"navigate\"in e||\"submit\"in e),Fe=e=>\"waitFor\"in e||\"waitForUrl\"in e,je=e=>String(e?.message??e);function te(e){let t=document.querySelector(e);if(!t)throw new O(\"NOT_FOUND\",`Nothing matches ${e}`);return t}async function Pt(e,t,n){let r=()=>Math.max(0,t-Date.now());if(\"waitFor\"in e)await ve(()=>document.querySelector(e.waitFor)!==null,Math.min(e.timeoutMs,r()),e.waitFor,n);else if(\"waitForUrl\"in e){let i=new RegExp(e.waitForUrl);await ve(()=>i.test(location.href),Math.min(e.timeoutMs,r()),e.waitForUrl,n)}else be(e)()}function be(e){if(\"click\"in e){let t=te(e.click);return()=>t.click()}if(\"fill\"in e){let t=te(e.fill);return()=>$t(t,e.value)}if(\"submit\"in e){let t=te(e.submit),n=t instanceof HTMLFormElement?t:t.closest(\"form\");if(!n)throw new O(\"NOT_FOUND\",`${e.submit} is not in a form`);let r=t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t:void 0;return()=>n.requestSubmit(r)}if(\"navigate\"in e){let t=e.navigate;return()=>location.assign(t)}if(\"scroll\"in e){let{target:t,to:n}=e.scroll,r=t===\"window\"?document.scrollingElement??document.documentElement:te(t);return()=>{r.scrollTop=n===\"end\"?r.scrollHeight:n}}throw new O(\"INVALID_STEPS\",\"A wait step does not run on its own\")}function $t(e,t){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new O(\"INVALID_STEPS\",\"fill needs an input or textarea\");let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(n,\"value\")?.set?.call(e,t),e.dispatchEvent(new Event(\"input\",{bubbles:!0})),e.dispatchEvent(new Event(\"change\",{bubbles:!0}))}function ve(e,t,n,r){let i=Date.now()+t;return new Promise((o,s)=>{let c=()=>{try{return e()}catch{return!1}},u=()=>{r()||c()?o():Date.now()>=i?s(new O(\"DEADLINE\",`Timed out waiting for ${n}`)):setTimeout(u,Nt)};u()})}var He=new WeakMap;function Ve(e){let t=He.get(e);return t===void 0&&He.set(e,t=JSON.stringify(e)),t}function Ae(e,t){return e===t?!0:e!==null&&t!==null&&Ve(e)===Ve(t)}function re(e,t){return e?.code===t?.code&&e?.message===t?.message}function Dt(e,t){if(e.kind!==t.kind)return{kind:\"replace\",region:t};if(t.kind===\"single\"){let f=e;if(Ae(f.record,t.record)&&f.status===t.status&&re(f.error,t.error))return null;let g={kind:\"single\",record:t.record};return f.status!==t.status&&(g.status=t.status),re(f.error,t.error)||(g.error=t.error??null),g}let n=e;if(!!n.ephemeral!=!!t.ephemeral||t.ephemeral)return Ct(n,t)?null:{kind:\"replace\",region:t};let r=new Map(n.items.map(f=>[f.key,f])),i=new Set,o=[];for(let f of t.items){i.add(f.key);let g=r.get(f.key);(!g||!Ae(g,f))&&o.push(f)}let s=n.items.filter(f=>!i.has(f.key)).map(f=>f.key),c=t.items.map(f=>f.key),u=c.length!==n.items.length||c.some((f,g)=>n.items[g].key!==f),d={kind:\"collection\"};return o.length&&(d.upsert=o),s.length&&(d.remove=s),u&&(d.order=c),n.complete!==t.complete&&(d.complete=t.complete),n.status!==t.status&&(d.status=t.status),re(n.error,t.error)||(d.error=t.error??null),Object.keys(d).length>1?d:null}function Ct(e,t){return e.complete===t.complete&&e.status===t.status&&re(e.error,t.error)&&!!e.ephemeral==!!t.ephemeral&&e.items.length===t.items.length&&e.items.every((n,r)=>Ae(n,t.items[r]))}function Ut(e,t,n=1/0){let r=e.slice(),i=s=>r.findIndex(c=>c.key===s),o=-1;for(let[s,c]of t.entries()){let u=i(c.key);if(u!==-1){r[u]=c,o=u;continue}let d=o+1;o===-1&&(d=t.slice(s+1).map(g=>i(g.key)).find(g=>g!==-1)??r.length),r.splice(d,0,c),o=d}return r.length>n?Xe(r,new Set(t.map(s=>s.key)),n):r}function Xe(e,t,n){if(e.length<=n)return e;let r=-1,i=0;for(let[c,u]of e.entries())t.has(u.key)&&(r===-1&&(r=c),i=c);r===-1&&(r=0);let o=Math.max(n,i-r+1),s=Math.min(Math.max(0,Math.floor((r+i+1-o)/2)),e.length-o);return e.slice(s,s+o)}function qt(e){return new Set(e).size===e.length?{keys:e,ephemeral:!1}:{keys:e.map((t,n)=>String(n)),ephemeral:!0}}function Gt(e,t,n){let r=new Map,i=o=>{let s=r.get(o);return s||r.set(o,s={keys:new Set,whole:!1,membership:!1,resolve:!1}),s};for(let[o,s]of Object.entries(e)){let c=t.some(u=>u.kind===\"childList\");if(!s.root){c&&(i(o).resolve=!0);continue}if(!ke(s.root,n)){i(o).resolve=!0;continue}(s.dependsOn.some(u=>!ke(u,n))||s.dependsOnMissing&&c)&&(i(o).whole=!0);for(let u of t){if(u.kind===\"field\"&&!s.fields||u.kind===\"resize\"&&!s.measure)continue;u.removed&&ke(s.root,u.target)&&(i(o).whole=!0);let d=Ye(s,u.target);d.dependent&&(i(o).whole=!0),d.inRoot&&(u.kind===\"childList\"&&(i(o).membership=!0),d.key===void 0?i(o).whole=!0:i(o).keys.add(d.key))}}return r}function Bt(e,t){let n=Ye(e,t);return n.inRoot||n.dependent}function Ye(e,t){let n,r=!1,i=!1;for(let o=t;o;o=o.parentNode)n??=e.items.get(o),o===e.root&&(r=!0),e.dependsOn.includes(o)&&(i=!0);return n!==void 0&&(r=!0),{key:n,inRoot:r,dependent:i}}function ke(e,t){for(let n=e;n;n=n.parentNode)if(n===t)return!0;return!1}function Ft(e){let t=new MutationObserver(o=>{let s=[];for(let c of o){s.push({target:c.target,kind:c.type});for(let u of c.removedNodes)s.push({target:u,kind:\"childList\",removed:!0})}e(s)});t.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let n=o=>{o.target instanceof Node&&e([{target:o.target,kind:\"field\"}])};document.addEventListener(\"input\",n,!0),document.addEventListener(\"change\",n,!0);let r=new WeakMap,i=typeof ResizeObserver==\"function\"?new ResizeObserver(o=>{let s=[];for(let c of o){let u=`${c.contentRect.width}x${c.contentRect.height}`,d=r.get(c.target);r.set(c.target,u),d!==void 0&&d!==u&&s.push({target:c.target,kind:\"resize\"})}s.length&&e(s)}):null;return{measure(o){if(i){i.disconnect();for(let s of o)i.observe(s)}},disconnect(){t.disconnect(),i?.disconnect(),document.removeEventListener(\"input\",n,!0),document.removeEventListener(\"change\",n,!0)}}}function jt(e){for(let t of[\"pushState\",\"replaceState\"]){let n=History.prototype[t];History.prototype[t]=function(...r){let i=n.apply(this,r);try{e()}catch(o){console.error(\"Genesis navigation handler failed\",o)}return i}}addEventListener(\"popstate\",e),addEventListener(\"hashchange\",e)}var Ht=new TextEncoder,ne=e=>Ht.encode(JSON.stringify(e)).length,Vt=class{constructor(e,t,n=()=>null){this.send=e,this.limits=t,this.shrink=n}send;limits;shrink;epoch=0;seq=0;last=null;page(e){let t={...e,epoch:++this.epoch};for(;ne(t)>this.limits.pageMaxBytes;){let n=this.shrink(t);if(!n){t={...t,status:\"error\",error:{code:\"PAGE_TOO_LARGE\",message:\"The page is too large to show\"},regions:{}};break}t={...n,epoch:t.epoch}}this.seq=0,this.last=t,this.post({page:t})}update(e){let t=this.last;if(!t||!zt(t,e))return this.page(e);let n={};for(let[o,s]of Object.entries(e.regions)){let c=Dt(t.regions[o],s);c&&(n[o]=c)}let r=e.account!==void 0&&e.account!==t.account;if(!r&&Object.keys(n).length===0)return;let i=this.split(n);if(r&&(i[i.length-1].account=e.account),i.some(o=>ne(o)>this.limits.patchMaxBytes))return this.page(e);this.last={...e,epoch:this.epoch};for(let o of i)this.post({patch:o})}split(e){let t=[],n={};for(let[u,d]of Object.entries(e)){if(d.kind!==\"collection\"||!d.upsert){n[u]=d;continue}let{upsert:f,...g}=d;for(let y of f)t.push([u,y]);Object.keys(g).length>1&&(n[u]=g)}let r=this.limits.patchMaxBytes-ne(n)-256,i=[],o=[],s=0;for(let u of t){let d=ne(u[1])+1;o.length&&(o.length>=this.limits.patchRecordsMax||s+d>r)&&(i.push(o),o=[],s=0),o.push(u),s+=d}i.push(o);let c=this.last.view;return i.map((u,d)=>{let f={view:c,epoch:this.epoch,base:this.seq,seq:++this.seq,regions:{}};for(let[g,y]of u)(f.regions[g]??={kind:\"collection\",upsert:[]}).upsert.push(y);if(d===i.length-1)for(let[g,y]of Object.entries(n))f.regions[g]={...f.regions[g],...y};return f})}post(e){this.send(e).catch(t=>{let n=t instanceof O?t.code:null;if(n!==\"RETIRED\"){if(\"patch\"in e&&this.last&&e.patch.epoch===this.epoch){let{epoch:r,...i}=this.last;return this.page(i)}if(\"page\"in e&&n===\"PAGE_TOO_LARGE\"&&e.page.status!==\"error\"){let{epoch:r,...i}=e.page;return this.page({...i,status:\"error\",error:{code:n,message:\"The page is too large to show\"},regions:{}})}console.error(\"Genesis could not publish the page\",t)}})}};function zt(e,t){let n=Object.keys(t.regions);return e.view.generation===t.view.generation&&e.view.n===t.view.n&&e.view.url===t.view.url&&e.status===t.status&&e.pageId===t.pageId&&e.routeId===t.routeId&&e.error?.code===t.error?.code&&e.error?.message===t.error?.message&&e.signInUrl===t.signInUrl&&JSON.stringify(e.params)===JSON.stringify(t.params)&&n.length===Object.keys(e.regions).length&&n.every(r=>e.regions[r]?.kind===t.regions[r].kind)}function Kt(e,t,n){let r,i,o=()=>{clearTimeout(r),r=void 0,i=void 0,e()};return{schedule(){let s=Date.now();i??=s,clearTimeout(r),r=setTimeout(o,Math.min(t,Math.max(0,i+n-s)))},now(){r!==void 0&&o()},cancel(){clearTimeout(r),r=void 0,i=void 0}}}var Wt=1e4,ze=!1;function Ee(e){if(typeof window>\"u\"||window.top!==window||ze)return;ze=!0;let t=window,n=t.__genesisBridge;try{delete t.__genesisBridge}catch{t.__genesisBridge=void 0}if(!n)return;let r=null;jt(()=>r?.navigated());let i=()=>Be(n,location.href).then(o=>{r=Jt(o,e)},o=>console.error(\"Genesis could not bind this page\",o));i(),addEventListener(\"pageshow\",o=>{o.persisted&&(r?.stop(),r=null,i())})}function Jt(e,t){let{manifest:n,limits:r,generation:i}=e.bound,o={batches:0,reads:0,lastBatchReads:0,pages:0,patches:0,lastPublishBytes:0,resyncs:0,startedAt:Date.now()},s=!1;s&&(window.__genesisStats=o);let c=new Vt(a=>(s&&(\"page\"in a?o.pages++:o.patches++,o.lastPublishBytes=JSON.stringify(a).length),e.request(\"context.publish\",a)),r,xt),u={generation:i,n:0,url:location.href};if(e.bound.compat.adapterApi!==j.adapterApi){let a=`This applet uses adapter API ${j.adapterApi}; this Genesis uses ${e.bound.compat.adapterApi}`;return console.error(`Genesis: ${a}`),c.page({view:u,pageId:null,routeId:null,params:{},status:\"error\",error:{code:\"PROTOCOL_MISMATCH\",message:a},account:null,regions:{}}),{navigated(){},stop(){}}}let d=!1,f=ye(location.href),g=we(n,location.href),y=D(g),k=null,h=new Map,v=[],N=!1;function D(a){return a.kind===\"route\"?t.pages[a.page]??null:null}function L(){let a=y?.account??t.account;try{let l=a?.(document);return l===void 0&&a?{account:void 0,failed:!1}:{account:typeof l==\"string\"&&l!==\"\"?l:null,failed:!1}}catch(l){return console.error(\"Genesis adapter account failed\",l),{account:void 0,failed:!0}}}function W(){let a=t.signInUrl;try{if(typeof a==\"string\")return new URL(a,n.origins[0]).href;if(typeof a==\"function\")return new URL(a(location.href),location.href).href}catch(l){console.error(\"Genesis adapter signInUrl failed\",l)}return null}function Q({account:a,failed:l}){if(g.kind!==\"route\")return{status:\"unsupported\"};if(!y)return{status:\"error\",error:{code:\"NOT_FOUND\",message:`The adapter declares no page ${g.page}`}};let m;try{m=y.ready(document)===!0}catch(w){return{status:\"error\",error:{code:\"INVALID_ARGUMENT\",message:Je(w)}}}if(y.requiresAccount===!0&&l)return{status:\"loading\"};let p=y.requiresAccount===!0&&a===null;return m?{status:p?\"auth\":\"ready\"}:p&&document.readyState!==\"loading\"?{status:\"auth\"}:{status:\"loading\"}}function ee(a,l){let m={view:u,pageId:g.kind===\"route\"?g.page:null,routeId:g.kind===\"route\"?g.routeId:null,params:g.kind===\"route\"?g.params:{},status:l.status,signInUrl:W(),regions:{}};a!==void 0&&(m.account=a),l.error&&(m.error=l.error);for(let[p,w]of h)m.regions[p]=w.value;return m}function E(a,l,m){let p={name:a,def:l,root:null,items:new WeakMap,elements:new Map,dependsOn:[],dependsOnMissing:!1,value:m?.value??Zt(l)};for(let w of l.dependsOn??[]){let x=[...document.querySelectorAll(w)];x.length===0&&(p.dependsOnMissing=!0),p.dependsOn.push(...x)}return p.root=document.querySelector(l.root),T(p,()=>l.kind===\"collection\"?M(p,l,\"all\"):C(p,l)),p}function T(a,l){try{a.value=l()}catch(m){let p=m instanceof O?m.code:\"INVALID_ARGUMENT\";a.value={...a.value,status:\"error\",error:{code:p,message:`${a.name}: ${Je(m)}`}}}}function C(a,l){let m=a.root;return m?{kind:\"single\",status:\"ready\",record:$e(l,m,l.key?oe(l.key,m):a.name)}:{kind:\"single\",status:\"ready\",record:null}}function M(a,l,m){let p=a.value,w=a.root?[...a.root.querySelectorAll(l.items)]:[],{keys:x,ephemeral:b}=qt(w.map($=>oe(l.key,$))),A=p.ephemeral?new Map:new Map(p.items.map($=>[$.key,$])),_=a.elements;a.elements=new Map;let S=w.map(($,vt)=>{let J=x[vt];a.elements.set(J,$);let qe=A.get(J);return m!==\"all\"&&qe&&!m.has(J)&&_.get(J)===$?qe:Pe(a,l,$,J)}),G={kind:\"collection\",status:\"ready\",items:l.virtualized&&!b&&!p.ephemeral?Ut(p.items,S,r.patchRecordsMax):S,complete:xe(l)};return b&&(G.ephemeral=!0),G}function Pe(a,l,m,p){let w=$e(l,m,p);a.items.set(m,p);for(let x of l.extent?.(m)??[])x&&a.items.set(x,p);return w}function $e(a,l,m){o.reads++;let p=a.read(l);if(typeof p?.then==\"function\")throw new O(\"ASYNC_READ\",\"read must return its data synchronously\");let w={key:m,data:p===void 0?null:p};return a.entity&&(w.entity=a.entity(l)),a.entityType&&(w.entityType=a.entityType),w}function wt(a,l,m){let p=a.value;if(p.ephemeral||p.status===\"error\")return T(a,()=>M(a,l,m));let w=p.items.slice();for(let x of m){let b=a.elements.get(x),A=w.findIndex(S=>S.key===x);if(!(b?.isConnected&&a.root?.contains(b)&&b.matches(l.items))||A===-1||oe(l.key,b)!==x)return T(a,()=>M(a,l,m));try{w[A]=Pe(a,l,b,x)}catch{return T(a,()=>M(a,l,m))}}a.value={...p,items:w,complete:xe(l)}}function kt(a,l){let{def:m}=a;l.resolve||l.whole||m.kind===\"single\"?h.set(a.name,E(a.name,m,a)):l.membership?T(a,()=>M(a,m,l.keys)):wt(a,m,l.keys)}function xt(a){if(a.view.n!==u.n)return null;let l={...a,regions:{...a.regions}},m=!1;for(let[p,w]of Object.entries(a.regions)){let x=h.get(p);if(x?.def.kind!==\"collection\"||!x.def.virtualized||w.kind!==\"collection\"||w.ephemeral)continue;let b=Xe(w.items,new Set(x.elements.keys()),Math.floor(w.items.length*3/4));b.length!==w.items.length&&(l.regions[p]={...w,items:b},x.value===w&&(x.value=l.regions[p]),m=!0)}return m?l:null}function fe(a=!1){if(d)return;v=[],N=!1;let l=L(),{account:m}=l,p=Q(l),w=h;if(h=new Map,p.status===\"ready\")for(let[b,A]of Object.entries(y?.regions??{}))h.set(b,E(b,A,w.get(b)));k=p.status;let x=ee(m,p);a?c.page(x):c.update(x),Ce()}function De(){if(d)return;o.batches++;let a=o.reads,l=v,m=N;v=[],N=!1;let p=L(),{account:w}=p,x=Q(p);if(x.status!==\"ready\"||k!==\"ready\"||m)fe();else{let b={};for(let[A,_]of h)b[A]=Ke(_);for(let[A,_]of Gt(b,l,document))kt(h.get(A),_);for(let A of h.values()){let _=A.value;if(A.def.kind===\"collection\"&&_.kind===\"collection\"&&A.def.more){let S=xe(A.def);S!==_.complete&&(A.value={..._,complete:S})}}c.update(ee(w,x)),Ce()}o.lastBatchReads=o.reads-a}function Ce(){let a=[];for(let l of h.values())l.def.measure&&(l.def.kind===\"single\"?l.root&&a.push(l.root):a.push(...l.elements.values()));Ue.measure(a)}let q=Kt(De,r.publishQuietMs,r.publishMaxDelayMs),Ue=Ft(a=>{if(!d){if(k===\"ready\"&&!N){let l=[...h.values()].map(Ke);v.push(...a.filter(m=>m.kind!==\"attributes\"||l.some(p=>Bt(p,m.target)))),v.length>Wt&&(v=[],N=!0)}q.schedule()}}),pe=Mt({connection:e,limits:r,flush:()=>{q.cancel(),De()},find:bt,view:()=>u.n});function bt(a){let l=(S,G)=>({error:{code:S,message:G}});if(k!==\"ready\"||!y)return l(\"NOT_READY\",\"The page is not ready\");let m=u.n;if(a.region===null){let S=y.actions?.[a.name];return S?{action:S,element:()=>null}:l(\"INVALID_ARGUMENT\",`The page has no action ${a.name}`)}let p=a.region,w=h.get(p);if(!w)return l(\"NOT_FOUND\",`The page has no region ${p}`);let x=w.def.actions?.[a.name];if(!x)return l(\"INVALID_ARGUMENT\",`Region ${p} has no action ${a.name}`);let b=w.def;if(b.kind===\"single\")return{action:x,element:()=>u.n===m?document.querySelector(b.root)??void 0:void 0};if(w.value.ephemeral)return l(\"PRECONDITION_FAILED\",`Region ${p} repeats keys, so its records have no actions`);let A=a.key;if(A===null)return l(\"INVALID_ARGUMENT\",`Action ${a.name} needs a record key`);let _=()=>{if(u.n!==m)return;let S=h.get(p)?.elements.get(A);if(S?.isConnected&&We(b,S)===A)return S;let G=document.querySelector(b.root);return G?[...G.querySelectorAll(b.items)].find($=>We(b,$)===A):void 0};return _()===void 0?l(\"TARGET_NOT_FOUND\",`No ${p} item has key ${A}`):{action:x,element:_}}function ge(a=!0){d||(d=!0,q.cancel(),Ue.disconnect(),a&&pe.retire())}return e.on(\"resync\",()=>{o.resyncs++,q.cancel(),fe(!0)}),e.on(\"act\",a=>pe.act(a)),e.on(\"cancel\",({actionId:a})=>pe.cancel(a)),e.on(\"ping\",()=>{}),e.on(\"retired\",()=>ge()),e.on(\"pagehide\",()=>ge(!1)),document.readyState===\"loading\"&&document.addEventListener(\"DOMContentLoaded\",()=>q.schedule(),{once:!0}),fe(),{navigated(){if(d)return;let a=ye(location.href);a!==f&&(f=a,u={generation:i,n:u.n+1,url:location.href},g=we(n,location.href),y=D(g),k=null,h=new Map,q.cancel(),q.schedule())},stop:()=>ge()}}function Ke(e){return{root:e.root,items:e.items,dependsOn:e.dependsOn,dependsOnMissing:e.dependsOnMissing,fields:e.def.fields===!0,measure:e.def.measure===!0}}function Zt(e){return e.kind===\"collection\"?{kind:\"collection\",status:\"ready\",items:[],complete:!0}:{kind:\"single\",status:\"ready\",record:null}}function xe(e){return e.more?document.querySelector(e.more)===null:!0}function oe(e,t){let n=e(t);if(typeof n!=\"string\"||n===\"\")throw new O(\"INVALID_ARGUMENT\",\"key must return a non-empty string\");return n}function We(e,t){try{return oe(e.key,t)}catch{return null}}function Je(e){return String(e?.message??e)}function V(e){return{...e,kind:\"collection\"}}function z(e){return{...e,kind:\"single\"}}function Ie(e){let t=(o,s)=>{throw new Error(`Adapter ${o} ${s}`)},n=(o,s)=>{o!==void 0&&typeof o!=\"function\"&&t(s,\"must be a function\")},r=(o,s)=>{(typeof o!=\"string\"||o.trim()===\"\")&&t(s,\"must be a CSS selector\")},i=(o,s)=>{if(o!==void 0){H(o)||t(s,\"must be an object of functions\");for(let[c,u]of Object.entries(o))typeof u!=\"function\"&&t(`${s}.${c}`,\"must be a function\")}};H(e)||t(\"definition\",\"must be an object\"),n(e.account,\"account\"),e.signInUrl!==void 0&&typeof e.signInUrl!=\"string\"&&typeof e.signInUrl!=\"function\"&&t(\"signInUrl\",\"must be a path or a function\"),H(e.pages)||t(\"pages\",\"must be an object\");for(let[o,s]of Object.entries(e.pages)){let c=`pages.${o}`;H(s)||t(c,\"must be an object\"),typeof s.ready!=\"function\"&&t(`${c}.ready`,\"must be a function\"),n(s.account,`${c}.account`),i(s.actions,`${c}.actions`),s.regions!==void 0&&!H(s.regions)&&t(`${c}.regions`,\"must be an object\");for(let[u,d]of Object.entries(s.regions??{})){let f=`${c}.regions.${u}`;(!H(d)||d.kind!==\"collection\"&&d.kind!==\"single\")&&t(f,\"must be made with collection() or single()\"),r(d.root,`${f}.root`),typeof d.read!=\"function\"&&t(`${f}.read`,\"must be a function\"),n(d.entity,`${f}.entity`),d.dependsOn!==void 0&&(Array.isArray(d.dependsOn)||t(`${f}.dependsOn`,\"must be an array of selectors\"),d.dependsOn.forEach((g,y)=>r(g,`${f}.dependsOn.${y}`))),i(d.actions,`${f}.actions`),d.kind===\"collection\"?(r(d.items,`${f}.items`),typeof d.key!=\"function\"&&t(`${f}.key`,\"must be a function\"),n(d.extent,`${f}.extent`),d.more!==void 0&&r(d.more,`${f}.more`)):n(d.key,`${f}.key`)}}return e}function H(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var Te=\"https://x.com\";var Z=e=>typeof e==\"string\"&&/^[A-Za-z0-9_]{1,15}$/.test(e);function X(e,t){if(typeof e!=\"string\"||e.length>2048)return null;try{let n=new URL(e,t);return[\"https:\",\"http:\"].includes(n.protocol)&&!n.username&&!n.password?n.href:null}catch{return null}}function U(e){let t=X(e);if(!t)return null;let n=new URL(t);return n.protocol===\"https:\"&&[\"pbs.twimg.com\",\"abs.twimg.com\"].includes(n.hostname)&&!n.port?n.href:null}function B(e){if(typeof e!=\"string\")return null;try{let t=new URL(e,Te),n=/^\\/([A-Za-z0-9_]{1,15})\\/status\\/([0-9]{1,25})$/.exec(t.pathname);return t.origin===Te&&!t.username&&!t.password&&n?{postId:n[2],handle:n[1],url:`${Te}/${n[1]}/status/${n[2]}`}:null}catch{return null}}var R='article[data-testid=\"tweet\"]',se=`${R}, [data-testid=\"notification\"]`;function I(e,t=300){return[...(e??\"\").replace(/\\s+/g,\" \").trim()].slice(0,t).join(\"\")}function ae(e){return(e instanceof HTMLElement?e.innerText:e?.textContent??\"\").split(`\n`).map(n=>I(n,300)).filter(Boolean)}function K(e){let t=5381;for(let n of e)t=t*33+n.charCodeAt(0)>>>0;return t.toString(36)}function tt(e){let t=[...e.querySelectorAll(\"span\")].find(n=>/^Something went wrong/i.test(n.textContent??\"\"));return t&&e.querySelector('[role=\"button\"], button')?I(t.textContent,200):null}var Xt=e=>e.querySelector('[data-testid=\"loginButton\"]')!==null,Yt=(e,t)=>e.closest(R)===t&&!e.parentElement?.closest('div[role=\"link\"]'),P=(e,t)=>[...e.querySelectorAll(t)].filter(n=>Yt(n,e));function Y(e){let t=P(e,\"a[href]\").filter(r=>r.querySelector(\"time\")).map(r=>({link:r,id:B(r.getAttribute(\"href\"))})).filter(r=>r.id!==null),n=t[0];return!n||t.some(r=>r.id.postId!==n.id.postId)?null:{link:n.link,...n.id}}var nt=e=>Y(e)?.postId??null;function ce(e){return e.matches(R)?Y(e)?.postId??`p:${K(I(e.textContent,600))}`:`n:${K(I(e.textContent,600))}`}function Qt(e,t=7e3){let n=[],r=0,i=(s,c)=>{if(r>=t||!s)return;let u=[...s].slice(0,t-r).join(\"\");r+=[...u].length,n.push(c?{text:u,href:c}:{text:u})},o=(s,c)=>{if(s.nodeType===Node.TEXT_NODE)return i(s.textContent??\"\",c);if(!(s instanceof Element))return;if(s.tagName===\"IMG\")return i(s.getAttribute(\"alt\")??\"\",c);if(s.matches(\"script,style,button,svg\"))return;let u=s.tagName===\"A\"?X(s.getAttribute(\"href\"),s.ownerDocument.location.href)??void 0:c;for(let d of s.childNodes)o(d,u)};return e&&o(e),n}var en=e=>e.map(t=>t.text).join(\"\"),ie=e=>I(e?.textContent,20);function Se(e){let t=Y(e);if(!t)return null;let n=t.link.querySelector(\"time\"),r=P(e,'[data-testid=\"tweetText\"]')[0]??null,i=r?Qt(r):[],o=r?.textContent??\"\",s=P(e,'[data-testid=\"User-Name\"] a')[0],c=y=>P(e,`[data-testid=\"${y}\"]`)[0],u=P(e,'[data-testid=\"tweetPhoto\"] img').filter(y=>B(y.closest(\"a[href]\")?.getAttribute(\"href\")?.replace(/\\/photo\\/[0-9]+$/,\"\"))?.postId===t.postId).map(y=>U(y.getAttribute(\"src\"))).filter(y=>y!==null).slice(0,4),d=P(e,'[data-testid=\"socialContext\"]')[0],f=[...e.querySelectorAll('div[role=\"link\"]')].find(y=>y.closest(R)===e&&y.querySelector('[data-testid=\"User-Name\"]')),g=null;if(f){let y=ae(f.querySelector('[data-testid=\"User-Name\"]')),k=y.find(h=>h.startsWith(\"@\"))?.slice(1)??null;g={name:y[0]??\"\",handle:Z(k)?k:null,text:I(f.querySelector('[data-testid=\"tweetText\"]')?.textContent,1200),url:B(f.querySelector('a[href*=\"/status/\"]')?.getAttribute(\"href\")?.replace(/\\/(photo|video)\\/[0-9]+$/,\"\"))?.url??null}}return{postId:t.postId,url:t.url,handle:t.handle,name:I(s?.textContent,200)||t.handle,avatar:U(P(e,'[data-testid=\"Tweet-User-Avatar\"] img')[0]?.getAttribute(\"src\")),verified:P(e,'[data-testid=\"User-Name\"] [data-testid=\"icon-verified\"]').length>0,time:I(n?.textContent,60),dateTime:n?.getAttribute(\"datetime\")?.slice(0,40)??null,parts:i,textState:o?en(i).lengthB(r.getAttribute(\"href\"))).find(Boolean);return{id:K(t),text:t,url:n?.url??null,avatars:[...e.querySelectorAll(\"img\")].map(r=>U(r.getAttribute(\"src\"))).filter(r=>r!==null).slice(0,4)}}function rt(e){if(e.matches(R)){let n=Se(e);return n&&{kind:\"post\",post:n}}let t=tn(e);return t&&{kind:\"notice\",notice:t}}function ot(e){return it(e)??`u:${K(I(e.textContent,300))}`}function it(e){return[...e.querySelectorAll(\"a[href]\")].map(t=>/^\\/([A-Za-z0-9_]{1,15})$/.exec(t.getAttribute(\"href\")??\"\")?.[1]).find(Z)??null}function st(e){let t=it(e);if(!t)return null;let n=ae(e),r=n.findIndex(i=>i.toLowerCase()===`@${t.toLowerCase()}`);return{handle:t,name:(r>0?n[0]:null)??t,avatar:U(e.querySelector(\"img\")?.getAttribute(\"src\")),verified:e.querySelector('[data-testid=\"icon-verified\"]')!==null,description:I(n.slice(r+1).filter(i=>!/^(Follow|Following|Follows you|Unfollow)$/.test(i)).join(\" \"),300)}}var Qe=e=>/\\b(posts?|tweets?)$/i.test(e)||/^[0-9][0-9.,]*[KMB]?$/i.test(e),nn=e=>e.length<=80&&/trending|^[^·]{1,40} · [^·]{1,40}$|^(sports|politics|entertainment|news|technology|business|music|gaming)$/i.test(e);function Oe(e){let t=ae(e).filter(o=>o!==\"\\xB7\"),n=t.find(nn)??\"\",r=t.filter(o=>o!==n),i=I(r.find(o=>!Qe(o))??\"\",200);return i?{context:n,name:i,meta:r.filter(o=>o!==i&&Qe(o)).join(\" \\xB7 \").slice(0,120)}:null}function Ne(e){let t=e.ownerDocument.location.pathname.split(\"/\")[1]??\"\",n=e.querySelector('[data-testid=\"UserName\"]'),r=ae(n);if(!n||!r.some(o=>o.toLowerCase()===`@${t.toLowerCase()}`))return null;let i=o=>U(e.querySelector(`a[href=\"/${t}/${o}\" i] img`)?.getAttribute(\"src\"));return{handle:t,name:r[0],verified:n.querySelector('[data-testid=\"icon-verified\"]')!==null,avatar:i(\"photo\"),banner:i(\"header_photo\"),description:I(e.querySelector('[data-testid=\"UserDescription\"]')?.textContent,1e3),details:I([...e.querySelector('[data-testid=\"UserProfileHeader_Items\"]')?.children??[]].map(o=>o.textContent?.trim()).filter(Boolean).join(\" \\xB7 \"),300),links:[...e.querySelectorAll(\"a[href]\")].filter(o=>new RegExp(`^/${t}/(following|followers|verified_followers)$`,\"i\").test(o.getAttribute(\"href\")??\"\")).slice(0,2).flatMap(o=>{let s=X(o.getAttribute(\"href\"),e.ownerDocument.location.href);return s?[{label:I(o.textContent,60),url:s}]:[]}),own:e.querySelector('[data-testid=\"editProfileButton\"]')!==null}}function at(e){let t=e.ownerDocument.defaultView?.innerWidth??0,n=[...e.querySelectorAll(\"img\")].filter(s=>{let c=U(s.getAttribute(\"src\"));return c&&new URL(c).pathname.startsWith(\"/media/\")}),r=t/2,i=n.find(s=>{let c=s.getBoundingClientRect();return c.width>0&&c.left<=r&&c.right>=r});if(!i)return null;let o=new URL(U(i.getAttribute(\"src\")));return o.searchParams.has(\"name\")&&o.searchParams.set(\"name\",\"large\"),{image:o.href,hasNext:n.some(s=>s.getBoundingClientRect().left>=t-2)}}var et=\"window.__INITIAL_STATE__=\";function rn(e){let t=[...e.scripts].find(n=>n.textContent?.startsWith(et));if(!t)return null;try{let n=t.textContent??\"\",r=n.indexOf(\";window.\"),i=JSON.parse(n.slice(et.length,r<0?void 0:r)),o=i.entities?.users?.entities?.[i.session?.user_id];return Z(o?.screen_name)&&typeof o.name==\"string\"?{handle:o.screen_name.toLowerCase(),name:o.name}:null}catch{return null}}function Me(e){let t=e.querySelector('[data-testid=\"AppTabBar_Profile_Link\"]')?.getAttribute(\"href\")?.match(/^\\/([A-Za-z0-9_]{1,15})$/)?.[1],n=rn(e);if(Z(t))return{handle:t.toLowerCase(),name:n?.handle===t.toLowerCase()?n.name:null};if(!n)return null;let r=e.querySelector('[data-testid=\"DashButton_ProfileIcon_Link\"]');return r?r.getAttribute(\"aria-label\")===`Profile menu ${n.name}`?n:null:e.querySelector('[data-testid=\"AppTabBar_Notifications_Link\"]')?n:null}function le(e){if(e.readyState!==\"loading\")return Xt(e)?null:Me(e)?.handle??void 0}function _e(e,t,n){if(typeof t!=\"boolean\")throw new Error(\"Needs a boolean\");if(!e?.matches(R))throw new Error(\"Not a post\");let r=Y(e);if(!r)throw new Error(\"This post has no clear identity\");let i=c=>P(c,`[data-testid=\"${n.off}\"]`).length>0;if(i(e)===t)return{satisfied:!0};let o=`a[href$=\"/status/${r.postId}\"] time`,s=`${R}:has(${o}):not(:has(div[role=\"link\"] ${o}))`;if(!P(e,`[data-testid=\"${t?n.on:n.off}\"]`).length)throw new Error(\"X shows no control for this here\");return{steps:[{click:`${s} [data-testid=\"${t?n.on:n.off}\"]`}],until:c=>{let u=[...c.querySelectorAll(R)].find(d=>Y(d)?.postId===r.postId);return u!==void 0&&i(u)===t}}}var F=\"main\",lt='[data-testid=\"emptyState\"]';function ue(e,t){if(e.readyState===\"loading\")return!1;let n=e.querySelector(F);if(!n)return!1;let r=tt(n);if(r)throw new Error(r);return n.querySelector(lt)?!0:typeof t==\"string\"?n.querySelector(t)!==null:t(n)}var ut={setLiked:(e,t)=>_e(e,t?.liked,{on:\"like\",off:\"unlike\"}),setBookmarked:(e,t)=>_e(e,t?.bookmarked,{on:\"bookmark\",off:\"removeBookmark\"})},Re=(e=se)=>V({root:F,items:e,key:ce,entityType:\"post\",read:rt,virtualized:!0,actions:ut}),de=z({root:lt,read:e=>I(e.textContent,200)||null}),ct=e=>{let t=e.querySelectorAll(`${F} :is(${se})`);return t.length?ce(t[t.length-1]):null};function Le(){let e=ct(document);return{steps:[{scroll:{target:\"window\",to:\"end\"}}],until:t=>ct(t)!==e,deadlineMs:1e4}}var dt={ready:e=>ue(e,se),requiresAccount:!0,regions:{timeline:Re(),empty:de},actions:{loadMore:Le}},ft={ready:e=>{let t=B(e.location.href)?.postId;return ue(e,n=>[...n.querySelectorAll(R)].some(r=>nt(r)===t))},regions:{thread:Re(R),empty:de}},on=new Set([\"home\",\"explore\",\"notifications\",\"messages\",\"settings\",\"i\",\"login\",\"logout\",\"signup\",\"tos\",\"privacy\",\"about\",\"download\",\"compose\",\"search\",\"jobs\",\"communities\",\"premium\",\"lists\",\"bookmarks\",\"account\"]),pt={ready:e=>{let t=e.location.pathname.split(\"/\")[1]??\"\";if(on.has(t.toLowerCase())||!/^[A-Za-z0-9_]{1,15}$/.test(t))throw new Error(\"This X page isn't a profile\");return ue(e,n=>Ne(n)!==null)},regions:{header:z({root:F,read:Ne}),posts:Re(),empty:de},actions:{loadMore:Le}};function sn(e){let t=e.querySelector(\"a[href]\")?.getAttribute(\"href\")??e.closest(\"a[href]\")?.getAttribute(\"href\"),n=Oe(e)?.name??I(e.textContent,300);return`t:${K(t??n)}`}var gt={ready:e=>ue(e,`${R}, [data-testid=\"trend\"], [data-testid=\"UserCell\"]`),regions:{trends:V({root:F,items:'[data-testid=\"trend\"]',key:sn,read:Oe}),people:V({root:F,items:'[data-testid=\"UserCell\"]',key:ot,read:st}),results:V({root:F,items:R,key:ce,entityType:\"post\",read:e=>Se(e),virtualized:!0,actions:ut}),empty:de},actions:{loadMore:Le}},mt={ready:e=>e.readyState!==\"loading\"&&e.querySelector('[data-testid=\"swipe-to-dismiss\"]')!==null,regions:{photos:z({root:'[data-testid=\"swipe-to-dismiss\"]',read:at,measure:!0})}},ht={ready:e=>le(e)!==void 0,requiresAccount:!0,regions:{handle:z({root:\"html\",read:e=>Me(e.ownerDocument)})}};var yt=Ie({account:le,signInUrl:\"/i/flow/login\",pages:{timeline:dt,post:ft,profile:pt,explore:gt,media:mt,account:ht}});Ee(yt);})();\n"},{"path":"assets/x.png","encoding":"base64","content":"iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAB6UlEQVR4nO3cQa7CMBRDUXbAhAn7XyisANSkyfN1nit59qW6Pgwo+u3j+Xp/El0e6gLdE4AA9E4AAtA7AQhA7wQgAL0TgAD0TgAC0DsBCEDvBCAAvROA0wD+HeqLXXU9AQjAHIAbQsU1lAO4IFR1lwDQESo7b/kW5IxQ3XXb11BHBEXHrfcBTgiqbttvxBwQlJ1K7oTJCOouAegAQEUgdCj9MY6EQBi/HICCQBlfAqBGII0vA1Ah0MaXAlQjEMeXA1QhUMcPQAD2I5DHxwDsQqCPjwJYjeAwPg5gFYLL+EiAuwhO42MBZhHcxkcDjCI4jo8HuIrw6+/U3dsAuH76LQBmEdSdjwIYRVB3PRJgBEHd81iAExGOBXBBsAKYOdSdjwG4c6i7BwDQ3xrg37DuCHiAK4M6I6ABRoZ0RcACzAzoiIAEuDOcGwIOYMVgTggogJVDuSAEIADrx3dCQADsHIaOIAeoGISMgPz39MpzqRFwD2gozqlEQD2ipDy3CgHzkB6hg6ITAqC6w1WE4wAIn/4RgIpu8iflFeOTEKTvilCOT0GQva5GPTwFQfLCJvXgJITyV5aph6YhlL60Tz3wKgQ8QBIAmwQgAL0TgAD0TgAC0DsBCEDvBCAAvROAAPROAALQOwEIQO98ASr29V3LMWMvAAAAAElFTkSuQmCC"},{"path":"foreground.css","encoding":"utf8","content":":root{color-scheme:light;--paper: #ffffff;--ink: #0f1419;--muted: #536471;--line: #eff3f4;--control-line: #cfd9de;--wash: #f7f9f9;--accent: #1d9bf0;--link: #0078b8;--accent-wash: #e8f5fd;--danger: #b42336;--like: #f91880;--repost: #00875a;--skeleton: #eff3f4;--font: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;--edge: 16px;--radius: 16px;--tabs: 64px}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--paper: #000000;--ink: #e7e9ea;--muted: #71767b;--line: #2f3336;--control-line: #536471;--wash: #16181c;--link: #1d9bf0;--accent-wash: #071e2d;--danger: #ff9aa5;--repost: #00ba7c;--skeleton: #202327}}@media(prefers-contrast:more){:root{--line: var(--muted);--control-line: var(--muted)}}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}html,body{background:var(--paper);color:var(--ink);font:15px/20px var(--font)}button,input,textarea{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}a{color:var(--link);text-decoration:none}a,button{overflow-wrap:anywhere}button{cursor:pointer}button:disabled{opacity:.5;cursor:default}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}svg.filled{fill:currentColor}.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.app{display:flex;flex-direction:column;height:100%}.content{flex:1;min-height:0}.screen{height:100%;overflow-y:auto;padding:8px var(--edge) 32px}.screen:before{content:\"\";float:right;width:44px;height:44px}.screen-title{font-size:20px;line-height:24px;font-weight:800;margin:12px 0 8px;overflow-wrap:anywhere}.section-title{font-size:17px;font-weight:800;margin:20px 0 4px}.post-meta{margin:0;color:var(--muted)}.grow{flex:1;min-width:0}.tabs{display:flex;flex:none;min-height:var(--tabs);background:var(--paper);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:56px;border:0;background:none;color:var(--muted);font-size:11px;line-height:13px}.tab[aria-current=page]{color:var(--ink);font-weight:700}.tab svg{width:24px;height:24px}.viewing .tabs{display:none}.primary,.secondary,.danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 18px;margin:8px 8px 0 0;border-radius:999px;font-weight:700}.primary{border:0;background:var(--ink);color:var(--paper)}.secondary{border:1px solid var(--control-line);background:var(--paper)}.danger{border:0;background:var(--danger);color:var(--paper)}.secondary svg,.primary svg{width:16px;height:16px}.text-button{min-height:44px;min-width:44px;padding:0 8px;border:0;background:none;color:var(--link);font-weight:700}.danger-text{color:var(--danger)}.icon-button{display:inline-grid;place-items:center;width:48px;height:48px;flex:none;border:0;border-radius:50%;background:none;color:inherit}.more{margin:16px 0 0}input:not([type=checkbox]){width:100%;min-height:44px;padding:10px 14px;border:1px solid var(--control-line);border-radius:999px;background:var(--paper)}input:not([type=checkbox]):focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 1px var(--accent)}.mode-tabs{display:flex;margin:0 calc(-1 * var(--edge));border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none}.mode-tab{flex:1 0 auto;min-height:53px;padding:0 16px;border:0;background:none;color:var(--muted);font-weight:500;position:relative}.mode-tab[aria-current=page]{color:var(--ink);font-weight:700}.mode-tab[aria-current=page]:after{content:\"\";position:absolute;left:50%;bottom:0;width:56px;height:4px;margin-left:-28px;border-radius:2px;background:var(--accent)}.chips{display:flex;gap:8px;overflow-x:auto;margin:4px 0;padding:8px 0;scrollbar-width:none}.chip{flex:none;min-height:36px;padding:0 14px;border:1px solid var(--control-line);border-radius:999px;background:var(--paper);font-weight:600}.chip[aria-pressed=true]{border-color:var(--ink);background:var(--ink);color:var(--paper)}.chip-count{margin-left:4px;opacity:.7;font-weight:400}.search-form{margin:4px 0 8px}.search-field{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border-radius:999px;background:var(--wash);color:var(--muted)}.search-field input,.search-field input:focus{min-height:42px;padding:0;border:0;border-radius:0;background:none;color:var(--ink);box-shadow:none}.search-field svg{width:18px;height:18px}.feed{margin:0 calc(-1 * var(--edge))}.post{padding:12px var(--edge);border-bottom:1px solid var(--line)}.post-context{display:flex;align-items:center;gap:8px;margin:0 0 4px 28px;color:var(--muted);font-size:13px;font-weight:700}.post-context svg{width:16px;height:16px}.post-context a{color:inherit}.post-grid{display:grid;grid-template-columns:40px minmax(0,1fr);gap:12px}.focus .post-grid{grid-template-columns:48px minmax(0,1fr)}.avatar{display:block;border-radius:50%;background:var(--skeleton);object-fit:cover}.avatar-button{padding:0;border:0;background:none;align-self:start;border-radius:50%}.post-body{min-width:0}.post-head{display:flex;align-items:center;flex-wrap:wrap;gap:0 4px;margin:0;min-width:0}.post-name{display:inline-flex;align-items:center;gap:2px;min-width:0;color:var(--ink)}.post-name strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.verified{width:18px;height:18px;fill:var(--accent);stroke:none}.verified .tick{fill:none;stroke:#fff;stroke-width:2}.post-content{cursor:pointer}.post-content.plain{display:block;width:100%;padding:0;border:0;background:none;text-align:left}.post-text{margin:2px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.post-text.large{font-size:20px;line-height:28px;margin-top:12px}.clamp{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}.show-more{color:var(--link)}.photos{display:grid;gap:2px;margin-top:12px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}.photos button{padding:0;border:0;background:var(--skeleton);min-height:0}.photos img{display:block;width:100%;height:100%;object-fit:cover}.photos.n1 img{max-height:510px;height:auto}.photos.n2,.photos.n3,.photos.n4{grid-template-columns:1fr 1fr;aspect-ratio:16 / 9}.photos.n3 button:first-child{grid-row:span 2}.photos.n2 button,.photos.n3 button,.photos.n4 button{overflow:hidden}.video-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;aspect-ratio:16 / 9;margin-top:12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--wash);font-weight:700}.video-tile svg{width:14px;height:14px;vertical-align:-2px}.quote{display:block;width:100%;margin-top:12px;padding:12px;border:1px solid var(--control-line);border-radius:var(--radius);background:none;text-align:left}.quote-text{display:block;margin-top:2px;white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden}.focus-time{padding:16px 0;border-bottom:1px solid var(--line)}.actions-bar{display:flex;justify-content:space-between;margin:4px -8px -4px;max-width:440px}.action{display:inline-flex;align-items:center;gap:4px;min-width:40px;min-height:40px;padding:0 6px;white-space:nowrap;border:0;background:none;color:var(--muted);font-size:13px}.action svg{width:18px;height:18px}.action.liked{color:var(--like)}.action.reposted{color:var(--repost)}.action.bookmarked{color:var(--accent)}.thread .post:not(:last-child){border-bottom:0}.notification{display:flex;flex-direction:column;gap:8px;width:100%;padding:12px var(--edge) 12px 68px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.notice-avatars{display:flex;gap:4px}.notice-text{overflow-wrap:anywhere}.trend,.person{display:flex;flex-direction:column;align-items:flex-start;width:calc(100% + 2 * var(--edge));margin:0 calc(-1 * var(--edge));padding:12px var(--edge);border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.trend strong{font-size:15px}.trend .post-meta{font-size:13px}.person{flex-direction:row;gap:12px}.person-body{display:flex;flex-direction:column;min-width:0}.person-bio{margin-top:4px;overflow-wrap:anywhere}.profile-screen{padding-top:0}.profile-screen:before{display:none}.profile{margin:0 calc(-1 * var(--edge));padding:0 var(--edge) 12px}.banner{margin:0 calc(-1 * var(--edge));aspect-ratio:3 / 1;background:var(--control-line);overflow:hidden}.banner img{display:block;width:100%;height:100%;object-fit:cover}.profile-top{display:flex;align-items:flex-end;justify-content:space-between;margin-top:-40px}.profile-top .avatar{border:4px solid var(--paper);box-sizing:content-box}.profile-name{display:flex;align-items:center;gap:2px;margin:8px 0 0;font-size:20px;line-height:24px;font-weight:800;overflow-wrap:anywhere}.profile .post-text,.profile .post-meta{margin-top:8px}.profile-links{display:flex;flex-wrap:wrap;gap:4px 16px;margin:8px 0 0}.profile-links a{display:inline-flex;align-items:center;min-height:32px}.media-viewer{position:fixed;inset:0;z-index:1;display:flex;flex-direction:column;background:#000;color:#fff}.media-close{position:absolute;top:8px;left:8px;z-index:1;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:#0009;color:#fff}.media-stage{flex:1;min-height:0;display:grid;place-items:center}.media-stage img{max-width:100%;max-height:100%;object-fit:contain}.media-message{margin:0;padding:16px;text-align:center}.media-message .secondary{background:none;color:#fff;border-color:#536471}.media-nav{display:flex;align-items:center;justify-content:center;gap:24px;padding:8px 0 calc(8px + env(safe-area-inset-bottom))}.saved-post .post-head{margin-bottom:2px}.pills{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px}.pill{padding:2px 10px;border-radius:999px;background:var(--accent-wash);color:var(--link);font-size:13px;font-weight:600}.pills .text-button{min-height:36px;margin-left:auto}.category-list{margin-top:8px}.category{padding:8px 0;border-top:1px solid var(--line)}.category-head{display:flex;align-items:center;gap:4px}.card{margin:12px 0;padding:12px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--paper)}.card .post-text{margin-top:4px}.card .post-meta{margin-top:8px;font-size:13px}fieldset{min-width:0}fieldset.card legend{padding:0 4px;font-weight:800}.check{display:flex;align-items:center;gap:12px;min-height:48px}.check input{width:22px;height:22px;accent-color:var(--accent)}.row{display:flex;align-items:center;gap:8px;margin-top:8px}.row .primary,.row .secondary{margin:0}.actions{display:flex;flex-wrap:wrap;align-items:center;margin-top:4px}.notice{margin:24px 0;padding:20px;border:1px solid var(--line);border-radius:var(--radius)}.notice h2{margin:0 0 6px;font-size:20px;line-height:24px;font-weight:800}.notice p{margin:0;color:var(--muted)}.inline-error,.field-error{color:var(--danger)}.status{padding:10px 12px;border-radius:12px;background:var(--wash)}.confirm{margin:12px 0;padding:12px 14px;border:1px solid var(--danger);border-radius:var(--radius)}.confirm p{margin:0}.skeleton{padding-top:8px}.skeleton-row{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}.skeleton-row>div{flex:1}.skeleton-avatar{width:40px;height:40px;flex:none;border-radius:50%;background:var(--skeleton)}.skeleton-row span:not(.skeleton-avatar){display:block;height:12px;border-radius:4px;background:var(--skeleton)}.skeleton-row span+span{width:80%;margin-top:8px}.skeleton-row span+span+span{width:45%}.skeleton.text .skeleton-row{border-bottom:0;padding:8px 0}\n"},{"path":"foreground.js","encoding":"utf8","content":"\"use strict\";(()=>{var h0=Object.create;var Jf=Object.defineProperty;var y0=Object.getOwnPropertyDescriptor;var b0=Object.getOwnPropertyNames;var S0=Object.getPrototypeOf,T0=Object.prototype.hasOwnProperty;var Ft=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var N0=(e,t,n,l)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let a of b0(t))!T0.call(e,a)&&a!==n&&Jf(e,a,{get:()=>t[a],enumerable:!(l=y0(t,a))||l.enumerable});return e};var L=(e,t,n)=>(n=e!=null?h0(S0(e)):{},N0(t||!e||!e.__esModule?Jf(n,\"default\",{value:e,enumerable:!0}):n,e));var Nd=Ft(D=>{\"use strict\";var _c=Symbol.for(\"react.transitional.element\"),Z0=Symbol.for(\"react.portal\"),K0=Symbol.for(\"react.fragment\"),J0=Symbol.for(\"react.strict_mode\"),I0=Symbol.for(\"react.profiler\"),$0=Symbol.for(\"react.consumer\"),F0=Symbol.for(\"react.context\"),W0=Symbol.for(\"react.forward_ref\"),P0=Symbol.for(\"react.suspense\"),ey=Symbol.for(\"react.memo\"),gd=Symbol.for(\"react.lazy\"),ty=Symbol.for(\"react.activity\"),ny=Symbol.for(\"react.view_transition\"),sd=Symbol.iterator;function ly(e){return e===null||typeof e!=\"object\"?null:(e=sd&&e[sd]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var pd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vd=Object.assign,hd={};function Il(e,t,n){this.props=e,this.context=t,this.refs=hd,this.updater=n||pd}Il.prototype.isReactComponent={};Il.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};Il.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function yd(){}yd.prototype=Il.prototype;function Mc(e,t,n){this.props=e,this.context=t,this.refs=hd,this.updater=n||pd}var zc=Mc.prototype=new yd;zc.constructor=Mc;vd(zc,Il.prototype);zc.isPureReactComponent=!0;var fd=Array.isArray;function Ac(){}var oe={H:null,A:null,T:null,S:null},bd=Object.prototype.hasOwnProperty;function wc(e,t,n){var l=n.ref;return{$$typeof:_c,type:e,key:t,ref:l!==void 0?l:null,props:n}}function ay(e,t){return wc(e.type,t,e.props)}function Cc(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===_c}function uy(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(n){return t[n]})}var dd=/\\/+/g;function Oc(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?uy(\"\"+e.key):t.toString(36)}function iy(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(Ac,Ac):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function Jl(e,t,n,l,a){var u=typeof e;(u===\"undefined\"||u===\"boolean\")&&(e=null);var i=!1;if(e===null)i=!0;else switch(u){case\"bigint\":case\"string\":case\"number\":i=!0;break;case\"object\":switch(e.$$typeof){case _c:case Z0:i=!0;break;case gd:return i=e._init,Jl(i(e._payload),t,n,l,a)}}if(i)return a=a(e),i=l===\"\"?\".\"+Oc(e,0):l,fd(a)?(n=\"\",i!=null&&(n=i.replace(dd,\"$&/\")+\"/\"),Jl(a,t,n,\"\",function(f){return f})):a!=null&&(Cc(a)&&(a=ay(a,n+(a.key==null||e&&e.key===a.key?\"\":(\"\"+a.key).replace(dd,\"$&/\")+\"/\")+i)),t.push(a)),1;i=0;var o=l===\"\"?\".\":l+\":\";if(fd(e))for(var c=0;c{\"use strict\";Ed.exports=Nd()});var Dd=Ft(de=>{\"use strict\";function Hc(e,t){var n=e.length;e.push(t);e:for(;0>>1,a=e[l];if(0>>1;lgi(o,n))cgi(f,o)?(e[l]=f,e[c]=n,l=c):(e[l]=o,e[i]=n,l=i);else if(cgi(f,n))e[l]=f,e[c]=n,l=c;else break e}}return t}function gi(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}de.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(xd=performance,de.unstable_now=function(){return xd.now()}):(Rc=Date,Od=Rc.now(),de.unstable_now=function(){return Rc.now()-Od});var xd,Rc,Od,bn=[],qn=[],ry=1,At=null,Ve=3,Lc=!1,tu=!1,nu=!1,qc=!1,Md=typeof setTimeout==\"function\"?setTimeout:null,zd=typeof clearTimeout==\"function\"?clearTimeout:null,Ad=typeof setImmediate<\"u\"?setImmediate:null;function pi(e){for(var t=Wt(qn);t!==null;){if(t.callback===null)vi(qn);else if(t.startTime<=e)vi(qn),t.sortIndex=t.expirationTime,Hc(bn,t);else break;t=Wt(qn)}}function Gc(e){if(nu=!1,pi(e),!tu)if(Wt(bn)!==null)tu=!0,Fl||(Fl=!0,$l());else{var t=Wt(qn);t!==null&&Bc(Gc,t.startTime-e)}}var Fl=!1,lu=-1,wd=5,Cd=-1;function Rd(){return qc?!0:!(de.unstable_now()-Cde&&Rd());){var l=At.callback;if(typeof l==\"function\"){At.callback=null,Ve=At.priorityLevel;var a=l(At.expirationTime<=e);if(e=de.unstable_now(),typeof a==\"function\"){At.callback=a,pi(e),t=!0;break t}At===Wt(bn)&&vi(bn),pi(e)}else vi(bn);At=Wt(bn)}if(At!==null)t=!0;else{var u=Wt(qn);u!==null&&Bc(Gc,u.startTime-e),t=!1}}break e}finally{At=null,Ve=n,Lc=!1}t=void 0}}finally{t?$l():Fl=!1}}}var $l;typeof Ad==\"function\"?$l=function(){Ad(Dc)}:typeof MessageChannel<\"u\"?(Uc=new MessageChannel,_d=Uc.port2,Uc.port1.onmessage=Dc,$l=function(){_d.postMessage(null)}):$l=function(){Md(Dc,0)};var Uc,_d;function Bc(e,t){lu=Md(function(){e(de.unstable_now())},t)}de.unstable_IdlePriority=5;de.unstable_ImmediatePriority=1;de.unstable_LowPriority=4;de.unstable_NormalPriority=3;de.unstable_Profiling=null;de.unstable_UserBlockingPriority=2;de.unstable_cancelCallback=function(e){e.callback=null};de.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=n,Hc(qn,e),Wt(bn)===null&&e===Wt(qn)&&(nu?(zd(lu),lu=-1):nu=!0,Bc(Gc,n-l))):(e.sortIndex=a,Hc(bn,e),tu||Lc||(tu=!0,Fl||(Fl=!0,$l()))),e};de.unstable_shouldYield=Rd;de.unstable_wrapCallback=function(e){var t=Ve;return function(){var n=Ve;Ve=t;try{return e.apply(this,arguments)}finally{Ve=n}}}});var Hd=Ft((uT,Ud)=>{\"use strict\";Ud.exports=Dd()});var Gd=Ft(je=>{\"use strict\";var sy=et();function qd(e){var t=\"https://react.dev/errors/\"+e;if(1{\"use strict\";function Bd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bd)}catch(e){console.error(e)}}Bd(),kd.exports=Gd()});var _h=Ft(Po=>{\"use strict\";var _e=Hd(),Ag=et(),gy=Yd();function T(e){var t=\"https://react.dev/errors/\"+e;if(1ia||(e.current=Or[ia],Or[ia]=null,ia--)}function se(e,t){ia++,Or[ia]=e.current,e.current=t}var rn=dn(null),zu=dn(null),Fn=dn(null),ao=dn(null);function uo(e,t){switch(se(Fn,t),se(zu,e),se(rn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ug(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ug(t),e=nh(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}Ge(rn),se(rn,e)}function Aa(){Ge(rn),Ge(zu),Ge(Fn)}function Ar(e){var t=e.memoizedState;t!==null&&(La._currentValue=t.memoizedState,se(ao,e)),t=rn.current;var n=nh(t,e.type);t!==n&&(se(zu,e),se(rn,n))}function io(e){zu.current===e&&(Ge(rn),Ge(zu)),ao.current===e&&(Ge(ao),La._currentValue=Ol)}var kc,Zd;function kn(e){if(kc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);kc=t&&t[1]||\"\",Zd=-1)\":-1a||c[l]!==f[a]){var d=`\n`+c[l].replace(\" at new \",\" at \");return e.displayName&&d.includes(\"\")&&(d=d.replace(\"\",e.displayName)),d}while(1<=l&&0<=a);break}}}finally{Yc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?kn(n):\"\"}function Ey(e,t){switch(e.tag){case 26:case 27:case 5:return kn(e.type);case 16:return kn(\"Lazy\");case 13:return e.child!==t&&t!==null?kn(\"Suspense Fallback\"):kn(\"Suspense\");case 19:return kn(\"SuspenseList\");case 0:case 15:return Vc(e.type,!1);case 11:return Vc(e.type.render,!1);case 1:return Vc(e.type,!0);case 31:return kn(\"Activity\");case 30:return kn(\"ViewTransition\");default:return\"\"}}function Kd(e){try{var t=\"\",n=null;do t+=Ey(e,n),n=e,e=e.return;while(e);return t}catch(l){return`\nError generating stack: `+l.message+`\n`+l.stack}}var _r=Object.prototype.hasOwnProperty,ws=_e.unstable_scheduleCallback,jc=_e.unstable_cancelCallback,xy=_e.unstable_shouldYield,Oy=_e.unstable_requestPaint,vt=_e.unstable_now,Ay=_e.unstable_getCurrentPriorityLevel,Hg=_e.unstable_ImmediatePriority,Lg=_e.unstable_UserBlockingPriority,oo=_e.unstable_NormalPriority,_y=_e.unstable_LowPriority,qg=_e.unstable_IdlePriority,My=_e.log,zy=_e.unstable_setDisableYieldValue,Zu=null,ht=null;function Qn(e){if(typeof My==\"function\"&&zy(e),ht&&typeof ht.setStrictMode==\"function\")try{ht.setStrictMode(Zu,e)}catch{}}var yt=Math.clz32?Math.clz32:Ry,wy=Math.log,Cy=Math.LN2;function Ry(e){return e>>>=0,e===0?32:31-(wy(e)/Cy|0)|0}var bi=256,Si=262144,Ti=4194304;function Sl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Uo(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,u=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~u,l!==0?a=Sl(l):(i&=o,i!==0?a=Sl(i):n||(n=o&~e,n!==0&&(a=Sl(n))))):(o=l&~u,o!==0?a=Sl(o):i!==0?a=Sl(i):n||(n=l&~e,n!==0&&(a=Sl(n)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:a}function Ku(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Gg(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Ju(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Uy(e,t,n,l,a,u){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,f=e.hiddenUpdates;for(n=i&~n;0\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),Cr=!1;if(An)try{Wl={},Object.defineProperty(Wl,\"passive\",{get:function(){Cr=!0}}),window.addEventListener(\"test\",Wl,Wl),window.removeEventListener(\"test\",Wl,Wl)}catch{Cr=!1}var Wl,Zn=null,Hs=null,Yi=null;function ep(){if(Yi)return Yi;var e,t=Hs,n=t.length,l,a=\"value\"in Zn?Zn.value:Zn.textContent,u=a.length;for(e=0;e=vu),im=\" \",om=!1;function np(e,t){switch(e){case\"keyup\":return v1.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function lp(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var ca=!1;function y1(e,t){switch(e){case\"compositionend\":return lp(t);case\"keypress\":return t.which!==32?null:(om=!0,im);case\"textInput\":return e=t.data,e===im&&om?null:e;default:return null}}function b1(e,t){if(ca)return e===\"compositionend\"||!qs&&np(e,t)?(e=ep(),Yi=Hs=Zn=null,ca=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function fm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dm(e,t){var n=fm(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fm(n)}}function op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?op(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rr(e.document)}return t}function Gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var _1=An&&\"documentMode\"in document&&11>=document.documentMode,ra=null,Dr=null,yu=null,Ur=!1;function mm(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ur||ra==null||ra!==Rr(l)||(l=ra,\"selectionStart\"in l&&Gs(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),yu&&Ru(yu,l)||(yu=l,l=Co(Dr,\"onSelect\"),0>=i,a-=i,on=1<<32-yt(t)+a|n<z?(fe=A,A=null):fe=A.sibling;var G=r(p,A,h[z],b);if(G===null){A===null&&(A=fe);break}e&&A&&G.alternate===null&&t(p,A),m=u(G,m,z),M===null?N=G:M.sibling=G,M=G,A=fe}if(z===h.length)return n(p,A),q&&Nn(p,z),N;if(A===null){for(;zz?(fe=A,A=null):fe=A.sibling;var rt=r(p,A,G.value,b);if(rt===null){A===null&&(A=fe);break}e&&A&&rt.alternate===null&&t(p,A),m=u(rt,m,z),M===null?N=rt:M.sibling=rt,M=rt,A=fe}if(G.done)return n(p,A),q&&Nn(p,z),N;if(A===null){for(;!G.done;z++,G=h.next())G=g(p,G.value,b),G!==null&&(m=u(G,m,z),M===null?N=G:M.sibling=G,M=G);return q&&Nn(p,z),N}for(A=l(A);!G.done;z++,G=h.next())G=s(A,p,z,G.value,b),G!==null&&(e&&(fe=G.alternate,fe!==null&&A.delete(fe.key===null?z:fe.key)),m=u(G,m,z),M===null?N=G:M.sibling=G,M=G);return e&&A.forEach(function($){return t(p,$)}),q&&Nn(p,z),N}function x(p,m,h,b){if(typeof h==\"object\"&&h!==null&&h.type===ua&&h.key===null&&h.props.ref===void 0&&(h=h.props.children),typeof h==\"object\"&&h!==null){switch(h.$$typeof){case yi:e:{for(var N=h.key;m!==null;){if(m.key===N){if(N=h.type,N===ua){if(m.tag===7){n(p,m.sibling),b=a(m,h.props.children),Bn(b,h),b.return=p,p=b;break e}}else if(m.elementType===N||typeof N==\"object\"&&N!==null&&N.$$typeof===Vn&&Tl(N)===m.type){n(p,m.sibling),b=a(m,h.props),Bn(b,h),b.return=p,p=b;break e}n(p,m);break}else t(p,m);m=m.sibling}h.type===ua?(b=Al(h.props.children,p.mode,b,h.key),Bn(b,h),b.return=p,p=b):(b=ji(h.type,h.key,h.props,null,p.mode,b),Bn(b,h),b.return=p,p=b)}return i(p);case fu:e:{for(N=h.key;m!==null;){if(m.key===N)if(m.tag===4&&m.stateNode.containerInfo===h.containerInfo&&m.stateNode.implementation===h.implementation){n(p,m.sibling),b=a(m,h.children||[]),b.return=p,p=b;break e}else{n(p,m);break}else t(p,m);m=m.sibling}b=Pc(h,p.mode,b),b.return=p,p=b}return i(p);case Vn:return h=Tl(h),x(p,m,h,b)}if(du(h))return y(p,m,h,b);if(uu(h)){if(N=uu(h),typeof N!=\"function\")throw Error(T(150));return h=N.call(h),S(p,m,h,b)}if(typeof h.then==\"function\")return x(p,m,_i(h),b);if(h.$$typeof===an)return x(p,m,Ai(p,h),b);Mi(p,h)}return typeof h==\"string\"&&h!==\"\"||typeof h==\"number\"||typeof h==\"bigint\"?(h=\"\"+h,m!==null&&m.tag===6?(n(p,m.sibling),b=a(m,h),b.return=p,p=b):(n(p,m),b=Wc(h,p.mode,b),b.return=p,p=b),i(p)):n(p,m)}return function(p,m,h,b){try{Hu=0;var N=x(p,m,h,b);return Sa=null,N}catch(A){if(A===Ya||A===Vo)throw A;var M=at(29,A,null,p.mode);return M.lanes=b,M.return=p,M}}}var Ul=Ep(!0),xp=Ep(!1),jn=!1;function Zs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Pn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function el(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(F&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=so(e),pp(e,null,n),t}return ko(e,l,t,n),so(e)}function Su(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Yg(e,n)}}function tr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?a=u=i:u=u.next=i,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Yr=!1;function Tu(){if(Yr){var e=ba;if(e!==null)throw e}}function Nu(e,t,n,l){Yr=!1;var a=e.updateQueue;jn=!1;var u=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,f=c.next;c.next=null,i===null?u=f:i.next=f,i=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==i&&(o===null?d.firstBaseUpdate=f:o.next=f,d.lastBaseUpdate=c))}if(u!==null){var g=a.baseState;i=0,d=f=c=null,o=u;do{var r=o.lane&-536870913,s=r!==o.lane;if(s?(V&r)===r:(l&r)===r){r!==0&&r===Dl&&(Yr=!0),d!==null&&(d=d.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var y=e,S=o;r=t;var x=n;switch(S.tag){case 1:if(y=S.payload,typeof y==\"function\"){g=y.call(x,g,r);break e}g=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=S.payload,r=typeof y==\"function\"?y.call(x,g,r):y,r==null)break e;g=ie({},g,r);break e;case 2:jn=!0}}r=o.callback,r!==null&&(e.flags|=64,s&&(e.flags|=8192),s=a.callbacks,s===null?a.callbacks=[r]:s.push(r))}else s={lane:r,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(f=d=s,c=g):d=d.next=s,i|=r;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;s=o,o=s.next,s.next=null,a.lastBaseUpdate=s,a.shared.pending=null}}while(!0);d===null&&(c=g),a.baseState=c,a.firstBaseUpdate=f,a.lastBaseUpdate=d,u===null&&(a.shared.lanes=0),fl|=i,e.lanes=i,e.memoizedState=g}}function Op(e,t){if(typeof e!=\"function\")throw Error(T(191,e));e.call(t)}function Ap(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eu?u:8;var i=C.T,o={};o.types=i!==null?i.types:null,C.T=o,of(e,!1,t,n);try{var c=a(),f=C.S;if(f!==null&&f(o,c),c!==null&&typeof c==\"object\"&&typeof c.then==\"function\"){var d=G1(c,l);Eu(e,t,d,bt(e))}else Eu(e,t,l,bt(e))}catch(g){Eu(e,t,{then:function(){},status:\"rejected\",reason:g},bt())}finally{W.p=u,i!==null&&o.types!==null&&(i.types=o.types),C.T=i}}function X1(){}function Zr(e,t,n,l){if(e.tag!==5)throw Error(T(476));var a=Fp(e).queue;$p(e,a,t,Ol,n===null?X1:function(){return Wp(e),n(l)})}function Fp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ol,baseState:Ol,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:Ol},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wp(e){var t=Fp(e);t.next===null&&(t=e.alternate.memoizedState),Eu(e,t.next.queue,{},bt())}function uf(){return qe(La)}function Pp(){return be().memoizedState}function ev(){return be().memoizedState}function Q1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=bt();e=Pn(n);var l=el(t,e,n);l!==null&&(ut(l,t,n),Su(l,t,n)),t={cache:js()},e.payload=t;return}t=t.return}}function Z1(e,t,n){var l=bt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Zo(e)?nv(t,n):(n=ks(e,t,n,l),n!==null&&(ut(n,e,l),lv(n,t,l)))}function tv(e,t,n){var l=bt();Eu(e,t,n,l)}function Eu(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zo(e))nv(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,o=u(i,n);if(a.hasEagerState=!0,a.eagerState=o,St(o,i))return ko(e,t,a,0),ue===null&&Bo(),!1}catch{}if(n=ks(e,t,a,l),n!==null)return ut(n,e,l),lv(n,t,l),!0}return!1}function of(e,t,n,l){if(l={lane:2,revertLane:yf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Zo(e)){if(t)throw Error(T(479))}else t=ks(e,n,l,2),t!==null&&ut(t,e,2)}function Zo(e){var t=e.alternate;return e===H||t!==null&&t===H}function nv(e,t){Ta=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lv(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Yg(e,n)}}var So={readContext:qe,use:Xo,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useLayoutEffect:he,useInsertionEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useSyncExternalStore:he,useId:he,useHostTransitionStatus:he,useFormState:he,useActionState:he,useOptimistic:he,useMemoCache:he,useCacheRefresh:he,useEffectEvent:he},av={readContext:qe,use:Xo,useCallback:function(e,t){return Fe().memoizedState=[e,t===void 0?null:t],e},useContext:qe,useEffect:zm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ki(4194308,4,Qp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ki(4194308,4,e,t)},useInsertionEffect:function(e,t){Ki(4,2,e,t)},useMemo:function(e,t){var n=Fe();t=t===void 0?null:t;var l=e();if(Hl){Qn(!0);try{e()}finally{Qn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Fe();if(n!==void 0){var a=n(t);if(Hl){Qn(!0);try{n(t)}finally{Qn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Z1.bind(null,H,e),[l.memoizedState,e]},useRef:function(e){var t=Fe();return e={current:e},t.memoizedState=e},useState:function(e){e=Xr(e);var t=e.queue,n=tv.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:lf,useDeferredValue:function(e,t){var n=Fe();return af(n,e,t)},useTransition:function(){var e=Xr(!1);return e=$p.bind(null,H,e.queue,!0,!1),Fe().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=H,a=Fe();if(q){if(n===void 0)throw Error(T(407));n=n()}else{if(n=t(),ue===null)throw Error(T(349));(V&127)!==0||Cp(l,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,zm(Dp.bind(null,l,u,e),[e]),l.flags|=2048,za(9,{destroy:void 0},Rp.bind(null,l,u,n,t),null),n},useId:function(){var e=Fe(),t=ue.identifierPrefix;if(q){var n=cn,l=on;n=(l&~(1<<32-yt(l)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=bo++,0<\\/script>\",u=u.removeChild(u.firstChild);break;case\"select\":u=typeof l.is==\"string\"?i.createElement(\"select\",{is:l.is}):i.createElement(\"select\"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is==\"string\"?i.createElement(a,{is:l.is}):i.createElement(a)}}u[Le]=t,u[ot]=l;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=u;e:switch(ke(u,a,l),a){case\"button\":case\"input\":case\"select\":case\"textarea\":l=!!l.autoFocus;break e;case\"img\":l=!0;break e;default:l=!1}l&&Tn(t)}}return ce(t),t.subtreeFlags&=-33554433,ur(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Tn(t);else{if(typeof l!=\"string\"&&t.stateNode===null)throw Error(T(166));if(e=Fn.current,Pl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Ce,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Le]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||th(e.nodeValue,n)),e||cl(t,!0)}else e=ku(e).createTextNode(l),e[Le]=t,t.stateNode=e}return ce(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Pl(t),n!==null){if(e===null){if(!l)throw Error(T(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(557));e[Le]=t}else wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ce(t),e=!1}else n=er(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(mt(t),t):(mt(t),null);if((t.flags&128)!==0)throw Error(T(558))}return ce(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Pl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(T(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(T(317));a[Le]=t}else wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ce(t),a=!1}else a=er(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(mt(t),t):(mt(t),null)}return mt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ci(t,t.updateQueue),ce(t),null);case 4:return Aa(),e===null&&bf(t.stateNode.containerInfo),t.flags|=67108864,ce(t),null;case 10:return On(t.type),ce(t),null;case 19:if(Js(t),l=t.memoizedState,l===null)return ce(t),null;if(a=(t.flags&128)!==0,u=l.rendering,u===null)if(a)ou(l,!1);else{if(ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=ho(e),u!==null){for(t.flags|=128,ou(l,!1),e=u.updateQueue,t.updateQueue=e,Ci(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vp(n,e),n=n.sibling;return Lu(t,Be.current&1|2),q&&Nn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&vt()>_o&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304)}else{if(!a)if(e=ho(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ci(t,e),ou(l,!0),l.tail===null&&l.tailMode!==\"collapsed\"&&l.tailMode!==\"visible\"&&!u.alternate&&!q)return ce(t),null}else 2*vt()-l.renderingStartTime>_o&&n!==536870912&&(t.flags|=128,a=!0,ou(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=vt(),e.sibling=null,u=Be.current,u=a?u&1|2:u&1,l.tailMode===\"visible\"||l.tailMode===\"collapsed\"||!n||q?Lu(t,u):(n=u,se(Ye,t),se(Be,n),Xe===null&&(Xe=t)),q&&Nn(t,l.treeForkCount),e}return ce(t),null;case 22:case 23:return mt(t),Ks(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(ce(t),t.subtreeFlags&6&&(t.flags|=8192)):ce(t),n=t.updateQueue,n!==null&&Ci(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Ge(_l),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),On(Ne),ce(t),null;case 25:return null;case 30:return t.flags|=33554432,ce(t),null}throw Error(T(156,t.tag))}function P1(e,t){switch(Vs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return On(Ne),Aa(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return io(t),null;case 31:if(t.memoizedState!==null){if(mt(t),t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Js(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Aa(),null;case 10:return On(t.type),null;case 22:case 23:return mt(t),Ks(),e!==null&&Ge(_l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return On(Ne),null;case 25:return null;default:return null}}function pv(e,t){switch(Vs(t),t.tag){case 3:On(Ne),Aa();break;case 26:case 27:case 5:io(t);break;case 4:Aa();break;case 31:t.memoizedState!==null&&mt(t);break;case 13:mt(t);break;case 19:Js(t);break;case 10:On(t.type);break;case 22:case 23:mt(t),Ks(),e!==null&&Ge(_l);break;case 24:On(Ne)}}function Pu(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var u=n.create,i=n.inst;l=u(),i.destroy=l}n=n.next}while(n!==a)}}catch(o){ne(t,t.return,o)}}function sl(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var u=a.next;l=u;do{if((l.tag&e)===e){var i=l.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,a=t;var c=n,f=o;try{f()}catch(d){ne(a,c,d)}}}l=l.next}while(l!==u)}}catch(d){ne(t,t.return,d)}}function vv(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ap(t,n)}catch(l){ne(e,e.return,l)}}}function hv(e,t,n){n.props=Ll(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){ne(e,t,l)}}function nn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var a=e.stateNode,u=_n(e.memoizedProps,a);(a.ref===null||a.ref.name!==u)&&(a.ref=oh(u)),l=a.ref;break;case 7:if(e.stateNode===null){var i=new Tt(e);it(e.child,!1,Yb,i,void 0,void 0),e.stateNode=i}l=e.stateNode;break;default:l=e.stateNode}typeof n==\"function\"?e.refCleanup=n(l):n.current=l}}catch(o){ne(e,t,o)}}function He(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l==\"function\")try{l()}catch(a){ne(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(a){ne(e,t,a)}else n.current=null}function No(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title\"))),ke(l,t,n),l[Le]=e,we(l),t=l;break e;case\"link\":if(u=hg(\"link\",\"href\",a).get(t+(n.href||\"\"))){for(i=0;ix&&(i=x,x=S,S=i);var p=dm(o,S),m=dm(o,x);if(p&&m&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==m.node||s.focusOffset!==m.offset)){var h=g.createRange();h.setStart(p.node,p.offset),s.removeAllRanges(),S>x?(s.addRange(h),s.extend(m.node,m.offset)):(h.setEnd(m.node,m.offset),s.addRange(h))}}}}for(g=[],s=o;s=s.parentNode;)s.nodeType===1&&g.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof o.focus==\"function\"&&o.focus(),o=0;on?32:n,C.T=null,n=fs,fs=null;var u=Xt,i=sn;if(pe=0,ql=Xt=null,sn=0,(F&6)!==0)throw Error(T(331));var o=F;if(F|=4,Lv(u.current),Dv(u,u.current,i,n),F=o,ei(0,!1),ht&&typeof ht.onPostCommitFiberRoot==\"function\")try{ht.onPostCommitFiberRoot(Zu,u)}catch{}return!0}finally{W.p=a,C.T=l,Jv(e,t)}}function Fm(e,t,n){t=Rt(n,t),t=Jr(e.stateNode,t,2),e=el(e,t,2),e!==null&&(Ju(e,2),mn(e))}function ne(e,t,n){if(e.tag===3)Fm(e,e,n);else for(;t!==null;){if(t.tag===3){Fm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof l.componentDidCatch==\"function\"&&(ll===null||!ll.has(l))){e=Rt(n,e),n=rv(2),l=el(t,n,2),l!==null&&(sv(n,l,t,e),Ju(l,2),mn(l));break}}t=t.return}}function sr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new lb;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(vf=!0,a.add(n),e=fb.bind(null,e,t,n),t.then(e,e))}function fb(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ue===e&&(V&n)===n&&((ye===4||ye===3&&(V&62914560)===V&&300>vt()-Jo)&&(F&2)===0?Ra(e,0):Ao|=n,wa===V&&(wa=0)),mn(e)}function Iv(e,t){t===0&&(t=Bg()),e=Yl(e,t),e!==null&&(Ju(e,t),mn(e))}function db(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Iv(e,n)}function mb(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(T(314))}l!==null&&l.delete(t),Iv(e,n)}function gb(e,t){return ws(e,t)}var Da=null,la=null,vs=!1,wo=!1,fr=!1,$n=0;function mn(e){e!==la&&e.next===null&&(la===null?Da=la=e:la=la.next=e),wo=!0,vs||(vs=!0,vb())}function ei(e,t){if(!fr&&wo){fr=!0;do for(var n=!1,l=Da;l!==null;){if(!t)if(e!==0){var a=l.pendingLanes;if(a===0)var u=0;else{var i=l.suspendedLanes,o=l.pingedLanes;u=(1<<31-yt(42|e)+1)-1,u&=a&~(i&~o),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Wm(l,u))}else u=V,u=Uo(l,l===ue?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Ku(l,u)||(n=!0,Wm(l,u));l=l.next}while(n);fr=!1}}function pb(){$v()}function $v(){wo=vs=!1;var e=0;$n!==0&&Ob()&&(e=$n);for(var t=vt(),n=null,l=Da;l!==null;){var a=l.next,u=Fv(l,t);u===0?(l.next=null,n===null?Da=a:n.next=a,a===null&&(la=n)):(n=l,(e!==0||(u&3)!==0)&&(wo=!0)),l=a}pe!==0&&pe!==5||ei(e,!1),$n!==0&&($n=0)}function Fv(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0o)break;var d=c.transferSize,g=c.initiatorType;d&&ag(g)&&(c=c.responseEnd,i+=d*(cto){S.length=y;break}h=new Promise(Cb.bind(h)),S.push(h)}}}if(0\"u\"?null:document;function ph(e,t,n){var l=Xa;if(l&&typeof t==\"string\"&&t){var a=Ct(t);a='link[rel=\"'+e+'\"][href=\"'+a+'\"]',typeof n==\"string\"&&(a+='[crossorigin=\"'+n+'\"]'),gg.has(a)||(gg.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement(\"link\"),ke(t,\"link\",e),we(t),l.head.appendChild(t)))}}function $b(e){Un.D(e),ph(\"dns-prefetch\",e,null)}function Fb(e,t){Un.C(e,t),ph(\"preconnect\",e,t)}function Wb(e,t,n){Un.L(e,t,n);var l=Xa;if(l&&e&&t){var a='link[rel=\"preload\"][as=\"'+Ct(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(a+='[imagesrcset=\"'+Ct(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(a+='[imagesizes=\"'+Ct(n.imageSizes)+'\"]')):a+='[href=\"'+Ct(e)+'\"]';var u=a;switch(t){case\"style\":u=Ha(e);break;case\"script\":u=Qa(e)}if(!(Ht.has(u)||(e=ie({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ht.set(u,e),l.querySelector(a)!==null||t===\"style\"&&l.querySelector(ti(u))||t===\"script\"&&l.querySelector(ni(u))))){var i=l.createElement(\"link\");ke(i,\"link\",e),t===\"style\"&&(i[co]=!0,i.onload=i.onerror=function(){Xg(i)}),we(i),l.head.appendChild(i)}}}function Pb(e,t){Un.m(e,t);var n=Xa;if(n&&e){var l=t&&typeof t.as==\"string\"?t.as:\"script\",a='link[rel=\"modulepreload\"][as=\"'+Ct(l)+'\"][href=\"'+Ct(e)+'\"]',u=a;switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":u=Qa(e)}if(!Ht.has(u)&&(e=ie({rel:\"modulepreload\",href:e},t),Ht.set(u,e),n.querySelector(a)===null)){switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(ni(u)))return}l=n.createElement(\"link\"),ke(l,\"link\",e),we(l),n.head.appendChild(l)}}}function eS(e,t,n){Un.S(e,t,n);var l=Xa;if(l&&e){var a=va(l).hoistableStyles,u=Ha(e);t=t||\"default\";var i=a.get(u);if(!i){var o={loading:0,preload:null};if(i=l.querySelector(ti(u)))o.loading=5;else{e=ie({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=Ht.get(u))&&Ef(e,n);var c=i=l.createElement(\"link\");we(c),ke(c,\"link\",e),c._p=new Promise(function(f,d){c.onload=f,c.onerror=d}),c.addEventListener(\"load\",function(){o.loading|=1}),c.addEventListener(\"error\",function(){o.loading|=2}),o.loading|=4,Pi(i,t,l)}i={type:\"stylesheet\",instance:i,count:1,state:o},a.set(u,i)}}}function tS(e,t){Un.X(e,t);var n=Xa;if(n&&e){var l=va(n).hoistableScripts,a=Qa(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ie({src:e,async:!0},t),(t=Ht.get(a))&&xf(e,t),u=n.createElement(\"script\"),we(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function nS(e,t){Un.M(e,t);var n=Xa;if(n&&e){var l=va(n).hoistableScripts,a=Qa(e),u=l.get(a);u||(u=n.querySelector(ni(a)),u||(e=ie({src:e,async:!0,type:\"module\"},t),(t=Ht.get(a))&&xf(e,t),u=n.createElement(\"script\"),we(u),ke(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function pg(e,t,n,l){var a=(a=Fn.current)?Yu(a):null;if(!a)throw Error(T(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(n=Ha(n.href),t=va(a).hoistableStyles,l=t.get(n),l||(l={type:\"style\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=Ha(n.href);var u=va(a).hoistableStyles,i=u.get(e);if(i||(a=a.ownerDocument||a,i={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,i),(u=a.querySelector(ti(e)))?u._p||(i.instance=u,i.state.loading=5):(u=Ht.get(e),u||(u={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ht.set(e,u)),lS(a,e,u,i.state))),t&&l===null)throw Error(T(528,\"\"));return i}if(t&&l!==null)throw Error(T(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(n=Qa(n),t=va(a).hoistableScripts,l=t.get(n),l||(l={type:\"script\",instance:null,count:0,state:null},t.set(n,l)),l):{type:\"void\",instance:null,count:0,state:null};default:throw Error(T(444,e))}}function Ha(e){return'href=\"'+Ct(e)+'\"'}function ti(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function vh(e){return ie({},e,{\"data-precedence\":e.precedence,precedence:null})}function lS(e,t,n,l){if(t=e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")){if(t[co]!==!0){l.loading=1;return}}else t=e.createElement(\"link\"),t[co]=!0,t.onload=t.onerror=Xg.bind(null,t),ke(t,\"link\",n),we(t),e.head.appendChild(t);l.preload=t,t.addEventListener(\"load\",function(){return l.loading|=1}),t.addEventListener(\"error\",function(){return l.loading|=2})}function Qa(e){return'[src=\"'+Ct(e)+'\"]'}function ni(e){return\"script[async]\"+e}function vg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var l=e.querySelector('style[data-href~=\"'+Ct(n.href)+'\"]');if(l)return t.instance=l,we(l),l;var a=ie({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement(\"style\"),we(l),ke(l,\"style\",a),Pi(l,n.precedence,e),t.instance=l;case\"stylesheet\":a=Ha(n.href);var u=e.querySelector(ti(a));if(u)return t.state.loading|=4,t.instance=u,we(u),u;l=vh(n),(a=Ht.get(a))&&Ef(l,a),u=(e.ownerDocument||e).createElement(\"link\"),we(u);var i=u;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),t.state.loading|=4,Pi(u,n.precedence,e),t.instance=u;case\"script\":return u=Qa(n.src),(a=e.querySelector(ni(u)))?(t.instance=a,we(a),a):(l=n,(a=Ht.get(u))&&(l=ie({},n),xf(l,a)),e=e.ownerDocument||e,a=e.createElement(\"script\"),we(a),ke(a,\"link\",l),e.head.appendChild(a),t.instance=a);case\"void\":return null;default:throw Error(T(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Pi(l,n.precedence,e));return t.instance}function Pi(e,t,n){for(var l=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,u=a,i=0;i title\"):null)}function aS(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function yg(e,t){return e===\"img\"&&t.src!=null&&t.src!==\"\"&&t.onLoad==null&&t.loading!==\"lazy\"}function hh(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function yh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==\"number\"?devicePixelRatio:1)*.25}function bg(e,t){typeof t.decode==\"function\"&&(e.imgCount++,t.complete||(e.imgBytes+=yh(t),e.suspenseyImages.push(t)),e=oS.bind(e),t.decode().then(e,e))}function uS(e,t,n,l){if(n.type===\"stylesheet\"&&(typeof l.media!=\"string\"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Ha(l.href),u=t.querySelector(ti(a));if(u){t=u._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=Vu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,we(u);return}u=t.ownerDocument||t,l=vh(l),(a=Ht.get(a))&&Ef(l,a),u=u.createElement(\"link\"),we(u);var i=u;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),ke(u,\"link\",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Vu.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var to=0;function iS(e,t){return e.stylesheets&&e.count===0&&no(e,e.stylesheets),0to?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function bh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)no(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Vu(){this.count--,bh(this)}function oS(){this.imgCount--,bh(this)}var Ro=null;function no(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ro=new Map,t.forEach(cS,e),Ro=null,Vu.call(e))}function cS(e,t){if(!(t.state.loading&4)){var n=Ro.get(e);if(n)var l=n.get(null);else{n=new Map,Ro.set(e,n);for(var a=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),u=0;u{\"use strict\";function Mh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mh)}catch(e){console.error(e)}}Mh(),zh.exports=_h()});var Rh=Ft(ec=>{\"use strict\";var vS=Symbol.for(\"react.transitional.element\"),hS=Symbol.for(\"react.fragment\");function Ch(e,t,n){var l=null;if(n!==void 0&&(l=\"\"+n),t.key!==void 0&&(l=\"\"+t.key),\"key\"in t){n={};for(var a in t)a!==\"key\"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:vS,type:e,key:l,ref:t!==void 0?t:null,props:n}}ec.Fragment=hS;ec.jsx=Ch;ec.jsxs=Ch});var ae=Ft((fT,Dh)=>{\"use strict\";Dh.exports=Rh()});var yn={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1},E0=[\"RETIRED\",\"CONFLICT\",\"NOT_FOUND\",\"DOCUMENT_TOO_LARGE\",\"STORAGE_FAILURE\",\"ORIGIN_NOT_DECLARED\",\"MESSAGE_TOO_LARGE\",\"PAGE_TOO_LARGE\",\"PATCH_TOO_LARGE\",\"DEADLINE\",\"INVALID_STEPS\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"CONFIGURATION_REQUIRED\",\"NOT_READY\",\"UNKNOWN_METHOD\",\"INVALID_ARGUMENT\",\"QUOTA_EXCEEDED\",\"PROTOCOL_MISMATCH\",\"APPLET_INCOMPATIBLE\",\"ENVELOPE_INVALID\",\"CONTEXT_REPLACED\",\"TARGET_NOT_FOUND\",\"PRECONDITION_FAILED\",\"ASYNC_READ\",\"AUTH_REQUIRED\",\"REJECTED\"];function ed(e){return typeof e==\"string\"&&E0.includes(e)}var x0=/^:[A-Za-z][A-Za-z0-9_]*$/,O0=/^[A-Za-z0-9_.~@-]+$/,yc=new Map;function A0(e){if(yc.has(e))return yc.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),l=n.at(-1)===\"*\";l&&n.pop();let a=[],u=!0;for(let i of n)x0.test(i)?a.push({param:i.slice(1)}):O0.test(i)&&i!==\".\"&&i!==\"..\"?a.push({literal:i}):u=!1;u&&(t={segments:a,rest:l})}return yc.set(e,t),t}function Se(e){try{return new URL(e).href}catch{return null}}function hl(e,t){let n=_0(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let l;try{l=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}l.at(-1)===\"\"&&l.pop();for(let a of e.routes){let u=A0(a.pattern);if(!u)continue;let i=M0(u,l);if(!i||!(a.query??[]).every(c=>n.searchParams.has(c)))continue;for(let c of a.query??[])i[c]=n.searchParams.get(c);let o={kind:\"route\",routeId:a.id,page:a.page,screen:a.screen,params:i};return a.context!==void 0&&(o.context=a.context),o}return{kind:\"website\",url:t}}function _0(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function M0(e,t){if(e.rest?t.lengthS.id===u.id)?.startUrl;f={index:o.index,start:y!==void 0&&Se(y)===Se(t.view.url),url:s}}}else t.status===\"ready\"&&t.account!==null&&c===\"auth\"&&(c=\"none\",f=null);o.page.status===\"ready\"&&(t.status===\"loading\"||t.status===\"error\")&&(d++,g=!1,l.push({type:\"schedule\",id:u.id,token:d}));let r={...o,seen:Math.max(o.seen,t.view.n),pin:c,signIn:f,deadline:d,page:{status:t.status,pageId:t.pageId,routeId:t.routeId,view:t.view,stale:t.stale,expired:g}};return{state:vl(Wf(e,u,r),r),effects:l}}case\"deadline\":{let u=e.contexts[t.id];return!u||t.token!==u.deadline||u.page.status===\"ready\"||u.page.expired?a:{state:vl(e,{...u,page:{...u.page,expired:!0}}),effects:l}}case\"user.viewWebsite\":{let u=e.contexts[t.id];return!u||u.pin===\"user\"?a:{state:vl(e,{...u,pin:\"user\"}),effects:l}}case\"user.done\":{let u=e.contexts[t.id];if(!u)return a;if(u.pin===\"auth\"&&u.signIn)return If(e,u,n)??a;let i=u.pin===\"none\"?u:{...u,pin:\"none\"},o=i===u?e:vl(e,i);if(fi(i,n)!==\"website\")return{state:o,effects:l};if(i.canGoBack)l.push({type:\"context.back\",id:u.id});else{let c=n.contexts.find(f=>f.id===u.id)?.startUrl;c&&l.push({type:\"context.navigate\",id:u.id,url:c,mode:\"push\"})}return{state:o,effects:l}}case\"navigate.url\":{let u=t.context??e.active;return e.contexts[u]?(l.push({type:\"context.navigate\",id:u,url:t.url,mode:t.mode}),{state:{...e,active:u,overlay:[],leaveGuard:null},effects:l}):a}case\"navigate.screen\":{let u=t.mode===\"root\"?[t.screen]:t.mode===\"replace\"?[...e.overlay.slice(0,-1),t.screen]:[...e.overlay,t.screen];return{state:{...e,overlay:u,leaveGuard:null},effects:l}}case\"select\":{let u=e.contexts[t.id];if(!u)return a;if(t.id!==e.active||e.overlay.length>0)return{state:{...e,active:t.id,overlay:[],leaveGuard:null},effects:l};let i=n.contexts.find(o=>o.id===t.id)?.startUrl;return i&&(u.url===null||Se(u.url)!==Se(i))&&l.push({type:\"context.navigate\",id:t.id,url:i,mode:\"push\"}),{state:{...e,leaveGuard:null},effects:l}}case\"back\":{if(e.leaveGuard)return{state:e,effects:[{type:\"confirmLeave\",message:e.leaveGuard.message}]};if(e.overlay.length>0)return{state:{...e,overlay:e.overlay.slice(0,-1)},effects:l};let u=e.contexts[e.active];return u?.pin===\"auth\"&&u.signIn?If(e,u,n)??{state:e,effects:[{type:\"leave\"}]}:e.contexts[e.active]?.canGoBack?{state:e,effects:[{type:\"context.back\",id:e.active}]}:{state:e,effects:[{type:\"leave\"}]}}case\"guard\":return{state:{...e,leaveGuard:t.guard},effects:l};case\"context.gone\":{let u=e.contexts[t.id];return u?{state:vl(e,{...u,page:{...Sc,status:\"unsupported\"}}),effects:l}:a}}}function If(e,t,n){let{index:l,start:a}=t.signIn,u=n.contexts[0].id,i=vl(e,{...t,pin:\"none\",signIn:null});if(!a&&l>0){let o=Math.max(1,t.index-l+1);return{state:i,effects:[{type:\"context.back\",id:t.id,steps:o}]}}return t.id===u?null:{state:{...i,active:u,overlay:[],leaveGuard:null},effects:[]}}function $f(e,t,n){return t===e.generation&&e.url!==null&&Se(n)===Se(e.url)}function Ff(e,t,n,l){let a=e.deadline+1;return l.push({type:\"schedule\",id:e.id,token:a}),{...e,url:n,seen:t===e.generation?e.seen:-1,generation:t,page:Sc,deadline:a}}function Wf(e,t,n){return!e.leaveGuard||t.id!==e.active||e.overlay.length>0||t.index===n.index&&t.url!==null&&n.url!==null&&Se(t.url)===Se(n.url)?e:{...e,leaveGuard:null}}function vl(e,t){return{...e,contexts:{...e.contexts,[t.id]:t}}}function Tc(e){let t={};for(let[n,l]of Object.entries(e.contexts))t[n]={url:l.url};return{version:yn.sessionState,state:{active:e.active,overlay:e.overlay,contexts:t}}}function ld(e,t){let n=z0(t);if(!e||e.version!==yn.sessionState||!eu(e.state))return n;let{active:l,overlay:a,contexts:u}=e.state,i={...n,contexts:{...n.contexts}};if(typeof l==\"string\"&&i.contexts[l]&&(i.active=l),Array.isArray(a)&&(i.overlay=a.filter(o=>C0(o,t.foreground.screens))),eu(u))for(let o of Object.keys(i.contexts)){let c=eu(u[o])?u[o].url:void 0;typeof c==\"string\"&&(i.contexts[o]=td(o,c))}return i}function C0(e,t){return eu(e)&&typeof e.key==\"string\"&&typeof e.id==\"string\"&&t.includes(e.id)&&eu(e.params)&&Object.values(e.params).every(n=>typeof n==\"string\")}function eu(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var IS=yn.bundleFormat,bc=\"(0|[1-9]\\\\d*)\",Pf=\"(?:0|[1-9]\\\\d*|\\\\d*[A-Za-z-][0-9A-Za-z-]*)\",$S=new RegExp(`^${bc}\\\\.${bc}\\\\.${bc}(?:-(${Pf}(?:\\\\.${Pf})*))?$`),st=class extends Error{code;constructor(e,t){super(t),this.name=\"GenesisError\",this.code=e}},R0=2e3;function Nc(e,t){return new Promise((n,l)=>{let a=null,u=!1,i=1,o=new Map,c=new Map,f={get bound(){return a},get retired(){return u},request(s,y={}){if(u)return Promise.reject(new st(\"RETIRED\",\"This page was closed\"));let S=i++;return new Promise((x,p)=>{let m=setTimeout(()=>{o.delete(S),p(new st(\"DEADLINE\",`${s} did not answer in time`))},a.limits.rpcDeadlineMs+R0);o.set(S,{resolve:x,reject:p,timer:m}),e.postMessage(JSON.stringify({type:\"request\",documentId:a.documentId,requestId:S,method:s,params:y}))})},on(s,y){let S=c.get(s);return S||c.set(s,S=new Set),S.add(y),()=>{S.delete(y)}}};function d(){u=!0;for(let s of o.values())clearTimeout(s.timer),s.reject(new st(\"RETIRED\",\"This page was closed\"));o.clear()}function g(s,y){for(let S of[...c.get(s)??[]])try{S(y)}catch(x){console.error(`Genesis ${s} handler failed`,x)}}e.addEventListener(\"message\",s=>{if(u||typeof s.data!=\"string\")return;let y;try{y=JSON.parse(s.data)}catch{return}if(y?.type===\"refused\"&&!a){u=!0,l(new st(y.error?.code??\"PROTOCOL_MISMATCH\",y.error?.message??\"The host refused this page\"));return}if(y?.type===\"bound\"){if(a)return;a=y,n(f);return}if(!(!a||y?.documentId!==a.documentId))if(y.type===\"response\"){let S=o.get(y.requestId);if(!S)return;o.delete(y.requestId),clearTimeout(S.timer),y.error?S.reject(new st(y.error.code,y.error.message)):S.resolve(y.result??null)}else y.type===\"event\"&&(y.name===\"retired\"?(d(),g(\"retired\",{})):g(y.name,y.data))}),addEventListener(\"pagehide\",()=>{u||(g(\"pagehide\",{}),d())});let r={type:\"hello\",protocol:yn.protocol,url:t};e.postMessage(JSON.stringify(r))})}var D0={pageId:null,routeId:null,params:{}};function ud(e,t){let n={};for(let g of e)n[g]=U0();let l={account:null,contexts:n},a=!1,u=new Map;function i(g){let r=g===null?[...u.values()]:[u.get(null),...g.map(y=>u.get(y))],s=new Set;for(let y of r)for(let S of[...y??[]])s.has(S)||(s.add(S),S())}function o(g,r){l={...l,contexts:{...l.contexts,[g]:r}}}function c(g){let{entry:r}=g;if(!g.attached||g.status!==\"ready\"||!r||!Kl(r.url,g.url))return;let{history:s}=g;for(s.delete(r.index),s.set(r.index,id(g));s.size>t.historyEntriesMax;)s.delete(s.keys().next().value)}function f(g,r,s){if(r===void 0||s!==\"ready\"&&s!==\"auth\")return!1;if(!a)return a=!0,l.account!==r&&(l={...l,account:r}),!1;if(r===l.account)return!1;let y={};for(let[S,x]of Object.entries(l.contexts))x.history.clear(),y[S]=S===g||!x.content||x.stale?x:{...x,stale:!0};return l={account:r,contexts:y},c(y[g]),!0}let d=(g,r=!1)=>({outcome:g,accountChanged:r});return{state:()=>l,context:g=>l.contexts[g],applyPage(g,r,s){let y=l.contexts[g];if(!y||r=r.size||m===r.index&&!Kl(h.url,r.url))&&S.delete(m)}let x={...y,generation:r.generation,entry:{index:r.index,url:r.url}},p;if(Kl(y.url,r.url))y.attached&&y.view?.generation!==r.generation?p={...x,attached:!1,status:\"loading\",error:null,stale:y.content}:p=x;else{let m=S.get(r.index);p=m?{...x,...m,attached:!1,status:\"loading\",error:null,stale:!0,content:!0}:{...x,...s,url:r.url,regions:{},attached:!1,status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1}}o(g,p),c(p),i([g])},gone(g,r){let s=l.contexts[g];s&&(o(g,{...s,attached:!1,status:\"error\",error:r,stale:s.content}),i([g]))},subscribe(g,r){let s=r??null,y=u.get(s);return y||u.set(s,y=new Set),y.add(g),()=>{y.delete(g)}}}}function U0(){return{generation:0,view:null,epoch:0,seq:0,live:[],attached:!1,url:null,pageId:null,routeId:null,params:{},regions:{},status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1,entry:null,history:new Map}}function Kl(e,t){return e!==null&&t!==null&&Se(e)===Se(t)}function id(e){return{url:e.url,pageId:e.pageId,routeId:e.routeId,params:e.params,regions:e.regions}}function H0(e,t){if(e.content&&Kl(e.url,t))return id(e);let{entry:n}=e,l=n&&Kl(n.url,t)?e.history.get(n.index):void 0;return l&&Kl(l.url,t)?l:null}function od(e,t=Object.create(null)){for(let n of e)t[n.key]=n;return t}function cd(e){return e.kind===\"single\"?{kind:\"single\",status:e.status,error:e.error??null,record:e.record}:{kind:\"collection\",status:e.status,error:e.error??null,order:e.items.map(t=>t.key),complete:e.complete,ephemeral:e.ephemeral===!0,records:od(e.items)}}function L0(e,t){let n={};for(let[l,a]of Object.entries(e)){let u=cd(a),i=t[l];n[l]=i?q0(i,u):u}return n}var di=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function q0(e,t){if(e.kind===\"single\"||t.kind===\"single\")return e.kind!==\"single\"||t.kind!==\"single\"?t:(di(e.record,t.record)&&(t.record=e.record),e.record===t.record&&e.status===t.status&&di(e.error,t.error)?e:t);let n=e.order.length===t.order.length&&e.complete===t.complete&&e.ephemeral===t.ephemeral&&e.status===t.status&&di(e.error,t.error);for(let[l,a]of t.order.entries()){let u=e.records[a];u&&di(u,t.records[a])?t.records[a]=u:n=!1,e.order[l]!==a&&(n=!1)}return n?e:t}function G0(e,t){let n=e.regions;for(let[l,a]of Object.entries(t)){let u=e.live.includes(l)?n[l]:void 0;if(!u)return null;let i;if(a.kind===\"replace\")i=cd(a.region);else if(a.kind===\"single\"){if(u.kind!==\"single\")return null;i={...u,record:a.record,status:a.status??u.status,error:a.error===void 0?u.error:a.error}}else{if(u.kind!==\"collection\")return null;if(i={...u,complete:a.complete??u.complete,status:a.status??u.status,error:a.error===void 0?u.error:a.error},a.upsert?.length||a.remove?.length){i.records=od(a.upsert??[],Object.assign(Object.create(null),u.records));for(let o of a.remove??[])delete i.records[o]}if(a.order){i.order=a.order;let o=new Set(a.order);for(let c of Object.keys(i.records))o.has(c)||(i.records===u.records&&(i.records=Object.assign(Object.create(null),u.records)),delete i.records[c])}else if(a.remove?.length){let o=new Set(a.remove);i.order=u.order.filter(c=>!o.has(c))}}n===e.regions&&(n={...n}),n[l]=i}return n}var rd=class extends st{constructor(e,t){super(e,t),this.name=\"ServiceError\"}},B0=[\"CONFIGURATION_REQUIRED\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"SERVICE_UNREACHABLE\",\"DEADLINE\",\"SERVICE_FAILURE\",\"QUOTA_EXCEEDED\"];function Ec(e){let t=e?.code;return t&&B0.includes(t)?\"This feature is temporarily unavailable. Try again in a moment.\":e instanceof Error?e.message:\"Something went wrong. Please try again.\"}async function xc(e=window.__genesisBridge){if(!e)throw new Error(\"Genesis bridge is missing; the foreground must run inside Genesis\");let t=await Nc(e,location.href),{compat:n}=t.bound;if(n.protocol!==yn.protocol||n.sessionState!==yn.sessionState)throw new st(\"PROTOCOL_MISMATCH\",\"This applet was built for another Genesis version\");return Q0(t)}var k0=500,Y0=1e3,V0=64,j0=2e3,X0=Object.freeze([]),ad=e=>e===void 0?null:Array.isArray(e)?e:[e];function Q0(e){let{manifest:t,appletId:n,limits:l,session:a}=e.bound,u=t.contexts.map(v=>v.id),i=ud(u,{historyEntriesMax:l.historyEntriesMax}),o=(v,E)=>e.request(v,E).catch(O=>{e.retired||console.error(`Genesis ${v} failed`,O)}),c=ld(a,t),f=new Set,d=null,g=new Set;function r(v){let E=nd(c,v,t),O=E.state!==c;c=E.state;let w=E.effects.filter(Z=>!s(Z));if(O){N=void 0,h();for(let Z of[...f])Z()}return w}function s(v){switch(v.type){case\"reveal\":return o(\"context.reveal\",{id:v.id}),!0;case\"cover\":return o(\"context.cover\"),!0;case\"context.navigate\":return si(v.id),o(\"context.navigate\",{id:v.id,url:v.url,mode:v.mode}),!0;case\"context.back\":return si(v.id),o(\"context.back\",v.steps?{id:v.id,steps:v.steps}:{id:v.id}),!0;case\"context.reload\":return si(v.id),o(\"context.reload\",{id:v.id}),!0;case\"schedule\":return setTimeout(()=>r({type:\"deadline\",id:v.id,token:v.token}),l.documentReadyMs),!0;case\"leave\":case\"confirmLeave\":return!1}}function y(v,E){d?d(v,E):window.confirm(v)&&E()}function S(v){let E=c.leaveGuard;if(!E)return v();y(E.message,()=>{r({type:\"guard\",guard:null}),v()})}function x(v){let E=!0;for(let O of r({type:\"back\"}))if(O.type===\"leave\")E=!1;else if(O.type===\"confirmLeave\"){let w=()=>{r({type:\"guard\",guard:null}),!x(!1)&&v&&o(\"back.leave\")};setTimeout(()=>y(O.message,w),0)}return E}let p=null,m=a?JSON.stringify(Tc(c)):\"\";function h(){p===null&&(p=setTimeout(b,k0))}function b(){p!==null&&clearTimeout(p),p=null;let v=Tc(c),E=JSON.stringify(v);E!==m&&(m=E,o(\"session.save\",v))}e.on(\"suspended\",b);let N;function M(){if(N!==void 0)return N;let v=c.overlay[c.overlay.length-1],E=c.contexts[c.active],O=null;if(v)O={key:v.key,id:v.id,params:v.params,context:c.active,overlay:!0};else if(E?.url){let w=hl(t,E.url);w.kind===\"route\"&&(O={key:`${E.id}:${E.index}`,id:w.screen,params:w.params,context:E.id,overlay:!1})}return N=O}let A=1,z=new Set(c.overlay.map(v=>v.key));function fe(){let v;do v=`s${A++}`;while(z.has(v));return z.add(v),v}function G(v){if(\"screen\"in v){let $t={key:fe(),id:v.screen,params:v.params??{}};S(()=>r({type:\"navigate.screen\",screen:$t,mode:v.mode??\"push\"}));return}let O=c.contexts[c.active]?.url??t.contexts[0].startUrl,w;try{w=new URL(v.url,O).href}catch{throw new st(\"INVALID_ARGUMENT\",`Not a URL: ${v.url}`)}let Z=v.context??rt(w);if(!c.contexts[Z])throw new st(\"NOT_FOUND\",`No context ${Z}`);let Ke=c.contexts[Z].url;if(Ke!==null&&Se(Ke)===Se(w)&&(v.mode??\"push\")===\"push\"){(Z!==c.active||c.overlay.length>0)&&S(()=>r({type:\"select\",id:Z}));return}S(()=>r({type:\"navigate.url\",url:w,context:Z,mode:v.mode??\"push\"}))}function rt(v){let E=hl(t,v);if(E.kind!==\"route\"||!E.context||!c.contexts[E.context])return c.active;let O=c.contexts[c.active],w=t.contexts.find(Ke=>Ke.id===c.active)?.startUrl,Z=!O.url||w!==void 0&&Se(O.url)===Se(w);return c.overlay.length>0||Z?E.context:c.active}function $(v){S(()=>{let E=v===c.active&&c.overlay.length===0,O=E&&c.contexts[v]?.url!==null&&Se(c.contexts[v].url)!==Se(t.contexts.find(w=>w.id===v)?.startUrl??\"\");if(r({type:\"select\",id:v}),E&&!O)for(let w of[...g])w(v)})}let xe=new Set;function Kt(v){xe.has(v)||(xe.add(v),setTimeout(()=>xe.delete(v),Y0),e.request(\"context.resync\",{id:v}).catch(()=>{}))}function ci(v){let E=hl(t,v);return E.kind===\"route\"?{pageId:E.page,routeId:E.routeId,params:E.params}:{pageId:null,routeId:null,params:{}}}e.on(\"page\",({id:v,generation:E,page:O})=>{let w=i.applyPage(v,E,O);if(w.outcome!==\"applied\")return;xe.delete(v);let Z=i.context(v);f0(v,O),r({type:\"context.page\",id:v,generation:E,view:O.view,status:O.status,pageId:O.pageId,routeId:O.routeId,account:O.account,stale:Z.stale&&Z.content,signInUrl:O.signInUrl??null}),Wa(v,w)}),e.on(\"patch\",({id:v,generation:E,patch:O})=>{let w=i.applyPatch(v,E,O);w.outcome===\"resync\"&&Kt(v),Wa(v,w)});function Wa(v,E){if(!E.accountChanged)return;let O=Zl(c,t);for(let w of u)w!==v&&(w===O?Kt(w):ri(w));for(let w of[...Jt.values()])w.context!==v&&It(w,{outcome:\"unknown\",code:\"CONTEXT_REPLACED\",message:\"The account changed\"})}function ri(v){si(v),o(\"context.reload\",{id:v})}e.on(\"context.navigated\",v=>{i.navigated(v.id,v,ci(v.url)),r({type:\"context.navigated\",...v})}),e.on(\"context.gone\",v=>{i.gone(v.id,{code:v.code??\"NOT_READY\",message:v.message??\"The page cannot be read\"}),r({type:\"context.gone\",id:v.id})}),e.on(\"user.viewWebsite\",v=>{r({type:\"user.viewWebsite\",id:v?.id??c.active})}),e.on(\"user.done\",v=>{r({type:\"user.done\",id:v?.id??c.active}),Vf()}),e.on(\"back\",()=>{let v=x(!0);o(\"back.handled\",{handled:v})});let Jt=new Map,sc=new Map,Pa=new Map,fc=0,dc=new Set,mc=new Map,Gf=(v,E,O)=>JSON.stringify([v,E,O]);function Bf(){let v=new Map;for(let O of Jt.values()){let w=Gf(O.context,O.region,O.key),Z=v.get(w);Z||v.set(w,Z=[]),Z.push({name:O.name,args:O.args})}let E=new Map;for(let[O,w]of v){let Z=mc.get(O);E.set(O,Z&&Z.length===w.length&&Z.every((Ke,$t)=>Ke.name===w[$t].name&&Ke.args===w[$t].args)?Z:w)}mc=E;for(let O of[...dc])O()}function It(v,E){Jt.get(v.dedup)===v&&(Jt.delete(v.dedup),v.actionId!==null&&sc.delete(v.actionId),v.timer!==null&&clearTimeout(v.timer),v.resolve(E),Bf())}function kf(v,E){v.timer!==null&&clearTimeout(v.timer),v.timer=setTimeout(()=>It(v,{outcome:\"unknown\",code:\"DEADLINE\",message:\"The action did not finish in time\"}),E)}function Yf(v,E){if(E.state===\"dispatched\"){if(!E.navigating)return;v.from=i.context(v.context)?.view??null,v.expect=E.expect??null,kf(v,l.actionTimeoutMs);return}let O=E.state===\"observed\"?\"observed\":E.state===\"cancelled\"?\"cancelled\":\"failed\";It(v,E.result??{outcome:O})}e.on(\"action.update\",v=>{let E=sc.get(v.actionId);if(E)return Yf(E,v);if(fc===0)return;let O=Pa.get(v.actionId)??[];O.push(v),Pa.set(v.actionId,O)});function f0(v,E){for(let O of[...Jt.values()]){if(O.context!==v||O.from===null)continue;let{from:w}=O;if(E.view.generation===w.generation&&E.view.n===w.n||E.status===\"loading\")continue;let Z=hl(t,E.view.url),Ke=Z.kind===\"route\"?Z.page:null,$t=ad(O.expect?.page);E.status===\"auth\"?It(O,{outcome:\"failed\",code:\"AUTH_REQUIRED\",message:\"Sign-in is needed\"}):Ke!==null&&ad(O.expect?.notPage)?.includes(Ke)?It(O,{outcome:\"failed\",code:\"REJECTED\",message:\"The website did not accept the action\"}):E.status===\"ready\"&&Ke!==null&&($t===null||$t.includes(Ke))?It(O,{outcome:\"observed\"}):It(O,{outcome:\"unknown\",message:\"The action led to another page\"})}}function si(v){for(let E of[...Jt.values()])E.context===v&&E.from!==null&&It(E,{outcome:\"unknown\",message:\"The page changed before the action finished\"})}function d0(v){let E=i.context(v.context);if(!E?.view)return Promise.resolve({outcome:\"failed\",code:\"NOT_READY\",message:\"The page is not ready\"});let O=v.region===null?void 0:E.regions[v.region],w=O?.kind===\"collection\"?O.records[v.key??\"\"]:O?.record??void 0,Z=JSON.stringify([v.context,w?.entityType??v.region,w?.entity??v.key,v.name,v.args??null]),Ke=Jt.get(Z);if(Ke)return Ke.promise;let $t,Qf=new Promise(Bt=>{$t=Bt}),pl={...v,dedup:Z,actionId:null,promise:Qf,resolve:$t,timer:null,from:null,expect:null};Jt.set(Z,pl),kf(pl,l.actionTimeoutMs+j0),Bf();let{view:Zf}=E,p0={region:v.region,key:v.key,name:v.name,args:v.args??null,view:Zf.n},Kf=()=>{--fc===0&&Pa.clear()};return fc++,e.request(\"context.act\",{id:v.context,generation:Zf.generation,action:p0}).then(({actionId:Bt})=>{let hc=Pa.get(Bt)??[];if(Pa.delete(Bt),Kf(),Jt.get(Z)===pl){pl.actionId=Bt,sc.set(Bt,pl);for(let v0 of hc)Yf(pl,v0)}},Bt=>{Kf();let hc=ed(Bt?.code)?Bt.code:void 0;It(pl,{outcome:\"failed\",code:hc,message:Bt instanceof Error?Bt.message:\"The action failed\"})}),Qf}let gc=new Set;e.on(\"storage.changed\",v=>{for(let E of[...gc])E(v)});let m0={get:(v,E)=>e.request(\"storage.get\",{collection:v,key:E}),list:(v,E={})=>e.request(\"storage.list\",{collection:v,...E}),commit:v=>e.request(\"storage.commit\",{checks:v.checks??[],puts:v.puts??[],deletes:v.deletes??[]}),onChanged(v){return gc.add(v),()=>{gc.delete(v)}}},g0={async request(v,E,O={}){try{return await e.request(\"services.request\",{serviceId:v,path:E,method:O.method??\"GET\",body:O.body??null})}catch(w){throw w instanceof st?new rd(w.code,w.message):w}}},pc=new Set;function Vf(){for(let v of[...pc])v()}e.on(\"resumed\",Vf);let vc=new Set;e.on(\"retired\",()=>{for(let v of[...Jt.values()])It(v,{outcome:\"unknown\",code:\"RETIRED\",message:\"This page was closed\"});for(let v of[...vc])v()});let Ql=new Map;for(let v of u)e.request(\"context.resync\",{id:v}).catch(()=>{}),s({type:\"schedule\",id:v,token:c.contexts[v].deadline});let jf=Zl(c,t);jf!==null&&o(\"context.reveal\",{id:jf});let Xf=!1;return{manifest:t,appletId:n,limits:l,restored:a!==null,store:i,navigation:{state:()=>c,screen:M,presentation:v=>fi(c.contexts[v],t),revealed:()=>Zl(c,t),navigate:G,select:$,back:()=>{x(!1)},reload:v=>{ri(v??c.active)},viewWebsite:v=>{r({type:\"user.viewWebsite\",id:v??c.active})},done:v=>{r({type:\"user.done\",id:v??c.active})},setLeaveGuard:v=>{r({type:\"guard\",guard:v===null?null:{message:v}})},onConfirmLeave(v){return d=v,()=>{d===v&&(d=null)}},onScrollToTop(v){return g.add(v),()=>{g.delete(v)}},subscribe(v){return f.add(v),()=>{f.delete(v)}}},actions:{act:d0,pending:(v,E,O)=>mc.get(Gf(v,E,O))??X0,subscribe(v){return dc.add(v),()=>{dc.delete(v)}}},storage:m0,services:g0,scroll:{get:v=>Ql.get(v),set(v,E){for(Ql.delete(v),Ql.set(v,E);Ql.size>V0;)Ql.delete(Ql.keys().next().value)}},onResume(v){return pc.add(v),()=>{pc.delete(v)}},onRetired(v){return vc.add(v),()=>{vc.delete(v)}},ready(){Xf||(Xf=!0,o(\"ui.ready\"))}}}var X=L(et(),1),Hh=L(wh(),1),li=L(ae(),1),Lh=(0,X.createContext)(null);function yS({foreground:e,children:t}){return(0,li.jsx)(Lh.Provider,{value:e,children:t})}function gn(){let e=(0,X.useContext)(Lh);if(!e)throw new Error(\"Genesis hooks need mountForeground or GenesisProvider\");return e}function bS({foreground:e,children:t}){return(0,X.useLayoutEffect)(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e.ready()))},[e]),t}async function qh(e,t){let n=t??document.getElementById(\"root\")??document.body.appendChild(document.createElement(\"div\")),l=await xc(),a=(0,Hh.createRoot)(n);return l.onRetired(()=>a.unmount()),a.render((0,li.jsx)(yS,{foreground:l,children:(0,li.jsx)(bS,{foreground:l,children:e})})),l}function zf(){let e=gn();return(0,X.useSyncExternalStore)(e.navigation.subscribe,e.navigation.state)}function tc(e){let t=zf();return e??t.active}function Gh(e,t){let{store:n}=gn(),l=(0,X.useCallback)(a=>n.subscribe(a,e),[n,e]);return(0,X.useSyncExternalStore)(l,()=>t(n.context(e)))}var SS=(e,t)=>e.pageId===t.pageId&&e.status===t.status&&e.stale===t.stale&&e.generation===t.generation&&e.params===t.params&&e.error===t.error&&e.account===t.account&&e.url===t.url;function TS(e,t){return{pageId:e?.pageId??null,status:e?.status??\"loading\",stale:e?e.stale&&e.content:!1,generation:e?.view?.generation??null,params:e?.params??NS,error:e?.error??null,account:t,url:e?.url??null}}function ct(e){let{store:t}=gn(),n=tc(e),l=(0,X.useRef)(null),a=(0,X.useCallback)(i=>t.subscribe(i),[t]),u=(0,X.useCallback)(()=>{let i=TS(t.context(n),t.state().account);return(!l.current||!SS(l.current,i))&&(l.current=i),l.current},[t,n]);return(0,X.useSyncExternalStore)(a,u)}var NS=Object.freeze({}),Uh=new WeakMap,ES=Object.freeze({order:Object.freeze([]),get:()=>{},complete:!1,status:\"missing\",error:null,ephemeral:!1});function xS(e){if(!e)return ES;let t=Uh.get(e);if(t)return t;if(e.kind===\"collection\"){let{records:n}=e;t={order:e.order.filter(l=>n[l]!==void 0),get:l=>n[l],complete:e.complete,status:e.status,error:e.error,ephemeral:e.ephemeral}}else{let{record:n}=e;t={order:n?[n.key]:[],get:l=>n&&n.key===l?n:void 0,complete:!0,status:e.status,error:e.error,ephemeral:!1}}return Uh.set(e,t),t}function pn(e,t){return Gh(tc(t),n=>xS(n?.regions[e]))}function Nt(e,t,n){return Gh(tc(n),l=>OS(l?.regions[e],t))}function OS(e,t){if(e)return e.kind===\"single\"?t===null||e.record?.key===t?e.record??void 0:void 0:t===null?void 0:e.records[t]}function nc(e,t,n){let l=gn();return(0,X.useCallback)((a,u)=>l.actions.act({context:n??l.navigation.state().active,region:t??null,key:a,name:e,args:u}),[l,e,t,n])}function lc(e,t,n){let l=gn(),a=tc(n);return(0,X.useSyncExternalStore)(l.actions.subscribe,()=>l.actions.pending(a,e,t))}function ge(){let e=gn(),t=zf(),{navigation:n}=e;return(0,X.useMemo)(()=>({presentation:n.presentation(t.active),active:t.active,contexts:t.contexts,overlay:t.overlay,screen:n.screen(),revealed:n.revealed(),navigate:n.navigate,back:n.back,select:n.select,reload:n.reload,viewWebsite:n.viewWebsite,done:n.done,setLeaveGuard:n.setLeaveGuard}),[n,t])}function ac(e,t={}){let n=gn(),l=t.storage??n.storage,[a,u]=(0,X.useState)({records:[],loading:!0,error:null});(0,X.useEffect)(()=>{let g=!0,r=0;async function s(){let S=++r;try{let x=[],p;do{let m=await l.list(e,p===void 0?{}:{afterKey:p});x.push(...m.entries),p=m.nextAfterKey??void 0}while(p!==void 0);g&&S===r&&u({records:x,loading:!1,error:null})}catch(x){g&&S===r&&u(p=>({...p,loading:!1,error:x}))}}s();let y=l.onChanged(S=>{S.changes.some(x=>x.collection===e)&&s()});return()=>{g=!1,y()}},[l,e]);let i=(0,X.useRef)(a.records);i.current=a.records;let o=(0,X.useCallback)(g=>i.current.find(r=>r.key===g)?.revision??null,[]),c=(0,X.useCallback)(g=>l.commit(g),[l]),f=(0,X.useCallback)((g,r,s)=>l.commit({checks:[{collection:e,key:g,expectedRevision:s===void 0?o(g):s}],puts:[{collection:e,key:g,value:r}]}),[l,e,o]),d=(0,X.useCallback)(g=>l.commit({checks:[{collection:e,key:g,expectedRevision:o(g)}],deletes:[{collection:e,key:g}]}),[l,e,o]);return{...a,put:f,remove:d,commit:c}}function Bh(e){let t=gn();return(0,X.useCallback)((n,l={})=>t.services.request(e,n,l),[t,e])}var AS=1500;function _S(){let e=gn();zf();let t=e.navigation.screen(),n=t?.key??`${e.navigation.state().active}:none`,l=t&&!t.overlay?t.context:null;return(0,X.useCallback)(a=>{if(!a)return;let u=e.scroll.get(n)??0,i=u>0,o=performance.now(),c=0,f=()=>{i&&(a.scrollTop=u,Math.abs(a.scrollTop-u)<2||performance.now()-o>AS?i=!1:c=requestAnimationFrame(f))},d=()=>{i=!1},g=()=>{i||e.scroll.set(n,a.scrollTop)},r=e.navigation.onScrollToTop(s=>{s===l&&(i=!1,a.scrollTo({top:0,behavior:\"smooth\"}))});return f(),a.addEventListener(\"scroll\",g,{passive:!0}),a.addEventListener(\"touchstart\",d,{passive:!0}),a.addEventListener(\"wheel\",d,{passive:!0}),()=>{cancelAnimationFrame(c),r(),a.removeEventListener(\"scroll\",g),a.removeEventListener(\"touchstart\",d),a.removeEventListener(\"wheel\",d)}},[e,n,l])}function Qe(e){return(0,li.jsx)(\"div\",{...e,ref:_S()})}function uc(e){let t=gn(),n=(0,X.useRef)(e);n.current=e,(0,X.useEffect)(()=>t.onResume(()=>n.current()),[t])}var c0=L(et(),1);var Re=\"https://x.com\";var kh=e=>typeof e==\"string\"&&/^[A-Za-z0-9_]{1,15}$/.test(e),wf=e=>typeof e==\"string\"&&/^[0-9]{1,25}$/.test(e),Et=e=>!!e&&typeof e==\"object\"&&!Array.isArray(e),Lt=e=>Number.isSafeInteger(e)&&e>=0,ic=e=>typeof e==\"string\"&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e);function MS(e,t){if(typeof e!=\"string\"||e.length>2048)return null;try{let n=new URL(e,t);return[\"https:\",\"http:\"].includes(n.protocol)&&!n.username&&!n.password?n.href:null}catch{return null}}function Cf(e){if(typeof e!=\"string\")return null;try{let t=new URL(e,Re),n=/^\\/([A-Za-z0-9_]{1,15})\\/status\\/([0-9]{1,25})$/.exec(t.pathname);return t.origin===Re&&!t.username&&!t.password&&n?{postId:n[2],handle:n[1],url:`${Re}/${n[1]}/status/${n[2]}`}:null}catch{return null}}function Rf(e){return Et(e)&&wf(e.postId)&&Lt(e.revision)&&e.revision>0&&Array.isArray(e.categoryIds)&&e.categoryIds.length<=10&&e.categoryIds.every(ic)}function Df(e){return!Et(e)||!kh(e.authorHandle)||typeof e.authorName!=\"string\"||e.authorName.length>800||typeof e.text!=\"string\"||e.text.length>16e3||!Lt(e.capturedAtMs)||![\"complete\",\"excerpt\",\"unavailable\"].includes(String(e.textState))||!Et(e.media)||![\"none\",\"photo\",\"video\",\"mixed\"].includes(String(e.media.kind))||!Lt(e.media.count)||e.media.count>16?!1:Array.isArray(e.links)&&e.links.length<=8&&e.links.every(t=>Et(t)&&typeof t.text==\"string\"&&!!MS(t.href))}function Yh(e){return Rf(e)&&Et(e)&&e.version===1&&Df(e.snapshot)&&Cf(e.url)?.postId===e.postId&&Lt(e.savedAtMs)&&Lt(e.updatedAtMs)}function Vh(e){return Et(e)&&e.version===1&&ic(e.id)&&typeof e.name==\"string\"&&e.name.length<=320&&typeof e.nameKey==\"string\"&&Lt(e.revision)&&e.revision>0&&Lt(e.count)&&Lt(e.createdAtMs)&&Lt(e.updatedAtMs)}var jh=e=>Et(e)&&e.version===1&&ic(e.libraryId)&&kh(e.expectedHandle)&&Lt(e.revision),Uf=e=>Et(e)&&ic(e.operationId)&&e.status===\"committed\"&&typeof e.kind==\"string\"&&Lt(e.libraryRevision)&&Lt(e.createdAtMs)&&Et(e.result);function ai(e){let t=e.normalize(\"NFKC\").trim().replace(/\\s+/gu,\" \");return t?[...t].length>80||new TextEncoder().encode(t).length>320?\"Use 80 characters or fewer.\":/[\\u0000-\\u001f\\u007f]/u.test(t)?\"Use a name without control characters.\":null:\"Enter a category name.\"}var xt=e=>`${Re}/${e}`,oc=(e,t)=>`${Re}/search?q=${encodeURIComponent(e)}&src=typed_query${t?`&f=${t}`:\"\"}`;var Xh=L(et(),1);var J=L(ae(),1),zS={home:\"M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z\",search:\"M21 21l-5.2-5.2M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0\",bell:\"M6 16V11a6 6 0 1 1 12 0v5l2 2H4zM10 21h4\",bookmark:\"M6 3h12v18l-6-4-6 4z\",person:\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0\",reply:\"M4 5h16v11H9l-5 4z\",repost:\"M7 4 3 8l4 4M3 8h13a4 4 0 0 1 4 4M17 20l4-4-4-4M21 16H8a4 4 0 0 1-4-4\",heart:\"M12 20s-8-4.9-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 9c0 6.1-8 11-8 11z\",views:\"M5 20V12M10 20V6M15 20v-9M20 20V4\",folder:\"M3 6a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z\",external:\"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6\",close:\"M6 6l12 12M18 6 6 18\",left:\"M15 5l-7 7 7 7\",right:\"M9 5l7 7-7 7\",check:\"M5 12.5 10 17 19 7\"};function ve({name:e,filled:t=!1}){return(0,J.jsx)(\"svg\",{viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",className:t?\"filled\":void 0,children:(0,J.jsx)(\"path\",{d:zS[e]})})}function Ot(){let{navigate:e}=ge();return(0,Xh.useCallback)(t=>{try{e({url:t})}catch(n){console.error(\"Genesis could not open\",t,n)}},[e])}function Qh({parts:e,className:t}){let n=Ot();return(0,J.jsx)(\"p\",{className:t??\"post-text\",dir:\"auto\",children:e.map((l,a)=>l.href?(0,J.jsx)(\"a\",{href:l.href,onClick:u=>{u.preventDefault(),u.stopPropagation(),n(l.href)},children:l.text},a):(0,J.jsx)(\"span\",{children:l.text},a))})}function gl({src:e,size:t=40}){return e?(0,J.jsx)(\"img\",{className:\"avatar\",src:e,alt:\"\",width:t,height:t,loading:\"lazy\",referrerPolicy:\"no-referrer\"}):(0,J.jsx)(\"span\",{className:\"avatar\",style:{width:t,height:t},\"aria-hidden\":\"true\"})}function Za(){return(0,J.jsxs)(\"svg\",{viewBox:\"0 0 24 24\",className:\"verified\",role:\"img\",\"aria-label\":\"Verified account\",children:[(0,J.jsx)(\"path\",{d:\"M12 2.5l2.4 1.8 3-.2.9 2.8 2.5 1.7-1 2.9 1 2.9-2.5 1.7-.9 2.8-3-.2L12 21.5l-2.4-1.8-3 .2-.9-2.8-2.5-1.7 1-2.9-1-2.9 2.5-1.7.9-2.8 3 .2z\"}),(0,J.jsx)(\"path\",{d:\"M8 12.2l2.6 2.6L16 9.4\",className:\"tick\"})]})}function Pe({label:e,rows:t=6,kind:n=\"posts\"}){return(0,J.jsx)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:`skeleton ${n}`,children:Array.from({length:t},(l,a)=>(0,J.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[n===\"posts\"&&(0,J.jsx)(\"span\",{className:\"skeleton-avatar\"}),(0,J.jsxs)(\"div\",{children:[(0,J.jsx)(\"span\",{}),(0,J.jsx)(\"span\",{}),(0,J.jsx)(\"span\",{})]})]},a))})}function Ze({title:e,children:t,role:n}){return(0,J.jsxs)(\"section\",{className:\"notice\",role:n,children:[(0,J.jsx)(\"h2\",{children:e}),t]})}function Hf({url:e,label:t=\"Open on X\"}){let{navigate:n,viewWebsite:l}=ge();return(0,J.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>e?n({url:e}):l(),children:[t,\" \",(0,J.jsx)(ve,{name:\"external\"})]})}function vn({error:e}){let t=e?.code===\"NOT_READY\"||e?.code===\"DEADLINE\"?\"X did not answer in time.\":e?.message||\"This page could not be read.\";return(0,J.jsxs)(Ze,{title:\"Couldn't load this page\",role:\"alert\",children:[(0,J.jsx)(\"p\",{children:t}),(0,J.jsx)(Hf,{})]})}function Ka({reason:e}){let{navigate:t}=ge();return(0,J.jsxs)(Ze,{title:\"Sign in to X\",children:[(0,J.jsx)(\"p\",{children:e}),(0,J.jsxs)(\"button\",{type:\"button\",className:\"primary\",onClick:()=>t({url:`${Re}/i/flow/login`}),children:[\"Sign in \",(0,J.jsx)(ve,{name:\"external\"})]})]})}function Ja({label:e,options:t,active:n}){return(0,J.jsx)(\"nav\",{className:\"mode-tabs\",\"aria-label\":e,children:t.map(l=>(0,J.jsx)(\"button\",{type:\"button\",className:\"mode-tab\",\"aria-current\":l.id===n?\"page\":void 0,onClick:()=>l.id!==n&&l.go(),children:l.label},l.id))})}var Zh=L(et(),1);var jl=L(ae(),1);function Kh(){let{navigate:e}=ge(),t=ct(),n=Nt(\"handle\",null),l=t.stale||t.pageId!==\"account\"?null:n?.data?.handle??t.account;(0,Zh.useEffect)(()=>{l&&e({url:xt(l),context:\"account\",mode:\"replace\"})},[l,e]);let a;return t.status===\"auth\"?a=(0,jl.jsx)(Ka,{reason:\"Sign in to see your profile and use Saved categories.\"}):t.status===\"error\"?a=(0,jl.jsx)(vn,{error:t.error}):a=(0,jl.jsx)(Pe,{label:\"Loading your profile\",rows:3,kind:\"text\"}),(0,jl.jsxs)(Qe,{className:\"screen\",children:[(0,jl.jsx)(\"h1\",{className:\"screen-title\",children:\"Profile\"}),a]})}var qt=L(et(),1);var Hn=L(et(),1);var xT=new TextEncoder;var Zt=class extends Error{constructor(n,l,a=!1){super(l);this.code=n;this.uncertain=a;this.name=\"LibraryError\"}code;uncertain},Ia={CONFLICT:\"This item changed. Refresh before saving again.\",CATEGORY_NAME_EXISTS:\"A category with this name already exists.\",CATEGORY_NOT_EMPTY:\"Move or remove its saved posts before deleting this category.\",CATEGORY_MISSING:\"A selected category no longer exists. Review your choices.\",CURSOR_STALE:\"The list changed while loading. Refresh to see it.\",LIMIT_REACHED:\"This would go over a library limit.\",ACCOUNT_MISMATCH:\"These categories belong to a different X account. Switch accounts on X to use them.\",SIGN_IN:\"Sign in to X to use your categories.\",UNCERTAIN:\"The last change may not have finished. Check it before making another.\"};function hn(e){let t=e?.code;return t&&Ia[t]?Ia[t]:e instanceof Zt?e.message:Ec(e)}function wS(){let e=Bh(\"bookmarks\");return(0,Hn.useMemo)(()=>{async function t(l,a){let u=await e(l,a===void 0?{}:{method:\"POST\",body:a});if(u.status>=200&&u.status<300)return u.body?.result;let i=u.body?.error;throw new Zt(i?.code??\"SERVICE_FAILURE\",i?.message??\"The bookmarks service refused the request.\",u.status>=500)}let n=(l,a)=>{if(!a(l))throw new Zt(\"SERVICE_FAILURE\",\"The bookmarks service sent an invalid answer.\");return l};return{library:async()=>n(await t(\"/v1/library\"),jh),categories:async()=>{let l=await t(\"/v1/categories\");return n(Et(l)?l.categories:void 0,a=>Array.isArray(a)&&a.every(Vh))},lookup:async l=>{let a=await t(\"/v1/bookmarks/lookup\",{postIds:[l]});return n(Et(a)?a.records:void 0,i=>Array.isArray(i)&&i.every(Rf)).find(i=>i.postId===l)??null},query:async(l,a,u)=>n(await t(\"/v1/bookmarks/query\",{categoryId:l,query:a,cursor:u,limit:20}),i=>Et(i)&&Array.isArray(i.entries)&&i.entries.every(Yh)),operate:async(l,a,u)=>n(await t(\"/v1/operations\",{operationId:l,kind:a,payload:u}),Uf),receipt:async l=>n(await t(`/v1/operations/${l}`),Uf)}},[e])}function CS(){let e=ct(\"account\");return{account:e.account?{handle:e.account,name:null}:null,signedOut:e.status===\"auth\"}}function $a(){let e=wS(),{account:t,signedOut:n}=CS(),l=ac(\"operations\"),[a,u]=(0,Hn.useState)({library:null,categories:[],loading:!0,error:null}),[i,o]=(0,Hn.useState)(0),c=(0,Hn.useCallback)(()=>o(y=>y+1),[]);uc(c),(0,Hn.useEffect)(()=>{let y=!0;return u(S=>({...S,loading:!0})),Promise.all([e.library(),e.categories()]).then(([S,x])=>{y&&u({library:S,categories:x,loading:!1,error:null})},S=>{y&&u(x=>({...x,loading:!1,error:S}))}),()=>{y=!1}},[e,i]);let f=a.library,d=f?l.records.find(y=>y.key===`pending:${f.libraryId}`)?.value??null:null,g=a.error;return!g&&f&&!t&&(g=new Zt(n?\"SIGN_IN\":\"ACCOUNT_UNKNOWN\",n?Ia.SIGN_IN:\"Checking your X account\\u2026\")),!g&&f&&t&&t.handle.toLowerCase()!==f.expectedHandle.toLowerCase()&&(g=new Zt(\"ACCOUNT_MISMATCH\",Ia.ACCOUNT_MISMATCH)),{...a,error:g,pending:d,reload:c,service:e,operate:async(y,S,x)=>{if(!f||g)throw g??new Zt(\"SERVICE_FAILURE\",\"The library isn't loaded.\");if(d)throw new Zt(\"UNCERTAIN\",Ia.UNCERTAIN);let p=`pending:${f.libraryId}`,m=crypto.randomUUID();await l.put(p,{operationId:m,kind:y,libraryId:f.libraryId,createdAtMs:Date.now(),recordId:x});try{let h=await e.operate(m,y,S);return await l.remove(p),h}catch(h){let b=!(h instanceof Zt)||h.uncertain;throw b||await l.remove(p),b?new Zt(\"UNCERTAIN\",Ia.UNCERTAIN,!0):h}finally{c()}},check:async()=>{if(!(!f||!d)){try{await e.receipt(d.operationId)}catch(y){if(y.code!==\"OPERATION_NOT_FOUND\")throw y}await l.remove(`pending:${f.libraryId}`),c()}},loading:a.loading||l.loading}}function Jh(e){let t=e.parts.map(a=>a.text).join(\"\"),n=e.photos.length&&e.videos?\"mixed\":e.videos?\"video\":e.photos.length?\"photo\":\"none\",l=e.parts.filter(a=>a.href).map(a=>({text:a.text.slice(0,300),href:a.href})).slice(0,8);return{authorHandle:e.handle.toLowerCase(),authorName:e.name,text:t,textState:e.textState,capturedAtMs:Date.now(),media:{kind:n,count:Math.min(16,e.photos.length+e.videos)},links:l}}var Fh=L(et(),1);var cc=L(et(),1);var _=L(ae(),1);function Ih(e,t,n,l,a){let u=lc(e,t),i=nc(n,e),[o,c]=(0,cc.useState)(!1),f=[...u].reverse().find(r=>r.name===n),d=f?f.args[l]:a;return{shown:d,busy:f!==void 0,failed:o,toggle:()=>{c(!1),i(t,{[l]:!d}).then(r=>c(r.outcome===\"failed\"))}}}function RS(){let{navigate:e}=ge();return t=>e({screen:\"save\",params:{post:JSON.stringify({postId:t.postId,url:t.url,snapshot:Jh(t)})}})}var Fa=(0,cc.memo)(function({post:t,region:n,actionable:l,focus:a=!1}){let u=Ot(),{viewWebsite:i}=ge(),o=RS(),c=()=>{a||u(t.url)},f=()=>{a||u(t.url),i()};return(0,_.jsxs)(\"article\",{className:a?\"post focus\":\"post\",\"aria-label\":`Post by ${t.name}`,children:[t.context&&(0,_.jsxs)(\"p\",{className:\"post-context\",children:[(0,_.jsx)(ve,{name:/pinned/i.test(t.context.text)?\"bookmark\":\"repost\"}),t.context.url?(0,_.jsx)(\"a\",{href:t.context.url,onClick:d=>{d.preventDefault(),u(t.context.url)},children:t.context.text}):t.context.text]}),(0,_.jsxs)(\"div\",{className:\"post-grid\",children:[(0,_.jsx)(\"button\",{type:\"button\",className:\"avatar-button\",\"aria-label\":`Profile of ${t.name}`,onClick:()=>u(xt(t.handle)),children:(0,_.jsx)(gl,{src:t.avatar,size:a?48:40})}),(0,_.jsxs)(\"div\",{className:\"post-body\",children:[(0,_.jsxs)(\"header\",{className:\"post-head\",children:[(0,_.jsxs)(\"a\",{className:\"post-name\",href:xt(t.handle),onClick:d=>{d.preventDefault(),u(xt(t.handle))},children:[(0,_.jsx)(\"strong\",{children:t.name}),t.verified&&(0,_.jsx)(Za,{})]}),(0,_.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",t.handle,!a&&t.time&&(0,_.jsxs)(_.Fragment,{children:[\" \\xB7 \",(0,_.jsx)(\"time\",{dateTime:t.dateTime??void 0,children:t.time})]})]})]}),(0,_.jsxs)(\"div\",{className:\"post-content\",onClick:c,children:[t.parts.length>0&&(0,_.jsx)(Qh,{parts:t.parts,className:a?\"post-text large\":\"post-text\"}),t.textState===\"excerpt\"&&!a&&(0,_.jsx)(\"span\",{className:\"show-more\",children:\"Show more\"}),t.textState===\"unavailable\"&&t.photos.length===0&&t.videos===0&&!t.quote&&(0,_.jsx)(\"p\",{className:\"post-meta\",children:\"X didn't show this post's text.\"})]}),t.photos.length>0&&(0,_.jsx)(\"div\",{className:`photos n${t.photos.length}`,children:t.photos.map((d,g)=>(0,_.jsx)(\"button\",{type:\"button\",\"aria-label\":`Photo ${g+1} of ${t.photos.length}`,onClick:()=>u(`${t.url}/photo/${g+1}`),children:(0,_.jsx)(\"img\",{src:d,alt:\"\",loading:\"lazy\",referrerPolicy:\"no-referrer\"})},d))}),t.videos>0&&(0,_.jsxs)(\"button\",{type:\"button\",className:\"video-tile\",onClick:f,children:[(0,_.jsx)(\"span\",{children:\"Video\"}),(0,_.jsxs)(\"span\",{className:\"post-meta\",children:[\"Play on X \",(0,_.jsx)(ve,{name:\"external\"})]})]}),t.quote&&(0,_.jsxs)(\"button\",{type:\"button\",className:\"quote\",disabled:!t.quote.url,onClick:()=>t.quote?.url&&u(t.quote.url),children:[(0,_.jsxs)(\"span\",{className:\"post-head\",children:[(0,_.jsx)(\"strong\",{children:t.quote.name}),t.quote.handle&&(0,_.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",t.quote.handle]})]}),t.quote.text&&(0,_.jsx)(\"span\",{className:\"quote-text\",children:t.quote.text})]}),a&&t.time&&(0,_.jsxs)(\"p\",{className:\"post-meta focus-time\",children:[(0,_.jsx)(\"time\",{dateTime:t.dateTime??void 0,children:t.time}),t.views&&(0,_.jsxs)(_.Fragment,{children:[\" \\xB7 \",(0,_.jsx)(\"strong\",{children:t.views}),\" views\"]})]}),(0,_.jsx)(DS,{post:t,region:n,actionable:l,save:()=>o(t)})]})]})]})});function DS({post:e,region:t,actionable:n,save:l}){let a=Ot(),u=Ih(t,e.postId,\"setLiked\",\"liked\",e.liked),i=Ih(t,e.postId,\"setBookmarked\",\"bookmarked\",e.bookmarked);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(\"div\",{className:\"actions-bar\",children:[(0,_.jsxs)(\"button\",{type:\"button\",className:\"action\",\"aria-label\":`Reply${e.replies?`, ${e.replies} replies`:\"\"}`,onClick:()=>a(`${Re}/compose/post?in_reply_to=${e.postId}`),children:[(0,_.jsx)(ve,{name:\"reply\"}),(0,_.jsx)(\"span\",{children:e.replies})]}),(0,_.jsxs)(\"span\",{className:e.reposted?\"action reposted\":\"action\",\"aria-label\":`${e.reposts||\"No\"} reposts`,role:\"img\",children:[(0,_.jsx)(ve,{name:\"repost\"}),(0,_.jsx)(\"span\",{children:e.reposts})]}),(0,_.jsxs)(\"button\",{type:\"button\",className:u.shown?\"action liked\":\"action\",\"aria-pressed\":u.shown,disabled:!n||!e.canLike||u.busy,\"aria-label\":`${u.shown?\"Unlike\":\"Like\"}${e.likes?`, ${e.likes} likes`:\"\"}`,onClick:u.toggle,children:[(0,_.jsx)(ve,{name:\"heart\",filled:u.shown}),(0,_.jsx)(\"span\",{children:e.likes})]}),(0,_.jsxs)(\"button\",{type:\"button\",className:\"action\",\"aria-label\":`${e.views||\"No\"} views`,disabled:!e.views,onClick:()=>a(`${e.url}/analytics`),children:[(0,_.jsx)(ve,{name:\"views\"}),(0,_.jsx)(\"span\",{children:e.views})]}),(0,_.jsx)(\"button\",{type:\"button\",className:i.shown?\"action bookmarked\":\"action\",\"aria-pressed\":i.shown,disabled:!n||!e.canBookmark||i.busy,\"aria-label\":i.shown?\"Remove bookmark\":\"Bookmark\",onClick:i.toggle,children:(0,_.jsx)(ve,{name:\"bookmark\",filled:i.shown})}),(0,_.jsx)(\"button\",{type:\"button\",className:\"action\",\"aria-label\":\"Save to categories\",onClick:l,children:(0,_.jsx)(ve,{name:\"folder\"})})]}),(u.failed||i.failed)&&(0,_.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"That didn't go through on X. Try again.\"})]})}var I=L(ae(),1);function Lf({active:e}){let{navigate:t}=ge();return(0,I.jsx)(Ja,{label:\"Saved\",options:[{id:\"bookmarks\",label:\"Bookmarks\",go:()=>t({url:`${Re}/i/history`,context:\"primary\",mode:e===\"categories\"?\"push\":\"replace\"})},{id:\"likes\",label:\"Likes\",go:()=>t({url:`${Re}/i/history/likes`,context:\"primary\",mode:e===\"categories\"?\"push\":\"replace\"})},{id:\"categories\",label:\"Categories\",go:()=>t({screen:\"categories\",mode:\"root\"})}],active:e})}var $h={home:\"Home\",notifications:\"Notifications\",saved:\"Saved\"},US={home:\"Sign in to see your timeline.\",notifications:\"Sign in to see your notifications.\",saved:\"Sign in to see your bookmarks and likes.\"};function HS(e,t){if(e===\"/home\")return{kind:\"home\",likes:!1,handle:null};if(e===\"/notifications\")return{kind:\"notifications\",likes:!1,handle:null};if(e===\"/i/history/likes\")return{kind:\"saved\",likes:!0,handle:null};let n=/^\\/([A-Za-z0-9_]{1,15})\\/likes$/.exec(e)?.[1]??null;return n?n.toLowerCase()===t?.toLowerCase()?{kind:\"saved\",likes:!0,handle:null}:{kind:\"likes\",likes:!0,handle:n}:{kind:\"saved\",likes:!1,handle:null}}function rc(){let e=ct(),t=pn(\"timeline\"),n=Nt(\"empty\",null),l=e.url?new URL(e.url).pathname:\"/home\",{kind:a,likes:u,handle:i}=HS(l,e.account),o=e.pageId===\"timeline\"?t.order:[],c=e.account!==null&&!e.stale&&!t.ephemeral,f=e.pageId===\"timeline\"&&t.status===\"error\",d;return e.status===\"auth\"?d=(0,I.jsx)(Ka,{reason:US[a]??\"Sign in to see this page.\"}):o.length===0?f?d=(0,I.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}):e.status===\"ready\"&&e.pageId===\"timeline\"?d=(0,I.jsx)(Ze,{title:n?.data??\"Nothing here yet\",children:(0,I.jsx)(\"p\",{children:a===\"notifications\"?\"New activity shows up here.\":a===\"saved\"?\"Posts you bookmark or like on X appear here.\":\"X has nothing to show here right now.\"})}):d=e.status===\"error\"?(0,I.jsx)(vn,{error:e.error}):(0,I.jsx)(Pe,{label:`Loading ${$h[a]??\"posts\"}`}):d=(0,I.jsxs)(I.Fragment,{children:[e.status===\"error\"&&(0,I.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),f&&(0,I.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}),(0,I.jsx)(qf,{region:\"timeline\",items:t,actionable:c}),(0,I.jsx)(ui,{stale:e.stale})]}),(0,I.jsxs)(Qe,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,I.jsx)(\"h1\",{className:\"screen-title\",children:a===\"likes\"?`@${i}\\u2019s likes`:$h[a]??\"Posts\"}),a===\"saved\"&&(0,I.jsx)(Lf,{active:u?\"likes\":\"bookmarks\"}),d]})}function qf({region:e,items:t,actionable:n}){return(0,I.jsx)(\"div\",{className:\"feed\",children:t.order.map(l=>{let a=t.get(l)?.data;return a?a.kind===\"post\"?(0,I.jsx)(Fa,{post:a.post,region:e,actionable:n},l):(0,I.jsx)(LS,{notice:a.notice},l):null})})}function ui({stale:e}){let t=nc(\"loadMore\"),n=lc(null,null).some(i=>i.name===\"loadMore\"),[l,a]=(0,Fh.useState)(!1);return(0,I.jsxs)(\"div\",{className:\"more\",children:[l&&(0,I.jsx)(\"p\",{className:\"post-meta\",role:\"status\",children:\"No more posts right now.\"}),(0,I.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:n||e,onClick:()=>{t(null).then(i=>a(i.outcome!==\"observed\"))},children:n?\"Loading\\u2026\":\"Show more\"})]})}function LS({notice:e}){let t=Ot(),n=(0,I.jsxs)(I.Fragment,{children:[e.avatars.length>0&&(0,I.jsx)(\"span\",{className:\"notice-avatars\",children:e.avatars.map(l=>(0,I.jsx)(gl,{src:l,size:32},l))}),(0,I.jsx)(\"span\",{className:\"notice-text\",children:e.text})]});return e.url?(0,I.jsx)(\"button\",{type:\"button\",className:\"notification\",onClick:()=>t(e.url),children:n}):(0,I.jsx)(\"div\",{className:\"notification\",children:n})}var R=L(ae(),1);function ii({library:e,children:t}){let[n,l]=(0,qt.useState)(!1),[a,u]=(0,qt.useState)(\"\"),i=e.error?.code;return i===\"SIGN_IN\"?(0,R.jsx)(Ka,{reason:\"Categories belong to your X account. Sign in to use them.\"}):i===\"ACCOUNT_UNKNOWN\"||e.loading&&!e.library?(0,R.jsx)(Pe,{label:\"Loading categories\",rows:4,kind:\"text\"}):e.error?(0,R.jsxs)(Ze,{title:i===\"ACCOUNT_MISMATCH\"?\"Different account\":\"Categories are unavailable\",role:\"alert\",children:[(0,R.jsx)(\"p\",{children:hn(e.error)}),i!==\"ACCOUNT_MISMATCH\"&&(0,R.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:e.reload,children:\"Try again\"})]}):e.pending?(0,R.jsxs)(Ze,{title:\"Check the last change\",role:\"alert\",children:[(0,R.jsx)(\"p\",{children:\"The last change to your categories may not have finished. Check it before making another.\"}),a&&(0,R.jsx)(\"p\",{className:\"inline-error\",children:a}),(0,R.jsx)(\"button\",{type:\"button\",className:\"primary\",disabled:n,onClick:()=>{l(!0),u(\"\"),e.check().catch(o=>u(hn(o))).finally(()=>l(!1))},children:n?\"Checking\\u2026\":\"Check last change\"})]}):(0,R.jsx)(R.Fragment,{children:t})}function Wh(){let{navigate:e}=ge(),t=$a(),[n,l]=(0,qt.useState)(null),[a,u]=(0,qt.useState)(\"\"),[i,o]=(0,qt.useState)(\"\"),[c,f]=(0,qt.useState)({entries:[],cursor:null,loading:!0,error:null}),d=t.library?.revision,{service:g}=t,r=ac(\"preferences\"),s=t.library?`library:${t.library.libraryId}`:null,y=s?(r.records.find(N=>N.key===s)??r.records.find(N=>N.key===\"library\"))?.value??null:null,[S,x]=(0,qt.useState)(null);(0,qt.useEffect)(()=>{!s||r.loading||S===s||(x(s),typeof y?.query==\"string\"&&(o(y.query),u(y.query)),y?.categoryId&&t.categories.some(N=>N.id===y.categoryId)&&l(y.categoryId))},[s,r.loading,S,y,t.categories]),(0,qt.useEffect)(()=>{let N=y?y.query===i&&y.categoryId===n:!i&&n===null;!s||S!==s||N||r.put(s,{query:i,categoryId:n,scroll:y?.scroll??0}).catch(()=>{})},[s,S,i,n]);let p=!!t.library&&!t.error&&!t.pending&&S===s;(0,qt.useEffect)(()=>{if(!p)return;let N=!0;return f(M=>({...M,loading:!0,error:null})),g.query(n,i,null).then(M=>{N&&f({entries:M.entries,cursor:M.nextCursor,loading:!1,error:null})},M=>{N&&f(A=>({...A,loading:!1,error:M}))}),()=>{N=!1}},[p,g,n,i,d]);let m=()=>{!c.cursor||c.loading||(f(N=>({...N,loading:!0})),g.query(n,i,c.cursor).then(N=>{f(M=>({entries:[...M.entries,...N.entries],cursor:N.nextCursor,loading:!1,error:null}))},N=>f(M=>({...M,loading:!1,error:N}))))},h=new Map(t.categories.map(N=>[N.id,N.name])),b=t.categories.reduce((N,M)=>N+M.count,0);return(0,R.jsxs)(Qe,{className:\"screen\",children:[(0,R.jsx)(\"h1\",{className:\"screen-title\",children:\"Saved\"}),(0,R.jsx)(Lf,{active:\"categories\"}),(0,R.jsxs)(ii,{library:t,children:[(0,R.jsxs)(\"div\",{className:\"chips\",role:\"group\",\"aria-label\":\"Filter by category\",children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":n===null,onClick:()=>l(null),children:\"All\"}),t.categories.map(N=>(0,R.jsxs)(\"button\",{type:\"button\",className:\"chip\",\"aria-pressed\":n===N.id,onClick:()=>l(N.id),children:[N.name,\" \",(0,R.jsx)(\"span\",{className:\"chip-count\",children:N.count})]},N.id))]}),(0,R.jsx)(\"form\",{className:\"search-form\",role:\"search\",onSubmit:N=>{N.preventDefault(),o(a.trim())},children:(0,R.jsxs)(\"label\",{className:\"search-field\",children:[(0,R.jsx)(ve,{name:\"search\"}),(0,R.jsx)(\"span\",{className:\"visually-hidden\",children:\"Search saved posts\"}),(0,R.jsx)(\"input\",{type:\"search\",placeholder:\"Search saved posts\",value:a,enterKeyHint:\"search\",onChange:N=>{u(N.target.value),N.target.value||o(\"\")}})]})}),(0,R.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>e({screen:\"manage\"}),children:[(0,R.jsx)(ve,{name:\"folder\"}),\" Manage categories\"]}),c.error!=null&&(0,R.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:hn(c.error)}),c.entries.length===0&&!c.loading&&!c.error&&(0,R.jsx)(Ze,{title:i?\"No matches\":t.categories.length?\"Nothing filed here\":\"No categories yet\",children:(0,R.jsx)(\"p\",{children:i?\"Try other words.\":t.categories.length?b?\"No saved posts in this category.\":\"Tap the folder on any post to file it.\":\"Create a category, then tap the folder on any post to file it.\"})}),(0,R.jsx)(\"div\",{className:\"feed\",children:c.entries.map(N=>(0,R.jsx)(qS,{entry:N,names:h},N.postId))}),c.loading&&(0,R.jsx)(Pe,{label:\"Loading saved posts\",rows:c.entries.length?1:4}),c.cursor&&!c.loading&&(0,R.jsx)(\"button\",{type:\"button\",className:\"secondary more\",onClick:m,children:\"Load more\"})]})]})}function qS({entry:e,names:t}){let n=Ot(),{navigate:l}=ge(),{snapshot:a}=e;return(0,R.jsx)(\"article\",{className:\"post saved-post\",children:(0,R.jsxs)(\"div\",{className:\"post-body\",children:[(0,R.jsxs)(\"header\",{className:\"post-head\",children:[(0,R.jsx)(\"a\",{className:\"post-name\",href:xt(a.authorHandle),onClick:u=>{u.preventDefault(),n(xt(a.authorHandle))},children:(0,R.jsx)(\"strong\",{children:a.authorName})}),(0,R.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",a.authorHandle]})]}),(0,R.jsx)(\"button\",{type:\"button\",className:\"post-content plain\",onClick:()=>n(e.url),children:(0,R.jsx)(\"span\",{className:\"post-text\",dir:\"auto\",children:a.text||(a.media.count?`${a.media.count} ${a.media.kind===\"video\"?\"video\":\"media\"}`:\"Post\")})}),(0,R.jsxs)(\"div\",{className:\"pills\",children:[e.categoryIds.map(u=>t.has(u)&&(0,R.jsx)(\"span\",{className:\"pill\",children:t.get(u)},u)),(0,R.jsx)(\"button\",{type:\"button\",className:\"text-button\",onClick:()=>l({screen:\"save\",params:{post:JSON.stringify({postId:e.postId,url:e.url,snapshot:a})}}),children:\"Edit\"})]})]})})}var Ph=L(et(),1);var B=L(ae(),1),GS=[{id:\"\",label:\"Top\"},{id:\"live\",label:\"Latest\"},{id:\"user\",label:\"People\"},{id:\"media\",label:\"Media\"}];function e0(){let{navigate:e}=ge(),t=ct(),n=pn(\"trends\"),l=pn(\"people\"),a=pn(\"results\"),u=Nt(\"empty\",null),i=Ot(),o=new URL(t.url??\"https://x.com/explore\"),c=o.pathname,f=c===\"/search\"?t.params.q??\"\":c.startsWith(\"/hashtag/\")?`#${t.params.tag}`:\"\",d=o.searchParams.get(\"f\")??\"\",[g,r]=(0,Ph.useState)(f),s=t.pageId===\"explore\",y={trends:s?n.order:[],people:s?l.order:[],results:s?a.order:[]},S=t.account!==null&&!t.stale&&!a.ephemeral,x=s&&[n,l,a].some(h=>h.status===\"error\"),p=x&&(0,B.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some results couldn't be read.\"}),m;return!y.trends.length&&!y.people.length&&!y.results.length?m=x?p:s&&t.status===\"ready\"?(0,B.jsx)(Ze,{title:u?.data??\"No results\",children:(0,B.jsx)(\"p\",{children:\"Try a different search.\"})}):t.status===\"error\"?(0,B.jsx)(vn,{error:t.error}):(0,B.jsx)(Pe,{label:f?\"Searching\":\"Loading trends\"}):m=(0,B.jsxs)(B.Fragment,{children:[t.status===\"error\"&&(0,B.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),p,y.trends.length>0&&(0,B.jsxs)(\"section\",{\"aria-label\":\"Trends\",children:[!f&&(0,B.jsx)(\"h2\",{className:\"section-title\",children:\"Trends for you\"}),y.trends.map(h=>{let b=n.get(h)?.data;return b&&(0,B.jsxs)(\"button\",{type:\"button\",className:\"trend\",onClick:()=>i(oc(b.name)),children:[b.context&&(0,B.jsx)(\"span\",{className:\"post-meta\",children:b.context}),(0,B.jsx)(\"strong\",{children:b.name}),b.meta&&(0,B.jsx)(\"span\",{className:\"post-meta\",children:b.meta})]},h)})]}),y.people.length>0&&(0,B.jsxs)(\"section\",{\"aria-label\":\"People\",children:[d!==\"user\"&&(0,B.jsx)(\"h2\",{className:\"section-title\",children:\"People\"}),y.people.map(h=>{let b=l.get(h)?.data;return b&&(0,B.jsx)(BS,{person:b},h)})]}),y.results.length>0&&(0,B.jsx)(\"div\",{className:\"feed\",children:y.results.map(h=>{let b=a.get(h)?.data;return b&&(0,B.jsx)(Fa,{post:b,region:\"results\",actionable:S},h)})}),f&&(0,B.jsx)(ui,{stale:t.stale})]}),(0,B.jsxs)(Qe,{className:\"screen\",\"aria-busy\":t.stale||t.status===\"loading\",children:[(0,B.jsx)(\"form\",{role:\"search\",className:\"search-form\",onSubmit:h=>{h.preventDefault();let b=g.trim();b&&e({url:oc(b,d||void 0),mode:f?\"replace\":\"push\"})},children:(0,B.jsxs)(\"label\",{className:\"search-field\",children:[(0,B.jsx)(ve,{name:\"search\"}),(0,B.jsx)(\"span\",{className:\"visually-hidden\",children:\"Search X\"}),(0,B.jsx)(\"input\",{type:\"search\",enterKeyHint:\"search\",placeholder:\"Search\",value:g,onChange:h=>r(h.target.value)})]})}),f&&(0,B.jsx)(Ja,{label:\"Result type\",active:d,options:GS.map(h=>({...h,go:()=>e({url:oc(f,h.id||void 0),mode:\"replace\"})}))}),m]})}function BS({person:e}){let t=Ot();return(0,B.jsxs)(\"button\",{type:\"button\",className:\"person\",onClick:()=>t(xt(e.handle)),children:[(0,B.jsx)(gl,{src:e.avatar}),(0,B.jsxs)(\"span\",{className:\"person-body\",children:[(0,B.jsxs)(\"span\",{className:\"post-head\",children:[(0,B.jsx)(\"strong\",{children:e.name}),e.verified&&(0,B.jsx)(Za,{})]}),(0,B.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",e.handle]}),e.description&&(0,B.jsx)(\"span\",{className:\"person-bio\",children:e.description})]})]})}var Xl=L(et(),1);var Q=L(ae(),1);function t0(){let e=$a(),[t,n]=(0,Xl.useState)(\"\"),[l,a]=(0,Xl.useState)(!1),[u,i]=(0,Xl.useState)(\"\"),o=async(d,g,r)=>{a(!0),i(\"\");try{return await e.operate(d,g,r),!0}catch(s){return i(hn(s)),!1}finally{a(!1)}},c=async()=>{let d=ai(t);if(d){i(d);return}let g=crypto.randomUUID();await o(\"category.create\",{id:g,name:t},g)&&n(\"\")},f=e.categories.length;return(0,Q.jsxs)(Qe,{className:\"screen\",children:[(0,Q.jsx)(\"h1\",{className:\"screen-title\",children:\"Manage categories\"}),(0,Q.jsxs)(ii,{library:e,children:[(0,Q.jsxs)(\"p\",{className:\"post-meta\",children:[f,\" of \",50,\" categories\"]}),f<50&&(0,Q.jsxs)(\"form\",{className:\"row\",onSubmit:d=>{d.preventDefault(),c()},children:[(0,Q.jsxs)(\"label\",{className:\"grow\",children:[(0,Q.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,Q.jsx)(\"input\",{placeholder:\"New category\",value:t,maxLength:80,enterKeyHint:\"done\",disabled:l,onChange:d=>n(d.target.value)})]}),(0,Q.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:l||!t.trim(),children:\"Create\"})]}),u&&(0,Q.jsx)(\"p\",{role:\"status\",className:\"status\",children:u}),(0,Q.jsx)(\"div\",{className:\"category-list\",children:e.categories.map(d=>(0,Q.jsx)(kS,{category:d,busy:l,run:o},d.id))})]})]})}function kS({category:e,busy:t,run:n}){let[l,a]=(0,Xl.useState)(\"view\"),[u,i]=(0,Xl.useState)(e.name),[o,c]=(0,Xl.useState)(\"\");return l===\"rename\"?(0,Q.jsxs)(\"form\",{className:\"category\",onSubmit:async f=>{f.preventDefault();let d=ai(u);if(d){c(d);return}await n(\"category.rename\",{id:e.id,expectedRevision:e.revision,name:u},e.id)&&a(\"view\")},children:[(0,Q.jsxs)(\"label\",{children:[(0,Q.jsxs)(\"span\",{className:\"visually-hidden\",children:[\"Name for \",e.name]}),(0,Q.jsx)(\"input\",{value:u,maxLength:80,autoFocus:!0,enterKeyHint:\"done\",onChange:f=>{i(f.target.value),c(\"\")}})]}),o&&(0,Q.jsx)(\"p\",{className:\"field-error\",children:o}),(0,Q.jsxs)(\"div\",{className:\"actions\",children:[(0,Q.jsx)(\"button\",{type:\"submit\",className:\"primary\",disabled:t||!u.trim(),children:\"Save\"}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t,onClick:()=>{i(e.name),a(\"view\")},children:\"Cancel\"})]})]}):(0,Q.jsxs)(\"div\",{className:\"category\",children:[(0,Q.jsxs)(\"div\",{className:\"category-head\",children:[(0,Q.jsxs)(\"span\",{className:\"grow\",children:[(0,Q.jsx)(\"strong\",{children:e.name}),\" \",(0,Q.jsxs)(\"span\",{className:\"post-meta\",children:[e.count,\" \",e.count===1?\"post\":\"posts\"]})]}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"text-button\",disabled:t,onClick:()=>a(\"rename\"),children:\"Rename\"}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:t,onClick:()=>a(\"delete\"),children:\"Delete\"})]}),l===\"delete\"&&(0,Q.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":`Confirm deleting ${e.name}`,children:[(0,Q.jsx)(\"p\",{children:e.count?`Delete \\u201C${e.name}\\u201D? Move or remove its ${e.count} saved posts first.`:`Delete \\u201C${e.name}\\u201D?`}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:t,onClick:async()=>{await n(\"category.delete\",{id:e.id,expectedRevision:e.revision},e.id)&&a(\"view\")},children:\"Delete\"}),(0,Q.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:t,onClick:()=>a(\"view\"),children:\"Keep\"})]})]})}var De=L(ae(),1);function n0(){let{navigate:e,back:t,viewWebsite:n}=ge(),l=ct(),a=Nt(\"photos\",null),{handle:u,id:i,index:o}=l.params,c=Number(o)||1,f=g=>e({url:`${Re}/${u}/status/${i}/photo/${g}`,mode:\"replace\"}),d=l.stale||l.pageId!==\"media\"?null:a?.data??null;return(0,De.jsxs)(\"div\",{className:\"media-viewer\",children:[(0,De.jsx)(\"button\",{type:\"button\",className:\"media-close\",\"aria-label\":\"Close\",onClick:t,children:(0,De.jsx)(ve,{name:\"close\"})}),(0,De.jsx)(\"div\",{className:\"media-stage\",children:d?.image?(0,De.jsx)(\"img\",{src:d.image,alt:`Photo ${c}`,referrerPolicy:\"no-referrer\"}):l.status===\"error\"?(0,De.jsxs)(\"div\",{className:\"media-message\",children:[(0,De.jsx)(\"p\",{children:\"This photo couldn't be shown.\"}),(0,De.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>n(),children:[\"Open on X \",(0,De.jsx)(ve,{name:\"external\"})]})]}):(0,De.jsx)(\"p\",{className:\"media-message\",role:\"status\",children:\"Loading photo\\u2026\"})}),(0,De.jsxs)(\"div\",{className:\"media-nav\",children:[(0,De.jsx)(\"button\",{type:\"button\",className:\"icon-button\",\"aria-label\":\"Previous photo\",disabled:c<=1,onClick:()=>f(c-1),children:(0,De.jsx)(ve,{name:\"left\"})}),(0,De.jsx)(\"span\",{children:c}),(0,De.jsx)(\"button\",{type:\"button\",className:\"icon-button\",\"aria-label\":\"Next photo\",disabled:!d?.hasNext,onClick:()=>f(c+1),children:(0,De.jsx)(ve,{name:\"right\"})})]})]})}var Ue=L(ae(),1);function l0(){let e=ct(),t=pn(\"thread\"),n=Nt(\"empty\",null),a=(e.pageId===\"post\"?t.order:[]).flatMap(d=>{let g=t.get(d)?.data;return g?.kind===\"post\"?[{key:d,post:g.post}]:[]}),u=a.findIndex(({post:d})=>d.postId===e.params.id),i=e.account!==null&&!e.stale&&!t.ephemeral,o=({key:d,post:g},r=!1)=>(0,Ue.jsx)(Fa,{post:g,region:\"thread\",actionable:i,focus:r},d),c=e.pageId===\"post\"&&t.status===\"error\",f;if(u<0)f=e.status===\"error\"?(0,Ue.jsx)(vn,{error:e.error}):c?(0,Ue.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"This post couldn't be read.\"}):e.status===\"ready\"&&e.pageId===\"post\"?(0,Ue.jsx)(Ze,{title:n?.data??\"This post isn't available\",children:(0,Ue.jsx)(\"p\",{children:\"X has nothing to show for it.\"})}):(0,Ue.jsx)(Pe,{label:\"Loading post\",rows:3});else{let d=a.slice(u+1);f=(0,Ue.jsxs)(Ue.Fragment,{children:[e.status===\"error\"&&(0,Ue.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),c&&(0,Ue.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some replies couldn't be read.\"}),(0,Ue.jsxs)(\"div\",{className:\"feed thread\",children:[a.slice(0,u).map(g=>o(g)),o(a[u],!0)]}),d.length>0&&(0,Ue.jsx)(\"h2\",{className:\"section-title\",children:\"Replies\"}),(0,Ue.jsx)(\"div\",{className:\"feed\",children:d.map(g=>o(g))})]})}return(0,Ue.jsxs)(Qe,{className:\"screen\",\"aria-busy\":e.stale||e.status===\"loading\",children:[(0,Ue.jsx)(\"h1\",{className:\"screen-title\",children:\"Post\"}),f]})}var j=L(ae(),1),a0=[{id:\"\",label:\"Posts\"},{id:\"/with_replies\",label:\"Replies\"},{id:\"/media\",label:\"Media\"}];function u0(){let{navigate:e}=ge(),t=ct(),n=Nt(\"header\",null),l=pn(\"posts\"),a=Nt(\"empty\",null),u=t.params.handle??\"\",i=t.url?new URL(t.url).pathname:\"\",o=a0.find(y=>y.id&&i.endsWith(y.id))?.id??\"\",c=t.pageId===\"profile\",f=c?n?.data??null:null,d=c?l.order:[],g=t.account!==null&&!t.stale&&!l.ephemeral,r=c&&l.status===\"error\",s;return!f&&d.length===0?s=t.status===\"error\"?(0,j.jsx)(vn,{error:t.error}):r?(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}):(0,j.jsx)(Pe,{label:\"Loading profile\"}):s=(0,j.jsxs)(j.Fragment,{children:[t.status===\"error\"&&(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"}),f?(0,j.jsx)(YS,{profile:f}):(0,j.jsxs)(\"h1\",{className:\"screen-title\",children:[\"@\",u]}),(0,j.jsx)(Ja,{label:\"Profile sections\",active:o,options:a0.map(y=>({...y,go:()=>e({url:`${xt(u)}${y.id}`,mode:\"replace\"})}))}),d.length===0&&r?(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}):d.length===0?(0,j.jsx)(Ze,{title:a?.data??\"No posts yet\",children:(0,j.jsx)(\"p\",{children:f?\"Posts show up here.\":\"X has nothing to show for this account.\"})}):(0,j.jsxs)(j.Fragment,{children:[r&&(0,j.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Some posts couldn't be read.\"}),(0,j.jsx)(qf,{region:\"posts\",items:l,actionable:g}),(0,j.jsx)(ui,{stale:t.stale})]})]}),(0,j.jsx)(Qe,{className:\"screen profile-screen\",\"aria-busy\":t.stale||t.status===\"loading\",children:s})}function YS({profile:e}){let t=Ot();return(0,j.jsxs)(\"header\",{className:\"profile\",children:[(0,j.jsx)(\"div\",{className:\"banner\",children:e.banner&&(0,j.jsx)(\"img\",{src:e.banner,alt:\"\",referrerPolicy:\"no-referrer\"})}),(0,j.jsxs)(\"div\",{className:\"profile-top\",children:[(0,j.jsx)(gl,{src:e.avatar,size:80}),e.own&&(0,j.jsx)(Hf,{url:`${Re}/settings/profile`,label:\"Edit profile\"})]}),(0,j.jsxs)(\"h1\",{className:\"profile-name\",children:[e.name,e.verified&&(0,j.jsx)(Za,{})]}),(0,j.jsxs)(\"p\",{className:\"post-meta\",children:[\"@\",e.handle]}),e.description&&(0,j.jsx)(\"p\",{className:\"post-text\",dir:\"auto\",children:e.description}),e.details&&(0,j.jsx)(\"p\",{className:\"post-meta\",children:e.details}),e.links.length>0&&(0,j.jsx)(\"p\",{className:\"profile-links\",children:e.links.map(n=>(0,j.jsx)(\"a\",{href:n.url,onClick:l=>{l.preventDefault(),t(n.url)},children:n.label},n.url))})]})}var Gt=L(et(),1);var U=L(ae(),1);function VS(e){try{let t=JSON.parse(e??\"\");return wf(t?.postId)&&Cf(t.url)?.postId===t.postId&&Df(t.snapshot)?t:null}catch{return null}}function o0(){let{screen:e,back:t}=ge(),n=$a(),l=(0,Gt.useMemo)(()=>VS(e?.params.post),[e?.params.post]),[a,u]=(0,Gt.useState)(void 0),[i,o]=(0,Gt.useState)(null),[c,f]=(0,Gt.useState)(0),[d,g]=(0,Gt.useState)(!1),[r,s]=(0,Gt.useState)(\"\"),[y,S]=(0,Gt.useState)(\"\"),[x,p]=(0,Gt.useState)(!1),{service:m}=n,h=!!n.library&&!n.error&&!n.pending;if((0,Gt.useEffect)(()=>{if(!l||!h)return;let $=!0;return m.lookup(l.postId).then(xe=>{$&&(u(xe),o(xe?.categoryIds??[]))},xe=>{$&&s(hn(xe))}),()=>{$=!1}},[l,h,m,c]),!l)return(0,U.jsx)(\"div\",{className:\"screen\",children:(0,U.jsx)(Ze,{title:\"Can't file this post\",role:\"alert\",children:(0,U.jsx)(\"p\",{children:\"The post details are missing.\"})})});let b=new Set(n.categories.map($=>$.id)),N=(i??[]).filter($=>b.has($)),M=N.length>=10,A=$=>{let xe=$.code;s(xe===\"CONFLICT\"?\"This post's categories changed elsewhere. They were reloaded; review them and save again.\":hn($)),xe===\"CONFLICT\"&&(o(null),f(Kt=>Kt+1))},z=async()=>{g(!0),s(\"\");try{await n.operate(\"bookmark.setCategories\",{postId:l.postId,expectedRevision:a?.revision??null,categoryIds:N,...a?{}:{url:l.url,snapshot:l.snapshot}},l.postId),t()}catch($){A($)}finally{g(!1)}},fe=async()=>{if(a){g(!0),s(\"\");try{await n.operate(\"bookmark.remove\",{postId:l.postId,expectedRevision:a.revision},l.postId),t()}catch($){p(!1),A($)}finally{g(!1)}}},G=async()=>{let $=ai(y);if($){s($);return}g(!0),s(\"\");let xe=crypto.randomUUID();try{await n.operate(\"category.create\",{id:xe,name:y},xe),S(\"\"),M||o(Kt=>[...new Set([...Kt??[],xe])])}catch(Kt){s(hn(Kt))}finally{g(!1)}},rt=h&&a!==void 0&&i!==null;return(0,U.jsxs)(Qe,{className:\"screen\",children:[(0,U.jsx)(\"h1\",{className:\"screen-title\",children:a?\"Edit categories\":\"Save to categories\"}),(0,U.jsxs)(\"section\",{className:\"card\",children:[(0,U.jsxs)(\"p\",{className:\"post-head\",children:[(0,U.jsx)(\"strong\",{children:l.snapshot.authorName}),\" \",(0,U.jsxs)(\"span\",{className:\"post-meta\",children:[\"@\",l.snapshot.authorHandle]})]}),l.snapshot.text&&(0,U.jsx)(\"p\",{className:\"post-text clamp\",dir:\"auto\",children:l.snapshot.text}),(0,U.jsx)(\"p\",{className:\"post-meta\",children:\"Categories are kept by this app, separate from your X bookmarks.\"})]}),(0,U.jsx)(ii,{library:n,children:rt?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(\"fieldset\",{className:\"card\",disabled:d,children:[(0,U.jsx)(\"legend\",{children:\"Categories\"}),n.categories.length===0&&(0,U.jsx)(\"p\",{className:\"post-meta\",children:\"No categories yet. Create one below.\"}),n.categories.map($=>{let xe=N.includes($.id);return(0,U.jsxs)(\"label\",{className:\"check\",children:[(0,U.jsx)(\"input\",{type:\"checkbox\",checked:xe,disabled:!xe&&M,onChange:Kt=>{let ci=$.id;o(Wa=>Kt.target.checked?[...Wa??[],ci]:(Wa??[]).filter(ri=>ri!==ci))}}),(0,U.jsx)(\"span\",{className:\"grow\",children:$.name}),(0,U.jsx)(\"span\",{className:\"post-meta\",children:$.count})]},$.id)}),M&&(0,U.jsxs)(\"p\",{className:\"post-meta\",children:[\"A post can be in up to \",10,\" categories.\"]}),n.categories.length<50?(0,U.jsxs)(\"form\",{className:\"row\",onSubmit:$=>{$.preventDefault(),G()},children:[(0,U.jsxs)(\"label\",{className:\"grow\",children:[(0,U.jsx)(\"span\",{className:\"visually-hidden\",children:\"New category name\"}),(0,U.jsx)(\"input\",{placeholder:\"New category\",value:y,maxLength:80,enterKeyHint:\"done\",onChange:$=>S($.target.value)})]}),(0,U.jsx)(\"button\",{type:\"submit\",className:\"secondary\",disabled:!y.trim(),children:\"Create\"})]}):(0,U.jsxs)(\"p\",{className:\"post-meta\",children:[\"You have \",50,\" categories, the most allowed.\"]})]}),r&&(0,U.jsx)(\"p\",{role:\"status\",className:\"status\",children:r}),(0,U.jsxs)(\"div\",{className:\"actions\",children:[(0,U.jsx)(\"button\",{type:\"button\",className:\"primary\",disabled:d||N.length===0,onClick:()=>{z()},children:d?\"Saving\\u2026\":\"Save\"}),(0,U.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:d,onClick:t,children:\"Cancel\"}),a&&!x&&(0,U.jsx)(\"button\",{type:\"button\",className:\"text-button danger-text\",disabled:d,onClick:()=>p(!0),children:\"Remove from Categories\"})]}),N.length===0&&(0,U.jsx)(\"p\",{className:\"post-meta\",children:a?\"Choose a category, or remove the post from Categories.\":\"Choose at least one category.\"}),x&&(0,U.jsxs)(\"div\",{className:\"confirm\",role:\"group\",\"aria-label\":\"Confirm removal\",children:[(0,U.jsx)(\"p\",{children:\"Remove this post from Categories? Its X bookmark will stay unchanged.\"}),(0,U.jsx)(\"button\",{type:\"button\",className:\"danger\",disabled:d,onClick:()=>{fe()},children:\"Remove\"}),(0,U.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:d,onClick:()=>p(!1),children:\"Keep\"})]})]}):(0,U.jsx)(Pe,{label:\"Loading categories\",rows:3,kind:\"text\"})}),!n.error&&r&&!rt&&(0,U.jsx)(\"p\",{role:\"status\",className:\"status\",children:r})]})}var Ln=L(ae(),1),jS={home:rc,notifications:rc,saved:rc,explore:e0,post:l0,profile:u0,media:n0,account:Kh,categories:Wh,save:o0,manage:t0},XS=[{id:\"home\",label:\"Home\",icon:\"home\"},{id:\"explore\",label:\"Explore\",icon:\"search\"},{id:\"notifications\",label:\"Notifications\",icon:\"bell\"},{id:\"saved\",label:\"Saved\",icon:\"bookmark\"},{id:\"profile\",label:\"Profile\",icon:\"person\"}],QS={home:\"/home\",notifications:\"/notifications\",saved:\"/i/history\"};function ZS(e){let t=e?new URL(e).pathname:\"/home\";return t===\"/home\"?\"home\":t===\"/notifications\"?\"notifications\":t.startsWith(\"/i/history\")||t===\"/i/bookmarks\"?\"saved\":null}function r0(){let{screen:e,active:t,contexts:n,overlay:l,select:a,navigate:u,reload:i}=ge();uc(()=>i(\"account\"));let o=(0,c0.useRef)(\"home\"),c=ZS(n.primary?.url??null);c&&(o.current=c);let f=l.length>0?\"saved\":t===\"explore\"?\"explore\":t===\"account\"?\"profile\":c??o.current,d=r=>{r===\"explore\"?a(\"explore\"):r===\"profile\"?a(\"account\"):r===o.current&&(t!==\"primary\"||l.length>0||r===\"home\")?a(\"primary\"):u({url:`${Re}${QS[r]}`,context:\"primary\"})},g=e?jS[e.id]:void 0;return(0,Ln.jsxs)(\"div\",{className:e?.id===\"media\"?\"app viewing\":\"app\",children:[(0,Ln.jsx)(\"main\",{className:\"content\",children:g&&(0,Ln.jsx)(g,{},e.key)}),(0,Ln.jsx)(\"nav\",{className:\"tabs\",\"aria-label\":\"Sections\",children:XS.map(r=>{let s=r.id===f;return(0,Ln.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":s?\"page\":void 0,onClick:()=>{s&&l.length===0&&c===r.id&&r.id!==\"home\"?document.querySelector(\".screen\")?.scrollTo({top:0,behavior:\"smooth\"}):d(r.id)},children:[(0,Ln.jsx)(ve,{name:r.icon,filled:s}),(0,Ln.jsx)(\"span\",{children:r.label})]},r.id)})})]})}var s0=L(ae(),1);qh((0,s0.jsx)(r0,{}));})();\n"},{"path":"index.html","encoding":"utf8","content":"\n\n\n\n\nX\n\n\n\n\n
\n\n\n\n"}]} \ No newline at end of file diff --git a/x-bookmarks/published/applet-x-bookmarks.release.json b/x-bookmarks/published/applet-x-bookmarks.release.json index b73d508..2f6424f 100644 --- a/x-bookmarks/published/applet-x-bookmarks.release.json +++ b/x-bookmarks/published/applet-x-bookmarks.release.json @@ -2,10 +2,10 @@ "releaseFormat": 1, "appletId": "x-bookmarks", "name": "X", - "version": "0.1.0", + "version": "0.0.0", "bundle": { "file": "applet-x-bookmarks.bundle.json", - "sha256": "17dc77590f03244d2fec222f48c5ae85773453f5338286b77036655346db3718", + "sha256": "80e6fb3079decb5d1e49357b992c759877222f6e937c9540e9348916b3f633b5", "size": 357380 }, "compat": { @@ -15,7 +15,7 @@ "adapterApi": 1, "sdk": "0.0.0", "tools": "0.0.0", - "builtAt": "2026-11-09T11:21:14Z" + "builtAt": "2026-11-09T13:08:07Z" }, "origins": [ "https://x.com" @@ -27,7 +27,7 @@ ] }, "toolchain": { - "genesisCommit": "655ce128bce13bd8a376a3630766fb18182ba928", + "genesisCommit": "aebef4c113b0fc4fc676435237eb027e2035f816", "node": "24.15.0", "tools": "0.0.0", "sdk": "0.0.0" @@ -36,5 +36,5 @@ "fullName": "nirvanacp/applets", "path": "x-bookmarks" }, - "builtAt": "2026-11-09T11:21:14Z" + "builtAt": "2026-11-09T13:08:07Z" } From 327f10cb5bc24fb24754645844807f36f8b08821 Mon Sep 17 00:00:00 2001 From: Rit Date: Mon, 9 Nov 2026 18:38:28 +0530 Subject: [PATCH 9/9] feat/(gmail-only): reset the version to 0.0.0 and republish Co-Authored-By: Claude Opus 5.5 --- .../2026-11-09-183819-reset-version-0.0.0.md | 6 ++++++ gmail-only/.specs/current.md | 2 +- gmail-only/package.json | 2 +- gmail-only/published/applet-gmail-only.bundle.json | 2 +- gmail-only/published/applet-gmail-only.release.json | 10 +++++----- 5 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 gmail-only/.changelog/2026-11-09-183819-reset-version-0.0.0.md diff --git a/gmail-only/.changelog/2026-11-09-183819-reset-version-0.0.0.md b/gmail-only/.changelog/2026-11-09-183819-reset-version-0.0.0.md new file mode 100644 index 0000000..e67a702 --- /dev/null +++ b/gmail-only/.changelog/2026-11-09-183819-reset-version-0.0.0.md @@ -0,0 +1,6 @@ +# Reset the version to 0.0.0 + +- Goal: Start the applet's version history at 0.0.0 before its first pushed release, as the developer asked for every applet in this collection. +- Changes: `package.json` version 0.1.0 became 0.0.0. `genesis-applet publish` rewrote `published/applet-gmail-only.bundle.json` (SHA-256 `01a7cb9bf9ecb000…`, 444989 bytes) and `published/applet-gmail-only.release.json` for 0.0.0, built with Genesis commit `aebef4c113b0`. The current spec names the new published version. Sources, id, service ids and stored data are unchanged. +- Decisions: The developer chose 0.0.0 as the starting version. The local tag `gmail-only/v0.1.0` was never pushed, so it was deleted; the release tool would otherwise refuse 0.0.0 as lower than the last tag. No new tag was created. Later changes raise the patch version before each pull request and ask the developer before a minor or major raise, per the Genesis applet builder instructions. +- Verification: `genesis-applet publish` passed its checks. The Genesis commit must be pushed before CI can rebuild this build at that commit. diff --git a/gmail-only/.specs/current.md b/gmail-only/.specs/current.md index 3ae767e..39fc1f4 100644 --- a/gmail-only/.specs/current.md +++ b/gmail-only/.specs/current.md @@ -12,7 +12,7 @@ Name Gmail Only, id `gmail-only`, origin https://mail\.google\.com. Created 2026 | Adapter API | 1 | | SDK and tools | 0.0.0 | | Kit | 0.0.0 | -| Published release | 0.1.0, tag `gmail-only/v0.1.0`, in `published/` | +| Published release | 0.0.0 in `published/`, built with Genesis `aebef4c113b0`, not tagged yet | ## Product scope diff --git a/gmail-only/package.json b/gmail-only/package.json index e892274..1c84f77 100644 --- a/gmail-only/package.json +++ b/gmail-only/package.json @@ -1,6 +1,6 @@ { "name": "gmail-only", - "version": "0.1.0", + "version": "0.0.0", "private": true, "type": "module", "engines": { diff --git a/gmail-only/published/applet-gmail-only.bundle.json b/gmail-only/published/applet-gmail-only.bundle.json index e0deb70..c3cc925 100644 --- a/gmail-only/published/applet-gmail-only.bundle.json +++ b/gmail-only/published/applet-gmail-only.bundle.json @@ -1 +1 @@ -{"envelope":1,"bundle":{"format":3,"compat":{"manifestSchema":6,"bundleFormat":3,"protocol":1,"adapterApi":1,"sdk":"0.0.0","tools":"0.0.0","builtAt":"2026-11-09T11:21:15Z"},"manifest":{"schemaVersion":6,"id":"gmail-only","name":"Gmail Only","origins":["https://mail.google.com"],"foreground":{"entry":"src/main.tsx","screens":["mail","todo","item","add","bulk","search","settings","accounts","account-setup","snoozed","menu"]},"adapter":"src/adapter.ts","contexts":[{"id":"primary","startUrl":"https://mail.google.com/mail/u/0/"}],"routes":[{"id":"mail","pattern":"/mail/*","page":"mail","screen":"mail","context":"primary"},{"id":"root","pattern":"/","page":"mail","screen":"mail","context":"primary"}],"capabilities":{"storage":true},"shell":{"accent":"#2347d9"}},"files":[{"path":"adapter.js","sha256":"4cfbe976a517eb7cd38fafa65e6ecbb60b01ab13de90956f95d8c390f1ef2a9a"},{"path":"foreground.css","sha256":"1f8afcbc2ceb8b81e8498f34d2fe8a82faa8af0e7e98d931e093cd2bf0de9e6f"},{"path":"foreground.js","sha256":"c4c2cd291d96febc206a54928495245b836ea20fa6b78c4f0bae5b2e47552915"},{"path":"index.html","sha256":"b19327387a3eb3bc797318bf6f660fb14d55f4031300a0aa85de91f63bd31844"}]},"entries":[{"path":"adapter.js","encoding":"utf8","content":"(()=>{var P={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1};var gt=/^:[A-Za-z][A-Za-z0-9_]*$/,ht=/^[A-Za-z0-9_.~@-]+$/,le=new Map;function yt(e){if(le.has(e))return le.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),r=n.at(-1)===\"*\";r&&n.pop();let s=[],o=!0;for(let i of n)gt.test(i)?s.push({param:i.slice(1)}):ht.test(i)&&i!==\".\"&&i!==\"..\"?s.push({literal:i}):o=!1;o&&(t={segments:s,rest:r})}return le.set(e,t),t}function de(e){try{return new URL(e).href}catch{return null}}function fe(e,t){let n=vt(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let r;try{r=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}r.at(-1)===\"\"&&r.pop();for(let s of e.routes){let o=yt(s.pattern);if(!o)continue;let i=Et(o,r);if(!i||!(s.query??[]).every(a=>n.searchParams.has(a)))continue;for(let a of s.query??[])i[a]=n.searchParams.get(a);let l={kind:\"route\",routeId:s.id,page:s.page,screen:s.screen,params:i};return s.context!==void 0&&(l.context=s.context),l}return{kind:\"website\",url:t}}function vt(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function Et(e,t){if(e.rest?t.length{let s=null,o=!1,i=1,l=new Map,a=new Map,u={get bound(){return s},get retired(){return o},request(y,g={}){if(o)return Promise.reject(new T(\"RETIRED\",\"This page was closed\"));let A=i++;return new Promise((O,D)=>{let N=setTimeout(()=>{l.delete(A),D(new T(\"DEADLINE\",`${y} did not answer in time`))},s.limits.rpcDeadlineMs+wt);l.set(A,{resolve:O,reject:D,timer:N}),e.postMessage(JSON.stringify({type:\"request\",documentId:s.documentId,requestId:A,method:y,params:g}))})},on(y,g){let A=a.get(y);return A||a.set(y,A=new Set),A.add(g),()=>{A.delete(g)}}};function f(){o=!0;for(let y of l.values())clearTimeout(y.timer),y.reject(new T(\"RETIRED\",\"This page was closed\"));l.clear()}function p(y,g){for(let A of[...a.get(y)??[]])try{A(g)}catch(O){console.error(`Genesis ${y} handler failed`,O)}}e.addEventListener(\"message\",y=>{if(o||typeof y.data!=\"string\")return;let g;try{g=JSON.parse(y.data)}catch{return}if(g?.type===\"refused\"&&!s){o=!0,r(new T(g.error?.code??\"PROTOCOL_MISMATCH\",g.error?.message??\"The host refused this page\"));return}if(g?.type===\"bound\"){if(s)return;s=g,n(u);return}if(!(!s||g?.documentId!==s.documentId))if(g.type===\"response\"){let A=l.get(g.requestId);if(!A)return;l.delete(g.requestId),clearTimeout(A.timer),g.error?A.reject(new T(g.error.code,g.error.message)):A.resolve(g.result??null)}else g.type===\"event\"&&(g.name===\"retired\"?(f(),p(\"retired\",{})):p(g.name,g.data))}),addEventListener(\"pagehide\",()=>{o||(p(\"pagehide\",{}),f())});let b={type:\"hello\",protocol:P.protocol,url:t};e.postMessage(JSON.stringify(b))})}var bt=100;function kt(e){let t=new Map,n=Promise.resolve();return{act(r){let s={request:r,arrived:Date.now(),view:e.view(),cancelled:!1,dispatched:!1,stopped:!1};t.set(r.actionId,s),n=n.then(()=>At(e,s)).catch(o=>{console.error(\"Genesis action failed\",o)}).finally(()=>{t.delete(r.actionId)})},cancel(r){let s=t.get(r);s&&!s.dispatched&&(s.cancelled=!0)},retire(){for(let r of t.values())r.stopped=!0}}}async function At(e,t){let{connection:n,limits:r}=e,{actionId:s}=t.request,o,i=(S,_,C)=>{if(t.stopped)return Promise.resolve();let M={actionId:s,state:S};return C&&(M.navigating=!0),C&&o&&(M.expect=o),_&&(M.result=_),n.request(\"context.actionResult\",M).then(()=>{},()=>{})},l=(S,_,C)=>{let M={outcome:\"failed\",code:S,message:_};return C!==void 0&&Object.assign(M,{completedSteps:C,partial:C>0}),i(\"failed\",M)},a=()=>i(\"cancelled\",{outcome:\"cancelled\"});if(t.stopped)return;if(t.cancelled)return a();if((t.request.view??t.view)!==t.view||e.view()!==t.view)return l(\"CONTEXT_REPLACED\",\"The page the action was for has been replaced\");let u=e.find(t.request);if(\"error\"in u)return l(u.error.code,u.error.message);let f=u.element();if(f===void 0)return l(\"TARGET_NOT_FOUND\",\"The item is no longer on the page\");let p;try{p=u.action(f,t.request.args)}catch(S){return l(\"INVALID_STEPS\",De(S))}if(typeof p?.then==\"function\")return l(\"INVALID_STEPS\",\"An action must return its steps synchronously\");if(p&&\"satisfied\"in p&&p.satisfied===!0)return i(\"observed\",{outcome:\"observed\",noop:!0});let b=It(p);if(b)return l(\"INVALID_STEPS\",b);let{steps:y,until:g,deadlineMs:A}=p;o=p.expect;let O=p.navigates===!0||Pe(y.at(-1)),D=t.arrived+(A??r.actionTimeoutMs),N=0,H=S=>(t.dispatched=!0,i(\"dispatched\",void 0,S)),K=n.on(\"pagehide\",()=>{!t.dispatched&&!t.stopped&&N>0&&H(!0),t.stopped=!0}),X=()=>t.stopped||t.cancelled;try{for(let[S,_]of y.entries()){if(t.stopped)return;if(t.cancelled)return a();if(Date.now()>=D)return l(\"DEADLINE\",\"The action did not finish in time\",N);if(S>0&&Le(y[S-1])&&u.element()===void 0)return l(\"TARGET_NOT_FOUND\",\"The item left the page during the action\",N);if(O&&S===y.length-1&&!Le(_)){if(ge(_),await H(!0),t.stopped)return;ge(_)();return}await _t(_,D,X),N++}if(t.stopped)return;if(t.cancelled)return a();if(await H(O),O)return;if(g!==void 0){let S=typeof g==\"string\"?()=>document.querySelector(g)!==null:()=>g(document)===!0;try{await he(S,D-Date.now(),\"the action to take effect\",()=>t.stopped)}catch{return i(\"failed\",{outcome:\"unknown\",code:\"DEADLINE\",message:\"The page did not show the action's effect in time\",completedSteps:N,partial:N>0})}}if(t.stopped)return;e.flush(),await i(\"observed\",{outcome:\"observed\"})}catch(S){let _=S instanceof T?S.code:\"INVALID_ARGUMENT\";return l(_,De(S),N)}finally{K()}}function It(e){if(typeof e!=\"object\"||e===null)return\"An action must return { satisfied: true } or { steps }\";let{steps:t,until:n}=e;if(!Array.isArray(t))return\"An action must return { satisfied: true } or { steps }\";for(let[r,s]of t.entries()){let o=St(s);if(o)return`Step ${r}: ${o}`;if(Pe(s)&&r!==t.length-1)return\"A navigate or submit step must be the last step\"}return n!==void 0&&typeof n!=\"string\"&&typeof n!=\"function\"?\"until must be a selector or a function\":null}function St(e){if(typeof e!=\"object\"||e===null)return\"must be an object\";let t=e,n=r=>typeof r==\"string\"&&r!==\"\";if(\"click\"in t)return n(t.click)?null:\"click needs a selector\";if(\"fill\"in t)return n(t.fill)&&typeof t.value==\"string\"?null:\"fill needs a selector and a string value\";if(\"submit\"in t)return n(t.submit)?null:\"submit needs a selector\";if(\"navigate\"in t)return n(t.navigate)?null:\"navigate needs a URL\";if(\"waitFor\"in t||\"waitForUrl\"in t)return n(t.waitFor??t.waitForUrl)&&typeof t.timeoutMs==\"number\"?null:\"a wait needs a selector or pattern and timeoutMs\";if(\"scroll\"in t){let r=t.scroll;return r&&n(r.target)&&(r.to===\"end\"||typeof r.to==\"number\")?null:\"scroll needs a target and to\"}return\"unknown step\"}var Pe=e=>e!==void 0&&(\"navigate\"in e||\"submit\"in e),Le=e=>\"waitFor\"in e||\"waitForUrl\"in e,De=e=>String(e?.message??e);function Y(e){let t=document.querySelector(e);if(!t)throw new T(\"NOT_FOUND\",`Nothing matches ${e}`);return t}async function _t(e,t,n){let r=()=>Math.max(0,t-Date.now());if(\"waitFor\"in e)await he(()=>document.querySelector(e.waitFor)!==null,Math.min(e.timeoutMs,r()),e.waitFor,n);else if(\"waitForUrl\"in e){let s=new RegExp(e.waitForUrl);await he(()=>s.test(location.href),Math.min(e.timeoutMs,r()),e.waitForUrl,n)}else ge(e)()}function ge(e){if(\"click\"in e){let t=Y(e.click);return()=>t.click()}if(\"fill\"in e){let t=Y(e.fill);return()=>xt(t,e.value)}if(\"submit\"in e){let t=Y(e.submit),n=t instanceof HTMLFormElement?t:t.closest(\"form\");if(!n)throw new T(\"NOT_FOUND\",`${e.submit} is not in a form`);let r=t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t:void 0;return()=>n.requestSubmit(r)}if(\"navigate\"in e){let t=e.navigate;return()=>location.assign(t)}if(\"scroll\"in e){let{target:t,to:n}=e.scroll,r=t===\"window\"?document.scrollingElement??document.documentElement:Y(t);return()=>{r.scrollTop=n===\"end\"?r.scrollHeight:n}}throw new T(\"INVALID_STEPS\",\"A wait step does not run on its own\")}function xt(e,t){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new T(\"INVALID_STEPS\",\"fill needs an input or textarea\");let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(n,\"value\")?.set?.call(e,t),e.dispatchEvent(new Event(\"input\",{bubbles:!0})),e.dispatchEvent(new Event(\"change\",{bubbles:!0}))}function he(e,t,n,r){let s=Date.now()+t;return new Promise((o,i)=>{let l=()=>{try{return e()}catch{return!1}},a=()=>{r()||l()?o():Date.now()>=s?i(new T(\"DEADLINE\",`Timed out waiting for ${n}`)):setTimeout(a,bt)};a()})}var Ce=new WeakMap;function $e(e){let t=Ce.get(e);return t===void 0&&Ce.set(e,t=JSON.stringify(e)),t}function ye(e,t){return e===t?!0:e!==null&&t!==null&&$e(e)===$e(t)}function Q(e,t){return e?.code===t?.code&&e?.message===t?.message}function Tt(e,t){if(e.kind!==t.kind)return{kind:\"replace\",region:t};if(t.kind===\"single\"){let f=e;if(ye(f.record,t.record)&&f.status===t.status&&Q(f.error,t.error))return null;let p={kind:\"single\",record:t.record};return f.status!==t.status&&(p.status=t.status),Q(f.error,t.error)||(p.error=t.error??null),p}let n=e;if(!!n.ephemeral!=!!t.ephemeral||t.ephemeral)return Ot(n,t)?null:{kind:\"replace\",region:t};let r=new Map(n.items.map(f=>[f.key,f])),s=new Set,o=[];for(let f of t.items){s.add(f.key);let p=r.get(f.key);(!p||!ye(p,f))&&o.push(f)}let i=n.items.filter(f=>!s.has(f.key)).map(f=>f.key),l=t.items.map(f=>f.key),a=l.length!==n.items.length||l.some((f,p)=>n.items[p].key!==f),u={kind:\"collection\"};return o.length&&(u.upsert=o),i.length&&(u.remove=i),a&&(u.order=l),n.complete!==t.complete&&(u.complete=t.complete),n.status!==t.status&&(u.status=t.status),Q(n.error,t.error)||(u.error=t.error??null),Object.keys(u).length>1?u:null}function Ot(e,t){return e.complete===t.complete&&e.status===t.status&&Q(e.error,t.error)&&!!e.ephemeral==!!t.ephemeral&&e.items.length===t.items.length&&e.items.every((n,r)=>ye(n,t.items[r]))}function Mt(e,t,n=1/0){let r=e.slice(),s=i=>r.findIndex(l=>l.key===i),o=-1;for(let[i,l]of t.entries()){let a=s(l.key);if(a!==-1){r[a]=l,o=a;continue}let u=o+1;o===-1&&(u=t.slice(i+1).map(p=>s(p.key)).find(p=>p!==-1)??r.length),r.splice(u,0,l),o=u}return r.length>n?je(r,new Set(t.map(i=>i.key)),n):r}function je(e,t,n){if(e.length<=n)return e;let r=-1,s=0;for(let[l,a]of e.entries())t.has(a.key)&&(r===-1&&(r=l),s=l);r===-1&&(r=0);let o=Math.max(n,s-r+1),i=Math.min(Math.max(0,Math.floor((r+s+1-o)/2)),e.length-o);return e.slice(i,i+o)}function Rt(e){return new Set(e).size===e.length?{keys:e,ephemeral:!1}:{keys:e.map((t,n)=>String(n)),ephemeral:!0}}function Nt(e,t,n){let r=new Map,s=o=>{let i=r.get(o);return i||r.set(o,i={keys:new Set,whole:!1,membership:!1,resolve:!1}),i};for(let[o,i]of Object.entries(e)){let l=t.some(a=>a.kind===\"childList\");if(!i.root){l&&(s(o).resolve=!0);continue}if(!pe(i.root,n)){s(o).resolve=!0;continue}(i.dependsOn.some(a=>!pe(a,n))||i.dependsOnMissing&&l)&&(s(o).whole=!0);for(let a of t){if(a.kind===\"field\"&&!i.fields||a.kind===\"resize\"&&!i.measure)continue;a.removed&&pe(i.root,a.target)&&(s(o).whole=!0);let u=Fe(i,a.target);u.dependent&&(s(o).whole=!0),u.inRoot&&(a.kind===\"childList\"&&(s(o).membership=!0),u.key===void 0?s(o).whole=!0:s(o).keys.add(u.key))}}return r}function Lt(e,t){let n=Fe(e,t);return n.inRoot||n.dependent}function Fe(e,t){let n,r=!1,s=!1;for(let o=t;o;o=o.parentNode)n??=e.items.get(o),o===e.root&&(r=!0),e.dependsOn.includes(o)&&(s=!0);return n!==void 0&&(r=!0),{key:n,inRoot:r,dependent:s}}function pe(e,t){for(let n=e;n;n=n.parentNode)if(n===t)return!0;return!1}function Dt(e){let t=new MutationObserver(o=>{let i=[];for(let l of o){i.push({target:l.target,kind:l.type});for(let a of l.removedNodes)i.push({target:a,kind:\"childList\",removed:!0})}e(i)});t.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let n=o=>{o.target instanceof Node&&e([{target:o.target,kind:\"field\"}])};document.addEventListener(\"input\",n,!0),document.addEventListener(\"change\",n,!0);let r=new WeakMap,s=typeof ResizeObserver==\"function\"?new ResizeObserver(o=>{let i=[];for(let l of o){let a=`${l.contentRect.width}x${l.contentRect.height}`,u=r.get(l.target);r.set(l.target,a),u!==void 0&&u!==a&&i.push({target:l.target,kind:\"resize\"})}i.length&&e(i)}):null;return{measure(o){if(s){s.disconnect();for(let i of o)s.observe(i)}},disconnect(){t.disconnect(),s?.disconnect(),document.removeEventListener(\"input\",n,!0),document.removeEventListener(\"change\",n,!0)}}}function Ct(e){for(let t of[\"pushState\",\"replaceState\"]){let n=History.prototype[t];History.prototype[t]=function(...r){let s=n.apply(this,r);try{e()}catch(o){console.error(\"Genesis navigation handler failed\",o)}return s}}addEventListener(\"popstate\",e),addEventListener(\"hashchange\",e)}var $t=new TextEncoder,Z=e=>$t.encode(JSON.stringify(e)).length,Gt=class{constructor(e,t,n=()=>null){this.send=e,this.limits=t,this.shrink=n}send;limits;shrink;epoch=0;seq=0;last=null;page(e){let t={...e,epoch:++this.epoch};for(;Z(t)>this.limits.pageMaxBytes;){let n=this.shrink(t);if(!n){t={...t,status:\"error\",error:{code:\"PAGE_TOO_LARGE\",message:\"The page is too large to show\"},regions:{}};break}t={...n,epoch:t.epoch}}this.seq=0,this.last=t,this.post({page:t})}update(e){let t=this.last;if(!t||!qt(t,e))return this.page(e);let n={};for(let[o,i]of Object.entries(e.regions)){let l=Tt(t.regions[o],i);l&&(n[o]=l)}let r=e.account!==void 0&&e.account!==t.account;if(!r&&Object.keys(n).length===0)return;let s=this.split(n);if(r&&(s[s.length-1].account=e.account),s.some(o=>Z(o)>this.limits.patchMaxBytes))return this.page(e);this.last={...e,epoch:this.epoch};for(let o of s)this.post({patch:o})}split(e){let t=[],n={};for(let[a,u]of Object.entries(e)){if(u.kind!==\"collection\"||!u.upsert){n[a]=u;continue}let{upsert:f,...p}=u;for(let b of f)t.push([a,b]);Object.keys(p).length>1&&(n[a]=p)}let r=this.limits.patchMaxBytes-Z(n)-256,s=[],o=[],i=0;for(let a of t){let u=Z(a[1])+1;o.length&&(o.length>=this.limits.patchRecordsMax||i+u>r)&&(s.push(o),o=[],i=0),o.push(a),i+=u}s.push(o);let l=this.last.view;return s.map((a,u)=>{let f={view:l,epoch:this.epoch,base:this.seq,seq:++this.seq,regions:{}};for(let[p,b]of a)(f.regions[p]??={kind:\"collection\",upsert:[]}).upsert.push(b);if(u===s.length-1)for(let[p,b]of Object.entries(n))f.regions[p]={...f.regions[p],...b};return f})}post(e){this.send(e).catch(t=>{let n=t instanceof T?t.code:null;if(n!==\"RETIRED\"){if(\"patch\"in e&&this.last&&e.patch.epoch===this.epoch){let{epoch:r,...s}=this.last;return this.page(s)}if(\"page\"in e&&n===\"PAGE_TOO_LARGE\"&&e.page.status!==\"error\"){let{epoch:r,...s}=e.page;return this.page({...s,status:\"error\",error:{code:n,message:\"The page is too large to show\"},regions:{}})}console.error(\"Genesis could not publish the page\",t)}})}};function qt(e,t){let n=Object.keys(t.regions);return e.view.generation===t.view.generation&&e.view.n===t.view.n&&e.view.url===t.view.url&&e.status===t.status&&e.pageId===t.pageId&&e.routeId===t.routeId&&e.error?.code===t.error?.code&&e.error?.message===t.error?.message&&e.signInUrl===t.signInUrl&&JSON.stringify(e.params)===JSON.stringify(t.params)&&n.length===Object.keys(e.regions).length&&n.every(r=>e.regions[r]?.kind===t.regions[r].kind)}function Ut(e,t,n){let r,s,o=()=>{clearTimeout(r),r=void 0,s=void 0,e()};return{schedule(){let i=Date.now();s??=i,clearTimeout(r),r=setTimeout(o,Math.min(t,Math.max(0,s+n-i)))},now(){r!==void 0&&o()},cancel(){clearTimeout(r),r=void 0,s=void 0}}}var Bt=1e4,Ge=!1;function ve(e){if(typeof window>\"u\"||window.top!==window||Ge)return;Ge=!0;let t=window,n=t.__genesisBridge;try{delete t.__genesisBridge}catch{t.__genesisBridge=void 0}if(!n)return;let r=null;Ct(()=>r?.navigated());let s=()=>Ne(n,location.href).then(o=>{r=Pt(o,e)},o=>console.error(\"Genesis could not bind this page\",o));s(),addEventListener(\"pageshow\",o=>{o.persisted&&(r?.stop(),r=null,s())})}function Pt(e,t){let{manifest:n,limits:r,generation:s}=e.bound,o={batches:0,reads:0,lastBatchReads:0,pages:0,patches:0,lastPublishBytes:0,resyncs:0,startedAt:Date.now()},i=!1;i&&(window.__genesisStats=o);let l=new Gt(c=>(i&&(\"page\"in c?o.pages++:o.patches++,o.lastPublishBytes=JSON.stringify(c).length),e.request(\"context.publish\",c)),r,ft),a={generation:s,n:0,url:location.href};if(e.bound.compat.adapterApi!==P.adapterApi){let c=`This applet uses adapter API ${P.adapterApi}; this Genesis uses ${e.bound.compat.adapterApi}`;return console.error(`Genesis: ${c}`),l.page({view:a,pageId:null,routeId:null,params:{},status:\"error\",error:{code:\"PROTOCOL_MISMATCH\",message:c},account:null,regions:{}}),{navigated(){},stop(){}}}let u=!1,f=de(location.href),p=fe(n,location.href),b=D(p),y=null,g=new Map,A=[],O=!1;function D(c){return c.kind===\"route\"?t.pages[c.page]??null:null}function N(){let c=b?.account??t.account;try{let d=c?.(document);return d===void 0&&c?{account:void 0,failed:!1}:{account:typeof d==\"string\"&&d!==\"\"?d:null,failed:!1}}catch(d){return console.error(\"Genesis adapter account failed\",d),{account:void 0,failed:!0}}}function H(){let c=t.signInUrl;try{if(typeof c==\"string\")return new URL(c,n.origins[0]).href;if(typeof c==\"function\")return new URL(c(location.href),location.href).href}catch(d){console.error(\"Genesis adapter signInUrl failed\",d)}return null}function K({account:c,failed:d}){if(p.kind!==\"route\")return{status:\"unsupported\"};if(!b)return{status:\"error\",error:{code:\"NOT_FOUND\",message:`The adapter declares no page ${p.page}`}};let h;try{h=b.ready(document)===!0}catch(v){return{status:\"error\",error:{code:\"INVALID_ARGUMENT\",message:Be(v)}}}if(b.requiresAccount===!0&&d)return{status:\"loading\"};let m=b.requiresAccount===!0&&c===null;return h?{status:m?\"auth\":\"ready\"}:m&&document.readyState!==\"loading\"?{status:\"auth\"}:{status:\"loading\"}}function X(c,d){let h={view:a,pageId:p.kind===\"route\"?p.page:null,routeId:p.kind===\"route\"?p.routeId:null,params:p.kind===\"route\"?p.params:{},status:d.status,signInUrl:H(),regions:{}};c!==void 0&&(h.account=c),d.error&&(h.error=d.error);for(let[m,v]of g)h.regions[m]=v.value;return h}function S(c,d,h){let m={name:c,def:d,root:null,items:new WeakMap,elements:new Map,dependsOn:[],dependsOnMissing:!1,value:h?.value??jt(d)};for(let v of d.dependsOn??[]){let E=[...document.querySelectorAll(v)];E.length===0&&(m.dependsOnMissing=!0),m.dependsOn.push(...E)}return m.root=document.querySelector(d.root),_(m,()=>d.kind===\"collection\"?M(m,d,\"all\"):C(m,d)),m}function _(c,d){try{c.value=d()}catch(h){let m=h instanceof T?h.code:\"INVALID_ARGUMENT\";c.value={...c.value,status:\"error\",error:{code:m,message:`${c.name}: ${Be(h)}`}}}}function C(c,d){let h=c.root;return h?{kind:\"single\",status:\"ready\",record:_e(d,h,d.key?ee(d.key,h):c.name)}:{kind:\"single\",status:\"ready\",record:null}}function M(c,d,h){let m=c.value,v=c.root?[...c.root.querySelectorAll(d.items)]:[],{keys:E,ephemeral:k}=Rt(v.map(L=>ee(d.key,L))),I=m.ephemeral?new Map:new Map(m.items.map(L=>[L.key,L])),R=c.elements;c.elements=new Map;let x=v.map((L,mt)=>{let V=E[mt];c.elements.set(V,L);let Me=I.get(V);return h!==\"all\"&&Me&&!h.has(V)&&R.get(V)===L?Me:Se(c,d,L,V)}),q={kind:\"collection\",status:\"ready\",items:d.virtualized&&!k&&!m.ephemeral?Mt(m.items,x,r.patchRecordsMax):x,complete:me(d)};return k&&(q.ephemeral=!0),q}function Se(c,d,h,m){let v=_e(d,h,m);c.items.set(h,m);for(let E of d.extent?.(h)??[])E&&c.items.set(E,m);return v}function _e(c,d,h){o.reads++;let m=c.read(d);if(typeof m?.then==\"function\")throw new T(\"ASYNC_READ\",\"read must return its data synchronously\");let v={key:h,data:m===void 0?null:m};return c.entity&&(v.entity=c.entity(d)),c.entityType&&(v.entityType=c.entityType),v}function ut(c,d,h){let m=c.value;if(m.ephemeral||m.status===\"error\")return _(c,()=>M(c,d,h));let v=m.items.slice();for(let E of h){let k=c.elements.get(E),I=v.findIndex(x=>x.key===E);if(!(k?.isConnected&&c.root?.contains(k)&&k.matches(d.items))||I===-1||ee(d.key,k)!==E)return _(c,()=>M(c,d,h));try{v[I]=Se(c,d,k,E)}catch{return _(c,()=>M(c,d,h))}}c.value={...m,items:v,complete:me(d)}}function dt(c,d){let{def:h}=c;d.resolve||d.whole||h.kind===\"single\"?g.set(c.name,S(c.name,h,c)):d.membership?_(c,()=>M(c,h,d.keys)):ut(c,h,d.keys)}function ft(c){if(c.view.n!==a.n)return null;let d={...c,regions:{...c.regions}},h=!1;for(let[m,v]of Object.entries(c.regions)){let E=g.get(m);if(E?.def.kind!==\"collection\"||!E.def.virtualized||v.kind!==\"collection\"||v.ephemeral)continue;let k=je(v.items,new Set(E.elements.keys()),Math.floor(v.items.length*3/4));k.length!==v.items.length&&(d.regions[m]={...v,items:k},E.value===v&&(E.value=d.regions[m]),h=!0)}return h?d:null}function ie(c=!1){if(u)return;A=[],O=!1;let d=N(),{account:h}=d,m=K(d),v=g;if(g=new Map,m.status===\"ready\")for(let[k,I]of Object.entries(b?.regions??{}))g.set(k,S(k,I,v.get(k)));y=m.status;let E=X(h,m);c?l.page(E):l.update(E),Te()}function xe(){if(u)return;o.batches++;let c=o.reads,d=A,h=O;A=[],O=!1;let m=N(),{account:v}=m,E=K(m);if(E.status!==\"ready\"||y!==\"ready\"||h)ie();else{let k={};for(let[I,R]of g)k[I]=qe(R);for(let[I,R]of Nt(k,d,document))dt(g.get(I),R);for(let I of g.values()){let R=I.value;if(I.def.kind===\"collection\"&&R.kind===\"collection\"&&I.def.more){let x=me(I.def);x!==R.complete&&(I.value={...R,complete:x})}}l.update(X(v,E)),Te()}o.lastBatchReads=o.reads-c}function Te(){let c=[];for(let d of g.values())d.def.measure&&(d.def.kind===\"single\"?d.root&&c.push(d.root):c.push(...d.elements.values()));Oe.measure(c)}let G=Ut(xe,r.publishQuietMs,r.publishMaxDelayMs),Oe=Dt(c=>{if(!u){if(y===\"ready\"&&!O){let d=[...g.values()].map(qe);A.push(...c.filter(h=>h.kind!==\"attributes\"||d.some(m=>Lt(m,h.target)))),A.length>Bt&&(A=[],O=!0)}G.schedule()}}),ce=kt({connection:e,limits:r,flush:()=>{G.cancel(),xe()},find:pt,view:()=>a.n});function pt(c){let d=(x,q)=>({error:{code:x,message:q}});if(y!==\"ready\"||!b)return d(\"NOT_READY\",\"The page is not ready\");let h=a.n;if(c.region===null){let x=b.actions?.[c.name];return x?{action:x,element:()=>null}:d(\"INVALID_ARGUMENT\",`The page has no action ${c.name}`)}let m=c.region,v=g.get(m);if(!v)return d(\"NOT_FOUND\",`The page has no region ${m}`);let E=v.def.actions?.[c.name];if(!E)return d(\"INVALID_ARGUMENT\",`Region ${m} has no action ${c.name}`);let k=v.def;if(k.kind===\"single\")return{action:E,element:()=>a.n===h?document.querySelector(k.root)??void 0:void 0};if(v.value.ephemeral)return d(\"PRECONDITION_FAILED\",`Region ${m} repeats keys, so its records have no actions`);let I=c.key;if(I===null)return d(\"INVALID_ARGUMENT\",`Action ${c.name} needs a record key`);let R=()=>{if(a.n!==h)return;let x=g.get(m)?.elements.get(I);if(x?.isConnected&&Ue(k,x)===I)return x;let q=document.querySelector(k.root);return q?[...q.querySelectorAll(k.items)].find(L=>Ue(k,L)===I):void 0};return R()===void 0?d(\"TARGET_NOT_FOUND\",`No ${m} item has key ${I}`):{action:E,element:R}}function ae(c=!0){u||(u=!0,G.cancel(),Oe.disconnect(),c&&ce.retire())}return e.on(\"resync\",()=>{o.resyncs++,G.cancel(),ie(!0)}),e.on(\"act\",c=>ce.act(c)),e.on(\"cancel\",({actionId:c})=>ce.cancel(c)),e.on(\"ping\",()=>{}),e.on(\"retired\",()=>ae()),e.on(\"pagehide\",()=>ae(!1)),document.readyState===\"loading\"&&document.addEventListener(\"DOMContentLoaded\",()=>G.schedule(),{once:!0}),ie(),{navigated(){if(u)return;let c=de(location.href);c!==f&&(f=c,a={generation:s,n:a.n+1,url:location.href},p=fe(n,location.href),b=D(p),y=null,g=new Map,G.cancel(),G.schedule())},stop:()=>ae()}}function qe(e){return{root:e.root,items:e.items,dependsOn:e.dependsOn,dependsOnMissing:e.dependsOnMissing,fields:e.def.fields===!0,measure:e.def.measure===!0}}function jt(e){return e.kind===\"collection\"?{kind:\"collection\",status:\"ready\",items:[],complete:!0}:{kind:\"single\",status:\"ready\",record:null}}function me(e){return e.more?document.querySelector(e.more)===null:!0}function ee(e,t){let n=e(t);if(typeof n!=\"string\"||n===\"\")throw new T(\"INVALID_ARGUMENT\",\"key must return a non-empty string\");return n}function Ue(e,t){try{return ee(e.key,t)}catch{return null}}function Be(e){return String(e?.message??e)}function te(e){return{...e,kind:\"collection\"}}function U(e){return{...e,kind:\"single\"}}function Ee(e){let t=(o,i)=>{throw new Error(`Adapter ${o} ${i}`)},n=(o,i)=>{o!==void 0&&typeof o!=\"function\"&&t(i,\"must be a function\")},r=(o,i)=>{(typeof o!=\"string\"||o.trim()===\"\")&&t(i,\"must be a CSS selector\")},s=(o,i)=>{if(o!==void 0){j(o)||t(i,\"must be an object of functions\");for(let[l,a]of Object.entries(o))typeof a!=\"function\"&&t(`${i}.${l}`,\"must be a function\")}};j(e)||t(\"definition\",\"must be an object\"),n(e.account,\"account\"),e.signInUrl!==void 0&&typeof e.signInUrl!=\"string\"&&typeof e.signInUrl!=\"function\"&&t(\"signInUrl\",\"must be a path or a function\"),j(e.pages)||t(\"pages\",\"must be an object\");for(let[o,i]of Object.entries(e.pages)){let l=`pages.${o}`;j(i)||t(l,\"must be an object\"),typeof i.ready!=\"function\"&&t(`${l}.ready`,\"must be a function\"),n(i.account,`${l}.account`),s(i.actions,`${l}.actions`),i.regions!==void 0&&!j(i.regions)&&t(`${l}.regions`,\"must be an object\");for(let[a,u]of Object.entries(i.regions??{})){let f=`${l}.regions.${a}`;(!j(u)||u.kind!==\"collection\"&&u.kind!==\"single\")&&t(f,\"must be made with collection() or single()\"),r(u.root,`${f}.root`),typeof u.read!=\"function\"&&t(`${f}.read`,\"must be a function\"),n(u.entity,`${f}.entity`),u.dependsOn!==void 0&&(Array.isArray(u.dependsOn)||t(`${f}.dependsOn`,\"must be an array of selectors\"),u.dependsOn.forEach((p,b)=>r(p,`${f}.dependsOn.${b}`))),s(u.actions,`${f}.actions`),u.kind===\"collection\"?(r(u.items,`${f}.items`),typeof u.key!=\"function\"&&t(`${f}.key`,\"must be a function\"),n(u.extent,`${f}.extent`),u.more!==void 0&&r(u.more,`${f}.more`)):n(u.key,`${f}.key`)}}return e}function j(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var Ft=[\"tl_\",\"cv_\",\"co_\",\"mn_\",\"pr_\"],F='[role=\"listitem\"][id^=\"th_\"]';function w(e,t=300){return[...(e??\"\").replace(/[​-‏⁠͏]/g,\"\").replace(/\\s+/g,\" \").trim()].slice(0,t).join(\"\")}function z(e){if(!(e instanceof HTMLElement))return!1;let t=e.ownerDocument.defaultView?.getComputedStyle(e);return t?t.display!==\"none\"&&t.visibility!==\"hidden\":e.offsetParent!==null}function W(e){for(let t of Ft)if(z(e.getElementById(t)))return t;return null}function Ht(e){for(let t of e.scripts){let n=/USER_EMAIL\\s*=\\s*\"([^\"@\\s]+@[^\"\\s]+)\"/.exec(t.textContent??\"\");if(n)return n[1].toLowerCase()}}var we=new WeakMap;function ze(e){if(we.has(e))return we.get(e);let t=null;for(let n of e.scripts){let r=/authuser\\\\u003d(\\d+)/.exec(n.textContent??\"\");if(r){t=Number(r[1]);break}}return we.set(e,t),t}function re(e){if(e.location.hostname!==\"mail.google.com\")return null;let t=Ht(e);if(t)return t}var B=e=>e.id.replace(/^th_/,\"\"),He=e=>e?.getAttribute(\"aria-checked\")===\"true\";function oe(e){let t=B(e),n=o=>e.querySelector(`[id=\"${o}${t}\"]`),r=n(\"ti_f_\"),s=e.querySelector(\".Akvd4\");return{threadId:t,sender:w(r?.textContent,120),subject:w(n(\"ti_s_\")?.textContent,240)||\"(no subject)\",snippet:w(n(\"ti_b_\")?.textContent,220).replace(/^[-–—]\\s*/,\"\"),date:w(n(\"ti_d_\")?.textContent,24),unread:r?.querySelector(\"b\")!==null||(s?.getAttribute(\"aria-labelledby\")??\"\").includes(\"tl_ul\"),starred:He(e.querySelector('[data-control-type^=\"tlastar\"]')),selected:e.classList.contains(\"B7pLff\")||He(e.querySelector('[data-control-type^=\"tlatogglecheck\"]')),attachment:e.querySelector('[aria-label*=\"ttachment\" i], img[src*=\"paperclip\" i], .M2ge3b')!==null,labels:[...e.querySelectorAll(\".Se5Bse .q49Gcc\")].map(o=>w(o.textContent,40)).filter(Boolean).slice(0,4)}}function We(e){let t=e.ownerDocument,n=w(t.querySelector(\"#tltbt .aLzX3d\")?.textContent,80),r=/^(.*?)(\\d+)?$/.exec(n),s=e.querySelector(\".mmDIjd\");return{title:w(r?.[1]??n,60),unread:r?.[2]?Number(r[2]):null,empty:s&&z(s)?w(s.textContent,200):null,selected:e.querySelectorAll(`${F}.B7pLff`).length}}var Vt=/^cvcmsg_[^_]+$/;function be(e,t){if(!e)return null;try{let n=new URL(e,t);if(n.hostname.endsWith(\"google.com\")&&n.pathname===\"/url\"){let r=n.searchParams.get(\"q\");if(r)return be(r,t)}return n.protocol===\"https:\"||n.protocol===\"http:\"?n.href:null}catch{return null}}var Ve=new Set([\"P\",\"DIV\",\"BR\",\"TR\",\"LI\",\"H1\",\"H2\",\"H3\",\"H4\",\"BLOCKQUOTE\",\"TABLE\",\"HR\"]);function zt(e,t=6e3){let n=[],r=0,s=!1,o=(a,u,f)=>{if(s)return;let p=a.replace(/[​-‏⁠͏]/g,\"\").replace(/[ \\t\\r\\f\\v]+/g,\" \");if(!p)return;let b=t-r,y=[...p].slice(0,b).join(\"\");y.length{if(a.nodeType===Node.TEXT_NODE)return o(a.textContent??\"\",u,f);if(!(a instanceof Element)||a.matches(\"script,style,head,title,svg,button,[aria-hidden=true],.adL,.gmail_quote,blockquote.gmail_quote\")||a instanceof HTMLElement&&a.style.display===\"none\"||a.matches('a[id^=\"att_\"]'))return;if(a.tagName===\"IMG\"){let y=w(a.getAttribute(\"alt\"),80);return y?o(y,u,f):void 0}let p=a.tagName===\"A\"?be(a.getAttribute(\"href\"),a.ownerDocument.location.href)??void 0:u,b=f||a.tagName===\"B\"||a.tagName===\"STRONG\";Ve.has(a.tagName)&&o(`\n`);for(let y of a.childNodes)i(y,p,b);Ve.has(a.tagName)&&a.tagName!==\"BR\"&&o(`\n`)};i(e??document.createElement(\"div\"));for(let a of n)a.text=a.text.replace(/ *\\n */g,`\n`).replace(/\\n{3,}/g,`\n\n`);for(;n.length&&!n[0].text.trim();)n.shift();n[0]&&(n[0].text=n[0].text.replace(/^\\s+/,\"\"));let l=n[n.length-1];return l&&(l.text=l.text.replace(/\\s+$/,\"\")),{runs:n.filter(a=>a.text!==\"\"),truncated:s}}function Wt(e){let t=new Map;for(let n of e.querySelectorAll('a[id^=\"att_\"]')){let r=n.getAttribute(\"href\")??n.id;t.has(r)||t.set(r,n)}return[...t.values()].slice(0,8).map(n=>{let r=(n instanceof HTMLElement?n.innerText:n.textContent??\"\").split(`\n`).map(l=>w(l,120)).filter(Boolean),s=w(n.getAttribute(\"download\"),120)||r.find(l=>/\\.[a-z0-9]{2,5}$/i.test(l))||r[0]||\"Attachment\",o=r.find(l=>/\\d\\s*(K|M|G)?B$/i.test(l))??\"\",i=Kt(s,n);return{name:s,size:o,...i?{href:i}:{}}})}var Jt=/\\.(jpe?g|png|gif|webp|bmp|svg|txt|csv|mp4|webm|mp3|m4a|ogg|wav)$/i;function Kt(e,t){let n=be(t.getAttribute(\"href\"),t.ownerDocument.location.href);if(!n||!Jt.test(e))return;let r=new URL(n);if(r.searchParams.get(\"view\")===\"att\")return r.searchParams.set(\"disp\",\"inline\"),r.href}function Xt(e){if(!e)return\"\";let t=\"\";for(let n of e.childNodes)if(n instanceof HTMLBRElement)t+=`\n`;else{if(n instanceof Element&&n.matches('[role=\"button\"]'))continue;t+=n.textContent??\"\"}return t}function Yt(e,t){let n=e.id.replace(/^cvcmsg_/,\"\"),r=e.ownerDocument,s=w(e.querySelector(\".HXJujf\")?.textContent,120),o=Xt(r.getElementById(`cvcstrecip_${n}`)).split(`\n`).map(u=>w(u,120)).filter(Boolean),i=r.getElementById(`cvcmsgbod_${n}`),{runs:l,truncated:a}=i&&z(i)?zt(i,t):{runs:[],truncated:!1};return{id:n,sender:s||\"Unknown sender\",initial:w(e.querySelector(\".th5Fjd\")?.textContent,2)||(s[0]??\"?\").toUpperCase(),recipients:o[0]??\"\",time:o.find(u=>/ago|AM|PM|\\d{1,2}:\\d{2}|yesterday|\\b[A-Z][a-z]{2} \\d{1,2}\\b/i.test(u)&&u!==o[0])??o[1]??\"\",snippet:w(r.querySelector(`#cvcstsnip_${CSS.escape(n)} .oex1Df`)?.textContent,200),body:l,truncated:a,attachments:Wt(e)}}var Je=[[\"archive\",\"ca+5\",\"1\"],[\"trash\",\"ca+5\",\"9\"],[\"deleteForever\",\"ca+5\",\"10\"],[\"notSpam\",\"ca+5\",\"8\"],[\"moveToInbox\",\"ca+5\",\"2\"],[\"mute\",\"ca+5\",\"11\"],[\"markUnread\",\"ca+5\",\"4\"],[\"spam\",\"spam+8\",\"7\"]];function ke(e){let[,t,n]=Je.find(([r])=>r===e);return`#cv__cntbt [data-control-type=\"${t}\"][data-onclick-arg=\"${n}\"]`}function Ke(e){let t=e.ownerDocument,n=[...e.querySelectorAll('[id^=\"cvcmsg_\"]')].filter(i=>Vt.test(i.id)),r=24e3,s=[];for(let i of[...n].reverse().slice(0,40)){let l=Yt(i,Math.max(400,Math.min(8e3,r)));r-=l.body.reduce((a,u)=>a+u.text.length,0),s.unshift(l)}let o=t.getElementById(\"cvcstar\");return{subject:w(e.querySelector(\".jzNoVc\")?.textContent,300)||\"(no subject)\",starred:z(o),labels:[...e.querySelectorAll(\".Se5Bse .q49Gcc, .Bqkuxd\")].map(i=>w(i.textContent,40)).filter(Boolean).slice(0,6),messages:s,commands:Je.filter(([i])=>{let l=t.querySelector(ke(i));return l!==null&&z(l.closest(\"[role=button], div\")??l)}).map(([i])=>i)}}var ne=(e,t)=>{let n=e.getElementById(t);return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?w(n.value,600):\"\"};function Xe(e){let t=e.ownerDocument,n=t.getElementById(\"cmcfrom\"),r=n instanceof HTMLSelectElement?n.selectedOptions[0]?.textContent:n?.textContent;return{from:w(r,160),to:ne(t,\"composeto\"),cc:ne(t,\"composecc\"),bcc:ne(t,\"composebcc\"),subject:ne(t,\"cmcsubj\"),body:w(t.getElementById(\"cmcbody\")?.innerText,2e3)}}var Ae='[role=\"menuitem\"][data-onclick-arg]';function Ye(e){let t=e.getAttribute(\"data-onclick-arg\")??\"\",n=e.getAttribute(\"data-control-type\")??e.getAttribute(\"data-onclick\")??\"\",r=w(e.querySelector(\".EAH59d\")?.textContent,8),s=w(e.textContent,80),o=w(s.replace(r,\"\"),60)||t,i=t.startsWith(\"^smartlabel\")?\"category\":t.startsWith(\"^\")?\"system\":n.startsWith(\"mnpi\")?\"category\":\"label\";return{arg:t,kind:i,label:o,count:/^\\d+$/.test(r)?Number(r):null}}var Ze=e=>{let t=w(e.ownerDocument.querySelector('[data-control-type^=\"toggleaccountscallout\"]')?.textContent,200);return/[^\\s@]+@[^\\s@]+/.exec(t)?.[0]?.toLowerCase()??null};var Zt=[[\"tl\",\"tl_\"],[\"cv\",\"cv_\"],[\"co\",\"co_\"],[\"mn\",\"mn_\"],[\"pr\",\"pr_\"]];function Qt(e){let t=e.replace(/^#/,\"\").split(/[/?]/)[0];return t===\"\"?\"tl_\":Zt.find(([n])=>n===t)?.[1]??null}function en(e,t){let n=e.getElementById(t);switch(t){case\"tl_\":return n.querySelector(F)!==null||w(n.querySelector(\".mmDIjd\")?.textContent)!==\"\";case\"cv_\":return n.querySelector(\".jzNoVc\")!==null&&n.querySelector('[id^=\"cvcmsg_\"]')!==null;case\"co_\":return e.getElementById(\"composeto\")!==null;case\"mn_\":return n.querySelector(Ae)!==null;case\"pr_\":return!0}}function tn(e){if(e.readyState===\"loading\")return!1;let t=W(e);if(!t||!en(e,t))return!1;let n=Qt(e.location.hash);return n===null||n===t||t===\"co_\"}var J=e=>`#th_${CSS.escape(e)}`,ct='[data-control-type^=\"tlatogglecheck\"]',nn='[data-control-type^=\"tlastar\"]',Ie=e=>`.zY6rPd [data-control-type=\"ca+5\"][data-onclick-arg=\"${e}\"]`;function Qe(e,t,n){if(!e||typeof n!=\"boolean\")throw new Error(\"Expected a thread and true or false\");let r=e.querySelector(t);if(!r)throw new Error(\"Gmail did not show this control\");if(r.getAttribute(\"aria-checked\")===\"true\"===n)return{satisfied:!0};let s=B(e);return{steps:[{click:`${J(s)} ${t}`}],until:o=>o.querySelector(`${J(s)} ${t}`)?.getAttribute(\"aria-checked\")===\"true\"===n}}var se=e=>[...e.querySelectorAll(`#tl_ ${F}`)].filter(t=>oe(t).selected);function et(e){return t=>{if(!t)throw new Error(\"Expected a thread\");let n=B(t);if(se(t.ownerDocument).filter(o=>B(o)!==n).length)throw new Error(\"Clear the selection first\");let s=[];return oe(t).selected||s.push({click:`${J(n)} ${ct}`},{waitFor:Ie(e),timeoutMs:3e3}),s.push({click:Ie(e)}),{steps:s,until:o=>o.querySelector(J(n))===null,deadlineMs:12e3}}}function tt(e){return()=>{let t=se(document).map(B);if(!t.length)throw new Error(\"No emails are selected\");return{steps:[{click:Ie(e)}],until:n=>t.every(r=>n.querySelector(J(r))===null),deadlineMs:12e3}}}function nt(){return se(document).length?{steps:[{click:'[data-control-type^=\"banone\"]'}],until:e=>se(e).length===0}:{satisfied:!0}}var rt=e=>e.querySelectorAll(`#tl_ ${F}`).length;function ot(){let e=rt(document);return{steps:[{scroll:{target:\"window\",to:\"end\"}}],until:t=>rt(t)>e,deadlineMs:1e4}}function st(){return document.querySelector('#tl_ [aria-label=\"Refresh\"], #tltbt [data-control-type^=\"rfr\"], [aria-label=\"Refresh\"]')?{steps:[{click:'[aria-label=\"Refresh\"]'}]}:{satisfied:!0}}function $(e){return()=>{let t=ke(e);if(!document.querySelector(t))throw new Error(\"Gmail does not offer that for this email\");let n=location.hash;return{steps:[{click:t}],until:r=>r.location.hash!==n||r.querySelector(t)===null,deadlineMs:1e4}}}function rn(e,t){let n=t?.id;if(typeof n!=\"string\"||!/^[\\w-]+$/.test(n))throw new Error(\"Expected a message id\");let r=o=>{let i=o.getElementById(`cvcmsgbod_${n}`);return i instanceof HTMLElement&&i.getClientRects().length>0&&(i.textContent??\"\").trim()!==\"\"};if(r(document))return{satisfied:!0};let s=`[data-control-type^=\"cvasnip\"][data-onclick-arg=\"${n}\"]`;if(!document.querySelector(s))throw new Error(\"Gmail can't open this message here\");return{steps:[{click:s}],until:r,deadlineMs:1e4}}function on(e,t){if(typeof t?.starred!=\"boolean\")throw new Error(\"Expected starred: true or false\");let n=()=>{let r=document.getElementById(\"cvcstar\");return r instanceof HTMLElement&&getComputedStyle(r).display!==\"none\"};return n()===t.starred?{satisfied:!0}:{steps:[{click:t.starred?\"#cvcstaroff\":\"#cvcstar\"}],until:()=>n()===t.starred}}var it={reply:\"cvarplf+29\",replyAll:\"cvarplallf+30\",forward:\"cvafwdf+31\"};function sn(e,t){let n=typeof t?.mode==\"string\"&&t.mode in it?t.mode:\"reply\",r=`#cv_ [data-control-type=\"${it[n]}\"]`;if(!document.querySelector(r))throw new Error(\"Gmail did not show a reply button\");return{steps:[{click:r}],until:s=>W(s)===\"co_\"&&s.getElementById(\"composeto\")!==null}}var cn=(e,t)=>typeof e?.[t]==\"string\"?e[t].slice(0,2e3):null;function an(e,t){let n=[];for(let[r,s]of[[\"to\",\"composeto\"],[\"cc\",\"composecc\"],[\"bcc\",\"composebcc\"],[\"subject\",\"cmcsubj\"]]){let o=cn(t,r),i=document.getElementById(s);o!==null&&i instanceof HTMLInputElement&&i.value!==o&&n.push({fill:`#${s}`,value:o})}return n.length?{steps:n,until:r=>n.every(s=>r.querySelector(s.fill)?.value===s.value)}:{satisfied:!0}}function ln(){return document.querySelector('#co_ [data-control-type=\"cmclose+108\"], [data-control-type=\"cmclose+108\"]')?{steps:[{click:'[data-control-type=\"cmclose+108\"]'}],until:t=>W(t)!==\"co_\"}:{satisfied:!0}}function un(e){if(!e)throw new Error(\"Expected a menu item\");let t=e.getAttribute(\"data-onclick-arg\")??\"\",n=location.hash;return{steps:[{click:`#mn_ [role=\"menuitem\"][data-onclick-arg=\"${CSS.escape(t)}\"]`}],until:r=>r.location.hash!==n}}var at={ready:tn,requiresAccount:!0,account:re,regions:{view:U({root:\"#views\",read:e=>({view:W(e.ownerDocument),hash:e.ownerDocument.location.hash.slice(0,600),session:ze(e.ownerDocument)})}),list:U({root:\"#tl_\",dependsOn:[\"#tltbt\"],read:We,actions:{clearSelection:nt,loadMore:ot,refresh:st}}),threads:te({root:\"#tl_\",items:F,key:B,entityType:\"thread\",read:oe,actions:{setStarred:(e,t)=>Qe(e,nn,t?.starred),setSelected:(e,t)=>Qe(e,ct,t?.selected),archive:et(\"1\"),trash:et(\"9\")}}),conversation:U({root:\"#cv_\",key:()=>location.hash.split(\"/\").pop()??\"conversation\",read:Ke,actions:{archive:$(\"archive\"),trash:$(\"trash\"),deleteForever:$(\"deleteForever\"),notSpam:$(\"notSpam\"),moveToInbox:$(\"moveToInbox\"),mute:$(\"mute\"),markUnread:$(\"markUnread\"),spam:$(\"spam\"),setStarred:on,expandMessage:rn,respond:sn}}),compose:U({root:\"#co_\",fields:!0,read:Xe,actions:{fill:an,discard:ln}}),menu:te({root:\"#mn_\",items:Ae,key:e=>e.getAttribute(\"data-onclick-arg\")??w(e.textContent,60),read:Ye,actions:{open:un}}),menuAccount:U({root:\"#mn_\",read:e=>({email:Ze(e)})})},actions:{archiveSelected:tt(\"1\"),trashSelected:tt(\"9\"),clearSelection:nt,loadMore:ot,refresh:st}};var lt=Ee({account:re,signInUrl:\"/mail/u/0/\",pages:{mail:at}});ve(lt);})();\n"},{"path":"foreground.css","encoding":"utf8","content":":root{color-scheme:light;--font: \"Inter\", \"Roboto\", system-ui, -apple-system, sans-serif;--accent: #2347d9;--accent-ink: #ffffff;--accent-tint: #e8edff;--hero: #2347d9;--hero-ink: #ffffff;--ink: #15161a;--ink-2: #4a4f5c;--ink-3: #6b7080;--wash: #f4f5f7;--paper: #ffffff;--line: #e4e6eb;--chip: #eceef2;--reminder: #9a3d06;--reminder-tint: #fdebdc;--done: #1f7a4d;--danger: #c62828;--danger-tint: #fde8e8;--scrim: rgba(21, 22, 26, .42);--shadow: 0 8px 28px rgba(21, 22, 26, .14);--radius: 20px;--ease-out: cubic-bezier(.2, 0, 0, 1);--ease-in: cubic-bezier(.3, 0, .8, .15);--ease-spring: cubic-bezier(.34, 1.4, .64, 1);--dur-short: .15s;--dur-medium: .25s;--dur-long: .35s;--press: rgba(21, 22, 26, .08)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--accent: #8ea6ff;--accent-ink: #0d1640;--accent-tint: #1f2850;--hero: #263a8f;--hero-ink: #eef1ff;--ink: #eceef2;--ink-2: #bfc3cd;--ink-3: #9297a3;--wash: #0f1013;--paper: #1a1c21;--line: #2c2f37;--chip: #262930;--reminder: #ffb27a;--reminder-tint: #3a2414;--done: #6fd39f;--danger: #ff8a80;--danger-tint: #3b1b1b;--scrim: rgba(0, 0, 0, .6);--shadow: 0 8px 28px rgba(0, 0, 0, .5);--press: rgba(255, 255, 255, .08)}}:root[data-theme=dark]{color-scheme:dark;--accent: #8ea6ff;--accent-ink: #0d1640;--accent-tint: #1f2850;--hero: #263a8f;--hero-ink: #eef1ff;--ink: #eceef2;--ink-2: #bfc3cd;--ink-3: #9297a3;--wash: #0f1013;--paper: #1a1c21;--line: #2c2f37;--chip: #262930;--reminder: #ffb27a;--reminder-tint: #3a2414;--done: #6fd39f;--danger: #ff8a80;--danger-tint: #3b1b1b;--scrim: rgba(0, 0, 0, .6);--shadow: 0 8px 28px rgba(0, 0, 0, .5);--press: rgba(255, 255, 255, .08)}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}html,body{background:var(--wash);color:var(--ink);font:15px/21px var(--font);-webkit-font-smoothing:antialiased}h1,h2,h3,p{margin:0}button,input,textarea,select{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{cursor:pointer;background:none;border:0;padding:0;text-align:inherit}button:disabled{opacity:.45;cursor:default}a{color:var(--accent);text-decoration:none;overflow-wrap:anywhere}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}svg.filled{fill:currentColor}ul,ol{list-style:none;margin:0;padding:0}small{color:var(--ink-3);font-size:13px;line-height:18px}mark{background:#ffe9a8;color:inherit;border-radius:3px;padding:0 1px}.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.muted{color:var(--ink-3)}.danger{color:var(--danger)}.spacer{flex:1}.padded{padding:8px 20px}.padded-x{margin-left:16px!important;margin-right:16px!important;width:calc(100% - 32px)!important}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.app{display:flex;flex-direction:column;height:100%;position:relative}.content{flex:1;min-height:0;position:relative;isolation:isolate;overflow:hidden}.screen-frame{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--wash)}.screen{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:104px}.screen.centered{display:grid;place-items:center;padding:24px}.icon-button{display:inline-grid;place-items:center;width:48px;height:48px;border-radius:50%;color:var(--ink-2);flex:none}.icon-button:active{background:var(--chip)}.icon-button[aria-pressed=true]{color:var(--accent)}.icon-button.star.on,.star.on{color:#e3a008}.accent,.primary,.secondary,.outline{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;border-radius:999px;font-weight:600}.accent{background:var(--accent);color:var(--accent-ink)}.primary{background:var(--ink);color:var(--paper)}.secondary{background:var(--chip);color:var(--ink)}.outline{border:1px solid var(--line);background:var(--paper)}.accent svg,.primary svg,.secondary svg,.outline svg{width:18px;height:18px}.block{display:flex;width:100%}.link-button{color:var(--accent);font-weight:600;min-height:44px;padding:0 8px;display:inline-flex;align-items:center}.row-buttons{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:16px}.card{background:var(--paper);border-radius:var(--radius);margin:0 16px;overflow:hidden}.section-label{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);padding:20px 20px 8px;display:flex;align-items:center;gap:6px}.section-label.with-action{justify-content:space-between;padding-bottom:0}.hint{color:var(--ink-3);font-size:13px;line-height:18px;display:flex;gap:6px;align-items:flex-start}.list-button{display:flex;align-items:center;gap:14px;width:100%;min-height:56px;padding:10px 16px}.list-button>span:not(.account-dot):not(.tile):not(.avatar){flex:1;min-width:0;display:flex;flex-direction:column}.list-button strong{font-weight:600}.list-button>svg:last-child{color:var(--ink-3);width:18px;height:18px}.plain-list>li+li{border-top:1px solid var(--line)}.tile{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:12px;flex:none}.tile.small{width:32px;height:32px;border-radius:10px}.tile.small svg{width:18px;height:18px}.tile.reminder{background:var(--reminder-tint);color:var(--reminder)}.tile.todo{background:var(--accent-tint);color:var(--accent)}.tile.neutral{background:var(--chip);color:var(--ink-2)}.account-dot{display:inline-block;width:10px;height:10px;min-width:10px;border-radius:50%;flex:none;vertical-align:middle}.avatar{display:inline-grid;place-items:center;border-radius:50%;flex:none;font-weight:600;background:hsl(var(--hue) 70% 92%);color:hsl(var(--hue) 55% 32%)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .avatar{background:hsl(var(--hue) 35% 24%);color:hsl(var(--hue) 70% 82%)}}:root[data-theme=dark] .avatar{background:hsl(var(--hue) 35% 24%);color:hsl(var(--hue) 70% 82%)}.avatar.selected{background:var(--accent);color:var(--accent-ink)}.avatar.selected svg{width:20px;height:20px}.logo{font-weight:800;font-size:20px;letter-spacing:-.02em}.logo span{color:var(--accent)}.chips{display:flex;flex-wrap:wrap;gap:8px}.chip{flex:none;white-space:nowrap;display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--paper);font-weight:500}.chip[aria-checked=true]{background:var(--ink);color:var(--paper);border-color:var(--ink)}.chip.high[aria-checked=true]{background:var(--danger);border-color:var(--danger);color:#fff}.chip .count{opacity:.7;margin-left:2px}.chips.filters{padding:12px 16px 4px;flex-wrap:nowrap;overflow-x:auto}.chip-small{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:12px;line-height:18px;background:var(--chip);color:var(--ink-2);font-weight:500}.chip-small.reminder{background:var(--reminder-tint);color:var(--reminder)}.chip-small.todo{background:var(--accent-tint);color:var(--accent)}.tag{flex:none;padding:3px 10px;border-radius:8px;font-size:13px;font-weight:600;background:var(--chip);color:var(--ink-2);white-space:nowrap}.tag.reminder{background:var(--reminder-tint);color:var(--reminder)}.tag.set-date{background:transparent;color:var(--accent);border:1.5px dashed var(--accent);min-height:32px}.time-tag{flex:none;color:var(--ink-3);font-size:13px;font-variant-numeric:tabular-nums}.top-bar{display:flex;align-items:center;gap:4px;min-height:64px;padding:8px 56px 8px 4px;background:var(--wash);flex:none}.top-bar h1{font-size:20px;font-weight:700;padding-left:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-bar .logo{padding-left:16px}.top-bar .send{min-height:40px;padding:0 16px}.mail-header{flex:none;padding:10px 64px 8px 12px;background:var(--wash)}.search-pill{display:flex;align-items:center;gap:4px;min-height:52px;border-radius:999px;background:var(--paper);padding:2px 4px;box-shadow:0 1px 2px #0000000f}.search-pill>svg{margin:0 6px 0 12px;color:var(--ink-3)}.search-pill-text{flex:1;min-height:48px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-pill-text.filled{color:var(--ink);font-weight:500}.search-pill input{flex:1;min-width:0;min-height:48px;border:0;background:none;outline:none}.me{display:grid;place-items:center;width:48px;height:48px;position:relative}.me-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;border:2px solid;font-size:12px;font-weight:700;background:var(--accent-tint);color:var(--accent)}.me-badge{position:absolute;right:2px;bottom:4px;min-width:18px;height:18px;border-radius:9px;background:var(--ink);color:var(--paper);font-size:11px;display:grid;place-items:center}.selection-bar{display:flex;align-items:center;min-height:64px;padding:8px 56px 8px 4px;background:var(--accent-tint);color:var(--accent);flex:none}.selection-bar h1{font-size:18px;font-weight:700}.selection-bar .icon-button{color:var(--accent)}.category-chips,.filter-chips{display:flex;gap:8px;overflow-x:auto;padding:4px 16px 8px;scrollbar-width:none}.category-chip,.filter-chip{flex:none;display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 16px;border-radius:999px;background:var(--paper);border:1px solid var(--line);font-weight:500}.category-chip[aria-current=page],.filter-chip[aria-pressed=true]{background:var(--ink);color:var(--paper);border-color:var(--ink)}.category-chip .count{font-size:12px;font-weight:700;color:var(--accent)}.category-chip[aria-current=page] .count{color:inherit;opacity:.8}.list-title{font-size:26px;font-weight:800;padding:4px 20px 12px;letter-spacing:-.01em}.results-line{padding:4px 20px 8px;color:var(--ink-2);font-size:14px}.thread-list{background:var(--paper);border-radius:var(--radius);margin:0 12px;overflow:hidden}.thread{position:relative;overflow:hidden}.thread+.thread{border-top:1px solid var(--line)}.thread-inner{position:relative;display:flex;align-items:flex-start;gap:4px;padding:10px 4px 10px 8px;background:var(--paper);transition:transform .2s;touch-action:pan-y}.thread.selected .thread-inner{background:var(--accent-tint)}.avatar-button{display:grid;place-items:center;width:48px;height:48px;flex:none}.thread-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;padding:2px 0}.thread-line{display:flex;align-items:baseline;gap:8px}.thread .sender{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}.thread .date{flex:none;font-size:12px;color:var(--ink-3)}.thread .subject{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}.thread .snippet{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-3);font-size:14px}.thread.unread .sender,.thread.unread .subject{color:var(--ink);font-weight:700}.thread.unread .date{color:var(--accent);font-weight:700}.thread-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.thread .star{color:var(--ink-3)}.swipe-under{position:absolute;inset:0;display:flex;align-items:center;padding:0 24px;color:#fff;font-weight:600;gap:8px}.swipe-under.right{justify-content:flex-start}.swipe-under.left{justify-content:flex-end}.swipe-under.remind{background:#d0611c}.swipe-under.archive{background:#1f7a4d}.swipe-under.none{background:var(--chip);color:var(--ink-3)}.list-end{display:flex;justify-content:center;padding:16px}.inline-error{color:var(--danger);padding:8px 20px}.fab{position:absolute;right:16px;bottom:16px;z-index:5;display:inline-flex;align-items:center;gap:10px;min-height:56px;padding:0 22px 0 18px;border-radius:18px;background:var(--accent);color:var(--accent-ink);font-weight:700;box-shadow:var(--shadow)}.fab.round{width:60px;height:60px;padding:0;justify-content:center;border-radius:20px}.fab.round svg{width:28px;height:28px}.today-card{margin:4px 12px 12px;border-radius:var(--radius);background:var(--hero);color:var(--hero-ink);padding:4px 16px 16px}.today-head{display:flex;align-items:center;width:100%;min-height:48px;gap:8px}.today-head>span{flex:1}.today-head .muted{color:inherit;opacity:.8}.today-row{display:flex;align-items:center;gap:10px;min-height:48px;border-top:1px solid rgba(255,255,255,.18)}.today-title{flex:1;min-width:0;min-height:48px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.today-card .tag{background:#ffffff2e;color:inherit}.today-card .mark{border-color:#fffc;color:inherit}.today-card .mark.reminder{background:#ffffff2e}.progress{height:6px;border-radius:3px;background:#ffffff40;margin-top:8px;overflow:hidden}.progress span{display:block;height:100%;background:currentColor;border-radius:3px}.back-section{margin:0 12px 12px;border-radius:var(--radius);background:var(--reminder-tint);color:var(--reminder)}.back-section .section-label{color:var(--reminder);padding:12px 16px 4px}.back-row{display:flex;align-items:center;gap:4px;padding-left:16px}.back-row+.back-row{border-top:1px solid rgba(154,61,6,.15)}.back-main{flex:1;min-width:0;min-height:56px;display:flex;flex-direction:column;justify-content:center}.back-main strong{color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.back-main span{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.back-row .icon-button{color:var(--reminder)}.also{margin-bottom:12px}.item-list{display:block}.item-row{display:flex;align-items:center;gap:12px;padding:6px 16px 6px 12px;min-height:64px}.item-row+.item-row{border-top:1px solid var(--line)}.item-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;min-height:52px;justify-content:center}.item-title{font-weight:600;display:flex;align-items:center;gap:6px;overflow-wrap:anywhere}.item-meta{display:block;font-size:13px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item-meta svg{width:14px;height:14px;vertical-align:-2px}.item-meta .account-dot{width:8px;height:8px;vertical-align:0}.item-row.overdue .item-meta{color:var(--danger)}.item-row.is-done .item-title{text-decoration:line-through;color:var(--ink-3);font-weight:500}.priority{color:var(--danger);display:inline-flex}.match{flex:none;max-width:40%;font-size:12px;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mark{position:relative;display:grid;place-items:center;width:28px;height:28px;flex:none;border:2px solid var(--ink-3);border-radius:8px;color:var(--paper)}.mark:after{content:\"\";position:absolute;inset:-10px}.mark.reminder{border:0;border-radius:50%;background:var(--reminder-tint);color:var(--reminder)}.mark svg{width:16px;height:16px}.mark.done{background:var(--done);border-color:var(--done);color:#fff}.mark.large{width:40px;height:40px;border-radius:12px}.mark.reminder.large{border-radius:50%}.mark.large svg{width:22px;height:22px}.todo-header{display:flex;align-items:center;gap:4px;min-height:72px;padding:12px 56px 4px 20px;flex:none}.todo-header h1{font-size:30px;font-weight:800;letter-spacing:-.02em}.todo-search{flex:1}.account-filter{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:var(--paper);font-weight:500}.segmented{position:relative;display:flex;margin:4px 16px 0;padding:4px;border-radius:16px;background:var(--chip)}.segmented:before{content:\"\";position:absolute;top:4px;bottom:4px;left:4px;width:calc(50% - 4px);border-radius:12px;background:var(--paper);box-shadow:0 1px 3px #0000001a;transition:transform var(--dur-medium) var(--ease-out)}.segmented[data-index=\"1\"]:before{transform:translate(100%)}.segmented button{position:relative;flex:1;min-height:44px;border-radius:12px;text-align:center;color:var(--ink-2);font-weight:600;transition:color var(--dur-short)}.segmented button[aria-selected=true]{color:var(--ink)}.week-strip{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;padding:12px 12px 4px}.week-day{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:64px;padding:6px 0;border-radius:14px;color:var(--ink-3)}.week-day strong{color:var(--ink);font-size:17px}.week-day.today,.week-day.today strong{color:var(--accent)}.week-day[aria-pressed=true]{background:var(--ink);color:var(--paper)}.week-day[aria-pressed=true] strong{color:var(--paper)}.week-day .dot{width:6px;height:6px;border-radius:50%;background:var(--accent)}.week-day .dot.none{background:transparent}.week-day[aria-pressed=true] .dot{background:var(--paper)}.group{margin-top:8px}.group-head{display:flex;align-items:baseline;gap:8px;padding:16px 20px 8px;font-size:16px;font-weight:700}.group-head small{font-weight:500}.group-head .link-button{margin-left:auto;min-height:32px;font-size:14px}.group.overdue .group-head>span{color:var(--danger)}.group.done .item-list{opacity:.85}.type-label{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--accent)}.type-label.reminder{color:var(--reminder)}.type-label svg{width:16px;height:16px}.item-hero{display:flex;align-items:flex-start;gap:14px;padding:8px 20px 20px}.item-hero h1{font-size:24px;line-height:30px;font-weight:800;letter-spacing:-.01em;overflow-wrap:anywhere}.item-hero h1.is-done{text-decoration:line-through;color:var(--ink-3)}.detail-rows{margin:0 16px}.detail-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 16px}.detail-row+.detail-row{border-top:1px solid var(--line)}.detail-row dt{display:flex;align-items:center;gap:10px;width:132px;flex:none;color:var(--ink-3);font-size:14px}.detail-row dd{margin:0;flex:1;min-width:0;display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-weight:500}.detail-row dd .link-button{margin-left:auto}.note-text{white-space:pre-wrap;font-weight:400}.email-card{display:flex;align-items:center;gap:12px;width:calc(100% - 32px);padding:14px 16px}.email-card>span:not(.avatar){flex:1;min-width:0;display:flex;flex-direction:column}.email-card small{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.email-subject{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-card.gone{color:var(--ink-3)}.email-card+.hint{padding:8px 20px}.snooze-chips{padding:16px}.action-bar{flex:none;display:flex;gap:8px;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:var(--paper);border-top:1px solid var(--line)}.action-bar>button{flex:1;min-width:0;padding:0 10px;white-space:nowrap}.conversation{padding:0 0 104px}.add-to{display:flex;align-items:center;gap:12px;padding:4px 16px 8px}.add-to .muted{font-size:13px;line-height:17px}.add-pill{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:44px;padding:0 14px;border-radius:999px;background:var(--ink);color:var(--paper);font-weight:600}.add-pill svg{width:18px;height:18px}.popover-scrim{position:fixed;inset:0;z-index:20;background:transparent;cursor:default}.popover{position:absolute;z-index:21;background:var(--paper);border-radius:18px;box-shadow:var(--shadow);padding:8px;display:flex;flex-direction:column;min-width:220px}.popover>button{min-height:48px;padding:0 14px;border-radius:12px;display:flex;align-items:center;gap:10px}.popover>button:active,.popover>button[aria-checked=true]{background:var(--chip)}.more-menu{top:64px;right:12px}.add-menu{top:120px;left:16px;right:16px}.account-menu{top:72px;right:56px}.add-option{display:flex;align-items:center;gap:14px;width:100%;min-height:64px;padding:8px 10px;border-radius:14px}.add-option>span:nth-child(2){flex:1;display:flex;flex-direction:column}.add-option>svg:last-child{color:var(--ink-3)}.quick-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 10px 6px;border-top:1px solid var(--line);margin-top:4px}.quick-row .section-label{width:100%;padding:0 4px}.subject-row{display:flex;align-items:flex-start;gap:4px;padding:4px 8px 0 20px}.conversation-subject{flex:1;font-size:22px;line-height:28px;font-weight:800;letter-spacing:-.01em;padding-top:8px;overflow-wrap:anywhere}.conversation-meta{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:6px 20px 12px;font-size:13px}.account-line{display:inline-flex;align-items:center;gap:6px;color:var(--ink-2)}.linked-items{margin-bottom:8px}.messages{display:flex;flex-direction:column;gap:8px;padding:0 12px}.message{background:var(--paper);border-radius:var(--radius);padding:4px 16px 16px}.message-head{display:flex;align-items:center;gap:12px;width:100%;min-height:56px}.message-head:disabled{opacity:1}.message-who{flex:1;min-width:0;display:flex;flex-direction:column}.message-who .muted{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:22px;padding-top:4px}.message-body p{margin-top:12px}.message-snippet{color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachments{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.attachment-card{display:flex;align-items:center;gap:10px;padding:8px 12px 8px 8px;border:1px solid var(--line);border-radius:14px;max-width:100%}.attachment-card>span:last-child{display:flex;flex-direction:column;min-width:0}.attachments>li{max-width:100%}a.attachment-card{color:inherit;text-decoration:none}a.attachment-card:active{background:var(--press)}.attachment-card small{color:var(--ink-2);font-size:12px}.attachment-card strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-tile{display:grid;place-items:center;width:40px;height:40px;border-radius:10px;background:var(--danger-tint);color:var(--danger);font-size:11px;font-weight:800;flex:none}.reply-row{display:flex;gap:8px;padding:16px 12px}.reply-row button{flex:1;min-width:0;padding:0 8px;white-space:nowrap}.compose-card{background:var(--paper);border-radius:var(--radius);margin:0 12px;overflow:hidden}.compose-field{display:flex;align-items:center;gap:12px;min-height:56px;padding:0 16px;border-bottom:1px solid var(--line)}.compose-field>span:first-child{width:56px;flex:none;color:var(--ink-3)}.compose-field input{flex:1;min-width:0;min-height:48px;border:0;background:none;outline:none}.compose-to{display:flex;align-items:center}.compose-to .compose-field{flex:1}.compose-to .link-button{border-bottom:1px solid var(--line);min-height:56px}.from-value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.compose-body-note{display:flex;gap:12px;padding:16px;color:var(--ink-2)}.compose-body-note svg{color:var(--ink-3)}.remind-card{margin-top:12px}.drawer .screen,.drawer .top-bar{background:var(--paper)}.account-card{display:flex;align-items:center;gap:12px;width:calc(100% - 32px);margin:0 16px 8px;min-height:64px;padding:10px 16px;border-radius:var(--radius);background:var(--accent-tint)}.account-card>span:not(.account-dot){flex:1;min-width:0;display:flex;flex-direction:column}.account-card>.account-dot{width:14px;height:14px}.account-card small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drawer-list{padding:0 8px}.drawer-list.end{margin-top:12px;border-top:1px solid var(--line);padding-top:8px}.drawer-row{display:flex;align-items:center;gap:16px;width:100%;min-height:52px;padding:0 16px;border-radius:999px;font-weight:500}.drawer-row>span:nth-child(2){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drawer-row.accent{background:transparent;color:var(--accent);min-height:52px;padding:0 16px;border-radius:999px;justify-content:flex-start;font-weight:600}.drawer-row .count{font-size:13px;font-weight:700;color:var(--ink-2)}.drawer-row svg{color:var(--ink-3)}.drawer-row.accent svg{color:var(--accent)}.drawer-row:active{background:var(--chip)}.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}.field>span{font-size:13px;font-weight:600;color:var(--ink-2)}.field input,.field textarea,.setting-row input,.select-row select{min-height:48px;padding:10px 14px;border-radius:14px;border:1px solid var(--line);background:var(--wash);outline:none;width:100%}.field input:focus,.field textarea:focus{border-color:var(--accent)}.field textarea{resize:vertical}.error-text{color:var(--danger)}.select-row{display:flex;align-items:center;gap:12px;min-height:56px}.select-row>span{flex:1}.select-row select{width:auto}.toggle-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 16px;cursor:pointer;position:relative}.card .toggle-row+.toggle-row,.card .toggle-row+.setting-row,.card .setting-row+.toggle-row,.card .setting-row+.setting-row{border-top:1px solid var(--line)}.sheet-body .toggle-row{padding:8px 0}.toggle-text{flex:1;min-width:0;display:flex;flex-direction:column}.toggle-row input{position:absolute;opacity:0;width:1px;height:1px}.switch{position:relative;width:50px;height:30px;border-radius:15px;background:var(--line);flex:none;transition:background .15s}.switch:after{content:\"\";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #00000040;transition:transform .15s}.toggle-row input:checked+.switch{background:var(--accent)}.toggle-row input:checked+.switch:after{transform:translate(20px)}.toggle-row input:focus-visible+.switch{outline:3px solid var(--accent);outline-offset:2px}.setting-row{display:flex;flex-direction:column;gap:10px;padding:12px 16px}.setting-row>span{display:flex;flex-direction:column;font-weight:500}.setting-row>span:has(svg){flex-direction:row;align-items:center;gap:6px}.setting-row input[type=time]{width:160px}.setting-row.nested{padding-left:32px}.settings .card{margin-bottom:4px}.settings-links{margin-top:8px}.sheet-layer{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;justify-content:flex-end}.sheet-backdrop{position:absolute;inset:0;background:var(--scrim);animation:fade .22s ease-out}.sheet{position:relative;max-height:92%;display:flex;flex-direction:column;background:var(--paper);border-radius:24px 24px 0 0;box-shadow:var(--shadow);animation:sheet-in .32s var(--ease-out);outline:none;transition:transform .28s var(--ease-out);will-change:transform}.grabber{width:40px;height:5px;border-radius:3px;background:var(--line);margin:8px auto 0;flex:none}.sheet-head{display:flex;align-items:center;gap:12px;padding:8px 8px 8px 20px;flex:none}.sheet-head h2{flex:1;font-size:19px;font-weight:800}.sheet-body{flex:1;min-height:0;overflow-y:auto;padding:4px 20px 16px}.sheet-foot{flex:none;display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 20px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line)}.sheet-lead{color:var(--ink-2);margin-bottom:14px}.sheet-body .section-label{padding:12px 0 8px}.linked-card{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:14px;background:var(--wash);margin-bottom:10px;font-size:14px}.linked-card>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}.preset{display:flex;flex-direction:column;gap:2px;min-height:64px;padding:10px 14px;border-radius:16px;border:1.5px solid var(--line)}.preset span{font-size:13px;color:var(--ink-3)}.preset[aria-checked=true]{border-color:var(--reminder);background:var(--reminder-tint)}.preset[aria-checked=true] span{color:var(--reminder)}.option-list{display:flex;flex-direction:column;gap:4px;margin-bottom:12px}.option{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:0 12px;border-radius:14px;background:var(--wash)}.option>span{flex:1;font-weight:600}@keyframes fade{0%{opacity:0}}.account-row{display:flex;align-items:center;padding-right:8px}.account-row .list-button:disabled{opacity:1;cursor:default}.account-row .list-button>svg:last-child{color:var(--accent)}.account-preview{display:flex;flex-direction:column;align-items:center;gap:4px;padding:16px 20px 24px}.account-badge{display:grid;place-items:center;width:72px;height:72px;border-radius:50%;border:3px solid var(--account);color:var(--account);background:color-mix(in srgb,var(--account) 14%,var(--paper));font-size:28px;font-weight:800;margin-bottom:8px}.swatches{display:flex;gap:12px;padding:0 20px;flex-wrap:wrap}.swatch{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;color:#fff}.swatch[aria-checked=true]{box-shadow:0 0 0 3px var(--paper),0 0 0 5px var(--ink)}.snooze-row{display:flex;align-items:center;padding-right:4px}.snooze-row .list-button small{display:inline-flex;align-items:center;gap:4px}.notice{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:48px 32px;color:var(--ink-2)}.notice h2{font-size:18px;color:var(--ink)}.notice .secondary{margin-top:12px}.notice-icon{display:grid;place-items:center;width:64px;height:64px;border-radius:20px;background:var(--accent-tint);color:var(--accent);margin-bottom:4px}.welcome{display:flex;flex-direction:column;gap:12px;max-width:360px;text-align:center}.welcome .logo{font-size:32px;margin-bottom:12px}.welcome h1{font-size:24px}.welcome p{color:var(--ink-2);margin-bottom:12px}.skeleton{padding:8px 12px;animation:fade .2s .12s both}.skeleton-row{display:flex;gap:12px;padding:12px 8px}.skeleton-avatar,.skeleton-row>div span,.skeleton .bar{background:linear-gradient(90deg,var(--chip) 0 40%,var(--shimmer) 50%,var(--chip) 60% 100%) var(--chip);background-size:300% 100%;animation:shimmer 1.4s linear infinite}.skeleton-avatar{width:40px;height:40px;border-radius:50%;flex:none}.skeleton-row>div{flex:1;display:flex;flex-direction:column;gap:8px}.skeleton-row>div span{height:12px;border-radius:6px}.skeleton-row>div span:nth-child(1){width:40%}.skeleton-row>div span:nth-child(3){width:70%}.skeleton.email{display:flex;flex-direction:column;gap:10px;padding:16px}.skeleton .bar{display:block;height:12px;border-radius:6px}.skeleton .bar.title{height:22px;border-radius:8px;width:85%}.skeleton .bar.title.short{width:55%;margin-bottom:8px}.skeleton .bar.short{width:60%}.skeleton.email .skeleton-row{padding:8px 0 12px}@keyframes shimmer{0%{background-position:100% 0}to{background-position:0 0}}.tabs{flex:none;display:flex;background:var(--paper);border-top:1px solid var(--line);padding:6px 8px calc(6px + env(safe-area-inset-bottom))}.tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;min-height:56px;font-size:13px;font-weight:600;color:var(--ink-3)}.tab-icon{position:relative;display:grid;place-items:center;width:64px;height:32px;border-radius:16px}.tab[aria-current=page]{color:var(--ink)}.tab[aria-current=page] .tab-icon{background:var(--accent-tint);color:var(--accent)}.badge{position:absolute;top:-4px;right:6px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--danger);color:#fff;font-size:11px;line-height:18px;text-align:center;font-weight:700}.badge.due{background:var(--reminder)}.toast-region{position:absolute;left:12px;right:12px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:40;display:flex;justify-content:center;pointer-events:none}.toast{pointer-events:auto;display:flex;align-items:center;gap:4px;min-height:52px;max-width:520px;width:100%;padding:4px 4px 4px 16px;border-radius:16px;background:var(--ink);color:var(--paper);box-shadow:var(--shadow);animation:toast-in var(--dur-medium) var(--ease-out)}.toast>span{flex:1}.toast button{min-height:44px;padding:0 12px;color:#a8bbff;font-weight:700}:root[data-theme=dark] .toast button{color:var(--accent-ink)}input[type=search]::-webkit-search-cancel-button{display:none}.search-screen .accent.block{margin-top:16px}.stage{position:absolute;inset:0}.ghosts,.ghost{position:absolute;inset:0;pointer-events:none}.ghost,.ghost *{animation:none!important;transition:none!important}.sheet-handle{flex:none;touch-action:none;cursor:grab}.sheet.dragging{transition:none}@keyframes sheet-in{0%{transform:translateY(100%)}}.list-button,.drawer-row,.option,.preset,.popover>button,.item-row,.thread-inner,.back-row,.tab,.week-day{transition:background-color var(--dur-short),color var(--dur-short),transform var(--dur-short) var(--ease-out)}.list-button:active,.option:active,.item-row:active,.back-row:active,.thread-inner:active{background-color:var(--press)}.thread-inner:active{background-image:linear-gradient(var(--press),var(--press))}.accent,.primary,.secondary,.outline,.chip,.add-pill,.fab,.preset,.option,.link-button,.segmented button,.week-day{transition:transform var(--dur-short) var(--ease-out),background-color var(--dur-short),color var(--dur-short),border-color var(--dur-short)}.accent:active,.primary:active,.secondary:active,.outline:active,.chip:active,.add-pill:active,.preset:active,.option:active,.week-day:active{transform:scale(.97)}.fab:active{transform:scale(.94)}.icon-button{transition:background-color var(--dur-short),transform var(--dur-short) var(--ease-out)}.icon-button:active{transform:scale(.92)}.popover{animation:pop-in .18s var(--ease-out);transform-origin:top right}.add-menu{transform-origin:top left}@keyframes pop-in{0%{opacity:0;transform:scale(.9)}}.tabs{animation:tabs-in var(--dur-medium) var(--ease-out)}@keyframes tabs-in{0%{transform:translateY(100%)}}.tab .tab-icon{isolation:isolate}.tab .tab-icon:before{content:\"\";position:absolute;inset:0;z-index:-1;border-radius:16px;background:var(--accent-tint);transform:scaleX(.3);opacity:0;transition:transform var(--dur-medium) var(--ease-out),opacity var(--dur-short)}.tab[aria-current=page] .tab-icon{background:none}.tab[aria-current=page] .tab-icon:before{transform:none;opacity:1}.tab:active .tab-icon:before{opacity:1;background:var(--press);transform:none}.tab[aria-current=page]:active .tab-icon:before{background:var(--accent-tint)}.badge{animation:badge-pop .3s var(--ease-spring)}@keyframes badge-pop{0%{transform:scale(.4)}}.crossfade{animation:fade var(--dur-medium) var(--ease-out)}.week-day{transition:background-color var(--dur-medium) var(--ease-out),color var(--dur-medium)}.progress span{transition:width .5s var(--ease-out)}.app.has-tabs .toast-region{bottom:84px}@keyframes toast-in{0%{opacity:0;transform:translateY(24px) scale(.96)}}.toast.leaving{animation:toast-out .18s var(--ease-in) forwards}@keyframes toast-out{to{opacity:0;transform:translateY(16px) scale(.96)}}.fab{transition:transform var(--dur-medium) var(--ease-out),background-color var(--dur-short)}.app.has-toast .fab{transform:translateY(-64px)}.app.has-toast .fab:active{transform:translateY(-64px) scale(.94)}.message-body{animation:fade var(--dur-medium) var(--ease-out)}:root{--shimmer: rgba(255, 255, 255, .7)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--shimmer: rgba(255, 255, 255, .1)}}:root[data-theme=dark]{--shimmer: rgba(255, 255, 255, .1)}.progress-bar{position:relative;flex:none;height:3px;margin-bottom:-3px;z-index:2;overflow:hidden;opacity:0;transition:opacity .2s;pointer-events:none}.progress-bar.active{opacity:1;transition-delay:.25s}.progress-bar.active:before{content:\"\";position:absolute;inset:0 auto 0 0;width:40%;border-radius:2px;background:var(--accent);animation:progress 1.2s var(--ease-out) infinite}@keyframes progress{0%{transform:translate(-100%)}to{transform:translate(250%)}}.spinner{width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.list-end{flex-direction:column;align-items:center;gap:4px}.screen{position:relative}.pull-indicator{position:absolute;top:-44px;left:50%;z-index:3;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--paper);color:var(--ink-3);box-shadow:0 2px 8px #0000002e;pointer-events:none}.pull-indicator.armed,.pull-indicator.active{color:var(--accent)}.pull-indicator.active{transition:transform .25s var(--ease-out)}.pull-indicator span{display:grid}.pull-indicator.active span{animation:spin .8s linear infinite}.reveal{animation:fade .24s var(--ease-out)}.mark{transition:background-color .15s,border-color .15s}.mark.checking{background:var(--done);border-color:var(--done);color:#fff;animation:badge-pop .32s var(--ease-spring)}.today-title{transition:opacity .25s}.today-row.is-done .today-title{opacity:.55;text-decoration:line-through}.star.on svg{animation:star-pop .36s var(--ease-spring)}@keyframes star-pop{0%{transform:scale(.5) rotate(-30deg)}to{transform:none}}.thread-inner{transition:background-color var(--dur-short),transform .22s var(--ease-out)}.thread-inner.dragging{transition:none}.swipe-under svg{transition:transform .15s var(--ease-spring)}.swipe-under.armed svg{transform:scale(1.3)}@media(prefers-reduced-motion:reduce){.skeleton-avatar,.skeleton-row>div span,.skeleton .bar,.progress-bar.active:before{animation:none}.progress-bar.active:before{width:100%;opacity:.5}.reveal,.mark.checking,.star.on svg,.pull-indicator.active span{animation:none}}\n"},{"path":"foreground.js","encoding":"utf8","content":"\"use strict\";(()=>{var t1=Object.create;var lm=Object.defineProperty;var n1=Object.getOwnPropertyDescriptor;var a1=Object.getOwnPropertyNames;var l1=Object.getPrototypeOf,i1=Object.prototype.hasOwnProperty;var kn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var o1=(e,t,n,a)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let l of a1(t))!i1.call(e,l)&&l!==n&&lm(e,l,{get:()=>t[l],enumerable:!(a=n1(t,l))||a.enumerable});return e};var Y=(e,t,n)=>(n=e!=null?t1(l1(e)):{},o1(t||!e||!e.__esModule?lm(n,\"default\",{value:e,enumerable:!0}):n,e));var km=kn($=>{\"use strict\";var zc=Symbol.for(\"react.transitional.element\"),O1=Symbol.for(\"react.portal\"),k1=Symbol.for(\"react.fragment\"),_1=Symbol.for(\"react.strict_mode\"),R1=Symbol.for(\"react.profiler\"),U1=Symbol.for(\"react.consumer\"),H1=Symbol.for(\"react.context\"),B1=Symbol.for(\"react.forward_ref\"),L1=Symbol.for(\"react.suspense\"),G1=Symbol.for(\"react.memo\"),wm=Symbol.for(\"react.lazy\"),q1=Symbol.for(\"react.activity\"),Y1=Symbol.for(\"react.view_transition\"),xm=Symbol.iterator;function j1(e){return e===null||typeof e!=\"object\"?null:(e=xm&&e[xm]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var Em={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Am=Object.assign,Mm={};function Ql(e,t,n){this.props=e,this.context=t,this.refs=Mm,this.updater=n||Em}Ql.prototype.isReactComponent={};Ql.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};Ql.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function Dm(){}Dm.prototype=Ql.prototype;function Cc(e,t,n){this.props=e,this.context=t,this.refs=Mm,this.updater=n||Em}var Oc=Cc.prototype=new Dm;Oc.constructor=Cc;Am(Oc,Ql.prototype);Oc.isPureReactComponent=!0;var Sm=Array.isArray;function Dc(){}var ze={H:null,A:null,T:null,S:null},zm=Object.prototype.hasOwnProperty;function kc(e,t,n){var a=n.ref;return{$$typeof:zc,type:e,key:t,ref:a!==void 0?a:null,props:n}}function X1(e,t){return kc(e.type,t,e.props)}function _c(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===zc}function V1(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(n){return t[n]})}var Tm=/\\/+/g;function Mc(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?V1(\"\"+e.key):t.toString(36)}function Q1(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(Dc,Dc):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function Vl(e,t,n,a,l){var i=typeof e;(i===\"undefined\"||i===\"boolean\")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case\"bigint\":case\"string\":case\"number\":o=!0;break;case\"object\":switch(e.$$typeof){case zc:case O1:o=!0;break;case wm:return o=e._init,Vl(o(e._payload),t,n,a,l)}}if(o)return l=l(e),o=a===\"\"?\".\"+Mc(e,0):a,Sm(l)?(n=\"\",o!=null&&(n=o.replace(Tm,\"$&/\")+\"/\"),Vl(l,t,n,\"\",function(c){return c})):l!=null&&(_c(l)&&(l=X1(l,n+(l.key==null||e&&e.key===l.key?\"\":(\"\"+l.key).replace(Tm,\"$&/\")+\"/\")+o)),t.push(l)),1;o=0;var u=a===\"\"?\".\":a+\":\";if(Sm(e))for(var r=0;r{\"use strict\";_m.exports=km()});var Xm=kn(He=>{\"use strict\";function Bc(e,t){var n=e.length;e.push(t);e:for(;0>>1,l=e[a];if(0>>1;avu(u,n))rvu(c,u)?(e[a]=c,e[r]=n,a=r):(e[a]=u,e[o]=n,a=o);else if(rvu(c,n))e[a]=c,e[r]=n,a=r;else break e}}return t}function vu(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}He.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(Rm=performance,He.unstable_now=function(){return Rm.now()}):(Rc=Date,Um=Rc.now(),He.unstable_now=function(){return Rc.now()-Um});var Rm,Rc,Um,ea=[],ya=[],K1=1,on=null,xt=3,Lc=!1,$i=!1,Fi=!1,Gc=!1,Lm=typeof setTimeout==\"function\"?setTimeout:null,Gm=typeof clearTimeout==\"function\"?clearTimeout:null,Hm=typeof setImmediate<\"u\"?setImmediate:null;function yu(e){for(var t=_n(ya);t!==null;){if(t.callback===null)bu(ya);else if(t.startTime<=e)bu(ya),t.sortIndex=t.expirationTime,Bc(ea,t);else break;t=_n(ya)}}function qc(e){if(Fi=!1,yu(e),!$i)if(_n(ea)!==null)$i=!0,Il||(Il=!0,Zl());else{var t=_n(ya);t!==null&&Yc(qc,t.startTime-e)}}var Il=!1,Wi=-1,qm=5,Ym=-1;function jm(){return Gc?!0:!(He.unstable_now()-Yme&&jm());){var a=on.callback;if(typeof a==\"function\"){on.callback=null,xt=on.priorityLevel;var l=a(on.expirationTime<=e);if(e=He.unstable_now(),typeof l==\"function\"){on.callback=l,yu(e),t=!0;break t}on===_n(ea)&&bu(ea),yu(e)}else bu(ea);on=_n(ea)}if(on!==null)t=!0;else{var i=_n(ya);i!==null&&Yc(qc,i.startTime-e),t=!1}}break e}finally{on=null,xt=n,Lc=!1}t=void 0}}finally{t?Zl():Il=!1}}}var Zl;typeof Hm==\"function\"?Zl=function(){Hm(Uc)}:typeof MessageChannel<\"u\"?(Hc=new MessageChannel,Bm=Hc.port2,Hc.port1.onmessage=Uc,Zl=function(){Bm.postMessage(null)}):Zl=function(){Lm(Uc,0)};var Hc,Bm;function Yc(e,t){Wi=Lm(function(){e(He.unstable_now())},t)}He.unstable_IdlePriority=5;He.unstable_ImmediatePriority=1;He.unstable_LowPriority=4;He.unstable_NormalPriority=3;He.unstable_Profiling=null;He.unstable_UserBlockingPriority=2;He.unstable_cancelCallback=function(e){e.callback=null};He.unstable_forceFrameRate=function(e){0>e||125a?(e.sortIndex=n,Bc(ya,e),_n(ea)===null&&e===_n(ya)&&(Fi?(Gm(Wi),Wi=-1):Fi=!0,Yc(qc,n-a))):(e.sortIndex=l,Bc(ea,e),$i||Lc||($i=!0,Il||(Il=!0,Zl()))),e};He.unstable_shouldYield=jm;He.unstable_wrapCallback=function(e){var t=xt;return function(){var n=xt;xt=t;try{return e.apply(this,arguments)}finally{xt=n}}}});var Qm=kn((kT,Vm)=>{\"use strict\";Vm.exports=Xm()});var Km=kn(St=>{\"use strict\";var J1=Ke();function Im(e){var t=\"https://react.dev/errors/\"+e;if(1{\"use strict\";function Jm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jm)}catch(e){console.error(e)}}Jm(),$m.exports=Km()});var B0=kn(tc=>{\"use strict\";var tt=Qm(),Hg=Ke(),P1=Fm();function N(e){var t=\"https://react.dev/errors/\"+e;if(1ni||(e.current=Ms[ni],Ms[ni]=null,ni--)}function ke(e,t){ni++,Ms[ni]=e.current,e.current=t}var Xn=Zn(null),Eo=Zn(null),ka=Zn(null),ur=Zn(null);function rr(e,t){switch(ke(ka,t),ke(Eo,e),ke(Xn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gg(t),e=f0(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}mt(Xn),ke(Xn,e)}function Ti(){mt(Xn),mt(Eo),mt(ka)}function Ds(e){var t=e.memoizedState;t!==null&&(ki._currentValue=t.memoizedState,ke(ur,e)),t=Xn.current;var n=f0(t,e.type);t!==n&&(ke(Eo,e),ke(Xn,n))}function cr(e){Eo.current===e&&(mt(Xn),mt(Eo)),ur.current===e&&(mt(ur),ki._currentValue=fl)}var jc,np;function Sa(e){if(jc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);jc=t&&t[1]||\"\",np=-1)\":-1l||r[a]!==c[l]){var m=`\n`+r[a].replace(\" at new \",\" at \");return e.displayName&&m.includes(\"\")&&(m=m.replace(\"\",e.displayName)),m}while(1<=a&&0<=l);break}}}finally{Xc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?Sa(n):\"\"}function rb(e,t){switch(e.tag){case 26:case 27:case 5:return Sa(e.type);case 16:return Sa(\"Lazy\");case 13:return e.child!==t&&t!==null?Sa(\"Suspense Fallback\"):Sa(\"Suspense\");case 19:return Sa(\"SuspenseList\");case 0:case 15:return Vc(e.type,!1);case 11:return Vc(e.type.render,!1);case 1:return Vc(e.type,!0);case 31:return Sa(\"Activity\");case 30:return Sa(\"ViewTransition\");default:return\"\"}}function ap(e){try{var t=\"\",n=null;do t+=rb(e,n),n=e,e=e.return;while(e);return t}catch(a){return`\nError generating stack: `+a.message+`\n`+a.stack}}var zs=Object.prototype.hasOwnProperty,kd=tt.unstable_scheduleCallback,Qc=tt.unstable_cancelCallback,cb=tt.unstable_shouldYield,sb=tt.unstable_requestPaint,Kt=tt.unstable_now,db=tt.unstable_getCurrentPriorityLevel,Qg=tt.unstable_ImmediatePriority,Zg=tt.unstable_UserBlockingPriority,sr=tt.unstable_NormalPriority,fb=tt.unstable_LowPriority,Ig=tt.unstable_IdlePriority,mb=tt.log,pb=tt.unstable_setDisableYieldValue,jo=null,Jt=null;function Aa(e){if(typeof mb==\"function\"&&pb(e),Jt&&typeof Jt.setStrictMode==\"function\")try{Jt.setStrictMode(jo,e)}catch{}}var $t=Math.clz32?Math.clz32:vb,gb=Math.log,hb=Math.LN2;function vb(e){return e>>>=0,e===0?32:31-(gb(e)/hb|0)|0}var Tu=256,Nu=262144,wu=4194304;function ul(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Hr(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var u=a&134217727;return u!==0?(a=u&~i,a!==0?l=ul(a):(o&=u,o!==0?l=ul(o):n||(n=u&~e,n!==0&&(l=ul(n))))):(u=a&~i,u!==0?l=ul(u):o!==0?l=ul(o):n||(n=a&~e,n!==0&&(l=ul(n)))),l===0?0:t!==0&&t!==l&&(t&i)===0&&(i=l&-l,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:l}function Xo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Kg(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Vo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bb(e,t,n,a,l,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var u=e.entanglements,r=e.expirationTimes,c=e.hiddenUpdates;for(n=o&~n;0\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),_s=!1;if(ua)try{Kl={},Object.defineProperty(Kl,\"passive\",{get:function(){_s=!0}}),window.addEventListener(\"test\",Kl,Kl),window.removeEventListener(\"test\",Kl,Kl)}catch{_s=!1}var Kl,Ma=null,Bd=null,Vu=null;function sh(){if(Vu)return Vu;var e,t=Bd,n=t.length,a,l=\"value\"in Ma?Ma.value:Ma.textContent,i=l.length;for(e=0;e=fo),hp=\" \",vp=!1;function fh(e,t){switch(e){case\"keyup\":return tx.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function mh(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var li=!1;function ax(e,t){switch(e){case\"compositionend\":return mh(t);case\"keypress\":return t.which!==32?null:(vp=!0,hp);case\"textInput\":return e=t.data,e===hp&&vp?null:e;default:return null}}function lx(e,t){if(li)return e===\"compositionend\"||!Gd&&fh(e,t)?(e=sh(),Vu=Bd=Ma=null,li=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function Sp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tp(e,t){var n=Sp(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Sp(n)}}function vh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vh(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rs(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rs(e.document)}return t}function qd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var fx=ua&&\"documentMode\"in document&&11>=document.documentMode,ii=null,Us=null,po=null,Hs=!1;function Np(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hs||ii==null||ii!==Rs(a)||(a=ii,\"selectionStart\"in a&&qd(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),po&&Do(po,a)||(po=a,a=_r(Us,\"onSelect\"),0>=o,l-=o,Yn=1<<32-$t(t)+l|n<D?(Q=C,C=null):Q=C.sibling;var O=f(p,C,v[D],x);if(O===null){C===null&&(C=Q);break}e&&C&&O.alternate===null&&t(p,C),g=i(O,g,D),U===null?w=O:U.sibling=O,U=O,C=Q}if(D===v.length)return n(p,C),ee&&aa(p,D),w;if(C===null){for(;DD?(Q=C,C=null):Q=C.sibling;var ne=f(p,C,O.value,x);if(ne===null){C===null&&(C=Q);break}e&&C&&ne.alternate===null&&t(p,C),g=i(ne,g,D),U===null?w=ne:U.sibling=ne,U=ne,C=Q}if(O.done)return n(p,C),ee&&aa(p,D),w;if(C===null){for(;!O.done;D++,O=v.next())O=d(p,O.value,x),O!==null&&(g=i(O,g,D),U===null?w=O:U.sibling=O,U=O);return ee&&aa(p,D),w}for(C=a(C);!O.done;D++,O=v.next())O=s(C,p,D,O.value,x),O!==null&&(e&&(Q=O.alternate,Q!==null&&C.delete(Q.key===null?D:Q.key)),g=i(O,g,D),U===null?w=O:U.sibling=O,U=O);return e&&C.forEach(function(Ne){return t(p,Ne)}),ee&&aa(p,D),w}function S(p,g,v,x){if(typeof v==\"object\"&&v!==null&&v.type===ti&&v.key===null&&v.props.ref===void 0&&(v=v.props.children),typeof v==\"object\"&&v!==null){switch(v.$$typeof){case Su:e:{for(var w=v.key;g!==null;){if(g.key===w){if(w=v.type,w===ti){if(g.tag===7){n(p,g.sibling),x=l(g,v.props.children),xa(x,v),x.return=p,p=x;break e}}else if(g.elementType===w||typeof w==\"object\"&&w!==null&&w.$$typeof===Na&&rl(w)===g.type){n(p,g.sibling),x=l(g,v.props),xa(x,v),x.return=p,p=x;break e}n(p,g);break}else t(p,g);g=g.sibling}v.type===ti?(x=ml(v.props.children,p.mode,x,v.key),xa(x,v),x.return=p,p=x):(x=Zu(v.type,v.key,v.props,null,p.mode,x),xa(x,v),x.return=p,p=x)}return o(p);case oo:e:{for(w=v.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(p,g.sibling),x=l(g,v.children||[]),x.return=p,p=x;break e}else{n(p,g);break}else t(p,g);g=g.sibling}x=ts(v,p.mode,x),x.return=p,p=x}return o(p);case Na:return v=rl(v),S(p,g,v,x)}if(uo(v))return h(p,g,v,x);if(eo(v)){if(w=eo(v),typeof w!=\"function\")throw Error(N(150));return v=w.call(v),y(p,g,v,x)}if(typeof v.then==\"function\")return S(p,g,Cu(v),x);if(v.$$typeof===Gn)return S(p,g,zu(p,v),x);Ou(p,v)}return typeof v==\"string\"&&v!==\"\"||typeof v==\"number\"||typeof v==\"bigint\"?(v=\"\"+v,g!==null&&g.tag===6?(n(p,g.sibling),x=l(g,v),x.return=p,p=x):(n(p,g),x=es(v,p.mode,x),x.return=p,p=x),o(p)):n(p,g)}return function(p,g,v,x){try{Oo=0;var w=S(p,g,v,x);return hi=null,w}catch(C){if(C===Bi||C===Vr)throw C;var U=Bt(29,C,null,p.mode);return U.lanes=x,U.return=p,U}}}var Sl=_h(!0),Rh=_h(!1),wa=!1;function Kd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function js(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(se&2)!==0){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=mr(e),Eh(e,null,n),t}return jr(e,a,t,n),mr(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Fg(e,n)}}function as(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xs=!1;function vo(){if(Xs){var e=gi;if(e!==null)throw e}}function yo(e,t,n,a){Xs=!1;var l=e.updateQueue;wa=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var r=u,c=r.next;r.next=null,o===null?i=c:o.next=c,o=r;var m=e.alternate;m!==null&&(m=m.updateQueue,u=m.lastBaseUpdate,u!==o&&(u===null?m.firstBaseUpdate=c:u.next=c,m.lastBaseUpdate=r))}if(i!==null){var d=l.baseState;o=0,m=c=r=null,u=i;do{var f=u.lane&-536870913,s=f!==u.lane;if(s?(oe&f)===f:(a&f)===f){f!==0&&f===xl&&(Xs=!0),m!==null&&(m=m.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var h=e,y=u;f=t;var S=n;switch(y.tag){case 1:if(h=y.payload,typeof h==\"function\"){d=h.call(S,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=y.payload,f=typeof h==\"function\"?h.call(S,d,f):h,f==null)break e;d=Me({},d,f);break e;case 2:wa=!0}}f=u.callback,f!==null&&(e.flags|=64,s&&(e.flags|=8192),s=l.callbacks,s===null?l.callbacks=[f]:s.push(f))}else s={lane:f,tag:u.tag,payload:u.payload,callback:u.callback,next:null},m===null?(c=m=s,r=d):m=m.next=s,o|=f;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;s=u,u=s.next,s.next=null,l.lastBaseUpdate=s,l.shared.pending=null}}while(!0);m===null&&(r=d),l.baseState=r,l.firstBaseUpdate=c,l.lastBaseUpdate=m,i===null&&(l.shared.lanes=0),Za|=o,e.lanes=o,e.memoizedState=d}}function Uh(e,t){if(typeof e!=\"function\")throw Error(N(191,e));e.call(t)}function Hh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ei?i:8;var o=Z.T,u={};u.types=o!==null?o.types:null,Z.T=u,cf(e,!1,t,n);try{var r=l(),c=Z.S;if(c!==null&&c(u,r),r!==null&&typeof r==\"object\"&&typeof r.then==\"function\"){var m=Nx(r,a);bo(e,t,m,Ft(e))}else bo(e,t,a,Ft(e))}catch(d){bo(e,t,{then:function(){},status:\"rejected\",reason:d},Ft())}finally{de.p=i,o!==null&&u.types!==null&&(o.types=u.types),Z.T=o}}function zx(){}function Ks(e,t,n,a){if(e.tag!==5)throw Error(N(476));var l=uv(e).queue;ov(e,l,t,fl,n===null?zx:function(){return rv(e),n(a)})}function uv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fl,baseState:fl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:fl},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rv(e){var t=uv(e);t.next===null&&(t=e.alternate.memoizedState),bo(e,t.next.queue,{},Ft())}function rf(){return ft(ki)}function cv(){return Qe().memoizedState}function sv(){return Qe().memoizedState}function Cx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ft();e=Ra(n);var a=Ua(t,e,n);a!==null&&(Lt(a,t,n),ho(a,t,n)),t={cache:Qd()},e.payload=t;return}t=t.return}}function Ox(e,t,n){var a=Ft();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Kr(e)?fv(t,n):(n=jd(e,t,n,a),n!==null&&(Lt(n,e,a),mv(n,t,a)))}function dv(e,t,n){var a=Ft();bo(e,t,n,a)}function bo(e,t,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Kr(e))fv(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,u=i(o,n);if(l.hasEagerState=!0,l.eagerState=u,Wt(u,o))return jr(e,t,l,0),Ae===null&&Yr(),!1}catch{}if(n=jd(e,t,l,a),n!==null)return Lt(n,e,a),mv(n,t,a),!0}return!1}function cf(e,t,n,a){if(a={lane:2,revertLane:xf(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Kr(e)){if(t)throw Error(N(479))}else t=jd(e,n,a,2),t!==null&&Lt(t,e,2)}function Kr(e){var t=e.alternate;return e===F||t!==null&&t===F}function fv(e,t){vi=xr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mv(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Fg(e,n)}}var Tr={readContext:ft,use:Zr,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye,useEffectEvent:Ye},pv={readContext:ft,use:Zr,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:Gp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$u(4194308,4,tv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $u(4194308,4,e,t)},useInsertionEffect:function(e,t){$u(4,2,e,t)},useMemo:function(e,t){var n=Dt();t=t===void 0?null:t;var a=e();if(Tl){Aa(!0);try{e()}finally{Aa(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Dt();if(n!==void 0){var l=n(t);if(Tl){Aa(!0);try{n(t)}finally{Aa(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=Ox.bind(null,F,e),[a.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Zs(e);var t=e.queue,n=dv.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:of,useDeferredValue:function(e,t){var n=Dt();return uf(n,e,t)},useTransition:function(){var e=Zs(!1);return e=ov.bind(null,F,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=F,l=Dt();if(ee){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),Ae===null)throw Error(N(349));(oe&127)!==0||Yh(a,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Gp(Xh.bind(null,a,i,e),[e]),a.flags|=2048,Ei(9,{destroy:void 0},jh.bind(null,a,i,n,t),null),n},useId:function(){var e=Dt(),t=Ae.identifierPrefix;if(ee){var n=jn,a=Yn;n=(a&~(1<<32-$t(a)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=Sr++,0<\\/script>\",i=i.removeChild(i.firstChild);break;case\"select\":i=typeof a.is==\"string\"?o.createElement(\"select\",{is:a.is}):o.createElement(\"select\"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is==\"string\"?o.createElement(l,{is:a.is}):o.createElement(l)}}i[dt]=t,i[qt]=a;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(gt(i,l,a),l){case\"button\":case\"input\":case\"select\":case\"textarea\":a=!!a.autoFocus;break e;case\"img\":a=!0;break e;default:a=!1}a&&na(t)}}return Ce(t),t.subtreeFlags&=-33554433,us(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&na(t);else{if(typeof a!=\"string\"&&t.stateNode===null)throw Error(N(166));if(e=ka.current,Jl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=it,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||d0(e.nodeValue,n)),e||Xa(t,!0)}else e=Ho(e).createTextNode(a),e[dt]=t,t.stateNode=e}return Ce(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Jl(t),n!==null){if(e===null){if(!a)throw Error(N(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(557));e[dt]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ce(t),e=!1}else n=ns(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Qt(t),t):(Qt(t),null);if((t.flags&128)!==0)throw Error(N(558))}return Ce(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Jl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(N(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(N(317));l[dt]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ce(t),l=!1}else l=ns(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(Qt(t),t):(Qt(t),null)}return Qt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==l&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ru(t,t.updateQueue),Ce(t),null);case 4:return Ti(),e===null&&Sf(t.stateNode.containerInfo),t.flags|=67108864,Ce(t),null;case 10:return oa(t.type),Ce(t),null;case 19:if($d(t),a=t.memoizedState,a===null)return Ce(t),null;if(l=(t.flags&128)!==0,i=a.rendering,i===null)if(l)no(a,!1);else{if(je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=br(e),i!==null){for(t.flags|=128,no(a,!1),e=i.updateQueue,t.updateQueue=e,Ru(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ah(n,e),n=n.sibling;return ko(t,pt.current&1|2),ee&&aa(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Kt()>zr&&(t.flags|=128,l=!0,no(a,!1),t.lanes=4194304)}else{if(!l)if(e=br(i),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Ru(t,e),no(a,!0),a.tail===null&&a.tailMode!==\"collapsed\"&&a.tailMode!==\"visible\"&&!i.alternate&&!ee)return Ce(t),null}else 2*Kt()-a.renderingStartTime>zr&&n!==536870912&&(t.flags|=128,l=!0,no(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}if(a.tail!==null){e=a.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Kt(),e.sibling=null,i=pt.current,i=l?i&1|2:i&1,a.tailMode===\"visible\"||a.tailMode===\"collapsed\"||!n||ee?ko(t,i):(n=i,ke(ht,t),ke(pt,n),Tt===null&&(Tt=t)),ee&&aa(t,a.treeForkCount),e}return Ce(t),null;case 22:case 23:return Qt(t),Jd(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ce(t),t.subtreeFlags&6&&(t.flags|=8192)):Ce(t),n=t.updateQueue,n!==null&&Ru(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&mt(pl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),oa($e),Ce(t),null;case 25:return null;case 30:return t.flags|=33554432,Ce(t),null}throw Error(N(156,t.tag))}function Lx(e,t){switch(Vd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return oa($e),Ti(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return cr(t),null;case 31:if(t.memoizedState!==null){if(Qt(t),t.alternate===null)throw Error(N(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $d(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ti(),null;case 10:return oa(t.type),null;case 22:case 23:return Qt(t),Jd(),e!==null&&mt(pl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return oa($e),null;case 25:return null;default:return null}}function Ev(e,t){switch(Vd(t),t.tag){case 3:oa($e),Ti();break;case 26:case 27:case 5:cr(t);break;case 4:Ti();break;case 31:t.memoizedState!==null&&Qt(t);break;case 13:Qt(t);break;case 19:$d(t);break;case 10:oa(t.type);break;case 22:case 23:Qt(t),Jd(),e!==null&&mt(pl);break;case 24:oa($e)}}function Jo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var i=n.create,o=n.inst;a=i(),o.destroy=a}n=n.next}while(n!==l)}}catch(u){be(t,t.return,u)}}function Qa(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&e)===e){var o=a.inst,u=o.destroy;if(u!==void 0){o.destroy=void 0,l=t;var r=n,c=u;try{c()}catch(m){be(l,r,m)}}}a=a.next}while(a!==i)}}catch(m){be(t,t.return,m)}}function Av(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hh(t,n)}catch(a){be(e,e.return,a)}}}function Mv(e,t,n){n.props=Nl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){be(e,t,a)}}function Bn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:var l=e.stateNode,i=ra(e.memoizedProps,l);(l.ref===null||l.ref.name!==i)&&(l.ref=v0(i)),a=l.ref;break;case 7:if(e.stateNode===null){var o=new Pt(e);Gt(e.child,!1,A2,o,void 0,void 0),e.stateNode=o}a=e.stateNode;break;default:a=e.stateNode}typeof n==\"function\"?e.refCleanup=n(a):n.current=a}}catch(u){be(e,t,u)}}function st(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a==\"function\")try{a()}catch(l){be(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(l){be(e,t,l)}else n.current=null}function wr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title\"))),gt(a,t,n),a[dt]=e,lt(a),t=a;break e;case\"link\":if(i=Mg(\"link\",\"href\",l).get(t+(n.href||\"\"))){for(o=0;oS&&(o=S,S=y,y=o);var p=Tp(u,y),g=Tp(u,S);if(p&&g&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==g.node||s.focusOffset!==g.offset)){var v=d.createRange();v.setStart(p.node,p.offset),s.removeAllRanges(),y>S?(s.addRange(v),s.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),s.addRange(v))}}}}for(d=[],s=u;s=s.parentNode;)s.nodeType===1&&d.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof u.focus==\"function\"&&u.focus(),u=0;un?32:n,Z.T=null,n=md,md=null;var i=An,o=Vn;if(Ge=0,wl=An=null,Vn=0,(se&6)!==0)throw Error(N(331));var u=se;if(se|=4,Zv(i.current),Xv(i,i.current,o,n),se=u,$o(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot==\"function\")try{Jt.onPostCommitFiberRoot(jo,i)}catch{}return!0}finally{de.p=l,Z.T=a,l0(e,t)}}function ug(e,t,n){t=fn(n,t),t=$s(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Vo(e,2),In(e))}function be(e,t,n){if(e.tag===3)ug(e,e,n);else for(;t!==null;){if(t.tag===3){ug(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof a.componentDidCatch==\"function\"&&(La===null||!La.has(a))){e=fn(n,e),n=bv(2),a=Ua(t,n,2),a!==null&&(xv(n,a,t,e),Vo(a,2),In(a));break}}t=t.return}}function fs(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new jx;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(yf=!0,l.add(n),e=$x.bind(null,e,t,n),t.then(e,e))}function $x(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ae===e&&(oe&n)===n&&((je===4||je===3&&(oe&62914560)===oe&&300>Kt()-$r)&&(se&2)===0?Di(e,0):Dr|=n,Ai===oe&&(Ai=0)),In(e)}function i0(e,t){t===0&&(t=Jg()),e=Dl(e,t),e!==null&&(Vo(e,t),In(e))}function Fx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),i0(e,n)}function Wx(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(N(314))}a!==null&&a.delete(t),i0(e,n)}function Px(e,t){return kd(e,t)}var zi=null,Pl=null,yd=!1,kr=!1,ms=!1,Oa=0;function In(e){e!==Pl&&e.next===null&&(Pl===null?zi=Pl=e:Pl=Pl.next=e),kr=!0,yd||(yd=!0,t2())}function $o(e,t){if(!ms&&kr){ms=!0;do for(var n=!1,a=zi;a!==null;){if(!t)if(e!==0){var l=a.pendingLanes;if(l===0)var i=0;else{var o=a.suspendedLanes,u=a.pingedLanes;i=(1<<31-$t(42|e)+1)-1,i&=l&~(o&~u),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,rg(a,i))}else i=oe,i=Hr(a,a===Ae?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Xo(a,i)||(n=!0,rg(a,i));a=a.next}while(n);ms=!1}}function e2(){o0()}function o0(){kr=yd=!1;var e=0;Oa!==0&&s2()&&(e=Oa);for(var t=Kt(),n=null,a=zi;a!==null;){var l=a.next,i=u0(a,t);i===0?(a.next=null,n===null?zi=l:n.next=l,l===null&&(Pl=n)):(n=a,(e!==0||(i&3)!==0)&&(kr=!0)),a=l}Ge!==0&&Ge!==5||$o(e,!1),Oa!==0&&(Oa=0)}function u0(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes&-62914561;0u)break;var m=r.transferSize,d=r.initiatorType;m&&pg(d)&&(r=r.responseEnd,o+=m*(rlr){y.length=h;break}v=new Promise(h2.bind(v)),y.push(v)}}}if(0\"u\"?null:document;function E0(e,t,n){var a=qi;if(a&&typeof t==\"string\"&&t){var l=dn(t);l='link[rel=\"'+e+'\"][href=\"'+l+'\"]',typeof n==\"string\"&&(l+='[crossorigin=\"'+n+'\"]'),wg.has(l)||(wg.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement(\"link\"),gt(t,\"link\",e),lt(t),a.head.appendChild(t)))}}function U2(e){ga.D(e),E0(\"dns-prefetch\",e,null)}function H2(e,t){ga.C(e,t),E0(\"preconnect\",e,t)}function B2(e,t,n){ga.L(e,t,n);var a=qi;if(a&&e&&t){var l='link[rel=\"preload\"][as=\"'+dn(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(l+='[imagesrcset=\"'+dn(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(l+='[imagesizes=\"'+dn(n.imageSizes)+'\"]')):l+='[href=\"'+dn(e)+'\"]';var i=l;switch(t){case\"style\":i=Oi(e);break;case\"script\":i=Yi(e)}if(!(gn.has(i)||(e=Me({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),gn.set(i,e),a.querySelector(l)!==null||t===\"style\"&&a.querySelector(Fo(i))||t===\"script\"&&a.querySelector(Wo(i))))){var o=a.createElement(\"link\");gt(o,\"link\",e),t===\"style\"&&(o[dr]=!0,o.onload=o.onerror=function(){eh(o)}),lt(o),a.head.appendChild(o)}}}function L2(e,t){ga.m(e,t);var n=qi;if(n&&e){var a=t&&typeof t.as==\"string\"?t.as:\"script\",l='link[rel=\"modulepreload\"][as=\"'+dn(a)+'\"][href=\"'+dn(e)+'\"]',i=l;switch(a){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":i=Yi(e)}if(!gn.has(i)&&(e=Me({rel:\"modulepreload\",href:e},t),gn.set(i,e),n.querySelector(l)===null)){switch(a){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(Wo(i)))return}a=n.createElement(\"link\"),gt(a,\"link\",e),lt(a),n.head.appendChild(a)}}}function G2(e,t,n){ga.S(e,t,n);var a=qi;if(a&&e){var l=fi(a).hoistableStyles,i=Oi(e);t=t||\"default\";var o=l.get(i);if(!o){var u={loading:0,preload:null};if(o=a.querySelector(Fo(i)))u.loading=5;else{e=Me({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=gn.get(i))&&Ef(e,n);var r=o=a.createElement(\"link\");lt(r),gt(r,\"link\",e),r._p=new Promise(function(c,m){r.onload=c,r.onerror=m}),r.addEventListener(\"load\",function(){u.loading|=1}),r.addEventListener(\"error\",function(){u.loading|=2}),u.loading|=4,nr(o,t,a)}o={type:\"stylesheet\",instance:o,count:1,state:u},l.set(i,o)}}}function q2(e,t){ga.X(e,t);var n=qi;if(n&&e){var a=fi(n).hoistableScripts,l=Yi(e),i=a.get(l);i||(i=n.querySelector(Wo(l)),i||(e=Me({src:e,async:!0},t),(t=gn.get(l))&&Af(e,t),i=n.createElement(\"script\"),lt(i),gt(i,\"link\",e),n.head.appendChild(i)),i={type:\"script\",instance:i,count:1,state:null},a.set(l,i))}}function Y2(e,t){ga.M(e,t);var n=qi;if(n&&e){var a=fi(n).hoistableScripts,l=Yi(e),i=a.get(l);i||(i=n.querySelector(Wo(l)),i||(e=Me({src:e,async:!0,type:\"module\"},t),(t=gn.get(l))&&Af(e,t),i=n.createElement(\"script\"),lt(i),gt(i,\"link\",e),n.head.appendChild(i)),i={type:\"script\",instance:i,count:1,state:null},a.set(l,i))}}function Eg(e,t,n,a){var l=(l=ka.current)?Bo(l):null;if(!l)throw Error(N(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(n=Oi(n.href),t=fi(l).hoistableStyles,a=t.get(n),a||(a={type:\"style\",instance:null,count:0,state:null},t.set(n,a)),a):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=Oi(n.href);var i=fi(l).hoistableStyles,o=i.get(e);if(o||(l=l.ownerDocument||l,o={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=l.querySelector(Fo(e)))?i._p||(o.instance=i,o.state.loading=5):(i=gn.get(e),i||(i={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gn.set(e,i)),j2(l,e,i,o.state))),t&&a===null)throw Error(N(528,\"\"));return o}if(t&&a!==null)throw Error(N(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(n=Yi(n),t=fi(l).hoistableScripts,a=t.get(n),a||(a={type:\"script\",instance:null,count:0,state:null},t.set(n,a)),a):{type:\"void\",instance:null,count:0,state:null};default:throw Error(N(444,e))}}function Oi(e){return'href=\"'+dn(e)+'\"'}function Fo(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function A0(e){return Me({},e,{\"data-precedence\":e.precedence,precedence:null})}function j2(e,t,n,a){if(t=e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")){if(t[dr]!==!0){a.loading=1;return}}else t=e.createElement(\"link\"),t[dr]=!0,t.onload=t.onerror=eh.bind(null,t),gt(t,\"link\",n),lt(t),e.head.appendChild(t);a.preload=t,t.addEventListener(\"load\",function(){return a.loading|=1}),t.addEventListener(\"error\",function(){return a.loading|=2})}function Yi(e){return'[src=\"'+dn(e)+'\"]'}function Wo(e){return\"script[async]\"+e}function Ag(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var a=e.querySelector('style[data-href~=\"'+dn(n.href)+'\"]');if(a)return t.instance=a,lt(a),a;var l=Me({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement(\"style\"),lt(a),gt(a,\"style\",l),nr(a,n.precedence,e),t.instance=a;case\"stylesheet\":l=Oi(n.href);var i=e.querySelector(Fo(l));if(i)return t.state.loading|=4,t.instance=i,lt(i),i;a=A0(n),(l=gn.get(l))&&Ef(a,l),i=(e.ownerDocument||e).createElement(\"link\"),lt(i);var o=i;return o._p=new Promise(function(u,r){o.onload=u,o.onerror=r}),gt(i,\"link\",a),t.state.loading|=4,nr(i,n.precedence,e),t.instance=i;case\"script\":return i=Yi(n.src),(l=e.querySelector(Wo(i)))?(t.instance=l,lt(l),l):(a=n,(l=gn.get(i))&&(a=Me({},n),Af(a,l)),e=e.ownerDocument||e,l=e.createElement(\"script\"),lt(l),gt(l,\"link\",a),e.head.appendChild(l),t.instance=l);case\"void\":return null;default:throw Error(N(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,nr(a,n.precedence,e));return t.instance}function nr(e,t,n){for(var a=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,i=l,o=0;o title\"):null)}function X2(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function Dg(e,t){return e===\"img\"&&t.src!=null&&t.src!==\"\"&&t.onLoad==null&&t.loading!==\"lazy\"}function M0(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function D0(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==\"number\"?devicePixelRatio:1)*.25}function zg(e,t){typeof t.decode==\"function\"&&(e.imgCount++,t.complete||(e.imgBytes+=D0(t),e.suspenseyImages.push(t)),e=Z2.bind(e),t.decode().then(e,e))}function V2(e,t,n,a){if(n.type===\"stylesheet\"&&(typeof a.media!=\"string\"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=Oi(a.href),i=t.querySelector(Fo(l));if(i){t=i._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=Lo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,lt(i);return}i=t.ownerDocument||t,a=A0(a),(l=gn.get(l))&&Ef(a,l),i=i.createElement(\"link\"),lt(i);var o=i;o._p=new Promise(function(u,r){o.onload=u,o.onerror=r}),gt(i,\"link\",a),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Lo.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var lr=0;function Q2(e,t){return e.stylesheets&&e.count===0&&ir(e,e.stylesheets),0lr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function z0(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ir(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Lo(){this.count--,z0(this)}function Z2(){this.imgCount--,z0(this)}var Rr=null;function ir(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Rr=new Map,t.forEach(I2,e),Rr=null,Lo.call(e))}function I2(e,t){if(!(t.state.loading&4)){var n=Rr.get(e);if(n)var a=n.get(null);else{n=new Map,Rr.set(e,n);for(var l=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),i=0;i{\"use strict\";function L0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(L0)}catch(e){console.error(e)}}L0(),G0.exports=B0()});var j0=kn(nc=>{\"use strict\";var tS=Symbol.for(\"react.transitional.element\"),nS=Symbol.for(\"react.fragment\");function Y0(e,t,n){var a=null;if(n!==void 0&&(a=\"\"+n),t.key!==void 0&&(a=\"\"+t.key),\"key\"in t){n={};for(var l in t)l!==\"key\"&&(n[l]=t[l])}else n=t;return t=n.ref,{$$typeof:tS,type:e,key:a,ref:t!==void 0?t:null,props:n}}nc.Fragment=nS;nc.jsx=Y0;nc.jsxs=Y0});var P=kn((LT,X0)=>{\"use strict\";X0.exports=j0()});var va={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1},u1=[\"RETIRED\",\"CONFLICT\",\"NOT_FOUND\",\"DOCUMENT_TOO_LARGE\",\"STORAGE_FAILURE\",\"ORIGIN_NOT_DECLARED\",\"MESSAGE_TOO_LARGE\",\"PAGE_TOO_LARGE\",\"PATCH_TOO_LARGE\",\"DEADLINE\",\"INVALID_STEPS\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"CONFIGURATION_REQUIRED\",\"NOT_READY\",\"UNKNOWN_METHOD\",\"INVALID_ARGUMENT\",\"QUOTA_EXCEEDED\",\"PROTOCOL_MISMATCH\",\"APPLET_INCOMPATIBLE\",\"ENVELOPE_INVALID\",\"CONTEXT_REPLACED\",\"TARGET_NOT_FOUND\",\"PRECONDITION_FAILED\",\"ASYNC_READ\",\"AUTH_REQUIRED\",\"REJECTED\"];function sm(e){return typeof e==\"string\"&&u1.includes(e)}var r1=/^:[A-Za-z][A-Za-z0-9_]*$/,c1=/^[A-Za-z0-9_.~@-]+$/,Nc=new Map;function s1(e){if(Nc.has(e))return Nc.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),a=n.at(-1)===\"*\";a&&n.pop();let l=[],i=!0;for(let o of n)r1.test(o)?l.push({param:o.slice(1)}):c1.test(o)&&o!==\".\"&&o!==\"..\"?l.push({literal:o}):i=!1;i&&(t={segments:l,rest:a})}return Nc.set(e,t),t}function We(e){try{return new URL(e).href}catch{return null}}function jl(e,t){let n=d1(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let a;try{a=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}a.at(-1)===\"\"&&a.pop();for(let l of e.routes){let i=s1(l.pattern);if(!i)continue;let o=f1(i,a);if(!o||!(l.query??[]).every(r=>n.searchParams.has(r)))continue;for(let r of l.query??[])o[r]=n.searchParams.get(r);let u={kind:\"route\",routeId:l.id,page:l.page,screen:l.screen,params:o};return l.context!==void 0&&(u.context=l.context),u}return{kind:\"website\",url:t}}function d1(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function f1(e,t){if(e.rest?t.lengthy.id===i.id)?.startUrl;c={index:u.index,start:h!==void 0&&We(h)===We(t.view.url),url:s}}}else t.status===\"ready\"&&t.account!==null&&r===\"auth\"&&(r=\"none\",c=null);u.page.status===\"ready\"&&(t.status===\"loading\"||t.status===\"error\")&&(m++,d=!1,a.push({type:\"schedule\",id:i.id,token:m}));let f={...u,seen:Math.max(u.seen,t.view.n),pin:r,signIn:c,deadline:m,page:{status:t.status,pageId:t.pageId,routeId:t.routeId,view:t.view,stale:t.stale,expired:d}};return{state:ll(rm(e,i,f),f),effects:a}}case\"deadline\":{let i=e.contexts[t.id];return!i||t.token!==i.deadline||i.page.status===\"ready\"||i.page.expired?l:{state:ll(e,{...i,page:{...i.page,expired:!0}}),effects:a}}case\"user.viewWebsite\":{let i=e.contexts[t.id];return!i||i.pin===\"user\"?l:{state:ll(e,{...i,pin:\"user\"}),effects:a}}case\"user.done\":{let i=e.contexts[t.id];if(!i)return l;if(i.pin===\"auth\"&&i.signIn)return im(e,i,n)??l;let o=i.pin===\"none\"?i:{...i,pin:\"none\"},u=o===i?e:ll(e,o);if(pu(o,n)!==\"website\")return{state:u,effects:a};if(o.canGoBack)a.push({type:\"context.back\",id:i.id});else{let r=n.contexts.find(c=>c.id===i.id)?.startUrl;r&&a.push({type:\"context.navigate\",id:i.id,url:r,mode:\"push\"})}return{state:u,effects:a}}case\"navigate.url\":{let i=t.context??e.active;return e.contexts[i]?(a.push({type:\"context.navigate\",id:i,url:t.url,mode:t.mode}),{state:{...e,active:i,overlay:[],leaveGuard:null},effects:a}):l}case\"navigate.screen\":{let i=t.mode===\"root\"?[t.screen]:t.mode===\"replace\"?[...e.overlay.slice(0,-1),t.screen]:[...e.overlay,t.screen];return{state:{...e,overlay:i,leaveGuard:null},effects:a}}case\"select\":{let i=e.contexts[t.id];if(!i)return l;if(t.id!==e.active||e.overlay.length>0)return{state:{...e,active:t.id,overlay:[],leaveGuard:null},effects:a};let o=n.contexts.find(u=>u.id===t.id)?.startUrl;return o&&(i.url===null||We(i.url)!==We(o))&&a.push({type:\"context.navigate\",id:t.id,url:o,mode:\"push\"}),{state:{...e,leaveGuard:null},effects:a}}case\"back\":{if(e.leaveGuard)return{state:e,effects:[{type:\"confirmLeave\",message:e.leaveGuard.message}]};if(e.overlay.length>0)return{state:{...e,overlay:e.overlay.slice(0,-1)},effects:a};let i=e.contexts[e.active];return i?.pin===\"auth\"&&i.signIn?im(e,i,n)??{state:e,effects:[{type:\"leave\"}]}:e.contexts[e.active]?.canGoBack?{state:e,effects:[{type:\"context.back\",id:e.active}]}:{state:e,effects:[{type:\"leave\"}]}}case\"guard\":return{state:{...e,leaveGuard:t.guard},effects:a};case\"context.gone\":{let i=e.contexts[t.id];return i?{state:ll(e,{...i,page:{...Ec,status:\"unsupported\"}}),effects:a}:l}}}function im(e,t,n){let{index:a,start:l}=t.signIn,i=n.contexts[0].id,o=ll(e,{...t,pin:\"none\",signIn:null});if(!l&&a>0){let u=Math.max(1,t.index-a+1);return{state:o,effects:[{type:\"context.back\",id:t.id,steps:u}]}}return t.id===i?null:{state:{...o,active:i,overlay:[],leaveGuard:null},effects:[]}}function om(e,t,n){return t===e.generation&&e.url!==null&&We(n)===We(e.url)}function um(e,t,n,a){let l=e.deadline+1;return a.push({type:\"schedule\",id:e.id,token:l}),{...e,url:n,seen:t===e.generation?e.seen:-1,generation:t,page:Ec,deadline:l}}function rm(e,t,n){return!e.leaveGuard||t.id!==e.active||e.overlay.length>0||t.index===n.index&&t.url!==null&&n.url!==null&&We(t.url)===We(n.url)?e:{...e,leaveGuard:null}}function ll(e,t){return{...e,contexts:{...e.contexts,[t.id]:t}}}function Ac(e){let t={};for(let[n,a]of Object.entries(e.contexts))t[n]={url:a.url};return{version:va.sessionState,state:{active:e.active,overlay:e.overlay,contexts:t}}}function mm(e,t){let n=m1(t);if(!e||e.version!==va.sessionState||!Ji(e.state))return n;let{active:a,overlay:l,contexts:i}=e.state,o={...n,contexts:{...n.contexts}};if(typeof a==\"string\"&&o.contexts[a]&&(o.active=a),Array.isArray(l)&&(o.overlay=l.filter(u=>g1(u,t.foreground.screens))),Ji(i))for(let u of Object.keys(o.contexts)){let r=Ji(i[u])?i[u].url:void 0;typeof r==\"string\"&&(o.contexts[u]=dm(u,r))}return o}function g1(e,t){return Ji(e)&&typeof e.key==\"string\"&&typeof e.id==\"string\"&&t.includes(e.id)&&Ji(e.params)&&Object.values(e.params).every(n=>typeof n==\"string\")}function Ji(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var TT=va.bundleFormat,wc=\"(0|[1-9]\\\\d*)\",cm=\"(?:0|[1-9]\\\\d*|\\\\d*[A-Za-z-][0-9A-Za-z-]*)\",NT=new RegExp(`^${wc}\\\\.${wc}\\\\.${wc}(?:-(${cm}(?:\\\\.${cm})*))?$`),Sn=class extends Error{code;constructor(e,t){super(t),this.name=\"GenesisError\",this.code=e}},h1=2e3;function pm(e,t){return new Promise((n,a)=>{let l=null,i=!1,o=1,u=new Map,r=new Map,c={get bound(){return l},get retired(){return i},request(s,h={}){if(i)return Promise.reject(new Sn(\"RETIRED\",\"This page was closed\"));let y=o++;return new Promise((S,p)=>{let g=setTimeout(()=>{u.delete(y),p(new Sn(\"DEADLINE\",`${s} did not answer in time`))},l.limits.rpcDeadlineMs+h1);u.set(y,{resolve:S,reject:p,timer:g}),e.postMessage(JSON.stringify({type:\"request\",documentId:l.documentId,requestId:y,method:s,params:h}))})},on(s,h){let y=r.get(s);return y||r.set(s,y=new Set),y.add(h),()=>{y.delete(h)}}};function m(){i=!0;for(let s of u.values())clearTimeout(s.timer),s.reject(new Sn(\"RETIRED\",\"This page was closed\"));u.clear()}function d(s,h){for(let y of[...r.get(s)??[]])try{y(h)}catch(S){console.error(`Genesis ${s} handler failed`,S)}}e.addEventListener(\"message\",s=>{if(i||typeof s.data!=\"string\")return;let h;try{h=JSON.parse(s.data)}catch{return}if(h?.type===\"refused\"&&!l){i=!0,a(new Sn(h.error?.code??\"PROTOCOL_MISMATCH\",h.error?.message??\"The host refused this page\"));return}if(h?.type===\"bound\"){if(l)return;l=h,n(c);return}if(!(!l||h?.documentId!==l.documentId))if(h.type===\"response\"){let y=u.get(h.requestId);if(!y)return;u.delete(h.requestId),clearTimeout(y.timer),h.error?y.reject(new Sn(h.error.code,h.error.message)):y.resolve(h.result??null)}else h.type===\"event\"&&(h.name===\"retired\"?(m(),d(\"retired\",{})):d(h.name,h.data))}),addEventListener(\"pagehide\",()=>{i||(d(\"pagehide\",{}),m())});let f={type:\"hello\",protocol:va.protocol,url:t};e.postMessage(JSON.stringify(f))})}var v1={pageId:null,routeId:null,params:{}};function y1(e,t){let n={};for(let d of e)n[d]=b1();let a={account:null,contexts:n},l=!1,i=new Map;function o(d){let f=d===null?[...i.values()]:[i.get(null),...d.map(h=>i.get(h))],s=new Set;for(let h of f)for(let y of[...h??[]])s.has(y)||(s.add(y),y())}function u(d,f){a={...a,contexts:{...a.contexts,[d]:f}}}function r(d){let{entry:f}=d;if(!d.attached||d.status!==\"ready\"||!f||!Xl(f.url,d.url))return;let{history:s}=d;for(s.delete(f.index),s.set(f.index,hm(d));s.size>t.historyEntriesMax;)s.delete(s.keys().next().value)}function c(d,f,s){if(f===void 0||s!==\"ready\"&&s!==\"auth\")return!1;if(!l)return l=!0,a.account!==f&&(a={...a,account:f}),!1;if(f===a.account)return!1;let h={};for(let[y,S]of Object.entries(a.contexts))S.history.clear(),h[y]=y===d||!S.content||S.stale?S:{...S,stale:!0};return a={account:f,contexts:h},r(h[d]),!0}let m=(d,f=!1)=>({outcome:d,accountChanged:f});return{state:()=>a,context:d=>a.contexts[d],applyPage(d,f,s){let h=a.contexts[d];if(!h||f=f.size||g===f.index&&!Xl(v.url,f.url))&&y.delete(g)}let S={...h,generation:f.generation,entry:{index:f.index,url:f.url}},p;if(Xl(h.url,f.url))h.attached&&h.view?.generation!==f.generation?p={...S,attached:!1,status:\"loading\",error:null,stale:h.content}:p=S;else{let g=y.get(f.index);p=g?{...S,...g,attached:!1,status:\"loading\",error:null,stale:!0,content:!0}:{...S,...s,url:f.url,regions:{},attached:!1,status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1}}u(d,p),r(p),o([d])},gone(d,f){let s=a.contexts[d];s&&(u(d,{...s,attached:!1,status:\"error\",error:f,stale:s.content}),o([d]))},subscribe(d,f){let s=f??null,h=i.get(s);return h||i.set(s,h=new Set),h.add(d),()=>{h.delete(d)}}}}function b1(){return{generation:0,view:null,epoch:0,seq:0,live:[],attached:!1,url:null,pageId:null,routeId:null,params:{},regions:{},status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1,entry:null,history:new Map}}function Xl(e,t){return e!==null&&t!==null&&We(e)===We(t)}function hm(e){return{url:e.url,pageId:e.pageId,routeId:e.routeId,params:e.params,regions:e.regions}}function x1(e,t){if(e.content&&Xl(e.url,t))return hm(e);let{entry:n}=e,a=n&&Xl(n.url,t)?e.history.get(n.index):void 0;return a&&Xl(a.url,t)?a:null}function vm(e,t=Object.create(null)){for(let n of e)t[n.key]=n;return t}function ym(e){return e.kind===\"single\"?{kind:\"single\",status:e.status,error:e.error??null,record:e.record}:{kind:\"collection\",status:e.status,error:e.error??null,order:e.items.map(t=>t.key),complete:e.complete,ephemeral:e.ephemeral===!0,records:vm(e.items)}}function S1(e,t){let n={};for(let[a,l]of Object.entries(e)){let i=ym(l),o=t[a];n[a]=o?T1(o,i):i}return n}var gu=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function T1(e,t){if(e.kind===\"single\"||t.kind===\"single\")return e.kind!==\"single\"||t.kind!==\"single\"?t:(gu(e.record,t.record)&&(t.record=e.record),e.record===t.record&&e.status===t.status&&gu(e.error,t.error)?e:t);let n=e.order.length===t.order.length&&e.complete===t.complete&&e.ephemeral===t.ephemeral&&e.status===t.status&&gu(e.error,t.error);for(let[a,l]of t.order.entries()){let i=e.records[l];i&&gu(i,t.records[l])?t.records[l]=i:n=!1,e.order[a]!==l&&(n=!1)}return n?e:t}function N1(e,t){let n=e.regions;for(let[a,l]of Object.entries(t)){let i=e.live.includes(a)?n[a]:void 0;if(!i)return null;let o;if(l.kind===\"replace\")o=ym(l.region);else if(l.kind===\"single\"){if(i.kind!==\"single\")return null;o={...i,record:l.record,status:l.status??i.status,error:l.error===void 0?i.error:l.error}}else{if(i.kind!==\"collection\")return null;if(o={...i,complete:l.complete??i.complete,status:l.status??i.status,error:l.error===void 0?i.error:l.error},l.upsert?.length||l.remove?.length){o.records=vm(l.upsert??[],Object.assign(Object.create(null),i.records));for(let u of l.remove??[])delete o.records[u]}if(l.order){o.order=l.order;let u=new Set(l.order);for(let r of Object.keys(o.records))u.has(r)||(o.records===i.records&&(o.records=Object.assign(Object.create(null),i.records)),delete o.records[r])}else if(l.remove?.length){let u=new Set(l.remove);o.order=i.order.filter(r=>!u.has(r))}}n===e.regions&&(n={...n}),n[a]=o}return n}var w1=class extends Sn{constructor(e,t){super(e,t),this.name=\"ServiceError\"}};async function bm(e=window.__genesisBridge){if(!e)throw new Error(\"Genesis bridge is missing; the foreground must run inside Genesis\");let t=await pm(e,location.href),{compat:n}=t.bound;if(n.protocol!==va.protocol||n.sessionState!==va.sessionState)throw new Sn(\"PROTOCOL_MISMATCH\",\"This applet was built for another Genesis version\");return C1(t)}var E1=500,A1=1e3,M1=64,D1=2e3,z1=Object.freeze([]),gm=e=>e===void 0?null:Array.isArray(e)?e:[e];function C1(e){let{manifest:t,appletId:n,limits:a,session:l}=e.bound,i=t.contexts.map(b=>b.id),o=y1(i,{historyEntriesMax:a.historyEntriesMax}),u=(b,A)=>e.request(b,A).catch(B=>{e.retired||console.error(`Genesis ${b} failed`,B)}),r=mm(l,t),c=new Set,m=null,d=new Set;function f(b){let A=fm(r,b,t),B=A.state!==r;r=A.state;let V=A.effects.filter(re=>!s(re));if(B){w=void 0,v();for(let re of[...c])re()}return V}function s(b){switch(b.type){case\"reveal\":return u(\"context.reveal\",{id:b.id}),!0;case\"cover\":return u(\"context.cover\"),!0;case\"context.navigate\":return mu(b.id),u(\"context.navigate\",{id:b.id,url:b.url,mode:b.mode}),!0;case\"context.back\":return mu(b.id),u(\"context.back\",b.steps?{id:b.id,steps:b.steps}:{id:b.id}),!0;case\"context.reload\":return mu(b.id),u(\"context.reload\",{id:b.id}),!0;case\"schedule\":return setTimeout(()=>f({type:\"deadline\",id:b.id,token:b.token}),a.documentReadyMs),!0;case\"leave\":case\"confirmLeave\":return!1}}function h(b,A){m?m(b,A):window.confirm(b)&&A()}function y(b){let A=r.leaveGuard;if(!A)return b();h(A.message,()=>{f({type:\"guard\",guard:null}),b()})}function S(b){let A=!0;for(let B of f({type:\"back\"}))if(B.type===\"leave\")A=!1;else if(B.type===\"confirmLeave\"){let V=()=>{f({type:\"guard\",guard:null}),!S(!1)&&b&&u(\"back.leave\")};setTimeout(()=>h(B.message,V),0)}return A}let p=null,g=l?JSON.stringify(Ac(r)):\"\";function v(){p===null&&(p=setTimeout(x,E1))}function x(){p!==null&&clearTimeout(p),p=null;let b=Ac(r),A=JSON.stringify(b);A!==g&&(g=A,u(\"session.save\",b))}e.on(\"suspended\",x);let w;function U(){if(w!==void 0)return w;let b=r.overlay[r.overlay.length-1],A=r.contexts[r.active],B=null;if(b)B={key:b.key,id:b.id,params:b.params,context:r.active,overlay:!0};else if(A?.url){let V=jl(t,A.url);V.kind===\"route\"&&(B={key:`${A.id}:${A.index}`,id:V.screen,params:V.params,context:A.id,overlay:!1})}return w=B}let C=1,D=new Set(r.overlay.map(b=>b.key));function Q(){let b;do b=`s${C++}`;while(D.has(b));return D.add(b),b}function O(b){if(\"screen\"in b){let On={key:Q(),id:b.screen,params:b.params??{}};y(()=>f({type:\"navigate.screen\",screen:On,mode:b.mode??\"push\"}));return}let B=r.contexts[r.active]?.url??t.contexts[0].startUrl,V;try{V=new URL(b.url,B).href}catch{throw new Sn(\"INVALID_ARGUMENT\",`Not a URL: ${b.url}`)}let re=b.context??ne(V);if(!r.contexts[re])throw new Sn(\"NOT_FOUND\",`No context ${re}`);let wt=r.contexts[re].url;if(wt!==null&&We(wt)===We(V)&&(b.mode??\"push\")===\"push\"){(re!==r.active||r.overlay.length>0)&&y(()=>f({type:\"select\",id:re}));return}y(()=>f({type:\"navigate.url\",url:V,context:re,mode:b.mode??\"push\"}))}function ne(b){let A=jl(t,b);if(A.kind!==\"route\"||!A.context||!r.contexts[A.context])return r.active;let B=r.contexts[r.active],V=t.contexts.find(wt=>wt.id===r.active)?.startUrl,re=!B.url||V!==void 0&&We(B.url)===We(V);return r.overlay.length>0||re?A.context:r.active}function Ne(b){y(()=>{let A=b===r.active&&r.overlay.length===0,B=A&&r.contexts[b]?.url!==null&&We(r.contexts[b].url)!==We(t.contexts.find(V=>V.id===b)?.startUrl??\"\");if(f({type:\"select\",id:b}),A&&!B)for(let V of[...d])V(b)})}let he=new Set;function K(b){he.has(b)||(he.add(b),setTimeout(()=>he.delete(b),A1),e.request(\"context.resync\",{id:b}).catch(()=>{}))}function q(b){let A=jl(t,b);return A.kind===\"route\"?{pageId:A.page,routeId:A.routeId,params:A.params}:{pageId:null,routeId:null,params:{}}}e.on(\"page\",({id:b,generation:A,page:B})=>{let V=o.applyPage(b,A,B);if(V.outcome!==\"applied\")return;he.delete(b);let re=o.context(b);Jy(b,B),f({type:\"context.page\",id:b,generation:A,view:B.view,status:B.status,pageId:B.pageId,routeId:B.routeId,account:B.account,stale:re.stale&&re.content,signInUrl:B.signInUrl??null}),ln(b,V)}),e.on(\"patch\",({id:b,generation:A,patch:B})=>{let V=o.applyPatch(b,A,B);V.outcome===\"resync\"&&K(b),ln(b,V)});function ln(b,A){if(!A.accountChanged)return;let B=Yl(r,t);for(let V of i)V!==b&&(V===B?K(V):Cn(V));for(let V of[...H.values()])V.context!==b&&jt(V,{outcome:\"unknown\",code:\"CONTEXT_REPLACED\",message:\"The account changed\"})}function Cn(b){mu(b),u(\"context.reload\",{id:b})}e.on(\"context.navigated\",b=>{o.navigated(b.id,b,q(b.url)),f({type:\"context.navigated\",...b})}),e.on(\"context.gone\",b=>{o.gone(b.id,{code:b.code??\"NOT_READY\",message:b.message??\"The page cannot be read\"}),f({type:\"context.gone\",id:b.id})}),e.on(\"user.viewWebsite\",b=>{f({type:\"user.viewWebsite\",id:b?.id??r.active})}),e.on(\"user.done\",b=>{f({type:\"user.done\",id:b?.id??r.active}),Wf()}),e.on(\"back\",()=>{let b=S(!0);u(\"back.handled\",{handled:b})});let H=new Map,_t=new Map,J=new Map,Ie=0,k=new Set,ue=new Map,Nt=(b,A,B)=>JSON.stringify([b,A,B]);function Gl(){let b=new Map;for(let B of H.values()){let V=Nt(B.context,B.region,B.key),re=b.get(V);re||b.set(V,re=[]),re.push({name:B.name,args:B.args})}let A=new Map;for(let[B,V]of b){let re=ue.get(B);A.set(B,re&&re.length===V.length&&re.every((wt,On)=>wt.name===V[On].name&&wt.args===V[On].args)?re:V)}ue=A;for(let B of[...k])B()}function jt(b,A){H.get(b.dedup)===b&&(H.delete(b.dedup),b.actionId!==null&&_t.delete(b.actionId),b.timer!==null&&clearTimeout(b.timer),b.resolve(A),Gl())}function Pn(b,A){b.timer!==null&&clearTimeout(b.timer),b.timer=setTimeout(()=>jt(b,{outcome:\"unknown\",code:\"DEADLINE\",message:\"The action did not finish in time\"}),A)}function Ki(b,A){if(A.state===\"dispatched\"){if(!A.navigating)return;b.from=o.context(b.context)?.view??null,b.expect=A.expect??null,Pn(b,a.actionTimeoutMs);return}let B=A.state===\"observed\"?\"observed\":A.state===\"cancelled\"?\"cancelled\":\"failed\";jt(b,A.result??{outcome:B})}e.on(\"action.update\",b=>{let A=_t.get(b.actionId);if(A)return Ki(A,b);if(Ie===0)return;let B=J.get(b.actionId)??[];B.push(b),J.set(b.actionId,B)});function Jy(b,A){for(let B of[...H.values()]){if(B.context!==b||B.from===null)continue;let{from:V}=B;if(A.view.generation===V.generation&&A.view.n===V.n||A.status===\"loading\")continue;let re=jl(t,A.view.url),wt=re.kind===\"route\"?re.page:null,On=gm(B.expect?.page);A.status===\"auth\"?jt(B,{outcome:\"failed\",code:\"AUTH_REQUIRED\",message:\"Sign-in is needed\"}):wt!==null&&gm(B.expect?.notPage)?.includes(wt)?jt(B,{outcome:\"failed\",code:\"REJECTED\",message:\"The website did not accept the action\"}):A.status===\"ready\"&&wt!==null&&(On===null||On.includes(wt))?jt(B,{outcome:\"observed\"}):jt(B,{outcome:\"unknown\",message:\"The action led to another page\"})}}function mu(b){for(let A of[...H.values()])A.context===b&&A.from!==null&&jt(A,{outcome:\"unknown\",message:\"The page changed before the action finished\"})}function $y(b){let A=o.context(b.context);if(!A?.view)return Promise.resolve({outcome:\"failed\",code:\"NOT_READY\",message:\"The page is not ready\"});let B=b.region===null?void 0:A.regions[b.region],V=B?.kind===\"collection\"?B.records[b.key??\"\"]:B?.record??void 0,re=JSON.stringify([b.context,V?.entityType??b.region,V?.entity??b.key,b.name,b.args??null]),wt=H.get(re);if(wt)return wt.promise;let On,tm=new Promise(xn=>{On=xn}),al={...b,dedup:re,actionId:null,promise:tm,resolve:On,timer:null,from:null,expect:null};H.set(re,al),Pn(al,a.actionTimeoutMs+D1),Gl();let{view:nm}=A,Py={region:b.region,key:b.key,name:b.name,args:b.args??null,view:nm.n},am=()=>{--Ie===0&&J.clear()};return Ie++,e.request(\"context.act\",{id:b.context,generation:nm.generation,action:Py}).then(({actionId:xn})=>{let Tc=J.get(xn)??[];if(J.delete(xn),am(),H.get(re)===al){al.actionId=xn,_t.set(xn,al);for(let e1 of Tc)Ki(al,e1)}},xn=>{am();let Tc=sm(xn?.code)?xn.code:void 0;jt(al,{outcome:\"failed\",code:Tc,message:xn instanceof Error?xn.message:\"The action failed\"})}),tm}let bc=new Set;e.on(\"storage.changed\",b=>{for(let A of[...bc])A(b)});let Fy={get:(b,A)=>e.request(\"storage.get\",{collection:b,key:A}),list:(b,A={})=>e.request(\"storage.list\",{collection:b,...A}),commit:b=>e.request(\"storage.commit\",{checks:b.checks??[],puts:b.puts??[],deletes:b.deletes??[]}),onChanged(b){return bc.add(b),()=>{bc.delete(b)}}},Wy={async request(b,A,B={}){try{return await e.request(\"services.request\",{serviceId:b,path:A,method:B.method??\"GET\",body:B.body??null})}catch(V){throw V instanceof Sn?new w1(V.code,V.message):V}}},xc=new Set;function Wf(){for(let b of[...xc])b()}e.on(\"resumed\",Wf);let Sc=new Set;e.on(\"retired\",()=>{for(let b of[...H.values()])jt(b,{outcome:\"unknown\",code:\"RETIRED\",message:\"This page was closed\"});for(let b of[...Sc])b()});let ql=new Map;for(let b of i)e.request(\"context.resync\",{id:b}).catch(()=>{}),s({type:\"schedule\",id:b,token:r.contexts[b].deadline});let Pf=Yl(r,t);Pf!==null&&u(\"context.reveal\",{id:Pf});let em=!1;return{manifest:t,appletId:n,limits:a,restored:l!==null,store:o,navigation:{state:()=>r,screen:U,presentation:b=>pu(r.contexts[b],t),revealed:()=>Yl(r,t),navigate:O,select:Ne,back:()=>{S(!1)},reload:b=>{Cn(b??r.active)},viewWebsite:b=>{f({type:\"user.viewWebsite\",id:b??r.active})},done:b=>{f({type:\"user.done\",id:b??r.active})},setLeaveGuard:b=>{f({type:\"guard\",guard:b===null?null:{message:b}})},onConfirmLeave(b){return m=b,()=>{m===b&&(m=null)}},onScrollToTop(b){return d.add(b),()=>{d.delete(b)}},subscribe(b){return c.add(b),()=>{c.delete(b)}}},actions:{act:$y,pending:(b,A,B)=>ue.get(Nt(b,A,B))??z1,subscribe(b){return k.add(b),()=>{k.delete(b)}}},storage:Fy,services:Wy,scroll:{get:b=>ql.get(b),set(b,A){for(ql.delete(b),ql.set(b,A);ql.size>M1;)ql.delete(ql.keys().next().value)}},onResume(b){return xc.add(b),()=>{xc.delete(b)}},onRetired(b){return Sc.add(b),()=>{Sc.delete(b)}},ready(){em||(em=!0,u(\"ui.ready\"))}}}var me=Y(Ke(),1),Q0=Y(q0(),1),Po=Y(P(),1),Z0=(0,me.createContext)(null);function aS({foreground:e,children:t}){return(0,Po.jsx)(Z0.Provider,{value:e,children:t})}function Kn(){let e=(0,me.useContext)(Z0);if(!e)throw new Error(\"Genesis hooks need mountForeground or GenesisProvider\");return e}function lS({foreground:e,children:t}){return(0,me.useLayoutEffect)(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e.ready()))},[e]),t}async function I0(e,t){let n=t??document.getElementById(\"root\")??document.body.appendChild(document.createElement(\"div\")),a=await bm(),l=(0,Q0.createRoot)(n);return a.onRetired(()=>l.unmount()),l.render((0,Po.jsx)(aS,{foreground:a,children:(0,Po.jsx)(lS,{foreground:a,children:e})})),a}function Of(){let e=Kn();return(0,me.useSyncExternalStore)(e.navigation.subscribe,e.navigation.state)}function ac(e){let t=Of();return e??t.active}function K0(e,t){let{store:n}=Kn(),a=(0,me.useCallback)(l=>n.subscribe(l,e),[n,e]);return(0,me.useSyncExternalStore)(a,()=>t(n.context(e)))}var iS=(e,t)=>e.pageId===t.pageId&&e.status===t.status&&e.stale===t.stale&&e.generation===t.generation&&e.params===t.params&&e.error===t.error&&e.account===t.account&&e.url===t.url;function oS(e,t){return{pageId:e?.pageId??null,status:e?.status??\"loading\",stale:e?e.stale&&e.content:!1,generation:e?.view?.generation??null,params:e?.params??uS,error:e?.error??null,account:t,url:e?.url??null}}function hn(e){let{store:t}=Kn(),n=ac(e),a=(0,me.useRef)(null),l=(0,me.useCallback)(o=>t.subscribe(o),[t]),i=(0,me.useCallback)(()=>{let o=oS(t.context(n),t.state().account);return(!a.current||!iS(a.current,o))&&(a.current=o),a.current},[t,n]);return(0,me.useSyncExternalStore)(l,i)}var uS=Object.freeze({}),V0=new WeakMap,rS=Object.freeze({order:Object.freeze([]),get:()=>{},complete:!1,status:\"missing\",error:null,ephemeral:!1});function cS(e){if(!e)return rS;let t=V0.get(e);if(t)return t;if(e.kind===\"collection\"){let{records:n}=e;t={order:e.order.filter(a=>n[a]!==void 0),get:a=>n[a],complete:e.complete,status:e.status,error:e.error,ephemeral:e.ephemeral}}else{let{record:n}=e;t={order:n?[n.key]:[],get:a=>n&&n.key===a?n:void 0,complete:!0,status:e.status,error:e.error,ephemeral:!1}}return V0.set(e,t),t}function lc(e,t){return K0(ac(t),n=>cS(n?.regions[e]))}function vn(e,t,n){return K0(ac(n),a=>sS(a?.regions[e],t))}function sS(e,t){if(e)return e.kind===\"single\"?t===null||e.record?.key===t?e.record??void 0:void 0:t===null?void 0:e.records[t]}function xe(e,t,n){let a=Kn();return(0,me.useCallback)((l,i)=>a.actions.act({context:n??a.navigation.state().active,region:t??null,key:l,name:e,args:i}),[a,e,t,n])}function ic(e,t,n){let a=Kn(),l=ac(n);return(0,me.useSyncExternalStore)(a.actions.subscribe,()=>a.actions.pending(l,e,t))}function I(){let e=Kn(),t=Of(),{navigation:n}=e;return(0,me.useMemo)(()=>({presentation:n.presentation(t.active),active:t.active,contexts:t.contexts,overlay:t.overlay,screen:n.screen(),revealed:n.revealed(),navigate:n.navigate,back:n.back,select:n.select,reload:n.reload,viewWebsite:n.viewWebsite,done:n.done,setLeaveGuard:n.setLeaveGuard}),[n,t])}function oc(e,t={}){let n=Kn(),a=t.storage??n.storage,[l,i]=(0,me.useState)({records:[],loading:!0,error:null});(0,me.useEffect)(()=>{let d=!0,f=0;async function s(){let y=++f;try{let S=[],p;do{let g=await a.list(e,p===void 0?{}:{afterKey:p});S.push(...g.entries),p=g.nextAfterKey??void 0}while(p!==void 0);d&&y===f&&i({records:S,loading:!1,error:null})}catch(S){d&&y===f&&i(p=>({...p,loading:!1,error:S}))}}s();let h=a.onChanged(y=>{y.changes.some(S=>S.collection===e)&&s()});return()=>{d=!1,h()}},[a,e]);let o=(0,me.useRef)(l.records);o.current=l.records;let u=(0,me.useCallback)(d=>o.current.find(f=>f.key===d)?.revision??null,[]),r=(0,me.useCallback)(d=>a.commit(d),[a]),c=(0,me.useCallback)((d,f,s)=>a.commit({checks:[{collection:e,key:d,expectedRevision:s===void 0?u(d):s}],puts:[{collection:e,key:d,value:f}]}),[a,e,u]),m=(0,me.useCallback)(d=>a.commit({checks:[{collection:e,key:d,expectedRevision:u(d)}],deletes:[{collection:e,key:d}]}),[a,e,u]);return{...l,put:c,remove:m,commit:r}}var dS=1500;function fS(){let e=Kn();Of();let t=e.navigation.screen(),n=t?.key??`${e.navigation.state().active}:none`,a=t&&!t.overlay?t.context:null;return(0,me.useCallback)(l=>{if(!l)return;let i=e.scroll.get(n)??0,o=i>0,u=performance.now(),r=0,c=()=>{o&&(l.scrollTop=i,Math.abs(l.scrollTop-i)<2||performance.now()-u>dS?o=!1:r=requestAnimationFrame(c))},m=()=>{o=!1},d=()=>{o||e.scroll.set(n,l.scrollTop)},f=e.navigation.onScrollToTop(s=>{s===a&&(o=!1,l.scrollTo({top:0,behavior:\"smooth\"}))});return c(),l.addEventListener(\"scroll\",d,{passive:!0}),l.addEventListener(\"touchstart\",m,{passive:!0}),l.addEventListener(\"wheel\",m,{passive:!0}),()=>{cancelAnimationFrame(r),f(),l.removeEventListener(\"scroll\",d),l.removeEventListener(\"touchstart\",m),l.removeEventListener(\"wheel\",m)}},[e,n,a])}function Xe(e){return(0,Po.jsx)(\"div\",{...e,ref:fS()})}var Yt=Y(Ke(),1);var ji=\"https://mail.google.com\",mS=\"/mail/mu/mp/239/\";var Ja=[{id:\"primary\",path:\"priority/%5Esmartlabel_personal\",title:\"Primary\",arg:\"^smartlabel_personal\",icon:\"inbox\",category:!0},{id:\"promotions\",path:\"priority/%5Esmartlabel_promo\",title:\"Promotions\",arg:\"^smartlabel_promo\",icon:\"tag\",category:!0},{id:\"social\",path:\"priority/%5Esmartlabel_social\",title:\"Social\",arg:\"^smartlabel_social\",icon:\"people\",category:!0},{id:\"starred\",path:\"Starred\",title:\"Starred\",arg:\"^t\",icon:\"star\"},{id:\"important\",path:\"Important\",title:\"Important\",arg:\"^io_im\",icon:\"important\"},{id:\"sent\",path:\"Sent%20Mail\",title:\"Sent\",arg:\"^f\",icon:\"send\"},{id:\"drafts\",path:\"Drafts\",title:\"Drafts\",arg:\"^r\",icon:\"draft\"},{id:\"all\",path:\"All%20Mail\",title:\"All mail\",arg:\"^all\",icon:\"mail\"},{id:\"spam\",path:\"Spam\",title:\"Spam\",arg:\"^s\",icon:\"alert\"},{id:\"trash\",path:\"Trash\",title:\"Trash\",arg:\"^k\",icon:\"trash\"}],yn=Ja[0];function eu(e){try{return decodeURIComponent(e)}catch{return e}}function kf(e){if(e.startsWith(\"search/\")){let n=eu(e.slice(7));return{path:e,id:\"search\",title:\"Search\",query:n}}let t=Ja.find(n=>n.path===e||eu(n.path)===eu(e));return t?{path:t.path,id:t.id,title:t.title}:{path:e,id:`label:${eu(e)}`,title:eu(e).replace(/^.*\\//,\"\")}}function $0(e){let t=e.replace(/^#/,\"\");if(t===\"\")return{kind:\"list\",list:kf(yn.path)};if(t.startsWith(\"tl/\"))return{kind:\"list\",list:kf(t.slice(3))};if(t.startsWith(\"cv/\")){let n=t.slice(3),a=n.lastIndexOf(\"/\"),l=a>=0?n.slice(a+1):n,i=a>=0?n.slice(0,a):yn.path;if(/^[0-9a-f]{6,24}$/i.test(l))return{kind:\"conversation\",list:kf(i),threadId:l}}return t===\"co\"||t.startsWith(\"co?\")||t.startsWith(\"co/\")?{kind:\"compose\"}:t===\"mn\"||t.startsWith(\"mn/\")?{kind:\"menu\"}:t===\"pr\"||t.startsWith(\"pr/\")?{kind:\"settings\"}:{kind:\"other\",hash:t}}function F0(e){try{let t=new URL(e??\"\");if(t.origin===ji&&t.pathname.startsWith(\"/mail/mu/\"))return`${ji}${t.pathname}${t.search}`}catch{}return`${ji}${mS}`}var _f=e=>`${ji}/mail/mu/?authuser=${encodeURIComponent(e.email||String(e.sessionIndex))}`,uc=(e,t)=>`${e}#tl/${t}`,W0=(e,t)=>`${e}#tl/search/${encodeURIComponent(t.trim())}`,Rf=(e,t,n=\"All%20Mail\")=>`${e}#cv/${n}/${t}`,P0=e=>`${e}#co`,ey=e=>`${e}#mn`,Cl=[\"#2347d9\",\"#b5470b\",\"#1f7a4d\",\"#7b2d8e\",\"#0e7490\",\"#3d4250\"],ty=[\"Blue\",\"Rust\",\"Green\",\"Plum\",\"Teal\",\"Graphite\"],ny={v:1,showAddTo:!0,defaultSort:\"due\",defaultReminderTime:\"09:00\",morningSummary:\"08:00\",archiveAfterAdding:!0,keepDoneDays:7,swipeRight:\"remind\",swipeLeft:\"archive\",theme:\"system\",todoAccount:\"all\",recentSearches:[]},Uf=e=>e.trim().toLowerCase();function ay(e,t=[]){let[n=\"\",a=\"\"]=e.split(\"@\"),l=a.toLowerCase(),i=l===\"gmail.com\"||l===\"googlemail.com\"?\"Personal\":l.split(\".\")[0]??\"\",o=i?i[0].toUpperCase()+i.slice(1):e;return t.includes(o)&&n?n:o}function rc(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var pS=/^\\d{4}-\\d{2}-\\d{2}$/,gS=/^\\d{2}:\\d{2}$/;function ly(e){return!rc(e)||e.v!==1?!1:typeof e.id==\"string\"&&(e.type===\"reminder\"||e.type===\"todo\")&&typeof e.title==\"string\"&&(e.dueDate===null||typeof e.dueDate==\"string\"&&pS.test(e.dueDate))&&(e.dueTime===null||typeof e.dueTime==\"string\"&&gS.test(e.dueTime))&&typeof e.done==\"boolean\"&&typeof e.createdAt==\"number\"&&typeof e.accountId==\"string\"}function iy(e){return rc(e)&&e.v===1&&typeof e.id==\"string\"&&typeof e.email==\"string\"&&typeof e.name==\"string\"&&typeof e.color==\"string\"}var tu=e=>String(e).padStart(2,\"0\"),pe=e=>`${e.getFullYear()}-${tu(e.getMonth()+1)}-${tu(e.getDate())}`,ut=e=>`${tu(e.getHours())}:${tu(e.getMinutes())}`;function en(e){let[t,n,a]=e.split(\"-\").map(Number);return new Date(t,n-1,a)}function _e(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}var vt=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate());function ot(e,t){let[n,a]=t.split(\":\").map(Number),l=vt(e);return l.setHours(n,a,0,0),l}function Hf(e){return e.dueDate?ot(en(e.dueDate),e.dueTime??\"23:59\"):null}var hS=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],oy=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],Xi=e=>hS[e.getDay()],Jn=e=>`${Xi(e)}, ${e.getDate()} ${oy[e.getMonth()]}`;function Ct(e){let[t,n]=e.split(\":\").map(Number),a=t<12?\"AM\":\"PM\";return`${t%12===0?12:t%12}:${tu(n)} ${a}`}function $a(e,t=new Date){return Math.round((vt(e).getTime()-vt(t).getTime())/864e5)}function Bf(e,t=new Date){let n=$a(e,t);return n===0?\"Today\":n===1?\"Tomorrow\":n===-1?\"Yesterday\":n>1&&n<7?Xi(e):Jn(e)}function $n(e,t=new Date){if(!e.dueDate)return\"No date\";let n=en(e.dueDate),a=Bf(n,t);return e.dueTime?`${a}, ${Ct(e.dueTime)}`:a}function Fn(e,t=new Date){if(!e.dueDate)return\"\";let n=en(e.dueDate),a=$a(n,t),l=a===0?\"today\":a===1?\"tomorrow\":a===-1?\"yesterday\":a>1&&a<7?Xi(n):`${Xi(n)} ${n.getDate()} ${oy[n.getMonth()]}`;return e.dueTime?`${l[0].toUpperCase()}${l.slice(1)} ${Ct(e.dueTime)}`:`Due ${l}`}function cc(e,t=new Date){let n=new Date(e),a=Bf(n,t);return`${a===\"Today\"?\"today\":a===\"Yesterday\"?\"yesterday\":a}, ${Ct(ut(n))}`}function uy(e,t){let n=en(e),a=vt(new Date);do if(t===\"daily\")n=_e(n,1);else if(t===\"weekly\")n=_e(n,7);else if(t===\"monthly\")n=new Date(n.getFullYear(),n.getMonth()+1,n.getDate());else if(t===\"weekdays\")do n=_e(n,1);while(n.getDay()===0||n.getDay()===6);else break;while(n=8&&i.getHours()<22&&a.push({id:\"later\",label:\"Later today\",date:i,detail:Dn(i,t)});let o=ot(_e(n,1),e);a.push({id:\"tomorrow\",label:\"Tomorrow\",date:o,detail:Dn(o,t)});let u=ot(_e(n,(8-n.getDay())%7||7),e);if(a.push({id:\"week\",label:\"Next week\",date:u,detail:Dn(u,t)}),n.getDay()!==0){let r=ot(_e(n,(6-n.getDay()+7)%7),\"10:00\"),c=r>t?r:ot(_e(n,1),\"10:00\");c>t&&c.getDay()!==1&&a.push({id:\"weekend\",label:\"This weekend\",date:c,detail:Dn(c,t)})}return a}function cy(e,t=new Date){let n=vt(t),a=[],l=ot(n,\"18:00\");if(l>t)a.push({id:\"evening\",label:\"Today 6 PM\",date:l,detail:\"\"});else{let o=ot(n,\"21:00\");o>t&&a.push({id:\"night\",label:\"Tonight 9 PM\",date:o,detail:\"\"})}let i=ot(_e(n,1),e);return a.push({id:\"tomorrow\",label:`Tomorrow ${Ct(e).replace(\":00\",\"\")}`,date:i,detail:\"\"}),a}function sy(e,t,n=new Date){let a=vt(n);if(e===\"today\")return pe(a);if(e===\"tomorrow\")return pe(_e(a,1));if(e===\"week\"){let l=(5-a.getDay()+7)%7,i=a.getDay()===6||a.getDay()===0||l<2?_e(a,(7-a.getDay())%7||0):_e(a,l);return pe(i<_e(a,2)?_e(a,2):i)}return e===\"pick\"?t:null}function Ol(e,t=new Date){if(e.done)return\"done\";if(!e.dueDate)return\"none\";let n=$a(en(e.dueDate),t);return n<0?\"overdue\":n===0?\"today\":n===1?\"tomorrow\":n<7?\"week\":\"later\"}function au(e,t){return(e.dueDate??\"9\")!==(t.dueDate??\"9\")?(e.dueDate??\"9\")<(t.dueDate??\"9\")?-1:1:!e.dueTime!=!t.dueTime?e.dueTime?1:-1:(e.dueTime??\"\")!==(t.dueTime??\"\")?(e.dueTime??\"\")<(t.dueTime??\"\")?-1:1:e.priority!==t.priority?e.priority===\"high\"?-1:1:e.createdAt-t.createdAt}function Fa(e,t=new Date){return e.done||e.snooze||!e.dueDate?!1:$a(en(e.dueDate),t)<=0}function dy(e,t=new Date){if(e.done||!e.bringBack||!e.link?.threadId)return!1;let n=Hf(e);return n!==null&&n<=t}function fy(e){let t=e.replace(/[<(].*$/,\"\").replace(/[^\\p{L}\\p{N} ]/gu,\" \").trim().split(/\\s+/).filter(Boolean);return t.length===0?\"?\":t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function my(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return t%360}var py=()=>typeof crypto<\"u\"&&\"randomUUID\"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`;var ie=Y(Ke(),1);var gy=(0,ie.createContext)(null);function vS(){let e=oc(\"items\"),t=(0,ie.useMemo)(()=>e.records.map(u=>u.value).filter(ly),[e.records]),n=(0,ie.useRef)(new Map);n.current=(0,ie.useMemo)(()=>new Map(e.records.map(u=>[u.key,u.revision])),[e.records]);let a=u=>n.current.get(u)??null,l=(0,ie.useCallback)(async u=>{u.length&&await e.commit({checks:u.map(r=>({collection:\"items\",key:r.id,expectedRevision:a(r.id)})),puts:u.map(r=>({collection:\"items\",key:r.id,value:r}))})},[e]),i=(0,ie.useCallback)(async u=>{let r=u.filter(c=>n.current.has(c));r.length&&await e.commit({checks:r.map(c=>({collection:\"items\",key:c,expectedRevision:a(c)})),deletes:r.map(c=>({collection:\"items\",key:c}))})},[e]),o=(0,ie.useCallback)(async(u,r)=>{if(r&&u.type===\"reminder\"&&u.repeat!==\"never\"&&u.dueDate){await l([{...u,dueDate:uy(u.dueDate,u.repeat),returned:!1}]);return}await l([{...u,done:r,completedAt:r?Date.now():null}])},[l]);return{items:t,loading:e.loading,error:e.error,save:u=>l([u]),saveMany:l,remove:u=>i([u]),removeMany:i,complete:o}}function yS(){let e=oc(\"accounts\"),t=hn(\"primary\"),n=(0,ie.useMemo)(()=>e.records.map(m=>m.value).filter(iy).sort((m,d)=>m.addedAt-d.addedAt),[e.records]),a=t.account,l=vn(\"view\",null,\"primary\")?.data.session,i=typeof l==\"number\"?l:bS(t.url),o=(0,ie.useCallback)(async m=>{await e.put(m.id,m)},[e]),u=(0,ie.useRef)(null);(0,ie.useEffect)(()=>{if(e.loading||!a)return;let m=Uf(a),d=n.find(h=>h.id===m);if(d){i!==null&&d.sessionIndex!==i&&e.put(m,{...d,sessionIndex:i}).catch(()=>{});return}if(u.current===m)return;u.current=m;let f=new Set(n.map(h=>h.color)),s=Cl.find(h=>!f.has(h))??Cl[n.length%Cl.length];e.put(m,{v:1,id:m,email:a,name:ay(a,n.map(h=>h.name)),color:s,sessionIndex:i??0,showInInbox:!0,showInTodo:!0,addedAt:Date.now()},null).catch(()=>{u.current=null})},[e,n,a,i]);let r=(0,ie.useCallback)(m=>n.find(d=>d.id===m),[n]),c=a?r(Uf(a))??null:null;return{accounts:n,current:c,byId:r,save:o}}function bS(e){let t=/\\/mail\\/u\\/(\\d+)\\/|[?&]authuser=(\\d+)/.exec(e??\"\");return t?Number(t[1]??t[2]):null}function xS(){let e=oc(\"settings\"),t=e.records.find(l=>l.key===\"prefs\")?.value,n=(0,ie.useMemo)(()=>({...ny,...rc(t)?t:{}}),[t]),a=(0,ie.useCallback)(async l=>{await e.put(\"prefs\",{...n,...l,v:1})},[e,n]);return{settings:n,loading:e.loading,update:a}}function hy({children:e}){let t=vS(),n=yS(),a=xS(),l=(0,ie.useMemo)(()=>({items:t,accounts:n,settings:a}),[t,n,a]);return(0,ie.createElement)(gy.Provider,{value:l},e)}function Lf(){let e=(0,ie.useContext)(gy);if(!e)throw new Error(\"DataProvider is missing\");return e}var Se=()=>Lf().items,Ee=()=>Lf().accounts,yt=()=>Lf().settings;function vy(){let{items:e,loading:t,removeMany:n}=Se(),{settings:a,loading:l}=yt(),i=(0,ie.useRef)(!1);(0,ie.useEffect)(()=>{if(t||l||i.current)return;i.current=!0;let o=Date.now()-a.keepDoneDays*864e5,u=e.filter(r=>r.done&&(r.completedAt??0)r.id);u.length&&n(u).catch(()=>{})},[t,l,e,a.keepDoneDays,n])}var yy=(0,ie.createContext)(null);function by({children:e}){let[t,n]=(0,ie.useState)(null),a=(0,ie.useRef)(0),l=(0,ie.useCallback)(u=>{window.clearTimeout(a.current);let r=Date.now();n({...u,id:r}),a.current=window.setTimeout(()=>n(c=>c?.id===r?null:c),u.undo?6e3:3500)},[]),i=(0,ie.useCallback)(()=>n(null),[]),o=(0,ie.useMemo)(()=>({toast:t,show:l,clear:i}),[t,l,i]);return(0,ie.createElement)(yy.Provider,{value:o},e)}function qe(){let e=(0,ie.useContext)(yy);if(!e)throw new Error(\"ToastProvider is missing\");return e}function Le(){let[e,t]=(0,ie.useState)(()=>new Date);return(0,ie.useEffect)(()=>{let n=window.setInterval(()=>t(new Date),3e4);return()=>window.clearInterval(n)},[]),e}var Ot=Y(Ke(),1);var R=Y(P(),1),SS={menu:\"M4 7h16M4 12h16M4 17h16\",search:\"M20 20l-4.6-4.6M17 10.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0\",back:\"M19 12H5M11 6l-6 6 6 6\",close:\"M6 6l12 12M18 6 6 18\",archive:\"M4 5h16v4H4zM5 9v10h14V9M10 13h4\",trash:\"M5 7h14M10 4h4M7 7l1 13h8l1-13M10 11v6M14 11v6\",unread:\"M3 6h18v12H3zM3 7l9 6 9-6\",clock:\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2\",more:\"M12 5.5h.01M12 12h.01M12 18.5h.01\",plus:\"M12 5v14M5 12h14\",down:\"M6 9l6 6 6-6\",up:\"M6 15l6-6 6 6\",right:\"M9 6l6 6-6 6\",bell:\"M6 16v-5a6 6 0 1 1 12 0v5l1.5 2h-15zM10 21h4\",check:\"M5 12.5 10 17 19 7\",star:\"M12 3.5l2.6 5.4 5.9.8-4.3 4.1 1 5.9L12 17l-5.2 2.7 1-5.9-4.3-4.1 5.9-.8z\",clip:\"M20 11.5l-8 8a5 5 0 0 1-7-7l8.5-8.5a3.3 3.3 0 0 1 4.7 4.7l-8.4 8.4a1.7 1.7 0 0 1-2.4-2.4L15 7\",reply:\"M10 8V4L3 11l7 7v-4c5 0 8 1.5 11 5-1-6-4-10-11-11z\",replyAll:\"M13 8V4l-7 7 7 7v-4c4.5 0 7 1.5 9 5-1-6-3.5-10-9-11zM7 4l-7 7 7 7\",forward:\"M14 8V4l7 7-7 7v-4c-5 0-8 1.5-11 5 1-6 4-10 11-11z\",inbox:\"M4 13l2.5-8h11L20 13v6H4zM4 13h5l1 2h4l1-2h5\",tag:\"M3 12V4h8l10 10-8 8zM7.5 8h.01\",people:\"M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 6.5M18 14.5a6.5 6.5 0 0 1 3.5 5.5\",send:\"M4 4l17 8-17 8 3-8zM7 12h14\",draft:\"M5 3h9l5 5v13H5zM14 3v5h5M8 13h8M8 17h5\",mail:\"M3 6h18v12H3zM3 7l9 6 9-6\",alert:\"M12 3l10 18H2zM12 10v5M12 18h.01\",important:\"M4 6h11l5 6-5 6H4l4-6z\",settings:\"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 0 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 0 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 0 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 0 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z\",pencil:\"M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4\",todo:\"M4 6l2 2 3-3M4 13l2 2 3-3M12 7h8M12 14h8M12 20h8M4 19.5h4\",calendar:\"M4 6h16v14H4zM4 10h16M8 3v4M16 3v4\",repeat:\"M17 2l3 3-3 3M4 11V9a4 4 0 0 1 4-4h12M7 22l-3-3 3-3M20 13v2a4 4 0 0 1-4 4H4\",note:\"M5 4h14v16H5zM8 9h8M8 13h8M8 17h4\",external:\"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6\",flag:\"M5 21V4h11l-2 4 2 4H5\",label:\"M3 12V4h8l10 10-8 8zM7.5 8h.01\",refresh:\"M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7\",mute:\"M11 5L6 9H3v6h3l5 4zM16 9l5 6M21 9l-5 6\",spam:\"M8 3h8l5 5v8l-5 5H8l-5-5V8zM12 8v5M12 16h.01\",user:\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0\",sun:\"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4\",swipe:\"M4 12h16M8 8l-4 4 4 4M16 8l4 4-4 4\",check2:\"M4 4h16v16H4zM8 12l3 3 5-6\"};function E({name:e,filled:t=!1,size:n}){return(0,R.jsx)(\"svg\",{viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",className:t?\"filled\":void 0,style:n?{width:n,height:n}:void 0,children:(0,R.jsx)(\"path\",{d:SS[e]})})}function te({icon:e,label:t,onClick:n,filled:a,disabled:l,pressed:i,className:o}){return(0,R.jsx)(\"button\",{type:\"button\",className:`icon-button ${o??\"\"}`,\"aria-label\":t,title:t,\"aria-pressed\":i,disabled:l,onClick:n,children:(0,R.jsx)(E,{name:e,filled:a})})}function Wa({name:e,size:t=40,selected:n=!1}){let a=my(e);return n?(0,R.jsx)(\"span\",{className:\"avatar selected\",style:{width:t,height:t},\"aria-hidden\":\"true\",children:(0,R.jsx)(E,{name:\"check\"})}):(0,R.jsx)(\"span\",{className:\"avatar\",\"aria-hidden\":\"true\",style:{width:t,height:t,fontSize:t*.38,\"--hue\":String(a)},children:fy(e)})}function Ze({color:e,label:t}){return(0,R.jsx)(\"span\",{className:\"account-dot\",style:{background:e},role:t?\"img\":void 0,\"aria-label\":t,\"aria-hidden\":t?void 0:!0})}function tn({label:e,detail:t,checked:n,onChange:a,icon:l}){let i=(0,Ot.useId)();return(0,R.jsxs)(\"label\",{className:\"toggle-row\",htmlFor:i,children:[l,(0,R.jsxs)(\"span\",{className:\"toggle-text\",children:[(0,R.jsx)(\"span\",{children:e}),t&&(0,R.jsx)(\"small\",{children:t})]}),(0,R.jsx)(\"input\",{id:i,type:\"checkbox\",role:\"switch\",checked:n,onChange:o=>a(o.target.checked)}),(0,R.jsx)(\"span\",{className:\"switch\",\"aria-hidden\":\"true\"})]})}function zn({label:e,options:t,value:n,onChange:a,className:l}){return(0,R.jsx)(\"div\",{className:`chips ${l??\"\"}`,role:\"radiogroup\",\"aria-label\":e,children:t.map(i=>(0,R.jsx)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":i.id===n,className:`chip ${i.tone??\"\"}`,onClick:()=>a(i.id),children:i.label},i.id))})}function lu({title:e,icon:t,tone:n,children:a,footer:l,onClose:i,labelledBy:o}){let u=(0,Ot.useId)(),r=(0,Ot.useRef)(null),c=(0,Ot.useRef)(null);(0,Ot.useEffect)(()=>{let s=document.activeElement instanceof HTMLElement?document.activeElement:null;return r.current?.focus(),()=>{s?.isConnected&&s.focus({preventScroll:!0})}},[]);let m=s=>{let h=c.current;!h||!r.current||(h.dy=Math.max(0,s-h.y),r.current.style.transform=h.dy?`translateY(${h.dy}px)`:\"\")},d=()=>{let s=c.current;if(c.current=null,!(!s||!r.current)){if(r.current.classList.remove(\"dragging\"),s.dy>Math.min(120,r.current.offsetHeight/4)){i();return}r.current.style.transform=\"\"}};return(0,R.jsxs)(\"div\",{className:\"sheet-layer\",children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"sheet-backdrop\",\"aria-label\":\"Close\",onClick:i}),(0,R.jsxs)(\"div\",{className:\"sheet\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":o??u,ref:r,tabIndex:-1,children:[(0,R.jsxs)(\"div\",{className:\"sheet-handle\",...{onPointerDown:s=>{s.target.closest(\"button\")||(c.current={id:s.pointerId,y:s.clientY,dy:0},s.currentTarget.setPointerCapture(s.pointerId),r.current?.classList.add(\"dragging\"))},onPointerMove:s=>{c.current?.id===s.pointerId&&m(s.clientY)},onPointerUp:d,onPointerCancel:d},children:[(0,R.jsx)(\"span\",{className:\"grabber\",\"aria-hidden\":\"true\"}),(0,R.jsxs)(\"header\",{className:\"sheet-head\",children:[(0,R.jsx)(\"span\",{className:`tile ${n}`,children:(0,R.jsx)(E,{name:t})}),(0,R.jsx)(\"h2\",{id:u,children:e}),(0,R.jsx)(te,{icon:\"close\",label:\"Close\",onClick:i})]})]}),(0,R.jsx)(\"div\",{className:\"sheet-body\",children:a}),l&&(0,R.jsx)(\"footer\",{className:\"sheet-foot\",children:l})]})]})}var sc={count:0};function iu({children:e,onClose:t,className:n}){let a=(0,Ot.useRef)(null),l=Kn().navigation,{screen:i}=I(),o=(0,Ot.useRef)({key:null,seen:!1}),u=(0,Ot.useRef)(t);return u.current=t,(0,Ot.useEffect)(()=>(sc.count++,l.navigate({screen:\"menu\"}),o.current={key:l.screen()?.key??null,seen:!1},()=>{sc.count--,o.current.key&&l.screen()?.key===o.current.key&&l.back(),o.current={key:null,seen:!1}}),[l]),(0,Ot.useEffect)(()=>{let r=o.current;r.key&&(i?.key===r.key?r.seen=!0:r.seen&&(o.current={key:null,seen:!1},u.current()))},[i?.key]),(0,Ot.useEffect)(()=>{a.current?.querySelector(\"button\")?.focus();let r=c=>{c.key===\"Escape\"&&t()};return window.addEventListener(\"keydown\",r),()=>window.removeEventListener(\"keydown\",r)},[t]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"popover-scrim\",\"aria-label\":\"Close menu\",onClick:t}),(0,R.jsx)(\"div\",{ref:a,role:\"menu\",className:`popover ${n}`,children:e})]})}function bn({title:e,children:t,onBack:n,backLabel:a=\"Back\",className:l}){let{back:i}=I();return(0,R.jsxs)(\"header\",{className:`top-bar ${l??\"\"}`,children:[(0,R.jsx)(te,{icon:\"back\",label:a,onClick:n??i}),e!==void 0&&(0,R.jsx)(\"h1\",{children:e}),(0,R.jsx)(\"span\",{className:\"spacer\"}),t]})}function nn({label:e,rows:t=7,kind:n=\"rows\"}){return n===\"email\"?(0,R.jsxs)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:\"skeleton email\",children:[(0,R.jsx)(\"span\",{className:\"bar title\"}),(0,R.jsx)(\"span\",{className:\"bar title short\"}),(0,R.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[(0,R.jsx)(\"span\",{className:\"skeleton-avatar\"}),(0,R.jsxs)(\"div\",{children:[(0,R.jsx)(\"span\",{}),(0,R.jsx)(\"span\",{})]})]}),Array.from({length:t},(a,l)=>(0,R.jsx)(\"span\",{className:`bar line ${l%4===3?\"short\":\"\"}`,\"aria-hidden\":\"true\"},l))]}):(0,R.jsx)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:`skeleton ${n}`,children:Array.from({length:t},(a,l)=>(0,R.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[n===\"rows\"&&(0,R.jsx)(\"span\",{className:\"skeleton-avatar\"}),(0,R.jsxs)(\"div\",{children:[(0,R.jsx)(\"span\",{}),(0,R.jsx)(\"span\",{}),(0,R.jsx)(\"span\",{})]})]},l))})}function dc({active:e,label:t=\"Loading\"}){return(0,R.jsx)(\"div\",{className:`progress-bar${e?\" active\":\"\"}`,role:\"progressbar\",\"aria-label\":t,\"aria-hidden\":!e,\"aria-busy\":e})}function fc(e){let t=(0,Ot.useRef)(e);return e&&(t.current=!0),t.current}function kt({title:e,children:t,role:n,icon:a}){return(0,R.jsxs)(\"section\",{className:\"notice\",role:n,children:[a&&(0,R.jsx)(\"span\",{className:\"notice-icon\",children:(0,R.jsx)(E,{name:a,size:28})}),(0,R.jsx)(\"h2\",{children:e}),t]})}function xy({error:e}){let{reload:t,viewWebsite:n}=I(),a=e?.code===\"NOT_READY\"||e?.code===\"DEADLINE\"?\"Gmail did not answer in time.\":e?.message||\"This page could not be read.\";return(0,R.jsxs)(kt,{title:\"Couldn't load Gmail\",role:\"alert\",icon:\"alert\",children:[(0,R.jsx)(\"p\",{children:a}),(0,R.jsxs)(\"div\",{className:\"row-buttons\",children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t(),children:\"Try again\"}),(0,R.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>n(),children:[\"Open in Gmail \",(0,R.jsx)(E,{name:\"external\"})]})]})]})}function ou({text:e,terms:t}){let n=t.map(l=>l.trim()).filter(l=>l.length>1);if(!n.length)return(0,R.jsx)(R.Fragment,{children:e});let a=new RegExp(`(${n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")).join(\"|\")})`,\"gi\");return(0,R.jsx)(R.Fragment,{children:e.split(a).map((l,i)=>i%2===1?(0,R.jsx)(\"mark\",{children:l},i):l)})}function mc(){return(0,R.jsxs)(\"span\",{className:\"logo\",\"aria-label\":\"Gmail Only\",children:[\"gmail \",(0,R.jsx)(\"span\",{children:\"only\"})]})}var kl=Y(Ke(),1);var j=\"primary\";function ru(){let e=hn(j);return(0,kl.useMemo)(()=>{let t=\"\";try{t=new URL(e.url??\"\").hash}catch{}return{view:$0(t),base:F0(e.url),url:e.url}},[e.url])}function Ve(){let{navigate:e}=I(),{base:t}=ru(),{current:n,byId:a}=Ee();return(0,kl.useMemo)(()=>({base:t,list:(l,i=\"push\")=>e({url:uc(t,l),context:j,mode:i}),inbox:(l=\"push\")=>e({url:uc(t,yn.path),context:j,mode:l}),thread:(l,i)=>e({url:Rf(t,l,i),context:j}),email:(l,i)=>{let o=a(i),u=o&&n&&o.id!==n.id;e({url:Rf(u?_f(o):t,l),context:j})},inboxOf:l=>e({url:uc(_f(l),yn.path),context:j}),search:(l,i=\"push\")=>e({url:W0(t,l),context:j,mode:i}),compose:()=>e({url:P0(t),context:j}),menu:()=>e({url:ey(t),context:j})}),[e,t,n,a])}var uu=new Map,pc=new Set,Gf=0;function gc(e,t){if(!(t===null||uu.get(e)===t)){uu.set(e,t),Gf++;for(let n of pc)n()}}function Sy(){if(uu.size){uu.clear(),Gf++;for(let e of pc)e()}}function hc(e){return(0,kl.useSyncExternalStore)(t=>(pc.add(t),()=>{pc.delete(t)}),()=>Gf),uu.get(e)??null}function _l(e,t,n,a={}){return{v:1,id:py(),type:e,title:t?Wn(t.subject):\"\",note:\"\",dueDate:null,dueTime:null,notify:e===\"reminder\",repeat:\"never\",priority:\"normal\",link:t?{threadId:t.threadId,sender:t.sender,subject:t.subject,snippet:t.snippet,receivedAt:t.receivedAt}:null,accountId:t?.accountId??n,source:\"user\",createdAt:Date.now(),completedAt:null,done:!1,bringBack:e===\"reminder\",snooze:!1,...a}}function Wn(e){return e.replace(/^((re|fwd?|fw|aw)\\s*:\\s*)+/i,\"\").trim().slice(0,200)||\"Follow up\"}function Vi(e,t){return t?e.filter(n=>n.link?.threadId===t):[]}function Pa(e){return e.split(/,| \\d+$/)[0].replace(/\\s+\\d+$/,\"\").trim()||e}function el(){let{navigate:e}=I();return(0,kl.useCallback)(t=>e({screen:\"item\",params:{id:t}}),[e])}var cu={threadId:null};var vc=Y(Ke(),1);var qf=(0,vc.createContext)(null);function Qi(){let e=(0,vc.useContext)(qf),{screen:t}=I();return e??t?.params??{}}var Rl=Y(Ke(),1),jf=Y(P(),1);function du(){try{return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches}catch{return!1}}var su=\"cubic-bezier(.2, 0, 0, 1)\",Zi=\"cubic-bezier(.3, 0, .8, .15)\",yc=\"32px\",TS={push:{frames:[{opacity:0,transform:`translateX(${yc})`},{opacity:1,transform:\"none\"}],ms:300,easing:su},pop:{frames:[{opacity:0,transform:`translateX(-${yc})`},{opacity:1,transform:\"none\"}],ms:300,easing:su},fade:{frames:[{opacity:0,transform:\"scale(.98)\"},{opacity:1,transform:\"none\"}],ms:220,easing:su},\"drawer-in\":{frames:[{transform:\"translateX(-100%)\"},{transform:\"none\"}],ms:280,easing:su}},NS={push:[{frames:[{opacity:1,transform:\"none\"},{opacity:0,transform:`translateX(-${yc})`}],ms:200,easing:Zi}],pop:Object.assign([{frames:[{opacity:1,transform:\"none\"},{opacity:0,transform:`translateX(${yc})`}],ms:200,easing:Zi}],{above:!0}),fade:[{frames:[{opacity:1},{opacity:0}],ms:120,easing:Zi}],\"drawer-in\":[{frames:[{opacity:1},{opacity:.6}],ms:280,easing:su}],\"drawer-out\":Object.assign([{frames:[{transform:\"none\"},{transform:\"translateX(-100%)\"}],ms:240,easing:Zi}],{above:!0}),\"sheet-close\":Object.assign([{frames:[{transform:\"translateY(100%)\"}],ms:220,easing:Zi,target:\".sheet\"},{frames:[{opacity:1},{opacity:0}],ms:220,easing:\"linear\",target:\".sheet-backdrop\"}],{above:!0}),\"sheet-swap\":[{frames:[{opacity:1},{opacity:0,transform:\"translateY(24px)\"}],ms:160,easing:Zi,target:\".sheet\"},{frames:[{opacity:1},{opacity:1}],ms:260,easing:\"linear\",target:\".sheet-backdrop\"}]},Ty=\".screen, .sheet-body, .sheet\",wS=90;function ES(e){let t=[...e.querySelectorAll(Ty)].map(a=>a.scrollTop),n=e.cloneNode(!0);return n.setAttribute(\"aria-hidden\",\"true\"),n.inert=!0,n.classList.add(\"ghost\"),{node:n,tops:t}}function AS(e,t,n,a){let l=NS[n];if(!e||!l)return;t.node.style.zIndex=String(a+(l.above?1:-1)),e.appendChild(t.node),t.node.querySelectorAll(Ty).forEach((r,c)=>{r.scrollTop=t.tops[c]??0});let i=l.map(r=>(r.target?t.node.querySelector(r.target):t.node)?.animate(r.frames,{duration:r.ms,easing:r.easing,fill:\"forwards\"})),o=Math.max(...l.map(r=>r.ms)),u=()=>t.node.remove();Promise.all(i.map(r=>r?.finished)).then(u,u),window.setTimeout(u,o+200)}function Yf({id:e,motion:t,layer:n,zIndex:a,inert:l,children:i}){let o=(0,Rl.useRef)(null),u=(0,Rl.useRef)({id:e,at:0}),r=(0,Rl.useRef)(null);if(u.current.id!==e){let c=performance.now(),m=c-u.current.at{let c=r.current;if(r.current=null,!c)return;c.copy&&AS(n.current,c.copy,c.motion,a);let m=TS[c.motion];m&&o.current&&o.current.animate(m.frames,{duration:m.ms,easing:m.easing})},[e,n,a]),e===null?null:(0,jf.jsx)(\"div\",{ref:o,className:\"stage\",style:{zIndex:a},inert:l,children:i})}function Ny({layer:e}){return(0,jf.jsx)(\"div\",{className:\"ghosts\",ref:e,\"aria-hidden\":\"true\"})}function MS(e,t){return!e||e.id===t.id?\"none\":t.drawer&&!e.drawer?\"drawer-in\":e.drawer&&!t.drawer?\"drawer-out\":e.tab&&t.tab?\"fade\":t.index!==e.index?t.index>e.index?\"push\":\"pop\":t.depth!==e.depth?t.depth>e.depth?\"push\":\"pop\":\"fade\"}function wy(e){let t=(0,Rl.useRef)({place:null,motion:\"none\"});return t.current.place?.id!==e.id&&(t.current={place:e,motion:MS(t.current.place,e)}),t.current.motion}var rt=Y(Ke(),1);var Ey=Y(Ke(),1);var Re=Y(P(),1),DS=380;function Xf(e){let{complete:t}=Se(),{show:n}=qe(),[a,l]=(0,Ey.useState)(!1);return{checking:a,toggle:()=>{if(!a){if(e.done){t(e,!1);return}l(!0),window.setTimeout(()=>{t(e,!0).then(()=>n({text:e.type===\"reminder\"?\"Reminder done\":\"To-do done\",undo:()=>t(e,!1)}),()=>n({text:\"Couldn't save. Try again.\"})).finally(()=>l(!1))},du()?0:DS)}}}}function fu({item:e,onToggle:t,large:n=!1,checking:a=!1}){let l=e.done||a,i=e.done?`Mark \"${e.title}\" not done`:`Mark \"${e.title}\" done`;return(0,Re.jsx)(\"button\",{type:\"button\",className:`mark ${e.type} ${l?\"done\":\"\"} ${a?\"checking\":\"\"} ${n?\"large\":\"\"}`,role:\"checkbox\",\"aria-checked\":l,\"aria-label\":i,onClick:o=>{o.stopPropagation(),t()},children:l?(0,Re.jsx)(E,{name:\"check\"}):e.type===\"reminder\"?(0,Re.jsx)(E,{name:\"bell\"}):null})}function zS(e,t){return e.byId(t.accountId)}function tl({item:e,mode:t=\"due\",now:n,onOpen:a,trailing:l,onSetDate:i}){let{checking:o,toggle:u}=Xf(e),r=Ee(),c=zS(r,e),m=Ol(e,n),d=m===\"overdue\",f=Hf(e),s;if(t===\"added\")s=(0,Re.jsxs)(Re.Fragment,{children:[e.link?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(E,{name:\"mail\",size:14}),\" \",Pa(e.link.sender),\" \\xB7 \"]}):\"Added by you \\xB7 \",e.done&&e.completedAt?`Done ${cc(e.completedAt,n)}`:Ct(ut(new Date(e.createdAt)))]});else{let y=d?e.dueTime?`Due ${Fn(e,n)}`:Fn(e,n):m===\"today\"&&!e.dueTime?\"Anytime today\":m===\"none\"?\"No date yet\":e.dueTime&&m===\"today\"?\"Today\":Fn(e,n);s=(0,Re.jsxs)(Re.Fragment,{children:[y,c&&(0,Re.jsxs)(Re.Fragment,{children:[\" \\xB7 \",(0,Re.jsx)(Ze,{color:c.color}),\" \",c.name]})]})}let h=l;return h===void 0&&(t===\"added\"&&!e.dueDate&&!e.done?h=(0,Re.jsx)(\"button\",{type:\"button\",className:\"tag set-date\",onClick:y=>{y.stopPropagation(),(i??a)()},children:\"+ Set date\"}):t===\"added\"&&e.dueDate&&!e.done?h=(0,Re.jsx)(\"span\",{className:`tag ${e.type===\"reminder\"?\"reminder\":\"\"}`,children:Fn(e,n)}):t===\"due\"&&e.dueTime&&!e.done&&f&&(h=(0,Re.jsx)(\"span\",{className:\"time-tag\",children:Ct(e.dueTime)}))),(0,Re.jsxs)(\"li\",{className:`item-row ${d&&t===\"due\"?\"overdue\":\"\"} ${e.done||o?\"is-done\":\"\"} ${e.type}`,children:[(0,Re.jsx)(fu,{item:e,onToggle:u,checking:o}),(0,Re.jsxs)(\"button\",{type:\"button\",className:\"item-main\",onClick:a,children:[(0,Re.jsxs)(\"span\",{className:\"item-title\",children:[e.priority===\"high\"&&!e.done&&(0,Re.jsx)(\"span\",{className:\"priority\",\"aria-label\":\"High priority\",children:(0,Re.jsx)(E,{name:\"flag\",filled:!0,size:14})}),e.title||\"Untitled\"]}),(0,Re.jsx)(\"span\",{className:\"item-meta\",children:s})]}),h]})}var T=Y(P(),1);function My(e,t){return{threadId:e.threadId,sender:e.sender,subject:e.subject,snippet:e.snippet,receivedAt:e.date,accountId:t}}var Ay=[{id:\"attachment\",label:\"Has attachment\",term:\"has:attachment\"},{id:\"unread\",label:\"Unread\",term:\"is:unread\"},{id:\"starred\",label:\"Starred\",term:\"is:starred\"},{id:\"week\",label:\"Last 7 days\",term:\"newer_than:7d\"}];function Zf(e){return e.split(/\\s+/).filter(t=>t&&!t.includes(\":\"))}function Dy({list:e}){let t=hn(j),n=lc(\"threads\",j),a=vn(\"list\",null,j)?.data,{items:l}=Se(),i=Ee(),{settings:o}=yt(),u=Ve(),r=Le(),c=xe(\"loadMore\",null,j),[m,d]=(0,rt.useState)(!1),[f,s]=(0,rt.useState)(!1),h=i.current,y=h?.id??\"unknown\",S=e.id===\"search\",p=e.id===yn.id,g=Ja.some(q=>q.category&&q.id===e.id);(0,rt.useEffect)(()=>{a&&!S&&gc(e.id,a.unread??0)},[a,e.id,S,i.current?.id]),(0,rt.useEffect)(()=>{s(!1)},[e.path]);let v=n.order.map(q=>n.get(q)?.data).filter(q=>!!q),x=v.filter(q=>q.selected),w=t.status===\"ready\"&&!t.stale,U=w&&!n.ephemeral,C=q=>i.byId(q.accountId)?.showInInbox!==!1,D=p?l.filter(q=>dy(q,r)&&!q.returned&&C(q)):[],Q=p?l.filter(q=>Fa(q,r)&&C(q)):[],O=t.status===\"loading\"||t.stale,ne=fc(!v.length&&O),Ne=OS(O),he=async()=>{d(!0);let q=await c(null);d(!1),q.outcome!==\"observed\"&&s(!0)},K;return!v.length&&O?K=(0,T.jsx)(nn,{label:`Loading ${e.title}`}):v.length?K=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(\"ul\",{className:`thread-list${ne?\" reveal\":\"\"}`,\"aria-label\":e.title,children:v.map(q=>(0,T.jsx)(HS,{row:q,list:e,linked:Vi(l,q.threadId),account:i.accounts.length>1?h?.color??null:null,selecting:x.length>0,actionable:U,terms:S?Zf(e.query??\"\"):[],accountId:y,swipeLeft:o.swipeLeft,swipeRight:o.swipeRight},q.threadId))}),(0,T.jsxs)(\"div\",{className:\"list-end\",children:[f?(0,T.jsx)(\"p\",{className:\"muted\",children:\"No more emails here.\"}):(0,T.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:m||!U,onClick:()=>{he()},children:m?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(\"span\",{className:\"spinner\",\"aria-hidden\":\"true\"}),\" Loading\\u2026\"]}):\"Load older emails\"}),(0,T.jsxs)(\"button\",{type:\"button\",className:\"link-button\",disabled:Ne.active,onClick:Ne.run,children:[(0,T.jsx)(E,{name:\"refresh\"}),\" Refresh\"]})]})]}):K=(0,T.jsxs)(kt,{title:S?\"No results\":`Nothing in ${e.title}`,icon:S?\"search\":\"inbox\",children:[(0,T.jsx)(\"p\",{children:a?.empty??(S?\"Try different words or remove a filter.\":\"You're all caught up.\")}),(0,T.jsx)(\"div\",{className:\"row-buttons\",children:(0,T.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:Ne.run,children:[(0,T.jsx)(E,{name:\"refresh\"}),\" Refresh\"]})})]}),(0,T.jsxs)(\"div\",{className:\"screen-frame\",children:[x.length>0?(0,T.jsx)(BS,{rows:x,accountId:y}):S?(0,T.jsx)(LS,{query:e.query??\"\"}):(0,T.jsx)(_S,{title:e.title}),(0,T.jsx)(dc,{active:O&&v.length>0||m||Ne.active}),(0,T.jsxs)(Xe,{className:\"screen\",\"aria-busy\":!w,...Ne.handlers,children:[(0,T.jsx)(kS,{state:Ne}),g&&!S&&(0,T.jsx)(RS,{current:e.id}),!p&&!g&&!S&&(0,T.jsx)(\"h1\",{className:\"list-title\",children:e.title}),S&&(0,T.jsx)(GS,{query:e.query??\"\",count:v.length,complete:f}),D.length>0&&(0,T.jsx)(YS,{items:D}),Q.length>0&&(0,T.jsx)(jS,{items:Q,all:l,now:r}),S&&(0,T.jsx)(qS,{query:e.query??\"\",items:l}),K,t.status===\"error\"&&v.length>0&&(0,T.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"})]}),!x.length&&(0,T.jsxs)(\"button\",{type:\"button\",className:\"fab\",onClick:()=>u.compose(),\"aria-label\":\"Compose\",children:[(0,T.jsx)(E,{name:\"pencil\"}),(0,T.jsx)(\"span\",{children:\"Compose\"})]})]})}var Qf=72,CS=112;function OS(e){let{reload:t}=I(),[n,a]=(0,rt.useState)(0),[l,i]=(0,rt.useState)(!1),o=(0,rt.useRef)(null),u=(0,rt.useRef)(!1),r=()=>{l||(i(!0),u.current=!1,t(j))};return(0,rt.useEffect)(()=>{if(!l)return;if(e)u.current=!0;else if(u.current){i(!1);return}let m=window.setTimeout(()=>i(!1),1e4);return()=>window.clearTimeout(m)},[l,e]),{pull:n,active:l,run:r,handlers:{onTouchStart:m=>{o.current=m.currentTarget.scrollTop<=0&&!l?m.touches[0].clientY:null},onTouchMove:m=>{if(o.current===null)return;let d=m.touches[0].clientY-o.current;if(d<=0||m.currentTarget.scrollTop>0){o.current=null,a(0);return}a(Math.min(CS,d*.5))},onTouchEnd:()=>{o.current!==null&&n>=Qf&&r(),o.current=null,a(0)},onTouchCancel:()=>{o.current=null,a(0)}}}}function kS({state:e}){let{pull:t,active:n}=e;if(!t&&!n)return null;let a=n?56:t,l=Math.min(1,t/Qf);return(0,T.jsx)(\"div\",{className:`pull-indicator${n?\" active\":\"\"}${t>=Qf?\" armed\":\"\"}`,\"aria-hidden\":\"true\",style:{transform:`translate(-50%, ${a}px)`,opacity:n?1:l},children:(0,T.jsx)(\"span\",{style:n?void 0:{transform:`rotate(${l*270}deg)`},children:(0,T.jsx)(E,{name:\"refresh\"})})})}function _S({title:e}){let t=Ve(),{navigate:n}=I(),{current:a,accounts:l}=Ee();return(0,T.jsx)(\"header\",{className:\"mail-header\",children:(0,T.jsxs)(\"div\",{className:\"search-pill\",children:[(0,T.jsx)(te,{icon:\"menu\",label:\"Menu\",onClick:()=>t.menu()}),(0,T.jsx)(\"button\",{type:\"button\",className:\"search-pill-text\",onClick:()=>n({screen:\"search\"}),children:`Search in ${e===\"Primary\"?\"mail\":e}`}),(0,T.jsxs)(\"button\",{type:\"button\",className:\"me\",\"aria-label\":`Account ${a?.email??\"\"}`,onClick:()=>n({screen:\"accounts\"}),children:[(0,T.jsx)(\"span\",{className:\"me-avatar\",style:{borderColor:a?.color??\"var(--accent)\"},children:(a?.name??a?.email??\"?\").slice(0,2).toUpperCase()}),l.length>1&&(0,T.jsx)(\"span\",{className:\"me-badge\",children:l.length})]})]})})}function RS({current:e}){let t=Ve(),n=Ja.filter(a=>a.category);return(0,T.jsx)(\"nav\",{className:\"category-chips\",\"aria-label\":\"Categories\",children:n.map(a=>(0,T.jsx)(US,{id:a.id,title:a.title,current:e===a.id,onClick:()=>e!==a.id&&t.list(a.path,\"replace\")},a.id))})}function US({id:e,title:t,current:n,onClick:a}){let l=hc(e);return(0,T.jsxs)(\"button\",{type:\"button\",className:\"category-chip\",\"aria-current\":n?\"page\":void 0,onClick:a,children:[t,l?(0,T.jsx)(\"span\",{className:\"count\",children:l}):null]})}var Vf=.3,HS=(0,rt.memo)(function({row:t,list:n,linked:a,account:l,selecting:i,actionable:o,terms:u,accountId:r,swipeLeft:c,swipeRight:m}){let d=Ve(),{navigate:f}=I(),{show:s}=qe(),h=xe(\"setStarred\",\"threads\",j),y=xe(\"setSelected\",\"threads\",j),S=xe(\"archive\",\"threads\",j),p=ic(\"threads\",t.threadId,j),g=(J,Ie,k)=>{let ue=[...p].reverse().find(Nt=>Nt.name===J);return ue?ue.args[Ie]??k:k},v=g(\"setStarred\",\"starred\",t.starred),x=g(\"setSelected\",\"selected\",t.selected),[w,U]=(0,rt.useState)(0),[C,D]=(0,rt.useState)(!1),Q=(0,rt.useRef)(null),O=(0,rt.useRef)(null),ne=a.filter(J=>!J.done&&!J.snooze),Ne=a.find(J=>J.snooze&&!J.done),he=(J,Ie=-1)=>{if(J===\"archive\"){let k=O.current,ue=k?.offsetWidth??360,Nt=du()||!k;U(Ie*ue);let Gl=Nt?null:k.animate([{height:`${k.offsetHeight}px`},{height:\"0px\"}],{duration:220,delay:180,easing:\"cubic-bezier(.2, 0, 0, 1)\",fill:\"forwards\"});S(t.threadId).then(jt=>{if(jt.outcome===\"observed\"){s({text:\"Archived\"});return}Gl?.cancel(),U(0),s({text:\"Couldn't archive. Try again.\"})})}else J===\"remind\"&&f({screen:\"add\",params:{type:\"reminder\",emails:JSON.stringify([My(t,r)]),archive:\"row\"}})},K=J=>{!o||i||J.pointerType===\"mouse\"&&J.button!==0||(Q.current={x:J.clientX,y:J.clientY,id:J.pointerId,swiping:!1})},q=J=>{let Ie=Q.current;if(!Ie||Ie.id!==J.pointerId)return;let k=J.clientX-Ie.x,ue=J.clientY-Ie.y;if(!Ie.swiping){if(Math.abs(ue)>12){Q.current=null;return}if(Math.abs(k)<14)return;Ie.swiping=!0,D(!0),J.currentTarget.setPointerCapture(J.pointerId)}let Nt=k>0&&m!==\"none\"||k<0&&c!==\"none\";U(Nt?k:0)},ln=()=>{let J=Q.current;if(Q.current=null,!J?.swiping)return;D(!1);let Ie=O.current?.offsetWidth??360,k=w,ue=k>0?m:c;if(Math.abs(k)>Ie*Vf&&ue===\"archive\"){he(ue,Math.sign(k));return}U(0),Math.abs(k)>Ie*Vf&&he(ue)},Cn=`${t.unread?\"Unread. \":\"\"}${t.sender}. ${t.subject}. ${t.date}`,H=w>0?m:w<0?c:\"\",_t=Math.abs(w)>(O.current?.offsetWidth??360)*Vf;return(0,T.jsxs)(\"li\",{ref:O,className:`thread ${t.unread?\"unread\":\"\"} ${x?\"selected\":\"\"}`,children:[w!==0&&(0,T.jsxs)(\"div\",{className:`swipe-under ${w>0?\"right\":\"left\"} ${H}${_t?\" armed\":\"\"}`,\"aria-hidden\":\"true\",children:[(0,T.jsx)(E,{name:H===\"archive\"?\"archive\":\"bell\"}),(0,T.jsx)(\"span\",{children:H===\"archive\"?\"Archive\":\"Remind\"})]}),(0,T.jsxs)(\"div\",{className:`thread-inner${C?\" dragging\":\"\"}`,style:w?{transform:`translateX(${w}px)`}:void 0,onPointerDown:K,onPointerMove:q,onPointerUp:ln,onPointerCancel:()=>{Q.current=null,D(!1),U(0)},children:[(0,T.jsx)(\"button\",{type:\"button\",className:\"avatar-button\",\"aria-label\":x?`Deselect ${t.subject}`:`Select ${t.subject}`,\"aria-pressed\":x,disabled:!o,onClick:()=>{y(t.threadId,{selected:!x})},children:(0,T.jsx)(Wa,{name:t.sender,selected:x})}),(0,T.jsxs)(\"button\",{type:\"button\",className:\"thread-main\",\"aria-label\":Cn,onClick:()=>i?void y(t.threadId,{selected:!x}):d.thread(t.threadId,n.path),children:[(0,T.jsxs)(\"span\",{className:\"thread-line\",children:[l&&(0,T.jsx)(Ze,{color:l}),(0,T.jsx)(\"span\",{className:\"sender\",children:t.sender}),(0,T.jsx)(\"span\",{className:\"date\",children:t.date})]}),(0,T.jsx)(\"span\",{className:\"subject\",children:(0,T.jsx)(ou,{text:t.subject,terms:u})}),(0,T.jsx)(\"span\",{className:\"snippet\",children:(0,T.jsx)(ou,{text:t.snippet,terms:u})}),(ne.length>0||Ne||t.attachment||t.labels.length>0)&&(0,T.jsxs)(\"span\",{className:\"thread-chips\",children:[ne.map(J=>(0,T.jsx)(\"span\",{className:`chip-small ${J.type}`,children:J.type===\"todo\"?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(E,{name:\"check\",size:12}),\" To-do added\"]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(E,{name:\"bell\",size:12}),\" \",J.dueDate?Fn(J):\"Reminder\"]})},J.id)).slice(0,2),Ne&&(0,T.jsxs)(\"span\",{className:\"chip-small\",children:[(0,T.jsx)(E,{name:\"clock\",size:12}),\" \",Fn(Ne)]}),t.attachment&&(0,T.jsxs)(\"span\",{className:\"chip-small attachment\",children:[(0,T.jsx)(E,{name:\"clip\",size:12}),\" Attachment\"]}),t.labels.filter(J=>J!==\"Inbox\"||u.length>0).slice(0,2).map(J=>(0,T.jsx)(\"span\",{className:\"chip-small label\",children:J},J))]})]}),(0,T.jsx)(te,{icon:\"star\",label:v?\"Unstar\":\"Star\",filled:v,pressed:v,className:v?\"star on\":\"star\",disabled:!o,onClick:()=>{h(t.threadId,{starred:!v})}})]})]})});function BS({rows:e,accountId:t}){let n=xe(\"clearSelection\",null,j),a=xe(\"archiveSelected\",null,j),l=xe(\"trashSelected\",null,j),{navigate:i}=I(),{show:o}=qe(),u=(r,c)=>{r(null).then(m=>o({text:m.outcome===\"observed\"?c:m.message??\"Couldn't finish. Try again.\"}))};return(0,T.jsxs)(\"header\",{className:\"selection-bar\",children:[(0,T.jsx)(te,{icon:\"close\",label:\"Clear selection\",onClick:()=>{n(null)}}),(0,T.jsxs)(\"h1\",{children:[e.length,\" selected\"]}),(0,T.jsx)(\"span\",{className:\"spacer\"}),(0,T.jsx)(te,{icon:\"archive\",label:\"Archive selected\",onClick:()=>u(a,`${e.length} archived`)}),(0,T.jsx)(te,{icon:\"trash\",label:\"Delete selected\",onClick:()=>u(l,`${e.length} moved to Trash`)}),(0,T.jsx)(te,{icon:\"bell\",label:\"Save for later\",onClick:()=>i({screen:\"bulk\",params:{emails:JSON.stringify(e.map(r=>My(r,t)))}})})]})}function LS({query:e}){let{navigate:t,back:n}=I();return(0,T.jsx)(\"header\",{className:\"mail-header\",children:(0,T.jsxs)(\"div\",{className:\"search-pill\",children:[(0,T.jsx)(te,{icon:\"back\",label:\"Back\",onClick:n}),(0,T.jsx)(\"button\",{type:\"button\",className:\"search-pill-text filled\",onClick:()=>t({screen:\"search\",params:{q:e}}),children:e}),(0,T.jsx)(te,{icon:\"close\",label:\"Clear search\",onClick:()=>t({screen:\"search\",params:{q:\"\"}})})]})})}function GS({query:e,count:t,complete:n}){let a=Ve(),l=e.split(/\\s+/).filter(Boolean),i=r=>{let c=l.includes(r)?l.filter(m=>m!==r):[...l,r];c.length&&a.search(c.join(\" \"),\"replace\")},o=Zf(e).join(\" \"),u=Ay.filter(r=>l.includes(r.term));return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(\"nav\",{className:\"filter-chips\",\"aria-label\":\"Filters\",children:Ay.map(r=>(0,T.jsxs)(\"button\",{type:\"button\",className:\"filter-chip\",\"aria-pressed\":l.includes(r.term),onClick:()=>i(r.term),children:[l.includes(r.term)&&(0,T.jsx)(E,{name:\"check\",size:14}),r.label]},r.id))}),(0,T.jsxs)(\"p\",{className:\"results-line\",children:[(0,T.jsxs)(\"strong\",{children:[t,n?\"\":t?\"+\":\"\",\" results\"]}),o?` for \\u201C${o}\\u201D`:\"\",u.length?` \\xB7 ${u.map(r=>r.label.toLowerCase()).join(\", \")}`:\"\",(0,T.jsx)(\"span\",{className:\"muted\",children:\" \\xB7 Most recent\"})]})]})}function qS({query:e,items:t}){let n=el(),a=Le(),l=Zf(e).map(o=>o.toLowerCase()),i=l.length?t.filter(o=>!o.snooze&&l.every(u=>`${o.title} ${o.note} ${o.link?.subject??\"\"} ${o.link?.sender??\"\"}`.toLowerCase().includes(u))).slice(0,4):[];return i.length?(0,T.jsxs)(\"section\",{className:\"also\",children:[(0,T.jsx)(\"h2\",{className:\"section-label\",children:\"Also in your to-do\"}),(0,T.jsx)(\"ul\",{className:\"item-list card\",children:i.map(o=>(0,T.jsx)(tl,{item:o,now:a,onOpen:()=>n(o.id)},o.id))})]}):null}function YS({items:e}){let t=Ve(),{save:n,complete:a}=Se(),{show:l}=qe(),i=o=>{(o.snooze?a(o,!0):n({...o,returned:!0})).then(()=>l({text:\"Dismissed\",undo:()=>n(o)}),()=>l({text:\"Couldn't save. Try again.\"}))};return(0,T.jsxs)(\"section\",{className:\"back-section\",\"aria-label\":\"Back in your inbox\",children:[(0,T.jsxs)(\"h2\",{className:\"section-label\",children:[(0,T.jsx)(E,{name:\"bell\",size:14}),\" Back in your inbox\"]}),(0,T.jsx)(\"ul\",{className:\"back-list\",children:e.slice(0,5).map(o=>(0,T.jsxs)(\"li\",{className:\"back-row\",children:[(0,T.jsxs)(\"button\",{type:\"button\",className:\"back-main\",onClick:()=>{n({...o,returned:!0}),o.link?.threadId&&t.email(o.link.threadId,o.accountId)},children:[(0,T.jsx)(\"strong\",{children:o.link?.subject??o.title}),(0,T.jsxs)(\"span\",{children:[o.snooze?\"Snoozed\":o.title,\" \\xB7 \",o.link?.sender]})]}),(0,T.jsx)(te,{icon:\"check\",label:`Dismiss ${o.title}`,onClick:()=>i(o)})]},o.id))})]})}function jS({items:e,all:t,now:n}){let{navigate:a}=I(),l=e.filter(c=>c.type===\"todo\").length,i=e.length-l,o=t.filter(c=>c.done&&c.completedAt&&pe(new Date(c.completedAt))===pe(n)).length,u=o/(o+e.length),r=[...e].sort((c,m)=>(c.dueTime??\"\").localeCompare(m.dueTime??\"\")).slice(0,2);return(0,T.jsxs)(\"section\",{className:\"today-card\",children:[(0,T.jsxs)(\"button\",{type:\"button\",className:\"today-head\",onClick:()=>a({screen:\"todo\",mode:\"root\"}),children:[(0,T.jsxs)(\"span\",{children:[(0,T.jsx)(\"strong\",{children:\"Today\"}),\" \",(0,T.jsx)(\"span\",{className:\"muted\",children:[l&&`${l} to-do${l>1?\"s\":\"\"}`,i&&`${i} reminder${i>1?\"s\":\"\"}`].filter(Boolean).join(\" \\xB7 \")})]}),(0,T.jsx)(E,{name:\"right\"})]}),(0,T.jsx)(\"ul\",{children:r.map(c=>(0,T.jsx)(XS,{item:c,now:n},c.id))}),(0,T.jsx)(\"div\",{className:\"progress\",role:\"progressbar\",\"aria-label\":\"Done today\",\"aria-valuemin\":0,\"aria-valuemax\":100,\"aria-valuenow\":Math.round(u*100),children:(0,T.jsx)(\"span\",{style:{width:`${Math.round(u*100)}%`}})})]})}function XS({item:e,now:t}){let{navigate:n}=I(),{checking:a,toggle:l}=Xf(e);return(0,T.jsxs)(\"li\",{className:`today-row${a?\" is-done\":\"\"}`,children:[(0,T.jsx)(fu,{item:e,onToggle:l,checking:a}),(0,T.jsx)(\"button\",{type:\"button\",className:\"today-title\",onClick:()=>n({screen:\"item\",params:{id:e.id}}),children:e.title}),(0,T.jsx)(\"span\",{className:`tag ${e.type===\"reminder\"?\"reminder\":\"due\"}`,children:e.dueTime?Fn(e,t).replace(/^Today /,\"by \"):Fn(e,t)})]})}var ha=Y(Ke(),1);var z=Y(P(),1),If={archive:\"Archive\",trash:\"Delete\",deleteForever:\"Delete forever\",notSpam:\"Not spam\",moveToInbox:\"Move to inbox\",mute:\"Mute\",markUnread:\"Mark unread\",spam:\"Report spam\"},VS={archive:\"Archived\",trash:\"Moved to Trash\",deleteForever:\"Deleted forever\",notSpam:\"Moved to inbox\",moveToInbox:\"Moved to inbox\",mute:\"Muted\",markUnread:\"Marked unread\",spam:\"Reported as spam\"};function zy({threadId:e,list:t}){let n=hn(j),l=vn(\"conversation\",null,j)?.data,{items:i}=Se(),{settings:o}=yt(),u=Ee(),{back:r,navigate:c}=I(),{show:m}=qe(),d=el(),f=Le(),[s,h]=(0,ha.useState)(null),y=n.status===\"ready\"&&!n.stale&&l!==void 0,S=Vi(i,e).filter(k=>!k.snooze||!k.done),p=u.current,{save:g}=Se();(0,ha.useEffect)(()=>{for(let k of S)k.bringBack&&!k.returned&&k.dueDate&&new Date(`${k.dueDate}T${k.dueTime??\"00:00\"}`)<=f&&g({...k,returned:!0})},[S.length]);let v={archive:xe(\"archive\",\"conversation\",j),trash:xe(\"trash\",\"conversation\",j),deleteForever:xe(\"deleteForever\",\"conversation\",j),notSpam:xe(\"notSpam\",\"conversation\",j),moveToInbox:xe(\"moveToInbox\",\"conversation\",j),mute:xe(\"mute\",\"conversation\",j),markUnread:xe(\"markUnread\",\"conversation\",j),spam:xe(\"spam\",\"conversation\",j)},x=xe(\"setStarred\",\"conversation\",j),w=xe(\"respond\",\"conversation\",j);(0,ha.useEffect)(()=>{!y||cu.threadId!==e||(cu.threadId=null,w(null,{mode:\"reply\"}))},[y,e]);let[U,C]=(0,ha.useState)(null),D=k=>{h(null),C(k),v[k](null).then(ue=>{C(null),m({text:ue.outcome===\"observed\"?VS[k]??\"Done\":ue.message??\"Couldn't finish. Try again.\"})})},Q=[...ic(\"conversation\",null,j)].reverse().find(k=>k.name===\"setStarred\"),O=Q?!!Q.args.starred:l?.starred??!1,ne=fc(!l),Ne=()=>{if(!l)return null;let k=l.messages[0],ue=l.messages[l.messages.length-1];return{threadId:e,subject:l.subject,sender:k?.sender??\"\",snippet:(ue?.snippet||QS(ue?.body??[])).slice(0,200),receivedAt:ue?.time??\"\",accountId:p?.id??\"unknown\"}},he=k=>{let ue=Ne();h(null),ue&&c({screen:\"add\",params:{type:k,emails:JSON.stringify([ue]),archive:\"conversation\"}})},{saveMany:K,removeMany:q}=Se(),ln=async k=>{let ue=Ne();if(h(null),!ue)return;let Nt=_l(\"reminder\",ue,p?.id??\"unknown\",{title:Wn(ue.subject),dueDate:pe(k),dueTime:ut(k)});try{await K([Nt]),m({text:`Reminder set \\xB7 ${$n(Nt,f)}`,undo:()=>q([Nt.id]),view:()=>d(Nt.id)})}catch{m({text:\"Couldn't save. Try again.\"})}},Cn;l?Cn=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\"div\",{className:\"subject-row\",children:[(0,z.jsx)(\"h1\",{className:\"conversation-subject\",children:l.subject}),(0,z.jsx)(te,{icon:\"star\",label:O?\"Unstar\":\"Star\",filled:O,pressed:O,className:O?\"star on\":\"star\",disabled:!y,onClick:()=>{x(null,{starred:!O})}})]}),(0,z.jsxs)(\"div\",{className:\"conversation-meta\",children:[p&&(0,z.jsxs)(\"span\",{className:\"account-line\",children:[(0,z.jsx)(Ze,{color:p.color}),\" \",p.name]}),l.labels.slice(0,3).map(k=>(0,z.jsx)(\"span\",{className:\"chip-small label\",children:k},k)),l.messages.length>1&&(0,z.jsxs)(\"span\",{className:\"muted\",children:[l.messages.length,\" messages\"]})]}),S.length>0&&(0,z.jsxs)(\"section\",{className:\"linked-items\",\"aria-label\":\"Linked items\",children:[(0,z.jsx)(\"h2\",{className:\"section-label\",children:S.length===1?\"1 item linked\":`${S.length} items linked`}),(0,z.jsx)(\"ul\",{className:\"item-list card\",children:S.map(k=>(0,z.jsx)(tl,{item:k,now:f,onOpen:()=>d(k.id)},k.id))})]}),(0,z.jsx)(\"ol\",{className:\"messages\",children:l.messages.map((k,ue)=>(0,z.jsx)(ZS,{message:k,last:ue===l.messages.length-1},k.id))}),(0,z.jsxs)(\"div\",{className:\"reply-row\",children:[(0,z.jsxs)(\"button\",{type:\"button\",className:\"outline\",disabled:!y,onClick:()=>{w(null,{mode:\"reply\"})},children:[(0,z.jsx)(E,{name:\"reply\"}),\" Reply\"]}),(0,z.jsxs)(\"button\",{type:\"button\",className:\"outline\",disabled:!y,onClick:()=>{w(null,{mode:\"replyAll\"})},children:[(0,z.jsx)(E,{name:\"replyAll\"}),\" Reply all\"]}),(0,z.jsxs)(\"button\",{type:\"button\",className:\"outline\",disabled:!y,onClick:()=>{w(null,{mode:\"forward\"})},children:[(0,z.jsx)(E,{name:\"forward\"}),\" Forward\"]})]})]}):Cn=n.status===\"error\"?(0,z.jsx)(kt,{title:\"Couldn't open this email\",role:\"alert\",icon:\"alert\",children:(0,z.jsx)(\"p\",{children:n.error?.message})}):(0,z.jsx)(nn,{label:\"Loading email\",kind:\"email\",rows:6});let H=l?.commands??[],_t=H.includes(\"moveToInbox\")?[\"moveToInbox\",\"trash\",\"markUnread\"]:[\"archive\",\"trash\",\"markUnread\"],J=H.filter(k=>!_t.includes(k)),Ie={archive:\"archive\",trash:\"trash\",markUnread:\"unread\",moveToInbox:\"inbox\"};return(0,z.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,z.jsxs)(\"header\",{className:\"top-bar\",children:[(0,z.jsx)(te,{icon:\"back\",label:`Back to ${t.title}`,onClick:r}),(0,z.jsx)(\"span\",{className:\"spacer\"}),_t.map(k=>(0,z.jsx)(te,{icon:Ie[k],label:If[k],disabled:!y||U!==null||!H.includes(k),onClick:()=>D(k)},k)),(0,z.jsx)(te,{icon:\"clock\",label:\"Snooze\",disabled:!y||U!==null,onClick:()=>he(\"snooze\")}),(0,z.jsx)(te,{icon:\"more\",label:\"More\",disabled:!y||U!==null,pressed:s===\"more\",onClick:()=>h(s===\"more\"?null:\"more\")})]}),s===\"more\"&&(0,z.jsxs)(iu,{onClose:()=>h(null),className:\"more-menu\",children:[J.map(k=>(0,z.jsx)(\"button\",{type:\"button\",role:\"menuitem\",onClick:()=>D(k),children:If[k]},k)),(0,z.jsx)(\"button\",{type:\"button\",role:\"menuitem\",onClick:()=>{h(null),c({screen:\"settings\"})},children:\"Gmail Only settings\"})]}),(0,z.jsx)(dc,{active:U!==null||!!l&&n.stale,label:U?If[U]:\"Updating\"}),(0,z.jsxs)(Xe,{className:`screen conversation${ne&&l?\" reveal\":\"\"}`,\"aria-busy\":!y,children:[o.showAddTo&&(0,z.jsxs)(\"div\",{className:\"add-to\",children:[(0,z.jsxs)(\"button\",{type:\"button\",className:\"add-pill\",\"aria-expanded\":s===\"add\",disabled:!l,onClick:()=>h(s===\"add\"?null:\"add\"),children:[(0,z.jsx)(E,{name:\"plus\"}),\" Add to\\u2026 \",(0,z.jsx)(E,{name:s===\"add\"?\"up\":\"down\"})]}),(0,z.jsx)(\"span\",{className:\"muted\",children:\"Save this email as a reminder or to-do\"})]}),s===\"add\"&&(0,z.jsxs)(iu,{onClose:()=>h(null),className:\"add-menu\",children:[(0,z.jsxs)(\"button\",{type:\"button\",role:\"menuitem\",className:\"add-option\",onClick:()=>he(\"reminder\"),children:[(0,z.jsx)(\"span\",{className:\"tile reminder\",children:(0,z.jsx)(E,{name:\"bell\"})}),(0,z.jsxs)(\"span\",{children:[(0,z.jsx)(\"strong\",{children:\"Add a reminder\"}),(0,z.jsx)(\"small\",{children:\"Get notified at a set time\"})]})]}),(0,z.jsxs)(\"button\",{type:\"button\",role:\"menuitem\",className:\"add-option\",onClick:()=>he(\"todo\"),children:[(0,z.jsx)(\"span\",{className:\"tile todo\",children:(0,z.jsx)(E,{name:\"check2\"})}),(0,z.jsxs)(\"span\",{children:[(0,z.jsx)(\"strong\",{children:\"Add to to-do\"}),(0,z.jsx)(\"small\",{children:\"A task to finish, due date optional\"})]})]}),(0,z.jsxs)(\"div\",{className:\"quick-row\",children:[(0,z.jsx)(\"span\",{className:\"section-label\",children:\"Quick\"}),cy(o.defaultReminderTime,f).map(k=>(0,z.jsxs)(\"button\",{type:\"button\",className:\"chip\",onClick:()=>{ln(k.date)},children:[(0,z.jsx)(E,{name:\"clock\",size:14}),\" \",k.label]},k.id))]})]}),Cn]})]})}var QS=e=>e.map(t=>t.text).join(\"\").replace(/\\s+/g,\" \").trim();function ZS({message:e,last:t}){let{navigate:n}=I(),a=xe(\"expandMessage\",\"conversation\",j),[l,i]=(0,ha.useState)(t||e.body.length>0),[o,u]=(0,ha.useState)(!1),[r,c]=(0,ha.useState)(null),m=e.body.length>0;return(0,z.jsxs)(\"li\",{className:\"message\",children:[(0,z.jsxs)(\"button\",{type:\"button\",className:\"message-head\",\"aria-expanded\":l&&m,\"aria-busy\":o,disabled:o,onClick:()=>{if(m){i(!l);return}u(!0),c(null);let f=(s,h)=>{u(!1),s?i(!0):c(h??\"Couldn't open this message. Try again.\")};a(null,{id:e.id}).then(s=>f(s.outcome===\"observed\",s.message),()=>f(!1))},children:[(0,z.jsx)(Wa,{name:e.sender,size:36}),(0,z.jsxs)(\"span\",{className:\"message-who\",children:[(0,z.jsx)(\"strong\",{children:e.sender}),(0,z.jsxs)(\"span\",{className:\"muted\",children:[e.recipients,e.time&&e.time!==e.recipients?` \\xB7 ${e.time}`:\"\"]})]})]}),l&&m?(0,z.jsxs)(\"div\",{className:\"message-body\",dir:\"auto\",children:[e.body.map((f,s)=>f.href?(0,z.jsx)(\"a\",{href:f.href,onClick:h=>{h.preventDefault(),n({url:f.href})},children:f.text},s):f.bold?(0,z.jsx)(\"strong\",{children:f.text},s):(0,z.jsx)(\"span\",{children:f.text},s)),e.truncated&&(0,z.jsx)(\"p\",{className:\"muted\",children:\"This message is long. The rest is in Gmail.\"})]}):(0,z.jsx)(\"p\",{className:\"message-snippet\",children:o?\"Opening\\u2026\":r??e.snippet}),e.attachments.length>0&&(0,z.jsx)(\"ul\",{className:\"attachments\",children:e.attachments.map((f,s)=>{let h=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\"span\",{className:\"file-tile\",children:(f.name.split(\".\").pop()??\"file\").slice(0,4).toUpperCase()}),(0,z.jsxs)(\"span\",{children:[(0,z.jsx)(\"strong\",{children:f.name}),(0,z.jsx)(\"small\",{children:[f.size,f.href?\"Opens in Gmail\":\"\"].filter(Boolean).join(\" \\xB7 \")})]})]});return(0,z.jsx)(\"li\",{children:f.href?(0,z.jsx)(\"a\",{className:\"attachment-card\",href:f.href,onClick:y=>{y.preventDefault(),n({url:f.href})},children:h}):(0,z.jsx)(\"span\",{className:\"attachment-card\",children:h})},s)})})]})}var Ul=Y(Ke(),1);var W=Y(P(),1),IS=3,Kf=\"10:00\";function KS(e){let t=_e(vt(e),IS);for(;t.getDay()===0||t.getDay()===6;)t=_e(t,1);return ot(t,Kf)}function Cy(){let e=hn(j),t=vn(\"compose\",null,j)?.data,n=xe(\"fill\",\"compose\",j),a=xe(\"discard\",\"compose\",j),{viewWebsite:l,back:i}=I(),{current:o}=Ee(),{saveMany:u,removeMany:r}=Se(),{show:c}=qe(),m=Le(),[d,f]=(0,Ul.useState)({to:\"\",cc:\"\",bcc:\"\",subject:\"\"}),[s,h]=(0,Ul.useState)(!1),[y,S]=(0,Ul.useState)(!1),[p,g]=(0,Ul.useState)(!1),v=e.status===\"ready\"&&!e.stale&&t!==void 0;(0,Ul.useEffect)(()=>{!t||s||(f({to:t.to,cc:t.cc,bcc:t.bcc,subject:t.subject}),(t.cc||t.bcc)&&S(!0),h(!0))},[t,s]);let x=/^re:/i.test(t?.subject??\"\"),w=/^fwd?:/i.test(t?.subject??\"\"),U=x?\"Reply\":w?\"Forward\":\"New message\",C=KS(m),D=()=>n(null,d);async function Q(){if((await D()).outcome!==\"observed\"&&c({text:\"Couldn't copy the fields to Gmail. Check them there.\"}),p){let he=d.subject.trim()||\"(no subject)\",K=_l(\"todo\",{threadId:null,sender:d.to.trim()||\"Recipient\",subject:he,snippet:\"Sent by you\",receivedAt:\"\",accountId:o?.id??\"unknown\"},o?.id??\"unknown\",{title:`Follow up: ${Wn(he)}`.slice(0,200),dueDate:pe(C),dueTime:Kf,notify:!0,bringBack:!1});try{await u([K]),c({text:`Follow-up added for ${Jn(C)}`,undo:()=>r([K.id])})}catch{c({text:\"Couldn't save the follow-up.\"})}}l()}async function O(){(await a(null)).outcome!==\"observed\"&&i()}if(!t)return(0,W.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,W.jsxs)(\"header\",{className:\"top-bar\",children:[(0,W.jsx)(te,{icon:\"close\",label:\"Close\",onClick:i}),(0,W.jsx)(\"h1\",{children:\"Compose\"})]}),(0,W.jsx)(nn,{label:\"Opening compose\",kind:\"text\",rows:4})]});let ne=(Ne,he,K=\"text\")=>(0,W.jsxs)(\"label\",{className:\"compose-field\",children:[(0,W.jsx)(\"span\",{children:he}),(0,W.jsx)(\"input\",{type:K,value:d[Ne],inputMode:K===\"email\"?\"email\":void 0,autoComplete:\"off\",onChange:q=>f(ln=>({...ln,[Ne]:q.target.value})),onBlur:()=>{D()}})]});return(0,W.jsxs)(\"div\",{className:\"screen-frame compose-screen\",children:[(0,W.jsxs)(\"header\",{className:\"top-bar\",children:[(0,W.jsx)(te,{icon:\"close\",label:\"Discard draft\",onClick:()=>{O()}}),(0,W.jsx)(\"h1\",{children:U}),(0,W.jsx)(\"span\",{className:\"spacer\"}),(0,W.jsxs)(\"button\",{type:\"button\",className:\"accent send\",disabled:!v,onClick:()=>{Q()},children:[(0,W.jsx)(E,{name:\"send\"}),\" Continue\"]})]}),(0,W.jsxs)(Xe,{className:\"screen\",\"aria-busy\":!v,children:[(0,W.jsxs)(\"div\",{className:\"compose-card\",children:[(0,W.jsxs)(\"div\",{className:\"compose-field from\",children:[(0,W.jsx)(\"span\",{children:\"From\"}),o&&(0,W.jsx)(Ze,{color:o.color}),(0,W.jsx)(\"span\",{className:\"from-value\",children:t.from||o?.email})]}),(0,W.jsxs)(\"div\",{className:\"compose-to\",children:[ne(\"to\",\"To\",\"email\"),!y&&(0,W.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:()=>S(!0),children:\"Cc/Bcc\"})]}),y&&(0,W.jsxs)(W.Fragment,{children:[ne(\"cc\",\"Cc\",\"email\"),ne(\"bcc\",\"Bcc\",\"email\")]}),ne(\"subject\",\"Subject\"),(0,W.jsxs)(\"div\",{className:\"compose-body-note\",children:[(0,W.jsx)(E,{name:\"pencil\"}),(0,W.jsxs)(\"p\",{children:[\"Write your message in Gmail. Gmail Only copies the fields above, then opens Gmail's compose so you can write and send.\",t.body?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(\"br\",{}),(0,W.jsxs)(\"span\",{className:\"muted\",children:[\"Already written: \\u201C\",t.body.slice(0,120),t.body.length>120?\"\\u2026\":\"\",\"\\u201D\"]})]}):null]})]})]}),(0,W.jsx)(\"div\",{className:\"card remind-card\",children:(0,W.jsx)(tn,{icon:(0,W.jsx)(\"span\",{className:\"tile reminder small\",children:(0,W.jsx)(E,{name:\"bell\"})}),label:\"Remind me if no reply\",detail:`Adds a to-do for ${Jn(C)} \\xB7 ${Ct(Kf).replace(\":00\",\"\")}`,checked:p,onChange:g})}),(0,W.jsx)(\"p\",{className:\"hint padded\",children:\"Gmail's mobile web has no scheduled send, and Gmail Only never sends for you. The follow-up stays on your list until you tick it off.\"}),(0,W.jsxs)(\"button\",{type:\"button\",className:\"accent block padded-x\",disabled:!v,onClick:()=>{Q()},children:[\"Continue in Gmail \",(0,W.jsx)(E,{name:\"external\"})]})]})]})}var Oy=Y(Ke(),1);var Te=Y(P(),1);function ky(){let e=lc(\"menu\",j),t=vn(\"menuAccount\",null,j)?.data,n=xe(\"open\",\"menu\",j),{navigate:a,back:l}=I(),i=Ve(),{current:o}=Ee(),{items:u}=Se(),r=Le(),c=e.order.map(S=>e.get(S)?.data).filter(S=>!!S),m=new Map(c.map(S=>[S.arg,S])),d=c.filter(S=>S.kind===\"label\"),f=u.filter(S=>Fa(S,r)).length,s=u.filter(S=>S.snooze&&!S.done).length,h=o?.email??t?.email??\"\";(0,Oy.useEffect)(()=>{for(let S of Ja){let p=m.get(S.arg);p&&gc(S.id,p.count??0)}},[c,o?.id]);let y=(S,p,g,v,x,w)=>(0,Te.jsx)(\"li\",{children:(0,Te.jsxs)(\"button\",{type:\"button\",className:`drawer-row ${w??\"\"}`,onClick:x,children:[(0,Te.jsx)(E,{name:p}),(0,Te.jsx)(\"span\",{children:g}),v?(0,Te.jsx)(\"span\",{className:\"count\",children:v}):null]})},S);return(0,Te.jsxs)(\"div\",{className:\"screen-frame drawer\",children:[(0,Te.jsxs)(\"header\",{className:\"top-bar\",children:[(0,Te.jsx)(mc,{}),(0,Te.jsx)(\"span\",{className:\"spacer\"}),(0,Te.jsx)(te,{icon:\"close\",label:\"Close menu\",onClick:l})]}),(0,Te.jsxs)(Xe,{className:\"screen\",\"aria-busy\":e.status!==\"ready\",children:[(0,Te.jsxs)(\"button\",{type:\"button\",className:\"account-card\",onClick:()=>a({screen:\"accounts\"}),children:[o&&(0,Te.jsx)(Ze,{color:o.color}),(0,Te.jsxs)(\"span\",{children:[(0,Te.jsx)(\"strong\",{children:o?.name??\"Account\"}),(0,Te.jsx)(\"small\",{children:h})]}),(0,Te.jsx)(E,{name:\"down\"})]}),(0,Te.jsxs)(\"ul\",{className:\"drawer-list\",children:[y(\"todo\",\"todo\",\"To-do & reminders\",f,()=>a({screen:\"todo\",mode:\"root\"}),\"accent\"),y(\"snoozed\",\"clock\",\"Snoozed\",s,()=>a({screen:\"snoozed\"}))]}),(0,Te.jsx)(\"h2\",{className:\"section-label\",children:\"Gmail\"}),!c.length&&e.status!==\"ready\"?(0,Te.jsx)(nn,{label:\"Loading folders\",rows:6,kind:\"text\"}):(0,Te.jsx)(\"ul\",{className:\"drawer-list\",children:Ja.map(S=>y(S.id,S.icon,S.title,m.get(S.arg)?.count??null,()=>i.list(S.path,\"replace\")))}),d.length>0&&(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(\"h2\",{className:\"section-label\",children:\"Labels\"}),(0,Te.jsx)(\"ul\",{className:\"drawer-list\",children:d.map(S=>y(S.arg,\"label\",S.label,S.count,()=>{n(S.arg)}))})]}),(0,Te.jsx)(\"ul\",{className:\"drawer-list end\",children:y(\"settings\",\"settings\",\"Gmail Only settings\",null,()=>a({screen:\"settings\"}))})]})]})}var X=Y(P(),1);function _y(){let e=hn(j),t=vn(\"view\",null,j)?.data,{view:n}=ru();if(e.status===\"auth\")return(0,X.jsx)($S,{});if(e.status===\"error\"&&!t)return(0,X.jsx)(Jf,{children:(0,X.jsx)(xy,{error:e.error})});switch(t?.view?JS(t.view):n.kind===\"other\"?\"loading\":n.kind){case\"list\":return(0,X.jsx)(Dy,{list:n.kind===\"list\"||n.kind===\"conversation\"?n.list:yn});case\"conversation\":return n.kind===\"conversation\"?(0,X.jsx)(zy,{threadId:n.threadId,list:n.list}):(0,X.jsx)(Jf,{children:(0,X.jsx)(nn,{label:\"Loading email\",kind:\"email\",rows:6})});case\"compose\":return(0,X.jsx)(Cy,{});case\"menu\":return(0,X.jsx)(ky,{});case\"settings\":return(0,X.jsx)(FS,{});case\"loading\":return(0,X.jsx)(Jf,{children:(0,X.jsx)(nn,{label:\"Loading Gmail\"})});default:return(0,X.jsx)(WS,{})}}function JS(e){switch(e){case\"tl_\":return\"list\";case\"cv_\":return\"conversation\";case\"co_\":return\"compose\";case\"mn_\":return\"menu\";case\"pr_\":return\"settings\";default:return\"loading\"}}function Jf({children:e}){return(0,X.jsx)(\"div\",{className:\"screen-frame\",children:(0,X.jsx)(\"div\",{className:\"screen\",children:e})})}function $S(){let{viewWebsite:e}=I();return(0,X.jsx)(\"div\",{className:\"screen-frame\",children:(0,X.jsx)(\"div\",{className:\"screen centered\",children:(0,X.jsxs)(\"div\",{className:\"welcome\",children:[(0,X.jsx)(mc,{}),(0,X.jsx)(\"h1\",{children:\"Sign in to Gmail\"}),(0,X.jsx)(\"p\",{children:\"Gmail Only works over your own Gmail session. Sign in on Google's page; your reminders and to-dos stay on this device.\"}),(0,X.jsxs)(\"button\",{type:\"button\",className:\"accent block\",onClick:()=>e(),children:[\"Sign in with Google \",(0,X.jsx)(E,{name:\"external\"})]})]})})})}function FS(){let{viewWebsite:e,navigate:t}=I(),n=Ve();return(0,X.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,X.jsxs)(\"header\",{className:\"top-bar\",children:[(0,X.jsx)(te,{icon:\"back\",label:\"Back to inbox\",onClick:()=>n.inbox(\"replace\")}),(0,X.jsx)(\"h1\",{children:\"Gmail settings\"})]}),(0,X.jsxs)(\"div\",{className:\"screen\",children:[(0,X.jsxs)(\"div\",{className:\"card settings-links\",children:[(0,X.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>e(),children:[(0,X.jsx)(\"span\",{className:\"tile neutral\",children:(0,X.jsx)(E,{name:\"mail\"})}),(0,X.jsxs)(\"span\",{children:[(0,X.jsx)(\"strong\",{children:\"Signature, vacation reply and more\"}),(0,X.jsx)(\"small\",{children:\"Opens Gmail's settings page\"})]}),(0,X.jsx)(E,{name:\"external\"})]}),(0,X.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>t({screen:\"settings\"}),children:[(0,X.jsx)(\"span\",{className:\"tile todo\",children:(0,X.jsx)(E,{name:\"settings\"})}),(0,X.jsxs)(\"span\",{children:[(0,X.jsx)(\"strong\",{children:\"Gmail Only settings\"}),(0,X.jsx)(\"small\",{children:\"Reminders, to-dos, swipe and theme\"})]}),(0,X.jsx)(E,{name:\"right\"})]})]}),(0,X.jsx)(\"p\",{className:\"hint padded\",children:\"Gmail's settings change your Google account, so Gmail Only opens them in Gmail rather than redrawing them.\"})]})]})}function WS(){let{viewWebsite:e}=I(),t=Ve();return(0,X.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,X.jsxs)(\"header\",{className:\"top-bar\",children:[(0,X.jsx)(te,{icon:\"back\",label:\"Back to inbox\",onClick:()=>t.inbox(\"replace\")}),(0,X.jsx)(\"h1\",{children:\"Gmail\"})]}),(0,X.jsx)(\"div\",{className:\"screen\",children:(0,X.jsxs)(kt,{title:\"This part of Gmail opens in Gmail\",icon:\"mail\",children:[(0,X.jsx)(\"p\",{children:\"Gmail Only doesn't have its own screen for this page yet.\"}),(0,X.jsxs)(\"div\",{className:\"row-buttons\",children:[(0,X.jsxs)(\"button\",{type:\"button\",className:\"accent\",onClick:()=>e(),children:[\"Open in Gmail \",(0,X.jsx)(E,{name:\"external\"})]}),(0,X.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t.inbox(\"replace\"),children:\"Go to inbox\"})]})]})})]})}var nl=Y(Ke(),1);var M=Y(P(),1),PS={overdue:\"Overdue\",today:\"Today\",tomorrow:\"Tomorrow\",week:\"This week\",later:\"Later\",none:\"No date yet\",done:\"Done\"},eT=[\"overdue\",\"today\",\"tomorrow\",\"week\",\"later\",\"none\",\"done\"];function Ry(){let{items:e,loading:t,error:n,saveMany:a}=Se(),l=Ee(),{settings:i,update:o}=yt(),{navigate:u}=I(),{show:r}=qe(),c=el(),m=Le(),[d,f]=(0,nl.useState)(i.defaultSort),[s,h]=(0,nl.useState)(\"all\"),[y,S]=(0,nl.useState)(null),[p,g]=(0,nl.useState)(null),[v,x]=(0,nl.useState)(!1),w=i.todoAccount,U=(0,nl.useMemo)(()=>{let K=(p??\"\").toLowerCase().split(/\\s+/).filter(Boolean);return e.filter(q=>!q.snooze).filter(q=>w===\"all\"||q.accountId===w).filter(q=>l.byId(q.accountId)?.showInTodo!==!1||w===q.accountId).filter(q=>!K.length||K.every(ln=>tT(q).includes(ln)))},[e,w,l,p]),C=pe(m),D=U.filter(K=>Ol(K,m)===\"overdue\"),Q=async()=>{let K=D.map(q=>({...q,dueDate:C}));try{await a(K),r({text:`${K.length} moved to today`,undo:()=>a(D)})}catch{r({text:\"Couldn't move them. Try again.\"})}},O=()=>u({screen:\"add\",params:{type:\"todo\"}}),ne=w===\"all\"?null:l.byId(w),Ne=!0,he;return t&&!e.length?he=(0,M.jsx)(nn,{label:\"Loading your to-dos\",kind:\"text\",rows:6}):n&&!e.length?he=(0,M.jsx)(kt,{title:\"Couldn't load your to-dos\",role:\"alert\",icon:\"alert\",children:(0,M.jsx)(\"p\",{children:\"Try closing and reopening Gmail Only.\"})}):U.length?d===\"due\"?he=(0,M.jsx)(aT,{items:U,now:m,day:y,keepDays:i.keepDoneDays,terms:p?p.split(/\\s+/):[],onOpen:c,onMoveAll:()=>{Q()}}):he=(0,M.jsx)(lT,{items:U,now:m,filter:s,onFilter:h,terms:p?p.split(/\\s+/):[],onOpen:c,onSetDate:K=>u({screen:\"add\",params:{type:K.type,itemId:K.id}})}):he=p?(0,M.jsx)(kt,{title:\"No matches\",icon:\"search\",children:(0,M.jsxs)(\"p\",{children:[\"Nothing in your to-dos matches \\u201C\",p,\"\\u201D.\"]})}):(0,M.jsxs)(kt,{title:\"Nothing due\",icon:\"check2\",children:[(0,M.jsxs)(\"p\",{children:[\"Save emails as reminders from any message. Open an email and tap \",(0,M.jsx)(\"strong\",{children:\"Add to\\u2026\"}),\", or swipe it right.\"]}),(0,M.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:O,children:[(0,M.jsx)(E,{name:\"plus\"}),\" Add a to-do\"]})]}),(0,M.jsxs)(\"div\",{className:\"screen-frame todo\",children:[(0,M.jsx)(\"header\",{className:\"todo-header\",children:p===null?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(\"h1\",{children:\"To-do\"}),(0,M.jsx)(\"span\",{className:\"spacer\"}),Ne&&(0,M.jsxs)(\"button\",{type:\"button\",className:\"account-filter\",\"aria-expanded\":v,onClick:()=>x(!v),children:[ne?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Ze,{color:ne.color}),\" \",ne.name]}):\"All accounts\",\" \",(0,M.jsx)(E,{name:\"down\",size:16})]}),(0,M.jsx)(te,{icon:\"search\",label:\"Search to-dos\",onClick:()=>g(\"\")})]}):(0,M.jsxs)(\"div\",{className:\"search-pill todo-search\",children:[(0,M.jsx)(E,{name:\"search\"}),(0,M.jsx)(\"input\",{type:\"search\",autoFocus:!0,placeholder:\"Search to-dos\",\"aria-label\":\"Search to-dos\",value:p,onChange:K=>g(K.target.value)}),(0,M.jsx)(te,{icon:\"close\",label:\"Close search\",onClick:()=>g(null)})]})}),v&&(0,M.jsxs)(iu,{onClose:()=>x(!1),className:\"account-menu\",children:[(0,M.jsx)(\"button\",{type:\"button\",role:\"menuitemradio\",\"aria-checked\":w===\"all\",onClick:()=>{o({todoAccount:\"all\"}),x(!1)},children:\"All accounts\"}),l.accounts.map(K=>(0,M.jsxs)(\"button\",{type:\"button\",role:\"menuitemradio\",\"aria-checked\":w===K.id,onClick:()=>{o({todoAccount:K.id}),x(!1)},children:[(0,M.jsx)(Ze,{color:K.color}),\" \",K.name,\" \",(0,M.jsx)(\"small\",{children:K.email})]},K.id))]}),(0,M.jsxs)(Xe,{className:\"screen\",\"aria-busy\":t,children:[(0,M.jsx)(\"div\",{className:\"segmented\",role:\"tablist\",\"aria-label\":\"Sort\",\"data-index\":d===\"due\"?0:1,children:[\"due\",\"added\"].map(K=>(0,M.jsx)(\"button\",{type:\"button\",role:\"tab\",\"aria-selected\":d===K,onClick:()=>f(K),children:K===\"due\"?\"When it's due\":\"When I added it\"},K))}),(0,M.jsxs)(\"div\",{className:\"crossfade\",children:[d===\"due\"&&(0,M.jsx)(nT,{items:U,now:m,day:y,onDay:S}),he]},d)]}),(0,M.jsx)(\"button\",{type:\"button\",className:\"fab round\",\"aria-label\":\"Add a to-do\",onClick:O,children:(0,M.jsx)(E,{name:\"plus\"})})]})}var tT=e=>`${e.title} ${e.note} ${e.link?.subject??\"\"} ${e.link?.sender??\"\"}`.toLowerCase();function nT({items:e,now:t,day:n,onDay:a}){let l=vt(t),i=Array.from({length:7},(u,r)=>_e(l,r)),o=new Set(e.filter(u=>!u.done&&u.dueDate).map(u=>u.dueDate));return(0,M.jsx)(\"div\",{className:\"week-strip\",role:\"group\",\"aria-label\":\"This week\",children:i.map(u=>{let r=pe(u),c=n===r,m=e.filter(d=>!d.done&&d.dueDate===r).length;return(0,M.jsxs)(\"button\",{type:\"button\",\"aria-pressed\":c,className:`week-day ${$a(u,t)===0?\"today\":\"\"}`,\"aria-label\":`${Jn(u)}${m?`, ${m} due`:\"\"}`,onClick:()=>a(c?null:r),children:[(0,M.jsx)(\"span\",{children:Xi(u).slice(0,1)}),(0,M.jsx)(\"strong\",{children:u.getDate()}),(0,M.jsx)(\"i\",{className:o.has(r)?\"dot\":\"dot none\",\"aria-hidden\":\"true\"})]},r)})})}function aT({items:e,now:t,day:n,terms:a,keepDays:l,onOpen:i,onMoveAll:o}){if(n){let r=e.filter(m=>m.dueDate===n&&!m.done).sort(au),c=en(n);return(0,M.jsxs)(\"section\",{className:\"group\",children:[(0,M.jsxs)(\"h2\",{className:\"group-head\",children:[(0,M.jsx)(\"span\",{children:Jn(c)}),(0,M.jsx)(\"small\",{children:r.length?`${r.length} due`:\"Nothing due\"})]}),r.length>0&&(0,M.jsx)(\"ul\",{className:\"item-list card\",children:r.map(m=>(0,M.jsx)($f,{item:m,now:t,terms:a,onOpen:i},m.id))})]})}let u=new Map;for(let r of e){let c=Ol(r,t);u.set(c,[...u.get(c)??[],r])}return(0,M.jsx)(M.Fragment,{children:eT.filter(r=>u.get(r)?.length).map(r=>{let c=u.get(r).sort(r===\"done\"?(d,f)=>(f.completedAt??0)-(d.completedAt??0):au),m=null;return r===\"today\"?m=`${c.length} left`:r===\"none\"?m=`${c.length} to schedule`:r===\"done\"&&(m=`Kept for ${l} days`),(0,M.jsxs)(\"section\",{className:`group ${r}`,children:[(0,M.jsxs)(\"h2\",{className:\"group-head\",children:[(0,M.jsx)(\"span\",{children:PS[r]}),r===\"overdue\"?(0,M.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:o,children:\"Move all to today\"}):m&&(0,M.jsx)(\"small\",{children:m})]}),(0,M.jsx)(\"ul\",{className:\"item-list card\",children:c.map(d=>(0,M.jsx)($f,{item:d,now:t,terms:a,onOpen:i},d.id))})]},r)})})}function lT({items:e,now:t,filter:n,onFilter:a,terms:l,onOpen:i,onSetDate:o}){let u={all:e.filter(d=>!d.done).length,reminder:e.filter(d=>!d.done&&d.type===\"reminder\").length,todo:e.filter(d=>!d.done&&d.type===\"todo\").length,done:e.filter(d=>d.done).length},r=e.filter(d=>n===\"all\"?!0:n===\"done\"?d.done:d.type===n&&!d.done).sort((d,f)=>f.createdAt-d.createdAt),c=new Map;for(let d of r){let f=pe(new Date(d.createdAt));c.set(f,[...c.get(f)??[],d])}let m=d=>{let f=$a(en(d),t);return f===0?\"Today\":f===-1?\"Yesterday\":Jn(en(d))};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(zn,{label:\"Show\",value:n,onChange:a,className:\"filters\",options:[{id:\"all\",label:(0,M.jsxs)(M.Fragment,{children:[\"All \",(0,M.jsx)(\"span\",{className:\"count\",children:u.all})]})},{id:\"reminder\",label:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{name:\"bell\",size:14}),\" Reminders \",(0,M.jsx)(\"span\",{className:\"count\",children:u.reminder})]})},{id:\"todo\",label:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{name:\"check2\",size:14}),\" To-dos \",(0,M.jsx)(\"span\",{className:\"count\",children:u.todo})]})},{id:\"done\",label:(0,M.jsxs)(M.Fragment,{children:[\"Done \",(0,M.jsx)(\"span\",{className:\"count\",children:u.done})]})}]}),!r.length&&(0,M.jsx)(\"p\",{className:\"muted padded\",children:\"Nothing here.\"}),[...c].map(([d,f])=>(0,M.jsxs)(\"section\",{className:\"group\",children:[(0,M.jsxs)(\"h2\",{className:\"group-head\",children:[(0,M.jsx)(\"span\",{children:m(d)}),(0,M.jsxs)(\"small\",{children:[f.length,\" added\"]})]}),(0,M.jsx)(\"ul\",{className:\"item-list card\",children:f.map(s=>(0,M.jsx)($f,{item:s,now:t,terms:l,onOpen:i,mode:\"added\",onSetDate:()=>o(s)},s.id))})]},d))]})}function $f({item:e,now:t,terms:n,onOpen:a,mode:l=\"due\",onSetDate:i}){return(0,M.jsx)(tl,{item:e,now:t,mode:l,onOpen:()=>a(e.id),onSetDate:i,trailing:n.length&&e.link?(0,M.jsx)(\"span\",{className:\"match\",children:(0,M.jsx)(ou,{text:e.link.subject,terms:n})}):void 0})}var Uy=Y(Ke(),1);var L=Y(P(),1);function Hy(){let{back:e,navigate:t}=I(),{items:n,loading:a,complete:l,save:i,remove:o}=Se(),u=Ee(),{settings:r}=yt(),{show:c}=qe(),m=Ve(),d=Le(),[f,s]=(0,Uy.useState)(!1),h=Qi(),y=n.find(O=>O.id===h.id);if(!y)return(0,L.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,L.jsx)(bn,{title:\"Item\"}),(0,L.jsx)(\"div\",{className:\"screen\",children:a?null:(0,L.jsx)(kt,{title:\"This item is gone\",icon:\"check2\",children:(0,L.jsxs)(\"p\",{children:[\"It was deleted, or removed after being done for \",r.keepDoneDays,\" days.\"]})})})]});let S=u.byId(y.accountId),p=y.type===\"reminder\",g=Ol(y,d)===\"overdue\",v=()=>t({screen:\"add\",params:{type:y.type,itemId:y.id}}),x=async()=>{let O=y;await l(y,!y.done);let ne=!y.done&&p&&y.repeat!==\"never\";c({text:y.done?\"Marked not done\":ne?\"Done. Next one scheduled\":\"Marked done\",undo:()=>i(O)})},w=async O=>{s(!1);let ne=y;await i({...y,dueDate:pe(O),dueTime:ut(O),returned:!1}),c({text:`Snoozed to ${$n({dueDate:pe(O),dueTime:ut(O)},d)}`,undo:()=>i(ne)})},U=async()=>{let O=y;e(),await o(y.id),c({text:p?\"Reminder deleted\":\"To-do deleted\",undo:()=>i(O)})},C=(O=!1)=>{y.link?.threadId&&(O&&(cu.threadId=y.link.threadId),m.email(y.link.threadId,y.accountId))},D=vt(d),Q=[{label:\"In 1 hour\",date:new Date(Math.ceil((d.getTime()+36e5)/3e5)*3e5)},{label:`Tomorrow ${Ct(r.defaultReminderTime).replace(\":00\",\"\")}`,date:ot(_e(D,1),r.defaultReminderTime)},{label:\"Next week\",date:ot(_e(D,(8-D.getDay())%7||7),r.defaultReminderTime)}];return(0,L.jsxs)(\"div\",{className:\"screen-frame item-screen\",children:[(0,L.jsxs)(bn,{title:(0,L.jsxs)(\"span\",{className:`type-label ${y.type}`,children:[(0,L.jsx)(E,{name:p?\"bell\":\"check2\",size:16}),\" \",p?\"Reminder\":\"To-do\"]}),children:[(0,L.jsx)(te,{icon:\"pencil\",label:\"Edit\",onClick:v}),(0,L.jsx)(te,{icon:\"trash\",label:\"Delete\",onClick:()=>{U()}})]}),(0,L.jsxs)(Xe,{className:\"screen\",children:[(0,L.jsxs)(\"div\",{className:\"item-hero\",children:[(0,L.jsx)(fu,{item:y,large:!0,onToggle:()=>{x()}}),(0,L.jsx)(\"h1\",{className:y.done?\"is-done\":void 0,children:y.title||\"Untitled\"})]}),(0,L.jsxs)(\"dl\",{className:\"card detail-rows\",children:[(0,L.jsxs)(Hl,{icon:p?\"bell\":\"calendar\",label:\"When\",children:[(0,L.jsx)(\"span\",{className:g?\"danger\":void 0,children:y.dueDate?$n(y,d):\"No date yet\"}),(0,L.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:v,children:y.dueDate?\"Change\":\"Set date\"})]}),p&&(0,L.jsx)(Hl,{icon:\"repeat\",label:\"Repeat\",children:nu[y.repeat]}),p&&y.link&&(0,L.jsx)(Hl,{icon:\"inbox\",label:\"Bring email back\",children:y.bringBack?\"On\":\"Off\"}),y.priority===\"high\"&&(0,L.jsx)(Hl,{icon:\"flag\",label:\"Priority\",children:\"High\"}),(0,L.jsx)(Hl,{icon:\"user\",label:\"Account\",children:S?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ze,{color:S.color}),\" \",S.name,\" \",(0,L.jsx)(\"small\",{className:\"muted\",children:S.email})]}):\"Unknown account\"}),(0,L.jsx)(Hl,{icon:\"pencil\",label:\"Added by you\",children:cc(y.createdAt,d)}),y.note&&(0,L.jsx)(Hl,{icon:\"note\",label:\"Note\",children:(0,L.jsx)(\"span\",{className:\"note-text\",children:y.note})})]}),y.link&&(0,L.jsxs)(\"section\",{\"aria-label\":\"From this email\",children:[(0,L.jsx)(\"h2\",{className:\"section-label\",children:\"From this email\"}),y.link.deleted||!y.link.threadId?(0,L.jsxs)(\"div\",{className:\"card email-card gone\",children:[(0,L.jsx)(E,{name:\"trash\"}),(0,L.jsxs)(\"span\",{children:[(0,L.jsx)(\"strong\",{children:\"Email deleted\"}),(0,L.jsx)(\"small\",{children:y.link.subject})]})]}):(0,L.jsxs)(\"button\",{type:\"button\",className:\"card email-card\",onClick:()=>C(),children:[(0,L.jsx)(Wa,{name:y.link.sender,size:40}),(0,L.jsxs)(\"span\",{children:[(0,L.jsx)(\"strong\",{children:Pa(y.link.sender)}),(0,L.jsx)(\"span\",{className:\"email-subject\",children:y.link.subject}),(0,L.jsx)(\"small\",{children:y.link.snippet})]}),(0,L.jsx)(E,{name:\"right\"})]}),y.link.threadId&&!y.link.deleted&&(0,L.jsx)(\"p\",{className:\"hint\",children:\"If the email was archived, this opens it from All mail.\"})]}),f&&(0,L.jsxs)(\"div\",{className:\"chips snooze-chips\",role:\"group\",\"aria-label\":\"Snooze until\",children:[Q.map(O=>(0,L.jsx)(\"button\",{type:\"button\",className:\"chip\",onClick:()=>{w(O.date)},children:O.label},O.label)),(0,L.jsx)(\"button\",{type:\"button\",className:\"chip\",onClick:v,children:\"Pick\\u2026\"})]})]}),(0,L.jsxs)(\"footer\",{className:\"action-bar\",children:[y.link?.threadId&&!y.link.deleted&&(0,L.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>C(!0),children:[(0,L.jsx)(E,{name:\"reply\"}),\" Reply\"]}),!y.done&&(0,L.jsxs)(\"button\",{type:\"button\",className:\"secondary\",\"aria-expanded\":f,onClick:()=>s(!f),children:[(0,L.jsx)(E,{name:\"clock\"}),\" Snooze\"]}),(0,L.jsxs)(\"button\",{type:\"button\",className:y.done?\"secondary\":\"accent\",onClick:()=>{x()},children:[(0,L.jsx)(E,{name:y.done?\"back\":\"check\"}),\" \",y.done?\"Undo\":\"Mark done\"]})]})]})}function Hl({icon:e,label:t,children:n}){return(0,L.jsxs)(\"div\",{className:\"detail-row\",children:[(0,L.jsxs)(\"dt\",{children:[(0,L.jsx)(E,{name:e,size:18}),\" \",t]}),(0,L.jsx)(\"dd\",{children:n})]})}var Bl=Y(Ke(),1);var _=Y(P(),1);function iT(e){let t=vt(e),n=[],a=ot(t,\"18:00\");a.getTime()-e.getTime()>30*6e4&&n.push({id:\"evening\",label:\"Later today\",date:a,detail:Dn(a,e)});let l=ot(_e(t,1),\"08:00\");n.push({id:\"tomorrow\",label:\"Tomorrow\",date:l,detail:Dn(l,e)});let i=ot(_e(t,(8-t.getDay())%7||7),\"08:00\");return n.push({id:\"week\",label:\"Next week\",date:i,detail:Dn(i,e)}),n}function Ff(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n?.subject==\"string\").slice(0,100):[]}catch{return[]}}function oT(){let e=xe(\"archive\",\"conversation\",j),t=xe(\"archive\",\"threads\",j),n=xe(\"archiveSelected\",null,j);return(a,l)=>a===\"conversation\"?e(null):a===\"row\"&&l[0]?.threadId?t(l[0].threadId):a===\"selected\"?n(null):Promise.resolve(null)}function By(){let{saveMany:e,removeMany:t}=Se(),{back:n,navigate:a}=I(),{show:l}=qe(),i=oT();return async(o,u,r,c=[])=>{try{await e(o)}catch{return l({text:\"Couldn't save. Try again.\"}),!1}n();let m=r?await i(r,c).catch(()=>({outcome:\"failed\"})):null,d=m?.outcome===\"observed\";return l({text:m!==null&&!d?`${u}. Gmail didn't archive the email, so it's still in the inbox.`:u,undo:async()=>{await t(o.map(s=>s.id)),d&&l({text:\"Item removed. The email is in All mail.\"})},view:o.length===1?()=>a({screen:\"item\",params:{id:o[0].id}}):()=>a({screen:\"todo\",mode:\"root\"})}),!0}}function uT(e,t,n,a,l,i){let o={type:e,title:n.length===1?Wn(n[0].subject):\"\",note:\"\",preset:\"\",picked:\"\",repeat:\"never\",bringBack:!0,due:\"today\",pickedDate:pe(_e(i,1)),notify:!1,time:l,priority:\"normal\",archive:a};if(!t)return o;let u=t.dueDate??\"\",r=t.dueDate&&t.dueTime?`${t.dueDate}T${t.dueTime}`:\"\";return{...o,type:t.type,title:t.title,note:t.note,repeat:t.repeat,bringBack:t.bringBack,priority:t.priority,preset:t.type===\"reminder\"&&r?\"pick\":\"\",picked:r,due:t.dueDate?\"pick\":\"none\",pickedDate:u||o.pickedDate,notify:t.type===\"todo\"&&!!t.dueTime,time:t.dueTime??l,archive:!1}}function Ly(){let{screen:e,back:t}=I(),n=e?.params??{},a=Le(),{items:l}=Se(),i=Ee(),{settings:o}=yt(),u=By(),r=n.itemId?l.find(H=>H.id===n.itemId):void 0,c=(0,Bl.useMemo)(()=>r?.link?[{...r.link,accountId:r.accountId}]:Ff(n.emails),[r,n.emails]),m=n.type===\"snooze\"?\"snooze\":null,[d,f]=(0,Bl.useState)(()=>uT(n.type===\"todo\"?\"todo\":\"reminder\",r,c,o.archiveAfterAdding,o.defaultReminderTime,a)),s=H=>f(_t=>({..._t,...H})),[h,y]=(0,Bl.useState)(!1),S=ry(o.defaultReminderTime,a),p=d.preset||(S.find(H=>H.id===\"later\")??S.find(H=>H.id===\"tomorrow\")??S[0]).id,g=`${pe(a)}T${ut(a)}`,v=p===\"pick\"?d.picked?new Date(d.picked):null:S.find(H=>H.id===p)?.date??null,x=v!==null&&v>a,w=c[0]?i.byId(c[0].accountId):i.current,U=w?.id??i.current?.id??\"unknown\",C=c.length===1?Vi(l,c[0].threadId).filter(H=>H.id!==r?.id).length:0,D=c.length>1,Q=sy(d.due,d.due===\"pick\"?d.pickedDate:null,a),O=d.notify&&!Q?pe(a):Q,ne=!d.notify||ot(en(O),d.time)>a;if(m===\"snooze\")return(0,_.jsx)(cT,{emails:c,archive:n.archive});let Ne=()=>t(),he=()=>s({type:d.type===\"reminder\"?\"todo\":\"reminder\"});async function K(){if(h)return;let H=d.type===\"reminder\";if(H&&!x||!H&&!ne)return;y(!0);let _t=H?{type:\"reminder\",dueDate:pe(v),dueTime:ut(v),notify:!0,repeat:d.repeat,bringBack:d.bringBack,priority:d.priority}:{type:\"todo\",dueDate:O,dueTime:d.notify?d.time:null,notify:d.notify,repeat:\"never\",bringBack:!1,priority:d.priority},J=d.note.trim().slice(0,2e3),k=(c.length?c:[null]).map(Pn=>{let Ki=(D?Wn(Pn.subject):d.title.trim())||(Pn?Wn(Pn.subject):\"\");return r?{...r,..._t,title:Ki,note:J,returned:!1}:_l(_t.type,Pn,U,{..._t,title:Ki,note:J})}).filter(Pn=>Pn.title);if(!k.length){y(!1);return}let ue=$n(k[0]),Nt=r?\"Saved\":H?D?`${k.length} reminders set \\xB7 ${ue}`:`Reminder set \\xB7 ${ue}`:D?`${k.length} to-dos added`:\"Added to to-do\",Gl=!r&&!H&&d.archive?n.archive:void 0;await u(k,Nt,Gl,c)||y(!1)}let q=d.type===\"reminder\",ln=r?q?\"Edit reminder\":\"Edit to-do\":q?D?`Add ${c.length} reminders`:\"Add a reminder\":D?`Add ${c.length} to-dos`:\"Add to to-do\",Cn=q?`Save reminder${x?` \\xB7 ${$n({dueDate:pe(v),dueTime:ut(v)},a)}`:\"\"}`:r?\"Save to-do\":D?`Add ${c.length} to to-do`:\"Add to to-do\";return(0,_.jsxs)(lu,{title:ln,icon:q?\"bell\":\"check2\",tone:q?\"reminder\":\"todo\",onClose:Ne,footer:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(\"button\",{type:\"button\",className:q?\"primary block\":\"accent block\",disabled:h||(q?!x:!ne),onClick:()=>{K()},children:h?\"Saving\\u2026\":Cn}),(0,_.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:he,children:q?\"Make it a to-do instead\":\"Make it a reminder instead\"})]}),children:[D?(0,_.jsx)(\"p\",{className:\"sheet-lead\",children:\"Each email becomes its own item, linked to its email. Titles come from the subjects.\"}):(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:q?\"Remind me to\":\"Task\"}),(0,_.jsx)(\"input\",{value:d.title,autoFocus:!r,maxLength:200,placeholder:q?\"What should we remind you of?\":\"What needs doing?\",onChange:H=>s({title:H.target.value}),enterKeyHint:\"done\"})]}),!q&&!D&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsxs)(\"span\",{children:[\"Note \",(0,_.jsx)(\"small\",{children:\"optional\"})]}),(0,_.jsx)(\"textarea\",{rows:2,value:d.note,maxLength:2e3,placeholder:\"Add details\",onChange:H=>s({note:H.target.value})})]}),c.length>0&&(0,_.jsxs)(\"div\",{className:\"linked-card\",children:[w&&(0,_.jsx)(Ze,{color:w.color,label:w.name}),(0,_.jsxs)(\"span\",{children:[(0,_.jsx)(\"strong\",{children:\"Linked:\"}),\" \",D?`${c.length} emails`:`${Pa(c[0].sender)} \\xB7 ${c[0].subject}`]})]}),C>0&&(0,_.jsxs)(\"p\",{className:\"hint\",children:[(0,_.jsx)(E,{name:\"check\",size:14}),\" \",C===1?\"1 item\":`${C} items`,\" already linked to this email\"]}),q?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(\"h3\",{className:\"section-label\",children:\"When\"}),(0,_.jsxs)(\"div\",{className:\"preset-grid\",role:\"radiogroup\",\"aria-label\":\"When\",children:[S.map(H=>(0,_.jsxs)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":p===H.id,className:\"preset\",onClick:()=>s({preset:H.id}),children:[(0,_.jsx)(\"strong\",{children:H.label}),(0,_.jsx)(\"span\",{children:H.detail})]},H.id)),(0,_.jsxs)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":p===\"pick\",className:\"preset\",onClick:()=>s({preset:\"pick\",picked:d.picked||`${pe(_e(a,1))}T${o.defaultReminderTime}`}),children:[(0,_.jsx)(\"strong\",{children:\"Pick date & time\"}),(0,_.jsx)(\"span\",{children:p===\"pick\"&&v?Dn(v,a):\"Custom\"})]})]}),p===\"pick\"&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Date and time\"}),(0,_.jsx)(\"input\",{type:\"datetime-local\",min:g,value:d.picked,onChange:H=>s({picked:H.target.value})}),d.picked&&!x&&(0,_.jsx)(\"small\",{className:\"error-text\",children:\"Pick a time that hasn't passed.\"})]}),(0,_.jsxs)(\"label\",{className:\"select-row\",children:[(0,_.jsx)(E,{name:\"repeat\"}),(0,_.jsx)(\"span\",{children:\"Repeat\"}),(0,_.jsx)(\"select\",{value:d.repeat,onChange:H=>s({repeat:H.target.value}),children:Object.keys(nu).map(H=>(0,_.jsx)(\"option\",{value:H,children:nu[H]},H))})]}),c.length>0&&(0,_.jsx)(tn,{label:\"Bring email back to top of inbox\",detail:\"When the reminder is due\",checked:d.bringBack,onChange:H=>s({bringBack:H})})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(\"h3\",{className:\"section-label\",children:\"Due\"}),(0,_.jsx)(zn,{label:\"Due\",value:d.due,onChange:H=>s({due:H}),options:[{id:\"none\",label:\"No date\"},{id:\"today\",label:\"Today\"},{id:\"tomorrow\",label:\"Tomorrow\"},{id:\"week\",label:\"This week\"},{id:\"pick\",label:\"Pick date\"}]}),d.due===\"pick\"&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Due date\"}),(0,_.jsx)(\"input\",{type:\"date\",min:pe(a),value:d.pickedDate,onChange:H=>s({pickedDate:H.target.value})})]}),(0,_.jsx)(\"p\",{className:\"hint\",children:rT(d.due,Q,a)}),(0,_.jsx)(tn,{label:\"Add a time & notify me\",checked:d.notify,onChange:H=>s({notify:H})}),d.notify&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Time\"}),(0,_.jsx)(\"input\",{type:\"time\",value:d.time,onChange:H=>s({time:H.target.value})}),!ne&&(0,_.jsx)(\"small\",{className:\"error-text\",children:\"That time has passed today.\"})]}),(0,_.jsx)(\"h3\",{className:\"section-label\",children:\"Priority\"}),(0,_.jsx)(zn,{label:\"Priority\",value:d.priority,onChange:H=>s({priority:H}),options:[{id:\"normal\",label:\"Normal\"},{id:\"high\",label:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(E,{name:\"flag\",size:14}),\" High\"]}),tone:\"high\"}]}),!r&&c.length>0&&n.archive&&(0,_.jsx)(tn,{label:D?\"Archive emails after adding\":\"Archive email after adding\",checked:d.archive,onChange:H=>s({archive:H})})]})]})}function rT(e,t,n){if(e===\"none\"||!t)return\"Goes to No date yet. You'll be nudged to schedule it.\";let a=en(t),l=Math.round((vt(a).getTime()-vt(n).getTime())/864e5),i=l===0?\"Today\":l===1?\"Tomorrow\":l<7?\"This week\":\"Later\";return`Due by ${Jn(a).replace(\",\",\"\")}. Shows in ${i}.`}function cT({emails:e,archive:t}){let{back:n}=I(),a=Le(),l=Ee(),i=By(),[o,u]=(0,Bl.useState)(\"\"),[r,c]=(0,Bl.useState)(!1),m=iT(a),d=e[0]?.accountId??l.current?.id??\"unknown\";async function f(h){if(r||h<=a||!e.length)return;c(!0);let y=e.map(p=>_l(\"reminder\",p,d,{title:Wn(p.subject),dueDate:pe(h),dueTime:ut(h),bringBack:!0,snooze:!0}));await i(y,`Snoozed until ${Dn(h,a)}`,t,e)||c(!1)}let s=o?new Date(o):null;return(0,_.jsxs)(lu,{title:e.length>1?`Snooze ${e.length} emails`:\"Snooze until\",icon:\"clock\",tone:\"neutral\",onClose:n,children:[(0,_.jsx)(\"p\",{className:\"sheet-lead\",children:\"The email leaves your inbox now and comes back to the top at this time.\"}),(0,_.jsx)(\"ul\",{className:\"option-list\",children:m.map(h=>(0,_.jsx)(\"li\",{children:(0,_.jsxs)(\"button\",{type:\"button\",className:\"option\",disabled:r,onClick:()=>{f(h.date)},children:[(0,_.jsx)(E,{name:\"clock\"}),(0,_.jsx)(\"span\",{children:h.label}),(0,_.jsx)(\"small\",{children:h.detail})]})},h.id))}),(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Pick date & time\"}),(0,_.jsx)(\"input\",{type:\"datetime-local\",min:`${pe(a)}T${ut(a)}`,value:o,onChange:h=>u(h.target.value)})]}),(0,_.jsx)(\"button\",{type:\"button\",className:\"primary block\",disabled:r||!s||s<=a,onClick:()=>s&&void f(s),children:s&&s>a?`Snooze until ${Dn(s,a)}`:\"Snooze\"}),(0,_.jsx)(\"p\",{className:\"hint\",children:\"Gmail's mobile web has no snooze, so Gmail Only archives the email and keeps the time. Snoozed emails are listed in the menu.\"})]})}var an=Y(P(),1);function Gy(){let{screen:e,back:t,navigate:n}=I(),a=e?.params.emails,l=Ff(a),i=u=>n({screen:\"add\",mode:\"replace\",params:{type:u,emails:a??\"[]\",archive:\"selected\"}}),o=(u,r,c,m,d)=>(0,an.jsx)(\"li\",{children:(0,an.jsxs)(\"button\",{type:\"button\",className:\"add-option\",onClick:()=>i(u),children:[(0,an.jsx)(\"span\",{className:`tile ${c}`,children:(0,an.jsx)(E,{name:r})}),(0,an.jsxs)(\"span\",{children:[(0,an.jsx)(\"strong\",{children:m}),(0,an.jsx)(\"small\",{children:d})]}),(0,an.jsx)(E,{name:\"right\"})]})});return(0,an.jsx)(lu,{title:`Save ${l.length} ${l.length===1?\"email\":\"emails\"} for later`,icon:\"bell\",tone:\"neutral\",onClose:t,children:l.length?(0,an.jsxs)(\"ul\",{className:\"option-list\",children:[o(\"reminder\",\"bell\",\"reminder\",\"Add reminders\",\"One per email, all at the same time\"),o(\"todo\",\"check2\",\"todo\",\"Add to to-do\",\"One task per email; archive them if you like\"),o(\"snooze\",\"clock\",\"neutral\",\"Snooze\",\"Archive now, back at the top later\")]}):(0,an.jsx)(\"p\",{className:\"sheet-lead\",children:\"Nothing is selected.\"})})}var qy=Y(Ke(),1);var De=Y(P(),1),sT=[{label:\"Unread\",query:\"is:unread\"},{label:\"Starred\",query:\"is:starred\"},{label:\"Has attachment\",query:\"has:attachment\"},{label:\"Last 7 days\",query:\"newer_than:7d\"}];function Yy(){let{back:e}=I(),t=Ve(),{settings:n,update:a}=yt(),{items:l}=Se(),i=el(),o=Le(),u=Qi(),[r,c]=(0,qy.useState)(u.q??\"\"),m=s=>{let h=s.trim();h&&(a({recentSearches:[h,...n.recentSearches.filter(y=>y!==h)].slice(0,8)}),t.search(h))},d=r.toLowerCase().split(/\\s+/).filter(s=>s.length>1&&!s.includes(\":\")),f=d.length?l.filter(s=>!s.snooze&&d.every(h=>`${s.title} ${s.note} ${s.link?.subject??\"\"} ${s.link?.sender??\"\"}`.toLowerCase().includes(h))).slice(0,5):[];return(0,De.jsxs)(\"div\",{className:\"screen-frame search-screen\",children:[(0,De.jsx)(\"header\",{className:\"mail-header\",children:(0,De.jsxs)(\"form\",{className:\"search-pill\",role:\"search\",onSubmit:s=>{s.preventDefault(),m(r)},children:[(0,De.jsx)(te,{icon:\"back\",label:\"Back\",onClick:e}),(0,De.jsx)(\"input\",{type:\"search\",autoFocus:!0,enterKeyHint:\"search\",placeholder:\"Search in mail\",\"aria-label\":\"Search in mail\",value:r,onChange:s=>c(s.target.value)}),r&&(0,De.jsx)(te,{icon:\"close\",label:\"Clear\",onClick:()=>c(\"\")})]})}),(0,De.jsxs)(Xe,{className:\"screen\",children:[(0,De.jsx)(\"nav\",{className:\"filter-chips\",\"aria-label\":\"Search for\",children:sT.map(s=>(0,De.jsx)(\"button\",{type:\"button\",className:\"filter-chip\",onClick:()=>m(r?`${r} ${s.query}`:s.query),children:s.label},s.query))}),f.length>0&&(0,De.jsxs)(\"section\",{children:[(0,De.jsx)(\"h2\",{className:\"section-label\",children:\"In your to-do\"}),(0,De.jsx)(\"ul\",{className:\"item-list card\",children:f.map(s=>(0,De.jsx)(tl,{item:s,now:o,onOpen:()=>i(s.id)},s.id))})]}),n.recentSearches.length>0&&(0,De.jsxs)(\"section\",{children:[(0,De.jsxs)(\"h2\",{className:\"section-label with-action\",children:[(0,De.jsx)(\"span\",{children:\"Recent\"}),(0,De.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:()=>{a({recentSearches:[]})},children:\"Clear\"})]}),(0,De.jsx)(\"ul\",{className:\"plain-list card\",children:n.recentSearches.map(s=>(0,De.jsx)(\"li\",{children:(0,De.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>m(s),children:[(0,De.jsx)(E,{name:\"clock\"}),(0,De.jsx)(\"span\",{children:s}),(0,De.jsx)(E,{name:\"up\"})]})},s))})]}),r.trim()&&(0,De.jsxs)(\"button\",{type:\"button\",className:\"accent block padded-x\",onClick:()=>m(r),children:[(0,De.jsx)(E,{name:\"search\"}),\" Search for \\u201C\",r.trim(),\"\\u201D\"]})]})]})}var G=Y(P(),1);function jy(){let{settings:e,update:t}=yt(),{accounts:n}=Ee(),{navigate:a,viewWebsite:l}=I(),i=u=>{t(u)},o=[{id:\"remind\",label:\"Remind\"},{id:\"archive\",label:\"Archive\"},{id:\"none\",label:\"Off\"}];return(0,G.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,G.jsx)(bn,{title:\"Settings\"}),(0,G.jsxs)(Xe,{className:\"screen settings\",children:[(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Reminders & to-dos\"}),(0,G.jsxs)(\"div\",{className:\"card\",children:[(0,G.jsx)(tn,{label:\"Show Add to\\u2026 on emails\",detail:\"The pill above every open email\",checked:e.showAddTo,onChange:u=>i({showAddTo:u})}),(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsx)(\"span\",{children:\"Default sort\"}),(0,G.jsx)(zn,{label:\"Default sort\",value:e.defaultSort,onChange:u=>i({defaultSort:u}),options:[{id:\"due\",label:\"When it's due\"},{id:\"added\",label:\"When I added it\"}]})]}),(0,G.jsxs)(\"label\",{className:\"setting-row\",children:[(0,G.jsxs)(\"span\",{children:[\"Default reminder time\",(0,G.jsx)(\"small\",{children:\"Used by Tomorrow and Next week\"})]}),(0,G.jsx)(\"input\",{type:\"time\",value:e.defaultReminderTime,onChange:u=>u.target.value&&i({defaultReminderTime:u.target.value})})]}),(0,G.jsx)(tn,{label:\"Morning summary\",detail:e.morningSummary?`Today's card at ${Ct(e.morningSummary)}`:\"Off\",checked:e.morningSummary!==null,onChange:u=>i({morningSummary:u?\"08:00\":null})}),e.morningSummary!==null&&(0,G.jsxs)(\"label\",{className:\"setting-row nested\",children:[(0,G.jsx)(\"span\",{children:\"Summary time\"}),(0,G.jsx)(\"input\",{type:\"time\",value:e.morningSummary,onChange:u=>u.target.value&&i({morningSummary:u.target.value})})]}),(0,G.jsx)(tn,{label:\"Archive email after adding to to-do\",checked:e.archiveAfterAdding,onChange:u=>i({archiveAfterAdding:u})}),(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsx)(\"span\",{children:\"Keep done items\"}),(0,G.jsx)(zn,{label:\"Keep done items\",value:String(e.keepDoneDays),onChange:u=>i({keepDoneDays:Number(u)}),options:[{id:\"1\",label:\"1 day\"},{id:\"7\",label:\"7 days\"},{id:\"30\",label:\"30 days\"}]})]})]}),(0,G.jsx)(\"p\",{className:\"hint padded\",children:`Gmail Only shows what's due inside the app: the To-do badge, the Today card and \"Back in your inbox\". It doesn't send phone notifications.`}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Swipe on emails\"}),(0,G.jsxs)(\"div\",{className:\"card\",children:[(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(E,{name:\"right\",size:16}),\" Swipe right\"]}),(0,G.jsx)(zn,{label:\"Swipe right\",value:e.swipeRight,onChange:u=>i({swipeRight:u}),options:o})]}),(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(E,{name:\"back\",size:16}),\" Swipe left\"]}),(0,G.jsx)(zn,{label:\"Swipe left\",value:e.swipeLeft,onChange:u=>i({swipeLeft:u}),options:o})]})]}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Appearance\"}),(0,G.jsx)(\"div\",{className:\"card\",children:(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsx)(\"span\",{children:\"Theme\"}),(0,G.jsx)(zn,{label:\"Theme\",value:e.theme,onChange:u=>i({theme:u}),options:[{id:\"system\",label:\"System\"},{id:\"light\",label:\"Light\"},{id:\"dark\",label:\"Dark\"}]})]})}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Accounts\"}),(0,G.jsxs)(\"ul\",{className:\"plain-list card\",children:[n.map(u=>(0,G.jsx)(\"li\",{children:(0,G.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>a({screen:\"account-setup\",params:{id:u.id}}),children:[(0,G.jsx)(Ze,{color:u.color}),(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(\"strong\",{children:u.name}),(0,G.jsx)(\"small\",{children:u.email})]}),(0,G.jsx)(E,{name:\"right\"})]})},u.id)),(0,G.jsx)(\"li\",{children:(0,G.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>a({screen:\"accounts\"}),children:[(0,G.jsx)(E,{name:\"user\"}),(0,G.jsx)(\"span\",{children:\"Manage accounts\"}),(0,G.jsx)(E,{name:\"right\"})]})})]}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Gmail\"}),(0,G.jsx)(\"ul\",{className:\"plain-list card\",children:(0,G.jsx)(\"li\",{children:(0,G.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>l(),children:[(0,G.jsx)(E,{name:\"mail\"}),(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(\"strong\",{children:\"Open Gmail itself\"}),(0,G.jsx)(\"small\",{children:\"For anything Gmail Only doesn't draw\"})]}),(0,G.jsx)(E,{name:\"external\"})]})})})]})]})}var ct=Y(P(),1);function Xy(){let{accounts:e,current:t}=Ee(),{items:n}=Se(),{navigate:a}=I(),l=Ve(),i=Le(),o=c=>n.filter(m=>m.accountId===c.id&&Fa(m,i)).length,u=c=>{c.id!==t?.id&&l.inboxOf(c)},r=()=>{let c=e.reduce((d,f)=>Math.max(d,f.sessionIndex),-1)+1,m=`${ji}/mail/u/${c}/`;a({url:`https://accounts.google.com/AddSession?continue=${encodeURIComponent(m)}`,context:\"primary\"})};return(0,ct.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,ct.jsx)(bn,{title:\"Accounts\"}),(0,ct.jsxs)(Xe,{className:\"screen\",children:[(0,ct.jsxs)(\"ul\",{className:\"plain-list card\",children:[e.map(c=>{let m=c.id===t?.id,d=o(c);return(0,ct.jsxs)(\"li\",{className:\"account-row\",children:[(0,ct.jsxs)(\"button\",{type:\"button\",className:\"list-button\",\"aria-current\":m?\"true\":void 0,disabled:!!0&&!m,onClick:()=>u(c),children:[(0,ct.jsx)(Ze,{color:c.color}),(0,ct.jsxs)(\"span\",{children:[(0,ct.jsx)(\"strong\",{children:c.name}),(0,ct.jsxs)(\"small\",{children:[c.email,d?` \\xB7 ${d} due`:\"\"]})]}),m&&(0,ct.jsx)(E,{name:\"check\"})]}),(0,ct.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:()=>a({screen:\"account-setup\",params:{id:c.id}}),children:\"Edit\"})]},c.id)}),!e.length&&(0,ct.jsx)(\"li\",{className:\"muted padded\",children:\"Gmail Only records your account once Gmail shows it.\"})]}),(0,ct.jsxs)(\"button\",{type:\"button\",className:\"secondary block padded-x\",onClick:r,children:[(0,ct.jsx)(E,{name:\"plus\"}),\" Add another account\"]})]})]})}var Ll=Y(Ke(),1);var Ue=Y(P(),1);function Vy(){let{back:e}=I(),{byId:t,save:n}=Ee(),{show:a}=qe(),l=t(Qi().id??\"\"),[i,o]=(0,Ll.useState)(l?.name??\"\"),[u,r]=(0,Ll.useState)(l?.color??Cl[0]),[c,m]=(0,Ll.useState)(l?.showInInbox??!0),[d,f]=(0,Ll.useState)(l?.showInTodo??!0);if((0,Ll.useEffect)(()=>{l&&(o(l.name),r(l.color),m(l.showInInbox),f(l.showInTodo))},[l?.id]),!l)return(0,Ue.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,Ue.jsx)(bn,{title:\"Account\"}),(0,Ue.jsx)(\"div\",{className:\"screen\"})]});let s=async()=>{try{await n({...l,name:i.trim()||l.name,color:u,showInInbox:c,showInTodo:d}),e(),a({text:\"Account saved\"})}catch{a({text:\"Couldn't save. Try again.\"})}};return(0,Ue.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,Ue.jsx)(bn,{title:\"Set up account\"}),(0,Ue.jsxs)(Xe,{className:\"screen\",children:[(0,Ue.jsxs)(\"div\",{className:\"account-preview\",style:{\"--account\":u},children:[(0,Ue.jsx)(\"span\",{className:\"account-badge\",children:(i||l.email)[0]?.toUpperCase()}),(0,Ue.jsx)(\"strong\",{children:i||l.name}),(0,Ue.jsx)(\"small\",{children:l.email})]}),(0,Ue.jsxs)(\"label\",{className:\"field padded-x\",children:[(0,Ue.jsx)(\"span\",{children:\"Name\"}),(0,Ue.jsx)(\"input\",{value:i,maxLength:40,placeholder:\"Personal, Work\\u2026\",onChange:h=>o(h.target.value)})]}),(0,Ue.jsx)(\"h2\",{className:\"section-label\",children:\"Color\"}),(0,Ue.jsx)(\"div\",{className:\"swatches\",role:\"radiogroup\",\"aria-label\":\"Color\",children:Cl.map((h,y)=>(0,Ue.jsx)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":h===u,\"aria-label\":ty[y],className:\"swatch\",style:{background:h},onClick:()=>r(h),children:h===u&&(0,Ue.jsx)(E,{name:\"check\"})},h))}),(0,Ue.jsx)(\"p\",{className:\"hint padded\",children:\"The color marks this account's emails, reminders and to-dos.\"}),(0,Ue.jsxs)(\"div\",{className:\"card\",children:[(0,Ue.jsx)(tn,{label:\"Show in inbox\",checked:c,onChange:m}),(0,Ue.jsx)(tn,{label:\"Show in To-do\",checked:d,onChange:f})]}),(0,Ue.jsx)(\"p\",{className:\"hint padded\",children:\"Show in inbox puts this account's due items on the inbox's Today card. Show in To-do lists them under All accounts.\"})]}),(0,Ue.jsx)(\"footer\",{className:\"action-bar\",children:(0,Ue.jsx)(\"button\",{type:\"button\",className:\"accent block\",onClick:()=>{s()},children:\"Save\"})})]})}var bt=Y(P(),1);function Qy(){let{items:e,save:t,complete:n}=Se(),{show:a}=qe(),l=Ve(),i=Le(),o=e.filter(c=>c.snooze&&!c.done).sort(au),u=async c=>{await t({...c,dueDate:pe(i),dueTime:ut(i),returned:!1}),a({text:\"Back in your inbox\",undo:()=>t(c)})},r=async c=>{await n(c,!0),a({text:\"Snooze removed. The email stays in All mail.\",undo:()=>t(c)})};return(0,bt.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,bt.jsx)(bn,{title:\"Snoozed\"}),(0,bt.jsx)(Xe,{className:\"screen\",children:o.length?(0,bt.jsx)(\"ul\",{className:\"plain-list card\",children:o.map(c=>(0,bt.jsxs)(\"li\",{className:\"snooze-row\",children:[(0,bt.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>c.link?.threadId&&l.email(c.link.threadId,c.accountId),children:[(0,bt.jsx)(Wa,{name:c.link?.sender??c.title,size:36}),(0,bt.jsxs)(\"span\",{children:[(0,bt.jsx)(\"strong\",{children:c.link?.subject??c.title}),(0,bt.jsxs)(\"small\",{children:[Pa(c.link?.sender??\"\"),\" \\xB7 \",(0,bt.jsx)(E,{name:\"clock\",size:12}),\" \",$n(c,i)]})]})]}),(0,bt.jsx)(te,{icon:\"inbox\",label:\"Bring back now\",onClick:()=>{u(c)}}),(0,bt.jsx)(te,{icon:\"close\",label:\"Remove snooze\",onClick:()=>{r(c)}})]},c.id))}):(0,bt.jsx)(kt,{title:\"Nothing snoozed\",icon:\"clock\",children:(0,bt.jsx)(\"p\",{children:\"Snooze an email from its toolbar to hide it until later.\"})})})]})}var ge=Y(P(),1),Zy={mail:_y,todo:Ry,item:Hy,add:Ly,bulk:Gy,search:Yy,settings:jy,accounts:Xy,\"account-setup\":Vy,snoozed:Qy},dT=new Set([\"add\",\"bulk\"]),fT=10,mT=30;function Iy(){return(0,ge.jsx)(hy,{children:(0,ge.jsx)(by,{children:(0,ge.jsx)(hT,{})})})}function pT(e){return e&&{key:e.key,id:e.id,overlay:!0,params:e.params}}function gT(e){switch(e.kind){case\"list\":return`list:${e.list.path}`;case\"conversation\":return`cv:${e.threadId}`;case\"other\":return`other:${e.hash}`;default:return e.kind}}function hT(){let{screen:e,overlay:t,select:n,navigate:a,back:l}=I(),{view:i}=ru(),o=Ve(),{items:u}=Se(),{settings:r}=yt(),{toast:c}=qe(),m=Le(),d=hc(yn.id),f=Ee().current?.id??null,s=(0,Yt.useRef)(f);(0,Yt.useLayoutEffect)(()=>{f&&s.current&&f!==s.current&&Sy(),f&&(s.current=f)},[f]);let h=(0,Yt.useRef)(null);vy(),(0,Yt.useEffect)(()=>{r.theme===\"system\"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=r.theme},[r.theme]);let y=e&&dT.has(e.id)?e:null,S=e?.id===\"menu\",p=(0,Yt.useRef)(null);e&&!y&&!S&&(p.current=e);let g=y||S?p.current??pT(t[t.length-2])??{key:`${j}:base`,id:\"mail\",overlay:!1,params:{}}:e??{key:`${j}:base`,id:\"mail\",overlay:!1,params:{}},v=Zy[g.id],x=y?Zy[y.id]:void 0,w=g.id===\"todo\",U=g.id===\"mail\"&&i.kind===\"list\",C=!y&&(w||U),D=u.filter(q=>Fa(q,m)).length,Q=(0,Yt.useRef)(0),O=g.overlay?null:/:(\\d+)$/.exec(g.key);O&&(Q.current=Number(O[1]));let ne={id:g.id===\"mail\"?`${g.key}|${gT(i)}`:g.key,index:Q.current,depth:y||S?Math.max(0,t.length-1):t.length,tab:w||U,drawer:g.id===\"mail\"&&i.kind===\"menu\"},Ne=wy(ne);(0,Yt.useEffect)(()=>{S&&sc.count===0&&l()},[S,l]);let he=vT(y?.key??null),K=()=>{t.length&&i.kind===\"list\"?n(j):t.length?o.inbox(\"replace\"):i.kind===\"list\"&&i.list.id===yn.id?document.querySelector(\".stage .screen\")?.scrollTo({top:0,behavior:\"smooth\"}):o.inbox()};return(0,ge.jsxs)(\"div\",{className:`app${C?\" has-tabs\":\"\"}${c?\" has-toast\":\"\"}`,children:[(0,ge.jsxs)(\"main\",{className:\"content\",children:[(0,ge.jsx)(Yf,{id:ne.id,motion:Ne,layer:h,zIndex:fT,inert:!!y,children:v&&(0,ge.jsx)(qf.Provider,{value:g.params,children:(0,ge.jsx)(v,{},g.key)})}),(0,ge.jsx)(Yf,{id:y?.key??null,motion:he,layer:h,zIndex:mT,children:x&&(0,ge.jsx)(x,{},y.key)}),(0,ge.jsx)(Ny,{layer:h})]}),C&&(0,ge.jsxs)(\"nav\",{className:\"tabs\",\"aria-label\":\"Sections\",children:[(0,ge.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":w?void 0:\"page\",onClick:K,children:[(0,ge.jsxs)(\"span\",{className:\"tab-icon\",children:[(0,ge.jsx)(E,{name:\"mail\",filled:!w}),d?(0,ge.jsx)(\"span\",{className:\"badge\",children:d>99?\"99+\":d},d):null]}),(0,ge.jsx)(\"span\",{children:\"Mail\"})]}),(0,ge.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":w?\"page\":void 0,onClick:()=>w?document.querySelector(\".stage .screen\")?.scrollTo({top:0,behavior:\"smooth\"}):a({screen:\"todo\",mode:\"root\"}),children:[(0,ge.jsxs)(\"span\",{className:\"tab-icon\",children:[(0,ge.jsx)(E,{name:\"todo\"}),D?(0,ge.jsx)(\"span\",{className:\"badge due\",children:D>99?\"99+\":D},D):null]}),(0,ge.jsx)(\"span\",{children:\"To-do\"})]})]}),(0,ge.jsx)(bT,{})]})}function vT(e){let t=(0,Yt.useRef)({key:e,motion:\"none\"});return t.current.key!==e&&(t.current={key:e,motion:e===null?\"sheet-close\":t.current.key?\"sheet-swap\":\"none\"}),t.current.motion}function yT(e,t){let n=()=>t({text:\"Couldn't undo. Try again.\"});try{let a=e();a&&a.then(void 0,n)}catch{n()}}function bT(){let{toast:e,clear:t,show:n}=qe(),[a,l]=(0,Yt.useState)(e?{toast:e,leaving:!1}:null);(0,Yt.useEffect)(()=>{if(e){l({toast:e,leaving:!1});return}l(u=>u&&{...u,leaving:!0});let o=window.setTimeout(()=>l(u=>u?.leaving?null:u),180);return()=>window.clearTimeout(o)},[e]);let i=a?.toast;return(0,ge.jsx)(\"div\",{className:\"toast-region\",role:\"status\",\"aria-live\":\"polite\",children:i&&(0,ge.jsxs)(\"div\",{className:`toast${a.leaving?\" leaving\":\"\"}`,children:[(0,ge.jsx)(\"span\",{children:i.text}),i.undo&&(0,ge.jsx)(\"button\",{type:\"button\",disabled:a.leaving,onClick:()=>{let o=i.undo;t(),yT(o,n)},children:\"Undo\"}),i.view&&(0,ge.jsx)(\"button\",{type:\"button\",disabled:a.leaving,onClick:()=>{let o=i.view;t(),o()},children:\"View\"})]},i.id)})}var Ky=Y(P(),1);I0((0,Ky.jsx)(Iy,{}));})();\n"},{"path":"index.html","encoding":"utf8","content":"\n\n\n\n\nGmail Only\n\n\n\n\n
\n\n\n\n"}]} \ No newline at end of file +{"envelope":1,"bundle":{"format":3,"compat":{"manifestSchema":6,"bundleFormat":3,"protocol":1,"adapterApi":1,"sdk":"0.0.0","tools":"0.0.0","builtAt":"2026-11-09T13:08:07Z"},"manifest":{"schemaVersion":6,"id":"gmail-only","name":"Gmail Only","origins":["https://mail.google.com"],"foreground":{"entry":"src/main.tsx","screens":["mail","todo","item","add","bulk","search","settings","accounts","account-setup","snoozed","menu"]},"adapter":"src/adapter.ts","contexts":[{"id":"primary","startUrl":"https://mail.google.com/mail/u/0/"}],"routes":[{"id":"mail","pattern":"/mail/*","page":"mail","screen":"mail","context":"primary"},{"id":"root","pattern":"/","page":"mail","screen":"mail","context":"primary"}],"capabilities":{"storage":true},"shell":{"accent":"#2347d9"}},"files":[{"path":"adapter.js","sha256":"4cfbe976a517eb7cd38fafa65e6ecbb60b01ab13de90956f95d8c390f1ef2a9a"},{"path":"foreground.css","sha256":"1f8afcbc2ceb8b81e8498f34d2fe8a82faa8af0e7e98d931e093cd2bf0de9e6f"},{"path":"foreground.js","sha256":"c4c2cd291d96febc206a54928495245b836ea20fa6b78c4f0bae5b2e47552915"},{"path":"index.html","sha256":"b19327387a3eb3bc797318bf6f660fb14d55f4031300a0aa85de91f63bd31844"}]},"entries":[{"path":"adapter.js","encoding":"utf8","content":"(()=>{var P={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1};var gt=/^:[A-Za-z][A-Za-z0-9_]*$/,ht=/^[A-Za-z0-9_.~@-]+$/,le=new Map;function yt(e){if(le.has(e))return le.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),r=n.at(-1)===\"*\";r&&n.pop();let s=[],o=!0;for(let i of n)gt.test(i)?s.push({param:i.slice(1)}):ht.test(i)&&i!==\".\"&&i!==\"..\"?s.push({literal:i}):o=!1;o&&(t={segments:s,rest:r})}return le.set(e,t),t}function de(e){try{return new URL(e).href}catch{return null}}function fe(e,t){let n=vt(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let r;try{r=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}r.at(-1)===\"\"&&r.pop();for(let s of e.routes){let o=yt(s.pattern);if(!o)continue;let i=Et(o,r);if(!i||!(s.query??[]).every(a=>n.searchParams.has(a)))continue;for(let a of s.query??[])i[a]=n.searchParams.get(a);let l={kind:\"route\",routeId:s.id,page:s.page,screen:s.screen,params:i};return s.context!==void 0&&(l.context=s.context),l}return{kind:\"website\",url:t}}function vt(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function Et(e,t){if(e.rest?t.length{let s=null,o=!1,i=1,l=new Map,a=new Map,u={get bound(){return s},get retired(){return o},request(y,g={}){if(o)return Promise.reject(new T(\"RETIRED\",\"This page was closed\"));let A=i++;return new Promise((O,D)=>{let N=setTimeout(()=>{l.delete(A),D(new T(\"DEADLINE\",`${y} did not answer in time`))},s.limits.rpcDeadlineMs+wt);l.set(A,{resolve:O,reject:D,timer:N}),e.postMessage(JSON.stringify({type:\"request\",documentId:s.documentId,requestId:A,method:y,params:g}))})},on(y,g){let A=a.get(y);return A||a.set(y,A=new Set),A.add(g),()=>{A.delete(g)}}};function f(){o=!0;for(let y of l.values())clearTimeout(y.timer),y.reject(new T(\"RETIRED\",\"This page was closed\"));l.clear()}function p(y,g){for(let A of[...a.get(y)??[]])try{A(g)}catch(O){console.error(`Genesis ${y} handler failed`,O)}}e.addEventListener(\"message\",y=>{if(o||typeof y.data!=\"string\")return;let g;try{g=JSON.parse(y.data)}catch{return}if(g?.type===\"refused\"&&!s){o=!0,r(new T(g.error?.code??\"PROTOCOL_MISMATCH\",g.error?.message??\"The host refused this page\"));return}if(g?.type===\"bound\"){if(s)return;s=g,n(u);return}if(!(!s||g?.documentId!==s.documentId))if(g.type===\"response\"){let A=l.get(g.requestId);if(!A)return;l.delete(g.requestId),clearTimeout(A.timer),g.error?A.reject(new T(g.error.code,g.error.message)):A.resolve(g.result??null)}else g.type===\"event\"&&(g.name===\"retired\"?(f(),p(\"retired\",{})):p(g.name,g.data))}),addEventListener(\"pagehide\",()=>{o||(p(\"pagehide\",{}),f())});let b={type:\"hello\",protocol:P.protocol,url:t};e.postMessage(JSON.stringify(b))})}var bt=100;function kt(e){let t=new Map,n=Promise.resolve();return{act(r){let s={request:r,arrived:Date.now(),view:e.view(),cancelled:!1,dispatched:!1,stopped:!1};t.set(r.actionId,s),n=n.then(()=>At(e,s)).catch(o=>{console.error(\"Genesis action failed\",o)}).finally(()=>{t.delete(r.actionId)})},cancel(r){let s=t.get(r);s&&!s.dispatched&&(s.cancelled=!0)},retire(){for(let r of t.values())r.stopped=!0}}}async function At(e,t){let{connection:n,limits:r}=e,{actionId:s}=t.request,o,i=(S,_,C)=>{if(t.stopped)return Promise.resolve();let M={actionId:s,state:S};return C&&(M.navigating=!0),C&&o&&(M.expect=o),_&&(M.result=_),n.request(\"context.actionResult\",M).then(()=>{},()=>{})},l=(S,_,C)=>{let M={outcome:\"failed\",code:S,message:_};return C!==void 0&&Object.assign(M,{completedSteps:C,partial:C>0}),i(\"failed\",M)},a=()=>i(\"cancelled\",{outcome:\"cancelled\"});if(t.stopped)return;if(t.cancelled)return a();if((t.request.view??t.view)!==t.view||e.view()!==t.view)return l(\"CONTEXT_REPLACED\",\"The page the action was for has been replaced\");let u=e.find(t.request);if(\"error\"in u)return l(u.error.code,u.error.message);let f=u.element();if(f===void 0)return l(\"TARGET_NOT_FOUND\",\"The item is no longer on the page\");let p;try{p=u.action(f,t.request.args)}catch(S){return l(\"INVALID_STEPS\",De(S))}if(typeof p?.then==\"function\")return l(\"INVALID_STEPS\",\"An action must return its steps synchronously\");if(p&&\"satisfied\"in p&&p.satisfied===!0)return i(\"observed\",{outcome:\"observed\",noop:!0});let b=It(p);if(b)return l(\"INVALID_STEPS\",b);let{steps:y,until:g,deadlineMs:A}=p;o=p.expect;let O=p.navigates===!0||Pe(y.at(-1)),D=t.arrived+(A??r.actionTimeoutMs),N=0,H=S=>(t.dispatched=!0,i(\"dispatched\",void 0,S)),K=n.on(\"pagehide\",()=>{!t.dispatched&&!t.stopped&&N>0&&H(!0),t.stopped=!0}),X=()=>t.stopped||t.cancelled;try{for(let[S,_]of y.entries()){if(t.stopped)return;if(t.cancelled)return a();if(Date.now()>=D)return l(\"DEADLINE\",\"The action did not finish in time\",N);if(S>0&&Le(y[S-1])&&u.element()===void 0)return l(\"TARGET_NOT_FOUND\",\"The item left the page during the action\",N);if(O&&S===y.length-1&&!Le(_)){if(ge(_),await H(!0),t.stopped)return;ge(_)();return}await _t(_,D,X),N++}if(t.stopped)return;if(t.cancelled)return a();if(await H(O),O)return;if(g!==void 0){let S=typeof g==\"string\"?()=>document.querySelector(g)!==null:()=>g(document)===!0;try{await he(S,D-Date.now(),\"the action to take effect\",()=>t.stopped)}catch{return i(\"failed\",{outcome:\"unknown\",code:\"DEADLINE\",message:\"The page did not show the action's effect in time\",completedSteps:N,partial:N>0})}}if(t.stopped)return;e.flush(),await i(\"observed\",{outcome:\"observed\"})}catch(S){let _=S instanceof T?S.code:\"INVALID_ARGUMENT\";return l(_,De(S),N)}finally{K()}}function It(e){if(typeof e!=\"object\"||e===null)return\"An action must return { satisfied: true } or { steps }\";let{steps:t,until:n}=e;if(!Array.isArray(t))return\"An action must return { satisfied: true } or { steps }\";for(let[r,s]of t.entries()){let o=St(s);if(o)return`Step ${r}: ${o}`;if(Pe(s)&&r!==t.length-1)return\"A navigate or submit step must be the last step\"}return n!==void 0&&typeof n!=\"string\"&&typeof n!=\"function\"?\"until must be a selector or a function\":null}function St(e){if(typeof e!=\"object\"||e===null)return\"must be an object\";let t=e,n=r=>typeof r==\"string\"&&r!==\"\";if(\"click\"in t)return n(t.click)?null:\"click needs a selector\";if(\"fill\"in t)return n(t.fill)&&typeof t.value==\"string\"?null:\"fill needs a selector and a string value\";if(\"submit\"in t)return n(t.submit)?null:\"submit needs a selector\";if(\"navigate\"in t)return n(t.navigate)?null:\"navigate needs a URL\";if(\"waitFor\"in t||\"waitForUrl\"in t)return n(t.waitFor??t.waitForUrl)&&typeof t.timeoutMs==\"number\"?null:\"a wait needs a selector or pattern and timeoutMs\";if(\"scroll\"in t){let r=t.scroll;return r&&n(r.target)&&(r.to===\"end\"||typeof r.to==\"number\")?null:\"scroll needs a target and to\"}return\"unknown step\"}var Pe=e=>e!==void 0&&(\"navigate\"in e||\"submit\"in e),Le=e=>\"waitFor\"in e||\"waitForUrl\"in e,De=e=>String(e?.message??e);function Y(e){let t=document.querySelector(e);if(!t)throw new T(\"NOT_FOUND\",`Nothing matches ${e}`);return t}async function _t(e,t,n){let r=()=>Math.max(0,t-Date.now());if(\"waitFor\"in e)await he(()=>document.querySelector(e.waitFor)!==null,Math.min(e.timeoutMs,r()),e.waitFor,n);else if(\"waitForUrl\"in e){let s=new RegExp(e.waitForUrl);await he(()=>s.test(location.href),Math.min(e.timeoutMs,r()),e.waitForUrl,n)}else ge(e)()}function ge(e){if(\"click\"in e){let t=Y(e.click);return()=>t.click()}if(\"fill\"in e){let t=Y(e.fill);return()=>xt(t,e.value)}if(\"submit\"in e){let t=Y(e.submit),n=t instanceof HTMLFormElement?t:t.closest(\"form\");if(!n)throw new T(\"NOT_FOUND\",`${e.submit} is not in a form`);let r=t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t:void 0;return()=>n.requestSubmit(r)}if(\"navigate\"in e){let t=e.navigate;return()=>location.assign(t)}if(\"scroll\"in e){let{target:t,to:n}=e.scroll,r=t===\"window\"?document.scrollingElement??document.documentElement:Y(t);return()=>{r.scrollTop=n===\"end\"?r.scrollHeight:n}}throw new T(\"INVALID_STEPS\",\"A wait step does not run on its own\")}function xt(e,t){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new T(\"INVALID_STEPS\",\"fill needs an input or textarea\");let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(n,\"value\")?.set?.call(e,t),e.dispatchEvent(new Event(\"input\",{bubbles:!0})),e.dispatchEvent(new Event(\"change\",{bubbles:!0}))}function he(e,t,n,r){let s=Date.now()+t;return new Promise((o,i)=>{let l=()=>{try{return e()}catch{return!1}},a=()=>{r()||l()?o():Date.now()>=s?i(new T(\"DEADLINE\",`Timed out waiting for ${n}`)):setTimeout(a,bt)};a()})}var Ce=new WeakMap;function $e(e){let t=Ce.get(e);return t===void 0&&Ce.set(e,t=JSON.stringify(e)),t}function ye(e,t){return e===t?!0:e!==null&&t!==null&&$e(e)===$e(t)}function Q(e,t){return e?.code===t?.code&&e?.message===t?.message}function Tt(e,t){if(e.kind!==t.kind)return{kind:\"replace\",region:t};if(t.kind===\"single\"){let f=e;if(ye(f.record,t.record)&&f.status===t.status&&Q(f.error,t.error))return null;let p={kind:\"single\",record:t.record};return f.status!==t.status&&(p.status=t.status),Q(f.error,t.error)||(p.error=t.error??null),p}let n=e;if(!!n.ephemeral!=!!t.ephemeral||t.ephemeral)return Ot(n,t)?null:{kind:\"replace\",region:t};let r=new Map(n.items.map(f=>[f.key,f])),s=new Set,o=[];for(let f of t.items){s.add(f.key);let p=r.get(f.key);(!p||!ye(p,f))&&o.push(f)}let i=n.items.filter(f=>!s.has(f.key)).map(f=>f.key),l=t.items.map(f=>f.key),a=l.length!==n.items.length||l.some((f,p)=>n.items[p].key!==f),u={kind:\"collection\"};return o.length&&(u.upsert=o),i.length&&(u.remove=i),a&&(u.order=l),n.complete!==t.complete&&(u.complete=t.complete),n.status!==t.status&&(u.status=t.status),Q(n.error,t.error)||(u.error=t.error??null),Object.keys(u).length>1?u:null}function Ot(e,t){return e.complete===t.complete&&e.status===t.status&&Q(e.error,t.error)&&!!e.ephemeral==!!t.ephemeral&&e.items.length===t.items.length&&e.items.every((n,r)=>ye(n,t.items[r]))}function Mt(e,t,n=1/0){let r=e.slice(),s=i=>r.findIndex(l=>l.key===i),o=-1;for(let[i,l]of t.entries()){let a=s(l.key);if(a!==-1){r[a]=l,o=a;continue}let u=o+1;o===-1&&(u=t.slice(i+1).map(p=>s(p.key)).find(p=>p!==-1)??r.length),r.splice(u,0,l),o=u}return r.length>n?je(r,new Set(t.map(i=>i.key)),n):r}function je(e,t,n){if(e.length<=n)return e;let r=-1,s=0;for(let[l,a]of e.entries())t.has(a.key)&&(r===-1&&(r=l),s=l);r===-1&&(r=0);let o=Math.max(n,s-r+1),i=Math.min(Math.max(0,Math.floor((r+s+1-o)/2)),e.length-o);return e.slice(i,i+o)}function Rt(e){return new Set(e).size===e.length?{keys:e,ephemeral:!1}:{keys:e.map((t,n)=>String(n)),ephemeral:!0}}function Nt(e,t,n){let r=new Map,s=o=>{let i=r.get(o);return i||r.set(o,i={keys:new Set,whole:!1,membership:!1,resolve:!1}),i};for(let[o,i]of Object.entries(e)){let l=t.some(a=>a.kind===\"childList\");if(!i.root){l&&(s(o).resolve=!0);continue}if(!pe(i.root,n)){s(o).resolve=!0;continue}(i.dependsOn.some(a=>!pe(a,n))||i.dependsOnMissing&&l)&&(s(o).whole=!0);for(let a of t){if(a.kind===\"field\"&&!i.fields||a.kind===\"resize\"&&!i.measure)continue;a.removed&&pe(i.root,a.target)&&(s(o).whole=!0);let u=Fe(i,a.target);u.dependent&&(s(o).whole=!0),u.inRoot&&(a.kind===\"childList\"&&(s(o).membership=!0),u.key===void 0?s(o).whole=!0:s(o).keys.add(u.key))}}return r}function Lt(e,t){let n=Fe(e,t);return n.inRoot||n.dependent}function Fe(e,t){let n,r=!1,s=!1;for(let o=t;o;o=o.parentNode)n??=e.items.get(o),o===e.root&&(r=!0),e.dependsOn.includes(o)&&(s=!0);return n!==void 0&&(r=!0),{key:n,inRoot:r,dependent:s}}function pe(e,t){for(let n=e;n;n=n.parentNode)if(n===t)return!0;return!1}function Dt(e){let t=new MutationObserver(o=>{let i=[];for(let l of o){i.push({target:l.target,kind:l.type});for(let a of l.removedNodes)i.push({target:a,kind:\"childList\",removed:!0})}e(i)});t.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let n=o=>{o.target instanceof Node&&e([{target:o.target,kind:\"field\"}])};document.addEventListener(\"input\",n,!0),document.addEventListener(\"change\",n,!0);let r=new WeakMap,s=typeof ResizeObserver==\"function\"?new ResizeObserver(o=>{let i=[];for(let l of o){let a=`${l.contentRect.width}x${l.contentRect.height}`,u=r.get(l.target);r.set(l.target,a),u!==void 0&&u!==a&&i.push({target:l.target,kind:\"resize\"})}i.length&&e(i)}):null;return{measure(o){if(s){s.disconnect();for(let i of o)s.observe(i)}},disconnect(){t.disconnect(),s?.disconnect(),document.removeEventListener(\"input\",n,!0),document.removeEventListener(\"change\",n,!0)}}}function Ct(e){for(let t of[\"pushState\",\"replaceState\"]){let n=History.prototype[t];History.prototype[t]=function(...r){let s=n.apply(this,r);try{e()}catch(o){console.error(\"Genesis navigation handler failed\",o)}return s}}addEventListener(\"popstate\",e),addEventListener(\"hashchange\",e)}var $t=new TextEncoder,Z=e=>$t.encode(JSON.stringify(e)).length,Gt=class{constructor(e,t,n=()=>null){this.send=e,this.limits=t,this.shrink=n}send;limits;shrink;epoch=0;seq=0;last=null;page(e){let t={...e,epoch:++this.epoch};for(;Z(t)>this.limits.pageMaxBytes;){let n=this.shrink(t);if(!n){t={...t,status:\"error\",error:{code:\"PAGE_TOO_LARGE\",message:\"The page is too large to show\"},regions:{}};break}t={...n,epoch:t.epoch}}this.seq=0,this.last=t,this.post({page:t})}update(e){let t=this.last;if(!t||!qt(t,e))return this.page(e);let n={};for(let[o,i]of Object.entries(e.regions)){let l=Tt(t.regions[o],i);l&&(n[o]=l)}let r=e.account!==void 0&&e.account!==t.account;if(!r&&Object.keys(n).length===0)return;let s=this.split(n);if(r&&(s[s.length-1].account=e.account),s.some(o=>Z(o)>this.limits.patchMaxBytes))return this.page(e);this.last={...e,epoch:this.epoch};for(let o of s)this.post({patch:o})}split(e){let t=[],n={};for(let[a,u]of Object.entries(e)){if(u.kind!==\"collection\"||!u.upsert){n[a]=u;continue}let{upsert:f,...p}=u;for(let b of f)t.push([a,b]);Object.keys(p).length>1&&(n[a]=p)}let r=this.limits.patchMaxBytes-Z(n)-256,s=[],o=[],i=0;for(let a of t){let u=Z(a[1])+1;o.length&&(o.length>=this.limits.patchRecordsMax||i+u>r)&&(s.push(o),o=[],i=0),o.push(a),i+=u}s.push(o);let l=this.last.view;return s.map((a,u)=>{let f={view:l,epoch:this.epoch,base:this.seq,seq:++this.seq,regions:{}};for(let[p,b]of a)(f.regions[p]??={kind:\"collection\",upsert:[]}).upsert.push(b);if(u===s.length-1)for(let[p,b]of Object.entries(n))f.regions[p]={...f.regions[p],...b};return f})}post(e){this.send(e).catch(t=>{let n=t instanceof T?t.code:null;if(n!==\"RETIRED\"){if(\"patch\"in e&&this.last&&e.patch.epoch===this.epoch){let{epoch:r,...s}=this.last;return this.page(s)}if(\"page\"in e&&n===\"PAGE_TOO_LARGE\"&&e.page.status!==\"error\"){let{epoch:r,...s}=e.page;return this.page({...s,status:\"error\",error:{code:n,message:\"The page is too large to show\"},regions:{}})}console.error(\"Genesis could not publish the page\",t)}})}};function qt(e,t){let n=Object.keys(t.regions);return e.view.generation===t.view.generation&&e.view.n===t.view.n&&e.view.url===t.view.url&&e.status===t.status&&e.pageId===t.pageId&&e.routeId===t.routeId&&e.error?.code===t.error?.code&&e.error?.message===t.error?.message&&e.signInUrl===t.signInUrl&&JSON.stringify(e.params)===JSON.stringify(t.params)&&n.length===Object.keys(e.regions).length&&n.every(r=>e.regions[r]?.kind===t.regions[r].kind)}function Ut(e,t,n){let r,s,o=()=>{clearTimeout(r),r=void 0,s=void 0,e()};return{schedule(){let i=Date.now();s??=i,clearTimeout(r),r=setTimeout(o,Math.min(t,Math.max(0,s+n-i)))},now(){r!==void 0&&o()},cancel(){clearTimeout(r),r=void 0,s=void 0}}}var Bt=1e4,Ge=!1;function ve(e){if(typeof window>\"u\"||window.top!==window||Ge)return;Ge=!0;let t=window,n=t.__genesisBridge;try{delete t.__genesisBridge}catch{t.__genesisBridge=void 0}if(!n)return;let r=null;Ct(()=>r?.navigated());let s=()=>Ne(n,location.href).then(o=>{r=Pt(o,e)},o=>console.error(\"Genesis could not bind this page\",o));s(),addEventListener(\"pageshow\",o=>{o.persisted&&(r?.stop(),r=null,s())})}function Pt(e,t){let{manifest:n,limits:r,generation:s}=e.bound,o={batches:0,reads:0,lastBatchReads:0,pages:0,patches:0,lastPublishBytes:0,resyncs:0,startedAt:Date.now()},i=!1;i&&(window.__genesisStats=o);let l=new Gt(c=>(i&&(\"page\"in c?o.pages++:o.patches++,o.lastPublishBytes=JSON.stringify(c).length),e.request(\"context.publish\",c)),r,ft),a={generation:s,n:0,url:location.href};if(e.bound.compat.adapterApi!==P.adapterApi){let c=`This applet uses adapter API ${P.adapterApi}; this Genesis uses ${e.bound.compat.adapterApi}`;return console.error(`Genesis: ${c}`),l.page({view:a,pageId:null,routeId:null,params:{},status:\"error\",error:{code:\"PROTOCOL_MISMATCH\",message:c},account:null,regions:{}}),{navigated(){},stop(){}}}let u=!1,f=de(location.href),p=fe(n,location.href),b=D(p),y=null,g=new Map,A=[],O=!1;function D(c){return c.kind===\"route\"?t.pages[c.page]??null:null}function N(){let c=b?.account??t.account;try{let d=c?.(document);return d===void 0&&c?{account:void 0,failed:!1}:{account:typeof d==\"string\"&&d!==\"\"?d:null,failed:!1}}catch(d){return console.error(\"Genesis adapter account failed\",d),{account:void 0,failed:!0}}}function H(){let c=t.signInUrl;try{if(typeof c==\"string\")return new URL(c,n.origins[0]).href;if(typeof c==\"function\")return new URL(c(location.href),location.href).href}catch(d){console.error(\"Genesis adapter signInUrl failed\",d)}return null}function K({account:c,failed:d}){if(p.kind!==\"route\")return{status:\"unsupported\"};if(!b)return{status:\"error\",error:{code:\"NOT_FOUND\",message:`The adapter declares no page ${p.page}`}};let h;try{h=b.ready(document)===!0}catch(v){return{status:\"error\",error:{code:\"INVALID_ARGUMENT\",message:Be(v)}}}if(b.requiresAccount===!0&&d)return{status:\"loading\"};let m=b.requiresAccount===!0&&c===null;return h?{status:m?\"auth\":\"ready\"}:m&&document.readyState!==\"loading\"?{status:\"auth\"}:{status:\"loading\"}}function X(c,d){let h={view:a,pageId:p.kind===\"route\"?p.page:null,routeId:p.kind===\"route\"?p.routeId:null,params:p.kind===\"route\"?p.params:{},status:d.status,signInUrl:H(),regions:{}};c!==void 0&&(h.account=c),d.error&&(h.error=d.error);for(let[m,v]of g)h.regions[m]=v.value;return h}function S(c,d,h){let m={name:c,def:d,root:null,items:new WeakMap,elements:new Map,dependsOn:[],dependsOnMissing:!1,value:h?.value??jt(d)};for(let v of d.dependsOn??[]){let E=[...document.querySelectorAll(v)];E.length===0&&(m.dependsOnMissing=!0),m.dependsOn.push(...E)}return m.root=document.querySelector(d.root),_(m,()=>d.kind===\"collection\"?M(m,d,\"all\"):C(m,d)),m}function _(c,d){try{c.value=d()}catch(h){let m=h instanceof T?h.code:\"INVALID_ARGUMENT\";c.value={...c.value,status:\"error\",error:{code:m,message:`${c.name}: ${Be(h)}`}}}}function C(c,d){let h=c.root;return h?{kind:\"single\",status:\"ready\",record:_e(d,h,d.key?ee(d.key,h):c.name)}:{kind:\"single\",status:\"ready\",record:null}}function M(c,d,h){let m=c.value,v=c.root?[...c.root.querySelectorAll(d.items)]:[],{keys:E,ephemeral:k}=Rt(v.map(L=>ee(d.key,L))),I=m.ephemeral?new Map:new Map(m.items.map(L=>[L.key,L])),R=c.elements;c.elements=new Map;let x=v.map((L,mt)=>{let V=E[mt];c.elements.set(V,L);let Me=I.get(V);return h!==\"all\"&&Me&&!h.has(V)&&R.get(V)===L?Me:Se(c,d,L,V)}),q={kind:\"collection\",status:\"ready\",items:d.virtualized&&!k&&!m.ephemeral?Mt(m.items,x,r.patchRecordsMax):x,complete:me(d)};return k&&(q.ephemeral=!0),q}function Se(c,d,h,m){let v=_e(d,h,m);c.items.set(h,m);for(let E of d.extent?.(h)??[])E&&c.items.set(E,m);return v}function _e(c,d,h){o.reads++;let m=c.read(d);if(typeof m?.then==\"function\")throw new T(\"ASYNC_READ\",\"read must return its data synchronously\");let v={key:h,data:m===void 0?null:m};return c.entity&&(v.entity=c.entity(d)),c.entityType&&(v.entityType=c.entityType),v}function ut(c,d,h){let m=c.value;if(m.ephemeral||m.status===\"error\")return _(c,()=>M(c,d,h));let v=m.items.slice();for(let E of h){let k=c.elements.get(E),I=v.findIndex(x=>x.key===E);if(!(k?.isConnected&&c.root?.contains(k)&&k.matches(d.items))||I===-1||ee(d.key,k)!==E)return _(c,()=>M(c,d,h));try{v[I]=Se(c,d,k,E)}catch{return _(c,()=>M(c,d,h))}}c.value={...m,items:v,complete:me(d)}}function dt(c,d){let{def:h}=c;d.resolve||d.whole||h.kind===\"single\"?g.set(c.name,S(c.name,h,c)):d.membership?_(c,()=>M(c,h,d.keys)):ut(c,h,d.keys)}function ft(c){if(c.view.n!==a.n)return null;let d={...c,regions:{...c.regions}},h=!1;for(let[m,v]of Object.entries(c.regions)){let E=g.get(m);if(E?.def.kind!==\"collection\"||!E.def.virtualized||v.kind!==\"collection\"||v.ephemeral)continue;let k=je(v.items,new Set(E.elements.keys()),Math.floor(v.items.length*3/4));k.length!==v.items.length&&(d.regions[m]={...v,items:k},E.value===v&&(E.value=d.regions[m]),h=!0)}return h?d:null}function ie(c=!1){if(u)return;A=[],O=!1;let d=N(),{account:h}=d,m=K(d),v=g;if(g=new Map,m.status===\"ready\")for(let[k,I]of Object.entries(b?.regions??{}))g.set(k,S(k,I,v.get(k)));y=m.status;let E=X(h,m);c?l.page(E):l.update(E),Te()}function xe(){if(u)return;o.batches++;let c=o.reads,d=A,h=O;A=[],O=!1;let m=N(),{account:v}=m,E=K(m);if(E.status!==\"ready\"||y!==\"ready\"||h)ie();else{let k={};for(let[I,R]of g)k[I]=qe(R);for(let[I,R]of Nt(k,d,document))dt(g.get(I),R);for(let I of g.values()){let R=I.value;if(I.def.kind===\"collection\"&&R.kind===\"collection\"&&I.def.more){let x=me(I.def);x!==R.complete&&(I.value={...R,complete:x})}}l.update(X(v,E)),Te()}o.lastBatchReads=o.reads-c}function Te(){let c=[];for(let d of g.values())d.def.measure&&(d.def.kind===\"single\"?d.root&&c.push(d.root):c.push(...d.elements.values()));Oe.measure(c)}let G=Ut(xe,r.publishQuietMs,r.publishMaxDelayMs),Oe=Dt(c=>{if(!u){if(y===\"ready\"&&!O){let d=[...g.values()].map(qe);A.push(...c.filter(h=>h.kind!==\"attributes\"||d.some(m=>Lt(m,h.target)))),A.length>Bt&&(A=[],O=!0)}G.schedule()}}),ce=kt({connection:e,limits:r,flush:()=>{G.cancel(),xe()},find:pt,view:()=>a.n});function pt(c){let d=(x,q)=>({error:{code:x,message:q}});if(y!==\"ready\"||!b)return d(\"NOT_READY\",\"The page is not ready\");let h=a.n;if(c.region===null){let x=b.actions?.[c.name];return x?{action:x,element:()=>null}:d(\"INVALID_ARGUMENT\",`The page has no action ${c.name}`)}let m=c.region,v=g.get(m);if(!v)return d(\"NOT_FOUND\",`The page has no region ${m}`);let E=v.def.actions?.[c.name];if(!E)return d(\"INVALID_ARGUMENT\",`Region ${m} has no action ${c.name}`);let k=v.def;if(k.kind===\"single\")return{action:E,element:()=>a.n===h?document.querySelector(k.root)??void 0:void 0};if(v.value.ephemeral)return d(\"PRECONDITION_FAILED\",`Region ${m} repeats keys, so its records have no actions`);let I=c.key;if(I===null)return d(\"INVALID_ARGUMENT\",`Action ${c.name} needs a record key`);let R=()=>{if(a.n!==h)return;let x=g.get(m)?.elements.get(I);if(x?.isConnected&&Ue(k,x)===I)return x;let q=document.querySelector(k.root);return q?[...q.querySelectorAll(k.items)].find(L=>Ue(k,L)===I):void 0};return R()===void 0?d(\"TARGET_NOT_FOUND\",`No ${m} item has key ${I}`):{action:E,element:R}}function ae(c=!0){u||(u=!0,G.cancel(),Oe.disconnect(),c&&ce.retire())}return e.on(\"resync\",()=>{o.resyncs++,G.cancel(),ie(!0)}),e.on(\"act\",c=>ce.act(c)),e.on(\"cancel\",({actionId:c})=>ce.cancel(c)),e.on(\"ping\",()=>{}),e.on(\"retired\",()=>ae()),e.on(\"pagehide\",()=>ae(!1)),document.readyState===\"loading\"&&document.addEventListener(\"DOMContentLoaded\",()=>G.schedule(),{once:!0}),ie(),{navigated(){if(u)return;let c=de(location.href);c!==f&&(f=c,a={generation:s,n:a.n+1,url:location.href},p=fe(n,location.href),b=D(p),y=null,g=new Map,G.cancel(),G.schedule())},stop:()=>ae()}}function qe(e){return{root:e.root,items:e.items,dependsOn:e.dependsOn,dependsOnMissing:e.dependsOnMissing,fields:e.def.fields===!0,measure:e.def.measure===!0}}function jt(e){return e.kind===\"collection\"?{kind:\"collection\",status:\"ready\",items:[],complete:!0}:{kind:\"single\",status:\"ready\",record:null}}function me(e){return e.more?document.querySelector(e.more)===null:!0}function ee(e,t){let n=e(t);if(typeof n!=\"string\"||n===\"\")throw new T(\"INVALID_ARGUMENT\",\"key must return a non-empty string\");return n}function Ue(e,t){try{return ee(e.key,t)}catch{return null}}function Be(e){return String(e?.message??e)}function te(e){return{...e,kind:\"collection\"}}function U(e){return{...e,kind:\"single\"}}function Ee(e){let t=(o,i)=>{throw new Error(`Adapter ${o} ${i}`)},n=(o,i)=>{o!==void 0&&typeof o!=\"function\"&&t(i,\"must be a function\")},r=(o,i)=>{(typeof o!=\"string\"||o.trim()===\"\")&&t(i,\"must be a CSS selector\")},s=(o,i)=>{if(o!==void 0){j(o)||t(i,\"must be an object of functions\");for(let[l,a]of Object.entries(o))typeof a!=\"function\"&&t(`${i}.${l}`,\"must be a function\")}};j(e)||t(\"definition\",\"must be an object\"),n(e.account,\"account\"),e.signInUrl!==void 0&&typeof e.signInUrl!=\"string\"&&typeof e.signInUrl!=\"function\"&&t(\"signInUrl\",\"must be a path or a function\"),j(e.pages)||t(\"pages\",\"must be an object\");for(let[o,i]of Object.entries(e.pages)){let l=`pages.${o}`;j(i)||t(l,\"must be an object\"),typeof i.ready!=\"function\"&&t(`${l}.ready`,\"must be a function\"),n(i.account,`${l}.account`),s(i.actions,`${l}.actions`),i.regions!==void 0&&!j(i.regions)&&t(`${l}.regions`,\"must be an object\");for(let[a,u]of Object.entries(i.regions??{})){let f=`${l}.regions.${a}`;(!j(u)||u.kind!==\"collection\"&&u.kind!==\"single\")&&t(f,\"must be made with collection() or single()\"),r(u.root,`${f}.root`),typeof u.read!=\"function\"&&t(`${f}.read`,\"must be a function\"),n(u.entity,`${f}.entity`),u.dependsOn!==void 0&&(Array.isArray(u.dependsOn)||t(`${f}.dependsOn`,\"must be an array of selectors\"),u.dependsOn.forEach((p,b)=>r(p,`${f}.dependsOn.${b}`))),s(u.actions,`${f}.actions`),u.kind===\"collection\"?(r(u.items,`${f}.items`),typeof u.key!=\"function\"&&t(`${f}.key`,\"must be a function\"),n(u.extent,`${f}.extent`),u.more!==void 0&&r(u.more,`${f}.more`)):n(u.key,`${f}.key`)}}return e}function j(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var Ft=[\"tl_\",\"cv_\",\"co_\",\"mn_\",\"pr_\"],F='[role=\"listitem\"][id^=\"th_\"]';function w(e,t=300){return[...(e??\"\").replace(/[​-‏⁠͏]/g,\"\").replace(/\\s+/g,\" \").trim()].slice(0,t).join(\"\")}function z(e){if(!(e instanceof HTMLElement))return!1;let t=e.ownerDocument.defaultView?.getComputedStyle(e);return t?t.display!==\"none\"&&t.visibility!==\"hidden\":e.offsetParent!==null}function W(e){for(let t of Ft)if(z(e.getElementById(t)))return t;return null}function Ht(e){for(let t of e.scripts){let n=/USER_EMAIL\\s*=\\s*\"([^\"@\\s]+@[^\"\\s]+)\"/.exec(t.textContent??\"\");if(n)return n[1].toLowerCase()}}var we=new WeakMap;function ze(e){if(we.has(e))return we.get(e);let t=null;for(let n of e.scripts){let r=/authuser\\\\u003d(\\d+)/.exec(n.textContent??\"\");if(r){t=Number(r[1]);break}}return we.set(e,t),t}function re(e){if(e.location.hostname!==\"mail.google.com\")return null;let t=Ht(e);if(t)return t}var B=e=>e.id.replace(/^th_/,\"\"),He=e=>e?.getAttribute(\"aria-checked\")===\"true\";function oe(e){let t=B(e),n=o=>e.querySelector(`[id=\"${o}${t}\"]`),r=n(\"ti_f_\"),s=e.querySelector(\".Akvd4\");return{threadId:t,sender:w(r?.textContent,120),subject:w(n(\"ti_s_\")?.textContent,240)||\"(no subject)\",snippet:w(n(\"ti_b_\")?.textContent,220).replace(/^[-–—]\\s*/,\"\"),date:w(n(\"ti_d_\")?.textContent,24),unread:r?.querySelector(\"b\")!==null||(s?.getAttribute(\"aria-labelledby\")??\"\").includes(\"tl_ul\"),starred:He(e.querySelector('[data-control-type^=\"tlastar\"]')),selected:e.classList.contains(\"B7pLff\")||He(e.querySelector('[data-control-type^=\"tlatogglecheck\"]')),attachment:e.querySelector('[aria-label*=\"ttachment\" i], img[src*=\"paperclip\" i], .M2ge3b')!==null,labels:[...e.querySelectorAll(\".Se5Bse .q49Gcc\")].map(o=>w(o.textContent,40)).filter(Boolean).slice(0,4)}}function We(e){let t=e.ownerDocument,n=w(t.querySelector(\"#tltbt .aLzX3d\")?.textContent,80),r=/^(.*?)(\\d+)?$/.exec(n),s=e.querySelector(\".mmDIjd\");return{title:w(r?.[1]??n,60),unread:r?.[2]?Number(r[2]):null,empty:s&&z(s)?w(s.textContent,200):null,selected:e.querySelectorAll(`${F}.B7pLff`).length}}var Vt=/^cvcmsg_[^_]+$/;function be(e,t){if(!e)return null;try{let n=new URL(e,t);if(n.hostname.endsWith(\"google.com\")&&n.pathname===\"/url\"){let r=n.searchParams.get(\"q\");if(r)return be(r,t)}return n.protocol===\"https:\"||n.protocol===\"http:\"?n.href:null}catch{return null}}var Ve=new Set([\"P\",\"DIV\",\"BR\",\"TR\",\"LI\",\"H1\",\"H2\",\"H3\",\"H4\",\"BLOCKQUOTE\",\"TABLE\",\"HR\"]);function zt(e,t=6e3){let n=[],r=0,s=!1,o=(a,u,f)=>{if(s)return;let p=a.replace(/[​-‏⁠͏]/g,\"\").replace(/[ \\t\\r\\f\\v]+/g,\" \");if(!p)return;let b=t-r,y=[...p].slice(0,b).join(\"\");y.length{if(a.nodeType===Node.TEXT_NODE)return o(a.textContent??\"\",u,f);if(!(a instanceof Element)||a.matches(\"script,style,head,title,svg,button,[aria-hidden=true],.adL,.gmail_quote,blockquote.gmail_quote\")||a instanceof HTMLElement&&a.style.display===\"none\"||a.matches('a[id^=\"att_\"]'))return;if(a.tagName===\"IMG\"){let y=w(a.getAttribute(\"alt\"),80);return y?o(y,u,f):void 0}let p=a.tagName===\"A\"?be(a.getAttribute(\"href\"),a.ownerDocument.location.href)??void 0:u,b=f||a.tagName===\"B\"||a.tagName===\"STRONG\";Ve.has(a.tagName)&&o(`\n`);for(let y of a.childNodes)i(y,p,b);Ve.has(a.tagName)&&a.tagName!==\"BR\"&&o(`\n`)};i(e??document.createElement(\"div\"));for(let a of n)a.text=a.text.replace(/ *\\n */g,`\n`).replace(/\\n{3,}/g,`\n\n`);for(;n.length&&!n[0].text.trim();)n.shift();n[0]&&(n[0].text=n[0].text.replace(/^\\s+/,\"\"));let l=n[n.length-1];return l&&(l.text=l.text.replace(/\\s+$/,\"\")),{runs:n.filter(a=>a.text!==\"\"),truncated:s}}function Wt(e){let t=new Map;for(let n of e.querySelectorAll('a[id^=\"att_\"]')){let r=n.getAttribute(\"href\")??n.id;t.has(r)||t.set(r,n)}return[...t.values()].slice(0,8).map(n=>{let r=(n instanceof HTMLElement?n.innerText:n.textContent??\"\").split(`\n`).map(l=>w(l,120)).filter(Boolean),s=w(n.getAttribute(\"download\"),120)||r.find(l=>/\\.[a-z0-9]{2,5}$/i.test(l))||r[0]||\"Attachment\",o=r.find(l=>/\\d\\s*(K|M|G)?B$/i.test(l))??\"\",i=Kt(s,n);return{name:s,size:o,...i?{href:i}:{}}})}var Jt=/\\.(jpe?g|png|gif|webp|bmp|svg|txt|csv|mp4|webm|mp3|m4a|ogg|wav)$/i;function Kt(e,t){let n=be(t.getAttribute(\"href\"),t.ownerDocument.location.href);if(!n||!Jt.test(e))return;let r=new URL(n);if(r.searchParams.get(\"view\")===\"att\")return r.searchParams.set(\"disp\",\"inline\"),r.href}function Xt(e){if(!e)return\"\";let t=\"\";for(let n of e.childNodes)if(n instanceof HTMLBRElement)t+=`\n`;else{if(n instanceof Element&&n.matches('[role=\"button\"]'))continue;t+=n.textContent??\"\"}return t}function Yt(e,t){let n=e.id.replace(/^cvcmsg_/,\"\"),r=e.ownerDocument,s=w(e.querySelector(\".HXJujf\")?.textContent,120),o=Xt(r.getElementById(`cvcstrecip_${n}`)).split(`\n`).map(u=>w(u,120)).filter(Boolean),i=r.getElementById(`cvcmsgbod_${n}`),{runs:l,truncated:a}=i&&z(i)?zt(i,t):{runs:[],truncated:!1};return{id:n,sender:s||\"Unknown sender\",initial:w(e.querySelector(\".th5Fjd\")?.textContent,2)||(s[0]??\"?\").toUpperCase(),recipients:o[0]??\"\",time:o.find(u=>/ago|AM|PM|\\d{1,2}:\\d{2}|yesterday|\\b[A-Z][a-z]{2} \\d{1,2}\\b/i.test(u)&&u!==o[0])??o[1]??\"\",snippet:w(r.querySelector(`#cvcstsnip_${CSS.escape(n)} .oex1Df`)?.textContent,200),body:l,truncated:a,attachments:Wt(e)}}var Je=[[\"archive\",\"ca+5\",\"1\"],[\"trash\",\"ca+5\",\"9\"],[\"deleteForever\",\"ca+5\",\"10\"],[\"notSpam\",\"ca+5\",\"8\"],[\"moveToInbox\",\"ca+5\",\"2\"],[\"mute\",\"ca+5\",\"11\"],[\"markUnread\",\"ca+5\",\"4\"],[\"spam\",\"spam+8\",\"7\"]];function ke(e){let[,t,n]=Je.find(([r])=>r===e);return`#cv__cntbt [data-control-type=\"${t}\"][data-onclick-arg=\"${n}\"]`}function Ke(e){let t=e.ownerDocument,n=[...e.querySelectorAll('[id^=\"cvcmsg_\"]')].filter(i=>Vt.test(i.id)),r=24e3,s=[];for(let i of[...n].reverse().slice(0,40)){let l=Yt(i,Math.max(400,Math.min(8e3,r)));r-=l.body.reduce((a,u)=>a+u.text.length,0),s.unshift(l)}let o=t.getElementById(\"cvcstar\");return{subject:w(e.querySelector(\".jzNoVc\")?.textContent,300)||\"(no subject)\",starred:z(o),labels:[...e.querySelectorAll(\".Se5Bse .q49Gcc, .Bqkuxd\")].map(i=>w(i.textContent,40)).filter(Boolean).slice(0,6),messages:s,commands:Je.filter(([i])=>{let l=t.querySelector(ke(i));return l!==null&&z(l.closest(\"[role=button], div\")??l)}).map(([i])=>i)}}var ne=(e,t)=>{let n=e.getElementById(t);return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?w(n.value,600):\"\"};function Xe(e){let t=e.ownerDocument,n=t.getElementById(\"cmcfrom\"),r=n instanceof HTMLSelectElement?n.selectedOptions[0]?.textContent:n?.textContent;return{from:w(r,160),to:ne(t,\"composeto\"),cc:ne(t,\"composecc\"),bcc:ne(t,\"composebcc\"),subject:ne(t,\"cmcsubj\"),body:w(t.getElementById(\"cmcbody\")?.innerText,2e3)}}var Ae='[role=\"menuitem\"][data-onclick-arg]';function Ye(e){let t=e.getAttribute(\"data-onclick-arg\")??\"\",n=e.getAttribute(\"data-control-type\")??e.getAttribute(\"data-onclick\")??\"\",r=w(e.querySelector(\".EAH59d\")?.textContent,8),s=w(e.textContent,80),o=w(s.replace(r,\"\"),60)||t,i=t.startsWith(\"^smartlabel\")?\"category\":t.startsWith(\"^\")?\"system\":n.startsWith(\"mnpi\")?\"category\":\"label\";return{arg:t,kind:i,label:o,count:/^\\d+$/.test(r)?Number(r):null}}var Ze=e=>{let t=w(e.ownerDocument.querySelector('[data-control-type^=\"toggleaccountscallout\"]')?.textContent,200);return/[^\\s@]+@[^\\s@]+/.exec(t)?.[0]?.toLowerCase()??null};var Zt=[[\"tl\",\"tl_\"],[\"cv\",\"cv_\"],[\"co\",\"co_\"],[\"mn\",\"mn_\"],[\"pr\",\"pr_\"]];function Qt(e){let t=e.replace(/^#/,\"\").split(/[/?]/)[0];return t===\"\"?\"tl_\":Zt.find(([n])=>n===t)?.[1]??null}function en(e,t){let n=e.getElementById(t);switch(t){case\"tl_\":return n.querySelector(F)!==null||w(n.querySelector(\".mmDIjd\")?.textContent)!==\"\";case\"cv_\":return n.querySelector(\".jzNoVc\")!==null&&n.querySelector('[id^=\"cvcmsg_\"]')!==null;case\"co_\":return e.getElementById(\"composeto\")!==null;case\"mn_\":return n.querySelector(Ae)!==null;case\"pr_\":return!0}}function tn(e){if(e.readyState===\"loading\")return!1;let t=W(e);if(!t||!en(e,t))return!1;let n=Qt(e.location.hash);return n===null||n===t||t===\"co_\"}var J=e=>`#th_${CSS.escape(e)}`,ct='[data-control-type^=\"tlatogglecheck\"]',nn='[data-control-type^=\"tlastar\"]',Ie=e=>`.zY6rPd [data-control-type=\"ca+5\"][data-onclick-arg=\"${e}\"]`;function Qe(e,t,n){if(!e||typeof n!=\"boolean\")throw new Error(\"Expected a thread and true or false\");let r=e.querySelector(t);if(!r)throw new Error(\"Gmail did not show this control\");if(r.getAttribute(\"aria-checked\")===\"true\"===n)return{satisfied:!0};let s=B(e);return{steps:[{click:`${J(s)} ${t}`}],until:o=>o.querySelector(`${J(s)} ${t}`)?.getAttribute(\"aria-checked\")===\"true\"===n}}var se=e=>[...e.querySelectorAll(`#tl_ ${F}`)].filter(t=>oe(t).selected);function et(e){return t=>{if(!t)throw new Error(\"Expected a thread\");let n=B(t);if(se(t.ownerDocument).filter(o=>B(o)!==n).length)throw new Error(\"Clear the selection first\");let s=[];return oe(t).selected||s.push({click:`${J(n)} ${ct}`},{waitFor:Ie(e),timeoutMs:3e3}),s.push({click:Ie(e)}),{steps:s,until:o=>o.querySelector(J(n))===null,deadlineMs:12e3}}}function tt(e){return()=>{let t=se(document).map(B);if(!t.length)throw new Error(\"No emails are selected\");return{steps:[{click:Ie(e)}],until:n=>t.every(r=>n.querySelector(J(r))===null),deadlineMs:12e3}}}function nt(){return se(document).length?{steps:[{click:'[data-control-type^=\"banone\"]'}],until:e=>se(e).length===0}:{satisfied:!0}}var rt=e=>e.querySelectorAll(`#tl_ ${F}`).length;function ot(){let e=rt(document);return{steps:[{scroll:{target:\"window\",to:\"end\"}}],until:t=>rt(t)>e,deadlineMs:1e4}}function st(){return document.querySelector('#tl_ [aria-label=\"Refresh\"], #tltbt [data-control-type^=\"rfr\"], [aria-label=\"Refresh\"]')?{steps:[{click:'[aria-label=\"Refresh\"]'}]}:{satisfied:!0}}function $(e){return()=>{let t=ke(e);if(!document.querySelector(t))throw new Error(\"Gmail does not offer that for this email\");let n=location.hash;return{steps:[{click:t}],until:r=>r.location.hash!==n||r.querySelector(t)===null,deadlineMs:1e4}}}function rn(e,t){let n=t?.id;if(typeof n!=\"string\"||!/^[\\w-]+$/.test(n))throw new Error(\"Expected a message id\");let r=o=>{let i=o.getElementById(`cvcmsgbod_${n}`);return i instanceof HTMLElement&&i.getClientRects().length>0&&(i.textContent??\"\").trim()!==\"\"};if(r(document))return{satisfied:!0};let s=`[data-control-type^=\"cvasnip\"][data-onclick-arg=\"${n}\"]`;if(!document.querySelector(s))throw new Error(\"Gmail can't open this message here\");return{steps:[{click:s}],until:r,deadlineMs:1e4}}function on(e,t){if(typeof t?.starred!=\"boolean\")throw new Error(\"Expected starred: true or false\");let n=()=>{let r=document.getElementById(\"cvcstar\");return r instanceof HTMLElement&&getComputedStyle(r).display!==\"none\"};return n()===t.starred?{satisfied:!0}:{steps:[{click:t.starred?\"#cvcstaroff\":\"#cvcstar\"}],until:()=>n()===t.starred}}var it={reply:\"cvarplf+29\",replyAll:\"cvarplallf+30\",forward:\"cvafwdf+31\"};function sn(e,t){let n=typeof t?.mode==\"string\"&&t.mode in it?t.mode:\"reply\",r=`#cv_ [data-control-type=\"${it[n]}\"]`;if(!document.querySelector(r))throw new Error(\"Gmail did not show a reply button\");return{steps:[{click:r}],until:s=>W(s)===\"co_\"&&s.getElementById(\"composeto\")!==null}}var cn=(e,t)=>typeof e?.[t]==\"string\"?e[t].slice(0,2e3):null;function an(e,t){let n=[];for(let[r,s]of[[\"to\",\"composeto\"],[\"cc\",\"composecc\"],[\"bcc\",\"composebcc\"],[\"subject\",\"cmcsubj\"]]){let o=cn(t,r),i=document.getElementById(s);o!==null&&i instanceof HTMLInputElement&&i.value!==o&&n.push({fill:`#${s}`,value:o})}return n.length?{steps:n,until:r=>n.every(s=>r.querySelector(s.fill)?.value===s.value)}:{satisfied:!0}}function ln(){return document.querySelector('#co_ [data-control-type=\"cmclose+108\"], [data-control-type=\"cmclose+108\"]')?{steps:[{click:'[data-control-type=\"cmclose+108\"]'}],until:t=>W(t)!==\"co_\"}:{satisfied:!0}}function un(e){if(!e)throw new Error(\"Expected a menu item\");let t=e.getAttribute(\"data-onclick-arg\")??\"\",n=location.hash;return{steps:[{click:`#mn_ [role=\"menuitem\"][data-onclick-arg=\"${CSS.escape(t)}\"]`}],until:r=>r.location.hash!==n}}var at={ready:tn,requiresAccount:!0,account:re,regions:{view:U({root:\"#views\",read:e=>({view:W(e.ownerDocument),hash:e.ownerDocument.location.hash.slice(0,600),session:ze(e.ownerDocument)})}),list:U({root:\"#tl_\",dependsOn:[\"#tltbt\"],read:We,actions:{clearSelection:nt,loadMore:ot,refresh:st}}),threads:te({root:\"#tl_\",items:F,key:B,entityType:\"thread\",read:oe,actions:{setStarred:(e,t)=>Qe(e,nn,t?.starred),setSelected:(e,t)=>Qe(e,ct,t?.selected),archive:et(\"1\"),trash:et(\"9\")}}),conversation:U({root:\"#cv_\",key:()=>location.hash.split(\"/\").pop()??\"conversation\",read:Ke,actions:{archive:$(\"archive\"),trash:$(\"trash\"),deleteForever:$(\"deleteForever\"),notSpam:$(\"notSpam\"),moveToInbox:$(\"moveToInbox\"),mute:$(\"mute\"),markUnread:$(\"markUnread\"),spam:$(\"spam\"),setStarred:on,expandMessage:rn,respond:sn}}),compose:U({root:\"#co_\",fields:!0,read:Xe,actions:{fill:an,discard:ln}}),menu:te({root:\"#mn_\",items:Ae,key:e=>e.getAttribute(\"data-onclick-arg\")??w(e.textContent,60),read:Ye,actions:{open:un}}),menuAccount:U({root:\"#mn_\",read:e=>({email:Ze(e)})})},actions:{archiveSelected:tt(\"1\"),trashSelected:tt(\"9\"),clearSelection:nt,loadMore:ot,refresh:st}};var lt=Ee({account:re,signInUrl:\"/mail/u/0/\",pages:{mail:at}});ve(lt);})();\n"},{"path":"foreground.css","encoding":"utf8","content":":root{color-scheme:light;--font: \"Inter\", \"Roboto\", system-ui, -apple-system, sans-serif;--accent: #2347d9;--accent-ink: #ffffff;--accent-tint: #e8edff;--hero: #2347d9;--hero-ink: #ffffff;--ink: #15161a;--ink-2: #4a4f5c;--ink-3: #6b7080;--wash: #f4f5f7;--paper: #ffffff;--line: #e4e6eb;--chip: #eceef2;--reminder: #9a3d06;--reminder-tint: #fdebdc;--done: #1f7a4d;--danger: #c62828;--danger-tint: #fde8e8;--scrim: rgba(21, 22, 26, .42);--shadow: 0 8px 28px rgba(21, 22, 26, .14);--radius: 20px;--ease-out: cubic-bezier(.2, 0, 0, 1);--ease-in: cubic-bezier(.3, 0, .8, .15);--ease-spring: cubic-bezier(.34, 1.4, .64, 1);--dur-short: .15s;--dur-medium: .25s;--dur-long: .35s;--press: rgba(21, 22, 26, .08)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--accent: #8ea6ff;--accent-ink: #0d1640;--accent-tint: #1f2850;--hero: #263a8f;--hero-ink: #eef1ff;--ink: #eceef2;--ink-2: #bfc3cd;--ink-3: #9297a3;--wash: #0f1013;--paper: #1a1c21;--line: #2c2f37;--chip: #262930;--reminder: #ffb27a;--reminder-tint: #3a2414;--done: #6fd39f;--danger: #ff8a80;--danger-tint: #3b1b1b;--scrim: rgba(0, 0, 0, .6);--shadow: 0 8px 28px rgba(0, 0, 0, .5);--press: rgba(255, 255, 255, .08)}}:root[data-theme=dark]{color-scheme:dark;--accent: #8ea6ff;--accent-ink: #0d1640;--accent-tint: #1f2850;--hero: #263a8f;--hero-ink: #eef1ff;--ink: #eceef2;--ink-2: #bfc3cd;--ink-3: #9297a3;--wash: #0f1013;--paper: #1a1c21;--line: #2c2f37;--chip: #262930;--reminder: #ffb27a;--reminder-tint: #3a2414;--done: #6fd39f;--danger: #ff8a80;--danger-tint: #3b1b1b;--scrim: rgba(0, 0, 0, .6);--shadow: 0 8px 28px rgba(0, 0, 0, .5);--press: rgba(255, 255, 255, .08)}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}html,body{background:var(--wash);color:var(--ink);font:15px/21px var(--font);-webkit-font-smoothing:antialiased}h1,h2,h3,p{margin:0}button,input,textarea,select{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{cursor:pointer;background:none;border:0;padding:0;text-align:inherit}button:disabled{opacity:.45;cursor:default}a{color:var(--accent);text-decoration:none;overflow-wrap:anywhere}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}svg.filled{fill:currentColor}ul,ol{list-style:none;margin:0;padding:0}small{color:var(--ink-3);font-size:13px;line-height:18px}mark{background:#ffe9a8;color:inherit;border-radius:3px;padding:0 1px}.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.muted{color:var(--ink-3)}.danger{color:var(--danger)}.spacer{flex:1}.padded{padding:8px 20px}.padded-x{margin-left:16px!important;margin-right:16px!important;width:calc(100% - 32px)!important}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.app{display:flex;flex-direction:column;height:100%;position:relative}.content{flex:1;min-height:0;position:relative;isolation:isolate;overflow:hidden}.screen-frame{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--wash)}.screen{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:104px}.screen.centered{display:grid;place-items:center;padding:24px}.icon-button{display:inline-grid;place-items:center;width:48px;height:48px;border-radius:50%;color:var(--ink-2);flex:none}.icon-button:active{background:var(--chip)}.icon-button[aria-pressed=true]{color:var(--accent)}.icon-button.star.on,.star.on{color:#e3a008}.accent,.primary,.secondary,.outline{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;border-radius:999px;font-weight:600}.accent{background:var(--accent);color:var(--accent-ink)}.primary{background:var(--ink);color:var(--paper)}.secondary{background:var(--chip);color:var(--ink)}.outline{border:1px solid var(--line);background:var(--paper)}.accent svg,.primary svg,.secondary svg,.outline svg{width:18px;height:18px}.block{display:flex;width:100%}.link-button{color:var(--accent);font-weight:600;min-height:44px;padding:0 8px;display:inline-flex;align-items:center}.row-buttons{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:16px}.card{background:var(--paper);border-radius:var(--radius);margin:0 16px;overflow:hidden}.section-label{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);padding:20px 20px 8px;display:flex;align-items:center;gap:6px}.section-label.with-action{justify-content:space-between;padding-bottom:0}.hint{color:var(--ink-3);font-size:13px;line-height:18px;display:flex;gap:6px;align-items:flex-start}.list-button{display:flex;align-items:center;gap:14px;width:100%;min-height:56px;padding:10px 16px}.list-button>span:not(.account-dot):not(.tile):not(.avatar){flex:1;min-width:0;display:flex;flex-direction:column}.list-button strong{font-weight:600}.list-button>svg:last-child{color:var(--ink-3);width:18px;height:18px}.plain-list>li+li{border-top:1px solid var(--line)}.tile{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:12px;flex:none}.tile.small{width:32px;height:32px;border-radius:10px}.tile.small svg{width:18px;height:18px}.tile.reminder{background:var(--reminder-tint);color:var(--reminder)}.tile.todo{background:var(--accent-tint);color:var(--accent)}.tile.neutral{background:var(--chip);color:var(--ink-2)}.account-dot{display:inline-block;width:10px;height:10px;min-width:10px;border-radius:50%;flex:none;vertical-align:middle}.avatar{display:inline-grid;place-items:center;border-radius:50%;flex:none;font-weight:600;background:hsl(var(--hue) 70% 92%);color:hsl(var(--hue) 55% 32%)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .avatar{background:hsl(var(--hue) 35% 24%);color:hsl(var(--hue) 70% 82%)}}:root[data-theme=dark] .avatar{background:hsl(var(--hue) 35% 24%);color:hsl(var(--hue) 70% 82%)}.avatar.selected{background:var(--accent);color:var(--accent-ink)}.avatar.selected svg{width:20px;height:20px}.logo{font-weight:800;font-size:20px;letter-spacing:-.02em}.logo span{color:var(--accent)}.chips{display:flex;flex-wrap:wrap;gap:8px}.chip{flex:none;white-space:nowrap;display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--paper);font-weight:500}.chip[aria-checked=true]{background:var(--ink);color:var(--paper);border-color:var(--ink)}.chip.high[aria-checked=true]{background:var(--danger);border-color:var(--danger);color:#fff}.chip .count{opacity:.7;margin-left:2px}.chips.filters{padding:12px 16px 4px;flex-wrap:nowrap;overflow-x:auto}.chip-small{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:12px;line-height:18px;background:var(--chip);color:var(--ink-2);font-weight:500}.chip-small.reminder{background:var(--reminder-tint);color:var(--reminder)}.chip-small.todo{background:var(--accent-tint);color:var(--accent)}.tag{flex:none;padding:3px 10px;border-radius:8px;font-size:13px;font-weight:600;background:var(--chip);color:var(--ink-2);white-space:nowrap}.tag.reminder{background:var(--reminder-tint);color:var(--reminder)}.tag.set-date{background:transparent;color:var(--accent);border:1.5px dashed var(--accent);min-height:32px}.time-tag{flex:none;color:var(--ink-3);font-size:13px;font-variant-numeric:tabular-nums}.top-bar{display:flex;align-items:center;gap:4px;min-height:64px;padding:8px 56px 8px 4px;background:var(--wash);flex:none}.top-bar h1{font-size:20px;font-weight:700;padding-left:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-bar .logo{padding-left:16px}.top-bar .send{min-height:40px;padding:0 16px}.mail-header{flex:none;padding:10px 64px 8px 12px;background:var(--wash)}.search-pill{display:flex;align-items:center;gap:4px;min-height:52px;border-radius:999px;background:var(--paper);padding:2px 4px;box-shadow:0 1px 2px #0000000f}.search-pill>svg{margin:0 6px 0 12px;color:var(--ink-3)}.search-pill-text{flex:1;min-height:48px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-pill-text.filled{color:var(--ink);font-weight:500}.search-pill input{flex:1;min-width:0;min-height:48px;border:0;background:none;outline:none}.me{display:grid;place-items:center;width:48px;height:48px;position:relative}.me-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;border:2px solid;font-size:12px;font-weight:700;background:var(--accent-tint);color:var(--accent)}.me-badge{position:absolute;right:2px;bottom:4px;min-width:18px;height:18px;border-radius:9px;background:var(--ink);color:var(--paper);font-size:11px;display:grid;place-items:center}.selection-bar{display:flex;align-items:center;min-height:64px;padding:8px 56px 8px 4px;background:var(--accent-tint);color:var(--accent);flex:none}.selection-bar h1{font-size:18px;font-weight:700}.selection-bar .icon-button{color:var(--accent)}.category-chips,.filter-chips{display:flex;gap:8px;overflow-x:auto;padding:4px 16px 8px;scrollbar-width:none}.category-chip,.filter-chip{flex:none;display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 16px;border-radius:999px;background:var(--paper);border:1px solid var(--line);font-weight:500}.category-chip[aria-current=page],.filter-chip[aria-pressed=true]{background:var(--ink);color:var(--paper);border-color:var(--ink)}.category-chip .count{font-size:12px;font-weight:700;color:var(--accent)}.category-chip[aria-current=page] .count{color:inherit;opacity:.8}.list-title{font-size:26px;font-weight:800;padding:4px 20px 12px;letter-spacing:-.01em}.results-line{padding:4px 20px 8px;color:var(--ink-2);font-size:14px}.thread-list{background:var(--paper);border-radius:var(--radius);margin:0 12px;overflow:hidden}.thread{position:relative;overflow:hidden}.thread+.thread{border-top:1px solid var(--line)}.thread-inner{position:relative;display:flex;align-items:flex-start;gap:4px;padding:10px 4px 10px 8px;background:var(--paper);transition:transform .2s;touch-action:pan-y}.thread.selected .thread-inner{background:var(--accent-tint)}.avatar-button{display:grid;place-items:center;width:48px;height:48px;flex:none}.thread-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;padding:2px 0}.thread-line{display:flex;align-items:baseline;gap:8px}.thread .sender{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}.thread .date{flex:none;font-size:12px;color:var(--ink-3)}.thread .subject{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}.thread .snippet{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-3);font-size:14px}.thread.unread .sender,.thread.unread .subject{color:var(--ink);font-weight:700}.thread.unread .date{color:var(--accent);font-weight:700}.thread-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.thread .star{color:var(--ink-3)}.swipe-under{position:absolute;inset:0;display:flex;align-items:center;padding:0 24px;color:#fff;font-weight:600;gap:8px}.swipe-under.right{justify-content:flex-start}.swipe-under.left{justify-content:flex-end}.swipe-under.remind{background:#d0611c}.swipe-under.archive{background:#1f7a4d}.swipe-under.none{background:var(--chip);color:var(--ink-3)}.list-end{display:flex;justify-content:center;padding:16px}.inline-error{color:var(--danger);padding:8px 20px}.fab{position:absolute;right:16px;bottom:16px;z-index:5;display:inline-flex;align-items:center;gap:10px;min-height:56px;padding:0 22px 0 18px;border-radius:18px;background:var(--accent);color:var(--accent-ink);font-weight:700;box-shadow:var(--shadow)}.fab.round{width:60px;height:60px;padding:0;justify-content:center;border-radius:20px}.fab.round svg{width:28px;height:28px}.today-card{margin:4px 12px 12px;border-radius:var(--radius);background:var(--hero);color:var(--hero-ink);padding:4px 16px 16px}.today-head{display:flex;align-items:center;width:100%;min-height:48px;gap:8px}.today-head>span{flex:1}.today-head .muted{color:inherit;opacity:.8}.today-row{display:flex;align-items:center;gap:10px;min-height:48px;border-top:1px solid rgba(255,255,255,.18)}.today-title{flex:1;min-width:0;min-height:48px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.today-card .tag{background:#ffffff2e;color:inherit}.today-card .mark{border-color:#fffc;color:inherit}.today-card .mark.reminder{background:#ffffff2e}.progress{height:6px;border-radius:3px;background:#ffffff40;margin-top:8px;overflow:hidden}.progress span{display:block;height:100%;background:currentColor;border-radius:3px}.back-section{margin:0 12px 12px;border-radius:var(--radius);background:var(--reminder-tint);color:var(--reminder)}.back-section .section-label{color:var(--reminder);padding:12px 16px 4px}.back-row{display:flex;align-items:center;gap:4px;padding-left:16px}.back-row+.back-row{border-top:1px solid rgba(154,61,6,.15)}.back-main{flex:1;min-width:0;min-height:56px;display:flex;flex-direction:column;justify-content:center}.back-main strong{color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.back-main span{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.back-row .icon-button{color:var(--reminder)}.also{margin-bottom:12px}.item-list{display:block}.item-row{display:flex;align-items:center;gap:12px;padding:6px 16px 6px 12px;min-height:64px}.item-row+.item-row{border-top:1px solid var(--line)}.item-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;min-height:52px;justify-content:center}.item-title{font-weight:600;display:flex;align-items:center;gap:6px;overflow-wrap:anywhere}.item-meta{display:block;font-size:13px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item-meta svg{width:14px;height:14px;vertical-align:-2px}.item-meta .account-dot{width:8px;height:8px;vertical-align:0}.item-row.overdue .item-meta{color:var(--danger)}.item-row.is-done .item-title{text-decoration:line-through;color:var(--ink-3);font-weight:500}.priority{color:var(--danger);display:inline-flex}.match{flex:none;max-width:40%;font-size:12px;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mark{position:relative;display:grid;place-items:center;width:28px;height:28px;flex:none;border:2px solid var(--ink-3);border-radius:8px;color:var(--paper)}.mark:after{content:\"\";position:absolute;inset:-10px}.mark.reminder{border:0;border-radius:50%;background:var(--reminder-tint);color:var(--reminder)}.mark svg{width:16px;height:16px}.mark.done{background:var(--done);border-color:var(--done);color:#fff}.mark.large{width:40px;height:40px;border-radius:12px}.mark.reminder.large{border-radius:50%}.mark.large svg{width:22px;height:22px}.todo-header{display:flex;align-items:center;gap:4px;min-height:72px;padding:12px 56px 4px 20px;flex:none}.todo-header h1{font-size:30px;font-weight:800;letter-spacing:-.02em}.todo-search{flex:1}.account-filter{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:var(--paper);font-weight:500}.segmented{position:relative;display:flex;margin:4px 16px 0;padding:4px;border-radius:16px;background:var(--chip)}.segmented:before{content:\"\";position:absolute;top:4px;bottom:4px;left:4px;width:calc(50% - 4px);border-radius:12px;background:var(--paper);box-shadow:0 1px 3px #0000001a;transition:transform var(--dur-medium) var(--ease-out)}.segmented[data-index=\"1\"]:before{transform:translate(100%)}.segmented button{position:relative;flex:1;min-height:44px;border-radius:12px;text-align:center;color:var(--ink-2);font-weight:600;transition:color var(--dur-short)}.segmented button[aria-selected=true]{color:var(--ink)}.week-strip{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;padding:12px 12px 4px}.week-day{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:64px;padding:6px 0;border-radius:14px;color:var(--ink-3)}.week-day strong{color:var(--ink);font-size:17px}.week-day.today,.week-day.today strong{color:var(--accent)}.week-day[aria-pressed=true]{background:var(--ink);color:var(--paper)}.week-day[aria-pressed=true] strong{color:var(--paper)}.week-day .dot{width:6px;height:6px;border-radius:50%;background:var(--accent)}.week-day .dot.none{background:transparent}.week-day[aria-pressed=true] .dot{background:var(--paper)}.group{margin-top:8px}.group-head{display:flex;align-items:baseline;gap:8px;padding:16px 20px 8px;font-size:16px;font-weight:700}.group-head small{font-weight:500}.group-head .link-button{margin-left:auto;min-height:32px;font-size:14px}.group.overdue .group-head>span{color:var(--danger)}.group.done .item-list{opacity:.85}.type-label{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--accent)}.type-label.reminder{color:var(--reminder)}.type-label svg{width:16px;height:16px}.item-hero{display:flex;align-items:flex-start;gap:14px;padding:8px 20px 20px}.item-hero h1{font-size:24px;line-height:30px;font-weight:800;letter-spacing:-.01em;overflow-wrap:anywhere}.item-hero h1.is-done{text-decoration:line-through;color:var(--ink-3)}.detail-rows{margin:0 16px}.detail-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 16px}.detail-row+.detail-row{border-top:1px solid var(--line)}.detail-row dt{display:flex;align-items:center;gap:10px;width:132px;flex:none;color:var(--ink-3);font-size:14px}.detail-row dd{margin:0;flex:1;min-width:0;display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-weight:500}.detail-row dd .link-button{margin-left:auto}.note-text{white-space:pre-wrap;font-weight:400}.email-card{display:flex;align-items:center;gap:12px;width:calc(100% - 32px);padding:14px 16px}.email-card>span:not(.avatar){flex:1;min-width:0;display:flex;flex-direction:column}.email-card small{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.email-subject{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-card.gone{color:var(--ink-3)}.email-card+.hint{padding:8px 20px}.snooze-chips{padding:16px}.action-bar{flex:none;display:flex;gap:8px;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:var(--paper);border-top:1px solid var(--line)}.action-bar>button{flex:1;min-width:0;padding:0 10px;white-space:nowrap}.conversation{padding:0 0 104px}.add-to{display:flex;align-items:center;gap:12px;padding:4px 16px 8px}.add-to .muted{font-size:13px;line-height:17px}.add-pill{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:44px;padding:0 14px;border-radius:999px;background:var(--ink);color:var(--paper);font-weight:600}.add-pill svg{width:18px;height:18px}.popover-scrim{position:fixed;inset:0;z-index:20;background:transparent;cursor:default}.popover{position:absolute;z-index:21;background:var(--paper);border-radius:18px;box-shadow:var(--shadow);padding:8px;display:flex;flex-direction:column;min-width:220px}.popover>button{min-height:48px;padding:0 14px;border-radius:12px;display:flex;align-items:center;gap:10px}.popover>button:active,.popover>button[aria-checked=true]{background:var(--chip)}.more-menu{top:64px;right:12px}.add-menu{top:120px;left:16px;right:16px}.account-menu{top:72px;right:56px}.add-option{display:flex;align-items:center;gap:14px;width:100%;min-height:64px;padding:8px 10px;border-radius:14px}.add-option>span:nth-child(2){flex:1;display:flex;flex-direction:column}.add-option>svg:last-child{color:var(--ink-3)}.quick-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 10px 6px;border-top:1px solid var(--line);margin-top:4px}.quick-row .section-label{width:100%;padding:0 4px}.subject-row{display:flex;align-items:flex-start;gap:4px;padding:4px 8px 0 20px}.conversation-subject{flex:1;font-size:22px;line-height:28px;font-weight:800;letter-spacing:-.01em;padding-top:8px;overflow-wrap:anywhere}.conversation-meta{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:6px 20px 12px;font-size:13px}.account-line{display:inline-flex;align-items:center;gap:6px;color:var(--ink-2)}.linked-items{margin-bottom:8px}.messages{display:flex;flex-direction:column;gap:8px;padding:0 12px}.message{background:var(--paper);border-radius:var(--radius);padding:4px 16px 16px}.message-head{display:flex;align-items:center;gap:12px;width:100%;min-height:56px}.message-head:disabled{opacity:1}.message-who{flex:1;min-width:0;display:flex;flex-direction:column}.message-who .muted{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:22px;padding-top:4px}.message-body p{margin-top:12px}.message-snippet{color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachments{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.attachment-card{display:flex;align-items:center;gap:10px;padding:8px 12px 8px 8px;border:1px solid var(--line);border-radius:14px;max-width:100%}.attachment-card>span:last-child{display:flex;flex-direction:column;min-width:0}.attachments>li{max-width:100%}a.attachment-card{color:inherit;text-decoration:none}a.attachment-card:active{background:var(--press)}.attachment-card small{color:var(--ink-2);font-size:12px}.attachment-card strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-tile{display:grid;place-items:center;width:40px;height:40px;border-radius:10px;background:var(--danger-tint);color:var(--danger);font-size:11px;font-weight:800;flex:none}.reply-row{display:flex;gap:8px;padding:16px 12px}.reply-row button{flex:1;min-width:0;padding:0 8px;white-space:nowrap}.compose-card{background:var(--paper);border-radius:var(--radius);margin:0 12px;overflow:hidden}.compose-field{display:flex;align-items:center;gap:12px;min-height:56px;padding:0 16px;border-bottom:1px solid var(--line)}.compose-field>span:first-child{width:56px;flex:none;color:var(--ink-3)}.compose-field input{flex:1;min-width:0;min-height:48px;border:0;background:none;outline:none}.compose-to{display:flex;align-items:center}.compose-to .compose-field{flex:1}.compose-to .link-button{border-bottom:1px solid var(--line);min-height:56px}.from-value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.compose-body-note{display:flex;gap:12px;padding:16px;color:var(--ink-2)}.compose-body-note svg{color:var(--ink-3)}.remind-card{margin-top:12px}.drawer .screen,.drawer .top-bar{background:var(--paper)}.account-card{display:flex;align-items:center;gap:12px;width:calc(100% - 32px);margin:0 16px 8px;min-height:64px;padding:10px 16px;border-radius:var(--radius);background:var(--accent-tint)}.account-card>span:not(.account-dot){flex:1;min-width:0;display:flex;flex-direction:column}.account-card>.account-dot{width:14px;height:14px}.account-card small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drawer-list{padding:0 8px}.drawer-list.end{margin-top:12px;border-top:1px solid var(--line);padding-top:8px}.drawer-row{display:flex;align-items:center;gap:16px;width:100%;min-height:52px;padding:0 16px;border-radius:999px;font-weight:500}.drawer-row>span:nth-child(2){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drawer-row.accent{background:transparent;color:var(--accent);min-height:52px;padding:0 16px;border-radius:999px;justify-content:flex-start;font-weight:600}.drawer-row .count{font-size:13px;font-weight:700;color:var(--ink-2)}.drawer-row svg{color:var(--ink-3)}.drawer-row.accent svg{color:var(--accent)}.drawer-row:active{background:var(--chip)}.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}.field>span{font-size:13px;font-weight:600;color:var(--ink-2)}.field input,.field textarea,.setting-row input,.select-row select{min-height:48px;padding:10px 14px;border-radius:14px;border:1px solid var(--line);background:var(--wash);outline:none;width:100%}.field input:focus,.field textarea:focus{border-color:var(--accent)}.field textarea{resize:vertical}.error-text{color:var(--danger)}.select-row{display:flex;align-items:center;gap:12px;min-height:56px}.select-row>span{flex:1}.select-row select{width:auto}.toggle-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 16px;cursor:pointer;position:relative}.card .toggle-row+.toggle-row,.card .toggle-row+.setting-row,.card .setting-row+.toggle-row,.card .setting-row+.setting-row{border-top:1px solid var(--line)}.sheet-body .toggle-row{padding:8px 0}.toggle-text{flex:1;min-width:0;display:flex;flex-direction:column}.toggle-row input{position:absolute;opacity:0;width:1px;height:1px}.switch{position:relative;width:50px;height:30px;border-radius:15px;background:var(--line);flex:none;transition:background .15s}.switch:after{content:\"\";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #00000040;transition:transform .15s}.toggle-row input:checked+.switch{background:var(--accent)}.toggle-row input:checked+.switch:after{transform:translate(20px)}.toggle-row input:focus-visible+.switch{outline:3px solid var(--accent);outline-offset:2px}.setting-row{display:flex;flex-direction:column;gap:10px;padding:12px 16px}.setting-row>span{display:flex;flex-direction:column;font-weight:500}.setting-row>span:has(svg){flex-direction:row;align-items:center;gap:6px}.setting-row input[type=time]{width:160px}.setting-row.nested{padding-left:32px}.settings .card{margin-bottom:4px}.settings-links{margin-top:8px}.sheet-layer{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;justify-content:flex-end}.sheet-backdrop{position:absolute;inset:0;background:var(--scrim);animation:fade .22s ease-out}.sheet{position:relative;max-height:92%;display:flex;flex-direction:column;background:var(--paper);border-radius:24px 24px 0 0;box-shadow:var(--shadow);animation:sheet-in .32s var(--ease-out);outline:none;transition:transform .28s var(--ease-out);will-change:transform}.grabber{width:40px;height:5px;border-radius:3px;background:var(--line);margin:8px auto 0;flex:none}.sheet-head{display:flex;align-items:center;gap:12px;padding:8px 8px 8px 20px;flex:none}.sheet-head h2{flex:1;font-size:19px;font-weight:800}.sheet-body{flex:1;min-height:0;overflow-y:auto;padding:4px 20px 16px}.sheet-foot{flex:none;display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 20px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line)}.sheet-lead{color:var(--ink-2);margin-bottom:14px}.sheet-body .section-label{padding:12px 0 8px}.linked-card{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:14px;background:var(--wash);margin-bottom:10px;font-size:14px}.linked-card>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}.preset{display:flex;flex-direction:column;gap:2px;min-height:64px;padding:10px 14px;border-radius:16px;border:1.5px solid var(--line)}.preset span{font-size:13px;color:var(--ink-3)}.preset[aria-checked=true]{border-color:var(--reminder);background:var(--reminder-tint)}.preset[aria-checked=true] span{color:var(--reminder)}.option-list{display:flex;flex-direction:column;gap:4px;margin-bottom:12px}.option{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:0 12px;border-radius:14px;background:var(--wash)}.option>span{flex:1;font-weight:600}@keyframes fade{0%{opacity:0}}.account-row{display:flex;align-items:center;padding-right:8px}.account-row .list-button:disabled{opacity:1;cursor:default}.account-row .list-button>svg:last-child{color:var(--accent)}.account-preview{display:flex;flex-direction:column;align-items:center;gap:4px;padding:16px 20px 24px}.account-badge{display:grid;place-items:center;width:72px;height:72px;border-radius:50%;border:3px solid var(--account);color:var(--account);background:color-mix(in srgb,var(--account) 14%,var(--paper));font-size:28px;font-weight:800;margin-bottom:8px}.swatches{display:flex;gap:12px;padding:0 20px;flex-wrap:wrap}.swatch{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;color:#fff}.swatch[aria-checked=true]{box-shadow:0 0 0 3px var(--paper),0 0 0 5px var(--ink)}.snooze-row{display:flex;align-items:center;padding-right:4px}.snooze-row .list-button small{display:inline-flex;align-items:center;gap:4px}.notice{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:48px 32px;color:var(--ink-2)}.notice h2{font-size:18px;color:var(--ink)}.notice .secondary{margin-top:12px}.notice-icon{display:grid;place-items:center;width:64px;height:64px;border-radius:20px;background:var(--accent-tint);color:var(--accent);margin-bottom:4px}.welcome{display:flex;flex-direction:column;gap:12px;max-width:360px;text-align:center}.welcome .logo{font-size:32px;margin-bottom:12px}.welcome h1{font-size:24px}.welcome p{color:var(--ink-2);margin-bottom:12px}.skeleton{padding:8px 12px;animation:fade .2s .12s both}.skeleton-row{display:flex;gap:12px;padding:12px 8px}.skeleton-avatar,.skeleton-row>div span,.skeleton .bar{background:linear-gradient(90deg,var(--chip) 0 40%,var(--shimmer) 50%,var(--chip) 60% 100%) var(--chip);background-size:300% 100%;animation:shimmer 1.4s linear infinite}.skeleton-avatar{width:40px;height:40px;border-radius:50%;flex:none}.skeleton-row>div{flex:1;display:flex;flex-direction:column;gap:8px}.skeleton-row>div span{height:12px;border-radius:6px}.skeleton-row>div span:nth-child(1){width:40%}.skeleton-row>div span:nth-child(3){width:70%}.skeleton.email{display:flex;flex-direction:column;gap:10px;padding:16px}.skeleton .bar{display:block;height:12px;border-radius:6px}.skeleton .bar.title{height:22px;border-radius:8px;width:85%}.skeleton .bar.title.short{width:55%;margin-bottom:8px}.skeleton .bar.short{width:60%}.skeleton.email .skeleton-row{padding:8px 0 12px}@keyframes shimmer{0%{background-position:100% 0}to{background-position:0 0}}.tabs{flex:none;display:flex;background:var(--paper);border-top:1px solid var(--line);padding:6px 8px calc(6px + env(safe-area-inset-bottom))}.tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;min-height:56px;font-size:13px;font-weight:600;color:var(--ink-3)}.tab-icon{position:relative;display:grid;place-items:center;width:64px;height:32px;border-radius:16px}.tab[aria-current=page]{color:var(--ink)}.tab[aria-current=page] .tab-icon{background:var(--accent-tint);color:var(--accent)}.badge{position:absolute;top:-4px;right:6px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--danger);color:#fff;font-size:11px;line-height:18px;text-align:center;font-weight:700}.badge.due{background:var(--reminder)}.toast-region{position:absolute;left:12px;right:12px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:40;display:flex;justify-content:center;pointer-events:none}.toast{pointer-events:auto;display:flex;align-items:center;gap:4px;min-height:52px;max-width:520px;width:100%;padding:4px 4px 4px 16px;border-radius:16px;background:var(--ink);color:var(--paper);box-shadow:var(--shadow);animation:toast-in var(--dur-medium) var(--ease-out)}.toast>span{flex:1}.toast button{min-height:44px;padding:0 12px;color:#a8bbff;font-weight:700}:root[data-theme=dark] .toast button{color:var(--accent-ink)}input[type=search]::-webkit-search-cancel-button{display:none}.search-screen .accent.block{margin-top:16px}.stage{position:absolute;inset:0}.ghosts,.ghost{position:absolute;inset:0;pointer-events:none}.ghost,.ghost *{animation:none!important;transition:none!important}.sheet-handle{flex:none;touch-action:none;cursor:grab}.sheet.dragging{transition:none}@keyframes sheet-in{0%{transform:translateY(100%)}}.list-button,.drawer-row,.option,.preset,.popover>button,.item-row,.thread-inner,.back-row,.tab,.week-day{transition:background-color var(--dur-short),color var(--dur-short),transform var(--dur-short) var(--ease-out)}.list-button:active,.option:active,.item-row:active,.back-row:active,.thread-inner:active{background-color:var(--press)}.thread-inner:active{background-image:linear-gradient(var(--press),var(--press))}.accent,.primary,.secondary,.outline,.chip,.add-pill,.fab,.preset,.option,.link-button,.segmented button,.week-day{transition:transform var(--dur-short) var(--ease-out),background-color var(--dur-short),color var(--dur-short),border-color var(--dur-short)}.accent:active,.primary:active,.secondary:active,.outline:active,.chip:active,.add-pill:active,.preset:active,.option:active,.week-day:active{transform:scale(.97)}.fab:active{transform:scale(.94)}.icon-button{transition:background-color var(--dur-short),transform var(--dur-short) var(--ease-out)}.icon-button:active{transform:scale(.92)}.popover{animation:pop-in .18s var(--ease-out);transform-origin:top right}.add-menu{transform-origin:top left}@keyframes pop-in{0%{opacity:0;transform:scale(.9)}}.tabs{animation:tabs-in var(--dur-medium) var(--ease-out)}@keyframes tabs-in{0%{transform:translateY(100%)}}.tab .tab-icon{isolation:isolate}.tab .tab-icon:before{content:\"\";position:absolute;inset:0;z-index:-1;border-radius:16px;background:var(--accent-tint);transform:scaleX(.3);opacity:0;transition:transform var(--dur-medium) var(--ease-out),opacity var(--dur-short)}.tab[aria-current=page] .tab-icon{background:none}.tab[aria-current=page] .tab-icon:before{transform:none;opacity:1}.tab:active .tab-icon:before{opacity:1;background:var(--press);transform:none}.tab[aria-current=page]:active .tab-icon:before{background:var(--accent-tint)}.badge{animation:badge-pop .3s var(--ease-spring)}@keyframes badge-pop{0%{transform:scale(.4)}}.crossfade{animation:fade var(--dur-medium) var(--ease-out)}.week-day{transition:background-color var(--dur-medium) var(--ease-out),color var(--dur-medium)}.progress span{transition:width .5s var(--ease-out)}.app.has-tabs .toast-region{bottom:84px}@keyframes toast-in{0%{opacity:0;transform:translateY(24px) scale(.96)}}.toast.leaving{animation:toast-out .18s var(--ease-in) forwards}@keyframes toast-out{to{opacity:0;transform:translateY(16px) scale(.96)}}.fab{transition:transform var(--dur-medium) var(--ease-out),background-color var(--dur-short)}.app.has-toast .fab{transform:translateY(-64px)}.app.has-toast .fab:active{transform:translateY(-64px) scale(.94)}.message-body{animation:fade var(--dur-medium) var(--ease-out)}:root{--shimmer: rgba(255, 255, 255, .7)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--shimmer: rgba(255, 255, 255, .1)}}:root[data-theme=dark]{--shimmer: rgba(255, 255, 255, .1)}.progress-bar{position:relative;flex:none;height:3px;margin-bottom:-3px;z-index:2;overflow:hidden;opacity:0;transition:opacity .2s;pointer-events:none}.progress-bar.active{opacity:1;transition-delay:.25s}.progress-bar.active:before{content:\"\";position:absolute;inset:0 auto 0 0;width:40%;border-radius:2px;background:var(--accent);animation:progress 1.2s var(--ease-out) infinite}@keyframes progress{0%{transform:translate(-100%)}to{transform:translate(250%)}}.spinner{width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.list-end{flex-direction:column;align-items:center;gap:4px}.screen{position:relative}.pull-indicator{position:absolute;top:-44px;left:50%;z-index:3;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--paper);color:var(--ink-3);box-shadow:0 2px 8px #0000002e;pointer-events:none}.pull-indicator.armed,.pull-indicator.active{color:var(--accent)}.pull-indicator.active{transition:transform .25s var(--ease-out)}.pull-indicator span{display:grid}.pull-indicator.active span{animation:spin .8s linear infinite}.reveal{animation:fade .24s var(--ease-out)}.mark{transition:background-color .15s,border-color .15s}.mark.checking{background:var(--done);border-color:var(--done);color:#fff;animation:badge-pop .32s var(--ease-spring)}.today-title{transition:opacity .25s}.today-row.is-done .today-title{opacity:.55;text-decoration:line-through}.star.on svg{animation:star-pop .36s var(--ease-spring)}@keyframes star-pop{0%{transform:scale(.5) rotate(-30deg)}to{transform:none}}.thread-inner{transition:background-color var(--dur-short),transform .22s var(--ease-out)}.thread-inner.dragging{transition:none}.swipe-under svg{transition:transform .15s var(--ease-spring)}.swipe-under.armed svg{transform:scale(1.3)}@media(prefers-reduced-motion:reduce){.skeleton-avatar,.skeleton-row>div span,.skeleton .bar,.progress-bar.active:before{animation:none}.progress-bar.active:before{width:100%;opacity:.5}.reveal,.mark.checking,.star.on svg,.pull-indicator.active span{animation:none}}\n"},{"path":"foreground.js","encoding":"utf8","content":"\"use strict\";(()=>{var t1=Object.create;var lm=Object.defineProperty;var n1=Object.getOwnPropertyDescriptor;var a1=Object.getOwnPropertyNames;var l1=Object.getPrototypeOf,i1=Object.prototype.hasOwnProperty;var kn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var o1=(e,t,n,a)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let l of a1(t))!i1.call(e,l)&&l!==n&&lm(e,l,{get:()=>t[l],enumerable:!(a=n1(t,l))||a.enumerable});return e};var Y=(e,t,n)=>(n=e!=null?t1(l1(e)):{},o1(t||!e||!e.__esModule?lm(n,\"default\",{value:e,enumerable:!0}):n,e));var km=kn($=>{\"use strict\";var zc=Symbol.for(\"react.transitional.element\"),O1=Symbol.for(\"react.portal\"),k1=Symbol.for(\"react.fragment\"),_1=Symbol.for(\"react.strict_mode\"),R1=Symbol.for(\"react.profiler\"),U1=Symbol.for(\"react.consumer\"),H1=Symbol.for(\"react.context\"),B1=Symbol.for(\"react.forward_ref\"),L1=Symbol.for(\"react.suspense\"),G1=Symbol.for(\"react.memo\"),wm=Symbol.for(\"react.lazy\"),q1=Symbol.for(\"react.activity\"),Y1=Symbol.for(\"react.view_transition\"),xm=Symbol.iterator;function j1(e){return e===null||typeof e!=\"object\"?null:(e=xm&&e[xm]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var Em={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Am=Object.assign,Mm={};function Ql(e,t,n){this.props=e,this.context=t,this.refs=Mm,this.updater=n||Em}Ql.prototype.isReactComponent={};Ql.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};Ql.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function Dm(){}Dm.prototype=Ql.prototype;function Cc(e,t,n){this.props=e,this.context=t,this.refs=Mm,this.updater=n||Em}var Oc=Cc.prototype=new Dm;Oc.constructor=Cc;Am(Oc,Ql.prototype);Oc.isPureReactComponent=!0;var Sm=Array.isArray;function Dc(){}var ze={H:null,A:null,T:null,S:null},zm=Object.prototype.hasOwnProperty;function kc(e,t,n){var a=n.ref;return{$$typeof:zc,type:e,key:t,ref:a!==void 0?a:null,props:n}}function X1(e,t){return kc(e.type,t,e.props)}function _c(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===zc}function V1(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(n){return t[n]})}var Tm=/\\/+/g;function Mc(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?V1(\"\"+e.key):t.toString(36)}function Q1(e){switch(e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason;default:switch(typeof e.status==\"string\"?e.then(Dc,Dc):(e.status=\"pending\",e.then(function(t){e.status===\"pending\"&&(e.status=\"fulfilled\",e.value=t)},function(t){e.status===\"pending\"&&(e.status=\"rejected\",e.reason=t)})),e.status){case\"fulfilled\":return e.value;case\"rejected\":throw e.reason}}throw e}function Vl(e,t,n,a,l){var i=typeof e;(i===\"undefined\"||i===\"boolean\")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case\"bigint\":case\"string\":case\"number\":o=!0;break;case\"object\":switch(e.$$typeof){case zc:case O1:o=!0;break;case wm:return o=e._init,Vl(o(e._payload),t,n,a,l)}}if(o)return l=l(e),o=a===\"\"?\".\"+Mc(e,0):a,Sm(l)?(n=\"\",o!=null&&(n=o.replace(Tm,\"$&/\")+\"/\"),Vl(l,t,n,\"\",function(c){return c})):l!=null&&(_c(l)&&(l=X1(l,n+(l.key==null||e&&e.key===l.key?\"\":(\"\"+l.key).replace(Tm,\"$&/\")+\"/\")+o)),t.push(l)),1;o=0;var u=a===\"\"?\".\":a+\":\";if(Sm(e))for(var r=0;r{\"use strict\";_m.exports=km()});var Xm=kn(He=>{\"use strict\";function Bc(e,t){var n=e.length;e.push(t);e:for(;0>>1,l=e[a];if(0>>1;avu(u,n))rvu(c,u)?(e[a]=c,e[r]=n,a=r):(e[a]=u,e[o]=n,a=o);else if(rvu(c,n))e[a]=c,e[r]=n,a=r;else break e}}return t}function vu(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}He.unstable_now=void 0;typeof performance==\"object\"&&typeof performance.now==\"function\"?(Rm=performance,He.unstable_now=function(){return Rm.now()}):(Rc=Date,Um=Rc.now(),He.unstable_now=function(){return Rc.now()-Um});var Rm,Rc,Um,ea=[],ya=[],K1=1,on=null,xt=3,Lc=!1,$i=!1,Fi=!1,Gc=!1,Lm=typeof setTimeout==\"function\"?setTimeout:null,Gm=typeof clearTimeout==\"function\"?clearTimeout:null,Hm=typeof setImmediate<\"u\"?setImmediate:null;function yu(e){for(var t=_n(ya);t!==null;){if(t.callback===null)bu(ya);else if(t.startTime<=e)bu(ya),t.sortIndex=t.expirationTime,Bc(ea,t);else break;t=_n(ya)}}function qc(e){if(Fi=!1,yu(e),!$i)if(_n(ea)!==null)$i=!0,Il||(Il=!0,Zl());else{var t=_n(ya);t!==null&&Yc(qc,t.startTime-e)}}var Il=!1,Wi=-1,qm=5,Ym=-1;function jm(){return Gc?!0:!(He.unstable_now()-Yme&&jm());){var a=on.callback;if(typeof a==\"function\"){on.callback=null,xt=on.priorityLevel;var l=a(on.expirationTime<=e);if(e=He.unstable_now(),typeof l==\"function\"){on.callback=l,yu(e),t=!0;break t}on===_n(ea)&&bu(ea),yu(e)}else bu(ea);on=_n(ea)}if(on!==null)t=!0;else{var i=_n(ya);i!==null&&Yc(qc,i.startTime-e),t=!1}}break e}finally{on=null,xt=n,Lc=!1}t=void 0}}finally{t?Zl():Il=!1}}}var Zl;typeof Hm==\"function\"?Zl=function(){Hm(Uc)}:typeof MessageChannel<\"u\"?(Hc=new MessageChannel,Bm=Hc.port2,Hc.port1.onmessage=Uc,Zl=function(){Bm.postMessage(null)}):Zl=function(){Lm(Uc,0)};var Hc,Bm;function Yc(e,t){Wi=Lm(function(){e(He.unstable_now())},t)}He.unstable_IdlePriority=5;He.unstable_ImmediatePriority=1;He.unstable_LowPriority=4;He.unstable_NormalPriority=3;He.unstable_Profiling=null;He.unstable_UserBlockingPriority=2;He.unstable_cancelCallback=function(e){e.callback=null};He.unstable_forceFrameRate=function(e){0>e||125a?(e.sortIndex=n,Bc(ya,e),_n(ea)===null&&e===_n(ya)&&(Fi?(Gm(Wi),Wi=-1):Fi=!0,Yc(qc,n-a))):(e.sortIndex=l,Bc(ea,e),$i||Lc||($i=!0,Il||(Il=!0,Zl()))),e};He.unstable_shouldYield=jm;He.unstable_wrapCallback=function(e){var t=xt;return function(){var n=xt;xt=t;try{return e.apply(this,arguments)}finally{xt=n}}}});var Qm=kn((kT,Vm)=>{\"use strict\";Vm.exports=Xm()});var Km=kn(St=>{\"use strict\";var J1=Ke();function Im(e){var t=\"https://react.dev/errors/\"+e;if(1{\"use strict\";function Jm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jm)}catch(e){console.error(e)}}Jm(),$m.exports=Km()});var B0=kn(tc=>{\"use strict\";var tt=Qm(),Hg=Ke(),P1=Fm();function N(e){var t=\"https://react.dev/errors/\"+e;if(1ni||(e.current=Ms[ni],Ms[ni]=null,ni--)}function ke(e,t){ni++,Ms[ni]=e.current,e.current=t}var Xn=Zn(null),Eo=Zn(null),ka=Zn(null),ur=Zn(null);function rr(e,t){switch(ke(ka,t),ke(Eo,e),ke(Xn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gg(t),e=f0(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}mt(Xn),ke(Xn,e)}function Ti(){mt(Xn),mt(Eo),mt(ka)}function Ds(e){var t=e.memoizedState;t!==null&&(ki._currentValue=t.memoizedState,ke(ur,e)),t=Xn.current;var n=f0(t,e.type);t!==n&&(ke(Eo,e),ke(Xn,n))}function cr(e){Eo.current===e&&(mt(Xn),mt(Eo)),ur.current===e&&(mt(ur),ki._currentValue=fl)}var jc,np;function Sa(e){if(jc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);jc=t&&t[1]||\"\",np=-1)\":-1l||r[a]!==c[l]){var m=`\n`+r[a].replace(\" at new \",\" at \");return e.displayName&&m.includes(\"\")&&(m=m.replace(\"\",e.displayName)),m}while(1<=a&&0<=l);break}}}finally{Xc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?Sa(n):\"\"}function rb(e,t){switch(e.tag){case 26:case 27:case 5:return Sa(e.type);case 16:return Sa(\"Lazy\");case 13:return e.child!==t&&t!==null?Sa(\"Suspense Fallback\"):Sa(\"Suspense\");case 19:return Sa(\"SuspenseList\");case 0:case 15:return Vc(e.type,!1);case 11:return Vc(e.type.render,!1);case 1:return Vc(e.type,!0);case 31:return Sa(\"Activity\");case 30:return Sa(\"ViewTransition\");default:return\"\"}}function ap(e){try{var t=\"\",n=null;do t+=rb(e,n),n=e,e=e.return;while(e);return t}catch(a){return`\nError generating stack: `+a.message+`\n`+a.stack}}var zs=Object.prototype.hasOwnProperty,kd=tt.unstable_scheduleCallback,Qc=tt.unstable_cancelCallback,cb=tt.unstable_shouldYield,sb=tt.unstable_requestPaint,Kt=tt.unstable_now,db=tt.unstable_getCurrentPriorityLevel,Qg=tt.unstable_ImmediatePriority,Zg=tt.unstable_UserBlockingPriority,sr=tt.unstable_NormalPriority,fb=tt.unstable_LowPriority,Ig=tt.unstable_IdlePriority,mb=tt.log,pb=tt.unstable_setDisableYieldValue,jo=null,Jt=null;function Aa(e){if(typeof mb==\"function\"&&pb(e),Jt&&typeof Jt.setStrictMode==\"function\")try{Jt.setStrictMode(jo,e)}catch{}}var $t=Math.clz32?Math.clz32:vb,gb=Math.log,hb=Math.LN2;function vb(e){return e>>>=0,e===0?32:31-(gb(e)/hb|0)|0}var Tu=256,Nu=262144,wu=4194304;function ul(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Hr(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var u=a&134217727;return u!==0?(a=u&~i,a!==0?l=ul(a):(o&=u,o!==0?l=ul(o):n||(n=u&~e,n!==0&&(l=ul(n))))):(u=a&~i,u!==0?l=ul(u):o!==0?l=ul(o):n||(n=a&~e,n!==0&&(l=ul(n)))),l===0?0:t!==0&&t!==l&&(t&i)===0&&(i=l&-l,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:l}function Xo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Kg(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Vo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bb(e,t,n,a,l,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var u=e.entanglements,r=e.expirationTimes,c=e.hiddenUpdates;for(n=o&~n;0\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),_s=!1;if(ua)try{Kl={},Object.defineProperty(Kl,\"passive\",{get:function(){_s=!0}}),window.addEventListener(\"test\",Kl,Kl),window.removeEventListener(\"test\",Kl,Kl)}catch{_s=!1}var Kl,Ma=null,Bd=null,Vu=null;function sh(){if(Vu)return Vu;var e,t=Bd,n=t.length,a,l=\"value\"in Ma?Ma.value:Ma.textContent,i=l.length;for(e=0;e=fo),hp=\" \",vp=!1;function fh(e,t){switch(e){case\"keyup\":return tx.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function mh(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var li=!1;function ax(e,t){switch(e){case\"compositionend\":return mh(t);case\"keypress\":return t.which!==32?null:(vp=!0,hp);case\"textInput\":return e=t.data,e===hp&&vp?null:e;default:return null}}function lx(e,t){if(li)return e===\"compositionend\"||!Gd&&fh(e,t)?(e=sh(),Vu=Bd=Ma=null,li=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function Sp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tp(e,t){var n=Sp(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Sp(n)}}function vh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vh(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rs(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rs(e.document)}return t}function qd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var fx=ua&&\"documentMode\"in document&&11>=document.documentMode,ii=null,Us=null,po=null,Hs=!1;function Np(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hs||ii==null||ii!==Rs(a)||(a=ii,\"selectionStart\"in a&&qd(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),po&&Do(po,a)||(po=a,a=_r(Us,\"onSelect\"),0>=o,l-=o,Yn=1<<32-$t(t)+l|n<D?(Q=C,C=null):Q=C.sibling;var O=f(p,C,v[D],x);if(O===null){C===null&&(C=Q);break}e&&C&&O.alternate===null&&t(p,C),g=i(O,g,D),U===null?w=O:U.sibling=O,U=O,C=Q}if(D===v.length)return n(p,C),ee&&aa(p,D),w;if(C===null){for(;DD?(Q=C,C=null):Q=C.sibling;var ne=f(p,C,O.value,x);if(ne===null){C===null&&(C=Q);break}e&&C&&ne.alternate===null&&t(p,C),g=i(ne,g,D),U===null?w=ne:U.sibling=ne,U=ne,C=Q}if(O.done)return n(p,C),ee&&aa(p,D),w;if(C===null){for(;!O.done;D++,O=v.next())O=d(p,O.value,x),O!==null&&(g=i(O,g,D),U===null?w=O:U.sibling=O,U=O);return ee&&aa(p,D),w}for(C=a(C);!O.done;D++,O=v.next())O=s(C,p,D,O.value,x),O!==null&&(e&&(Q=O.alternate,Q!==null&&C.delete(Q.key===null?D:Q.key)),g=i(O,g,D),U===null?w=O:U.sibling=O,U=O);return e&&C.forEach(function(Ne){return t(p,Ne)}),ee&&aa(p,D),w}function S(p,g,v,x){if(typeof v==\"object\"&&v!==null&&v.type===ti&&v.key===null&&v.props.ref===void 0&&(v=v.props.children),typeof v==\"object\"&&v!==null){switch(v.$$typeof){case Su:e:{for(var w=v.key;g!==null;){if(g.key===w){if(w=v.type,w===ti){if(g.tag===7){n(p,g.sibling),x=l(g,v.props.children),xa(x,v),x.return=p,p=x;break e}}else if(g.elementType===w||typeof w==\"object\"&&w!==null&&w.$$typeof===Na&&rl(w)===g.type){n(p,g.sibling),x=l(g,v.props),xa(x,v),x.return=p,p=x;break e}n(p,g);break}else t(p,g);g=g.sibling}v.type===ti?(x=ml(v.props.children,p.mode,x,v.key),xa(x,v),x.return=p,p=x):(x=Zu(v.type,v.key,v.props,null,p.mode,x),xa(x,v),x.return=p,p=x)}return o(p);case oo:e:{for(w=v.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(p,g.sibling),x=l(g,v.children||[]),x.return=p,p=x;break e}else{n(p,g);break}else t(p,g);g=g.sibling}x=ts(v,p.mode,x),x.return=p,p=x}return o(p);case Na:return v=rl(v),S(p,g,v,x)}if(uo(v))return h(p,g,v,x);if(eo(v)){if(w=eo(v),typeof w!=\"function\")throw Error(N(150));return v=w.call(v),y(p,g,v,x)}if(typeof v.then==\"function\")return S(p,g,Cu(v),x);if(v.$$typeof===Gn)return S(p,g,zu(p,v),x);Ou(p,v)}return typeof v==\"string\"&&v!==\"\"||typeof v==\"number\"||typeof v==\"bigint\"?(v=\"\"+v,g!==null&&g.tag===6?(n(p,g.sibling),x=l(g,v),x.return=p,p=x):(n(p,g),x=es(v,p.mode,x),x.return=p,p=x),o(p)):n(p,g)}return function(p,g,v,x){try{Oo=0;var w=S(p,g,v,x);return hi=null,w}catch(C){if(C===Bi||C===Vr)throw C;var U=Bt(29,C,null,p.mode);return U.lanes=x,U.return=p,U}}}var Sl=_h(!0),Rh=_h(!1),wa=!1;function Kd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function js(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(se&2)!==0){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=mr(e),Eh(e,null,n),t}return jr(e,a,t,n),mr(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Fg(e,n)}}function as(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xs=!1;function vo(){if(Xs){var e=gi;if(e!==null)throw e}}function yo(e,t,n,a){Xs=!1;var l=e.updateQueue;wa=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var r=u,c=r.next;r.next=null,o===null?i=c:o.next=c,o=r;var m=e.alternate;m!==null&&(m=m.updateQueue,u=m.lastBaseUpdate,u!==o&&(u===null?m.firstBaseUpdate=c:u.next=c,m.lastBaseUpdate=r))}if(i!==null){var d=l.baseState;o=0,m=c=r=null,u=i;do{var f=u.lane&-536870913,s=f!==u.lane;if(s?(oe&f)===f:(a&f)===f){f!==0&&f===xl&&(Xs=!0),m!==null&&(m=m.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var h=e,y=u;f=t;var S=n;switch(y.tag){case 1:if(h=y.payload,typeof h==\"function\"){d=h.call(S,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=y.payload,f=typeof h==\"function\"?h.call(S,d,f):h,f==null)break e;d=Me({},d,f);break e;case 2:wa=!0}}f=u.callback,f!==null&&(e.flags|=64,s&&(e.flags|=8192),s=l.callbacks,s===null?l.callbacks=[f]:s.push(f))}else s={lane:f,tag:u.tag,payload:u.payload,callback:u.callback,next:null},m===null?(c=m=s,r=d):m=m.next=s,o|=f;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;s=u,u=s.next,s.next=null,l.lastBaseUpdate=s,l.shared.pending=null}}while(!0);m===null&&(r=d),l.baseState=r,l.firstBaseUpdate=c,l.lastBaseUpdate=m,i===null&&(l.shared.lanes=0),Za|=o,e.lanes=o,e.memoizedState=d}}function Uh(e,t){if(typeof e!=\"function\")throw Error(N(191,e));e.call(t)}function Hh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ei?i:8;var o=Z.T,u={};u.types=o!==null?o.types:null,Z.T=u,cf(e,!1,t,n);try{var r=l(),c=Z.S;if(c!==null&&c(u,r),r!==null&&typeof r==\"object\"&&typeof r.then==\"function\"){var m=Nx(r,a);bo(e,t,m,Ft(e))}else bo(e,t,a,Ft(e))}catch(d){bo(e,t,{then:function(){},status:\"rejected\",reason:d},Ft())}finally{de.p=i,o!==null&&u.types!==null&&(o.types=u.types),Z.T=o}}function zx(){}function Ks(e,t,n,a){if(e.tag!==5)throw Error(N(476));var l=uv(e).queue;ov(e,l,t,fl,n===null?zx:function(){return rv(e),n(a)})}function uv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fl,baseState:fl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:fl},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rv(e){var t=uv(e);t.next===null&&(t=e.alternate.memoizedState),bo(e,t.next.queue,{},Ft())}function rf(){return ft(ki)}function cv(){return Qe().memoizedState}function sv(){return Qe().memoizedState}function Cx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ft();e=Ra(n);var a=Ua(t,e,n);a!==null&&(Lt(a,t,n),ho(a,t,n)),t={cache:Qd()},e.payload=t;return}t=t.return}}function Ox(e,t,n){var a=Ft();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Kr(e)?fv(t,n):(n=jd(e,t,n,a),n!==null&&(Lt(n,e,a),mv(n,t,a)))}function dv(e,t,n){var a=Ft();bo(e,t,n,a)}function bo(e,t,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Kr(e))fv(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,u=i(o,n);if(l.hasEagerState=!0,l.eagerState=u,Wt(u,o))return jr(e,t,l,0),Ae===null&&Yr(),!1}catch{}if(n=jd(e,t,l,a),n!==null)return Lt(n,e,a),mv(n,t,a),!0}return!1}function cf(e,t,n,a){if(a={lane:2,revertLane:xf(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Kr(e)){if(t)throw Error(N(479))}else t=jd(e,n,a,2),t!==null&&Lt(t,e,2)}function Kr(e){var t=e.alternate;return e===F||t!==null&&t===F}function fv(e,t){vi=xr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mv(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Fg(e,n)}}var Tr={readContext:ft,use:Zr,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye,useEffectEvent:Ye},pv={readContext:ft,use:Zr,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:Gp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$u(4194308,4,tv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $u(4194308,4,e,t)},useInsertionEffect:function(e,t){$u(4,2,e,t)},useMemo:function(e,t){var n=Dt();t=t===void 0?null:t;var a=e();if(Tl){Aa(!0);try{e()}finally{Aa(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Dt();if(n!==void 0){var l=n(t);if(Tl){Aa(!0);try{n(t)}finally{Aa(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=Ox.bind(null,F,e),[a.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Zs(e);var t=e.queue,n=dv.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:of,useDeferredValue:function(e,t){var n=Dt();return uf(n,e,t)},useTransition:function(){var e=Zs(!1);return e=ov.bind(null,F,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=F,l=Dt();if(ee){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),Ae===null)throw Error(N(349));(oe&127)!==0||Yh(a,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Gp(Xh.bind(null,a,i,e),[e]),a.flags|=2048,Ei(9,{destroy:void 0},jh.bind(null,a,i,n,t),null),n},useId:function(){var e=Dt(),t=Ae.identifierPrefix;if(ee){var n=jn,a=Yn;n=(a&~(1<<32-$t(a)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=Sr++,0<\\/script>\",i=i.removeChild(i.firstChild);break;case\"select\":i=typeof a.is==\"string\"?o.createElement(\"select\",{is:a.is}):o.createElement(\"select\"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is==\"string\"?o.createElement(l,{is:a.is}):o.createElement(l)}}i[dt]=t,i[qt]=a;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(gt(i,l,a),l){case\"button\":case\"input\":case\"select\":case\"textarea\":a=!!a.autoFocus;break e;case\"img\":a=!0;break e;default:a=!1}a&&na(t)}}return Ce(t),t.subtreeFlags&=-33554433,us(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&na(t);else{if(typeof a!=\"string\"&&t.stateNode===null)throw Error(N(166));if(e=ka.current,Jl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=it,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||d0(e.nodeValue,n)),e||Xa(t,!0)}else e=Ho(e).createTextNode(a),e[dt]=t,t.stateNode=e}return Ce(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Jl(t),n!==null){if(e===null){if(!a)throw Error(N(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(557));e[dt]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ce(t),e=!1}else n=ns(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Qt(t),t):(Qt(t),null);if((t.flags&128)!==0)throw Error(N(558))}return Ce(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Jl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(N(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(N(317));l[dt]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ce(t),l=!1}else l=ns(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(Qt(t),t):(Qt(t),null)}return Qt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==l&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ru(t,t.updateQueue),Ce(t),null);case 4:return Ti(),e===null&&Sf(t.stateNode.containerInfo),t.flags|=67108864,Ce(t),null;case 10:return oa(t.type),Ce(t),null;case 19:if($d(t),a=t.memoizedState,a===null)return Ce(t),null;if(l=(t.flags&128)!==0,i=a.rendering,i===null)if(l)no(a,!1);else{if(je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=br(e),i!==null){for(t.flags|=128,no(a,!1),e=i.updateQueue,t.updateQueue=e,Ru(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ah(n,e),n=n.sibling;return ko(t,pt.current&1|2),ee&&aa(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Kt()>zr&&(t.flags|=128,l=!0,no(a,!1),t.lanes=4194304)}else{if(!l)if(e=br(i),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Ru(t,e),no(a,!0),a.tail===null&&a.tailMode!==\"collapsed\"&&a.tailMode!==\"visible\"&&!i.alternate&&!ee)return Ce(t),null}else 2*Kt()-a.renderingStartTime>zr&&n!==536870912&&(t.flags|=128,l=!0,no(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}if(a.tail!==null){e=a.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Kt(),e.sibling=null,i=pt.current,i=l?i&1|2:i&1,a.tailMode===\"visible\"||a.tailMode===\"collapsed\"||!n||ee?ko(t,i):(n=i,ke(ht,t),ke(pt,n),Tt===null&&(Tt=t)),ee&&aa(t,a.treeForkCount),e}return Ce(t),null;case 22:case 23:return Qt(t),Jd(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ce(t),t.subtreeFlags&6&&(t.flags|=8192)):Ce(t),n=t.updateQueue,n!==null&&Ru(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&mt(pl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),oa($e),Ce(t),null;case 25:return null;case 30:return t.flags|=33554432,Ce(t),null}throw Error(N(156,t.tag))}function Lx(e,t){switch(Vd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return oa($e),Ti(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return cr(t),null;case 31:if(t.memoizedState!==null){if(Qt(t),t.alternate===null)throw Error(N(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $d(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ti(),null;case 10:return oa(t.type),null;case 22:case 23:return Qt(t),Jd(),e!==null&&mt(pl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return oa($e),null;case 25:return null;default:return null}}function Ev(e,t){switch(Vd(t),t.tag){case 3:oa($e),Ti();break;case 26:case 27:case 5:cr(t);break;case 4:Ti();break;case 31:t.memoizedState!==null&&Qt(t);break;case 13:Qt(t);break;case 19:$d(t);break;case 10:oa(t.type);break;case 22:case 23:Qt(t),Jd(),e!==null&&mt(pl);break;case 24:oa($e)}}function Jo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var i=n.create,o=n.inst;a=i(),o.destroy=a}n=n.next}while(n!==l)}}catch(u){be(t,t.return,u)}}function Qa(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&e)===e){var o=a.inst,u=o.destroy;if(u!==void 0){o.destroy=void 0,l=t;var r=n,c=u;try{c()}catch(m){be(l,r,m)}}}a=a.next}while(a!==i)}}catch(m){be(t,t.return,m)}}function Av(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hh(t,n)}catch(a){be(e,e.return,a)}}}function Mv(e,t,n){n.props=Nl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){be(e,t,a)}}function Bn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:var l=e.stateNode,i=ra(e.memoizedProps,l);(l.ref===null||l.ref.name!==i)&&(l.ref=v0(i)),a=l.ref;break;case 7:if(e.stateNode===null){var o=new Pt(e);Gt(e.child,!1,A2,o,void 0,void 0),e.stateNode=o}a=e.stateNode;break;default:a=e.stateNode}typeof n==\"function\"?e.refCleanup=n(a):n.current=a}}catch(u){be(e,t,u)}}function st(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a==\"function\")try{a()}catch(l){be(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(l){be(e,t,l)}else n.current=null}function wr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title\"))),gt(a,t,n),a[dt]=e,lt(a),t=a;break e;case\"link\":if(i=Mg(\"link\",\"href\",l).get(t+(n.href||\"\"))){for(o=0;oS&&(o=S,S=y,y=o);var p=Tp(u,y),g=Tp(u,S);if(p&&g&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==g.node||s.focusOffset!==g.offset)){var v=d.createRange();v.setStart(p.node,p.offset),s.removeAllRanges(),y>S?(s.addRange(v),s.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),s.addRange(v))}}}}for(d=[],s=u;s=s.parentNode;)s.nodeType===1&&d.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof u.focus==\"function\"&&u.focus(),u=0;un?32:n,Z.T=null,n=md,md=null;var i=An,o=Vn;if(Ge=0,wl=An=null,Vn=0,(se&6)!==0)throw Error(N(331));var u=se;if(se|=4,Zv(i.current),Xv(i,i.current,o,n),se=u,$o(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot==\"function\")try{Jt.onPostCommitFiberRoot(jo,i)}catch{}return!0}finally{de.p=l,Z.T=a,l0(e,t)}}function ug(e,t,n){t=fn(n,t),t=$s(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Vo(e,2),In(e))}function be(e,t,n){if(e.tag===3)ug(e,e,n);else for(;t!==null;){if(t.tag===3){ug(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof a.componentDidCatch==\"function\"&&(La===null||!La.has(a))){e=fn(n,e),n=bv(2),a=Ua(t,n,2),a!==null&&(xv(n,a,t,e),Vo(a,2),In(a));break}}t=t.return}}function fs(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new jx;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(yf=!0,l.add(n),e=$x.bind(null,e,t,n),t.then(e,e))}function $x(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ae===e&&(oe&n)===n&&((je===4||je===3&&(oe&62914560)===oe&&300>Kt()-$r)&&(se&2)===0?Di(e,0):Dr|=n,Ai===oe&&(Ai=0)),In(e)}function i0(e,t){t===0&&(t=Jg()),e=Dl(e,t),e!==null&&(Vo(e,t),In(e))}function Fx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),i0(e,n)}function Wx(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(N(314))}a!==null&&a.delete(t),i0(e,n)}function Px(e,t){return kd(e,t)}var zi=null,Pl=null,yd=!1,kr=!1,ms=!1,Oa=0;function In(e){e!==Pl&&e.next===null&&(Pl===null?zi=Pl=e:Pl=Pl.next=e),kr=!0,yd||(yd=!0,t2())}function $o(e,t){if(!ms&&kr){ms=!0;do for(var n=!1,a=zi;a!==null;){if(!t)if(e!==0){var l=a.pendingLanes;if(l===0)var i=0;else{var o=a.suspendedLanes,u=a.pingedLanes;i=(1<<31-$t(42|e)+1)-1,i&=l&~(o&~u),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,rg(a,i))}else i=oe,i=Hr(a,a===Ae?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Xo(a,i)||(n=!0,rg(a,i));a=a.next}while(n);ms=!1}}function e2(){o0()}function o0(){kr=yd=!1;var e=0;Oa!==0&&s2()&&(e=Oa);for(var t=Kt(),n=null,a=zi;a!==null;){var l=a.next,i=u0(a,t);i===0?(a.next=null,n===null?zi=l:n.next=l,l===null&&(Pl=n)):(n=a,(e!==0||(i&3)!==0)&&(kr=!0)),a=l}Ge!==0&&Ge!==5||$o(e,!1),Oa!==0&&(Oa=0)}function u0(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes&-62914561;0u)break;var m=r.transferSize,d=r.initiatorType;m&&pg(d)&&(r=r.responseEnd,o+=m*(rlr){y.length=h;break}v=new Promise(h2.bind(v)),y.push(v)}}}if(0\"u\"?null:document;function E0(e,t,n){var a=qi;if(a&&typeof t==\"string\"&&t){var l=dn(t);l='link[rel=\"'+e+'\"][href=\"'+l+'\"]',typeof n==\"string\"&&(l+='[crossorigin=\"'+n+'\"]'),wg.has(l)||(wg.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement(\"link\"),gt(t,\"link\",e),lt(t),a.head.appendChild(t)))}}function U2(e){ga.D(e),E0(\"dns-prefetch\",e,null)}function H2(e,t){ga.C(e,t),E0(\"preconnect\",e,t)}function B2(e,t,n){ga.L(e,t,n);var a=qi;if(a&&e&&t){var l='link[rel=\"preload\"][as=\"'+dn(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(l+='[imagesrcset=\"'+dn(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(l+='[imagesizes=\"'+dn(n.imageSizes)+'\"]')):l+='[href=\"'+dn(e)+'\"]';var i=l;switch(t){case\"style\":i=Oi(e);break;case\"script\":i=Yi(e)}if(!(gn.has(i)||(e=Me({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),gn.set(i,e),a.querySelector(l)!==null||t===\"style\"&&a.querySelector(Fo(i))||t===\"script\"&&a.querySelector(Wo(i))))){var o=a.createElement(\"link\");gt(o,\"link\",e),t===\"style\"&&(o[dr]=!0,o.onload=o.onerror=function(){eh(o)}),lt(o),a.head.appendChild(o)}}}function L2(e,t){ga.m(e,t);var n=qi;if(n&&e){var a=t&&typeof t.as==\"string\"?t.as:\"script\",l='link[rel=\"modulepreload\"][as=\"'+dn(a)+'\"][href=\"'+dn(e)+'\"]',i=l;switch(a){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":i=Yi(e)}if(!gn.has(i)&&(e=Me({rel:\"modulepreload\",href:e},t),gn.set(i,e),n.querySelector(l)===null)){switch(a){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(Wo(i)))return}a=n.createElement(\"link\"),gt(a,\"link\",e),lt(a),n.head.appendChild(a)}}}function G2(e,t,n){ga.S(e,t,n);var a=qi;if(a&&e){var l=fi(a).hoistableStyles,i=Oi(e);t=t||\"default\";var o=l.get(i);if(!o){var u={loading:0,preload:null};if(o=a.querySelector(Fo(i)))u.loading=5;else{e=Me({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=gn.get(i))&&Ef(e,n);var r=o=a.createElement(\"link\");lt(r),gt(r,\"link\",e),r._p=new Promise(function(c,m){r.onload=c,r.onerror=m}),r.addEventListener(\"load\",function(){u.loading|=1}),r.addEventListener(\"error\",function(){u.loading|=2}),u.loading|=4,nr(o,t,a)}o={type:\"stylesheet\",instance:o,count:1,state:u},l.set(i,o)}}}function q2(e,t){ga.X(e,t);var n=qi;if(n&&e){var a=fi(n).hoistableScripts,l=Yi(e),i=a.get(l);i||(i=n.querySelector(Wo(l)),i||(e=Me({src:e,async:!0},t),(t=gn.get(l))&&Af(e,t),i=n.createElement(\"script\"),lt(i),gt(i,\"link\",e),n.head.appendChild(i)),i={type:\"script\",instance:i,count:1,state:null},a.set(l,i))}}function Y2(e,t){ga.M(e,t);var n=qi;if(n&&e){var a=fi(n).hoistableScripts,l=Yi(e),i=a.get(l);i||(i=n.querySelector(Wo(l)),i||(e=Me({src:e,async:!0,type:\"module\"},t),(t=gn.get(l))&&Af(e,t),i=n.createElement(\"script\"),lt(i),gt(i,\"link\",e),n.head.appendChild(i)),i={type:\"script\",instance:i,count:1,state:null},a.set(l,i))}}function Eg(e,t,n,a){var l=(l=ka.current)?Bo(l):null;if(!l)throw Error(N(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(n=Oi(n.href),t=fi(l).hoistableStyles,a=t.get(n),a||(a={type:\"style\",instance:null,count:0,state:null},t.set(n,a)),a):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=Oi(n.href);var i=fi(l).hoistableStyles,o=i.get(e);if(o||(l=l.ownerDocument||l,o={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=l.querySelector(Fo(e)))?i._p||(o.instance=i,o.state.loading=5):(i=gn.get(e),i||(i={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gn.set(e,i)),j2(l,e,i,o.state))),t&&a===null)throw Error(N(528,\"\"));return o}if(t&&a!==null)throw Error(N(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(n=Yi(n),t=fi(l).hoistableScripts,a=t.get(n),a||(a={type:\"script\",instance:null,count:0,state:null},t.set(n,a)),a):{type:\"void\",instance:null,count:0,state:null};default:throw Error(N(444,e))}}function Oi(e){return'href=\"'+dn(e)+'\"'}function Fo(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function A0(e){return Me({},e,{\"data-precedence\":e.precedence,precedence:null})}function j2(e,t,n,a){if(t=e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")){if(t[dr]!==!0){a.loading=1;return}}else t=e.createElement(\"link\"),t[dr]=!0,t.onload=t.onerror=eh.bind(null,t),gt(t,\"link\",n),lt(t),e.head.appendChild(t);a.preload=t,t.addEventListener(\"load\",function(){return a.loading|=1}),t.addEventListener(\"error\",function(){return a.loading|=2})}function Yi(e){return'[src=\"'+dn(e)+'\"]'}function Wo(e){return\"script[async]\"+e}function Ag(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var a=e.querySelector('style[data-href~=\"'+dn(n.href)+'\"]');if(a)return t.instance=a,lt(a),a;var l=Me({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement(\"style\"),lt(a),gt(a,\"style\",l),nr(a,n.precedence,e),t.instance=a;case\"stylesheet\":l=Oi(n.href);var i=e.querySelector(Fo(l));if(i)return t.state.loading|=4,t.instance=i,lt(i),i;a=A0(n),(l=gn.get(l))&&Ef(a,l),i=(e.ownerDocument||e).createElement(\"link\"),lt(i);var o=i;return o._p=new Promise(function(u,r){o.onload=u,o.onerror=r}),gt(i,\"link\",a),t.state.loading|=4,nr(i,n.precedence,e),t.instance=i;case\"script\":return i=Yi(n.src),(l=e.querySelector(Wo(i)))?(t.instance=l,lt(l),l):(a=n,(l=gn.get(i))&&(a=Me({},n),Af(a,l)),e=e.ownerDocument||e,l=e.createElement(\"script\"),lt(l),gt(l,\"link\",a),e.head.appendChild(l),t.instance=l);case\"void\":return null;default:throw Error(N(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,nr(a,n.precedence,e));return t.instance}function nr(e,t,n){for(var a=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,i=l,o=0;o title\"):null)}function X2(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;return t.rel===\"stylesheet\"?(e=t.disabled,typeof t.precedence==\"string\"&&e==null):!0;case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function Dg(e,t){return e===\"img\"&&t.src!=null&&t.src!==\"\"&&t.onLoad==null&&t.loading!==\"lazy\"}function M0(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function D0(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==\"number\"?devicePixelRatio:1)*.25}function zg(e,t){typeof t.decode==\"function\"&&(e.imgCount++,t.complete||(e.imgBytes+=D0(t),e.suspenseyImages.push(t)),e=Z2.bind(e),t.decode().then(e,e))}function V2(e,t,n,a){if(n.type===\"stylesheet\"&&(typeof a.media!=\"string\"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=Oi(a.href),i=t.querySelector(Fo(l));if(i){t=i._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=Lo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,lt(i);return}i=t.ownerDocument||t,a=A0(a),(l=gn.get(l))&&Ef(a,l),i=i.createElement(\"link\"),lt(i);var o=i;o._p=new Promise(function(u,r){o.onload=u,o.onerror=r}),gt(i,\"link\",a),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Lo.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var lr=0;function Q2(e,t){return e.stylesheets&&e.count===0&&ir(e,e.stylesheets),0lr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function z0(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ir(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Lo(){this.count--,z0(this)}function Z2(){this.imgCount--,z0(this)}var Rr=null;function ir(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Rr=new Map,t.forEach(I2,e),Rr=null,Lo.call(e))}function I2(e,t){if(!(t.state.loading&4)){var n=Rr.get(e);if(n)var a=n.get(null);else{n=new Map,Rr.set(e,n);for(var l=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),i=0;i{\"use strict\";function L0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(L0)}catch(e){console.error(e)}}L0(),G0.exports=B0()});var j0=kn(nc=>{\"use strict\";var tS=Symbol.for(\"react.transitional.element\"),nS=Symbol.for(\"react.fragment\");function Y0(e,t,n){var a=null;if(n!==void 0&&(a=\"\"+n),t.key!==void 0&&(a=\"\"+t.key),\"key\"in t){n={};for(var l in t)l!==\"key\"&&(n[l]=t[l])}else n=t;return t=n.ref,{$$typeof:tS,type:e,key:a,ref:t!==void 0?t:null,props:n}}nc.Fragment=nS;nc.jsx=Y0;nc.jsxs=Y0});var P=kn((LT,X0)=>{\"use strict\";X0.exports=j0()});var va={manifestSchema:6,bundleFormat:3,protocol:1,adapterApi:1,sessionState:1,importEnvelope:1,credentialEnvelope:1,packagesIndex:1},u1=[\"RETIRED\",\"CONFLICT\",\"NOT_FOUND\",\"DOCUMENT_TOO_LARGE\",\"STORAGE_FAILURE\",\"ORIGIN_NOT_DECLARED\",\"MESSAGE_TOO_LARGE\",\"PAGE_TOO_LARGE\",\"PATCH_TOO_LARGE\",\"DEADLINE\",\"INVALID_STEPS\",\"SERVICE_UNREACHABLE\",\"SERVICE_FAILURE\",\"AUTHENTICATION_FAILED\",\"CERTIFICATE_FAILED\",\"CONFIGURATION_REQUIRED\",\"NOT_READY\",\"UNKNOWN_METHOD\",\"INVALID_ARGUMENT\",\"QUOTA_EXCEEDED\",\"PROTOCOL_MISMATCH\",\"APPLET_INCOMPATIBLE\",\"ENVELOPE_INVALID\",\"CONTEXT_REPLACED\",\"TARGET_NOT_FOUND\",\"PRECONDITION_FAILED\",\"ASYNC_READ\",\"AUTH_REQUIRED\",\"REJECTED\"];function sm(e){return typeof e==\"string\"&&u1.includes(e)}var r1=/^:[A-Za-z][A-Za-z0-9_]*$/,c1=/^[A-Za-z0-9_.~@-]+$/,Nc=new Map;function s1(e){if(Nc.has(e))return Nc.get(e);let t=null;if(e.startsWith(\"/\")&&e.length<=256){let n=e===\"/\"?[]:e.slice(1).split(\"/\"),a=n.at(-1)===\"*\";a&&n.pop();let l=[],i=!0;for(let o of n)r1.test(o)?l.push({param:o.slice(1)}):c1.test(o)&&o!==\".\"&&o!==\"..\"?l.push({literal:o}):i=!1;i&&(t={segments:l,rest:a})}return Nc.set(e,t),t}function We(e){try{return new URL(e).href}catch{return null}}function jl(e,t){let n=d1(t);if(!n||!e.origins.includes(n.origin))return{kind:\"external\",url:t};let a;try{a=n.pathname.split(\"/\").slice(1).map(decodeURIComponent)}catch{return{kind:\"website\",url:t}}a.at(-1)===\"\"&&a.pop();for(let l of e.routes){let i=s1(l.pattern);if(!i)continue;let o=f1(i,a);if(!o||!(l.query??[]).every(r=>n.searchParams.has(r)))continue;for(let r of l.query??[])o[r]=n.searchParams.get(r);let u={kind:\"route\",routeId:l.id,page:l.page,screen:l.screen,params:o};return l.context!==void 0&&(u.context=l.context),u}return{kind:\"website\",url:t}}function d1(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==\"https:\"||t.username||t.password?null:t}function f1(e,t){if(e.rest?t.lengthy.id===i.id)?.startUrl;c={index:u.index,start:h!==void 0&&We(h)===We(t.view.url),url:s}}}else t.status===\"ready\"&&t.account!==null&&r===\"auth\"&&(r=\"none\",c=null);u.page.status===\"ready\"&&(t.status===\"loading\"||t.status===\"error\")&&(m++,d=!1,a.push({type:\"schedule\",id:i.id,token:m}));let f={...u,seen:Math.max(u.seen,t.view.n),pin:r,signIn:c,deadline:m,page:{status:t.status,pageId:t.pageId,routeId:t.routeId,view:t.view,stale:t.stale,expired:d}};return{state:ll(rm(e,i,f),f),effects:a}}case\"deadline\":{let i=e.contexts[t.id];return!i||t.token!==i.deadline||i.page.status===\"ready\"||i.page.expired?l:{state:ll(e,{...i,page:{...i.page,expired:!0}}),effects:a}}case\"user.viewWebsite\":{let i=e.contexts[t.id];return!i||i.pin===\"user\"?l:{state:ll(e,{...i,pin:\"user\"}),effects:a}}case\"user.done\":{let i=e.contexts[t.id];if(!i)return l;if(i.pin===\"auth\"&&i.signIn)return im(e,i,n)??l;let o=i.pin===\"none\"?i:{...i,pin:\"none\"},u=o===i?e:ll(e,o);if(pu(o,n)!==\"website\")return{state:u,effects:a};if(o.canGoBack)a.push({type:\"context.back\",id:i.id});else{let r=n.contexts.find(c=>c.id===i.id)?.startUrl;r&&a.push({type:\"context.navigate\",id:i.id,url:r,mode:\"push\"})}return{state:u,effects:a}}case\"navigate.url\":{let i=t.context??e.active;return e.contexts[i]?(a.push({type:\"context.navigate\",id:i,url:t.url,mode:t.mode}),{state:{...e,active:i,overlay:[],leaveGuard:null},effects:a}):l}case\"navigate.screen\":{let i=t.mode===\"root\"?[t.screen]:t.mode===\"replace\"?[...e.overlay.slice(0,-1),t.screen]:[...e.overlay,t.screen];return{state:{...e,overlay:i,leaveGuard:null},effects:a}}case\"select\":{let i=e.contexts[t.id];if(!i)return l;if(t.id!==e.active||e.overlay.length>0)return{state:{...e,active:t.id,overlay:[],leaveGuard:null},effects:a};let o=n.contexts.find(u=>u.id===t.id)?.startUrl;return o&&(i.url===null||We(i.url)!==We(o))&&a.push({type:\"context.navigate\",id:t.id,url:o,mode:\"push\"}),{state:{...e,leaveGuard:null},effects:a}}case\"back\":{if(e.leaveGuard)return{state:e,effects:[{type:\"confirmLeave\",message:e.leaveGuard.message}]};if(e.overlay.length>0)return{state:{...e,overlay:e.overlay.slice(0,-1)},effects:a};let i=e.contexts[e.active];return i?.pin===\"auth\"&&i.signIn?im(e,i,n)??{state:e,effects:[{type:\"leave\"}]}:e.contexts[e.active]?.canGoBack?{state:e,effects:[{type:\"context.back\",id:e.active}]}:{state:e,effects:[{type:\"leave\"}]}}case\"guard\":return{state:{...e,leaveGuard:t.guard},effects:a};case\"context.gone\":{let i=e.contexts[t.id];return i?{state:ll(e,{...i,page:{...Ec,status:\"unsupported\"}}),effects:a}:l}}}function im(e,t,n){let{index:a,start:l}=t.signIn,i=n.contexts[0].id,o=ll(e,{...t,pin:\"none\",signIn:null});if(!l&&a>0){let u=Math.max(1,t.index-a+1);return{state:o,effects:[{type:\"context.back\",id:t.id,steps:u}]}}return t.id===i?null:{state:{...o,active:i,overlay:[],leaveGuard:null},effects:[]}}function om(e,t,n){return t===e.generation&&e.url!==null&&We(n)===We(e.url)}function um(e,t,n,a){let l=e.deadline+1;return a.push({type:\"schedule\",id:e.id,token:l}),{...e,url:n,seen:t===e.generation?e.seen:-1,generation:t,page:Ec,deadline:l}}function rm(e,t,n){return!e.leaveGuard||t.id!==e.active||e.overlay.length>0||t.index===n.index&&t.url!==null&&n.url!==null&&We(t.url)===We(n.url)?e:{...e,leaveGuard:null}}function ll(e,t){return{...e,contexts:{...e.contexts,[t.id]:t}}}function Ac(e){let t={};for(let[n,a]of Object.entries(e.contexts))t[n]={url:a.url};return{version:va.sessionState,state:{active:e.active,overlay:e.overlay,contexts:t}}}function mm(e,t){let n=m1(t);if(!e||e.version!==va.sessionState||!Ji(e.state))return n;let{active:a,overlay:l,contexts:i}=e.state,o={...n,contexts:{...n.contexts}};if(typeof a==\"string\"&&o.contexts[a]&&(o.active=a),Array.isArray(l)&&(o.overlay=l.filter(u=>g1(u,t.foreground.screens))),Ji(i))for(let u of Object.keys(o.contexts)){let r=Ji(i[u])?i[u].url:void 0;typeof r==\"string\"&&(o.contexts[u]=dm(u,r))}return o}function g1(e,t){return Ji(e)&&typeof e.key==\"string\"&&typeof e.id==\"string\"&&t.includes(e.id)&&Ji(e.params)&&Object.values(e.params).every(n=>typeof n==\"string\")}function Ji(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var TT=va.bundleFormat,wc=\"(0|[1-9]\\\\d*)\",cm=\"(?:0|[1-9]\\\\d*|\\\\d*[A-Za-z-][0-9A-Za-z-]*)\",NT=new RegExp(`^${wc}\\\\.${wc}\\\\.${wc}(?:-(${cm}(?:\\\\.${cm})*))?$`),Sn=class extends Error{code;constructor(e,t){super(t),this.name=\"GenesisError\",this.code=e}},h1=2e3;function pm(e,t){return new Promise((n,a)=>{let l=null,i=!1,o=1,u=new Map,r=new Map,c={get bound(){return l},get retired(){return i},request(s,h={}){if(i)return Promise.reject(new Sn(\"RETIRED\",\"This page was closed\"));let y=o++;return new Promise((S,p)=>{let g=setTimeout(()=>{u.delete(y),p(new Sn(\"DEADLINE\",`${s} did not answer in time`))},l.limits.rpcDeadlineMs+h1);u.set(y,{resolve:S,reject:p,timer:g}),e.postMessage(JSON.stringify({type:\"request\",documentId:l.documentId,requestId:y,method:s,params:h}))})},on(s,h){let y=r.get(s);return y||r.set(s,y=new Set),y.add(h),()=>{y.delete(h)}}};function m(){i=!0;for(let s of u.values())clearTimeout(s.timer),s.reject(new Sn(\"RETIRED\",\"This page was closed\"));u.clear()}function d(s,h){for(let y of[...r.get(s)??[]])try{y(h)}catch(S){console.error(`Genesis ${s} handler failed`,S)}}e.addEventListener(\"message\",s=>{if(i||typeof s.data!=\"string\")return;let h;try{h=JSON.parse(s.data)}catch{return}if(h?.type===\"refused\"&&!l){i=!0,a(new Sn(h.error?.code??\"PROTOCOL_MISMATCH\",h.error?.message??\"The host refused this page\"));return}if(h?.type===\"bound\"){if(l)return;l=h,n(c);return}if(!(!l||h?.documentId!==l.documentId))if(h.type===\"response\"){let y=u.get(h.requestId);if(!y)return;u.delete(h.requestId),clearTimeout(y.timer),h.error?y.reject(new Sn(h.error.code,h.error.message)):y.resolve(h.result??null)}else h.type===\"event\"&&(h.name===\"retired\"?(m(),d(\"retired\",{})):d(h.name,h.data))}),addEventListener(\"pagehide\",()=>{i||(d(\"pagehide\",{}),m())});let f={type:\"hello\",protocol:va.protocol,url:t};e.postMessage(JSON.stringify(f))})}var v1={pageId:null,routeId:null,params:{}};function y1(e,t){let n={};for(let d of e)n[d]=b1();let a={account:null,contexts:n},l=!1,i=new Map;function o(d){let f=d===null?[...i.values()]:[i.get(null),...d.map(h=>i.get(h))],s=new Set;for(let h of f)for(let y of[...h??[]])s.has(y)||(s.add(y),y())}function u(d,f){a={...a,contexts:{...a.contexts,[d]:f}}}function r(d){let{entry:f}=d;if(!d.attached||d.status!==\"ready\"||!f||!Xl(f.url,d.url))return;let{history:s}=d;for(s.delete(f.index),s.set(f.index,hm(d));s.size>t.historyEntriesMax;)s.delete(s.keys().next().value)}function c(d,f,s){if(f===void 0||s!==\"ready\"&&s!==\"auth\")return!1;if(!l)return l=!0,a.account!==f&&(a={...a,account:f}),!1;if(f===a.account)return!1;let h={};for(let[y,S]of Object.entries(a.contexts))S.history.clear(),h[y]=y===d||!S.content||S.stale?S:{...S,stale:!0};return a={account:f,contexts:h},r(h[d]),!0}let m=(d,f=!1)=>({outcome:d,accountChanged:f});return{state:()=>a,context:d=>a.contexts[d],applyPage(d,f,s){let h=a.contexts[d];if(!h||f=f.size||g===f.index&&!Xl(v.url,f.url))&&y.delete(g)}let S={...h,generation:f.generation,entry:{index:f.index,url:f.url}},p;if(Xl(h.url,f.url))h.attached&&h.view?.generation!==f.generation?p={...S,attached:!1,status:\"loading\",error:null,stale:h.content}:p=S;else{let g=y.get(f.index);p=g?{...S,...g,attached:!1,status:\"loading\",error:null,stale:!0,content:!0}:{...S,...s,url:f.url,regions:{},attached:!1,status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1}}u(d,p),r(p),o([d])},gone(d,f){let s=a.contexts[d];s&&(u(d,{...s,attached:!1,status:\"error\",error:f,stale:s.content}),o([d]))},subscribe(d,f){let s=f??null,h=i.get(s);return h||i.set(s,h=new Set),h.add(d),()=>{h.delete(d)}}}}function b1(){return{generation:0,view:null,epoch:0,seq:0,live:[],attached:!1,url:null,pageId:null,routeId:null,params:{},regions:{},status:\"loading\",error:null,signInUrl:null,stale:!1,content:!1,entry:null,history:new Map}}function Xl(e,t){return e!==null&&t!==null&&We(e)===We(t)}function hm(e){return{url:e.url,pageId:e.pageId,routeId:e.routeId,params:e.params,regions:e.regions}}function x1(e,t){if(e.content&&Xl(e.url,t))return hm(e);let{entry:n}=e,a=n&&Xl(n.url,t)?e.history.get(n.index):void 0;return a&&Xl(a.url,t)?a:null}function vm(e,t=Object.create(null)){for(let n of e)t[n.key]=n;return t}function ym(e){return e.kind===\"single\"?{kind:\"single\",status:e.status,error:e.error??null,record:e.record}:{kind:\"collection\",status:e.status,error:e.error??null,order:e.items.map(t=>t.key),complete:e.complete,ephemeral:e.ephemeral===!0,records:vm(e.items)}}function S1(e,t){let n={};for(let[a,l]of Object.entries(e)){let i=ym(l),o=t[a];n[a]=o?T1(o,i):i}return n}var gu=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function T1(e,t){if(e.kind===\"single\"||t.kind===\"single\")return e.kind!==\"single\"||t.kind!==\"single\"?t:(gu(e.record,t.record)&&(t.record=e.record),e.record===t.record&&e.status===t.status&&gu(e.error,t.error)?e:t);let n=e.order.length===t.order.length&&e.complete===t.complete&&e.ephemeral===t.ephemeral&&e.status===t.status&&gu(e.error,t.error);for(let[a,l]of t.order.entries()){let i=e.records[l];i&&gu(i,t.records[l])?t.records[l]=i:n=!1,e.order[a]!==l&&(n=!1)}return n?e:t}function N1(e,t){let n=e.regions;for(let[a,l]of Object.entries(t)){let i=e.live.includes(a)?n[a]:void 0;if(!i)return null;let o;if(l.kind===\"replace\")o=ym(l.region);else if(l.kind===\"single\"){if(i.kind!==\"single\")return null;o={...i,record:l.record,status:l.status??i.status,error:l.error===void 0?i.error:l.error}}else{if(i.kind!==\"collection\")return null;if(o={...i,complete:l.complete??i.complete,status:l.status??i.status,error:l.error===void 0?i.error:l.error},l.upsert?.length||l.remove?.length){o.records=vm(l.upsert??[],Object.assign(Object.create(null),i.records));for(let u of l.remove??[])delete o.records[u]}if(l.order){o.order=l.order;let u=new Set(l.order);for(let r of Object.keys(o.records))u.has(r)||(o.records===i.records&&(o.records=Object.assign(Object.create(null),i.records)),delete o.records[r])}else if(l.remove?.length){let u=new Set(l.remove);o.order=i.order.filter(r=>!u.has(r))}}n===e.regions&&(n={...n}),n[a]=o}return n}var w1=class extends Sn{constructor(e,t){super(e,t),this.name=\"ServiceError\"}};async function bm(e=window.__genesisBridge){if(!e)throw new Error(\"Genesis bridge is missing; the foreground must run inside Genesis\");let t=await pm(e,location.href),{compat:n}=t.bound;if(n.protocol!==va.protocol||n.sessionState!==va.sessionState)throw new Sn(\"PROTOCOL_MISMATCH\",\"This applet was built for another Genesis version\");return C1(t)}var E1=500,A1=1e3,M1=64,D1=2e3,z1=Object.freeze([]),gm=e=>e===void 0?null:Array.isArray(e)?e:[e];function C1(e){let{manifest:t,appletId:n,limits:a,session:l}=e.bound,i=t.contexts.map(b=>b.id),o=y1(i,{historyEntriesMax:a.historyEntriesMax}),u=(b,A)=>e.request(b,A).catch(B=>{e.retired||console.error(`Genesis ${b} failed`,B)}),r=mm(l,t),c=new Set,m=null,d=new Set;function f(b){let A=fm(r,b,t),B=A.state!==r;r=A.state;let V=A.effects.filter(re=>!s(re));if(B){w=void 0,v();for(let re of[...c])re()}return V}function s(b){switch(b.type){case\"reveal\":return u(\"context.reveal\",{id:b.id}),!0;case\"cover\":return u(\"context.cover\"),!0;case\"context.navigate\":return mu(b.id),u(\"context.navigate\",{id:b.id,url:b.url,mode:b.mode}),!0;case\"context.back\":return mu(b.id),u(\"context.back\",b.steps?{id:b.id,steps:b.steps}:{id:b.id}),!0;case\"context.reload\":return mu(b.id),u(\"context.reload\",{id:b.id}),!0;case\"schedule\":return setTimeout(()=>f({type:\"deadline\",id:b.id,token:b.token}),a.documentReadyMs),!0;case\"leave\":case\"confirmLeave\":return!1}}function h(b,A){m?m(b,A):window.confirm(b)&&A()}function y(b){let A=r.leaveGuard;if(!A)return b();h(A.message,()=>{f({type:\"guard\",guard:null}),b()})}function S(b){let A=!0;for(let B of f({type:\"back\"}))if(B.type===\"leave\")A=!1;else if(B.type===\"confirmLeave\"){let V=()=>{f({type:\"guard\",guard:null}),!S(!1)&&b&&u(\"back.leave\")};setTimeout(()=>h(B.message,V),0)}return A}let p=null,g=l?JSON.stringify(Ac(r)):\"\";function v(){p===null&&(p=setTimeout(x,E1))}function x(){p!==null&&clearTimeout(p),p=null;let b=Ac(r),A=JSON.stringify(b);A!==g&&(g=A,u(\"session.save\",b))}e.on(\"suspended\",x);let w;function U(){if(w!==void 0)return w;let b=r.overlay[r.overlay.length-1],A=r.contexts[r.active],B=null;if(b)B={key:b.key,id:b.id,params:b.params,context:r.active,overlay:!0};else if(A?.url){let V=jl(t,A.url);V.kind===\"route\"&&(B={key:`${A.id}:${A.index}`,id:V.screen,params:V.params,context:A.id,overlay:!1})}return w=B}let C=1,D=new Set(r.overlay.map(b=>b.key));function Q(){let b;do b=`s${C++}`;while(D.has(b));return D.add(b),b}function O(b){if(\"screen\"in b){let On={key:Q(),id:b.screen,params:b.params??{}};y(()=>f({type:\"navigate.screen\",screen:On,mode:b.mode??\"push\"}));return}let B=r.contexts[r.active]?.url??t.contexts[0].startUrl,V;try{V=new URL(b.url,B).href}catch{throw new Sn(\"INVALID_ARGUMENT\",`Not a URL: ${b.url}`)}let re=b.context??ne(V);if(!r.contexts[re])throw new Sn(\"NOT_FOUND\",`No context ${re}`);let wt=r.contexts[re].url;if(wt!==null&&We(wt)===We(V)&&(b.mode??\"push\")===\"push\"){(re!==r.active||r.overlay.length>0)&&y(()=>f({type:\"select\",id:re}));return}y(()=>f({type:\"navigate.url\",url:V,context:re,mode:b.mode??\"push\"}))}function ne(b){let A=jl(t,b);if(A.kind!==\"route\"||!A.context||!r.contexts[A.context])return r.active;let B=r.contexts[r.active],V=t.contexts.find(wt=>wt.id===r.active)?.startUrl,re=!B.url||V!==void 0&&We(B.url)===We(V);return r.overlay.length>0||re?A.context:r.active}function Ne(b){y(()=>{let A=b===r.active&&r.overlay.length===0,B=A&&r.contexts[b]?.url!==null&&We(r.contexts[b].url)!==We(t.contexts.find(V=>V.id===b)?.startUrl??\"\");if(f({type:\"select\",id:b}),A&&!B)for(let V of[...d])V(b)})}let he=new Set;function K(b){he.has(b)||(he.add(b),setTimeout(()=>he.delete(b),A1),e.request(\"context.resync\",{id:b}).catch(()=>{}))}function q(b){let A=jl(t,b);return A.kind===\"route\"?{pageId:A.page,routeId:A.routeId,params:A.params}:{pageId:null,routeId:null,params:{}}}e.on(\"page\",({id:b,generation:A,page:B})=>{let V=o.applyPage(b,A,B);if(V.outcome!==\"applied\")return;he.delete(b);let re=o.context(b);Jy(b,B),f({type:\"context.page\",id:b,generation:A,view:B.view,status:B.status,pageId:B.pageId,routeId:B.routeId,account:B.account,stale:re.stale&&re.content,signInUrl:B.signInUrl??null}),ln(b,V)}),e.on(\"patch\",({id:b,generation:A,patch:B})=>{let V=o.applyPatch(b,A,B);V.outcome===\"resync\"&&K(b),ln(b,V)});function ln(b,A){if(!A.accountChanged)return;let B=Yl(r,t);for(let V of i)V!==b&&(V===B?K(V):Cn(V));for(let V of[...H.values()])V.context!==b&&jt(V,{outcome:\"unknown\",code:\"CONTEXT_REPLACED\",message:\"The account changed\"})}function Cn(b){mu(b),u(\"context.reload\",{id:b})}e.on(\"context.navigated\",b=>{o.navigated(b.id,b,q(b.url)),f({type:\"context.navigated\",...b})}),e.on(\"context.gone\",b=>{o.gone(b.id,{code:b.code??\"NOT_READY\",message:b.message??\"The page cannot be read\"}),f({type:\"context.gone\",id:b.id})}),e.on(\"user.viewWebsite\",b=>{f({type:\"user.viewWebsite\",id:b?.id??r.active})}),e.on(\"user.done\",b=>{f({type:\"user.done\",id:b?.id??r.active}),Wf()}),e.on(\"back\",()=>{let b=S(!0);u(\"back.handled\",{handled:b})});let H=new Map,_t=new Map,J=new Map,Ie=0,k=new Set,ue=new Map,Nt=(b,A,B)=>JSON.stringify([b,A,B]);function Gl(){let b=new Map;for(let B of H.values()){let V=Nt(B.context,B.region,B.key),re=b.get(V);re||b.set(V,re=[]),re.push({name:B.name,args:B.args})}let A=new Map;for(let[B,V]of b){let re=ue.get(B);A.set(B,re&&re.length===V.length&&re.every((wt,On)=>wt.name===V[On].name&&wt.args===V[On].args)?re:V)}ue=A;for(let B of[...k])B()}function jt(b,A){H.get(b.dedup)===b&&(H.delete(b.dedup),b.actionId!==null&&_t.delete(b.actionId),b.timer!==null&&clearTimeout(b.timer),b.resolve(A),Gl())}function Pn(b,A){b.timer!==null&&clearTimeout(b.timer),b.timer=setTimeout(()=>jt(b,{outcome:\"unknown\",code:\"DEADLINE\",message:\"The action did not finish in time\"}),A)}function Ki(b,A){if(A.state===\"dispatched\"){if(!A.navigating)return;b.from=o.context(b.context)?.view??null,b.expect=A.expect??null,Pn(b,a.actionTimeoutMs);return}let B=A.state===\"observed\"?\"observed\":A.state===\"cancelled\"?\"cancelled\":\"failed\";jt(b,A.result??{outcome:B})}e.on(\"action.update\",b=>{let A=_t.get(b.actionId);if(A)return Ki(A,b);if(Ie===0)return;let B=J.get(b.actionId)??[];B.push(b),J.set(b.actionId,B)});function Jy(b,A){for(let B of[...H.values()]){if(B.context!==b||B.from===null)continue;let{from:V}=B;if(A.view.generation===V.generation&&A.view.n===V.n||A.status===\"loading\")continue;let re=jl(t,A.view.url),wt=re.kind===\"route\"?re.page:null,On=gm(B.expect?.page);A.status===\"auth\"?jt(B,{outcome:\"failed\",code:\"AUTH_REQUIRED\",message:\"Sign-in is needed\"}):wt!==null&&gm(B.expect?.notPage)?.includes(wt)?jt(B,{outcome:\"failed\",code:\"REJECTED\",message:\"The website did not accept the action\"}):A.status===\"ready\"&&wt!==null&&(On===null||On.includes(wt))?jt(B,{outcome:\"observed\"}):jt(B,{outcome:\"unknown\",message:\"The action led to another page\"})}}function mu(b){for(let A of[...H.values()])A.context===b&&A.from!==null&&jt(A,{outcome:\"unknown\",message:\"The page changed before the action finished\"})}function $y(b){let A=o.context(b.context);if(!A?.view)return Promise.resolve({outcome:\"failed\",code:\"NOT_READY\",message:\"The page is not ready\"});let B=b.region===null?void 0:A.regions[b.region],V=B?.kind===\"collection\"?B.records[b.key??\"\"]:B?.record??void 0,re=JSON.stringify([b.context,V?.entityType??b.region,V?.entity??b.key,b.name,b.args??null]),wt=H.get(re);if(wt)return wt.promise;let On,tm=new Promise(xn=>{On=xn}),al={...b,dedup:re,actionId:null,promise:tm,resolve:On,timer:null,from:null,expect:null};H.set(re,al),Pn(al,a.actionTimeoutMs+D1),Gl();let{view:nm}=A,Py={region:b.region,key:b.key,name:b.name,args:b.args??null,view:nm.n},am=()=>{--Ie===0&&J.clear()};return Ie++,e.request(\"context.act\",{id:b.context,generation:nm.generation,action:Py}).then(({actionId:xn})=>{let Tc=J.get(xn)??[];if(J.delete(xn),am(),H.get(re)===al){al.actionId=xn,_t.set(xn,al);for(let e1 of Tc)Ki(al,e1)}},xn=>{am();let Tc=sm(xn?.code)?xn.code:void 0;jt(al,{outcome:\"failed\",code:Tc,message:xn instanceof Error?xn.message:\"The action failed\"})}),tm}let bc=new Set;e.on(\"storage.changed\",b=>{for(let A of[...bc])A(b)});let Fy={get:(b,A)=>e.request(\"storage.get\",{collection:b,key:A}),list:(b,A={})=>e.request(\"storage.list\",{collection:b,...A}),commit:b=>e.request(\"storage.commit\",{checks:b.checks??[],puts:b.puts??[],deletes:b.deletes??[]}),onChanged(b){return bc.add(b),()=>{bc.delete(b)}}},Wy={async request(b,A,B={}){try{return await e.request(\"services.request\",{serviceId:b,path:A,method:B.method??\"GET\",body:B.body??null})}catch(V){throw V instanceof Sn?new w1(V.code,V.message):V}}},xc=new Set;function Wf(){for(let b of[...xc])b()}e.on(\"resumed\",Wf);let Sc=new Set;e.on(\"retired\",()=>{for(let b of[...H.values()])jt(b,{outcome:\"unknown\",code:\"RETIRED\",message:\"This page was closed\"});for(let b of[...Sc])b()});let ql=new Map;for(let b of i)e.request(\"context.resync\",{id:b}).catch(()=>{}),s({type:\"schedule\",id:b,token:r.contexts[b].deadline});let Pf=Yl(r,t);Pf!==null&&u(\"context.reveal\",{id:Pf});let em=!1;return{manifest:t,appletId:n,limits:a,restored:l!==null,store:o,navigation:{state:()=>r,screen:U,presentation:b=>pu(r.contexts[b],t),revealed:()=>Yl(r,t),navigate:O,select:Ne,back:()=>{S(!1)},reload:b=>{Cn(b??r.active)},viewWebsite:b=>{f({type:\"user.viewWebsite\",id:b??r.active})},done:b=>{f({type:\"user.done\",id:b??r.active})},setLeaveGuard:b=>{f({type:\"guard\",guard:b===null?null:{message:b}})},onConfirmLeave(b){return m=b,()=>{m===b&&(m=null)}},onScrollToTop(b){return d.add(b),()=>{d.delete(b)}},subscribe(b){return c.add(b),()=>{c.delete(b)}}},actions:{act:$y,pending:(b,A,B)=>ue.get(Nt(b,A,B))??z1,subscribe(b){return k.add(b),()=>{k.delete(b)}}},storage:Fy,services:Wy,scroll:{get:b=>ql.get(b),set(b,A){for(ql.delete(b),ql.set(b,A);ql.size>M1;)ql.delete(ql.keys().next().value)}},onResume(b){return xc.add(b),()=>{xc.delete(b)}},onRetired(b){return Sc.add(b),()=>{Sc.delete(b)}},ready(){em||(em=!0,u(\"ui.ready\"))}}}var me=Y(Ke(),1),Q0=Y(q0(),1),Po=Y(P(),1),Z0=(0,me.createContext)(null);function aS({foreground:e,children:t}){return(0,Po.jsx)(Z0.Provider,{value:e,children:t})}function Kn(){let e=(0,me.useContext)(Z0);if(!e)throw new Error(\"Genesis hooks need mountForeground or GenesisProvider\");return e}function lS({foreground:e,children:t}){return(0,me.useLayoutEffect)(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e.ready()))},[e]),t}async function I0(e,t){let n=t??document.getElementById(\"root\")??document.body.appendChild(document.createElement(\"div\")),a=await bm(),l=(0,Q0.createRoot)(n);return a.onRetired(()=>l.unmount()),l.render((0,Po.jsx)(aS,{foreground:a,children:(0,Po.jsx)(lS,{foreground:a,children:e})})),a}function Of(){let e=Kn();return(0,me.useSyncExternalStore)(e.navigation.subscribe,e.navigation.state)}function ac(e){let t=Of();return e??t.active}function K0(e,t){let{store:n}=Kn(),a=(0,me.useCallback)(l=>n.subscribe(l,e),[n,e]);return(0,me.useSyncExternalStore)(a,()=>t(n.context(e)))}var iS=(e,t)=>e.pageId===t.pageId&&e.status===t.status&&e.stale===t.stale&&e.generation===t.generation&&e.params===t.params&&e.error===t.error&&e.account===t.account&&e.url===t.url;function oS(e,t){return{pageId:e?.pageId??null,status:e?.status??\"loading\",stale:e?e.stale&&e.content:!1,generation:e?.view?.generation??null,params:e?.params??uS,error:e?.error??null,account:t,url:e?.url??null}}function hn(e){let{store:t}=Kn(),n=ac(e),a=(0,me.useRef)(null),l=(0,me.useCallback)(o=>t.subscribe(o),[t]),i=(0,me.useCallback)(()=>{let o=oS(t.context(n),t.state().account);return(!a.current||!iS(a.current,o))&&(a.current=o),a.current},[t,n]);return(0,me.useSyncExternalStore)(l,i)}var uS=Object.freeze({}),V0=new WeakMap,rS=Object.freeze({order:Object.freeze([]),get:()=>{},complete:!1,status:\"missing\",error:null,ephemeral:!1});function cS(e){if(!e)return rS;let t=V0.get(e);if(t)return t;if(e.kind===\"collection\"){let{records:n}=e;t={order:e.order.filter(a=>n[a]!==void 0),get:a=>n[a],complete:e.complete,status:e.status,error:e.error,ephemeral:e.ephemeral}}else{let{record:n}=e;t={order:n?[n.key]:[],get:a=>n&&n.key===a?n:void 0,complete:!0,status:e.status,error:e.error,ephemeral:!1}}return V0.set(e,t),t}function lc(e,t){return K0(ac(t),n=>cS(n?.regions[e]))}function vn(e,t,n){return K0(ac(n),a=>sS(a?.regions[e],t))}function sS(e,t){if(e)return e.kind===\"single\"?t===null||e.record?.key===t?e.record??void 0:void 0:t===null?void 0:e.records[t]}function xe(e,t,n){let a=Kn();return(0,me.useCallback)((l,i)=>a.actions.act({context:n??a.navigation.state().active,region:t??null,key:l,name:e,args:i}),[a,e,t,n])}function ic(e,t,n){let a=Kn(),l=ac(n);return(0,me.useSyncExternalStore)(a.actions.subscribe,()=>a.actions.pending(l,e,t))}function I(){let e=Kn(),t=Of(),{navigation:n}=e;return(0,me.useMemo)(()=>({presentation:n.presentation(t.active),active:t.active,contexts:t.contexts,overlay:t.overlay,screen:n.screen(),revealed:n.revealed(),navigate:n.navigate,back:n.back,select:n.select,reload:n.reload,viewWebsite:n.viewWebsite,done:n.done,setLeaveGuard:n.setLeaveGuard}),[n,t])}function oc(e,t={}){let n=Kn(),a=t.storage??n.storage,[l,i]=(0,me.useState)({records:[],loading:!0,error:null});(0,me.useEffect)(()=>{let d=!0,f=0;async function s(){let y=++f;try{let S=[],p;do{let g=await a.list(e,p===void 0?{}:{afterKey:p});S.push(...g.entries),p=g.nextAfterKey??void 0}while(p!==void 0);d&&y===f&&i({records:S,loading:!1,error:null})}catch(S){d&&y===f&&i(p=>({...p,loading:!1,error:S}))}}s();let h=a.onChanged(y=>{y.changes.some(S=>S.collection===e)&&s()});return()=>{d=!1,h()}},[a,e]);let o=(0,me.useRef)(l.records);o.current=l.records;let u=(0,me.useCallback)(d=>o.current.find(f=>f.key===d)?.revision??null,[]),r=(0,me.useCallback)(d=>a.commit(d),[a]),c=(0,me.useCallback)((d,f,s)=>a.commit({checks:[{collection:e,key:d,expectedRevision:s===void 0?u(d):s}],puts:[{collection:e,key:d,value:f}]}),[a,e,u]),m=(0,me.useCallback)(d=>a.commit({checks:[{collection:e,key:d,expectedRevision:u(d)}],deletes:[{collection:e,key:d}]}),[a,e,u]);return{...l,put:c,remove:m,commit:r}}var dS=1500;function fS(){let e=Kn();Of();let t=e.navigation.screen(),n=t?.key??`${e.navigation.state().active}:none`,a=t&&!t.overlay?t.context:null;return(0,me.useCallback)(l=>{if(!l)return;let i=e.scroll.get(n)??0,o=i>0,u=performance.now(),r=0,c=()=>{o&&(l.scrollTop=i,Math.abs(l.scrollTop-i)<2||performance.now()-u>dS?o=!1:r=requestAnimationFrame(c))},m=()=>{o=!1},d=()=>{o||e.scroll.set(n,l.scrollTop)},f=e.navigation.onScrollToTop(s=>{s===a&&(o=!1,l.scrollTo({top:0,behavior:\"smooth\"}))});return c(),l.addEventListener(\"scroll\",d,{passive:!0}),l.addEventListener(\"touchstart\",m,{passive:!0}),l.addEventListener(\"wheel\",m,{passive:!0}),()=>{cancelAnimationFrame(r),f(),l.removeEventListener(\"scroll\",d),l.removeEventListener(\"touchstart\",m),l.removeEventListener(\"wheel\",m)}},[e,n,a])}function Xe(e){return(0,Po.jsx)(\"div\",{...e,ref:fS()})}var Yt=Y(Ke(),1);var ji=\"https://mail.google.com\",mS=\"/mail/mu/mp/239/\";var Ja=[{id:\"primary\",path:\"priority/%5Esmartlabel_personal\",title:\"Primary\",arg:\"^smartlabel_personal\",icon:\"inbox\",category:!0},{id:\"promotions\",path:\"priority/%5Esmartlabel_promo\",title:\"Promotions\",arg:\"^smartlabel_promo\",icon:\"tag\",category:!0},{id:\"social\",path:\"priority/%5Esmartlabel_social\",title:\"Social\",arg:\"^smartlabel_social\",icon:\"people\",category:!0},{id:\"starred\",path:\"Starred\",title:\"Starred\",arg:\"^t\",icon:\"star\"},{id:\"important\",path:\"Important\",title:\"Important\",arg:\"^io_im\",icon:\"important\"},{id:\"sent\",path:\"Sent%20Mail\",title:\"Sent\",arg:\"^f\",icon:\"send\"},{id:\"drafts\",path:\"Drafts\",title:\"Drafts\",arg:\"^r\",icon:\"draft\"},{id:\"all\",path:\"All%20Mail\",title:\"All mail\",arg:\"^all\",icon:\"mail\"},{id:\"spam\",path:\"Spam\",title:\"Spam\",arg:\"^s\",icon:\"alert\"},{id:\"trash\",path:\"Trash\",title:\"Trash\",arg:\"^k\",icon:\"trash\"}],yn=Ja[0];function eu(e){try{return decodeURIComponent(e)}catch{return e}}function kf(e){if(e.startsWith(\"search/\")){let n=eu(e.slice(7));return{path:e,id:\"search\",title:\"Search\",query:n}}let t=Ja.find(n=>n.path===e||eu(n.path)===eu(e));return t?{path:t.path,id:t.id,title:t.title}:{path:e,id:`label:${eu(e)}`,title:eu(e).replace(/^.*\\//,\"\")}}function $0(e){let t=e.replace(/^#/,\"\");if(t===\"\")return{kind:\"list\",list:kf(yn.path)};if(t.startsWith(\"tl/\"))return{kind:\"list\",list:kf(t.slice(3))};if(t.startsWith(\"cv/\")){let n=t.slice(3),a=n.lastIndexOf(\"/\"),l=a>=0?n.slice(a+1):n,i=a>=0?n.slice(0,a):yn.path;if(/^[0-9a-f]{6,24}$/i.test(l))return{kind:\"conversation\",list:kf(i),threadId:l}}return t===\"co\"||t.startsWith(\"co?\")||t.startsWith(\"co/\")?{kind:\"compose\"}:t===\"mn\"||t.startsWith(\"mn/\")?{kind:\"menu\"}:t===\"pr\"||t.startsWith(\"pr/\")?{kind:\"settings\"}:{kind:\"other\",hash:t}}function F0(e){try{let t=new URL(e??\"\");if(t.origin===ji&&t.pathname.startsWith(\"/mail/mu/\"))return`${ji}${t.pathname}${t.search}`}catch{}return`${ji}${mS}`}var _f=e=>`${ji}/mail/mu/?authuser=${encodeURIComponent(e.email||String(e.sessionIndex))}`,uc=(e,t)=>`${e}#tl/${t}`,W0=(e,t)=>`${e}#tl/search/${encodeURIComponent(t.trim())}`,Rf=(e,t,n=\"All%20Mail\")=>`${e}#cv/${n}/${t}`,P0=e=>`${e}#co`,ey=e=>`${e}#mn`,Cl=[\"#2347d9\",\"#b5470b\",\"#1f7a4d\",\"#7b2d8e\",\"#0e7490\",\"#3d4250\"],ty=[\"Blue\",\"Rust\",\"Green\",\"Plum\",\"Teal\",\"Graphite\"],ny={v:1,showAddTo:!0,defaultSort:\"due\",defaultReminderTime:\"09:00\",morningSummary:\"08:00\",archiveAfterAdding:!0,keepDoneDays:7,swipeRight:\"remind\",swipeLeft:\"archive\",theme:\"system\",todoAccount:\"all\",recentSearches:[]},Uf=e=>e.trim().toLowerCase();function ay(e,t=[]){let[n=\"\",a=\"\"]=e.split(\"@\"),l=a.toLowerCase(),i=l===\"gmail.com\"||l===\"googlemail.com\"?\"Personal\":l.split(\".\")[0]??\"\",o=i?i[0].toUpperCase()+i.slice(1):e;return t.includes(o)&&n?n:o}function rc(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}var pS=/^\\d{4}-\\d{2}-\\d{2}$/,gS=/^\\d{2}:\\d{2}$/;function ly(e){return!rc(e)||e.v!==1?!1:typeof e.id==\"string\"&&(e.type===\"reminder\"||e.type===\"todo\")&&typeof e.title==\"string\"&&(e.dueDate===null||typeof e.dueDate==\"string\"&&pS.test(e.dueDate))&&(e.dueTime===null||typeof e.dueTime==\"string\"&&gS.test(e.dueTime))&&typeof e.done==\"boolean\"&&typeof e.createdAt==\"number\"&&typeof e.accountId==\"string\"}function iy(e){return rc(e)&&e.v===1&&typeof e.id==\"string\"&&typeof e.email==\"string\"&&typeof e.name==\"string\"&&typeof e.color==\"string\"}var tu=e=>String(e).padStart(2,\"0\"),pe=e=>`${e.getFullYear()}-${tu(e.getMonth()+1)}-${tu(e.getDate())}`,ut=e=>`${tu(e.getHours())}:${tu(e.getMinutes())}`;function en(e){let[t,n,a]=e.split(\"-\").map(Number);return new Date(t,n-1,a)}function _e(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}var vt=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate());function ot(e,t){let[n,a]=t.split(\":\").map(Number),l=vt(e);return l.setHours(n,a,0,0),l}function Hf(e){return e.dueDate?ot(en(e.dueDate),e.dueTime??\"23:59\"):null}var hS=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],oy=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],Xi=e=>hS[e.getDay()],Jn=e=>`${Xi(e)}, ${e.getDate()} ${oy[e.getMonth()]}`;function Ct(e){let[t,n]=e.split(\":\").map(Number),a=t<12?\"AM\":\"PM\";return`${t%12===0?12:t%12}:${tu(n)} ${a}`}function $a(e,t=new Date){return Math.round((vt(e).getTime()-vt(t).getTime())/864e5)}function Bf(e,t=new Date){let n=$a(e,t);return n===0?\"Today\":n===1?\"Tomorrow\":n===-1?\"Yesterday\":n>1&&n<7?Xi(e):Jn(e)}function $n(e,t=new Date){if(!e.dueDate)return\"No date\";let n=en(e.dueDate),a=Bf(n,t);return e.dueTime?`${a}, ${Ct(e.dueTime)}`:a}function Fn(e,t=new Date){if(!e.dueDate)return\"\";let n=en(e.dueDate),a=$a(n,t),l=a===0?\"today\":a===1?\"tomorrow\":a===-1?\"yesterday\":a>1&&a<7?Xi(n):`${Xi(n)} ${n.getDate()} ${oy[n.getMonth()]}`;return e.dueTime?`${l[0].toUpperCase()}${l.slice(1)} ${Ct(e.dueTime)}`:`Due ${l}`}function cc(e,t=new Date){let n=new Date(e),a=Bf(n,t);return`${a===\"Today\"?\"today\":a===\"Yesterday\"?\"yesterday\":a}, ${Ct(ut(n))}`}function uy(e,t){let n=en(e),a=vt(new Date);do if(t===\"daily\")n=_e(n,1);else if(t===\"weekly\")n=_e(n,7);else if(t===\"monthly\")n=new Date(n.getFullYear(),n.getMonth()+1,n.getDate());else if(t===\"weekdays\")do n=_e(n,1);while(n.getDay()===0||n.getDay()===6);else break;while(n=8&&i.getHours()<22&&a.push({id:\"later\",label:\"Later today\",date:i,detail:Dn(i,t)});let o=ot(_e(n,1),e);a.push({id:\"tomorrow\",label:\"Tomorrow\",date:o,detail:Dn(o,t)});let u=ot(_e(n,(8-n.getDay())%7||7),e);if(a.push({id:\"week\",label:\"Next week\",date:u,detail:Dn(u,t)}),n.getDay()!==0){let r=ot(_e(n,(6-n.getDay()+7)%7),\"10:00\"),c=r>t?r:ot(_e(n,1),\"10:00\");c>t&&c.getDay()!==1&&a.push({id:\"weekend\",label:\"This weekend\",date:c,detail:Dn(c,t)})}return a}function cy(e,t=new Date){let n=vt(t),a=[],l=ot(n,\"18:00\");if(l>t)a.push({id:\"evening\",label:\"Today 6 PM\",date:l,detail:\"\"});else{let o=ot(n,\"21:00\");o>t&&a.push({id:\"night\",label:\"Tonight 9 PM\",date:o,detail:\"\"})}let i=ot(_e(n,1),e);return a.push({id:\"tomorrow\",label:`Tomorrow ${Ct(e).replace(\":00\",\"\")}`,date:i,detail:\"\"}),a}function sy(e,t,n=new Date){let a=vt(n);if(e===\"today\")return pe(a);if(e===\"tomorrow\")return pe(_e(a,1));if(e===\"week\"){let l=(5-a.getDay()+7)%7,i=a.getDay()===6||a.getDay()===0||l<2?_e(a,(7-a.getDay())%7||0):_e(a,l);return pe(i<_e(a,2)?_e(a,2):i)}return e===\"pick\"?t:null}function Ol(e,t=new Date){if(e.done)return\"done\";if(!e.dueDate)return\"none\";let n=$a(en(e.dueDate),t);return n<0?\"overdue\":n===0?\"today\":n===1?\"tomorrow\":n<7?\"week\":\"later\"}function au(e,t){return(e.dueDate??\"9\")!==(t.dueDate??\"9\")?(e.dueDate??\"9\")<(t.dueDate??\"9\")?-1:1:!e.dueTime!=!t.dueTime?e.dueTime?1:-1:(e.dueTime??\"\")!==(t.dueTime??\"\")?(e.dueTime??\"\")<(t.dueTime??\"\")?-1:1:e.priority!==t.priority?e.priority===\"high\"?-1:1:e.createdAt-t.createdAt}function Fa(e,t=new Date){return e.done||e.snooze||!e.dueDate?!1:$a(en(e.dueDate),t)<=0}function dy(e,t=new Date){if(e.done||!e.bringBack||!e.link?.threadId)return!1;let n=Hf(e);return n!==null&&n<=t}function fy(e){let t=e.replace(/[<(].*$/,\"\").replace(/[^\\p{L}\\p{N} ]/gu,\" \").trim().split(/\\s+/).filter(Boolean);return t.length===0?\"?\":t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function my(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return t%360}var py=()=>typeof crypto<\"u\"&&\"randomUUID\"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`;var ie=Y(Ke(),1);var gy=(0,ie.createContext)(null);function vS(){let e=oc(\"items\"),t=(0,ie.useMemo)(()=>e.records.map(u=>u.value).filter(ly),[e.records]),n=(0,ie.useRef)(new Map);n.current=(0,ie.useMemo)(()=>new Map(e.records.map(u=>[u.key,u.revision])),[e.records]);let a=u=>n.current.get(u)??null,l=(0,ie.useCallback)(async u=>{u.length&&await e.commit({checks:u.map(r=>({collection:\"items\",key:r.id,expectedRevision:a(r.id)})),puts:u.map(r=>({collection:\"items\",key:r.id,value:r}))})},[e]),i=(0,ie.useCallback)(async u=>{let r=u.filter(c=>n.current.has(c));r.length&&await e.commit({checks:r.map(c=>({collection:\"items\",key:c,expectedRevision:a(c)})),deletes:r.map(c=>({collection:\"items\",key:c}))})},[e]),o=(0,ie.useCallback)(async(u,r)=>{if(r&&u.type===\"reminder\"&&u.repeat!==\"never\"&&u.dueDate){await l([{...u,dueDate:uy(u.dueDate,u.repeat),returned:!1}]);return}await l([{...u,done:r,completedAt:r?Date.now():null}])},[l]);return{items:t,loading:e.loading,error:e.error,save:u=>l([u]),saveMany:l,remove:u=>i([u]),removeMany:i,complete:o}}function yS(){let e=oc(\"accounts\"),t=hn(\"primary\"),n=(0,ie.useMemo)(()=>e.records.map(m=>m.value).filter(iy).sort((m,d)=>m.addedAt-d.addedAt),[e.records]),a=t.account,l=vn(\"view\",null,\"primary\")?.data.session,i=typeof l==\"number\"?l:bS(t.url),o=(0,ie.useCallback)(async m=>{await e.put(m.id,m)},[e]),u=(0,ie.useRef)(null);(0,ie.useEffect)(()=>{if(e.loading||!a)return;let m=Uf(a),d=n.find(h=>h.id===m);if(d){i!==null&&d.sessionIndex!==i&&e.put(m,{...d,sessionIndex:i}).catch(()=>{});return}if(u.current===m)return;u.current=m;let f=new Set(n.map(h=>h.color)),s=Cl.find(h=>!f.has(h))??Cl[n.length%Cl.length];e.put(m,{v:1,id:m,email:a,name:ay(a,n.map(h=>h.name)),color:s,sessionIndex:i??0,showInInbox:!0,showInTodo:!0,addedAt:Date.now()},null).catch(()=>{u.current=null})},[e,n,a,i]);let r=(0,ie.useCallback)(m=>n.find(d=>d.id===m),[n]),c=a?r(Uf(a))??null:null;return{accounts:n,current:c,byId:r,save:o}}function bS(e){let t=/\\/mail\\/u\\/(\\d+)\\/|[?&]authuser=(\\d+)/.exec(e??\"\");return t?Number(t[1]??t[2]):null}function xS(){let e=oc(\"settings\"),t=e.records.find(l=>l.key===\"prefs\")?.value,n=(0,ie.useMemo)(()=>({...ny,...rc(t)?t:{}}),[t]),a=(0,ie.useCallback)(async l=>{await e.put(\"prefs\",{...n,...l,v:1})},[e,n]);return{settings:n,loading:e.loading,update:a}}function hy({children:e}){let t=vS(),n=yS(),a=xS(),l=(0,ie.useMemo)(()=>({items:t,accounts:n,settings:a}),[t,n,a]);return(0,ie.createElement)(gy.Provider,{value:l},e)}function Lf(){let e=(0,ie.useContext)(gy);if(!e)throw new Error(\"DataProvider is missing\");return e}var Se=()=>Lf().items,Ee=()=>Lf().accounts,yt=()=>Lf().settings;function vy(){let{items:e,loading:t,removeMany:n}=Se(),{settings:a,loading:l}=yt(),i=(0,ie.useRef)(!1);(0,ie.useEffect)(()=>{if(t||l||i.current)return;i.current=!0;let o=Date.now()-a.keepDoneDays*864e5,u=e.filter(r=>r.done&&(r.completedAt??0)r.id);u.length&&n(u).catch(()=>{})},[t,l,e,a.keepDoneDays,n])}var yy=(0,ie.createContext)(null);function by({children:e}){let[t,n]=(0,ie.useState)(null),a=(0,ie.useRef)(0),l=(0,ie.useCallback)(u=>{window.clearTimeout(a.current);let r=Date.now();n({...u,id:r}),a.current=window.setTimeout(()=>n(c=>c?.id===r?null:c),u.undo?6e3:3500)},[]),i=(0,ie.useCallback)(()=>n(null),[]),o=(0,ie.useMemo)(()=>({toast:t,show:l,clear:i}),[t,l,i]);return(0,ie.createElement)(yy.Provider,{value:o},e)}function qe(){let e=(0,ie.useContext)(yy);if(!e)throw new Error(\"ToastProvider is missing\");return e}function Le(){let[e,t]=(0,ie.useState)(()=>new Date);return(0,ie.useEffect)(()=>{let n=window.setInterval(()=>t(new Date),3e4);return()=>window.clearInterval(n)},[]),e}var Ot=Y(Ke(),1);var R=Y(P(),1),SS={menu:\"M4 7h16M4 12h16M4 17h16\",search:\"M20 20l-4.6-4.6M17 10.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0\",back:\"M19 12H5M11 6l-6 6 6 6\",close:\"M6 6l12 12M18 6 6 18\",archive:\"M4 5h16v4H4zM5 9v10h14V9M10 13h4\",trash:\"M5 7h14M10 4h4M7 7l1 13h8l1-13M10 11v6M14 11v6\",unread:\"M3 6h18v12H3zM3 7l9 6 9-6\",clock:\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2\",more:\"M12 5.5h.01M12 12h.01M12 18.5h.01\",plus:\"M12 5v14M5 12h14\",down:\"M6 9l6 6 6-6\",up:\"M6 15l6-6 6 6\",right:\"M9 6l6 6-6 6\",bell:\"M6 16v-5a6 6 0 1 1 12 0v5l1.5 2h-15zM10 21h4\",check:\"M5 12.5 10 17 19 7\",star:\"M12 3.5l2.6 5.4 5.9.8-4.3 4.1 1 5.9L12 17l-5.2 2.7 1-5.9-4.3-4.1 5.9-.8z\",clip:\"M20 11.5l-8 8a5 5 0 0 1-7-7l8.5-8.5a3.3 3.3 0 0 1 4.7 4.7l-8.4 8.4a1.7 1.7 0 0 1-2.4-2.4L15 7\",reply:\"M10 8V4L3 11l7 7v-4c5 0 8 1.5 11 5-1-6-4-10-11-11z\",replyAll:\"M13 8V4l-7 7 7 7v-4c4.5 0 7 1.5 9 5-1-6-3.5-10-9-11zM7 4l-7 7 7 7\",forward:\"M14 8V4l7 7-7 7v-4c-5 0-8 1.5-11 5 1-6 4-10 11-11z\",inbox:\"M4 13l2.5-8h11L20 13v6H4zM4 13h5l1 2h4l1-2h5\",tag:\"M3 12V4h8l10 10-8 8zM7.5 8h.01\",people:\"M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 6.5M18 14.5a6.5 6.5 0 0 1 3.5 5.5\",send:\"M4 4l17 8-17 8 3-8zM7 12h14\",draft:\"M5 3h9l5 5v13H5zM14 3v5h5M8 13h8M8 17h5\",mail:\"M3 6h18v12H3zM3 7l9 6 9-6\",alert:\"M12 3l10 18H2zM12 10v5M12 18h.01\",important:\"M4 6h11l5 6-5 6H4l4-6z\",settings:\"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 0 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 0 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 0 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 0 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z\",pencil:\"M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4\",todo:\"M4 6l2 2 3-3M4 13l2 2 3-3M12 7h8M12 14h8M12 20h8M4 19.5h4\",calendar:\"M4 6h16v14H4zM4 10h16M8 3v4M16 3v4\",repeat:\"M17 2l3 3-3 3M4 11V9a4 4 0 0 1 4-4h12M7 22l-3-3 3-3M20 13v2a4 4 0 0 1-4 4H4\",note:\"M5 4h14v16H5zM8 9h8M8 13h8M8 17h4\",external:\"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6\",flag:\"M5 21V4h11l-2 4 2 4H5\",label:\"M3 12V4h8l10 10-8 8zM7.5 8h.01\",refresh:\"M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7\",mute:\"M11 5L6 9H3v6h3l5 4zM16 9l5 6M21 9l-5 6\",spam:\"M8 3h8l5 5v8l-5 5H8l-5-5V8zM12 8v5M12 16h.01\",user:\"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0\",sun:\"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4\",swipe:\"M4 12h16M8 8l-4 4 4 4M16 8l4 4-4 4\",check2:\"M4 4h16v16H4zM8 12l3 3 5-6\"};function E({name:e,filled:t=!1,size:n}){return(0,R.jsx)(\"svg\",{viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",className:t?\"filled\":void 0,style:n?{width:n,height:n}:void 0,children:(0,R.jsx)(\"path\",{d:SS[e]})})}function te({icon:e,label:t,onClick:n,filled:a,disabled:l,pressed:i,className:o}){return(0,R.jsx)(\"button\",{type:\"button\",className:`icon-button ${o??\"\"}`,\"aria-label\":t,title:t,\"aria-pressed\":i,disabled:l,onClick:n,children:(0,R.jsx)(E,{name:e,filled:a})})}function Wa({name:e,size:t=40,selected:n=!1}){let a=my(e);return n?(0,R.jsx)(\"span\",{className:\"avatar selected\",style:{width:t,height:t},\"aria-hidden\":\"true\",children:(0,R.jsx)(E,{name:\"check\"})}):(0,R.jsx)(\"span\",{className:\"avatar\",\"aria-hidden\":\"true\",style:{width:t,height:t,fontSize:t*.38,\"--hue\":String(a)},children:fy(e)})}function Ze({color:e,label:t}){return(0,R.jsx)(\"span\",{className:\"account-dot\",style:{background:e},role:t?\"img\":void 0,\"aria-label\":t,\"aria-hidden\":t?void 0:!0})}function tn({label:e,detail:t,checked:n,onChange:a,icon:l}){let i=(0,Ot.useId)();return(0,R.jsxs)(\"label\",{className:\"toggle-row\",htmlFor:i,children:[l,(0,R.jsxs)(\"span\",{className:\"toggle-text\",children:[(0,R.jsx)(\"span\",{children:e}),t&&(0,R.jsx)(\"small\",{children:t})]}),(0,R.jsx)(\"input\",{id:i,type:\"checkbox\",role:\"switch\",checked:n,onChange:o=>a(o.target.checked)}),(0,R.jsx)(\"span\",{className:\"switch\",\"aria-hidden\":\"true\"})]})}function zn({label:e,options:t,value:n,onChange:a,className:l}){return(0,R.jsx)(\"div\",{className:`chips ${l??\"\"}`,role:\"radiogroup\",\"aria-label\":e,children:t.map(i=>(0,R.jsx)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":i.id===n,className:`chip ${i.tone??\"\"}`,onClick:()=>a(i.id),children:i.label},i.id))})}function lu({title:e,icon:t,tone:n,children:a,footer:l,onClose:i,labelledBy:o}){let u=(0,Ot.useId)(),r=(0,Ot.useRef)(null),c=(0,Ot.useRef)(null);(0,Ot.useEffect)(()=>{let s=document.activeElement instanceof HTMLElement?document.activeElement:null;return r.current?.focus(),()=>{s?.isConnected&&s.focus({preventScroll:!0})}},[]);let m=s=>{let h=c.current;!h||!r.current||(h.dy=Math.max(0,s-h.y),r.current.style.transform=h.dy?`translateY(${h.dy}px)`:\"\")},d=()=>{let s=c.current;if(c.current=null,!(!s||!r.current)){if(r.current.classList.remove(\"dragging\"),s.dy>Math.min(120,r.current.offsetHeight/4)){i();return}r.current.style.transform=\"\"}};return(0,R.jsxs)(\"div\",{className:\"sheet-layer\",children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"sheet-backdrop\",\"aria-label\":\"Close\",onClick:i}),(0,R.jsxs)(\"div\",{className:\"sheet\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":o??u,ref:r,tabIndex:-1,children:[(0,R.jsxs)(\"div\",{className:\"sheet-handle\",...{onPointerDown:s=>{s.target.closest(\"button\")||(c.current={id:s.pointerId,y:s.clientY,dy:0},s.currentTarget.setPointerCapture(s.pointerId),r.current?.classList.add(\"dragging\"))},onPointerMove:s=>{c.current?.id===s.pointerId&&m(s.clientY)},onPointerUp:d,onPointerCancel:d},children:[(0,R.jsx)(\"span\",{className:\"grabber\",\"aria-hidden\":\"true\"}),(0,R.jsxs)(\"header\",{className:\"sheet-head\",children:[(0,R.jsx)(\"span\",{className:`tile ${n}`,children:(0,R.jsx)(E,{name:t})}),(0,R.jsx)(\"h2\",{id:u,children:e}),(0,R.jsx)(te,{icon:\"close\",label:\"Close\",onClick:i})]})]}),(0,R.jsx)(\"div\",{className:\"sheet-body\",children:a}),l&&(0,R.jsx)(\"footer\",{className:\"sheet-foot\",children:l})]})]})}var sc={count:0};function iu({children:e,onClose:t,className:n}){let a=(0,Ot.useRef)(null),l=Kn().navigation,{screen:i}=I(),o=(0,Ot.useRef)({key:null,seen:!1}),u=(0,Ot.useRef)(t);return u.current=t,(0,Ot.useEffect)(()=>(sc.count++,l.navigate({screen:\"menu\"}),o.current={key:l.screen()?.key??null,seen:!1},()=>{sc.count--,o.current.key&&l.screen()?.key===o.current.key&&l.back(),o.current={key:null,seen:!1}}),[l]),(0,Ot.useEffect)(()=>{let r=o.current;r.key&&(i?.key===r.key?r.seen=!0:r.seen&&(o.current={key:null,seen:!1},u.current()))},[i?.key]),(0,Ot.useEffect)(()=>{a.current?.querySelector(\"button\")?.focus();let r=c=>{c.key===\"Escape\"&&t()};return window.addEventListener(\"keydown\",r),()=>window.removeEventListener(\"keydown\",r)},[t]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"popover-scrim\",\"aria-label\":\"Close menu\",onClick:t}),(0,R.jsx)(\"div\",{ref:a,role:\"menu\",className:`popover ${n}`,children:e})]})}function bn({title:e,children:t,onBack:n,backLabel:a=\"Back\",className:l}){let{back:i}=I();return(0,R.jsxs)(\"header\",{className:`top-bar ${l??\"\"}`,children:[(0,R.jsx)(te,{icon:\"back\",label:a,onClick:n??i}),e!==void 0&&(0,R.jsx)(\"h1\",{children:e}),(0,R.jsx)(\"span\",{className:\"spacer\"}),t]})}function nn({label:e,rows:t=7,kind:n=\"rows\"}){return n===\"email\"?(0,R.jsxs)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:\"skeleton email\",children:[(0,R.jsx)(\"span\",{className:\"bar title\"}),(0,R.jsx)(\"span\",{className:\"bar title short\"}),(0,R.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[(0,R.jsx)(\"span\",{className:\"skeleton-avatar\"}),(0,R.jsxs)(\"div\",{children:[(0,R.jsx)(\"span\",{}),(0,R.jsx)(\"span\",{})]})]}),Array.from({length:t},(a,l)=>(0,R.jsx)(\"span\",{className:`bar line ${l%4===3?\"short\":\"\"}`,\"aria-hidden\":\"true\"},l))]}):(0,R.jsx)(\"div\",{role:\"status\",\"aria-busy\":\"true\",\"aria-label\":e,className:`skeleton ${n}`,children:Array.from({length:t},(a,l)=>(0,R.jsxs)(\"div\",{className:\"skeleton-row\",\"aria-hidden\":\"true\",children:[n===\"rows\"&&(0,R.jsx)(\"span\",{className:\"skeleton-avatar\"}),(0,R.jsxs)(\"div\",{children:[(0,R.jsx)(\"span\",{}),(0,R.jsx)(\"span\",{}),(0,R.jsx)(\"span\",{})]})]},l))})}function dc({active:e,label:t=\"Loading\"}){return(0,R.jsx)(\"div\",{className:`progress-bar${e?\" active\":\"\"}`,role:\"progressbar\",\"aria-label\":t,\"aria-hidden\":!e,\"aria-busy\":e})}function fc(e){let t=(0,Ot.useRef)(e);return e&&(t.current=!0),t.current}function kt({title:e,children:t,role:n,icon:a}){return(0,R.jsxs)(\"section\",{className:\"notice\",role:n,children:[a&&(0,R.jsx)(\"span\",{className:\"notice-icon\",children:(0,R.jsx)(E,{name:a,size:28})}),(0,R.jsx)(\"h2\",{children:e}),t]})}function xy({error:e}){let{reload:t,viewWebsite:n}=I(),a=e?.code===\"NOT_READY\"||e?.code===\"DEADLINE\"?\"Gmail did not answer in time.\":e?.message||\"This page could not be read.\";return(0,R.jsxs)(kt,{title:\"Couldn't load Gmail\",role:\"alert\",icon:\"alert\",children:[(0,R.jsx)(\"p\",{children:a}),(0,R.jsxs)(\"div\",{className:\"row-buttons\",children:[(0,R.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t(),children:\"Try again\"}),(0,R.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>n(),children:[\"Open in Gmail \",(0,R.jsx)(E,{name:\"external\"})]})]})]})}function ou({text:e,terms:t}){let n=t.map(l=>l.trim()).filter(l=>l.length>1);if(!n.length)return(0,R.jsx)(R.Fragment,{children:e});let a=new RegExp(`(${n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")).join(\"|\")})`,\"gi\");return(0,R.jsx)(R.Fragment,{children:e.split(a).map((l,i)=>i%2===1?(0,R.jsx)(\"mark\",{children:l},i):l)})}function mc(){return(0,R.jsxs)(\"span\",{className:\"logo\",\"aria-label\":\"Gmail Only\",children:[\"gmail \",(0,R.jsx)(\"span\",{children:\"only\"})]})}var kl=Y(Ke(),1);var j=\"primary\";function ru(){let e=hn(j);return(0,kl.useMemo)(()=>{let t=\"\";try{t=new URL(e.url??\"\").hash}catch{}return{view:$0(t),base:F0(e.url),url:e.url}},[e.url])}function Ve(){let{navigate:e}=I(),{base:t}=ru(),{current:n,byId:a}=Ee();return(0,kl.useMemo)(()=>({base:t,list:(l,i=\"push\")=>e({url:uc(t,l),context:j,mode:i}),inbox:(l=\"push\")=>e({url:uc(t,yn.path),context:j,mode:l}),thread:(l,i)=>e({url:Rf(t,l,i),context:j}),email:(l,i)=>{let o=a(i),u=o&&n&&o.id!==n.id;e({url:Rf(u?_f(o):t,l),context:j})},inboxOf:l=>e({url:uc(_f(l),yn.path),context:j}),search:(l,i=\"push\")=>e({url:W0(t,l),context:j,mode:i}),compose:()=>e({url:P0(t),context:j}),menu:()=>e({url:ey(t),context:j})}),[e,t,n,a])}var uu=new Map,pc=new Set,Gf=0;function gc(e,t){if(!(t===null||uu.get(e)===t)){uu.set(e,t),Gf++;for(let n of pc)n()}}function Sy(){if(uu.size){uu.clear(),Gf++;for(let e of pc)e()}}function hc(e){return(0,kl.useSyncExternalStore)(t=>(pc.add(t),()=>{pc.delete(t)}),()=>Gf),uu.get(e)??null}function _l(e,t,n,a={}){return{v:1,id:py(),type:e,title:t?Wn(t.subject):\"\",note:\"\",dueDate:null,dueTime:null,notify:e===\"reminder\",repeat:\"never\",priority:\"normal\",link:t?{threadId:t.threadId,sender:t.sender,subject:t.subject,snippet:t.snippet,receivedAt:t.receivedAt}:null,accountId:t?.accountId??n,source:\"user\",createdAt:Date.now(),completedAt:null,done:!1,bringBack:e===\"reminder\",snooze:!1,...a}}function Wn(e){return e.replace(/^((re|fwd?|fw|aw)\\s*:\\s*)+/i,\"\").trim().slice(0,200)||\"Follow up\"}function Vi(e,t){return t?e.filter(n=>n.link?.threadId===t):[]}function Pa(e){return e.split(/,| \\d+$/)[0].replace(/\\s+\\d+$/,\"\").trim()||e}function el(){let{navigate:e}=I();return(0,kl.useCallback)(t=>e({screen:\"item\",params:{id:t}}),[e])}var cu={threadId:null};var vc=Y(Ke(),1);var qf=(0,vc.createContext)(null);function Qi(){let e=(0,vc.useContext)(qf),{screen:t}=I();return e??t?.params??{}}var Rl=Y(Ke(),1),jf=Y(P(),1);function du(){try{return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches}catch{return!1}}var su=\"cubic-bezier(.2, 0, 0, 1)\",Zi=\"cubic-bezier(.3, 0, .8, .15)\",yc=\"32px\",TS={push:{frames:[{opacity:0,transform:`translateX(${yc})`},{opacity:1,transform:\"none\"}],ms:300,easing:su},pop:{frames:[{opacity:0,transform:`translateX(-${yc})`},{opacity:1,transform:\"none\"}],ms:300,easing:su},fade:{frames:[{opacity:0,transform:\"scale(.98)\"},{opacity:1,transform:\"none\"}],ms:220,easing:su},\"drawer-in\":{frames:[{transform:\"translateX(-100%)\"},{transform:\"none\"}],ms:280,easing:su}},NS={push:[{frames:[{opacity:1,transform:\"none\"},{opacity:0,transform:`translateX(-${yc})`}],ms:200,easing:Zi}],pop:Object.assign([{frames:[{opacity:1,transform:\"none\"},{opacity:0,transform:`translateX(${yc})`}],ms:200,easing:Zi}],{above:!0}),fade:[{frames:[{opacity:1},{opacity:0}],ms:120,easing:Zi}],\"drawer-in\":[{frames:[{opacity:1},{opacity:.6}],ms:280,easing:su}],\"drawer-out\":Object.assign([{frames:[{transform:\"none\"},{transform:\"translateX(-100%)\"}],ms:240,easing:Zi}],{above:!0}),\"sheet-close\":Object.assign([{frames:[{transform:\"translateY(100%)\"}],ms:220,easing:Zi,target:\".sheet\"},{frames:[{opacity:1},{opacity:0}],ms:220,easing:\"linear\",target:\".sheet-backdrop\"}],{above:!0}),\"sheet-swap\":[{frames:[{opacity:1},{opacity:0,transform:\"translateY(24px)\"}],ms:160,easing:Zi,target:\".sheet\"},{frames:[{opacity:1},{opacity:1}],ms:260,easing:\"linear\",target:\".sheet-backdrop\"}]},Ty=\".screen, .sheet-body, .sheet\",wS=90;function ES(e){let t=[...e.querySelectorAll(Ty)].map(a=>a.scrollTop),n=e.cloneNode(!0);return n.setAttribute(\"aria-hidden\",\"true\"),n.inert=!0,n.classList.add(\"ghost\"),{node:n,tops:t}}function AS(e,t,n,a){let l=NS[n];if(!e||!l)return;t.node.style.zIndex=String(a+(l.above?1:-1)),e.appendChild(t.node),t.node.querySelectorAll(Ty).forEach((r,c)=>{r.scrollTop=t.tops[c]??0});let i=l.map(r=>(r.target?t.node.querySelector(r.target):t.node)?.animate(r.frames,{duration:r.ms,easing:r.easing,fill:\"forwards\"})),o=Math.max(...l.map(r=>r.ms)),u=()=>t.node.remove();Promise.all(i.map(r=>r?.finished)).then(u,u),window.setTimeout(u,o+200)}function Yf({id:e,motion:t,layer:n,zIndex:a,inert:l,children:i}){let o=(0,Rl.useRef)(null),u=(0,Rl.useRef)({id:e,at:0}),r=(0,Rl.useRef)(null);if(u.current.id!==e){let c=performance.now(),m=c-u.current.at{let c=r.current;if(r.current=null,!c)return;c.copy&&AS(n.current,c.copy,c.motion,a);let m=TS[c.motion];m&&o.current&&o.current.animate(m.frames,{duration:m.ms,easing:m.easing})},[e,n,a]),e===null?null:(0,jf.jsx)(\"div\",{ref:o,className:\"stage\",style:{zIndex:a},inert:l,children:i})}function Ny({layer:e}){return(0,jf.jsx)(\"div\",{className:\"ghosts\",ref:e,\"aria-hidden\":\"true\"})}function MS(e,t){return!e||e.id===t.id?\"none\":t.drawer&&!e.drawer?\"drawer-in\":e.drawer&&!t.drawer?\"drawer-out\":e.tab&&t.tab?\"fade\":t.index!==e.index?t.index>e.index?\"push\":\"pop\":t.depth!==e.depth?t.depth>e.depth?\"push\":\"pop\":\"fade\"}function wy(e){let t=(0,Rl.useRef)({place:null,motion:\"none\"});return t.current.place?.id!==e.id&&(t.current={place:e,motion:MS(t.current.place,e)}),t.current.motion}var rt=Y(Ke(),1);var Ey=Y(Ke(),1);var Re=Y(P(),1),DS=380;function Xf(e){let{complete:t}=Se(),{show:n}=qe(),[a,l]=(0,Ey.useState)(!1);return{checking:a,toggle:()=>{if(!a){if(e.done){t(e,!1);return}l(!0),window.setTimeout(()=>{t(e,!0).then(()=>n({text:e.type===\"reminder\"?\"Reminder done\":\"To-do done\",undo:()=>t(e,!1)}),()=>n({text:\"Couldn't save. Try again.\"})).finally(()=>l(!1))},du()?0:DS)}}}}function fu({item:e,onToggle:t,large:n=!1,checking:a=!1}){let l=e.done||a,i=e.done?`Mark \"${e.title}\" not done`:`Mark \"${e.title}\" done`;return(0,Re.jsx)(\"button\",{type:\"button\",className:`mark ${e.type} ${l?\"done\":\"\"} ${a?\"checking\":\"\"} ${n?\"large\":\"\"}`,role:\"checkbox\",\"aria-checked\":l,\"aria-label\":i,onClick:o=>{o.stopPropagation(),t()},children:l?(0,Re.jsx)(E,{name:\"check\"}):e.type===\"reminder\"?(0,Re.jsx)(E,{name:\"bell\"}):null})}function zS(e,t){return e.byId(t.accountId)}function tl({item:e,mode:t=\"due\",now:n,onOpen:a,trailing:l,onSetDate:i}){let{checking:o,toggle:u}=Xf(e),r=Ee(),c=zS(r,e),m=Ol(e,n),d=m===\"overdue\",f=Hf(e),s;if(t===\"added\")s=(0,Re.jsxs)(Re.Fragment,{children:[e.link?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(E,{name:\"mail\",size:14}),\" \",Pa(e.link.sender),\" \\xB7 \"]}):\"Added by you \\xB7 \",e.done&&e.completedAt?`Done ${cc(e.completedAt,n)}`:Ct(ut(new Date(e.createdAt)))]});else{let y=d?e.dueTime?`Due ${Fn(e,n)}`:Fn(e,n):m===\"today\"&&!e.dueTime?\"Anytime today\":m===\"none\"?\"No date yet\":e.dueTime&&m===\"today\"?\"Today\":Fn(e,n);s=(0,Re.jsxs)(Re.Fragment,{children:[y,c&&(0,Re.jsxs)(Re.Fragment,{children:[\" \\xB7 \",(0,Re.jsx)(Ze,{color:c.color}),\" \",c.name]})]})}let h=l;return h===void 0&&(t===\"added\"&&!e.dueDate&&!e.done?h=(0,Re.jsx)(\"button\",{type:\"button\",className:\"tag set-date\",onClick:y=>{y.stopPropagation(),(i??a)()},children:\"+ Set date\"}):t===\"added\"&&e.dueDate&&!e.done?h=(0,Re.jsx)(\"span\",{className:`tag ${e.type===\"reminder\"?\"reminder\":\"\"}`,children:Fn(e,n)}):t===\"due\"&&e.dueTime&&!e.done&&f&&(h=(0,Re.jsx)(\"span\",{className:\"time-tag\",children:Ct(e.dueTime)}))),(0,Re.jsxs)(\"li\",{className:`item-row ${d&&t===\"due\"?\"overdue\":\"\"} ${e.done||o?\"is-done\":\"\"} ${e.type}`,children:[(0,Re.jsx)(fu,{item:e,onToggle:u,checking:o}),(0,Re.jsxs)(\"button\",{type:\"button\",className:\"item-main\",onClick:a,children:[(0,Re.jsxs)(\"span\",{className:\"item-title\",children:[e.priority===\"high\"&&!e.done&&(0,Re.jsx)(\"span\",{className:\"priority\",\"aria-label\":\"High priority\",children:(0,Re.jsx)(E,{name:\"flag\",filled:!0,size:14})}),e.title||\"Untitled\"]}),(0,Re.jsx)(\"span\",{className:\"item-meta\",children:s})]}),h]})}var T=Y(P(),1);function My(e,t){return{threadId:e.threadId,sender:e.sender,subject:e.subject,snippet:e.snippet,receivedAt:e.date,accountId:t}}var Ay=[{id:\"attachment\",label:\"Has attachment\",term:\"has:attachment\"},{id:\"unread\",label:\"Unread\",term:\"is:unread\"},{id:\"starred\",label:\"Starred\",term:\"is:starred\"},{id:\"week\",label:\"Last 7 days\",term:\"newer_than:7d\"}];function Zf(e){return e.split(/\\s+/).filter(t=>t&&!t.includes(\":\"))}function Dy({list:e}){let t=hn(j),n=lc(\"threads\",j),a=vn(\"list\",null,j)?.data,{items:l}=Se(),i=Ee(),{settings:o}=yt(),u=Ve(),r=Le(),c=xe(\"loadMore\",null,j),[m,d]=(0,rt.useState)(!1),[f,s]=(0,rt.useState)(!1),h=i.current,y=h?.id??\"unknown\",S=e.id===\"search\",p=e.id===yn.id,g=Ja.some(q=>q.category&&q.id===e.id);(0,rt.useEffect)(()=>{a&&!S&&gc(e.id,a.unread??0)},[a,e.id,S,i.current?.id]),(0,rt.useEffect)(()=>{s(!1)},[e.path]);let v=n.order.map(q=>n.get(q)?.data).filter(q=>!!q),x=v.filter(q=>q.selected),w=t.status===\"ready\"&&!t.stale,U=w&&!n.ephemeral,C=q=>i.byId(q.accountId)?.showInInbox!==!1,D=p?l.filter(q=>dy(q,r)&&!q.returned&&C(q)):[],Q=p?l.filter(q=>Fa(q,r)&&C(q)):[],O=t.status===\"loading\"||t.stale,ne=fc(!v.length&&O),Ne=OS(O),he=async()=>{d(!0);let q=await c(null);d(!1),q.outcome!==\"observed\"&&s(!0)},K;return!v.length&&O?K=(0,T.jsx)(nn,{label:`Loading ${e.title}`}):v.length?K=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(\"ul\",{className:`thread-list${ne?\" reveal\":\"\"}`,\"aria-label\":e.title,children:v.map(q=>(0,T.jsx)(HS,{row:q,list:e,linked:Vi(l,q.threadId),account:i.accounts.length>1?h?.color??null:null,selecting:x.length>0,actionable:U,terms:S?Zf(e.query??\"\"):[],accountId:y,swipeLeft:o.swipeLeft,swipeRight:o.swipeRight},q.threadId))}),(0,T.jsxs)(\"div\",{className:\"list-end\",children:[f?(0,T.jsx)(\"p\",{className:\"muted\",children:\"No more emails here.\"}):(0,T.jsx)(\"button\",{type:\"button\",className:\"secondary\",disabled:m||!U,onClick:()=>{he()},children:m?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(\"span\",{className:\"spinner\",\"aria-hidden\":\"true\"}),\" Loading\\u2026\"]}):\"Load older emails\"}),(0,T.jsxs)(\"button\",{type:\"button\",className:\"link-button\",disabled:Ne.active,onClick:Ne.run,children:[(0,T.jsx)(E,{name:\"refresh\"}),\" Refresh\"]})]})]}):K=(0,T.jsxs)(kt,{title:S?\"No results\":`Nothing in ${e.title}`,icon:S?\"search\":\"inbox\",children:[(0,T.jsx)(\"p\",{children:a?.empty??(S?\"Try different words or remove a filter.\":\"You're all caught up.\")}),(0,T.jsx)(\"div\",{className:\"row-buttons\",children:(0,T.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:Ne.run,children:[(0,T.jsx)(E,{name:\"refresh\"}),\" Refresh\"]})})]}),(0,T.jsxs)(\"div\",{className:\"screen-frame\",children:[x.length>0?(0,T.jsx)(BS,{rows:x,accountId:y}):S?(0,T.jsx)(LS,{query:e.query??\"\"}):(0,T.jsx)(_S,{title:e.title}),(0,T.jsx)(dc,{active:O&&v.length>0||m||Ne.active}),(0,T.jsxs)(Xe,{className:\"screen\",\"aria-busy\":!w,...Ne.handlers,children:[(0,T.jsx)(kS,{state:Ne}),g&&!S&&(0,T.jsx)(RS,{current:e.id}),!p&&!g&&!S&&(0,T.jsx)(\"h1\",{className:\"list-title\",children:e.title}),S&&(0,T.jsx)(GS,{query:e.query??\"\",count:v.length,complete:f}),D.length>0&&(0,T.jsx)(YS,{items:D}),Q.length>0&&(0,T.jsx)(jS,{items:Q,all:l,now:r}),S&&(0,T.jsx)(qS,{query:e.query??\"\",items:l}),K,t.status===\"error\"&&v.length>0&&(0,T.jsx)(\"p\",{className:\"inline-error\",role:\"alert\",children:\"Couldn't refresh. Showing the last copy.\"})]}),!x.length&&(0,T.jsxs)(\"button\",{type:\"button\",className:\"fab\",onClick:()=>u.compose(),\"aria-label\":\"Compose\",children:[(0,T.jsx)(E,{name:\"pencil\"}),(0,T.jsx)(\"span\",{children:\"Compose\"})]})]})}var Qf=72,CS=112;function OS(e){let{reload:t}=I(),[n,a]=(0,rt.useState)(0),[l,i]=(0,rt.useState)(!1),o=(0,rt.useRef)(null),u=(0,rt.useRef)(!1),r=()=>{l||(i(!0),u.current=!1,t(j))};return(0,rt.useEffect)(()=>{if(!l)return;if(e)u.current=!0;else if(u.current){i(!1);return}let m=window.setTimeout(()=>i(!1),1e4);return()=>window.clearTimeout(m)},[l,e]),{pull:n,active:l,run:r,handlers:{onTouchStart:m=>{o.current=m.currentTarget.scrollTop<=0&&!l?m.touches[0].clientY:null},onTouchMove:m=>{if(o.current===null)return;let d=m.touches[0].clientY-o.current;if(d<=0||m.currentTarget.scrollTop>0){o.current=null,a(0);return}a(Math.min(CS,d*.5))},onTouchEnd:()=>{o.current!==null&&n>=Qf&&r(),o.current=null,a(0)},onTouchCancel:()=>{o.current=null,a(0)}}}}function kS({state:e}){let{pull:t,active:n}=e;if(!t&&!n)return null;let a=n?56:t,l=Math.min(1,t/Qf);return(0,T.jsx)(\"div\",{className:`pull-indicator${n?\" active\":\"\"}${t>=Qf?\" armed\":\"\"}`,\"aria-hidden\":\"true\",style:{transform:`translate(-50%, ${a}px)`,opacity:n?1:l},children:(0,T.jsx)(\"span\",{style:n?void 0:{transform:`rotate(${l*270}deg)`},children:(0,T.jsx)(E,{name:\"refresh\"})})})}function _S({title:e}){let t=Ve(),{navigate:n}=I(),{current:a,accounts:l}=Ee();return(0,T.jsx)(\"header\",{className:\"mail-header\",children:(0,T.jsxs)(\"div\",{className:\"search-pill\",children:[(0,T.jsx)(te,{icon:\"menu\",label:\"Menu\",onClick:()=>t.menu()}),(0,T.jsx)(\"button\",{type:\"button\",className:\"search-pill-text\",onClick:()=>n({screen:\"search\"}),children:`Search in ${e===\"Primary\"?\"mail\":e}`}),(0,T.jsxs)(\"button\",{type:\"button\",className:\"me\",\"aria-label\":`Account ${a?.email??\"\"}`,onClick:()=>n({screen:\"accounts\"}),children:[(0,T.jsx)(\"span\",{className:\"me-avatar\",style:{borderColor:a?.color??\"var(--accent)\"},children:(a?.name??a?.email??\"?\").slice(0,2).toUpperCase()}),l.length>1&&(0,T.jsx)(\"span\",{className:\"me-badge\",children:l.length})]})]})})}function RS({current:e}){let t=Ve(),n=Ja.filter(a=>a.category);return(0,T.jsx)(\"nav\",{className:\"category-chips\",\"aria-label\":\"Categories\",children:n.map(a=>(0,T.jsx)(US,{id:a.id,title:a.title,current:e===a.id,onClick:()=>e!==a.id&&t.list(a.path,\"replace\")},a.id))})}function US({id:e,title:t,current:n,onClick:a}){let l=hc(e);return(0,T.jsxs)(\"button\",{type:\"button\",className:\"category-chip\",\"aria-current\":n?\"page\":void 0,onClick:a,children:[t,l?(0,T.jsx)(\"span\",{className:\"count\",children:l}):null]})}var Vf=.3,HS=(0,rt.memo)(function({row:t,list:n,linked:a,account:l,selecting:i,actionable:o,terms:u,accountId:r,swipeLeft:c,swipeRight:m}){let d=Ve(),{navigate:f}=I(),{show:s}=qe(),h=xe(\"setStarred\",\"threads\",j),y=xe(\"setSelected\",\"threads\",j),S=xe(\"archive\",\"threads\",j),p=ic(\"threads\",t.threadId,j),g=(J,Ie,k)=>{let ue=[...p].reverse().find(Nt=>Nt.name===J);return ue?ue.args[Ie]??k:k},v=g(\"setStarred\",\"starred\",t.starred),x=g(\"setSelected\",\"selected\",t.selected),[w,U]=(0,rt.useState)(0),[C,D]=(0,rt.useState)(!1),Q=(0,rt.useRef)(null),O=(0,rt.useRef)(null),ne=a.filter(J=>!J.done&&!J.snooze),Ne=a.find(J=>J.snooze&&!J.done),he=(J,Ie=-1)=>{if(J===\"archive\"){let k=O.current,ue=k?.offsetWidth??360,Nt=du()||!k;U(Ie*ue);let Gl=Nt?null:k.animate([{height:`${k.offsetHeight}px`},{height:\"0px\"}],{duration:220,delay:180,easing:\"cubic-bezier(.2, 0, 0, 1)\",fill:\"forwards\"});S(t.threadId).then(jt=>{if(jt.outcome===\"observed\"){s({text:\"Archived\"});return}Gl?.cancel(),U(0),s({text:\"Couldn't archive. Try again.\"})})}else J===\"remind\"&&f({screen:\"add\",params:{type:\"reminder\",emails:JSON.stringify([My(t,r)]),archive:\"row\"}})},K=J=>{!o||i||J.pointerType===\"mouse\"&&J.button!==0||(Q.current={x:J.clientX,y:J.clientY,id:J.pointerId,swiping:!1})},q=J=>{let Ie=Q.current;if(!Ie||Ie.id!==J.pointerId)return;let k=J.clientX-Ie.x,ue=J.clientY-Ie.y;if(!Ie.swiping){if(Math.abs(ue)>12){Q.current=null;return}if(Math.abs(k)<14)return;Ie.swiping=!0,D(!0),J.currentTarget.setPointerCapture(J.pointerId)}let Nt=k>0&&m!==\"none\"||k<0&&c!==\"none\";U(Nt?k:0)},ln=()=>{let J=Q.current;if(Q.current=null,!J?.swiping)return;D(!1);let Ie=O.current?.offsetWidth??360,k=w,ue=k>0?m:c;if(Math.abs(k)>Ie*Vf&&ue===\"archive\"){he(ue,Math.sign(k));return}U(0),Math.abs(k)>Ie*Vf&&he(ue)},Cn=`${t.unread?\"Unread. \":\"\"}${t.sender}. ${t.subject}. ${t.date}`,H=w>0?m:w<0?c:\"\",_t=Math.abs(w)>(O.current?.offsetWidth??360)*Vf;return(0,T.jsxs)(\"li\",{ref:O,className:`thread ${t.unread?\"unread\":\"\"} ${x?\"selected\":\"\"}`,children:[w!==0&&(0,T.jsxs)(\"div\",{className:`swipe-under ${w>0?\"right\":\"left\"} ${H}${_t?\" armed\":\"\"}`,\"aria-hidden\":\"true\",children:[(0,T.jsx)(E,{name:H===\"archive\"?\"archive\":\"bell\"}),(0,T.jsx)(\"span\",{children:H===\"archive\"?\"Archive\":\"Remind\"})]}),(0,T.jsxs)(\"div\",{className:`thread-inner${C?\" dragging\":\"\"}`,style:w?{transform:`translateX(${w}px)`}:void 0,onPointerDown:K,onPointerMove:q,onPointerUp:ln,onPointerCancel:()=>{Q.current=null,D(!1),U(0)},children:[(0,T.jsx)(\"button\",{type:\"button\",className:\"avatar-button\",\"aria-label\":x?`Deselect ${t.subject}`:`Select ${t.subject}`,\"aria-pressed\":x,disabled:!o,onClick:()=>{y(t.threadId,{selected:!x})},children:(0,T.jsx)(Wa,{name:t.sender,selected:x})}),(0,T.jsxs)(\"button\",{type:\"button\",className:\"thread-main\",\"aria-label\":Cn,onClick:()=>i?void y(t.threadId,{selected:!x}):d.thread(t.threadId,n.path),children:[(0,T.jsxs)(\"span\",{className:\"thread-line\",children:[l&&(0,T.jsx)(Ze,{color:l}),(0,T.jsx)(\"span\",{className:\"sender\",children:t.sender}),(0,T.jsx)(\"span\",{className:\"date\",children:t.date})]}),(0,T.jsx)(\"span\",{className:\"subject\",children:(0,T.jsx)(ou,{text:t.subject,terms:u})}),(0,T.jsx)(\"span\",{className:\"snippet\",children:(0,T.jsx)(ou,{text:t.snippet,terms:u})}),(ne.length>0||Ne||t.attachment||t.labels.length>0)&&(0,T.jsxs)(\"span\",{className:\"thread-chips\",children:[ne.map(J=>(0,T.jsx)(\"span\",{className:`chip-small ${J.type}`,children:J.type===\"todo\"?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(E,{name:\"check\",size:12}),\" To-do added\"]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(E,{name:\"bell\",size:12}),\" \",J.dueDate?Fn(J):\"Reminder\"]})},J.id)).slice(0,2),Ne&&(0,T.jsxs)(\"span\",{className:\"chip-small\",children:[(0,T.jsx)(E,{name:\"clock\",size:12}),\" \",Fn(Ne)]}),t.attachment&&(0,T.jsxs)(\"span\",{className:\"chip-small attachment\",children:[(0,T.jsx)(E,{name:\"clip\",size:12}),\" Attachment\"]}),t.labels.filter(J=>J!==\"Inbox\"||u.length>0).slice(0,2).map(J=>(0,T.jsx)(\"span\",{className:\"chip-small label\",children:J},J))]})]}),(0,T.jsx)(te,{icon:\"star\",label:v?\"Unstar\":\"Star\",filled:v,pressed:v,className:v?\"star on\":\"star\",disabled:!o,onClick:()=>{h(t.threadId,{starred:!v})}})]})]})});function BS({rows:e,accountId:t}){let n=xe(\"clearSelection\",null,j),a=xe(\"archiveSelected\",null,j),l=xe(\"trashSelected\",null,j),{navigate:i}=I(),{show:o}=qe(),u=(r,c)=>{r(null).then(m=>o({text:m.outcome===\"observed\"?c:m.message??\"Couldn't finish. Try again.\"}))};return(0,T.jsxs)(\"header\",{className:\"selection-bar\",children:[(0,T.jsx)(te,{icon:\"close\",label:\"Clear selection\",onClick:()=>{n(null)}}),(0,T.jsxs)(\"h1\",{children:[e.length,\" selected\"]}),(0,T.jsx)(\"span\",{className:\"spacer\"}),(0,T.jsx)(te,{icon:\"archive\",label:\"Archive selected\",onClick:()=>u(a,`${e.length} archived`)}),(0,T.jsx)(te,{icon:\"trash\",label:\"Delete selected\",onClick:()=>u(l,`${e.length} moved to Trash`)}),(0,T.jsx)(te,{icon:\"bell\",label:\"Save for later\",onClick:()=>i({screen:\"bulk\",params:{emails:JSON.stringify(e.map(r=>My(r,t)))}})})]})}function LS({query:e}){let{navigate:t,back:n}=I();return(0,T.jsx)(\"header\",{className:\"mail-header\",children:(0,T.jsxs)(\"div\",{className:\"search-pill\",children:[(0,T.jsx)(te,{icon:\"back\",label:\"Back\",onClick:n}),(0,T.jsx)(\"button\",{type:\"button\",className:\"search-pill-text filled\",onClick:()=>t({screen:\"search\",params:{q:e}}),children:e}),(0,T.jsx)(te,{icon:\"close\",label:\"Clear search\",onClick:()=>t({screen:\"search\",params:{q:\"\"}})})]})})}function GS({query:e,count:t,complete:n}){let a=Ve(),l=e.split(/\\s+/).filter(Boolean),i=r=>{let c=l.includes(r)?l.filter(m=>m!==r):[...l,r];c.length&&a.search(c.join(\" \"),\"replace\")},o=Zf(e).join(\" \"),u=Ay.filter(r=>l.includes(r.term));return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(\"nav\",{className:\"filter-chips\",\"aria-label\":\"Filters\",children:Ay.map(r=>(0,T.jsxs)(\"button\",{type:\"button\",className:\"filter-chip\",\"aria-pressed\":l.includes(r.term),onClick:()=>i(r.term),children:[l.includes(r.term)&&(0,T.jsx)(E,{name:\"check\",size:14}),r.label]},r.id))}),(0,T.jsxs)(\"p\",{className:\"results-line\",children:[(0,T.jsxs)(\"strong\",{children:[t,n?\"\":t?\"+\":\"\",\" results\"]}),o?` for \\u201C${o}\\u201D`:\"\",u.length?` \\xB7 ${u.map(r=>r.label.toLowerCase()).join(\", \")}`:\"\",(0,T.jsx)(\"span\",{className:\"muted\",children:\" \\xB7 Most recent\"})]})]})}function qS({query:e,items:t}){let n=el(),a=Le(),l=Zf(e).map(o=>o.toLowerCase()),i=l.length?t.filter(o=>!o.snooze&&l.every(u=>`${o.title} ${o.note} ${o.link?.subject??\"\"} ${o.link?.sender??\"\"}`.toLowerCase().includes(u))).slice(0,4):[];return i.length?(0,T.jsxs)(\"section\",{className:\"also\",children:[(0,T.jsx)(\"h2\",{className:\"section-label\",children:\"Also in your to-do\"}),(0,T.jsx)(\"ul\",{className:\"item-list card\",children:i.map(o=>(0,T.jsx)(tl,{item:o,now:a,onOpen:()=>n(o.id)},o.id))})]}):null}function YS({items:e}){let t=Ve(),{save:n,complete:a}=Se(),{show:l}=qe(),i=o=>{(o.snooze?a(o,!0):n({...o,returned:!0})).then(()=>l({text:\"Dismissed\",undo:()=>n(o)}),()=>l({text:\"Couldn't save. Try again.\"}))};return(0,T.jsxs)(\"section\",{className:\"back-section\",\"aria-label\":\"Back in your inbox\",children:[(0,T.jsxs)(\"h2\",{className:\"section-label\",children:[(0,T.jsx)(E,{name:\"bell\",size:14}),\" Back in your inbox\"]}),(0,T.jsx)(\"ul\",{className:\"back-list\",children:e.slice(0,5).map(o=>(0,T.jsxs)(\"li\",{className:\"back-row\",children:[(0,T.jsxs)(\"button\",{type:\"button\",className:\"back-main\",onClick:()=>{n({...o,returned:!0}),o.link?.threadId&&t.email(o.link.threadId,o.accountId)},children:[(0,T.jsx)(\"strong\",{children:o.link?.subject??o.title}),(0,T.jsxs)(\"span\",{children:[o.snooze?\"Snoozed\":o.title,\" \\xB7 \",o.link?.sender]})]}),(0,T.jsx)(te,{icon:\"check\",label:`Dismiss ${o.title}`,onClick:()=>i(o)})]},o.id))})]})}function jS({items:e,all:t,now:n}){let{navigate:a}=I(),l=e.filter(c=>c.type===\"todo\").length,i=e.length-l,o=t.filter(c=>c.done&&c.completedAt&&pe(new Date(c.completedAt))===pe(n)).length,u=o/(o+e.length),r=[...e].sort((c,m)=>(c.dueTime??\"\").localeCompare(m.dueTime??\"\")).slice(0,2);return(0,T.jsxs)(\"section\",{className:\"today-card\",children:[(0,T.jsxs)(\"button\",{type:\"button\",className:\"today-head\",onClick:()=>a({screen:\"todo\",mode:\"root\"}),children:[(0,T.jsxs)(\"span\",{children:[(0,T.jsx)(\"strong\",{children:\"Today\"}),\" \",(0,T.jsx)(\"span\",{className:\"muted\",children:[l&&`${l} to-do${l>1?\"s\":\"\"}`,i&&`${i} reminder${i>1?\"s\":\"\"}`].filter(Boolean).join(\" \\xB7 \")})]}),(0,T.jsx)(E,{name:\"right\"})]}),(0,T.jsx)(\"ul\",{children:r.map(c=>(0,T.jsx)(XS,{item:c,now:n},c.id))}),(0,T.jsx)(\"div\",{className:\"progress\",role:\"progressbar\",\"aria-label\":\"Done today\",\"aria-valuemin\":0,\"aria-valuemax\":100,\"aria-valuenow\":Math.round(u*100),children:(0,T.jsx)(\"span\",{style:{width:`${Math.round(u*100)}%`}})})]})}function XS({item:e,now:t}){let{navigate:n}=I(),{checking:a,toggle:l}=Xf(e);return(0,T.jsxs)(\"li\",{className:`today-row${a?\" is-done\":\"\"}`,children:[(0,T.jsx)(fu,{item:e,onToggle:l,checking:a}),(0,T.jsx)(\"button\",{type:\"button\",className:\"today-title\",onClick:()=>n({screen:\"item\",params:{id:e.id}}),children:e.title}),(0,T.jsx)(\"span\",{className:`tag ${e.type===\"reminder\"?\"reminder\":\"due\"}`,children:e.dueTime?Fn(e,t).replace(/^Today /,\"by \"):Fn(e,t)})]})}var ha=Y(Ke(),1);var z=Y(P(),1),If={archive:\"Archive\",trash:\"Delete\",deleteForever:\"Delete forever\",notSpam:\"Not spam\",moveToInbox:\"Move to inbox\",mute:\"Mute\",markUnread:\"Mark unread\",spam:\"Report spam\"},VS={archive:\"Archived\",trash:\"Moved to Trash\",deleteForever:\"Deleted forever\",notSpam:\"Moved to inbox\",moveToInbox:\"Moved to inbox\",mute:\"Muted\",markUnread:\"Marked unread\",spam:\"Reported as spam\"};function zy({threadId:e,list:t}){let n=hn(j),l=vn(\"conversation\",null,j)?.data,{items:i}=Se(),{settings:o}=yt(),u=Ee(),{back:r,navigate:c}=I(),{show:m}=qe(),d=el(),f=Le(),[s,h]=(0,ha.useState)(null),y=n.status===\"ready\"&&!n.stale&&l!==void 0,S=Vi(i,e).filter(k=>!k.snooze||!k.done),p=u.current,{save:g}=Se();(0,ha.useEffect)(()=>{for(let k of S)k.bringBack&&!k.returned&&k.dueDate&&new Date(`${k.dueDate}T${k.dueTime??\"00:00\"}`)<=f&&g({...k,returned:!0})},[S.length]);let v={archive:xe(\"archive\",\"conversation\",j),trash:xe(\"trash\",\"conversation\",j),deleteForever:xe(\"deleteForever\",\"conversation\",j),notSpam:xe(\"notSpam\",\"conversation\",j),moveToInbox:xe(\"moveToInbox\",\"conversation\",j),mute:xe(\"mute\",\"conversation\",j),markUnread:xe(\"markUnread\",\"conversation\",j),spam:xe(\"spam\",\"conversation\",j)},x=xe(\"setStarred\",\"conversation\",j),w=xe(\"respond\",\"conversation\",j);(0,ha.useEffect)(()=>{!y||cu.threadId!==e||(cu.threadId=null,w(null,{mode:\"reply\"}))},[y,e]);let[U,C]=(0,ha.useState)(null),D=k=>{h(null),C(k),v[k](null).then(ue=>{C(null),m({text:ue.outcome===\"observed\"?VS[k]??\"Done\":ue.message??\"Couldn't finish. Try again.\"})})},Q=[...ic(\"conversation\",null,j)].reverse().find(k=>k.name===\"setStarred\"),O=Q?!!Q.args.starred:l?.starred??!1,ne=fc(!l),Ne=()=>{if(!l)return null;let k=l.messages[0],ue=l.messages[l.messages.length-1];return{threadId:e,subject:l.subject,sender:k?.sender??\"\",snippet:(ue?.snippet||QS(ue?.body??[])).slice(0,200),receivedAt:ue?.time??\"\",accountId:p?.id??\"unknown\"}},he=k=>{let ue=Ne();h(null),ue&&c({screen:\"add\",params:{type:k,emails:JSON.stringify([ue]),archive:\"conversation\"}})},{saveMany:K,removeMany:q}=Se(),ln=async k=>{let ue=Ne();if(h(null),!ue)return;let Nt=_l(\"reminder\",ue,p?.id??\"unknown\",{title:Wn(ue.subject),dueDate:pe(k),dueTime:ut(k)});try{await K([Nt]),m({text:`Reminder set \\xB7 ${$n(Nt,f)}`,undo:()=>q([Nt.id]),view:()=>d(Nt.id)})}catch{m({text:\"Couldn't save. Try again.\"})}},Cn;l?Cn=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\"div\",{className:\"subject-row\",children:[(0,z.jsx)(\"h1\",{className:\"conversation-subject\",children:l.subject}),(0,z.jsx)(te,{icon:\"star\",label:O?\"Unstar\":\"Star\",filled:O,pressed:O,className:O?\"star on\":\"star\",disabled:!y,onClick:()=>{x(null,{starred:!O})}})]}),(0,z.jsxs)(\"div\",{className:\"conversation-meta\",children:[p&&(0,z.jsxs)(\"span\",{className:\"account-line\",children:[(0,z.jsx)(Ze,{color:p.color}),\" \",p.name]}),l.labels.slice(0,3).map(k=>(0,z.jsx)(\"span\",{className:\"chip-small label\",children:k},k)),l.messages.length>1&&(0,z.jsxs)(\"span\",{className:\"muted\",children:[l.messages.length,\" messages\"]})]}),S.length>0&&(0,z.jsxs)(\"section\",{className:\"linked-items\",\"aria-label\":\"Linked items\",children:[(0,z.jsx)(\"h2\",{className:\"section-label\",children:S.length===1?\"1 item linked\":`${S.length} items linked`}),(0,z.jsx)(\"ul\",{className:\"item-list card\",children:S.map(k=>(0,z.jsx)(tl,{item:k,now:f,onOpen:()=>d(k.id)},k.id))})]}),(0,z.jsx)(\"ol\",{className:\"messages\",children:l.messages.map((k,ue)=>(0,z.jsx)(ZS,{message:k,last:ue===l.messages.length-1},k.id))}),(0,z.jsxs)(\"div\",{className:\"reply-row\",children:[(0,z.jsxs)(\"button\",{type:\"button\",className:\"outline\",disabled:!y,onClick:()=>{w(null,{mode:\"reply\"})},children:[(0,z.jsx)(E,{name:\"reply\"}),\" Reply\"]}),(0,z.jsxs)(\"button\",{type:\"button\",className:\"outline\",disabled:!y,onClick:()=>{w(null,{mode:\"replyAll\"})},children:[(0,z.jsx)(E,{name:\"replyAll\"}),\" Reply all\"]}),(0,z.jsxs)(\"button\",{type:\"button\",className:\"outline\",disabled:!y,onClick:()=>{w(null,{mode:\"forward\"})},children:[(0,z.jsx)(E,{name:\"forward\"}),\" Forward\"]})]})]}):Cn=n.status===\"error\"?(0,z.jsx)(kt,{title:\"Couldn't open this email\",role:\"alert\",icon:\"alert\",children:(0,z.jsx)(\"p\",{children:n.error?.message})}):(0,z.jsx)(nn,{label:\"Loading email\",kind:\"email\",rows:6});let H=l?.commands??[],_t=H.includes(\"moveToInbox\")?[\"moveToInbox\",\"trash\",\"markUnread\"]:[\"archive\",\"trash\",\"markUnread\"],J=H.filter(k=>!_t.includes(k)),Ie={archive:\"archive\",trash:\"trash\",markUnread:\"unread\",moveToInbox:\"inbox\"};return(0,z.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,z.jsxs)(\"header\",{className:\"top-bar\",children:[(0,z.jsx)(te,{icon:\"back\",label:`Back to ${t.title}`,onClick:r}),(0,z.jsx)(\"span\",{className:\"spacer\"}),_t.map(k=>(0,z.jsx)(te,{icon:Ie[k],label:If[k],disabled:!y||U!==null||!H.includes(k),onClick:()=>D(k)},k)),(0,z.jsx)(te,{icon:\"clock\",label:\"Snooze\",disabled:!y||U!==null,onClick:()=>he(\"snooze\")}),(0,z.jsx)(te,{icon:\"more\",label:\"More\",disabled:!y||U!==null,pressed:s===\"more\",onClick:()=>h(s===\"more\"?null:\"more\")})]}),s===\"more\"&&(0,z.jsxs)(iu,{onClose:()=>h(null),className:\"more-menu\",children:[J.map(k=>(0,z.jsx)(\"button\",{type:\"button\",role:\"menuitem\",onClick:()=>D(k),children:If[k]},k)),(0,z.jsx)(\"button\",{type:\"button\",role:\"menuitem\",onClick:()=>{h(null),c({screen:\"settings\"})},children:\"Gmail Only settings\"})]}),(0,z.jsx)(dc,{active:U!==null||!!l&&n.stale,label:U?If[U]:\"Updating\"}),(0,z.jsxs)(Xe,{className:`screen conversation${ne&&l?\" reveal\":\"\"}`,\"aria-busy\":!y,children:[o.showAddTo&&(0,z.jsxs)(\"div\",{className:\"add-to\",children:[(0,z.jsxs)(\"button\",{type:\"button\",className:\"add-pill\",\"aria-expanded\":s===\"add\",disabled:!l,onClick:()=>h(s===\"add\"?null:\"add\"),children:[(0,z.jsx)(E,{name:\"plus\"}),\" Add to\\u2026 \",(0,z.jsx)(E,{name:s===\"add\"?\"up\":\"down\"})]}),(0,z.jsx)(\"span\",{className:\"muted\",children:\"Save this email as a reminder or to-do\"})]}),s===\"add\"&&(0,z.jsxs)(iu,{onClose:()=>h(null),className:\"add-menu\",children:[(0,z.jsxs)(\"button\",{type:\"button\",role:\"menuitem\",className:\"add-option\",onClick:()=>he(\"reminder\"),children:[(0,z.jsx)(\"span\",{className:\"tile reminder\",children:(0,z.jsx)(E,{name:\"bell\"})}),(0,z.jsxs)(\"span\",{children:[(0,z.jsx)(\"strong\",{children:\"Add a reminder\"}),(0,z.jsx)(\"small\",{children:\"Get notified at a set time\"})]})]}),(0,z.jsxs)(\"button\",{type:\"button\",role:\"menuitem\",className:\"add-option\",onClick:()=>he(\"todo\"),children:[(0,z.jsx)(\"span\",{className:\"tile todo\",children:(0,z.jsx)(E,{name:\"check2\"})}),(0,z.jsxs)(\"span\",{children:[(0,z.jsx)(\"strong\",{children:\"Add to to-do\"}),(0,z.jsx)(\"small\",{children:\"A task to finish, due date optional\"})]})]}),(0,z.jsxs)(\"div\",{className:\"quick-row\",children:[(0,z.jsx)(\"span\",{className:\"section-label\",children:\"Quick\"}),cy(o.defaultReminderTime,f).map(k=>(0,z.jsxs)(\"button\",{type:\"button\",className:\"chip\",onClick:()=>{ln(k.date)},children:[(0,z.jsx)(E,{name:\"clock\",size:14}),\" \",k.label]},k.id))]})]}),Cn]})]})}var QS=e=>e.map(t=>t.text).join(\"\").replace(/\\s+/g,\" \").trim();function ZS({message:e,last:t}){let{navigate:n}=I(),a=xe(\"expandMessage\",\"conversation\",j),[l,i]=(0,ha.useState)(t||e.body.length>0),[o,u]=(0,ha.useState)(!1),[r,c]=(0,ha.useState)(null),m=e.body.length>0;return(0,z.jsxs)(\"li\",{className:\"message\",children:[(0,z.jsxs)(\"button\",{type:\"button\",className:\"message-head\",\"aria-expanded\":l&&m,\"aria-busy\":o,disabled:o,onClick:()=>{if(m){i(!l);return}u(!0),c(null);let f=(s,h)=>{u(!1),s?i(!0):c(h??\"Couldn't open this message. Try again.\")};a(null,{id:e.id}).then(s=>f(s.outcome===\"observed\",s.message),()=>f(!1))},children:[(0,z.jsx)(Wa,{name:e.sender,size:36}),(0,z.jsxs)(\"span\",{className:\"message-who\",children:[(0,z.jsx)(\"strong\",{children:e.sender}),(0,z.jsxs)(\"span\",{className:\"muted\",children:[e.recipients,e.time&&e.time!==e.recipients?` \\xB7 ${e.time}`:\"\"]})]})]}),l&&m?(0,z.jsxs)(\"div\",{className:\"message-body\",dir:\"auto\",children:[e.body.map((f,s)=>f.href?(0,z.jsx)(\"a\",{href:f.href,onClick:h=>{h.preventDefault(),n({url:f.href})},children:f.text},s):f.bold?(0,z.jsx)(\"strong\",{children:f.text},s):(0,z.jsx)(\"span\",{children:f.text},s)),e.truncated&&(0,z.jsx)(\"p\",{className:\"muted\",children:\"This message is long. The rest is in Gmail.\"})]}):(0,z.jsx)(\"p\",{className:\"message-snippet\",children:o?\"Opening\\u2026\":r??e.snippet}),e.attachments.length>0&&(0,z.jsx)(\"ul\",{className:\"attachments\",children:e.attachments.map((f,s)=>{let h=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\"span\",{className:\"file-tile\",children:(f.name.split(\".\").pop()??\"file\").slice(0,4).toUpperCase()}),(0,z.jsxs)(\"span\",{children:[(0,z.jsx)(\"strong\",{children:f.name}),(0,z.jsx)(\"small\",{children:[f.size,f.href?\"Opens in Gmail\":\"\"].filter(Boolean).join(\" \\xB7 \")})]})]});return(0,z.jsx)(\"li\",{children:f.href?(0,z.jsx)(\"a\",{className:\"attachment-card\",href:f.href,onClick:y=>{y.preventDefault(),n({url:f.href})},children:h}):(0,z.jsx)(\"span\",{className:\"attachment-card\",children:h})},s)})})]})}var Ul=Y(Ke(),1);var W=Y(P(),1),IS=3,Kf=\"10:00\";function KS(e){let t=_e(vt(e),IS);for(;t.getDay()===0||t.getDay()===6;)t=_e(t,1);return ot(t,Kf)}function Cy(){let e=hn(j),t=vn(\"compose\",null,j)?.data,n=xe(\"fill\",\"compose\",j),a=xe(\"discard\",\"compose\",j),{viewWebsite:l,back:i}=I(),{current:o}=Ee(),{saveMany:u,removeMany:r}=Se(),{show:c}=qe(),m=Le(),[d,f]=(0,Ul.useState)({to:\"\",cc:\"\",bcc:\"\",subject:\"\"}),[s,h]=(0,Ul.useState)(!1),[y,S]=(0,Ul.useState)(!1),[p,g]=(0,Ul.useState)(!1),v=e.status===\"ready\"&&!e.stale&&t!==void 0;(0,Ul.useEffect)(()=>{!t||s||(f({to:t.to,cc:t.cc,bcc:t.bcc,subject:t.subject}),(t.cc||t.bcc)&&S(!0),h(!0))},[t,s]);let x=/^re:/i.test(t?.subject??\"\"),w=/^fwd?:/i.test(t?.subject??\"\"),U=x?\"Reply\":w?\"Forward\":\"New message\",C=KS(m),D=()=>n(null,d);async function Q(){if((await D()).outcome!==\"observed\"&&c({text:\"Couldn't copy the fields to Gmail. Check them there.\"}),p){let he=d.subject.trim()||\"(no subject)\",K=_l(\"todo\",{threadId:null,sender:d.to.trim()||\"Recipient\",subject:he,snippet:\"Sent by you\",receivedAt:\"\",accountId:o?.id??\"unknown\"},o?.id??\"unknown\",{title:`Follow up: ${Wn(he)}`.slice(0,200),dueDate:pe(C),dueTime:Kf,notify:!0,bringBack:!1});try{await u([K]),c({text:`Follow-up added for ${Jn(C)}`,undo:()=>r([K.id])})}catch{c({text:\"Couldn't save the follow-up.\"})}}l()}async function O(){(await a(null)).outcome!==\"observed\"&&i()}if(!t)return(0,W.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,W.jsxs)(\"header\",{className:\"top-bar\",children:[(0,W.jsx)(te,{icon:\"close\",label:\"Close\",onClick:i}),(0,W.jsx)(\"h1\",{children:\"Compose\"})]}),(0,W.jsx)(nn,{label:\"Opening compose\",kind:\"text\",rows:4})]});let ne=(Ne,he,K=\"text\")=>(0,W.jsxs)(\"label\",{className:\"compose-field\",children:[(0,W.jsx)(\"span\",{children:he}),(0,W.jsx)(\"input\",{type:K,value:d[Ne],inputMode:K===\"email\"?\"email\":void 0,autoComplete:\"off\",onChange:q=>f(ln=>({...ln,[Ne]:q.target.value})),onBlur:()=>{D()}})]});return(0,W.jsxs)(\"div\",{className:\"screen-frame compose-screen\",children:[(0,W.jsxs)(\"header\",{className:\"top-bar\",children:[(0,W.jsx)(te,{icon:\"close\",label:\"Discard draft\",onClick:()=>{O()}}),(0,W.jsx)(\"h1\",{children:U}),(0,W.jsx)(\"span\",{className:\"spacer\"}),(0,W.jsxs)(\"button\",{type:\"button\",className:\"accent send\",disabled:!v,onClick:()=>{Q()},children:[(0,W.jsx)(E,{name:\"send\"}),\" Continue\"]})]}),(0,W.jsxs)(Xe,{className:\"screen\",\"aria-busy\":!v,children:[(0,W.jsxs)(\"div\",{className:\"compose-card\",children:[(0,W.jsxs)(\"div\",{className:\"compose-field from\",children:[(0,W.jsx)(\"span\",{children:\"From\"}),o&&(0,W.jsx)(Ze,{color:o.color}),(0,W.jsx)(\"span\",{className:\"from-value\",children:t.from||o?.email})]}),(0,W.jsxs)(\"div\",{className:\"compose-to\",children:[ne(\"to\",\"To\",\"email\"),!y&&(0,W.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:()=>S(!0),children:\"Cc/Bcc\"})]}),y&&(0,W.jsxs)(W.Fragment,{children:[ne(\"cc\",\"Cc\",\"email\"),ne(\"bcc\",\"Bcc\",\"email\")]}),ne(\"subject\",\"Subject\"),(0,W.jsxs)(\"div\",{className:\"compose-body-note\",children:[(0,W.jsx)(E,{name:\"pencil\"}),(0,W.jsxs)(\"p\",{children:[\"Write your message in Gmail. Gmail Only copies the fields above, then opens Gmail's compose so you can write and send.\",t.body?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(\"br\",{}),(0,W.jsxs)(\"span\",{className:\"muted\",children:[\"Already written: \\u201C\",t.body.slice(0,120),t.body.length>120?\"\\u2026\":\"\",\"\\u201D\"]})]}):null]})]})]}),(0,W.jsx)(\"div\",{className:\"card remind-card\",children:(0,W.jsx)(tn,{icon:(0,W.jsx)(\"span\",{className:\"tile reminder small\",children:(0,W.jsx)(E,{name:\"bell\"})}),label:\"Remind me if no reply\",detail:`Adds a to-do for ${Jn(C)} \\xB7 ${Ct(Kf).replace(\":00\",\"\")}`,checked:p,onChange:g})}),(0,W.jsx)(\"p\",{className:\"hint padded\",children:\"Gmail's mobile web has no scheduled send, and Gmail Only never sends for you. The follow-up stays on your list until you tick it off.\"}),(0,W.jsxs)(\"button\",{type:\"button\",className:\"accent block padded-x\",disabled:!v,onClick:()=>{Q()},children:[\"Continue in Gmail \",(0,W.jsx)(E,{name:\"external\"})]})]})]})}var Oy=Y(Ke(),1);var Te=Y(P(),1);function ky(){let e=lc(\"menu\",j),t=vn(\"menuAccount\",null,j)?.data,n=xe(\"open\",\"menu\",j),{navigate:a,back:l}=I(),i=Ve(),{current:o}=Ee(),{items:u}=Se(),r=Le(),c=e.order.map(S=>e.get(S)?.data).filter(S=>!!S),m=new Map(c.map(S=>[S.arg,S])),d=c.filter(S=>S.kind===\"label\"),f=u.filter(S=>Fa(S,r)).length,s=u.filter(S=>S.snooze&&!S.done).length,h=o?.email??t?.email??\"\";(0,Oy.useEffect)(()=>{for(let S of Ja){let p=m.get(S.arg);p&&gc(S.id,p.count??0)}},[c,o?.id]);let y=(S,p,g,v,x,w)=>(0,Te.jsx)(\"li\",{children:(0,Te.jsxs)(\"button\",{type:\"button\",className:`drawer-row ${w??\"\"}`,onClick:x,children:[(0,Te.jsx)(E,{name:p}),(0,Te.jsx)(\"span\",{children:g}),v?(0,Te.jsx)(\"span\",{className:\"count\",children:v}):null]})},S);return(0,Te.jsxs)(\"div\",{className:\"screen-frame drawer\",children:[(0,Te.jsxs)(\"header\",{className:\"top-bar\",children:[(0,Te.jsx)(mc,{}),(0,Te.jsx)(\"span\",{className:\"spacer\"}),(0,Te.jsx)(te,{icon:\"close\",label:\"Close menu\",onClick:l})]}),(0,Te.jsxs)(Xe,{className:\"screen\",\"aria-busy\":e.status!==\"ready\",children:[(0,Te.jsxs)(\"button\",{type:\"button\",className:\"account-card\",onClick:()=>a({screen:\"accounts\"}),children:[o&&(0,Te.jsx)(Ze,{color:o.color}),(0,Te.jsxs)(\"span\",{children:[(0,Te.jsx)(\"strong\",{children:o?.name??\"Account\"}),(0,Te.jsx)(\"small\",{children:h})]}),(0,Te.jsx)(E,{name:\"down\"})]}),(0,Te.jsxs)(\"ul\",{className:\"drawer-list\",children:[y(\"todo\",\"todo\",\"To-do & reminders\",f,()=>a({screen:\"todo\",mode:\"root\"}),\"accent\"),y(\"snoozed\",\"clock\",\"Snoozed\",s,()=>a({screen:\"snoozed\"}))]}),(0,Te.jsx)(\"h2\",{className:\"section-label\",children:\"Gmail\"}),!c.length&&e.status!==\"ready\"?(0,Te.jsx)(nn,{label:\"Loading folders\",rows:6,kind:\"text\"}):(0,Te.jsx)(\"ul\",{className:\"drawer-list\",children:Ja.map(S=>y(S.id,S.icon,S.title,m.get(S.arg)?.count??null,()=>i.list(S.path,\"replace\")))}),d.length>0&&(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(\"h2\",{className:\"section-label\",children:\"Labels\"}),(0,Te.jsx)(\"ul\",{className:\"drawer-list\",children:d.map(S=>y(S.arg,\"label\",S.label,S.count,()=>{n(S.arg)}))})]}),(0,Te.jsx)(\"ul\",{className:\"drawer-list end\",children:y(\"settings\",\"settings\",\"Gmail Only settings\",null,()=>a({screen:\"settings\"}))})]})]})}var X=Y(P(),1);function _y(){let e=hn(j),t=vn(\"view\",null,j)?.data,{view:n}=ru();if(e.status===\"auth\")return(0,X.jsx)($S,{});if(e.status===\"error\"&&!t)return(0,X.jsx)(Jf,{children:(0,X.jsx)(xy,{error:e.error})});switch(t?.view?JS(t.view):n.kind===\"other\"?\"loading\":n.kind){case\"list\":return(0,X.jsx)(Dy,{list:n.kind===\"list\"||n.kind===\"conversation\"?n.list:yn});case\"conversation\":return n.kind===\"conversation\"?(0,X.jsx)(zy,{threadId:n.threadId,list:n.list}):(0,X.jsx)(Jf,{children:(0,X.jsx)(nn,{label:\"Loading email\",kind:\"email\",rows:6})});case\"compose\":return(0,X.jsx)(Cy,{});case\"menu\":return(0,X.jsx)(ky,{});case\"settings\":return(0,X.jsx)(FS,{});case\"loading\":return(0,X.jsx)(Jf,{children:(0,X.jsx)(nn,{label:\"Loading Gmail\"})});default:return(0,X.jsx)(WS,{})}}function JS(e){switch(e){case\"tl_\":return\"list\";case\"cv_\":return\"conversation\";case\"co_\":return\"compose\";case\"mn_\":return\"menu\";case\"pr_\":return\"settings\";default:return\"loading\"}}function Jf({children:e}){return(0,X.jsx)(\"div\",{className:\"screen-frame\",children:(0,X.jsx)(\"div\",{className:\"screen\",children:e})})}function $S(){let{viewWebsite:e}=I();return(0,X.jsx)(\"div\",{className:\"screen-frame\",children:(0,X.jsx)(\"div\",{className:\"screen centered\",children:(0,X.jsxs)(\"div\",{className:\"welcome\",children:[(0,X.jsx)(mc,{}),(0,X.jsx)(\"h1\",{children:\"Sign in to Gmail\"}),(0,X.jsx)(\"p\",{children:\"Gmail Only works over your own Gmail session. Sign in on Google's page; your reminders and to-dos stay on this device.\"}),(0,X.jsxs)(\"button\",{type:\"button\",className:\"accent block\",onClick:()=>e(),children:[\"Sign in with Google \",(0,X.jsx)(E,{name:\"external\"})]})]})})})}function FS(){let{viewWebsite:e,navigate:t}=I(),n=Ve();return(0,X.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,X.jsxs)(\"header\",{className:\"top-bar\",children:[(0,X.jsx)(te,{icon:\"back\",label:\"Back to inbox\",onClick:()=>n.inbox(\"replace\")}),(0,X.jsx)(\"h1\",{children:\"Gmail settings\"})]}),(0,X.jsxs)(\"div\",{className:\"screen\",children:[(0,X.jsxs)(\"div\",{className:\"card settings-links\",children:[(0,X.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>e(),children:[(0,X.jsx)(\"span\",{className:\"tile neutral\",children:(0,X.jsx)(E,{name:\"mail\"})}),(0,X.jsxs)(\"span\",{children:[(0,X.jsx)(\"strong\",{children:\"Signature, vacation reply and more\"}),(0,X.jsx)(\"small\",{children:\"Opens Gmail's settings page\"})]}),(0,X.jsx)(E,{name:\"external\"})]}),(0,X.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>t({screen:\"settings\"}),children:[(0,X.jsx)(\"span\",{className:\"tile todo\",children:(0,X.jsx)(E,{name:\"settings\"})}),(0,X.jsxs)(\"span\",{children:[(0,X.jsx)(\"strong\",{children:\"Gmail Only settings\"}),(0,X.jsx)(\"small\",{children:\"Reminders, to-dos, swipe and theme\"})]}),(0,X.jsx)(E,{name:\"right\"})]})]}),(0,X.jsx)(\"p\",{className:\"hint padded\",children:\"Gmail's settings change your Google account, so Gmail Only opens them in Gmail rather than redrawing them.\"})]})]})}function WS(){let{viewWebsite:e}=I(),t=Ve();return(0,X.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,X.jsxs)(\"header\",{className:\"top-bar\",children:[(0,X.jsx)(te,{icon:\"back\",label:\"Back to inbox\",onClick:()=>t.inbox(\"replace\")}),(0,X.jsx)(\"h1\",{children:\"Gmail\"})]}),(0,X.jsx)(\"div\",{className:\"screen\",children:(0,X.jsxs)(kt,{title:\"This part of Gmail opens in Gmail\",icon:\"mail\",children:[(0,X.jsx)(\"p\",{children:\"Gmail Only doesn't have its own screen for this page yet.\"}),(0,X.jsxs)(\"div\",{className:\"row-buttons\",children:[(0,X.jsxs)(\"button\",{type:\"button\",className:\"accent\",onClick:()=>e(),children:[\"Open in Gmail \",(0,X.jsx)(E,{name:\"external\"})]}),(0,X.jsx)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>t.inbox(\"replace\"),children:\"Go to inbox\"})]})]})})]})}var nl=Y(Ke(),1);var M=Y(P(),1),PS={overdue:\"Overdue\",today:\"Today\",tomorrow:\"Tomorrow\",week:\"This week\",later:\"Later\",none:\"No date yet\",done:\"Done\"},eT=[\"overdue\",\"today\",\"tomorrow\",\"week\",\"later\",\"none\",\"done\"];function Ry(){let{items:e,loading:t,error:n,saveMany:a}=Se(),l=Ee(),{settings:i,update:o}=yt(),{navigate:u}=I(),{show:r}=qe(),c=el(),m=Le(),[d,f]=(0,nl.useState)(i.defaultSort),[s,h]=(0,nl.useState)(\"all\"),[y,S]=(0,nl.useState)(null),[p,g]=(0,nl.useState)(null),[v,x]=(0,nl.useState)(!1),w=i.todoAccount,U=(0,nl.useMemo)(()=>{let K=(p??\"\").toLowerCase().split(/\\s+/).filter(Boolean);return e.filter(q=>!q.snooze).filter(q=>w===\"all\"||q.accountId===w).filter(q=>l.byId(q.accountId)?.showInTodo!==!1||w===q.accountId).filter(q=>!K.length||K.every(ln=>tT(q).includes(ln)))},[e,w,l,p]),C=pe(m),D=U.filter(K=>Ol(K,m)===\"overdue\"),Q=async()=>{let K=D.map(q=>({...q,dueDate:C}));try{await a(K),r({text:`${K.length} moved to today`,undo:()=>a(D)})}catch{r({text:\"Couldn't move them. Try again.\"})}},O=()=>u({screen:\"add\",params:{type:\"todo\"}}),ne=w===\"all\"?null:l.byId(w),Ne=!0,he;return t&&!e.length?he=(0,M.jsx)(nn,{label:\"Loading your to-dos\",kind:\"text\",rows:6}):n&&!e.length?he=(0,M.jsx)(kt,{title:\"Couldn't load your to-dos\",role:\"alert\",icon:\"alert\",children:(0,M.jsx)(\"p\",{children:\"Try closing and reopening Gmail Only.\"})}):U.length?d===\"due\"?he=(0,M.jsx)(aT,{items:U,now:m,day:y,keepDays:i.keepDoneDays,terms:p?p.split(/\\s+/):[],onOpen:c,onMoveAll:()=>{Q()}}):he=(0,M.jsx)(lT,{items:U,now:m,filter:s,onFilter:h,terms:p?p.split(/\\s+/):[],onOpen:c,onSetDate:K=>u({screen:\"add\",params:{type:K.type,itemId:K.id}})}):he=p?(0,M.jsx)(kt,{title:\"No matches\",icon:\"search\",children:(0,M.jsxs)(\"p\",{children:[\"Nothing in your to-dos matches \\u201C\",p,\"\\u201D.\"]})}):(0,M.jsxs)(kt,{title:\"Nothing due\",icon:\"check2\",children:[(0,M.jsxs)(\"p\",{children:[\"Save emails as reminders from any message. Open an email and tap \",(0,M.jsx)(\"strong\",{children:\"Add to\\u2026\"}),\", or swipe it right.\"]}),(0,M.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:O,children:[(0,M.jsx)(E,{name:\"plus\"}),\" Add a to-do\"]})]}),(0,M.jsxs)(\"div\",{className:\"screen-frame todo\",children:[(0,M.jsx)(\"header\",{className:\"todo-header\",children:p===null?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(\"h1\",{children:\"To-do\"}),(0,M.jsx)(\"span\",{className:\"spacer\"}),Ne&&(0,M.jsxs)(\"button\",{type:\"button\",className:\"account-filter\",\"aria-expanded\":v,onClick:()=>x(!v),children:[ne?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Ze,{color:ne.color}),\" \",ne.name]}):\"All accounts\",\" \",(0,M.jsx)(E,{name:\"down\",size:16})]}),(0,M.jsx)(te,{icon:\"search\",label:\"Search to-dos\",onClick:()=>g(\"\")})]}):(0,M.jsxs)(\"div\",{className:\"search-pill todo-search\",children:[(0,M.jsx)(E,{name:\"search\"}),(0,M.jsx)(\"input\",{type:\"search\",autoFocus:!0,placeholder:\"Search to-dos\",\"aria-label\":\"Search to-dos\",value:p,onChange:K=>g(K.target.value)}),(0,M.jsx)(te,{icon:\"close\",label:\"Close search\",onClick:()=>g(null)})]})}),v&&(0,M.jsxs)(iu,{onClose:()=>x(!1),className:\"account-menu\",children:[(0,M.jsx)(\"button\",{type:\"button\",role:\"menuitemradio\",\"aria-checked\":w===\"all\",onClick:()=>{o({todoAccount:\"all\"}),x(!1)},children:\"All accounts\"}),l.accounts.map(K=>(0,M.jsxs)(\"button\",{type:\"button\",role:\"menuitemradio\",\"aria-checked\":w===K.id,onClick:()=>{o({todoAccount:K.id}),x(!1)},children:[(0,M.jsx)(Ze,{color:K.color}),\" \",K.name,\" \",(0,M.jsx)(\"small\",{children:K.email})]},K.id))]}),(0,M.jsxs)(Xe,{className:\"screen\",\"aria-busy\":t,children:[(0,M.jsx)(\"div\",{className:\"segmented\",role:\"tablist\",\"aria-label\":\"Sort\",\"data-index\":d===\"due\"?0:1,children:[\"due\",\"added\"].map(K=>(0,M.jsx)(\"button\",{type:\"button\",role:\"tab\",\"aria-selected\":d===K,onClick:()=>f(K),children:K===\"due\"?\"When it's due\":\"When I added it\"},K))}),(0,M.jsxs)(\"div\",{className:\"crossfade\",children:[d===\"due\"&&(0,M.jsx)(nT,{items:U,now:m,day:y,onDay:S}),he]},d)]}),(0,M.jsx)(\"button\",{type:\"button\",className:\"fab round\",\"aria-label\":\"Add a to-do\",onClick:O,children:(0,M.jsx)(E,{name:\"plus\"})})]})}var tT=e=>`${e.title} ${e.note} ${e.link?.subject??\"\"} ${e.link?.sender??\"\"}`.toLowerCase();function nT({items:e,now:t,day:n,onDay:a}){let l=vt(t),i=Array.from({length:7},(u,r)=>_e(l,r)),o=new Set(e.filter(u=>!u.done&&u.dueDate).map(u=>u.dueDate));return(0,M.jsx)(\"div\",{className:\"week-strip\",role:\"group\",\"aria-label\":\"This week\",children:i.map(u=>{let r=pe(u),c=n===r,m=e.filter(d=>!d.done&&d.dueDate===r).length;return(0,M.jsxs)(\"button\",{type:\"button\",\"aria-pressed\":c,className:`week-day ${$a(u,t)===0?\"today\":\"\"}`,\"aria-label\":`${Jn(u)}${m?`, ${m} due`:\"\"}`,onClick:()=>a(c?null:r),children:[(0,M.jsx)(\"span\",{children:Xi(u).slice(0,1)}),(0,M.jsx)(\"strong\",{children:u.getDate()}),(0,M.jsx)(\"i\",{className:o.has(r)?\"dot\":\"dot none\",\"aria-hidden\":\"true\"})]},r)})})}function aT({items:e,now:t,day:n,terms:a,keepDays:l,onOpen:i,onMoveAll:o}){if(n){let r=e.filter(m=>m.dueDate===n&&!m.done).sort(au),c=en(n);return(0,M.jsxs)(\"section\",{className:\"group\",children:[(0,M.jsxs)(\"h2\",{className:\"group-head\",children:[(0,M.jsx)(\"span\",{children:Jn(c)}),(0,M.jsx)(\"small\",{children:r.length?`${r.length} due`:\"Nothing due\"})]}),r.length>0&&(0,M.jsx)(\"ul\",{className:\"item-list card\",children:r.map(m=>(0,M.jsx)($f,{item:m,now:t,terms:a,onOpen:i},m.id))})]})}let u=new Map;for(let r of e){let c=Ol(r,t);u.set(c,[...u.get(c)??[],r])}return(0,M.jsx)(M.Fragment,{children:eT.filter(r=>u.get(r)?.length).map(r=>{let c=u.get(r).sort(r===\"done\"?(d,f)=>(f.completedAt??0)-(d.completedAt??0):au),m=null;return r===\"today\"?m=`${c.length} left`:r===\"none\"?m=`${c.length} to schedule`:r===\"done\"&&(m=`Kept for ${l} days`),(0,M.jsxs)(\"section\",{className:`group ${r}`,children:[(0,M.jsxs)(\"h2\",{className:\"group-head\",children:[(0,M.jsx)(\"span\",{children:PS[r]}),r===\"overdue\"?(0,M.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:o,children:\"Move all to today\"}):m&&(0,M.jsx)(\"small\",{children:m})]}),(0,M.jsx)(\"ul\",{className:\"item-list card\",children:c.map(d=>(0,M.jsx)($f,{item:d,now:t,terms:a,onOpen:i},d.id))})]},r)})})}function lT({items:e,now:t,filter:n,onFilter:a,terms:l,onOpen:i,onSetDate:o}){let u={all:e.filter(d=>!d.done).length,reminder:e.filter(d=>!d.done&&d.type===\"reminder\").length,todo:e.filter(d=>!d.done&&d.type===\"todo\").length,done:e.filter(d=>d.done).length},r=e.filter(d=>n===\"all\"?!0:n===\"done\"?d.done:d.type===n&&!d.done).sort((d,f)=>f.createdAt-d.createdAt),c=new Map;for(let d of r){let f=pe(new Date(d.createdAt));c.set(f,[...c.get(f)??[],d])}let m=d=>{let f=$a(en(d),t);return f===0?\"Today\":f===-1?\"Yesterday\":Jn(en(d))};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(zn,{label:\"Show\",value:n,onChange:a,className:\"filters\",options:[{id:\"all\",label:(0,M.jsxs)(M.Fragment,{children:[\"All \",(0,M.jsx)(\"span\",{className:\"count\",children:u.all})]})},{id:\"reminder\",label:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{name:\"bell\",size:14}),\" Reminders \",(0,M.jsx)(\"span\",{className:\"count\",children:u.reminder})]})},{id:\"todo\",label:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{name:\"check2\",size:14}),\" To-dos \",(0,M.jsx)(\"span\",{className:\"count\",children:u.todo})]})},{id:\"done\",label:(0,M.jsxs)(M.Fragment,{children:[\"Done \",(0,M.jsx)(\"span\",{className:\"count\",children:u.done})]})}]}),!r.length&&(0,M.jsx)(\"p\",{className:\"muted padded\",children:\"Nothing here.\"}),[...c].map(([d,f])=>(0,M.jsxs)(\"section\",{className:\"group\",children:[(0,M.jsxs)(\"h2\",{className:\"group-head\",children:[(0,M.jsx)(\"span\",{children:m(d)}),(0,M.jsxs)(\"small\",{children:[f.length,\" added\"]})]}),(0,M.jsx)(\"ul\",{className:\"item-list card\",children:f.map(s=>(0,M.jsx)($f,{item:s,now:t,terms:l,onOpen:i,mode:\"added\",onSetDate:()=>o(s)},s.id))})]},d))]})}function $f({item:e,now:t,terms:n,onOpen:a,mode:l=\"due\",onSetDate:i}){return(0,M.jsx)(tl,{item:e,now:t,mode:l,onOpen:()=>a(e.id),onSetDate:i,trailing:n.length&&e.link?(0,M.jsx)(\"span\",{className:\"match\",children:(0,M.jsx)(ou,{text:e.link.subject,terms:n})}):void 0})}var Uy=Y(Ke(),1);var L=Y(P(),1);function Hy(){let{back:e,navigate:t}=I(),{items:n,loading:a,complete:l,save:i,remove:o}=Se(),u=Ee(),{settings:r}=yt(),{show:c}=qe(),m=Ve(),d=Le(),[f,s]=(0,Uy.useState)(!1),h=Qi(),y=n.find(O=>O.id===h.id);if(!y)return(0,L.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,L.jsx)(bn,{title:\"Item\"}),(0,L.jsx)(\"div\",{className:\"screen\",children:a?null:(0,L.jsx)(kt,{title:\"This item is gone\",icon:\"check2\",children:(0,L.jsxs)(\"p\",{children:[\"It was deleted, or removed after being done for \",r.keepDoneDays,\" days.\"]})})})]});let S=u.byId(y.accountId),p=y.type===\"reminder\",g=Ol(y,d)===\"overdue\",v=()=>t({screen:\"add\",params:{type:y.type,itemId:y.id}}),x=async()=>{let O=y;await l(y,!y.done);let ne=!y.done&&p&&y.repeat!==\"never\";c({text:y.done?\"Marked not done\":ne?\"Done. Next one scheduled\":\"Marked done\",undo:()=>i(O)})},w=async O=>{s(!1);let ne=y;await i({...y,dueDate:pe(O),dueTime:ut(O),returned:!1}),c({text:`Snoozed to ${$n({dueDate:pe(O),dueTime:ut(O)},d)}`,undo:()=>i(ne)})},U=async()=>{let O=y;e(),await o(y.id),c({text:p?\"Reminder deleted\":\"To-do deleted\",undo:()=>i(O)})},C=(O=!1)=>{y.link?.threadId&&(O&&(cu.threadId=y.link.threadId),m.email(y.link.threadId,y.accountId))},D=vt(d),Q=[{label:\"In 1 hour\",date:new Date(Math.ceil((d.getTime()+36e5)/3e5)*3e5)},{label:`Tomorrow ${Ct(r.defaultReminderTime).replace(\":00\",\"\")}`,date:ot(_e(D,1),r.defaultReminderTime)},{label:\"Next week\",date:ot(_e(D,(8-D.getDay())%7||7),r.defaultReminderTime)}];return(0,L.jsxs)(\"div\",{className:\"screen-frame item-screen\",children:[(0,L.jsxs)(bn,{title:(0,L.jsxs)(\"span\",{className:`type-label ${y.type}`,children:[(0,L.jsx)(E,{name:p?\"bell\":\"check2\",size:16}),\" \",p?\"Reminder\":\"To-do\"]}),children:[(0,L.jsx)(te,{icon:\"pencil\",label:\"Edit\",onClick:v}),(0,L.jsx)(te,{icon:\"trash\",label:\"Delete\",onClick:()=>{U()}})]}),(0,L.jsxs)(Xe,{className:\"screen\",children:[(0,L.jsxs)(\"div\",{className:\"item-hero\",children:[(0,L.jsx)(fu,{item:y,large:!0,onToggle:()=>{x()}}),(0,L.jsx)(\"h1\",{className:y.done?\"is-done\":void 0,children:y.title||\"Untitled\"})]}),(0,L.jsxs)(\"dl\",{className:\"card detail-rows\",children:[(0,L.jsxs)(Hl,{icon:p?\"bell\":\"calendar\",label:\"When\",children:[(0,L.jsx)(\"span\",{className:g?\"danger\":void 0,children:y.dueDate?$n(y,d):\"No date yet\"}),(0,L.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:v,children:y.dueDate?\"Change\":\"Set date\"})]}),p&&(0,L.jsx)(Hl,{icon:\"repeat\",label:\"Repeat\",children:nu[y.repeat]}),p&&y.link&&(0,L.jsx)(Hl,{icon:\"inbox\",label:\"Bring email back\",children:y.bringBack?\"On\":\"Off\"}),y.priority===\"high\"&&(0,L.jsx)(Hl,{icon:\"flag\",label:\"Priority\",children:\"High\"}),(0,L.jsx)(Hl,{icon:\"user\",label:\"Account\",children:S?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ze,{color:S.color}),\" \",S.name,\" \",(0,L.jsx)(\"small\",{className:\"muted\",children:S.email})]}):\"Unknown account\"}),(0,L.jsx)(Hl,{icon:\"pencil\",label:\"Added by you\",children:cc(y.createdAt,d)}),y.note&&(0,L.jsx)(Hl,{icon:\"note\",label:\"Note\",children:(0,L.jsx)(\"span\",{className:\"note-text\",children:y.note})})]}),y.link&&(0,L.jsxs)(\"section\",{\"aria-label\":\"From this email\",children:[(0,L.jsx)(\"h2\",{className:\"section-label\",children:\"From this email\"}),y.link.deleted||!y.link.threadId?(0,L.jsxs)(\"div\",{className:\"card email-card gone\",children:[(0,L.jsx)(E,{name:\"trash\"}),(0,L.jsxs)(\"span\",{children:[(0,L.jsx)(\"strong\",{children:\"Email deleted\"}),(0,L.jsx)(\"small\",{children:y.link.subject})]})]}):(0,L.jsxs)(\"button\",{type:\"button\",className:\"card email-card\",onClick:()=>C(),children:[(0,L.jsx)(Wa,{name:y.link.sender,size:40}),(0,L.jsxs)(\"span\",{children:[(0,L.jsx)(\"strong\",{children:Pa(y.link.sender)}),(0,L.jsx)(\"span\",{className:\"email-subject\",children:y.link.subject}),(0,L.jsx)(\"small\",{children:y.link.snippet})]}),(0,L.jsx)(E,{name:\"right\"})]}),y.link.threadId&&!y.link.deleted&&(0,L.jsx)(\"p\",{className:\"hint\",children:\"If the email was archived, this opens it from All mail.\"})]}),f&&(0,L.jsxs)(\"div\",{className:\"chips snooze-chips\",role:\"group\",\"aria-label\":\"Snooze until\",children:[Q.map(O=>(0,L.jsx)(\"button\",{type:\"button\",className:\"chip\",onClick:()=>{w(O.date)},children:O.label},O.label)),(0,L.jsx)(\"button\",{type:\"button\",className:\"chip\",onClick:v,children:\"Pick\\u2026\"})]})]}),(0,L.jsxs)(\"footer\",{className:\"action-bar\",children:[y.link?.threadId&&!y.link.deleted&&(0,L.jsxs)(\"button\",{type:\"button\",className:\"secondary\",onClick:()=>C(!0),children:[(0,L.jsx)(E,{name:\"reply\"}),\" Reply\"]}),!y.done&&(0,L.jsxs)(\"button\",{type:\"button\",className:\"secondary\",\"aria-expanded\":f,onClick:()=>s(!f),children:[(0,L.jsx)(E,{name:\"clock\"}),\" Snooze\"]}),(0,L.jsxs)(\"button\",{type:\"button\",className:y.done?\"secondary\":\"accent\",onClick:()=>{x()},children:[(0,L.jsx)(E,{name:y.done?\"back\":\"check\"}),\" \",y.done?\"Undo\":\"Mark done\"]})]})]})}function Hl({icon:e,label:t,children:n}){return(0,L.jsxs)(\"div\",{className:\"detail-row\",children:[(0,L.jsxs)(\"dt\",{children:[(0,L.jsx)(E,{name:e,size:18}),\" \",t]}),(0,L.jsx)(\"dd\",{children:n})]})}var Bl=Y(Ke(),1);var _=Y(P(),1);function iT(e){let t=vt(e),n=[],a=ot(t,\"18:00\");a.getTime()-e.getTime()>30*6e4&&n.push({id:\"evening\",label:\"Later today\",date:a,detail:Dn(a,e)});let l=ot(_e(t,1),\"08:00\");n.push({id:\"tomorrow\",label:\"Tomorrow\",date:l,detail:Dn(l,e)});let i=ot(_e(t,(8-t.getDay())%7||7),\"08:00\");return n.push({id:\"week\",label:\"Next week\",date:i,detail:Dn(i,e)}),n}function Ff(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n?.subject==\"string\").slice(0,100):[]}catch{return[]}}function oT(){let e=xe(\"archive\",\"conversation\",j),t=xe(\"archive\",\"threads\",j),n=xe(\"archiveSelected\",null,j);return(a,l)=>a===\"conversation\"?e(null):a===\"row\"&&l[0]?.threadId?t(l[0].threadId):a===\"selected\"?n(null):Promise.resolve(null)}function By(){let{saveMany:e,removeMany:t}=Se(),{back:n,navigate:a}=I(),{show:l}=qe(),i=oT();return async(o,u,r,c=[])=>{try{await e(o)}catch{return l({text:\"Couldn't save. Try again.\"}),!1}n();let m=r?await i(r,c).catch(()=>({outcome:\"failed\"})):null,d=m?.outcome===\"observed\";return l({text:m!==null&&!d?`${u}. Gmail didn't archive the email, so it's still in the inbox.`:u,undo:async()=>{await t(o.map(s=>s.id)),d&&l({text:\"Item removed. The email is in All mail.\"})},view:o.length===1?()=>a({screen:\"item\",params:{id:o[0].id}}):()=>a({screen:\"todo\",mode:\"root\"})}),!0}}function uT(e,t,n,a,l,i){let o={type:e,title:n.length===1?Wn(n[0].subject):\"\",note:\"\",preset:\"\",picked:\"\",repeat:\"never\",bringBack:!0,due:\"today\",pickedDate:pe(_e(i,1)),notify:!1,time:l,priority:\"normal\",archive:a};if(!t)return o;let u=t.dueDate??\"\",r=t.dueDate&&t.dueTime?`${t.dueDate}T${t.dueTime}`:\"\";return{...o,type:t.type,title:t.title,note:t.note,repeat:t.repeat,bringBack:t.bringBack,priority:t.priority,preset:t.type===\"reminder\"&&r?\"pick\":\"\",picked:r,due:t.dueDate?\"pick\":\"none\",pickedDate:u||o.pickedDate,notify:t.type===\"todo\"&&!!t.dueTime,time:t.dueTime??l,archive:!1}}function Ly(){let{screen:e,back:t}=I(),n=e?.params??{},a=Le(),{items:l}=Se(),i=Ee(),{settings:o}=yt(),u=By(),r=n.itemId?l.find(H=>H.id===n.itemId):void 0,c=(0,Bl.useMemo)(()=>r?.link?[{...r.link,accountId:r.accountId}]:Ff(n.emails),[r,n.emails]),m=n.type===\"snooze\"?\"snooze\":null,[d,f]=(0,Bl.useState)(()=>uT(n.type===\"todo\"?\"todo\":\"reminder\",r,c,o.archiveAfterAdding,o.defaultReminderTime,a)),s=H=>f(_t=>({..._t,...H})),[h,y]=(0,Bl.useState)(!1),S=ry(o.defaultReminderTime,a),p=d.preset||(S.find(H=>H.id===\"later\")??S.find(H=>H.id===\"tomorrow\")??S[0]).id,g=`${pe(a)}T${ut(a)}`,v=p===\"pick\"?d.picked?new Date(d.picked):null:S.find(H=>H.id===p)?.date??null,x=v!==null&&v>a,w=c[0]?i.byId(c[0].accountId):i.current,U=w?.id??i.current?.id??\"unknown\",C=c.length===1?Vi(l,c[0].threadId).filter(H=>H.id!==r?.id).length:0,D=c.length>1,Q=sy(d.due,d.due===\"pick\"?d.pickedDate:null,a),O=d.notify&&!Q?pe(a):Q,ne=!d.notify||ot(en(O),d.time)>a;if(m===\"snooze\")return(0,_.jsx)(cT,{emails:c,archive:n.archive});let Ne=()=>t(),he=()=>s({type:d.type===\"reminder\"?\"todo\":\"reminder\"});async function K(){if(h)return;let H=d.type===\"reminder\";if(H&&!x||!H&&!ne)return;y(!0);let _t=H?{type:\"reminder\",dueDate:pe(v),dueTime:ut(v),notify:!0,repeat:d.repeat,bringBack:d.bringBack,priority:d.priority}:{type:\"todo\",dueDate:O,dueTime:d.notify?d.time:null,notify:d.notify,repeat:\"never\",bringBack:!1,priority:d.priority},J=d.note.trim().slice(0,2e3),k=(c.length?c:[null]).map(Pn=>{let Ki=(D?Wn(Pn.subject):d.title.trim())||(Pn?Wn(Pn.subject):\"\");return r?{...r,..._t,title:Ki,note:J,returned:!1}:_l(_t.type,Pn,U,{..._t,title:Ki,note:J})}).filter(Pn=>Pn.title);if(!k.length){y(!1);return}let ue=$n(k[0]),Nt=r?\"Saved\":H?D?`${k.length} reminders set \\xB7 ${ue}`:`Reminder set \\xB7 ${ue}`:D?`${k.length} to-dos added`:\"Added to to-do\",Gl=!r&&!H&&d.archive?n.archive:void 0;await u(k,Nt,Gl,c)||y(!1)}let q=d.type===\"reminder\",ln=r?q?\"Edit reminder\":\"Edit to-do\":q?D?`Add ${c.length} reminders`:\"Add a reminder\":D?`Add ${c.length} to-dos`:\"Add to to-do\",Cn=q?`Save reminder${x?` \\xB7 ${$n({dueDate:pe(v),dueTime:ut(v)},a)}`:\"\"}`:r?\"Save to-do\":D?`Add ${c.length} to to-do`:\"Add to to-do\";return(0,_.jsxs)(lu,{title:ln,icon:q?\"bell\":\"check2\",tone:q?\"reminder\":\"todo\",onClose:Ne,footer:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(\"button\",{type:\"button\",className:q?\"primary block\":\"accent block\",disabled:h||(q?!x:!ne),onClick:()=>{K()},children:h?\"Saving\\u2026\":Cn}),(0,_.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:he,children:q?\"Make it a to-do instead\":\"Make it a reminder instead\"})]}),children:[D?(0,_.jsx)(\"p\",{className:\"sheet-lead\",children:\"Each email becomes its own item, linked to its email. Titles come from the subjects.\"}):(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:q?\"Remind me to\":\"Task\"}),(0,_.jsx)(\"input\",{value:d.title,autoFocus:!r,maxLength:200,placeholder:q?\"What should we remind you of?\":\"What needs doing?\",onChange:H=>s({title:H.target.value}),enterKeyHint:\"done\"})]}),!q&&!D&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsxs)(\"span\",{children:[\"Note \",(0,_.jsx)(\"small\",{children:\"optional\"})]}),(0,_.jsx)(\"textarea\",{rows:2,value:d.note,maxLength:2e3,placeholder:\"Add details\",onChange:H=>s({note:H.target.value})})]}),c.length>0&&(0,_.jsxs)(\"div\",{className:\"linked-card\",children:[w&&(0,_.jsx)(Ze,{color:w.color,label:w.name}),(0,_.jsxs)(\"span\",{children:[(0,_.jsx)(\"strong\",{children:\"Linked:\"}),\" \",D?`${c.length} emails`:`${Pa(c[0].sender)} \\xB7 ${c[0].subject}`]})]}),C>0&&(0,_.jsxs)(\"p\",{className:\"hint\",children:[(0,_.jsx)(E,{name:\"check\",size:14}),\" \",C===1?\"1 item\":`${C} items`,\" already linked to this email\"]}),q?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(\"h3\",{className:\"section-label\",children:\"When\"}),(0,_.jsxs)(\"div\",{className:\"preset-grid\",role:\"radiogroup\",\"aria-label\":\"When\",children:[S.map(H=>(0,_.jsxs)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":p===H.id,className:\"preset\",onClick:()=>s({preset:H.id}),children:[(0,_.jsx)(\"strong\",{children:H.label}),(0,_.jsx)(\"span\",{children:H.detail})]},H.id)),(0,_.jsxs)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":p===\"pick\",className:\"preset\",onClick:()=>s({preset:\"pick\",picked:d.picked||`${pe(_e(a,1))}T${o.defaultReminderTime}`}),children:[(0,_.jsx)(\"strong\",{children:\"Pick date & time\"}),(0,_.jsx)(\"span\",{children:p===\"pick\"&&v?Dn(v,a):\"Custom\"})]})]}),p===\"pick\"&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Date and time\"}),(0,_.jsx)(\"input\",{type:\"datetime-local\",min:g,value:d.picked,onChange:H=>s({picked:H.target.value})}),d.picked&&!x&&(0,_.jsx)(\"small\",{className:\"error-text\",children:\"Pick a time that hasn't passed.\"})]}),(0,_.jsxs)(\"label\",{className:\"select-row\",children:[(0,_.jsx)(E,{name:\"repeat\"}),(0,_.jsx)(\"span\",{children:\"Repeat\"}),(0,_.jsx)(\"select\",{value:d.repeat,onChange:H=>s({repeat:H.target.value}),children:Object.keys(nu).map(H=>(0,_.jsx)(\"option\",{value:H,children:nu[H]},H))})]}),c.length>0&&(0,_.jsx)(tn,{label:\"Bring email back to top of inbox\",detail:\"When the reminder is due\",checked:d.bringBack,onChange:H=>s({bringBack:H})})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(\"h3\",{className:\"section-label\",children:\"Due\"}),(0,_.jsx)(zn,{label:\"Due\",value:d.due,onChange:H=>s({due:H}),options:[{id:\"none\",label:\"No date\"},{id:\"today\",label:\"Today\"},{id:\"tomorrow\",label:\"Tomorrow\"},{id:\"week\",label:\"This week\"},{id:\"pick\",label:\"Pick date\"}]}),d.due===\"pick\"&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Due date\"}),(0,_.jsx)(\"input\",{type:\"date\",min:pe(a),value:d.pickedDate,onChange:H=>s({pickedDate:H.target.value})})]}),(0,_.jsx)(\"p\",{className:\"hint\",children:rT(d.due,Q,a)}),(0,_.jsx)(tn,{label:\"Add a time & notify me\",checked:d.notify,onChange:H=>s({notify:H})}),d.notify&&(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Time\"}),(0,_.jsx)(\"input\",{type:\"time\",value:d.time,onChange:H=>s({time:H.target.value})}),!ne&&(0,_.jsx)(\"small\",{className:\"error-text\",children:\"That time has passed today.\"})]}),(0,_.jsx)(\"h3\",{className:\"section-label\",children:\"Priority\"}),(0,_.jsx)(zn,{label:\"Priority\",value:d.priority,onChange:H=>s({priority:H}),options:[{id:\"normal\",label:\"Normal\"},{id:\"high\",label:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(E,{name:\"flag\",size:14}),\" High\"]}),tone:\"high\"}]}),!r&&c.length>0&&n.archive&&(0,_.jsx)(tn,{label:D?\"Archive emails after adding\":\"Archive email after adding\",checked:d.archive,onChange:H=>s({archive:H})})]})]})}function rT(e,t,n){if(e===\"none\"||!t)return\"Goes to No date yet. You'll be nudged to schedule it.\";let a=en(t),l=Math.round((vt(a).getTime()-vt(n).getTime())/864e5),i=l===0?\"Today\":l===1?\"Tomorrow\":l<7?\"This week\":\"Later\";return`Due by ${Jn(a).replace(\",\",\"\")}. Shows in ${i}.`}function cT({emails:e,archive:t}){let{back:n}=I(),a=Le(),l=Ee(),i=By(),[o,u]=(0,Bl.useState)(\"\"),[r,c]=(0,Bl.useState)(!1),m=iT(a),d=e[0]?.accountId??l.current?.id??\"unknown\";async function f(h){if(r||h<=a||!e.length)return;c(!0);let y=e.map(p=>_l(\"reminder\",p,d,{title:Wn(p.subject),dueDate:pe(h),dueTime:ut(h),bringBack:!0,snooze:!0}));await i(y,`Snoozed until ${Dn(h,a)}`,t,e)||c(!1)}let s=o?new Date(o):null;return(0,_.jsxs)(lu,{title:e.length>1?`Snooze ${e.length} emails`:\"Snooze until\",icon:\"clock\",tone:\"neutral\",onClose:n,children:[(0,_.jsx)(\"p\",{className:\"sheet-lead\",children:\"The email leaves your inbox now and comes back to the top at this time.\"}),(0,_.jsx)(\"ul\",{className:\"option-list\",children:m.map(h=>(0,_.jsx)(\"li\",{children:(0,_.jsxs)(\"button\",{type:\"button\",className:\"option\",disabled:r,onClick:()=>{f(h.date)},children:[(0,_.jsx)(E,{name:\"clock\"}),(0,_.jsx)(\"span\",{children:h.label}),(0,_.jsx)(\"small\",{children:h.detail})]})},h.id))}),(0,_.jsxs)(\"label\",{className:\"field\",children:[(0,_.jsx)(\"span\",{children:\"Pick date & time\"}),(0,_.jsx)(\"input\",{type:\"datetime-local\",min:`${pe(a)}T${ut(a)}`,value:o,onChange:h=>u(h.target.value)})]}),(0,_.jsx)(\"button\",{type:\"button\",className:\"primary block\",disabled:r||!s||s<=a,onClick:()=>s&&void f(s),children:s&&s>a?`Snooze until ${Dn(s,a)}`:\"Snooze\"}),(0,_.jsx)(\"p\",{className:\"hint\",children:\"Gmail's mobile web has no snooze, so Gmail Only archives the email and keeps the time. Snoozed emails are listed in the menu.\"})]})}var an=Y(P(),1);function Gy(){let{screen:e,back:t,navigate:n}=I(),a=e?.params.emails,l=Ff(a),i=u=>n({screen:\"add\",mode:\"replace\",params:{type:u,emails:a??\"[]\",archive:\"selected\"}}),o=(u,r,c,m,d)=>(0,an.jsx)(\"li\",{children:(0,an.jsxs)(\"button\",{type:\"button\",className:\"add-option\",onClick:()=>i(u),children:[(0,an.jsx)(\"span\",{className:`tile ${c}`,children:(0,an.jsx)(E,{name:r})}),(0,an.jsxs)(\"span\",{children:[(0,an.jsx)(\"strong\",{children:m}),(0,an.jsx)(\"small\",{children:d})]}),(0,an.jsx)(E,{name:\"right\"})]})});return(0,an.jsx)(lu,{title:`Save ${l.length} ${l.length===1?\"email\":\"emails\"} for later`,icon:\"bell\",tone:\"neutral\",onClose:t,children:l.length?(0,an.jsxs)(\"ul\",{className:\"option-list\",children:[o(\"reminder\",\"bell\",\"reminder\",\"Add reminders\",\"One per email, all at the same time\"),o(\"todo\",\"check2\",\"todo\",\"Add to to-do\",\"One task per email; archive them if you like\"),o(\"snooze\",\"clock\",\"neutral\",\"Snooze\",\"Archive now, back at the top later\")]}):(0,an.jsx)(\"p\",{className:\"sheet-lead\",children:\"Nothing is selected.\"})})}var qy=Y(Ke(),1);var De=Y(P(),1),sT=[{label:\"Unread\",query:\"is:unread\"},{label:\"Starred\",query:\"is:starred\"},{label:\"Has attachment\",query:\"has:attachment\"},{label:\"Last 7 days\",query:\"newer_than:7d\"}];function Yy(){let{back:e}=I(),t=Ve(),{settings:n,update:a}=yt(),{items:l}=Se(),i=el(),o=Le(),u=Qi(),[r,c]=(0,qy.useState)(u.q??\"\"),m=s=>{let h=s.trim();h&&(a({recentSearches:[h,...n.recentSearches.filter(y=>y!==h)].slice(0,8)}),t.search(h))},d=r.toLowerCase().split(/\\s+/).filter(s=>s.length>1&&!s.includes(\":\")),f=d.length?l.filter(s=>!s.snooze&&d.every(h=>`${s.title} ${s.note} ${s.link?.subject??\"\"} ${s.link?.sender??\"\"}`.toLowerCase().includes(h))).slice(0,5):[];return(0,De.jsxs)(\"div\",{className:\"screen-frame search-screen\",children:[(0,De.jsx)(\"header\",{className:\"mail-header\",children:(0,De.jsxs)(\"form\",{className:\"search-pill\",role:\"search\",onSubmit:s=>{s.preventDefault(),m(r)},children:[(0,De.jsx)(te,{icon:\"back\",label:\"Back\",onClick:e}),(0,De.jsx)(\"input\",{type:\"search\",autoFocus:!0,enterKeyHint:\"search\",placeholder:\"Search in mail\",\"aria-label\":\"Search in mail\",value:r,onChange:s=>c(s.target.value)}),r&&(0,De.jsx)(te,{icon:\"close\",label:\"Clear\",onClick:()=>c(\"\")})]})}),(0,De.jsxs)(Xe,{className:\"screen\",children:[(0,De.jsx)(\"nav\",{className:\"filter-chips\",\"aria-label\":\"Search for\",children:sT.map(s=>(0,De.jsx)(\"button\",{type:\"button\",className:\"filter-chip\",onClick:()=>m(r?`${r} ${s.query}`:s.query),children:s.label},s.query))}),f.length>0&&(0,De.jsxs)(\"section\",{children:[(0,De.jsx)(\"h2\",{className:\"section-label\",children:\"In your to-do\"}),(0,De.jsx)(\"ul\",{className:\"item-list card\",children:f.map(s=>(0,De.jsx)(tl,{item:s,now:o,onOpen:()=>i(s.id)},s.id))})]}),n.recentSearches.length>0&&(0,De.jsxs)(\"section\",{children:[(0,De.jsxs)(\"h2\",{className:\"section-label with-action\",children:[(0,De.jsx)(\"span\",{children:\"Recent\"}),(0,De.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:()=>{a({recentSearches:[]})},children:\"Clear\"})]}),(0,De.jsx)(\"ul\",{className:\"plain-list card\",children:n.recentSearches.map(s=>(0,De.jsx)(\"li\",{children:(0,De.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>m(s),children:[(0,De.jsx)(E,{name:\"clock\"}),(0,De.jsx)(\"span\",{children:s}),(0,De.jsx)(E,{name:\"up\"})]})},s))})]}),r.trim()&&(0,De.jsxs)(\"button\",{type:\"button\",className:\"accent block padded-x\",onClick:()=>m(r),children:[(0,De.jsx)(E,{name:\"search\"}),\" Search for \\u201C\",r.trim(),\"\\u201D\"]})]})]})}var G=Y(P(),1);function jy(){let{settings:e,update:t}=yt(),{accounts:n}=Ee(),{navigate:a,viewWebsite:l}=I(),i=u=>{t(u)},o=[{id:\"remind\",label:\"Remind\"},{id:\"archive\",label:\"Archive\"},{id:\"none\",label:\"Off\"}];return(0,G.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,G.jsx)(bn,{title:\"Settings\"}),(0,G.jsxs)(Xe,{className:\"screen settings\",children:[(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Reminders & to-dos\"}),(0,G.jsxs)(\"div\",{className:\"card\",children:[(0,G.jsx)(tn,{label:\"Show Add to\\u2026 on emails\",detail:\"The pill above every open email\",checked:e.showAddTo,onChange:u=>i({showAddTo:u})}),(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsx)(\"span\",{children:\"Default sort\"}),(0,G.jsx)(zn,{label:\"Default sort\",value:e.defaultSort,onChange:u=>i({defaultSort:u}),options:[{id:\"due\",label:\"When it's due\"},{id:\"added\",label:\"When I added it\"}]})]}),(0,G.jsxs)(\"label\",{className:\"setting-row\",children:[(0,G.jsxs)(\"span\",{children:[\"Default reminder time\",(0,G.jsx)(\"small\",{children:\"Used by Tomorrow and Next week\"})]}),(0,G.jsx)(\"input\",{type:\"time\",value:e.defaultReminderTime,onChange:u=>u.target.value&&i({defaultReminderTime:u.target.value})})]}),(0,G.jsx)(tn,{label:\"Morning summary\",detail:e.morningSummary?`Today's card at ${Ct(e.morningSummary)}`:\"Off\",checked:e.morningSummary!==null,onChange:u=>i({morningSummary:u?\"08:00\":null})}),e.morningSummary!==null&&(0,G.jsxs)(\"label\",{className:\"setting-row nested\",children:[(0,G.jsx)(\"span\",{children:\"Summary time\"}),(0,G.jsx)(\"input\",{type:\"time\",value:e.morningSummary,onChange:u=>u.target.value&&i({morningSummary:u.target.value})})]}),(0,G.jsx)(tn,{label:\"Archive email after adding to to-do\",checked:e.archiveAfterAdding,onChange:u=>i({archiveAfterAdding:u})}),(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsx)(\"span\",{children:\"Keep done items\"}),(0,G.jsx)(zn,{label:\"Keep done items\",value:String(e.keepDoneDays),onChange:u=>i({keepDoneDays:Number(u)}),options:[{id:\"1\",label:\"1 day\"},{id:\"7\",label:\"7 days\"},{id:\"30\",label:\"30 days\"}]})]})]}),(0,G.jsx)(\"p\",{className:\"hint padded\",children:`Gmail Only shows what's due inside the app: the To-do badge, the Today card and \"Back in your inbox\". It doesn't send phone notifications.`}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Swipe on emails\"}),(0,G.jsxs)(\"div\",{className:\"card\",children:[(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(E,{name:\"right\",size:16}),\" Swipe right\"]}),(0,G.jsx)(zn,{label:\"Swipe right\",value:e.swipeRight,onChange:u=>i({swipeRight:u}),options:o})]}),(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(E,{name:\"back\",size:16}),\" Swipe left\"]}),(0,G.jsx)(zn,{label:\"Swipe left\",value:e.swipeLeft,onChange:u=>i({swipeLeft:u}),options:o})]})]}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Appearance\"}),(0,G.jsx)(\"div\",{className:\"card\",children:(0,G.jsxs)(\"div\",{className:\"setting-row\",children:[(0,G.jsx)(\"span\",{children:\"Theme\"}),(0,G.jsx)(zn,{label:\"Theme\",value:e.theme,onChange:u=>i({theme:u}),options:[{id:\"system\",label:\"System\"},{id:\"light\",label:\"Light\"},{id:\"dark\",label:\"Dark\"}]})]})}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Accounts\"}),(0,G.jsxs)(\"ul\",{className:\"plain-list card\",children:[n.map(u=>(0,G.jsx)(\"li\",{children:(0,G.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>a({screen:\"account-setup\",params:{id:u.id}}),children:[(0,G.jsx)(Ze,{color:u.color}),(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(\"strong\",{children:u.name}),(0,G.jsx)(\"small\",{children:u.email})]}),(0,G.jsx)(E,{name:\"right\"})]})},u.id)),(0,G.jsx)(\"li\",{children:(0,G.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>a({screen:\"accounts\"}),children:[(0,G.jsx)(E,{name:\"user\"}),(0,G.jsx)(\"span\",{children:\"Manage accounts\"}),(0,G.jsx)(E,{name:\"right\"})]})})]}),(0,G.jsx)(\"h2\",{className:\"section-label\",children:\"Gmail\"}),(0,G.jsx)(\"ul\",{className:\"plain-list card\",children:(0,G.jsx)(\"li\",{children:(0,G.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>l(),children:[(0,G.jsx)(E,{name:\"mail\"}),(0,G.jsxs)(\"span\",{children:[(0,G.jsx)(\"strong\",{children:\"Open Gmail itself\"}),(0,G.jsx)(\"small\",{children:\"For anything Gmail Only doesn't draw\"})]}),(0,G.jsx)(E,{name:\"external\"})]})})})]})]})}var ct=Y(P(),1);function Xy(){let{accounts:e,current:t}=Ee(),{items:n}=Se(),{navigate:a}=I(),l=Ve(),i=Le(),o=c=>n.filter(m=>m.accountId===c.id&&Fa(m,i)).length,u=c=>{c.id!==t?.id&&l.inboxOf(c)},r=()=>{let c=e.reduce((d,f)=>Math.max(d,f.sessionIndex),-1)+1,m=`${ji}/mail/u/${c}/`;a({url:`https://accounts.google.com/AddSession?continue=${encodeURIComponent(m)}`,context:\"primary\"})};return(0,ct.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,ct.jsx)(bn,{title:\"Accounts\"}),(0,ct.jsxs)(Xe,{className:\"screen\",children:[(0,ct.jsxs)(\"ul\",{className:\"plain-list card\",children:[e.map(c=>{let m=c.id===t?.id,d=o(c);return(0,ct.jsxs)(\"li\",{className:\"account-row\",children:[(0,ct.jsxs)(\"button\",{type:\"button\",className:\"list-button\",\"aria-current\":m?\"true\":void 0,disabled:!!0&&!m,onClick:()=>u(c),children:[(0,ct.jsx)(Ze,{color:c.color}),(0,ct.jsxs)(\"span\",{children:[(0,ct.jsx)(\"strong\",{children:c.name}),(0,ct.jsxs)(\"small\",{children:[c.email,d?` \\xB7 ${d} due`:\"\"]})]}),m&&(0,ct.jsx)(E,{name:\"check\"})]}),(0,ct.jsx)(\"button\",{type:\"button\",className:\"link-button\",onClick:()=>a({screen:\"account-setup\",params:{id:c.id}}),children:\"Edit\"})]},c.id)}),!e.length&&(0,ct.jsx)(\"li\",{className:\"muted padded\",children:\"Gmail Only records your account once Gmail shows it.\"})]}),(0,ct.jsxs)(\"button\",{type:\"button\",className:\"secondary block padded-x\",onClick:r,children:[(0,ct.jsx)(E,{name:\"plus\"}),\" Add another account\"]})]})]})}var Ll=Y(Ke(),1);var Ue=Y(P(),1);function Vy(){let{back:e}=I(),{byId:t,save:n}=Ee(),{show:a}=qe(),l=t(Qi().id??\"\"),[i,o]=(0,Ll.useState)(l?.name??\"\"),[u,r]=(0,Ll.useState)(l?.color??Cl[0]),[c,m]=(0,Ll.useState)(l?.showInInbox??!0),[d,f]=(0,Ll.useState)(l?.showInTodo??!0);if((0,Ll.useEffect)(()=>{l&&(o(l.name),r(l.color),m(l.showInInbox),f(l.showInTodo))},[l?.id]),!l)return(0,Ue.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,Ue.jsx)(bn,{title:\"Account\"}),(0,Ue.jsx)(\"div\",{className:\"screen\"})]});let s=async()=>{try{await n({...l,name:i.trim()||l.name,color:u,showInInbox:c,showInTodo:d}),e(),a({text:\"Account saved\"})}catch{a({text:\"Couldn't save. Try again.\"})}};return(0,Ue.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,Ue.jsx)(bn,{title:\"Set up account\"}),(0,Ue.jsxs)(Xe,{className:\"screen\",children:[(0,Ue.jsxs)(\"div\",{className:\"account-preview\",style:{\"--account\":u},children:[(0,Ue.jsx)(\"span\",{className:\"account-badge\",children:(i||l.email)[0]?.toUpperCase()}),(0,Ue.jsx)(\"strong\",{children:i||l.name}),(0,Ue.jsx)(\"small\",{children:l.email})]}),(0,Ue.jsxs)(\"label\",{className:\"field padded-x\",children:[(0,Ue.jsx)(\"span\",{children:\"Name\"}),(0,Ue.jsx)(\"input\",{value:i,maxLength:40,placeholder:\"Personal, Work\\u2026\",onChange:h=>o(h.target.value)})]}),(0,Ue.jsx)(\"h2\",{className:\"section-label\",children:\"Color\"}),(0,Ue.jsx)(\"div\",{className:\"swatches\",role:\"radiogroup\",\"aria-label\":\"Color\",children:Cl.map((h,y)=>(0,Ue.jsx)(\"button\",{type:\"button\",role:\"radio\",\"aria-checked\":h===u,\"aria-label\":ty[y],className:\"swatch\",style:{background:h},onClick:()=>r(h),children:h===u&&(0,Ue.jsx)(E,{name:\"check\"})},h))}),(0,Ue.jsx)(\"p\",{className:\"hint padded\",children:\"The color marks this account's emails, reminders and to-dos.\"}),(0,Ue.jsxs)(\"div\",{className:\"card\",children:[(0,Ue.jsx)(tn,{label:\"Show in inbox\",checked:c,onChange:m}),(0,Ue.jsx)(tn,{label:\"Show in To-do\",checked:d,onChange:f})]}),(0,Ue.jsx)(\"p\",{className:\"hint padded\",children:\"Show in inbox puts this account's due items on the inbox's Today card. Show in To-do lists them under All accounts.\"})]}),(0,Ue.jsx)(\"footer\",{className:\"action-bar\",children:(0,Ue.jsx)(\"button\",{type:\"button\",className:\"accent block\",onClick:()=>{s()},children:\"Save\"})})]})}var bt=Y(P(),1);function Qy(){let{items:e,save:t,complete:n}=Se(),{show:a}=qe(),l=Ve(),i=Le(),o=e.filter(c=>c.snooze&&!c.done).sort(au),u=async c=>{await t({...c,dueDate:pe(i),dueTime:ut(i),returned:!1}),a({text:\"Back in your inbox\",undo:()=>t(c)})},r=async c=>{await n(c,!0),a({text:\"Snooze removed. The email stays in All mail.\",undo:()=>t(c)})};return(0,bt.jsxs)(\"div\",{className:\"screen-frame\",children:[(0,bt.jsx)(bn,{title:\"Snoozed\"}),(0,bt.jsx)(Xe,{className:\"screen\",children:o.length?(0,bt.jsx)(\"ul\",{className:\"plain-list card\",children:o.map(c=>(0,bt.jsxs)(\"li\",{className:\"snooze-row\",children:[(0,bt.jsxs)(\"button\",{type:\"button\",className:\"list-button\",onClick:()=>c.link?.threadId&&l.email(c.link.threadId,c.accountId),children:[(0,bt.jsx)(Wa,{name:c.link?.sender??c.title,size:36}),(0,bt.jsxs)(\"span\",{children:[(0,bt.jsx)(\"strong\",{children:c.link?.subject??c.title}),(0,bt.jsxs)(\"small\",{children:[Pa(c.link?.sender??\"\"),\" \\xB7 \",(0,bt.jsx)(E,{name:\"clock\",size:12}),\" \",$n(c,i)]})]})]}),(0,bt.jsx)(te,{icon:\"inbox\",label:\"Bring back now\",onClick:()=>{u(c)}}),(0,bt.jsx)(te,{icon:\"close\",label:\"Remove snooze\",onClick:()=>{r(c)}})]},c.id))}):(0,bt.jsx)(kt,{title:\"Nothing snoozed\",icon:\"clock\",children:(0,bt.jsx)(\"p\",{children:\"Snooze an email from its toolbar to hide it until later.\"})})})]})}var ge=Y(P(),1),Zy={mail:_y,todo:Ry,item:Hy,add:Ly,bulk:Gy,search:Yy,settings:jy,accounts:Xy,\"account-setup\":Vy,snoozed:Qy},dT=new Set([\"add\",\"bulk\"]),fT=10,mT=30;function Iy(){return(0,ge.jsx)(hy,{children:(0,ge.jsx)(by,{children:(0,ge.jsx)(hT,{})})})}function pT(e){return e&&{key:e.key,id:e.id,overlay:!0,params:e.params}}function gT(e){switch(e.kind){case\"list\":return`list:${e.list.path}`;case\"conversation\":return`cv:${e.threadId}`;case\"other\":return`other:${e.hash}`;default:return e.kind}}function hT(){let{screen:e,overlay:t,select:n,navigate:a,back:l}=I(),{view:i}=ru(),o=Ve(),{items:u}=Se(),{settings:r}=yt(),{toast:c}=qe(),m=Le(),d=hc(yn.id),f=Ee().current?.id??null,s=(0,Yt.useRef)(f);(0,Yt.useLayoutEffect)(()=>{f&&s.current&&f!==s.current&&Sy(),f&&(s.current=f)},[f]);let h=(0,Yt.useRef)(null);vy(),(0,Yt.useEffect)(()=>{r.theme===\"system\"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=r.theme},[r.theme]);let y=e&&dT.has(e.id)?e:null,S=e?.id===\"menu\",p=(0,Yt.useRef)(null);e&&!y&&!S&&(p.current=e);let g=y||S?p.current??pT(t[t.length-2])??{key:`${j}:base`,id:\"mail\",overlay:!1,params:{}}:e??{key:`${j}:base`,id:\"mail\",overlay:!1,params:{}},v=Zy[g.id],x=y?Zy[y.id]:void 0,w=g.id===\"todo\",U=g.id===\"mail\"&&i.kind===\"list\",C=!y&&(w||U),D=u.filter(q=>Fa(q,m)).length,Q=(0,Yt.useRef)(0),O=g.overlay?null:/:(\\d+)$/.exec(g.key);O&&(Q.current=Number(O[1]));let ne={id:g.id===\"mail\"?`${g.key}|${gT(i)}`:g.key,index:Q.current,depth:y||S?Math.max(0,t.length-1):t.length,tab:w||U,drawer:g.id===\"mail\"&&i.kind===\"menu\"},Ne=wy(ne);(0,Yt.useEffect)(()=>{S&&sc.count===0&&l()},[S,l]);let he=vT(y?.key??null),K=()=>{t.length&&i.kind===\"list\"?n(j):t.length?o.inbox(\"replace\"):i.kind===\"list\"&&i.list.id===yn.id?document.querySelector(\".stage .screen\")?.scrollTo({top:0,behavior:\"smooth\"}):o.inbox()};return(0,ge.jsxs)(\"div\",{className:`app${C?\" has-tabs\":\"\"}${c?\" has-toast\":\"\"}`,children:[(0,ge.jsxs)(\"main\",{className:\"content\",children:[(0,ge.jsx)(Yf,{id:ne.id,motion:Ne,layer:h,zIndex:fT,inert:!!y,children:v&&(0,ge.jsx)(qf.Provider,{value:g.params,children:(0,ge.jsx)(v,{},g.key)})}),(0,ge.jsx)(Yf,{id:y?.key??null,motion:he,layer:h,zIndex:mT,children:x&&(0,ge.jsx)(x,{},y.key)}),(0,ge.jsx)(Ny,{layer:h})]}),C&&(0,ge.jsxs)(\"nav\",{className:\"tabs\",\"aria-label\":\"Sections\",children:[(0,ge.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":w?void 0:\"page\",onClick:K,children:[(0,ge.jsxs)(\"span\",{className:\"tab-icon\",children:[(0,ge.jsx)(E,{name:\"mail\",filled:!w}),d?(0,ge.jsx)(\"span\",{className:\"badge\",children:d>99?\"99+\":d},d):null]}),(0,ge.jsx)(\"span\",{children:\"Mail\"})]}),(0,ge.jsxs)(\"button\",{type:\"button\",className:\"tab\",\"aria-current\":w?\"page\":void 0,onClick:()=>w?document.querySelector(\".stage .screen\")?.scrollTo({top:0,behavior:\"smooth\"}):a({screen:\"todo\",mode:\"root\"}),children:[(0,ge.jsxs)(\"span\",{className:\"tab-icon\",children:[(0,ge.jsx)(E,{name:\"todo\"}),D?(0,ge.jsx)(\"span\",{className:\"badge due\",children:D>99?\"99+\":D},D):null]}),(0,ge.jsx)(\"span\",{children:\"To-do\"})]})]}),(0,ge.jsx)(bT,{})]})}function vT(e){let t=(0,Yt.useRef)({key:e,motion:\"none\"});return t.current.key!==e&&(t.current={key:e,motion:e===null?\"sheet-close\":t.current.key?\"sheet-swap\":\"none\"}),t.current.motion}function yT(e,t){let n=()=>t({text:\"Couldn't undo. Try again.\"});try{let a=e();a&&a.then(void 0,n)}catch{n()}}function bT(){let{toast:e,clear:t,show:n}=qe(),[a,l]=(0,Yt.useState)(e?{toast:e,leaving:!1}:null);(0,Yt.useEffect)(()=>{if(e){l({toast:e,leaving:!1});return}l(u=>u&&{...u,leaving:!0});let o=window.setTimeout(()=>l(u=>u?.leaving?null:u),180);return()=>window.clearTimeout(o)},[e]);let i=a?.toast;return(0,ge.jsx)(\"div\",{className:\"toast-region\",role:\"status\",\"aria-live\":\"polite\",children:i&&(0,ge.jsxs)(\"div\",{className:`toast${a.leaving?\" leaving\":\"\"}`,children:[(0,ge.jsx)(\"span\",{children:i.text}),i.undo&&(0,ge.jsx)(\"button\",{type:\"button\",disabled:a.leaving,onClick:()=>{let o=i.undo;t(),yT(o,n)},children:\"Undo\"}),i.view&&(0,ge.jsx)(\"button\",{type:\"button\",disabled:a.leaving,onClick:()=>{let o=i.view;t(),o()},children:\"View\"})]},i.id)})}var Ky=Y(P(),1);I0((0,Ky.jsx)(Iy,{}));})();\n"},{"path":"index.html","encoding":"utf8","content":"\n\n\n\n\nGmail Only\n\n\n\n\n
\n\n\n\n"}]} \ No newline at end of file diff --git a/gmail-only/published/applet-gmail-only.release.json b/gmail-only/published/applet-gmail-only.release.json index c4383ba..9862b65 100644 --- a/gmail-only/published/applet-gmail-only.release.json +++ b/gmail-only/published/applet-gmail-only.release.json @@ -2,10 +2,10 @@ "releaseFormat": 1, "appletId": "gmail-only", "name": "Gmail Only", - "version": "0.1.0", + "version": "0.0.0", "bundle": { "file": "applet-gmail-only.bundle.json", - "sha256": "e9c94c854254f2b8f6a57b3807f69bd1238d53f5ca1fa9d29b6b7cca98966ff7", + "sha256": "01a7cb9bf9ecb000b8521ae5750a5c06ffbe80b176157aa1d0c6160cc88c9a1d", "size": 444989 }, "compat": { @@ -15,7 +15,7 @@ "adapterApi": 1, "sdk": "0.0.0", "tools": "0.0.0", - "builtAt": "2026-11-09T11:21:15Z" + "builtAt": "2026-11-09T13:08:07Z" }, "origins": [ "https://mail.google.com" @@ -25,7 +25,7 @@ "services": [] }, "toolchain": { - "genesisCommit": "655ce128bce13bd8a376a3630766fb18182ba928", + "genesisCommit": "aebef4c113b0fc4fc676435237eb027e2035f816", "node": "24.15.0", "tools": "0.0.0", "sdk": "0.0.0" @@ -34,5 +34,5 @@ "fullName": "nirvanacp/applets", "path": "gmail-only" }, - "builtAt": "2026-11-09T11:21:15Z" + "builtAt": "2026-11-09T13:08:07Z" }