From 0f78182c585640a3b5120803ccf78515bd4f17bc Mon Sep 17 00:00:00 2001 From: Thomas Durieux <5577568+tdurieux@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:13:19 +0000 Subject: [PATCH] fix: keep legacy prices and address review findings Subscriptions sold at a replaced price lost their plan, because a subscription was matched only against the configured price. Resolve prices through the configured price, STRIPE_LEGACY_PRICES, then a registry that now also records subscription prices and every configured price at startup. Store the price on subscription grants. Review fixes: - Recover a Never expire add-on found by reconciliation before expiring. - Open Checkout for the subscription cycle the hosting option shows. - Report conference hosting only while the package payment stands. - Keep automatic updates on a paid-slot repository while its owner subscribes. - Apply the repository expiration limit only to repositories. Co-Authored-By: Claude Opus 5.5 --- docs/paid-hosting.md | 12 ++++- public/asset-manifest.json | 2 +- public/script/app.js | 12 +++-- public/script/vendor.min.js | 4 +- src/config.ts | 6 +++ src/core/Repository.ts | 6 +-- src/core/billing/config.ts | 12 +++++ src/core/billing/expiration.ts | 18 +++++-- src/core/billing/maintenance.ts | 2 + src/core/billing/stripe.ts | 31 +++++++++--- src/server/routes/conference.ts | 6 ++- test/billing-integration.test.js | 83 ++++++++++++++++++++++++++++++++ test/vue-ui.test.js | 28 +++++++++++ 13 files changed, 198 insertions(+), 24 deletions(-) diff --git a/docs/paid-hosting.md b/docs/paid-hosting.md index f0a212e..9205847 100644 --- a/docs/paid-hosting.md +++ b/docs/paid-hosting.md @@ -53,6 +53,8 @@ STRIPE_REPO_PACK_PRICE= STRIPE_CONFERENCE_SMALL_PRICE= STRIPE_CONFERENCE_PRICE= STRIPE_CONFERENCE_LARGE_PRICE= +# Optional: retired price IDs still used by existing purchases +STRIPE_LEGACY_PRICES=price_old_annual:author_annual BILLING_AUTOMATIC_TAX=false ``` @@ -75,7 +77,15 @@ PAID_CONFERENCE_LARGE_REPOSITORIES=400 PAID_CONFERENCE_LARGE_STORAGE=214748364800 ``` -Changing these values changes the allowance of existing plans too. Keep existing Price IDs configured for as long as subscriptions using them remain active. Plan and conference review-window changes are intentionally locked in this first version. +Changing these values changes the allowance of existing plans too. Plan and conference review-window changes are intentionally locked in this first version. + +### Changing a price + +Existing subscriptions and purchases keep the Stripe price they were sold at. The application maps a price to its plan through the configured price, then `STRIPE_LEGACY_PRICES`, then a registry of prices it has seen: every configured price is recorded at startup, and every price is recorded when a checkout is created. To replace a price: + +1. Deploy this version while the old price is still configured, so startup records it. +2. Add the old price to `STRIPE_LEGACY_PRICES` (for example `price_old_annual:author_annual`). This is explicit and also covers prices the registry never saw. +3. Set the new price ID and restart. New checkouts use the new price; existing subscribers keep theirs, including on renewal and cancellation webhooks. Configure the Stripe customer portal for payment-method updates, invoice downloads and cancellation. Disable arbitrary subscription product switches. Configure a snapshot webhook at `/api/billing/webhook` using API version `2026-10-28.endive`, matching the installed Stripe SDK, for: diff --git a/public/asset-manifest.json b/public/asset-manifest.json index 1f553a9..9846f78 100644 --- a/public/asset-manifest.json +++ b/public/asset-manifest.json @@ -1,6 +1,6 @@ { "core.min.js": "core.d23af1c652.min.js", - "vendor.min.js": "vendor.51a6ce08f9.min.js", + "vendor.min.js": "vendor.d5b4d04371.min.js", "mermaid.min.js": "mermaid.a7356d5ed1.min.js", "all.min.css": "all.8c4e8ecba6.min.css", "markdown.min.js": "markdown.6c8dfb7b1d.min.js", diff --git a/public/script/app.js b/public/script/app.js index bdc3e26..5debd77 100644 --- a/public/script/app.js +++ b/public/script/app.js @@ -1531,7 +1531,7 @@ export const anonymizeController = function (state, http, html, params, location }; state.hostingPlan = ""; state.hostingSaving = false; - state.selectedHostingPlan = () => state.authorPlans().find(p => p.id === state.hostingPlan) || state.authorPlans()[0]; + state.selectedHostingPlan = () => state.authorPlans().find(p => p.id === state.hostingPlan) || state.hostingSubscriptionPlan?.(); const loadHostingQuota = () => http.get("/api/user/quota").then(res => { state.hostingQuota = res.data; }); setupBilling(state, http, async () => { await loadHostingQuota(); @@ -1589,7 +1589,7 @@ export const anonymizeController = function (state, http, html, params, location state.hostingChoice = () => { const oneTime = state.hostingOneTimePlans(); if (oneTime.some(p => p.id === state.hostingPlan) || state.authorPlans().some(p => p.id === state.hostingPlan)) return state.hostingPlan; - return oneTime[0]?.id || state.authorPlans()[0]?.id || ""; + return oneTime[0]?.id || state.hostingSubscriptionPlan()?.id || ""; }; state.checkoutRepository = async (addon = "") => { if (state.hostingSaving || state.billingBusy || !state.billing?.csrf || state.sourceLoading) return; @@ -1603,7 +1603,8 @@ export const anonymizeController = function (state, http, html, params, location checkoutDraftId = saved.data.id; checkoutDraftSnapshot = serialized; } - const plan = state.authorPlans().find(p => p.id === state.hostingPlan) || state.authorPlans()[0]; + // The subscription option shows one cycle; Checkout must open that same cycle. + const plan = state.authorPlans().find(p => p.id === state.hostingPlan) || state.hostingSubscriptionPlan(); if (!addon && !plan) throw new Error("No author plan available"); await state.checkout(addon || plan.id, addon ? state.repoId : "", { draftId: checkoutDraftId }); } catch { state.billingError = "Your draft could not be saved for checkout. Your form is unchanged. Please try again."; } @@ -1708,7 +1709,8 @@ export const anonymizeController = function (state, http, html, params, location const now = new Date(); let maximum = new Date(now); maximum.setFullYear(maximum.getFullYear() + 1); - if (state.billing?.enabled && !state.hasAuthorHosting()) { + // Gists and pull requests keep their one-year limit; billing only limits repositories. + if (state.billing?.enabled && state.detectedType === "repo" && !state.hasAuthorHosting()) { maximum = new Date(now); maximum.setMonth(maximum.getMonth() + (state.billing.freeExpirationMonths || 5)); for (const grant of state.repositoryGrants("repo_extend")) if (new Date(grant.until) > maximum) maximum = new Date(grant.until); @@ -1723,7 +1725,7 @@ export const anonymizeController = function (state, http, html, params, location state.maxExpirationDate = toLocalDateString(maximum); }; updateExpirationLimit(); - state.watch(() => [state.billing, state.repoId, state.conference_data, state.isUpdate, state._savedExpirationDate, state.options?.expirationMode], updateExpirationLimit, true, false); + state.watch(() => [state.billing, state.repoId, state.conference_data, state.isUpdate, state._savedExpirationDate, state.options?.expirationMode, state.detectedType], updateExpirationLimit, true, false); state.anonymize_readme = ""; state.readme = ""; state.html_readme = ""; diff --git a/public/script/vendor.min.js b/public/script/vendor.min.js index 3e1db8e..31ea39b 100644 --- a/public/script/vendor.min.js +++ b/public/script/vendor.min.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var ya=Object.defineProperty;var ba=e=>{throw TypeError(e)};var ap=(e,t,o)=>t in e?ya(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var lp=(e,t)=>{for(var o in t)ya(e,o,{get:t[o],enumerable:!0})};var We=(e,t,o)=>ap(e,typeof t!="symbol"?t+"":t,o),Ui=(e,t,o)=>t.has(e)||ba("Cannot "+o);var se=(e,t,o)=>(Ui(e,t,"read from private field"),o?o.call(e):t.get(e)),Ie=(e,t,o)=>t.has(e)?ba("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),qe=(e,t,o,i)=>(Ui(e,t,"write to private field"),i?i.call(e,o):t.set(e,o),o),Me=(e,t,o)=>(Ui(e,t,"access private method"),o);var wa=(e,t,o,i)=>({set _(s){qe(e,t,s,o)},get _(){return se(e,t,i)}});var ge=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var ve={markdown:"/script/markdown.6c8dfb7b1d.min.js",org:"/script/org.f61f262915.min.js",notebook:"/script/notebook.c3144c18ae.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};function ka(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let o=new URLSearchParams(t);if([...o.keys()].length!==3||[...o.keys()].some(a=>!["clientId","intentId","token"].includes(a)))return null;let i=o.get("clientId"),s=o.get("intentId"),r=o.get("token");return!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{32}$/.test(s||"")||!/^[a-f0-9]{64}$/.test(r||"")?null:{contract:"4open.artifacts/1",clientId:i,intentId:s,token:r}}function Ca(e,t){let{http:o,promises:i,window:s}=t,r=t.takeReviewHandoff(),a=r?{clientId:r.clientId,intentId:r.intentId}:null,u,p,v,h,g,m=!0,k,T=i.defer(),w=()=>[...s.crypto.getRandomValues(new Uint8Array(16))].map(q=>q.toString(16).padStart(2,"0")).join("");Object.assign(e,{repositoryId:"",handoffEnabled:!1,busy:!1,preview:null,acceptAccess:!1,acceptRetention:!1,uncertain:!1,saved:!1,expired:!1,error:r?"":"Open a new artifact link from your submission. This link is missing or invalid."});let b=()=>m&&e.user?.username===g;function E(){m=!1,r=u=p=void 0,T.resolve(),s.clearTimeout(k)}e.on("dispose",E),e.on("routeLeave",E),e.watch(()=>e.user?.username,q=>{!g&&q?g=q:g&&q!==g&&(E(),e.preview=null,e.repositoryId="",e.busy=!1,e.saved=!1,e.handoffEnabled=!1,e.error="Your account changed. Open a new artifact link from your submission.")});let N=()=>({timeout:T.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":p}}),O=q=>q?.status===404?"Artifact linking is not available on this server.":q?.status===401?"Sign in, then open a new artifact link from your submission.":q?.status===403?"This account cannot approve this repository or this link.":"The request could not be completed. You can retry from this page.";e.loadPreview=async()=>{if(!m||!r||e.busy||e.uncertain||e.saved||!e.user?.username)return;g=e.user.username;let q=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(q)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,u=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,s.clearTimeout(k),h||(h=w());try{let M=(await o.get("/api/review-consent/csrf",{timeout:T.promise})).data;if(!b())return;if(p=M.csrf,e.handoffEnabled=M.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(p||""))throw new Error("invalid_csrf");let G=(await o.post("/api/review-consent/preview",{repositoryId:q,intent:{...r,requestId:h}},N())).data;if(!b())return;if(!G||typeof G.ticket!="string"||!G.ticket||G.ticket.length>8192||typeof G.repositoryName!="string"||!["restricted-review","anonymous-link"].includes(G.policy?.access)||!Number.isSafeInteger(G.policy.version)||!Number.isFinite(Date.parse(G.policy.retainUntil))||!Number.isFinite(Date.parse(G.expiresAt))||Date.parse(G.expiresAt)<=Date.now()||Date.parse(G.expiresAt)>Date.now()+6e5)throw new Error("invalid_preview");u=G.ticket,v=w(),e.preview={repositoryName:G.repositoryName,policy:{...G.policy},expiresAt:G.expiresAt},k=s.setTimeout(()=>{m&&(e.expired=!0)},Math.max(0,Date.parse(G.expiresAt)-Date.now()))}catch(M){b()&&(e.error=O(M))}finally{b()&&(e.busy=!1)}},e.confirmConsent=async()=>{if(!(!b()||e.busy||e.saved||!u||!e.acceptAccess||!e.acceptRetention)){if(Date.parse(e.preview.expiresAt)<=Date.now()){e.expired=!0;return}e.busy=!0,e.error="";try{let q=(await o.post("/api/review-consent/confirm",{ticket:u,requestId:v,acceptAccess:!0,acceptRetention:!0},N())).data;if(!b())return;if(q?.requestId!==v||!Number.isFinite(Date.parse(q.confirmedAt)))throw new Error("invalid_receipt");e.saved=!0,e.uncertain=!1,r=void 0,e.handoffEnabled||(u=void 0)}catch{b()&&(e.uncertain=!0,e.error="The confirmation was not verified. Retry with the same approval, or return to your submission to check its status.")}finally{b()&&(e.busy=!1)}}},e.continueReview=async()=>{if(!b()||e.busy||!e.saved||!e.handoffEnabled||!u||!a)return;e.busy=!0,e.error="";let q,M=()=>{q?.remove(),s.removeEventListener("securitypolicyviolation",G)},G=de=>{de.violatedDirective?.startsWith("form-action")&&(M(),b()&&(e.busy=!1,e.error="The return address was blocked. Return to your submission to check the artifact status."))};try{let de=(await o.post("/api/review-consent/handoff",{ticket:u},N())).data;if(!b())return;let re=de?.completion,D=new URL(de?.callbackUrl);if(!re||Object.keys(re).sort().join(",")!=="clientId,code,contract,expiresAt,intentId"||re.contract!=="4open.artifacts/1"||re.clientId!==a.clientId||re.intentId!==a.intentId||!/^[a-f0-9]{64}$/.test(re.code||"")||!Number.isFinite(Date.parse(re.expiresAt))||Date.parse(re.expiresAt)<=Date.now()||Date.parse(re.expiresAt)>Date.now()+3e5||D.protocol!=="https:"||D.href!==de.callbackUrl||D.username||D.password||de.callbackUrl.includes("?")||de.callbackUrl.includes("#"))throw new Error("invalid_handoff");q=s.document.createElement("form"),q.method="POST",q.action=D.href;let X=s.document.createElement("input");X.type="hidden",X.name="completion",X.value=JSON.stringify(re),q.appendChild(X),s.document.body.appendChild(q),s.addEventListener("securitypolicyviolation",G),e.on("dispose",M),q.submit()}catch{M(),b()&&(e.busy=!1,e.error="The return to review could not be prepared. Retry from this page, or return to your submission to check its status.")}}}var Is=new Map,cp=ve;function Ln(e){if(!Is.has(e)){let t=document.createElement("script");t.src=cp[e];let o=new Promise((i,s)=>{t.onload=i,t.onerror=()=>{Is.delete(e),t.remove(),s(new Error(`Unable to load ${e}. Please retry.`))}});Is.set(e,o),document.head.appendChild(t)}return Is.get(e)}async function Ms(){await Ln("editor"),ace.config.set("basePath","/script/external/ace/")}function ao(e){let t=Object.create(null);for(let o of e.split(","))t[o]=1;return o=>o in t}var Ge={},En=[],St=()=>{},Bi=()=>!1,lo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),uo=e=>e.startsWith("onUpdate:"),it=Object.assign,qo=(e,t)=>{let o=e.indexOf(t);o>-1&&e.splice(o,1)},pp=Object.prototype.hasOwnProperty,Fe=(e,t)=>pp.call(e,t),Se=Array.isArray,dn=e=>$o(e)==="[object Map]",Ut=e=>$o(e)==="[object Set]",Ea=e=>$o(e)==="[object Date]";var Te=e=>typeof e=="function",xe=e=>typeof e=="string",Pt=e=>typeof e=="symbol",He=e=>e!==null&&typeof e=="object",zi=e=>(He(e)||Te(e))&&Te(e.then)&&Te(e.catch),Da=Object.prototype.toString,$o=e=>Da.call(e),Hi=e=>$o(e).slice(8,-1),Vs=e=>$o(e)==="[object Object]",qs=e=>xe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,co=ao(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var $s=e=>{let t=Object.create(null);return(o=>t[o]||(t[o]=e(o)))},fp=/-\w/g,dt=$s(e=>e.replace(fp,t=>t.slice(1).toUpperCase())),hp=/\B([A-Z])/g,Xt=$s(e=>e.replace(hp,"-$1").toLowerCase()),Un=$s(e=>e.charAt(0).toUpperCase()+e.slice(1)),Lo=$s(e=>e?`on${Un(e)}`:""),Vt=(e,t)=>!Object.is(e,t),po=(e,...t)=>{for(let o=0;o{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:o})},fo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var Sa,Uo=()=>Sa||(Sa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function $e(e){if(Se(e)){let t={};for(let o=0;oo.startsWith("/*")?"":o).split(mp).forEach(o=>{if(o){let i=o.split(gp);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function P(e){let t="";if(xe(e))t=e;else if(Se(e))for(let o=0;oFt(o,t))}var Pa=e=>!!(e&&e.__v_isRef===!0),c=e=>xe(e)?e:e==null?"":Se(e)||He(e)&&(e.toString===Da||!Te(e.toString))?Pa(e)?c(e.value):JSON.stringify(e,_a,2):String(e),_a=(e,t)=>Pa(t)?_a(e,t.value):dn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[i,s],r)=>(o[Fi(i,r)+" =>"]=s,o),{})}:Ut(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>Fi(o))}:Pt(t)?Fi(t):He(t)&&!Se(t)&&!Vs(t)?String(t):t,Fi=(e,t="")=>{var o;return Pt(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};function Cp(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var ut,Ho=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&ut&&(ut.active?(this.parent=ut,this.index=(ut.scopes||(ut.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes){let i=this.scopes.slice();for(t=0,o=i.length;t0&&--this._on===0){if(ut===this)ut=this.prevScope;else{let t=ut;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let o,i;for(o=0,i=this.effects.length;o0)return;if(zo){let t=zo;for(zo=void 0;t;){let o=t.next;t.next=void 0,t.flags&=-9,t=o}}let e;for(;Bo;){let t=Bo;for(Bo=void 0;t;){let o=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=o}}if(e)throw e}function La(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ua(e){let t,o=e.depsTail,i=o;for(;i;){let s=i.prevDep;i.version===-1?(i===o&&(o=s),or(i),Ep(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}e.deps=t,e.depsTail=o}function Ki(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Fa(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Fa(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===jo)||(e.globalVersion=jo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ki(e))))return;e.flags|=2;let t=e.dep,o=Je,i=Bt;Je=e,Bt=!0;try{La(e);let s=e.fn(e._value);(t.version===0||Vt(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Je=o,Bt=i,Ua(e),e.flags&=-3}}function or(e,t=!1){let{dep:o,prevSub:i,nextSub:s}=e;if(i&&(i.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=i,e.nextSub=void 0),o.subs===e&&(o.subs=i,!i&&o.computed)){o.computed.flags&=-5;for(let r=o.computed.deps;r;r=r.nextDep)or(r,!0)}!t&&!--o.sc&&o.map&&o.map.delete(o.key)}function Ep(e){let{prevDep:t,nextDep:o}=e;t&&(t.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=t,e.nextDep=void 0)}var Bt=!0,Ba=[];function zt(){Ba.push(Bt),Bt=!1}function Ht(){let e=Ba.pop();Bt=e===void 0?!0:e}function Oa(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let o=Je;Je=void 0;try{t()}finally{Je=o}}}var jo=0,Yi=class{constructor(t,o){this.sub=t,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Go=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Je||!Bt||Je===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==Je)o=this.activeLink=new Yi(Je,this),Je.deps?(o.prevDep=Je.depsTail,Je.depsTail.nextDep=o,Je.depsTail=o):Je.deps=Je.depsTail=o,za(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){let i=o.nextDep;i.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=i),o.prevDep=Je.depsTail,o.nextDep=void 0,Je.depsTail.nextDep=o,Je.depsTail=o,Je.deps===o&&(Je.deps=i)}return o}trigger(t){this.version++,jo++,this.notify(t)}notify(t){tr();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{nr()}}};function za(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)za(i)}let o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}var Xi=new WeakMap,Bn=Symbol(""),Ji=Symbol(""),Wo=Symbol("");function mt(e,t,o){if(Bt&&Je){let i=Xi.get(e);i||Xi.set(e,i=new Map);let s=i.get(o);s||(i.set(o,s=new Go),s.map=i,s.key=o),s.track()}}function Qt(e,t,o,i,s,r){let a=Xi.get(e);if(!a){jo++;return}let u=p=>{p&&p.trigger()};if(tr(),t==="clear")a.forEach(u);else{let p=Se(e),v=p&&qs(o);if(p&&o==="length"){let h=Number(i);a.forEach((g,m)=>{(m==="length"||m===Wo||!Pt(m)&&m>=h)&&u(g)})}else switch((o!==void 0||a.has(void 0))&&u(a.get(o)),v&&u(a.get(Wo)),t){case"add":p?v&&u(a.get("length")):(u(a.get(Bn)),dn(e)&&u(a.get(Ji)));break;case"delete":p||(u(a.get(Bn)),dn(e)&&u(a.get(Ji)));break;case"set":dn(e)&&u(a.get(Bn));break}}nr()}function ho(e){let t=ze(e);return t===e||(mt(t,"iterate",Wo),Nt(e))?t:qt(e)?xt(e)?t.map(o=>cn(_t(o))):t.map(cn):t.map(_t)}function Yo(e){return mt(e=ze(e),"iterate",Wo),e}function Jt(e,t){return qt(e)?cn(xt(e)?_t(t):t):_t(t)}var Sp={__proto__:null,[Symbol.iterator](){return Gi(this,Symbol.iterator,e=>Jt(this,e))},concat(...e){return ho(this).concat(...e.map(t=>Se(t)?ho(t):t))},entries(){return Gi(this,"entries",e=>(e[1]=Jt(this,e[1]),e))},every(e,t){return un(this,"every",e,t,void 0,arguments)},filter(e,t){return un(this,"filter",e,t,o=>o.map(i=>Jt(this,i)),arguments)},find(e,t){return un(this,"find",e,t,o=>Jt(this,o),arguments)},findIndex(e,t){return un(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return un(this,"findLast",e,t,o=>Jt(this,o),arguments)},findLastIndex(e,t){return un(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return un(this,"forEach",e,t,void 0,arguments)},includes(...e){return Wi(this,"includes",e)},indexOf(...e){return Wi(this,"indexOf",e)},join(e){return ho(this).join(e)},lastIndexOf(...e){return Wi(this,"lastIndexOf",e)},map(e,t){return un(this,"map",e,t,void 0,arguments)},pop(){return Fo(this,"pop")},push(...e){return Fo(this,"push",e)},reduce(e,...t){return Ma(this,"reduce",e,t)},reduceRight(e,...t){return Ma(this,"reduceRight",e,t)},shift(){return Fo(this,"shift")},some(e,t){return un(this,"some",e,t,void 0,arguments)},splice(...e){return Fo(this,"splice",e)},toReversed(){return ho(this).toReversed()},toSorted(e){return ho(this).toSorted(e)},toSpliced(...e){return ho(this).toSpliced(...e)},unshift(...e){return Fo(this,"unshift",e)},values(){return Gi(this,"values",e=>Jt(this,e))}};function Gi(e,t,o){let i=Yo(e),s=i[t],r=s.call(i);if(i!==e&&!Nt(e)){if(r[Symbol.toStringTag]==="Array Iterator"){let a=Object.create(Object.getPrototypeOf(r));return a.next=()=>Ia(r.next(),o),s!==Ha[t]&&Object.defineProperties(a,{return:{get(){let u=r.return;return typeof u=="function"?u.bind(r):u}},throw:{get(){let u=r.throw;return typeof u=="function"?u.bind(r):u}}}),a}r._next=r.next,r.next=()=>Ia(r._next(),o)}return r}function Ia(e,t){return e.done||(e.value=t(e.value)),e}var Ha=Array.prototype;function un(e,t,o,i,s,r){let a=Yo(e),u=a!==e&&!Nt(e),p=a[t];if(p!==Ha[t]){let g=p.apply(e,r);return u?_t(g):g}let v=o;a!==e&&(u?v=function(g,m){return o.call(this,Jt(e,g),m,e)}:o.length>2&&(v=function(g,m){return o.call(this,g,m,e)}));let h=p.call(a,v,i);return u&&s?s(h):h}function Ma(e,t,o,i){let s=Yo(e),r=s!==e&&!Nt(e),a=o,u=!1;s!==e&&(r?(u=i.length===0,a=function(v,h,g){return u&&(u=!1,v=Jt(e,v)),o.call(this,v,Jt(e,h),g,e)}):o.length>3&&(a=function(v,h,g){return o.call(this,v,h,g,e)}));let p=s[t](a,...i);return u?Jt(e,p):p}function Wi(e,t,o){let i=ze(e);mt(i,"iterate",Wo);let s=i[t](...o);return(s===-1||s===!1)&&Jo(o[0])?(o[0]=ze(o[0]),i[t](...o)):s}function Fo(e,t,o=[]){zt(),tr();let i=ze(e)[t].apply(e,o);return nr(),Ht(),i}var Np=ao("__proto__,__v_isRef,__isVue"),ja=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Pt));function Rp(e){Pt(e)||(e=String(e));let t=ze(this);return mt(t,"has",e),t.hasOwnProperty(e)}var js=class{constructor(t=!1,o=!1){this._isReadonly=t,this._isShallow=o}get(t,o,i){if(o==="__v_skip")return t.__v_skip;let s=this._isReadonly,r=this._isShallow;if(o==="__v_isReactive")return!s;if(o==="__v_isReadonly")return s;if(o==="__v_isShallow")return r;if(o==="__v_raw")return i===(s?r?Vp:Ka:r?Wa:Ga).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;let a=Se(t);if(!s){let p;if(a&&(p=Sp[o]))return p;if(o==="hasOwnProperty")return Rp}let u=Reflect.get(t,o,ht(t)?t:i);if((Pt(o)?ja.has(o):Np(o))||(s||mt(t,"get",o),r))return u;if(ht(u)){let p=a&&qs(o)?u:u.value;return s&&He(p)?Ws(p):p}return He(u)?s?Ws(u):et(u):u}},Gs=class extends js{constructor(t=!1){super(!1,t)}set(t,o,i,s){let r=t[o],a=Se(t)&&qs(o);if(!this._isShallow){let v=qt(r);if(!Nt(i)&&!qt(i)&&(r=ze(r),i=ze(i)),!a&&ht(r)&&!ht(i))return v||(r.value=i),!0}let u=a?Number(o)e,Bs=e=>Reflect.getPrototypeOf(e);function Pp(e,t,o){return function(...i){let s=this.__v_raw,r=ze(s),a=dn(r),u=e==="entries"||e===Symbol.iterator&&a,p=e==="keys"&&a,v=s[e](...i),h=o?Zi:t?cn:_t;return!t&&mt(r,"iterate",p?Ji:Bn),it(Object.create(v),{next(){let{value:g,done:m}=v.next();return m?{value:g,done:m}:{value:u?[h(g[0]),h(g[1])]:h(g),done:m}}})}}function zs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function _p(e,t){let o={get(s){let r=this.__v_raw,a=ze(r),u=ze(s);e||(Vt(s,u)&&mt(a,"get",s),mt(a,"get",u));let{has:p}=Bs(a),v=t?Zi:e?cn:_t;if(p.call(a,s))return v(r.get(s));if(p.call(a,u))return v(r.get(u));r!==a&&r.get(s)},get size(){let s=this.__v_raw;return!e&&mt(ze(s),"iterate",Bn),s.size},has(s){let r=this.__v_raw,a=ze(r),u=ze(s);return e||(Vt(s,u)&&mt(a,"has",s),mt(a,"has",u)),s===u?r.has(s):r.has(s)||r.has(u)},forEach(s,r){let a=this,u=a.__v_raw,p=ze(u),v=t?Zi:e?cn:_t;return!e&&mt(p,"iterate",Bn),u.forEach((h,g)=>s.call(r,v(h),v(g),a))}};return it(o,e?{add:zs("add"),set:zs("set"),delete:zs("delete"),clear:zs("clear")}:{add(s){let r=ze(this),a=Bs(r),u=ze(s),p=!t&&!Nt(s)&&!qt(s)?u:s;return a.has.call(r,p)||Vt(s,p)&&a.has.call(r,s)||Vt(u,p)&&a.has.call(r,u)||(r.add(p),Qt(r,"add",p,p)),this},set(s,r){!t&&!Nt(r)&&!qt(r)&&(r=ze(r));let a=ze(this),{has:u,get:p}=Bs(a),v=u.call(a,s);v||(s=ze(s),v=u.call(a,s));let h=p.call(a,s);return a.set(s,r),v?Vt(r,h)&&Qt(a,"set",s,r,h):Qt(a,"add",s,r),this},delete(s){let r=ze(this),{has:a,get:u}=Bs(r),p=a.call(r,s);p||(s=ze(s),p=a.call(r,s));let v=u?u.call(r,s):void 0,h=r.delete(s);return p&&Qt(r,"delete",s,void 0,v),h},clear(){let s=ze(this),r=s.size!==0,a=void 0,u=s.clear();return r&&Qt(s,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(s=>{o[s]=Pp(s,e,t)}),o}function sr(e,t){let o=_p(e,t);return(i,s,r)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_isShallow"?t:s==="__v_raw"?i:Reflect.get(Fe(o,s)&&s in i?o:i,s,r)}var Op={get:sr(!1,!1)},Ip={get:sr(!1,!0)},Mp={get:sr(!0,!1)};var Ga=new WeakMap,Wa=new WeakMap,Ka=new WeakMap,Vp=new WeakMap;function qp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function et(e){return qt(e)?e:ir(e,!1,Dp,Op,Ga)}function Xo(e){return ir(e,!1,Tp,Ip,Wa)}function Ws(e){return ir(e,!0,Ap,Mp,Ka)}function ir(e,t,o,i,s){if(!He(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let r=s.get(e);if(r)return r;let a=qp(Hi(e));if(a===0)return e;let u=new Proxy(e,a===2?i:o);return s.set(e,u),u}function xt(e){return qt(e)?xt(e.__v_raw):!!(e&&e.__v_isReactive)}function qt(e){return!!(e&&e.__v_isReadonly)}function Nt(e){return!!(e&&e.__v_isShallow)}function Jo(e){return e?!!e.__v_raw:!1}function ze(e){let t=e&&e.__v_raw;return t?ze(t):e}function go(e){return!Fe(e,"__v_skip")&&Object.isExtensible(e)&&Ls(e,"__v_skip",!0),e}var _t=e=>He(e)?et(e):e,cn=e=>He(e)?Ws(e):e;function ht(e){return e?e.__v_isRef===!0:!1}function gt(e){return Ya(e,!1)}function Ys(e){return Ya(e,!0)}function Ya(e,t){return ht(e)?e:new xi(e,t)}var xi=class{constructor(t,o){this.dep=new Go,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?t:ze(t),this._value=o?t:_t(t),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(t){let o=this._rawValue,i=this.__v_isShallow||Nt(t)||qt(t);t=i?t:ze(t),Vt(t,o)&&(this._rawValue=t,this._value=i?t:_t(t),this.dep.trigger())}};function pn(e){return ht(e)?e.value:e}var $p={get:(e,t,o)=>t==="__v_raw"?e:pn(Reflect.get(e,t,o)),set:(e,t,o,i)=>{let s=e[t];return ht(s)&&!ht(o)?(s.value=o,!0):Reflect.set(e,t,o,i)}};function Xs(e){return xt(e)?e:new Proxy(e,$p)}var er=class{constructor(t,o,i){this.fn=t,this.setter=o,this._value=void 0,this.dep=new Go(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=jo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Je!==this)return $a(this,!0),!0}get value(){let t=this.dep.track();return Fa(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Xa(e,t,o=!1){let i,s;return Te(e)?i=e:(i=e.get,s=e.set),new er(i,s,o)}var Hs={},Ks=new WeakMap,Fn;function Ja(e,t=!1,o=Fn){if(o){let i=Ks.get(o);i||Ks.set(o,i=[]),i.push(e)}}function Qa(e,t,o=Ge){let{immediate:i,deep:s,once:r,scheduler:a,augmentJob:u,call:p}=o,v=M=>{(o.onWarn||Cp)("Invalid watch source: ",M,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},h=M=>s?M:Nt(M)||s===!1||s===0?Zt(M,1):Zt(M),g,m,k,T,w=!1,b=!1;if(ht(e)?(m=()=>e.value,w=Nt(e)):xt(e)?(m=()=>h(e),w=!0):Se(e)?(b=!0,w=e.some(M=>xt(M)||Nt(M)),m=()=>e.map(M=>{if(ht(M))return M.value;if(xt(M))return h(M);if(Te(M))return p?p(M,2):M()})):Te(e)?t?m=p?()=>p(e,2):e:m=()=>{if(k){zt();try{k()}finally{Ht()}}let M=Fn;Fn=g;try{return p?p(e,3,[T]):e(T)}finally{Fn=M}}:m=St,t&&s){let M=m,G=s===!0?1/0:s;m=()=>Zt(M(),G)}let E=Va(),N=()=>{g.stop(),E&&E.active&&qo(E.effects,g)};if(r&&t){let M=t;t=(...G)=>{try{return M(...G)}finally{N()}}}let O=b?new Array(e.length).fill(Hs):Hs,q=M=>{if(!(!(g.flags&1)||!g.dirty&&!M))if(t){let G=g.run();if(M||s||w||(b?G.some((de,re)=>Vt(de,O[re])):Vt(G,O))){let de=Fn;zt();try{k&&k(),Fn=g;let re=[G,O===Hs?void 0:b&&O[0]===Hs?[]:O,T];O=G,p?p(t,3,re):t(...re)}finally{Fn=de,Ht()}}}else g.run()};return u&&u(q),g=new mo(m),g.scheduler=a?()=>a(q,!1):q,T=M=>Ja(M,!1,g),k=g.onStop=()=>{let M=Ks.get(g);if(M){if(p)p(M,4);else for(let G of M)G();Ks.delete(g)}},t?i?q(!0):O=g.run():a?a(q.bind(null,!0),!0):g.run(),N.pause=g.pause.bind(g),N.resume=g.resume.bind(g),N.stop=N,N}function Zt(e,t=1/0,o){if(t<=0||!He(e)||e.__v_skip||(o=o||new Map,(o.get(e)||0)>=t))return e;if(o.set(e,t),t--,ht(e))Zt(e.value,t,o);else if(Se(e))for(let i=0;i{Zt(i,t,o)});else if(Vs(e)){for(let i in e)Zt(e[i],t,o);for(let i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&Zt(e[i],t,o)}return e}function ls(e,t,o,i){try{return i?e(...i):e()}catch(s){ds(s,t,o)}}function $t(e,t,o,i){if(Te(e)){let s=ls(e,t,o,i);return s&&zi(s)&&s.catch(r=>{ds(r,t,o)}),s}if(Se(e)){let s=[];for(let r=0;r>>1,s=Ct[i],r=os(s);r=os(o)?Ct.push(e):Ct.splice(zp(t),0,e),e.flags|=1,hl()}}function hl(){Zs||(Zs=fl.then(yl))}function ml(e){if(!Se(e))Sn&&e.id===-1?Sn.splice(vo+1,0,e):e.flags&1||(tn.push(e),e.flags|=1);else for(let t=0;t=t))continue;Ct.splice(i,1),i=e?i-1:jt,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function vl(e,t,o=0){if(tn.length){let i=tn,s=0;if(t){i=[];for(let a=0;aos(a)-os(u));if(tn.length=s,Sn){for(let a=0;ae.id==null?e.flags&2?-1:1/0:e.id;function yl(e){let t=St;try{for(jt=0;jt{i._d&&ni(-1);let r=xs(t),a=jn.length,u;try{u=e(...s)}finally{for(let p=jn.length;p>a;p--)Yl();xs(r),i._d&&ni(1)}return u};return i._n=!0,i._c=!0,i._d=!0,i}function A(e,t){if(Ot===null)return e;let o=ui(Ot),i=e.dirs||(e.dirs=[]);for(let s=0;s1)return o&&Te(t)?t.call(i&&i.proxy):t}}var Gp=Symbol.for("v-scx"),Wp=()=>{{let e=Dt(Gp);return e}};function tt(e,t,o){return wl(e,t,o)}function wl(e,t,o=Ge){let{immediate:i,deep:s,flush:r,once:a}=o,u=it({},o),p=t&&i||!t&&r!=="post",v;if(wo){if(r==="sync"){let k=Wp();v=k.__watcherHandles||(k.__watcherHandles=[])}else if(!p){let k=()=>{};return k.stop=St,k.resume=St,k.pause=St,k}}let h=vt;u.call=(k,T,w)=>$t(k,h,T,w);let g=!1;r==="post"?u.scheduler=k=>{k.i=h,Rt(k,h&&h.suspense)}:r!=="sync"&&(g=!0,u.scheduler=(k,T)=>{T?k():vr(k)}),u.augmentJob=k=>{t&&(k.flags|=4),g&&(k.flags|=2,h&&(k.id=h.uid,k.i=h))};let m=Qa(e,t,u);return wo&&(v?v.push(m):p&&m()),m}function Kp(e,t,o){let i=this.proxy,s=xe(e)?e.includes(".")?kl(i,e):()=>i[e]:e.bind(i,i),r;Te(t)?r=t:(r=t.handler,o=t);let a=ps(this),u=wl(s,r.bind(i),o);return a(),u}function kl(e,t){let o=t.split(".");return()=>{let i=e;for(let s=0;se.__isTeleport;var ar=Symbol("_leaveCb");function Xp(e){let t=e[0];if(e.length>1){let o=!1;for(let i of e)if(i.type!==Gt){t=i,o=!0;break}}return t}function Cl(e){if(!ri(e))return ii(e.type)&&e.children?Xp(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:o}=e;if(o){if(t&16)return o[0];if(t&32&&Te(o.default))return o.default()}}function ss(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let o=e.component.subTree;ss(ii(o.type)&&Cl(o)||o,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===B&&Se(e.children)){let o=Ml(e.children,!1);o&&ss(o,t)}}function cr(e){if(e.component)return cr(e.component.subTree);if(e.type===B){let t=Se(e.children)&&Ml(e.children,!1);return t?cr(t):void 0}if(e.type!==Gt)return e}function us(e,t){return Te(e)?it({name:e.name},t,{setup:e}):e}function yr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Za(e,t){let o;return!!((o=Object.getOwnPropertyDescriptor(e,t))&&!o.configurable)}var ei=new WeakMap;function xo(e,t,o,i,s=!1){if(Se(e)){e.forEach((w,b)=>xo(w,t&&(Se(t)?t[b]:t),o,i,s));return}if(es(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&xo(e,t,o,i.component.subTree);return}let r=i.shapeFlag&4?ui(i.component):i.el,a=s?null:r,{i:u,r:p}=e,v=t&&t.r,h=u.refs===Ge?u.refs={}:u.refs,g=u.setupState,m=ze(g),k=g===Ge?Bi:w=>Za(h,w)?!1:Fe(m,w),T=(w,b)=>!(b&&Za(h,b));if(v!=null&&v!==p){if(xa(t),xe(v))h[v]=null,k(v)&&(g[v]=null);else if(ht(v)){let w=t;T(v,w.k)&&(v.value=null),w.k&&(h[w.k]=null)}}if(Te(p))ls(p,u,12,[a,h]);else{let w=xe(p),b=ht(p);if(w||b){let E=()=>{if(e.f){let N=w?k(p)?g[p]:h[p]:T(p)||!e.k?p.value:h[e.k];if(s)Se(N)&&qo(N,r);else if(Se(N))N.includes(r)||N.push(r);else if(w)h[p]=[r],k(p)&&(g[p]=h[p]);else{let O=[r];T(p,e.k)&&(p.value=O),e.k&&(h[e.k]=O)}}else w?(h[p]=a,k(p)&&(g[p]=a)):b&&(T(p,e.k)&&(p.value=a),e.k&&(h[e.k]=a))};if(a){let N=()=>{E(),ei.delete(e)};N.id=-1,ei.set(e,N),Rt(N,o)}else xa(e),E()}}}function xa(e){let t=ei.get(e);t&&(t.flags|=8,ei.delete(e))}var el=e=>e.nodeType===8;var Ij=Uo().requestIdleCallback||(e=>setTimeout(e,1)),Mj=Uo().cancelIdleCallback||(e=>clearTimeout(e));function Jp(e,t){if(el(e)&&e.data==="["){let o=1,i=e.nextSibling;for(;i;){if(i.nodeType===1){if(t(i)===!1)break}else if(el(i))if(i.data==="]"){if(--o===0)break}else i.data==="["&&o++;i=i.nextSibling}}else t(e)}var es=e=>!!e.type.__asyncLoader;function El(e){Te(e)&&(e={loader:e});let{loader:t,loadingComponent:o,errorComponent:i,delay:s=200,hydrate:r,timeout:a,suspensible:u=!0,onError:p}=e,v=null,h,g=0,m=()=>(g++,v=null,k()),k=()=>{let T;return v||(T=v=t().catch(w=>{if(w=w instanceof Error?w:new Error(String(w)),p)return new Promise((b,E)=>{p(w,()=>b(m()),()=>E(w),g+1)});throw w}).then(w=>T!==v&&v?v:(w&&(w.__esModule||w[Symbol.toStringTag]==="Module")&&(w=w.default),h=w,w)))};return us({name:"AsyncComponentWrapper",__asyncLoader:k,__asyncHydrate(T,w,b){let E=T.isConnected,N=!1;(w.bu||(w.bu=[])).push(()=>N=!0);let O=()=>{N||!T.parentNode||E&&!T.isConnected||b()},q=r?()=>{let M=r(O,G=>Jp(T,G));M&&(w.bum||(w.bum=[])).push(M)}:O;h?q():k().then(()=>!w.isUnmounted&&q())},get __asyncResolved(){return h},setup(){let T=vt;if(yr(T),h)return()=>Js(h,T);let w=M=>{v=null,ds(M,T,13,!i)};if(u&&T.suspense||wo)return k().then(M=>()=>Js(M,T)).catch(M=>(w(M),()=>i?Ue(i,{error:M}):null));let b=gt(!1),E=gt(),N=gt(!!s),O,q;return cs(()=>{O!=null&&clearTimeout(O),q!=null&&clearTimeout(q)}),s&&(q=setTimeout(()=>{T.isUnmounted||(N.value=!1)},s)),a!=null&&(O=setTimeout(()=>{if(!T.isUnmounted&&!b.value&&!E.value){let M=new Error(`Async component timed out after ${a}ms.`);w(M),E.value=M}},a)),k().then(()=>{T.isUnmounted||(b.value=!0,T.parent&&ri(T.parent.vnode)&&T.parent.update())}).catch(M=>{if(T.isUnmounted){v=null;return}w(M),E.value=M}),()=>{if(b.value&&h)return Js(h,T);if(E.value&&i)return Ue(i,{error:E.value});if(o&&!N.value)return Js(o,T)}}})}function Js(e,t){let{ref:o,props:i,children:s,ce:r}=t.vnode,a=Ue(e,i,s);return a.ref=o,a.ce=r,delete t.vnode.ce,a}var ri=e=>e.type.__isKeepAlive;function Sl(e,t){Rl(e,"a",t)}function Nl(e,t){Rl(e,"da",t)}function Rl(e,t,o=vt){let i=e.__wdc||(e.__wdc=()=>{let s=o;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ai(t,i,o),o){let s=o.parent;for(;s&&s.parent;)ri(s.parent.vnode)&&Qp(i,t,o,s),s=s.parent}}function Qp(e,t,o,i){let s=ai(t,e,i,!0);cs(()=>{qo(i[t],s)},o)}function ai(e,t,o=vt,i=!1){if(o){let s=o[e]||(o[e]=[]),r=t.__weh||(t.__weh=(...a)=>{zt();let u=ps(o),p=$t(t,o,e,a);return u(),Ht(),p});return i?s.unshift(r):s.push(r),r}}var hn=e=>(t,o=vt)=>{(!wo||e==="sp")&&ai(e,(...i)=>t(...i),o)},Zp=hn("bm"),on=hn("m"),Dl=hn("bu"),Al=hn("u"),Wn=hn("bum"),cs=hn("um"),xp=hn("sp"),ef=hn("rtg"),tf=hn("rtc");function nf(e,t=vt){ai("ec",e,t)}var Tl="components",of="directives";function at(e,t){return Pl(Tl,e,!0,t)||e}var sf=Symbol.for("v-ndc");function De(e){return Pl(of,e)}function Pl(e,t,o=!0,i=!1){let s=Ot||vt;if(s){let r=s.type;if(e===Tl){let u=zf(r,!1);if(u&&(u===t||u===dt(t)||u===Un(dt(t))))return r}let a=tl(s[e]||r[e],t)||tl(s.appContext[e],t);return!a&&i?r:a}}function tl(e,t){return e&&(e[t]||e[dt(t)]||e[Un(dt(t))])}function ie(e,t,o,i){let s,r=o&&o[i],a=Se(e);if(a||xe(e)){let u=a&&xt(e),p=!1,v=!1;u&&(p=!Nt(e),v=qt(e),e=Yo(e)),s=new Array(e.length);for(let h=0,g=e.length;ht(u,p,void 0,r&&r[p]));else{let u=Object.keys(e);s=new Array(u.length);for(let p=0,v=u.length;pe?Zl(e)?ui(e):pr(e.parent):null;var ts=it(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>pr(e.parent),$root:e=>pr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>br(e),$forceUpdate:e=>e.f||(e.f=()=>{vr(e.update)}),$nextTick:e=>e.n||(e.n=nt.bind(e.proxy)),$watch:e=>Kp.bind(e)});var lr=(e,t)=>e!==Ge&&!e.__isScriptSetup&&Fe(e,t),rf={get({_:e},t){if(t==="__v_skip")return!0;let{ctx:o,setupState:i,data:s,props:r,accessCache:a,type:u,appContext:p}=e;if(t[0]!=="$"){let m=a[t];if(m!==void 0)switch(m){case 1:return i[t];case 2:return s[t];case 4:return o[t];case 3:return r[t]}else{if(lr(i,t))return a[t]=1,i[t];if(s!==Ge&&Fe(s,t))return a[t]=2,s[t];if(Fe(r,t))return a[t]=3,r[t];if(o!==Ge&&Fe(o,t))return a[t]=4,o[t];fr&&(a[t]=0)}}let v=ts[t],h,g;if(v)return t==="$attrs"&&mt(e.attrs,"get",""),v(e);if((h=u.__cssModules)&&(h=h[t]))return h;if(o!==Ge&&Fe(o,t))return a[t]=4,o[t];if(g=p.config.globalProperties,Fe(g,t))return g[t]},set({_:e},t,o){let{data:i,setupState:s,ctx:r}=e;return lr(s,t)?(s[t]=o,!0):i!==Ge&&Fe(i,t)?(i[t]=o,!0):Fe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=o,!0)},has({_:{data:e,setupState:t,accessCache:o,ctx:i,appContext:s,props:r,type:a}},u){let p;return!!(o[u]||e!==Ge&&u[0]!=="$"&&Fe(e,u)||lr(t,u)||Fe(r,u)||Fe(i,u)||Fe(ts,u)||Fe(s.config.globalProperties,u)||(p=a.__cssModules)&&p[u])},defineProperty(e,t,o){return o.get!=null?e._.accessCache[t]=0:Fe(o,"value")&&this.set(e,t,o.value,null),Reflect.defineProperty(e,t,o)}};function nl(e){return Se(e)?e.reduce((t,o)=>(t[o]=null,t),{}):e}var fr=!0;function af(e){let t=br(e),o=e.proxy,i=e.ctx;fr=!1,t.beforeCreate&&ol(t.beforeCreate,e,"bc");let{data:s,computed:r,methods:a,watch:u,provide:p,inject:v,created:h,beforeMount:g,mounted:m,beforeUpdate:k,updated:T,activated:w,deactivated:b,beforeDestroy:E,beforeUnmount:N,destroyed:O,unmounted:q,render:M,renderTracked:G,renderTriggered:de,errorCaptured:re,serverPrefetch:D,expose:X,inheritAttrs:le,components:Ee,directives:ae,filters:he}=t;if(v&&lf(v,i,null),a)for(let Ne in a){let Re=a[Ne];Te(Re)&&(i[Ne]=Re.bind(o))}if(s){let Ne=s.call(o,o);He(Ne)&&(e.data=et(Ne))}if(fr=!0,r)for(let Ne in r){let Re=r[Ne],Qe=Te(Re)?Re.bind(o,o):Te(Re.get)?Re.get.bind(o,o):St,Ke=!Te(Re)&&Te(Re.set)?Re.set.bind(o):St,rt=yt({get:Qe,set:Ke});Object.defineProperty(i,Ne,{enumerable:!0,configurable:!0,get:()=>rt.value,set:Ze=>rt.value=Ze})}if(u)for(let Ne in u)_l(u[Ne],i,o,Ne);if(p){let Ne=Te(p)?p.call(o):p;Reflect.ownKeys(Ne).forEach(Re=>{Gn(Re,Ne[Re])})}h&&ol(h,e,"c");function Pe(Ne,Re){Se(Re)?Re.forEach(Qe=>Ne(Qe.bind(o))):Re&&Ne(Re.bind(o))}if(Pe(Zp,g),Pe(on,m),Pe(Dl,k),Pe(Al,T),Pe(Sl,w),Pe(Nl,b),Pe(nf,re),Pe(tf,G),Pe(ef,de),Pe(Wn,N),Pe(cs,q),Pe(xp,D),Se(X))if(X.length){let Ne=e.exposed||(e.exposed={});X.forEach(Re=>{Object.defineProperty(Ne,Re,{get:()=>o[Re],set:Qe=>o[Re]=Qe,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===St&&(e.render=M),le!=null&&(e.inheritAttrs=le),Ee&&(e.components=Ee),ae&&(e.directives=ae),D&&yr(e)}function lf(e,t,o=St){Se(e)&&(e=hr(e));for(let i in e){let s=e[i],r;He(s)?"default"in s?r=Dt(s.from||i,s.default,!0):r=Dt(s.from||i):r=Dt(s),ht(r)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:a=>r.value=a}):t[i]=r}}function ol(e,t,o){$t(Se(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,o)}function _l(e,t,o,i){let s=i.includes(".")?kl(o,i):()=>o[i];if(xe(e)){let r=t[e];Te(r)&&tt(s,r)}else if(Te(e))tt(s,e.bind(o));else if(He(e))if(Se(e))e.forEach(r=>_l(r,t,o,i));else{let r=Te(e.handler)?e.handler.bind(o):t[e.handler];Te(r)&&tt(s,r,e)}}function br(e){let t=e.type,{mixins:o,extends:i}=t,{mixins:s,optionsCache:r,config:{optionMergeStrategies:a}}=e.appContext,u=r.get(t),p;return u?p=u:!s.length&&!o&&!i?p=t:(p={},s.length&&s.forEach(v=>ti(p,v,a,!0)),ti(p,t,a)),He(t)&&r.set(t,p),p}function ti(e,t,o,i=!1){let{mixins:s,extends:r}=t;r&&ti(e,r,o,!0),s&&s.forEach(a=>ti(e,a,o,!0));for(let a in t)if(!(i&&a==="expose")){let u=df[a]||o&&o[a];e[a]=u?u(e[a],t[a]):t[a]}return e}var df={data:sl,props:il,emits:il,methods:Zo,computed:Zo,beforeCreate:kt,created:kt,beforeMount:kt,mounted:kt,beforeUpdate:kt,updated:kt,beforeDestroy:kt,beforeUnmount:kt,destroyed:kt,unmounted:kt,activated:kt,deactivated:kt,errorCaptured:kt,serverPrefetch:kt,components:Zo,directives:Zo,watch:cf,provide:sl,inject:uf};function sl(e,t){return t?e?function(){return it(Te(e)?e.call(this,this):e,Te(t)?t.call(this,this):t)}:t:e}function uf(e,t){return Zo(hr(e),hr(t))}function hr(e){if(Se(e)){let t={};for(let o=0;ot==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${dt(t)}Modifiers`]||e[`${Xt(t)}Modifiers`];function mf(e,t,...o){if(e.isUnmounted)return;let i=e.vnode.props||Ge,s=o,r=t.startsWith("update:"),a=r&&hf(i,t.slice(7));a&&(a.trim&&(s=o.map(h=>xe(h)?h.trim():h)),a.number&&(s=s.map(fo)));let u,p=i[u=Lo(t)]||i[u=Lo(dt(t))];!p&&r&&(p=i[u=Lo(Xt(t))]),p&&$t(p,e,6,s);let v=i[u+"Once"];if(v){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,$t(v,e,6,s)}}var gf=new WeakMap;function Il(e,t,o=!1){let i=o?gf:t.emitsCache,s=i.get(e);if(s!==void 0)return s;let r=e.emits,a={},u=!1;if(!Te(e)){let p=v=>{let h=Il(v,t,!0);h&&(u=!0,it(a,h))};!o&&t.mixins.length&&t.mixins.forEach(p),e.extends&&p(e.extends),e.mixins&&e.mixins.forEach(p)}return!r&&!u?(He(e)&&i.set(e,null),null):(Se(r)?r.forEach(p=>a[p]=null):it(a,r),He(e)&&i.set(e,a),a)}function li(e,t){return!e||!lo(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Fe(e,t[0].toLowerCase()+t.slice(1))||Fe(e,Xt(t))||Fe(e,t))}function dr(e){let{type:t,vnode:o,proxy:i,withProxy:s,propsOptions:[r],slots:a,attrs:u,emit:p,render:v,renderCache:h,props:g,data:m,setupState:k,ctx:T,inheritAttrs:w}=e,b=xs(e),E,N;try{if(o.shapeFlag&4){let M=s||i,G=M;E=nn(v.call(G,M,h,g,k,m,T)),N=u}else{let M=t;E=nn(M.length>1?M(g,{attrs:u,slots:a,emit:p}):M(g,null)),N=t.props?u:vf(u)}}catch(M){jn.length=0,ds(M,e,1),E=Ue(Gt)}let O=E,q;if(N&&w!==!1){let M=Object.keys(N),{shapeFlag:G}=O;M.length&&G&7&&(r&&M.some(uo)&&(N=yf(N,r)),O=bo(O,N,!1,!0))}if(o.dirs&&(O=bo(O,null,!1,!0),O.dirs=O.dirs?O.dirs.concat(o.dirs):o.dirs),o.transition){let M=ii(O.type)&&Cl(O)||O;ss(M,o.transition)}return E=O,xs(b),E}function Ml(e,t=!0){let o;for(let i=0;i{let t;for(let o in e)(o==="class"||o==="style"||lo(o))&&((t||(t={}))[o]=e[o]);return t},yf=(e,t)=>{let o={};for(let i in e)(!uo(i)||!(i.slice(9)in t))&&(o[i]=e[i]);return o};function bf(e,t,o){let{props:i,children:s,component:r}=e,{props:a,children:u,patchFlag:p}=t,v=r.emitsOptions;if(t.dirs||t.transition)return!0;if(o&&p>=0){if(p&1024)return!0;if(p&16)return i?rl(i,a,v):!!a;if(p&8){let h=t.dynamicProps;for(let g=0;gObject.create(ql),Ll=e=>Object.getPrototypeOf(e)===ql;function kf(e,t,o,i=!1){let s={},r=$l();e.propsDefaults=Object.create(null),Ul(e,t,s,r);for(let a in e.propsOptions[0])a in s||(s[a]=void 0);o?e.props=i?s:Xo(s):e.type.props?e.props=s:e.props=r,e.attrs=r}function Cf(e,t,o,i){let{props:s,attrs:r,vnode:{patchFlag:a}}=e,u=ze(s),[p]=e.propsOptions,v=!1;if((i||a>0)&&!(a&16)){if(a&8){let h=e.vnode.dynamicProps;for(let g=0;g{p=!0;let[m,k]=Fl(g,t,!0);it(a,m),k&&u.push(...k)};!o&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!r&&!p)return He(e)&&i.set(e,En),En;if(Se(r))for(let h=0;he==="_"||e==="_ctx"||e==="$stable",kr=e=>Se(e)?e.map(nn):[nn(e)],Sf=(e,t,o)=>{if(t._n)return t;let i=jp((...s)=>kr(t(...s)),o);return i._c=!1,i},Bl=(e,t,o)=>{let i=e._ctx;for(let s in e){if(wr(s))continue;let r=e[s];if(Te(r))t[s]=Sf(s,r,i);else if(r!=null){let a=kr(r);t[s]=()=>a}}},zl=(e,t)=>{let o=kr(t);e.slots.default=()=>o},Hl=(e,t,o)=>{for(let i in t)(o||!wr(i))&&(e[i]=t[i])},Nf=(e,t,o)=>{let i=e.slots=$l();if(e.vnode.shapeFlag&32){let s=t._;s?(Hl(i,t,o),o&&Ls(i,"_",s,!0)):Bl(t,i)}else t&&zl(e,t)},Rf=(e,t,o)=>{let{vnode:i,slots:s}=e,r=!0,a=Ge;if(i.shapeFlag&32){let u=t._;u?o&&u===1?r=!1:Hl(s,t,o):(r=!t.$stable,Bl(t,s)),a=t}else t&&(zl(e,t),a={default:1});if(r)for(let u in s)!wr(u)&&a[u]==null&&delete s[u]};function Df(){let e=[]}var Rt=_f;function jl(e){return Af(e)}function Af(e,t){Df();let o=Uo();o.__VUE__=!0;let{insert:i,remove:s,patchProp:r,createElement:a,createText:u,createComment:p,setText:v,setElementText:h,parentNode:g,nextSibling:m,setScopeId:k=St,insertStaticContent:T}=e,w=(C,R,I,W=null,z=null,Y=null,V=void 0,j=null,ee=!!R.dynamicChildren)=>{if(C===R)return;C&&!Qo(C,R)&&(W=x(C),U(C,z,Y,!0),C=null),R.patchFlag===-2&&(ee=!1,R.dynamicChildren=null),R.dynamicChildren&&C&&C.dynamicChildren&&C.dynamicChildren.hasOnce&&(R.dynamicChildren===En&&(R.dynamicChildren=[]),R.dynamicChildren.hasOnce=!0);let{type:K,ref:me,shapeFlag:ne}=R;switch(K){case di:b(C,R,I,W);break;case Gt:E(C,R,I,W);break;case ns:C==null&&N(R,I,W,V);break;case B:ae(C,R,I,W,z,Y,V,j,ee);break;default:ne&1?G(C,R,I,W,z,Y,V,j,ee):ne&6?he(C,R,I,W,z,Y,V,j,ee):(ne&64||ne&128)&&K.process(C,R,I,W,z,Y,V,j,ee,ue)}me!=null&&z?xo(me,C&&C.ref,Y,R||C,!R):me==null&&C&&C.ref!=null&&xo(C.ref,null,Y,C,!0)},b=(C,R,I,W)=>{if(C==null)i(R.el=u(R.children),I,W);else{let z=R.el=C.el;R.children!==C.children&&v(z,R.children)}},E=(C,R,I,W)=>{C==null?i(R.el=p(R.children||""),I,W):R.el=C.el},N=(C,R,I,W)=>{[C.el,C.anchor]=T(C.children,R,I,W,C.el,C.anchor)},O=(C,R,I,W)=>{if(R.children!==C.children){let z=m(C.anchor);M(C),[R.el,R.anchor]=T(R.children,I,z,W)}else R.el=C.el,R.anchor=C.anchor},q=({el:C,anchor:R},I,W)=>{let z;for(;C&&C!==R;)z=m(C),i(C,I,W),C=z;i(R,I,W)},M=({el:C,anchor:R})=>{let I;for(;C&&C!==R;)I=m(C),s(C),C=I;s(R)},G=(C,R,I,W,z,Y,V,j,ee)=>{if(R.type==="svg"?V="svg":R.type==="math"&&(V="mathml"),C==null)de(R,I,W,z,Y,V,j,ee);else{let K=C.el&&C.el._isVueCE?C.el:null;try{K&&K._beginPatch(),X(C,R,z,Y,V,j,ee)}finally{K&&K._endPatch()}}},de=(C,R,I,W,z,Y,V,j)=>{let ee,K,{props:me,shapeFlag:ne,transition:fe,dirs:ye}=C;if(ee=C.el=a(C.type,Y,me&&me.is,me),ne&8?h(ee,C.children):ne&16&&D(C.children,ee,null,W,z,ur(C,Y),V,j),ye&&zn(C,null,W,"created"),re(ee,C,C.scopeId,V,W),me){for(let Le in me)Le!=="value"&&!co(Le)&&r(ee,Le,null,me[Le],Y,W);"value"in me&&r(ee,"value",null,me.value,Y),(K=me.onVnodeBeforeMount)&&en(K,W,C)}ye&&zn(C,null,W,"beforeMount");let Ae=Tf(z,fe);Ae&&fe.beforeEnter(ee),i(ee,R,I),((K=me&&me.onVnodeMounted)||Ae||ye)&&Rt(()=>{let Be;K&&en(K,W,C),Ae&&fe.enter(ee),ye&&zn(C,null,W,"mounted")},z)},re=(C,R,I,W,z)=>{if(I&&k(C,I),W)for(let Y=0;Y{for(let K=ee;K{let j=R.el=C.el,{patchFlag:ee,dynamicChildren:K,dirs:me}=R;ee|=C.patchFlag&16;let ne=C.props||Ge,fe=R.props||Ge,ye;if(I&&Hn(I,!1),(ye=fe.onVnodeBeforeUpdate)&&en(ye,I,R,C),me&&zn(R,C,I,"beforeUpdate"),I&&Hn(I,!0),K&&(!C.dynamicChildren||C.dynamicChildren.length!==K.length)&&(ee=0,V=!1,K=null),(ne.innerHTML&&fe.innerHTML==null||ne.textContent&&fe.textContent==null)&&h(j,""),K?le(C.dynamicChildren,K,j,I,W,ur(R,z),Y):V||Qe(C,R,j,null,I,W,ur(R,z),Y,!1),ee>0){if(ee&16)Ee(j,ne,fe,I,z);else if(ee&2&&ne.class!==fe.class&&r(j,"class",null,fe.class,z),ee&4&&r(j,"style",ne.style,fe.style,z),ee&8){let Ae=R.dynamicProps;for(let Le=0;Le{ye&&en(ye,I,R,C),me&&zn(R,C,I,"updated")},W)},le=(C,R,I,W,z,Y,V)=>{for(let j=0;j{if(R!==I){if(R!==Ge)for(let Y in R)!co(Y)&&!(Y in I)&&r(C,Y,R[Y],null,z,W);for(let Y in I){if(co(Y))continue;let V=I[Y],j=R[Y];V!==j&&Y!=="value"&&r(C,Y,j,V,z,W)}"value"in I&&r(C,"value",R.value,I.value,z)}},ae=(C,R,I,W,z,Y,V,j,ee)=>{let K=R.el=C?C.el:u(""),me=R.anchor=C?C.anchor:u(""),{patchFlag:ne,dynamicChildren:fe,slotScopeIds:ye}=R;ye&&(j=j?j.concat(ye):ye),C==null?(i(K,I,W),i(me,I,W),D(R.children||[],I,me,z,Y,V,j,ee)):ne>0&&ne&64&&fe&&C.dynamicChildren&&C.dynamicChildren.length===fe.length?(le(C.dynamicChildren,fe,I,z,Y,V,j),(R.key!=null||z&&R===z.subTree)&&Gl(C,R,!0)):Qe(C,R,I,me,z,Y,V,j,ee)},he=(C,R,I,W,z,Y,V,j,ee)=>{R.slotScopeIds=j,C==null?R.shapeFlag&512?z.ctx.activate(R,I,W,V,ee):Ce(R,I,W,z,Y,V,ee):Pe(C,R,ee)},Ce=(C,R,I,W,z,Y,V)=>{let j=C.component=$f(C,W,z);if(ri(C)&&(j.ctx.renderer=ue),Lf(j,!1,V),j.asyncDep){if(z&&z.registerDep(j,Ne,V,Y),!C.el){let ee=j.subTree=Ue(Gt);E(null,ee,R,I),C.placeholder=ee.el}}else Ne(j,C,R,I,z,Y,V)},Pe=(C,R,I)=>{let W=R.component=C.component;if(bf(C,R,I))if(W.asyncDep&&!W.asyncResolved){R.el=C.el,R.placeholder=C.placeholder,Re(W,R,I);return}else W.next=R,W.update();else R.el=C.el,R.placeholder=C.placeholder,W.vnode=R},Ne=(C,R,I,W,z,Y,V)=>{let j=()=>{if(C.isMounted){let{next:ne,bu:fe,u:ye,parent:Ae,vnode:Le}=C;{let lt=Wl(C);if(lt){ne&&(ne.el=Le.el,Re(C,ne,V)),lt.asyncDep.then(()=>{Rt(()=>{C.isUnmounted||K()},z)});return}}let Be=ne,st;Hn(C,!1),ne?(ne.el=Le.el,Re(C,ne,V)):ne=Le,fe&&po(fe),(st=ne.props&&ne.props.onVnodeBeforeUpdate)&&en(st,Ae,ne,Le),Hn(C,!0);let Ye=dr(C),bt=C.subTree;C.subTree=Ye,w(bt,Ye,g(bt.el),x(bt),C,z,Y),ne.el=Ye.el,Be===null&&wf(C,Ye.el),ye&&Rt(ye,z),(st=ne.props&&ne.props.onVnodeUpdated)&&Rt(()=>en(st,Ae,ne,Le),z)}else{let ne,{el:fe,props:ye}=R,{bm:Ae,m:Le,parent:Be,root:st,type:Ye}=C,bt=es(R);if(Hn(C,!1),Ae&&po(Ae),!bt&&(ne=ye&&ye.onVnodeBeforeMount)&&en(ne,Be,R),Hn(C,!0),fe&&Oe){let lt=()=>{C.subTree=dr(C),Oe(fe,C.subTree,C,z,null)};bt&&Ye.__asyncHydrate?Ye.__asyncHydrate(fe,C,lt):lt()}else{st.ce&&st.ce._hasShadowRoot()&&st.ce._injectChildStyle(Ye,C.parent?C.parent.type:void 0);let lt=C.subTree=dr(C);w(null,lt,I,W,C,z,Y),R.el=lt.el}if(Le&&Rt(Le,z),!bt&&(ne=ye&&ye.onVnodeMounted)){let lt=R;Rt(()=>en(ne,Be,lt),z)}(R.shapeFlag&256||Be&&es(Be.vnode)&&Be.vnode.shapeFlag&256)&&C.a&&Rt(C.a,z),C.isMounted=!0,R=I=W=null}};C.scope.on();let ee=C.effect=new mo(j);C.scope.off();let K=C.update=ee.run.bind(ee),me=C.job=ee.runIfDirty.bind(ee);me.i=C,me.id=C.uid,ee.scheduler=()=>vr(me),Hn(C,!0),K()},Re=(C,R,I)=>{R.component=C;let W=C.vnode.props;C.vnode=R,C.next=null,Cf(C,R.props,W,I),Rf(C,R.children,I),zt(),gl(C),Ht()},Qe=(C,R,I,W,z,Y,V,j,ee=!1)=>{let K=C&&C.children,me=C?C.shapeFlag:0,ne=R.children,{patchFlag:fe,shapeFlag:ye}=R;if(fe>0){if(fe&128){rt(K,ne,I,W,z,Y,V,j,ee);return}else if(fe&256){Ke(K,ne,I,W,z,Y,V,j,ee);return}}ye&8?(me&16&&L(K,z,Y),ne!==K&&h(I,ne)):me&16?ye&16?rt(K,ne,I,W,z,Y,V,j,ee):L(K,z,Y,!0):(me&8&&h(I,""),ye&16&&D(ne,I,W,z,Y,V,j,ee))},Ke=(C,R,I,W,z,Y,V,j,ee)=>{C=C||En,R=R||En;let K=C.length,me=R.length,ne=Math.min(K,me),fe;for(fe=0;feme?L(C,z,Y,!0,!1,ne):D(R,I,W,z,Y,V,j,ee,ne)},rt=(C,R,I,W,z,Y,V,j,ee)=>{let K=0,me=R.length,ne=C.length-1,fe=me-1;for(;K<=ne&&K<=fe;){let ye=C[K],Ae=R[K]=ee?fn(R[K]):nn(R[K]);if(Qo(ye,Ae))w(ye,Ae,I,null,z,Y,V,j,ee);else break;K++}for(;K<=ne&&K<=fe;){let ye=C[ne],Ae=R[fe]=ee?fn(R[fe]):nn(R[fe]);if(Qo(ye,Ae))w(ye,Ae,I,null,z,Y,V,j,ee);else break;ne--,fe--}if(K>ne){if(K<=fe){let ye=fe+1,Ae=yefe)for(;K<=ne;)U(C[K],z,Y,!0),K++;else{let ye=K,Ae=K,Le=new Map;for(K=Ae;K<=fe;K++){let F=R[K]=ee?fn(R[K]):nn(R[K]);F.key!=null&&Le.set(F.key,K)}let Be,st=0,Ye=fe-Ae+1,bt=!1,lt=0,S=new Array(Ye);for(K=0;K=Ye){U(F,z,Y,!0);continue}let Q;if(F.key!=null)Q=Le.get(F.key);else for(Be=Ae;Be<=fe;Be++)if(S[Be-Ae]===0&&Qo(F,R[Be])){Q=Be;break}Q===void 0?U(F,z,Y,!0):(S[Q-Ae]=K+1,Q>=lt?lt=Q:bt=!0,w(F,R[Q],I,null,z,Y,V,j,ee),st++)}let _=bt?Pf(S):En;for(Be=_.length-1,K=Ye-1;K>=0;K--){let F=Ae+K,Q=R[F],pe=R[F+1],be=F+1{let{el:Y,type:V,transition:j,children:ee,shapeFlag:K}=C;if(K&6){Ze(C.component.subTree,R,I,W);return}if(K&128){C.suspense.move(R,I,W);return}if(K&64){V.move(C,R,I,ue);return}if(V===B){i(Y,R,I);for(let ne=0;nej.enter(Y),z));else{let{leave:ne,delayLeave:fe,afterLeave:ye}=j,Ae=()=>{C.ctx.isUnmounted?s(Y):i(Y,R,I)},Le=()=>{let Be=Y._isLeaving||!!Y[ar];Y._isLeaving&&Y[ar](!0),j.persisted&&!Be?Ae():ne(Y,()=>{Ae(),ye&&ye()})};fe?fe(Y,Ae,Le):Le()}else i(Y,R,I)},U=(C,R,I,W=!1,z=!1)=>{let{type:Y,props:V,ref:j,children:ee,dynamicChildren:K,shapeFlag:me,patchFlag:ne,dirs:fe,cacheIndex:ye,memo:Ae}=C;if((ne===-2||K&&K.hasOnce)&&(z=!1),j!=null&&(zt(),xo(j,null,I,C,!0),Ht()),ye!=null&&(!C.ctx||C.ctx===R)&&(R.renderCache[ye]=void 0),me&256){R.ctx.deactivate(C);return}let Le=me&1&&fe,Be=!es(C),st;if(Be&&(st=V&&V.onVnodeBeforeUnmount)&&en(st,R,C),me&6)te(C.component,I,W);else{if(me&128){C.suspense.unmount(I,W);return}Le&&zn(C,null,R,"beforeUnmount"),me&64?C.type.remove(C,R,I,ue,W):K&&!K.hasOnce&&(Y!==B||ne>0&&ne&64)?L(K,R,I,!1,!0):(Y===B&&ne&384||!z&&me&16)&&L(ee,R,I),W&&oe(C)}let Ye=Ae!=null&&ye==null;(Be&&(st=V&&V.onVnodeUnmounted)||Le||Ye)&&Rt(()=>{st&&en(st,R,C),Le&&zn(C,null,R,"unmounted"),Ye&&(C.el=null)},I)},oe=C=>{let{type:R,el:I,anchor:W,transition:z}=C,Y=R===B;if(Y&&!z){Z(I,W);return}if(R===ns){M(C),z&&!z.persisted&&z.afterLeave&&z.afterLeave();return}let V=Y?cr(C):C,j=()=>{Y?g(I)&&Z(I,W):s(I),z&&!z.persisted&&z.afterLeave&&z.afterLeave()};if(V&&V.shapeFlag&1&&z&&!z.persisted){let{leave:ee,delayLeave:K}=z,me=V.el,ne=()=>ee(me,j);K?K(me,j,ne):ne()}else j()},Z=(C,R)=>{let I;for(;C!==R;)I=m(C),s(C),C=I;s(R)},te=(C,R,I)=>{let{bum:W,scope:z,job:Y,subTree:V,um:j,m:ee,a:K}=C;ll(ee),ll(K),W&&po(W),z.stop(),Y?(Y.flags|=8,U(V,C,R,I)):C.vnode.el&&V&&(V.transition=C.vnode.transition,U(V,C,R,I)),j&&Rt(j,R),Rt(()=>{C.isUnmounted=!0},R)},L=(C,R,I,W=!1,z=!1,Y=0)=>{for(let V=Y;V{if(C.shapeFlag&6)return x(C.component.subTree);if(C.shapeFlag&128)return C.suspense.next();let R=m(C.anchor||C.el),I=R&&R[Yp];return I?m(I):R},H=(C,R,I)=>{let W=C&&R._vnode?void 0:C&&C.component?C.component.uid:qf();Hp(()=>{C==null?R._vnode&&U(R._vnode,null,null,!0):w(R._vnode||null,C,R,null,null,null,I),R._vnode=C},W)},ue={p:w,um:U,m:Ze,r:oe,mt:Ce,mc:D,pc:Qe,pbc:le,n:x,o:e},we,Oe;return t&&([we,Oe]=t(ue)),{render:H,hydrate:we,createApp:ff(H,we)}}function ur({type:e,props:t},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:o}function Hn({effect:e,job:t},o){o?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Tf(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Gl(e,t,o=!1){let i=e.children,s=t.children;if(Se(i)&&Se(s))for(let r=0;r>1,e[o[u]]0&&(t[i]=o[r-1]),o[r]=i)}}for(r=o.length,a=o[r-1];r-- >0;)o[r]=a,a=t[a];return o}function Wl(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Wl(t)}function ll(e){if(e)for(let t=0;te.__isSuspense;function _f(e,t){t&&t.pendingBranch?Se(e)?t.effects.push(...e):t.effects.push(e):ml(e)}var B=Symbol.for("v-fgt"),di=Symbol.for("v-txt"),Gt=Symbol.for("v-cmt"),ns=Symbol.for("v-stc"),jn=[],It=null;function l(e=!1){jn.push(It=e?null:[])}function Yl(){jn.pop(),It=jn[jn.length-1]||null}var is=1;function ni(e,t=!1){is+=e,e<0&&It&&t&&(It.hasOnce=!0)}function Xl(e){return e.dynamicChildren=is>0?It||En:null,Yl(),is>0&&It&&It.push(e),e}function d(e,t,o,i,s,r){return Xl(n(e,t,o,i,s,r,!0))}function sn(e,t,o,i,s){return Xl(Ue(e,t,o,i,s,!0))}function rs(e){return e?e.__v_isVNode===!0:!1}function Qo(e,t){return e.type===t.type&&e.key===t.key}var Jl=({key:e})=>e??null,Qs=({ref:e,ref_key:t,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?xe(e)||ht(e)||Te(e)?{i:Ot,r:e,k:t,f:!!o}:e:null);function n(e,t=null,o=null,i=0,s=null,r=e===B?0:1,a=!1,u=!1){let p={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Jl(t),ref:t&&Qs(t),scopeId:bl,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Ot};return u?(oi(p,o),r&128&&e.normalize(p)):o&&(p.shapeFlag|=xe(o)?8:16),is>0&&!a&&It&&(p.patchFlag>0||r&6)&&p.patchFlag!==32&&It.push(p),p}var Ue=Of;function Of(e,t=null,o=null,i=0,s=null,r=!1){if((!e||e===sf)&&(e=Gt),rs(e)){let u=bo(e,t,!0);return o&&oi(u,o),is>0&&!r&&It&&(u.shapeFlag&6?It[It.indexOf(e)]=u:It.push(u)),u.patchFlag=-2,u}if(Hf(e)&&(e=e.__vccOpts),t){t=If(t);let{class:u,style:p}=t;u&&!xe(u)&&(t.class=P(u)),He(p)&&(Jo(p)&&!Se(p)&&(p=it({},p)),t.style=$e(p))}let a=xe(e)?1:Kl(e)?128:ii(e)?64:He(e)?4:Te(e)?2:0;return n(e,t,o,i,s,a,r,!0)}function If(e){return e?Jo(e)||Ll(e)?it({},e):e:null}function bo(e,t,o=!1,i=!1){let{props:s,ref:r,patchFlag:a,children:u,transition:p}=e,v=t?Mf(s||{},t):s,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:v,key:v&&Jl(v),ref:t&&t.ref?o&&r?Se(r)?r.concat(Qs(t)):[r,Qs(t)]:Qs(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==B?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:p,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&bo(e.ssContent),ssFallback:e.ssFallback&&bo(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return p&&i&&ss(h,p.clone(h)),h}function y(e=" ",t=0){return Ue(di,null,e,t)}function ke(e,t){let o=Ue(ns,null,e);return o.staticCount=t,o}function f(e="",t=!1){return t?(l(),sn(Gt,null,e)):Ue(Gt,null,e)}function nn(e){return e==null||typeof e=="boolean"?Ue(Gt):Se(e)?Ue(B,null,e.slice()):rs(e)?fn(e):Ue(di,null,String(e))}function fn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:bo(e)}function oi(e,t){let o=0,{shapeFlag:i}=e;if(t==null)t=null;else if(Se(t))o=16;else if(typeof t=="object")if(i&65){let s=t.default;s&&(s._c&&(s._d=!1),oi(e,s()),s._c&&(s._d=!0));return}else{o=32;let s=t._;!s&&!Ll(t)?t._ctx=Ot:s===3&&Ot&&(Ot.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Te(t)){if(i&65){oi(e,{default:t});return}t={default:t,_ctx:Ot},o=32}else t=String(t),i&64?(o=16,t=[y(t)]):o=8;e.children=t,e.shapeFlag|=o}function Mf(...e){let t={};for(let o=0;ovt||Ot,si,as;{let e=Uo(),t=(o,i)=>{let s;return(s=e[o])||(s=e[o]=[]),s.push(i),r=>{s.length>1?s.forEach(a=>a(r)):s[0](r)}};si=t("__VUE_INSTANCE_SETTERS__",o=>vt=o),as=t("__VUE_SSR_SETTERS__",o=>wo=o)}var ps=e=>{let t=vt;return si(e),e.scope.on(),()=>{e.scope.off(),si(t)}},dl=()=>{vt&&vt.scope.off(),si(null)};function Zl(e){return e.vnode.shapeFlag&4}var wo=!1;function Lf(e,t=!1,o=!1){t&&as(t);let{props:i,children:s}=e.vnode,r=Zl(e);kf(e,i,r,t),Nf(e,s,o||t);let a=r?Uf(e,t):void 0;return t&&as(!1),a}function Uf(e,t){let o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,rf);let{setup:i}=o;if(i){zt();let s=e.setupContext=i.length>1?Bf(e):null,r=ps(e),a=ls(i,e,0,[e.props,s]),u=zi(a);if(Ht(),r(),(u||e.sp)&&!es(e)&&yr(e),u){if(a.then(dl,dl),t)return a.then(p=>{as(!0);try{ul(e,p,t)}finally{as(!1)}}).catch(p=>{ds(p,e,0)});e.asyncDep=a}else ul(e,a,t)}else xl(e,t)}function ul(e,t,o){Te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:He(t)&&(e.setupState=Xs(t)),xl(e,o)}var cl,pl;function xl(e,t,o){let i=e.type;if(!e.render){if(!t&&cl&&!i.render){let s=i.template||br(e).template;if(s){let{isCustomElement:r,compilerOptions:a}=e.appContext.config,{delimiters:u,compilerOptions:p}=i,v=it(it({isCustomElement:r,delimiters:u},a),p);i.render=cl(s,v)}}e.render=i.render||St,pl&&pl(e)}{let s=ps(e);zt();try{af(e)}finally{Ht(),s()}}}var Ff={get(e,t){return mt(e,"get",""),e[t]}};function Bf(e){let t=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,Ff),slots:e.slots,emit:e.emit,expose:t}}function ui(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Xs(go(e.exposed)),{get(t,o){if(o in t)return t[o];if(o in ts)return ts[o](e)},has(t,o){return o in t||o in ts}})):e.proxy}function zf(e,t=!0){return Te(e)?e.displayName||e.name:e.name||t&&e.__name}function Hf(e){return Te(e)&&"__vccOpts"in e}var yt=(e,t)=>Xa(e,t,wo);function _e(e,t,o){try{ni(-1);let i=arguments.length;return i===2?He(t)&&!Se(t)?rs(t)?Ue(e,null,[t]):Ue(e,t):Ue(e,null,t):(i>3?o=Array.prototype.slice.call(arguments,2):i===3&&rs(o)&&(o=[o]),Ue(e,t,o))}finally{ni(1)}}var jf="3.5.44";var Rr,ed=typeof window<"u"&&window.trustedTypes;if(ed)try{Rr=ed.createPolicy("vue",{createHTML:e=>e})}catch{}var pd=Rr?e=>Rr.createHTML(e):e=>e,Gf="http://www.w3.org/2000/svg",Wf="http://www.w3.org/1998/Math/MathML",mn=typeof document<"u"?document:null,td=mn&&mn.createElement("template"),Kf={insert:(e,t,o)=>{t.insertBefore(e,o||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,o,i)=>{let s=t==="svg"?mn.createElementNS(Gf,e):t==="mathml"?mn.createElementNS(Wf,e):o?mn.createElement(e,{is:o}):mn.createElement(e);return e==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:e=>mn.createTextNode(e),createComment:e=>mn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>mn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,o,i,s,r){let a=o?o.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),o),!(s===r||!(s=s.nextSibling)););else{td.innerHTML=pd(i==="svg"?`${e}`:i==="mathml"?`${e}`:e);let u=td.content;if(i==="svg"||i==="mathml"){let p=u.firstChild;for(;p.firstChild;)u.appendChild(p.firstChild);u.removeChild(p)}t.insertBefore(u,o)}return[a?a.nextSibling:t.firstChild,o?o.previousSibling:t.lastChild]}};var Yf=Symbol("_vtc");function Xf(e,t,o){let i=e[Yf];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):o?e.setAttribute("class",t):e.className=t}var fi=Symbol("_vod"),fd=Symbol("_vsh"),J={name:"show",beforeMount(e,{value:t},{transition:o}){e[fi]=e.style.display==="none"?"":e.style.display,o&&t?o.beforeEnter(e):fs(e,t)},mounted(e,{value:t},{transition:o}){o&&t&&o.enter(e)},updated(e,{value:t,oldValue:o},{transition:i}){!t!=!o&&(i?t?(i.beforeEnter(e),fs(e,!0),i.enter(e)):i.leave(e,()=>{fs(e,!1)}):fs(e,t))},beforeUnmount(e,{value:t}){fs(e,t)}};function fs(e,t){e.style.display=t?e[fi]:"none",e[fd]=!t}var Jf=Symbol("");var Qf=/(?:^|;)\s*display\s*:/;function Zf(e,t,o){let i=e.style,s=xe(o),r=!1;if(o&&!s){if(t)if(xe(t))for(let a of t.split(";")){let u=a.slice(0,a.indexOf(":")).trim();o[u]==null&&hs(i,u,"")}else for(let a in t)o[a]==null&&hs(i,a,"");for(let a in o){a==="display"&&(r=!0);let u=o[a];u!=null?eh(e,a,!xe(t)&&t?t[a]:void 0,u)||hs(i,a,u):hs(i,a,"")}}else if(s){if(t!==o){let a=i[Jf];a&&(o+=";"+a),i.cssText=o,r=Qf.test(o)}}else t&&e.removeAttribute("style");fi in e&&((!s||t!==o)&&(e[fi]=r?i.display:""),e[fd]&&(i.display="none"))}var ci=/\s*!important$/;function hs(e,t,o){if(Se(o))o.forEach(i=>hs(e,t,i));else if(o==null&&(o=""),t.startsWith("--"))ci.test(o)?e.setProperty(t,o.replace(ci,""),"important"):e.setProperty(t,o);else{let i=xf(e,t);ci.test(o)?e.setProperty(Xt(i),o.replace(ci,""),"important"):e[i]=o}}var nd=["Webkit","Moz","ms"],Er={};function xf(e,t){let o=Er[t];if(o)return o;let i=dt(t);if(i!=="filter"&&i in e)return Er[t]=i;i=Un(i);for(let s=0;sSr||(rh.then(()=>Sr=0),Sr=Date.now());function lh(e,t){let o=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=o.attached)return;let s=o.value;if(Se(s)){let r=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{r.call(i),i._stopped=!0};let a=s.slice(),u=[i];for(let p=0;pe.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,dh=(e,t,o,i,s,r)=>{let a=s==="svg";t==="class"?Xf(e,i,a):t==="style"?Zf(e,o,i):lo(t)?uo(t)||nh(e,t,o,i,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):uh(e,t,i,a))?(id(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&sd(e,t,i,a,r,t!=="value")):e._isVueCE&&(ch(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!xe(i)))?id(e,dt(t),i,r,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),sd(e,t,i,a))};function uh(e,t,o,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&ad(t)&&Te(o));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){let s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return ad(t)&&xe(o)?!1:t in e}function ch(e,t){let o=e._def.props;if(!o)return!1;let i=dt(t);return Array.isArray(o)?o.some(s=>dt(s)===i):Object.keys(o).some(s=>dt(s)===i)}var ko=e=>{let t=e.props["onUpdate:modelValue"]||!1;return Se(t)?o=>po(t,o):t};function ph(e){e.target.composing=!0}function ld(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}var rn=Symbol("_assign"),pi=Symbol("_initialValue");function Nr(e,t,o){return t&&(e=e.trim()),o&&(e=fo(e)),e}var ct={created(e,{modifiers:{lazy:t,trim:o,number:i}},s){e.parentNode&&(e.type==="text"?e[pi]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[pi]=e.defaultValue.replace(/\r\n?/g,` +"use strict";(()=>{var ya=Object.defineProperty;var ba=e=>{throw TypeError(e)};var ap=(e,t,o)=>t in e?ya(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var lp=(e,t)=>{for(var o in t)ya(e,o,{get:t[o],enumerable:!0})};var We=(e,t,o)=>ap(e,typeof t!="symbol"?t+"":t,o),Ui=(e,t,o)=>t.has(e)||ba("Cannot "+o);var se=(e,t,o)=>(Ui(e,t,"read from private field"),o?o.call(e):t.get(e)),Ie=(e,t,o)=>t.has(e)?ba("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),qe=(e,t,o,i)=>(Ui(e,t,"write to private field"),i?i.call(e,o):t.set(e,o),o),Me=(e,t,o)=>(Ui(e,t,"access private method"),o);var wa=(e,t,o,i)=>({set _(s){qe(e,t,s,o)},get _(){return se(e,t,i)}});var ge=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var ve={markdown:"/script/markdown.6c8dfb7b1d.min.js",notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",editor:"/script/editor.4f142d3adc.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js"};function ka(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let o=new URLSearchParams(t);if([...o.keys()].length!==3||[...o.keys()].some(a=>!["clientId","intentId","token"].includes(a)))return null;let i=o.get("clientId"),s=o.get("intentId"),r=o.get("token");return!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{32}$/.test(s||"")||!/^[a-f0-9]{64}$/.test(r||"")?null:{contract:"4open.artifacts/1",clientId:i,intentId:s,token:r}}function Ca(e,t){let{http:o,promises:i,window:s}=t,r=t.takeReviewHandoff(),a=r?{clientId:r.clientId,intentId:r.intentId}:null,u,p,v,h,g,m=!0,k,T=i.defer(),w=()=>[...s.crypto.getRandomValues(new Uint8Array(16))].map(q=>q.toString(16).padStart(2,"0")).join("");Object.assign(e,{repositoryId:"",handoffEnabled:!1,busy:!1,preview:null,acceptAccess:!1,acceptRetention:!1,uncertain:!1,saved:!1,expired:!1,error:r?"":"Open a new artifact link from your submission. This link is missing or invalid."});let b=()=>m&&e.user?.username===g;function E(){m=!1,r=u=p=void 0,T.resolve(),s.clearTimeout(k)}e.on("dispose",E),e.on("routeLeave",E),e.watch(()=>e.user?.username,q=>{!g&&q?g=q:g&&q!==g&&(E(),e.preview=null,e.repositoryId="",e.busy=!1,e.saved=!1,e.handoffEnabled=!1,e.error="Your account changed. Open a new artifact link from your submission.")});let N=()=>({timeout:T.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":p}}),O=q=>q?.status===404?"Artifact linking is not available on this server.":q?.status===401?"Sign in, then open a new artifact link from your submission.":q?.status===403?"This account cannot approve this repository or this link.":"The request could not be completed. You can retry from this page.";e.loadPreview=async()=>{if(!m||!r||e.busy||e.uncertain||e.saved||!e.user?.username)return;g=e.user.username;let q=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(q)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,u=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,s.clearTimeout(k),h||(h=w());try{let M=(await o.get("/api/review-consent/csrf",{timeout:T.promise})).data;if(!b())return;if(p=M.csrf,e.handoffEnabled=M.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(p||""))throw new Error("invalid_csrf");let G=(await o.post("/api/review-consent/preview",{repositoryId:q,intent:{...r,requestId:h}},N())).data;if(!b())return;if(!G||typeof G.ticket!="string"||!G.ticket||G.ticket.length>8192||typeof G.repositoryName!="string"||!["restricted-review","anonymous-link"].includes(G.policy?.access)||!Number.isSafeInteger(G.policy.version)||!Number.isFinite(Date.parse(G.policy.retainUntil))||!Number.isFinite(Date.parse(G.expiresAt))||Date.parse(G.expiresAt)<=Date.now()||Date.parse(G.expiresAt)>Date.now()+6e5)throw new Error("invalid_preview");u=G.ticket,v=w(),e.preview={repositoryName:G.repositoryName,policy:{...G.policy},expiresAt:G.expiresAt},k=s.setTimeout(()=>{m&&(e.expired=!0)},Math.max(0,Date.parse(G.expiresAt)-Date.now()))}catch(M){b()&&(e.error=O(M))}finally{b()&&(e.busy=!1)}},e.confirmConsent=async()=>{if(!(!b()||e.busy||e.saved||!u||!e.acceptAccess||!e.acceptRetention)){if(Date.parse(e.preview.expiresAt)<=Date.now()){e.expired=!0;return}e.busy=!0,e.error="";try{let q=(await o.post("/api/review-consent/confirm",{ticket:u,requestId:v,acceptAccess:!0,acceptRetention:!0},N())).data;if(!b())return;if(q?.requestId!==v||!Number.isFinite(Date.parse(q.confirmedAt)))throw new Error("invalid_receipt");e.saved=!0,e.uncertain=!1,r=void 0,e.handoffEnabled||(u=void 0)}catch{b()&&(e.uncertain=!0,e.error="The confirmation was not verified. Retry with the same approval, or return to your submission to check its status.")}finally{b()&&(e.busy=!1)}}},e.continueReview=async()=>{if(!b()||e.busy||!e.saved||!e.handoffEnabled||!u||!a)return;e.busy=!0,e.error="";let q,M=()=>{q?.remove(),s.removeEventListener("securitypolicyviolation",G)},G=de=>{de.violatedDirective?.startsWith("form-action")&&(M(),b()&&(e.busy=!1,e.error="The return address was blocked. Return to your submission to check the artifact status."))};try{let de=(await o.post("/api/review-consent/handoff",{ticket:u},N())).data;if(!b())return;let re=de?.completion,D=new URL(de?.callbackUrl);if(!re||Object.keys(re).sort().join(",")!=="clientId,code,contract,expiresAt,intentId"||re.contract!=="4open.artifacts/1"||re.clientId!==a.clientId||re.intentId!==a.intentId||!/^[a-f0-9]{64}$/.test(re.code||"")||!Number.isFinite(Date.parse(re.expiresAt))||Date.parse(re.expiresAt)<=Date.now()||Date.parse(re.expiresAt)>Date.now()+3e5||D.protocol!=="https:"||D.href!==de.callbackUrl||D.username||D.password||de.callbackUrl.includes("?")||de.callbackUrl.includes("#"))throw new Error("invalid_handoff");q=s.document.createElement("form"),q.method="POST",q.action=D.href;let X=s.document.createElement("input");X.type="hidden",X.name="completion",X.value=JSON.stringify(re),q.appendChild(X),s.document.body.appendChild(q),s.addEventListener("securitypolicyviolation",G),e.on("dispose",M),q.submit()}catch{M(),b()&&(e.busy=!1,e.error="The return to review could not be prepared. Retry from this page, or return to your submission to check its status.")}}}var Is=new Map,cp=ve;function Ln(e){if(!Is.has(e)){let t=document.createElement("script");t.src=cp[e];let o=new Promise((i,s)=>{t.onload=i,t.onerror=()=>{Is.delete(e),t.remove(),s(new Error(`Unable to load ${e}. Please retry.`))}});Is.set(e,o),document.head.appendChild(t)}return Is.get(e)}async function Ms(){await Ln("editor"),ace.config.set("basePath","/script/external/ace/")}function ao(e){let t=Object.create(null);for(let o of e.split(","))t[o]=1;return o=>o in t}var Ge={},En=[],St=()=>{},Bi=()=>!1,lo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),uo=e=>e.startsWith("onUpdate:"),it=Object.assign,qo=(e,t)=>{let o=e.indexOf(t);o>-1&&e.splice(o,1)},pp=Object.prototype.hasOwnProperty,Fe=(e,t)=>pp.call(e,t),Se=Array.isArray,dn=e=>$o(e)==="[object Map]",Ut=e=>$o(e)==="[object Set]",Ea=e=>$o(e)==="[object Date]";var Te=e=>typeof e=="function",xe=e=>typeof e=="string",Pt=e=>typeof e=="symbol",He=e=>e!==null&&typeof e=="object",zi=e=>(He(e)||Te(e))&&Te(e.then)&&Te(e.catch),Da=Object.prototype.toString,$o=e=>Da.call(e),Hi=e=>$o(e).slice(8,-1),Vs=e=>$o(e)==="[object Object]",qs=e=>xe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,co=ao(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var $s=e=>{let t=Object.create(null);return(o=>t[o]||(t[o]=e(o)))},fp=/-\w/g,dt=$s(e=>e.replace(fp,t=>t.slice(1).toUpperCase())),hp=/\B([A-Z])/g,Xt=$s(e=>e.replace(hp,"-$1").toLowerCase()),Un=$s(e=>e.charAt(0).toUpperCase()+e.slice(1)),Lo=$s(e=>e?`on${Un(e)}`:""),Vt=(e,t)=>!Object.is(e,t),po=(e,...t)=>{for(let o=0;o{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:o})},fo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var Sa,Uo=()=>Sa||(Sa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function $e(e){if(Se(e)){let t={};for(let o=0;oo.startsWith("/*")?"":o).split(mp).forEach(o=>{if(o){let i=o.split(gp);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function P(e){let t="";if(xe(e))t=e;else if(Se(e))for(let o=0;oFt(o,t))}var Pa=e=>!!(e&&e.__v_isRef===!0),c=e=>xe(e)?e:e==null?"":Se(e)||He(e)&&(e.toString===Da||!Te(e.toString))?Pa(e)?c(e.value):JSON.stringify(e,_a,2):String(e),_a=(e,t)=>Pa(t)?_a(e,t.value):dn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[i,s],r)=>(o[Fi(i,r)+" =>"]=s,o),{})}:Ut(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>Fi(o))}:Pt(t)?Fi(t):He(t)&&!Se(t)&&!Vs(t)?String(t):t,Fi=(e,t="")=>{var o;return Pt(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};function Cp(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var ut,Ho=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&ut&&(ut.active?(this.parent=ut,this.index=(ut.scopes||(ut.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes){let i=this.scopes.slice();for(t=0,o=i.length;t0&&--this._on===0){if(ut===this)ut=this.prevScope;else{let t=ut;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let o,i;for(o=0,i=this.effects.length;o0)return;if(zo){let t=zo;for(zo=void 0;t;){let o=t.next;t.next=void 0,t.flags&=-9,t=o}}let e;for(;Bo;){let t=Bo;for(Bo=void 0;t;){let o=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=o}}if(e)throw e}function La(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ua(e){let t,o=e.depsTail,i=o;for(;i;){let s=i.prevDep;i.version===-1?(i===o&&(o=s),or(i),Ep(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}e.deps=t,e.depsTail=o}function Ki(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Fa(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Fa(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===jo)||(e.globalVersion=jo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ki(e))))return;e.flags|=2;let t=e.dep,o=Je,i=Bt;Je=e,Bt=!0;try{La(e);let s=e.fn(e._value);(t.version===0||Vt(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Je=o,Bt=i,Ua(e),e.flags&=-3}}function or(e,t=!1){let{dep:o,prevSub:i,nextSub:s}=e;if(i&&(i.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=i,e.nextSub=void 0),o.subs===e&&(o.subs=i,!i&&o.computed)){o.computed.flags&=-5;for(let r=o.computed.deps;r;r=r.nextDep)or(r,!0)}!t&&!--o.sc&&o.map&&o.map.delete(o.key)}function Ep(e){let{prevDep:t,nextDep:o}=e;t&&(t.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=t,e.nextDep=void 0)}var Bt=!0,Ba=[];function zt(){Ba.push(Bt),Bt=!1}function Ht(){let e=Ba.pop();Bt=e===void 0?!0:e}function Oa(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let o=Je;Je=void 0;try{t()}finally{Je=o}}}var jo=0,Yi=class{constructor(t,o){this.sub=t,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Go=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Je||!Bt||Je===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==Je)o=this.activeLink=new Yi(Je,this),Je.deps?(o.prevDep=Je.depsTail,Je.depsTail.nextDep=o,Je.depsTail=o):Je.deps=Je.depsTail=o,za(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){let i=o.nextDep;i.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=i),o.prevDep=Je.depsTail,o.nextDep=void 0,Je.depsTail.nextDep=o,Je.depsTail=o,Je.deps===o&&(Je.deps=i)}return o}trigger(t){this.version++,jo++,this.notify(t)}notify(t){tr();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{nr()}}};function za(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)za(i)}let o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}var Xi=new WeakMap,Bn=Symbol(""),Ji=Symbol(""),Wo=Symbol("");function mt(e,t,o){if(Bt&&Je){let i=Xi.get(e);i||Xi.set(e,i=new Map);let s=i.get(o);s||(i.set(o,s=new Go),s.map=i,s.key=o),s.track()}}function Qt(e,t,o,i,s,r){let a=Xi.get(e);if(!a){jo++;return}let u=p=>{p&&p.trigger()};if(tr(),t==="clear")a.forEach(u);else{let p=Se(e),v=p&&qs(o);if(p&&o==="length"){let h=Number(i);a.forEach((g,m)=>{(m==="length"||m===Wo||!Pt(m)&&m>=h)&&u(g)})}else switch((o!==void 0||a.has(void 0))&&u(a.get(o)),v&&u(a.get(Wo)),t){case"add":p?v&&u(a.get("length")):(u(a.get(Bn)),dn(e)&&u(a.get(Ji)));break;case"delete":p||(u(a.get(Bn)),dn(e)&&u(a.get(Ji)));break;case"set":dn(e)&&u(a.get(Bn));break}}nr()}function ho(e){let t=ze(e);return t===e||(mt(t,"iterate",Wo),Nt(e))?t:qt(e)?xt(e)?t.map(o=>cn(_t(o))):t.map(cn):t.map(_t)}function Yo(e){return mt(e=ze(e),"iterate",Wo),e}function Jt(e,t){return qt(e)?cn(xt(e)?_t(t):t):_t(t)}var Sp={__proto__:null,[Symbol.iterator](){return Gi(this,Symbol.iterator,e=>Jt(this,e))},concat(...e){return ho(this).concat(...e.map(t=>Se(t)?ho(t):t))},entries(){return Gi(this,"entries",e=>(e[1]=Jt(this,e[1]),e))},every(e,t){return un(this,"every",e,t,void 0,arguments)},filter(e,t){return un(this,"filter",e,t,o=>o.map(i=>Jt(this,i)),arguments)},find(e,t){return un(this,"find",e,t,o=>Jt(this,o),arguments)},findIndex(e,t){return un(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return un(this,"findLast",e,t,o=>Jt(this,o),arguments)},findLastIndex(e,t){return un(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return un(this,"forEach",e,t,void 0,arguments)},includes(...e){return Wi(this,"includes",e)},indexOf(...e){return Wi(this,"indexOf",e)},join(e){return ho(this).join(e)},lastIndexOf(...e){return Wi(this,"lastIndexOf",e)},map(e,t){return un(this,"map",e,t,void 0,arguments)},pop(){return Fo(this,"pop")},push(...e){return Fo(this,"push",e)},reduce(e,...t){return Ma(this,"reduce",e,t)},reduceRight(e,...t){return Ma(this,"reduceRight",e,t)},shift(){return Fo(this,"shift")},some(e,t){return un(this,"some",e,t,void 0,arguments)},splice(...e){return Fo(this,"splice",e)},toReversed(){return ho(this).toReversed()},toSorted(e){return ho(this).toSorted(e)},toSpliced(...e){return ho(this).toSpliced(...e)},unshift(...e){return Fo(this,"unshift",e)},values(){return Gi(this,"values",e=>Jt(this,e))}};function Gi(e,t,o){let i=Yo(e),s=i[t],r=s.call(i);if(i!==e&&!Nt(e)){if(r[Symbol.toStringTag]==="Array Iterator"){let a=Object.create(Object.getPrototypeOf(r));return a.next=()=>Ia(r.next(),o),s!==Ha[t]&&Object.defineProperties(a,{return:{get(){let u=r.return;return typeof u=="function"?u.bind(r):u}},throw:{get(){let u=r.throw;return typeof u=="function"?u.bind(r):u}}}),a}r._next=r.next,r.next=()=>Ia(r._next(),o)}return r}function Ia(e,t){return e.done||(e.value=t(e.value)),e}var Ha=Array.prototype;function un(e,t,o,i,s,r){let a=Yo(e),u=a!==e&&!Nt(e),p=a[t];if(p!==Ha[t]){let g=p.apply(e,r);return u?_t(g):g}let v=o;a!==e&&(u?v=function(g,m){return o.call(this,Jt(e,g),m,e)}:o.length>2&&(v=function(g,m){return o.call(this,g,m,e)}));let h=p.call(a,v,i);return u&&s?s(h):h}function Ma(e,t,o,i){let s=Yo(e),r=s!==e&&!Nt(e),a=o,u=!1;s!==e&&(r?(u=i.length===0,a=function(v,h,g){return u&&(u=!1,v=Jt(e,v)),o.call(this,v,Jt(e,h),g,e)}):o.length>3&&(a=function(v,h,g){return o.call(this,v,h,g,e)}));let p=s[t](a,...i);return u?Jt(e,p):p}function Wi(e,t,o){let i=ze(e);mt(i,"iterate",Wo);let s=i[t](...o);return(s===-1||s===!1)&&Jo(o[0])?(o[0]=ze(o[0]),i[t](...o)):s}function Fo(e,t,o=[]){zt(),tr();let i=ze(e)[t].apply(e,o);return nr(),Ht(),i}var Np=ao("__proto__,__v_isRef,__isVue"),ja=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Pt));function Rp(e){Pt(e)||(e=String(e));let t=ze(this);return mt(t,"has",e),t.hasOwnProperty(e)}var js=class{constructor(t=!1,o=!1){this._isReadonly=t,this._isShallow=o}get(t,o,i){if(o==="__v_skip")return t.__v_skip;let s=this._isReadonly,r=this._isShallow;if(o==="__v_isReactive")return!s;if(o==="__v_isReadonly")return s;if(o==="__v_isShallow")return r;if(o==="__v_raw")return i===(s?r?Vp:Ka:r?Wa:Ga).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;let a=Se(t);if(!s){let p;if(a&&(p=Sp[o]))return p;if(o==="hasOwnProperty")return Rp}let u=Reflect.get(t,o,ht(t)?t:i);if((Pt(o)?ja.has(o):Np(o))||(s||mt(t,"get",o),r))return u;if(ht(u)){let p=a&&qs(o)?u:u.value;return s&&He(p)?Ws(p):p}return He(u)?s?Ws(u):et(u):u}},Gs=class extends js{constructor(t=!1){super(!1,t)}set(t,o,i,s){let r=t[o],a=Se(t)&&qs(o);if(!this._isShallow){let v=qt(r);if(!Nt(i)&&!qt(i)&&(r=ze(r),i=ze(i)),!a&&ht(r)&&!ht(i))return v||(r.value=i),!0}let u=a?Number(o)e,Bs=e=>Reflect.getPrototypeOf(e);function Pp(e,t,o){return function(...i){let s=this.__v_raw,r=ze(s),a=dn(r),u=e==="entries"||e===Symbol.iterator&&a,p=e==="keys"&&a,v=s[e](...i),h=o?Zi:t?cn:_t;return!t&&mt(r,"iterate",p?Ji:Bn),it(Object.create(v),{next(){let{value:g,done:m}=v.next();return m?{value:g,done:m}:{value:u?[h(g[0]),h(g[1])]:h(g),done:m}}})}}function zs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function _p(e,t){let o={get(s){let r=this.__v_raw,a=ze(r),u=ze(s);e||(Vt(s,u)&&mt(a,"get",s),mt(a,"get",u));let{has:p}=Bs(a),v=t?Zi:e?cn:_t;if(p.call(a,s))return v(r.get(s));if(p.call(a,u))return v(r.get(u));r!==a&&r.get(s)},get size(){let s=this.__v_raw;return!e&&mt(ze(s),"iterate",Bn),s.size},has(s){let r=this.__v_raw,a=ze(r),u=ze(s);return e||(Vt(s,u)&&mt(a,"has",s),mt(a,"has",u)),s===u?r.has(s):r.has(s)||r.has(u)},forEach(s,r){let a=this,u=a.__v_raw,p=ze(u),v=t?Zi:e?cn:_t;return!e&&mt(p,"iterate",Bn),u.forEach((h,g)=>s.call(r,v(h),v(g),a))}};return it(o,e?{add:zs("add"),set:zs("set"),delete:zs("delete"),clear:zs("clear")}:{add(s){let r=ze(this),a=Bs(r),u=ze(s),p=!t&&!Nt(s)&&!qt(s)?u:s;return a.has.call(r,p)||Vt(s,p)&&a.has.call(r,s)||Vt(u,p)&&a.has.call(r,u)||(r.add(p),Qt(r,"add",p,p)),this},set(s,r){!t&&!Nt(r)&&!qt(r)&&(r=ze(r));let a=ze(this),{has:u,get:p}=Bs(a),v=u.call(a,s);v||(s=ze(s),v=u.call(a,s));let h=p.call(a,s);return a.set(s,r),v?Vt(r,h)&&Qt(a,"set",s,r,h):Qt(a,"add",s,r),this},delete(s){let r=ze(this),{has:a,get:u}=Bs(r),p=a.call(r,s);p||(s=ze(s),p=a.call(r,s));let v=u?u.call(r,s):void 0,h=r.delete(s);return p&&Qt(r,"delete",s,void 0,v),h},clear(){let s=ze(this),r=s.size!==0,a=void 0,u=s.clear();return r&&Qt(s,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(s=>{o[s]=Pp(s,e,t)}),o}function sr(e,t){let o=_p(e,t);return(i,s,r)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_isShallow"?t:s==="__v_raw"?i:Reflect.get(Fe(o,s)&&s in i?o:i,s,r)}var Op={get:sr(!1,!1)},Ip={get:sr(!1,!0)},Mp={get:sr(!0,!1)};var Ga=new WeakMap,Wa=new WeakMap,Ka=new WeakMap,Vp=new WeakMap;function qp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function et(e){return qt(e)?e:ir(e,!1,Dp,Op,Ga)}function Xo(e){return ir(e,!1,Tp,Ip,Wa)}function Ws(e){return ir(e,!0,Ap,Mp,Ka)}function ir(e,t,o,i,s){if(!He(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let r=s.get(e);if(r)return r;let a=qp(Hi(e));if(a===0)return e;let u=new Proxy(e,a===2?i:o);return s.set(e,u),u}function xt(e){return qt(e)?xt(e.__v_raw):!!(e&&e.__v_isReactive)}function qt(e){return!!(e&&e.__v_isReadonly)}function Nt(e){return!!(e&&e.__v_isShallow)}function Jo(e){return e?!!e.__v_raw:!1}function ze(e){let t=e&&e.__v_raw;return t?ze(t):e}function go(e){return!Fe(e,"__v_skip")&&Object.isExtensible(e)&&Ls(e,"__v_skip",!0),e}var _t=e=>He(e)?et(e):e,cn=e=>He(e)?Ws(e):e;function ht(e){return e?e.__v_isRef===!0:!1}function gt(e){return Ya(e,!1)}function Ys(e){return Ya(e,!0)}function Ya(e,t){return ht(e)?e:new xi(e,t)}var xi=class{constructor(t,o){this.dep=new Go,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?t:ze(t),this._value=o?t:_t(t),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(t){let o=this._rawValue,i=this.__v_isShallow||Nt(t)||qt(t);t=i?t:ze(t),Vt(t,o)&&(this._rawValue=t,this._value=i?t:_t(t),this.dep.trigger())}};function pn(e){return ht(e)?e.value:e}var $p={get:(e,t,o)=>t==="__v_raw"?e:pn(Reflect.get(e,t,o)),set:(e,t,o,i)=>{let s=e[t];return ht(s)&&!ht(o)?(s.value=o,!0):Reflect.set(e,t,o,i)}};function Xs(e){return xt(e)?e:new Proxy(e,$p)}var er=class{constructor(t,o,i){this.fn=t,this.setter=o,this._value=void 0,this.dep=new Go(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=jo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Je!==this)return $a(this,!0),!0}get value(){let t=this.dep.track();return Fa(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Xa(e,t,o=!1){let i,s;return Te(e)?i=e:(i=e.get,s=e.set),new er(i,s,o)}var Hs={},Ks=new WeakMap,Fn;function Ja(e,t=!1,o=Fn){if(o){let i=Ks.get(o);i||Ks.set(o,i=[]),i.push(e)}}function Qa(e,t,o=Ge){let{immediate:i,deep:s,once:r,scheduler:a,augmentJob:u,call:p}=o,v=M=>{(o.onWarn||Cp)("Invalid watch source: ",M,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},h=M=>s?M:Nt(M)||s===!1||s===0?Zt(M,1):Zt(M),g,m,k,T,w=!1,b=!1;if(ht(e)?(m=()=>e.value,w=Nt(e)):xt(e)?(m=()=>h(e),w=!0):Se(e)?(b=!0,w=e.some(M=>xt(M)||Nt(M)),m=()=>e.map(M=>{if(ht(M))return M.value;if(xt(M))return h(M);if(Te(M))return p?p(M,2):M()})):Te(e)?t?m=p?()=>p(e,2):e:m=()=>{if(k){zt();try{k()}finally{Ht()}}let M=Fn;Fn=g;try{return p?p(e,3,[T]):e(T)}finally{Fn=M}}:m=St,t&&s){let M=m,G=s===!0?1/0:s;m=()=>Zt(M(),G)}let E=Va(),N=()=>{g.stop(),E&&E.active&&qo(E.effects,g)};if(r&&t){let M=t;t=(...G)=>{try{return M(...G)}finally{N()}}}let O=b?new Array(e.length).fill(Hs):Hs,q=M=>{if(!(!(g.flags&1)||!g.dirty&&!M))if(t){let G=g.run();if(M||s||w||(b?G.some((de,re)=>Vt(de,O[re])):Vt(G,O))){let de=Fn;zt();try{k&&k(),Fn=g;let re=[G,O===Hs?void 0:b&&O[0]===Hs?[]:O,T];O=G,p?p(t,3,re):t(...re)}finally{Fn=de,Ht()}}}else g.run()};return u&&u(q),g=new mo(m),g.scheduler=a?()=>a(q,!1):q,T=M=>Ja(M,!1,g),k=g.onStop=()=>{let M=Ks.get(g);if(M){if(p)p(M,4);else for(let G of M)G();Ks.delete(g)}},t?i?q(!0):O=g.run():a?a(q.bind(null,!0),!0):g.run(),N.pause=g.pause.bind(g),N.resume=g.resume.bind(g),N.stop=N,N}function Zt(e,t=1/0,o){if(t<=0||!He(e)||e.__v_skip||(o=o||new Map,(o.get(e)||0)>=t))return e;if(o.set(e,t),t--,ht(e))Zt(e.value,t,o);else if(Se(e))for(let i=0;i{Zt(i,t,o)});else if(Vs(e)){for(let i in e)Zt(e[i],t,o);for(let i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&Zt(e[i],t,o)}return e}function ls(e,t,o,i){try{return i?e(...i):e()}catch(s){ds(s,t,o)}}function $t(e,t,o,i){if(Te(e)){let s=ls(e,t,o,i);return s&&zi(s)&&s.catch(r=>{ds(r,t,o)}),s}if(Se(e)){let s=[];for(let r=0;r>>1,s=Ct[i],r=os(s);r=os(o)?Ct.push(e):Ct.splice(zp(t),0,e),e.flags|=1,hl()}}function hl(){Zs||(Zs=fl.then(yl))}function ml(e){if(!Se(e))Sn&&e.id===-1?Sn.splice(vo+1,0,e):e.flags&1||(tn.push(e),e.flags|=1);else for(let t=0;t=t))continue;Ct.splice(i,1),i=e?i-1:jt,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function vl(e,t,o=0){if(tn.length){let i=tn,s=0;if(t){i=[];for(let a=0;aos(a)-os(u));if(tn.length=s,Sn){for(let a=0;ae.id==null?e.flags&2?-1:1/0:e.id;function yl(e){let t=St;try{for(jt=0;jt{i._d&&ni(-1);let r=xs(t),a=jn.length,u;try{u=e(...s)}finally{for(let p=jn.length;p>a;p--)Yl();xs(r),i._d&&ni(1)}return u};return i._n=!0,i._c=!0,i._d=!0,i}function A(e,t){if(Ot===null)return e;let o=ui(Ot),i=e.dirs||(e.dirs=[]);for(let s=0;s1)return o&&Te(t)?t.call(i&&i.proxy):t}}var Gp=Symbol.for("v-scx"),Wp=()=>{{let e=Dt(Gp);return e}};function tt(e,t,o){return wl(e,t,o)}function wl(e,t,o=Ge){let{immediate:i,deep:s,flush:r,once:a}=o,u=it({},o),p=t&&i||!t&&r!=="post",v;if(wo){if(r==="sync"){let k=Wp();v=k.__watcherHandles||(k.__watcherHandles=[])}else if(!p){let k=()=>{};return k.stop=St,k.resume=St,k.pause=St,k}}let h=vt;u.call=(k,T,w)=>$t(k,h,T,w);let g=!1;r==="post"?u.scheduler=k=>{k.i=h,Rt(k,h&&h.suspense)}:r!=="sync"&&(g=!0,u.scheduler=(k,T)=>{T?k():vr(k)}),u.augmentJob=k=>{t&&(k.flags|=4),g&&(k.flags|=2,h&&(k.id=h.uid,k.i=h))};let m=Qa(e,t,u);return wo&&(v?v.push(m):p&&m()),m}function Kp(e,t,o){let i=this.proxy,s=xe(e)?e.includes(".")?kl(i,e):()=>i[e]:e.bind(i,i),r;Te(t)?r=t:(r=t.handler,o=t);let a=ps(this),u=wl(s,r.bind(i),o);return a(),u}function kl(e,t){let o=t.split(".");return()=>{let i=e;for(let s=0;se.__isTeleport;var ar=Symbol("_leaveCb");function Xp(e){let t=e[0];if(e.length>1){let o=!1;for(let i of e)if(i.type!==Gt){t=i,o=!0;break}}return t}function Cl(e){if(!ri(e))return ii(e.type)&&e.children?Xp(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:o}=e;if(o){if(t&16)return o[0];if(t&32&&Te(o.default))return o.default()}}function ss(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let o=e.component.subTree;ss(ii(o.type)&&Cl(o)||o,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===B&&Se(e.children)){let o=Ml(e.children,!1);o&&ss(o,t)}}function cr(e){if(e.component)return cr(e.component.subTree);if(e.type===B){let t=Se(e.children)&&Ml(e.children,!1);return t?cr(t):void 0}if(e.type!==Gt)return e}function us(e,t){return Te(e)?it({name:e.name},t,{setup:e}):e}function yr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Za(e,t){let o;return!!((o=Object.getOwnPropertyDescriptor(e,t))&&!o.configurable)}var ei=new WeakMap;function xo(e,t,o,i,s=!1){if(Se(e)){e.forEach((w,b)=>xo(w,t&&(Se(t)?t[b]:t),o,i,s));return}if(es(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&xo(e,t,o,i.component.subTree);return}let r=i.shapeFlag&4?ui(i.component):i.el,a=s?null:r,{i:u,r:p}=e,v=t&&t.r,h=u.refs===Ge?u.refs={}:u.refs,g=u.setupState,m=ze(g),k=g===Ge?Bi:w=>Za(h,w)?!1:Fe(m,w),T=(w,b)=>!(b&&Za(h,b));if(v!=null&&v!==p){if(xa(t),xe(v))h[v]=null,k(v)&&(g[v]=null);else if(ht(v)){let w=t;T(v,w.k)&&(v.value=null),w.k&&(h[w.k]=null)}}if(Te(p))ls(p,u,12,[a,h]);else{let w=xe(p),b=ht(p);if(w||b){let E=()=>{if(e.f){let N=w?k(p)?g[p]:h[p]:T(p)||!e.k?p.value:h[e.k];if(s)Se(N)&&qo(N,r);else if(Se(N))N.includes(r)||N.push(r);else if(w)h[p]=[r],k(p)&&(g[p]=h[p]);else{let O=[r];T(p,e.k)&&(p.value=O),e.k&&(h[e.k]=O)}}else w?(h[p]=a,k(p)&&(g[p]=a)):b&&(T(p,e.k)&&(p.value=a),e.k&&(h[e.k]=a))};if(a){let N=()=>{E(),ei.delete(e)};N.id=-1,ei.set(e,N),Rt(N,o)}else xa(e),E()}}}function xa(e){let t=ei.get(e);t&&(t.flags|=8,ei.delete(e))}var el=e=>e.nodeType===8;var Ij=Uo().requestIdleCallback||(e=>setTimeout(e,1)),Mj=Uo().cancelIdleCallback||(e=>clearTimeout(e));function Jp(e,t){if(el(e)&&e.data==="["){let o=1,i=e.nextSibling;for(;i;){if(i.nodeType===1){if(t(i)===!1)break}else if(el(i))if(i.data==="]"){if(--o===0)break}else i.data==="["&&o++;i=i.nextSibling}}else t(e)}var es=e=>!!e.type.__asyncLoader;function El(e){Te(e)&&(e={loader:e});let{loader:t,loadingComponent:o,errorComponent:i,delay:s=200,hydrate:r,timeout:a,suspensible:u=!0,onError:p}=e,v=null,h,g=0,m=()=>(g++,v=null,k()),k=()=>{let T;return v||(T=v=t().catch(w=>{if(w=w instanceof Error?w:new Error(String(w)),p)return new Promise((b,E)=>{p(w,()=>b(m()),()=>E(w),g+1)});throw w}).then(w=>T!==v&&v?v:(w&&(w.__esModule||w[Symbol.toStringTag]==="Module")&&(w=w.default),h=w,w)))};return us({name:"AsyncComponentWrapper",__asyncLoader:k,__asyncHydrate(T,w,b){let E=T.isConnected,N=!1;(w.bu||(w.bu=[])).push(()=>N=!0);let O=()=>{N||!T.parentNode||E&&!T.isConnected||b()},q=r?()=>{let M=r(O,G=>Jp(T,G));M&&(w.bum||(w.bum=[])).push(M)}:O;h?q():k().then(()=>!w.isUnmounted&&q())},get __asyncResolved(){return h},setup(){let T=vt;if(yr(T),h)return()=>Js(h,T);let w=M=>{v=null,ds(M,T,13,!i)};if(u&&T.suspense||wo)return k().then(M=>()=>Js(M,T)).catch(M=>(w(M),()=>i?Ue(i,{error:M}):null));let b=gt(!1),E=gt(),N=gt(!!s),O,q;return cs(()=>{O!=null&&clearTimeout(O),q!=null&&clearTimeout(q)}),s&&(q=setTimeout(()=>{T.isUnmounted||(N.value=!1)},s)),a!=null&&(O=setTimeout(()=>{if(!T.isUnmounted&&!b.value&&!E.value){let M=new Error(`Async component timed out after ${a}ms.`);w(M),E.value=M}},a)),k().then(()=>{T.isUnmounted||(b.value=!0,T.parent&&ri(T.parent.vnode)&&T.parent.update())}).catch(M=>{if(T.isUnmounted){v=null;return}w(M),E.value=M}),()=>{if(b.value&&h)return Js(h,T);if(E.value&&i)return Ue(i,{error:E.value});if(o&&!N.value)return Js(o,T)}}})}function Js(e,t){let{ref:o,props:i,children:s,ce:r}=t.vnode,a=Ue(e,i,s);return a.ref=o,a.ce=r,delete t.vnode.ce,a}var ri=e=>e.type.__isKeepAlive;function Sl(e,t){Rl(e,"a",t)}function Nl(e,t){Rl(e,"da",t)}function Rl(e,t,o=vt){let i=e.__wdc||(e.__wdc=()=>{let s=o;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ai(t,i,o),o){let s=o.parent;for(;s&&s.parent;)ri(s.parent.vnode)&&Qp(i,t,o,s),s=s.parent}}function Qp(e,t,o,i){let s=ai(t,e,i,!0);cs(()=>{qo(i[t],s)},o)}function ai(e,t,o=vt,i=!1){if(o){let s=o[e]||(o[e]=[]),r=t.__weh||(t.__weh=(...a)=>{zt();let u=ps(o),p=$t(t,o,e,a);return u(),Ht(),p});return i?s.unshift(r):s.push(r),r}}var hn=e=>(t,o=vt)=>{(!wo||e==="sp")&&ai(e,(...i)=>t(...i),o)},Zp=hn("bm"),on=hn("m"),Dl=hn("bu"),Al=hn("u"),Wn=hn("bum"),cs=hn("um"),xp=hn("sp"),ef=hn("rtg"),tf=hn("rtc");function nf(e,t=vt){ai("ec",e,t)}var Tl="components",of="directives";function at(e,t){return Pl(Tl,e,!0,t)||e}var sf=Symbol.for("v-ndc");function De(e){return Pl(of,e)}function Pl(e,t,o=!0,i=!1){let s=Ot||vt;if(s){let r=s.type;if(e===Tl){let u=zf(r,!1);if(u&&(u===t||u===dt(t)||u===Un(dt(t))))return r}let a=tl(s[e]||r[e],t)||tl(s.appContext[e],t);return!a&&i?r:a}}function tl(e,t){return e&&(e[t]||e[dt(t)]||e[Un(dt(t))])}function ie(e,t,o,i){let s,r=o&&o[i],a=Se(e);if(a||xe(e)){let u=a&&xt(e),p=!1,v=!1;u&&(p=!Nt(e),v=qt(e),e=Yo(e)),s=new Array(e.length);for(let h=0,g=e.length;ht(u,p,void 0,r&&r[p]));else{let u=Object.keys(e);s=new Array(u.length);for(let p=0,v=u.length;pe?Zl(e)?ui(e):pr(e.parent):null;var ts=it(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>pr(e.parent),$root:e=>pr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>br(e),$forceUpdate:e=>e.f||(e.f=()=>{vr(e.update)}),$nextTick:e=>e.n||(e.n=nt.bind(e.proxy)),$watch:e=>Kp.bind(e)});var lr=(e,t)=>e!==Ge&&!e.__isScriptSetup&&Fe(e,t),rf={get({_:e},t){if(t==="__v_skip")return!0;let{ctx:o,setupState:i,data:s,props:r,accessCache:a,type:u,appContext:p}=e;if(t[0]!=="$"){let m=a[t];if(m!==void 0)switch(m){case 1:return i[t];case 2:return s[t];case 4:return o[t];case 3:return r[t]}else{if(lr(i,t))return a[t]=1,i[t];if(s!==Ge&&Fe(s,t))return a[t]=2,s[t];if(Fe(r,t))return a[t]=3,r[t];if(o!==Ge&&Fe(o,t))return a[t]=4,o[t];fr&&(a[t]=0)}}let v=ts[t],h,g;if(v)return t==="$attrs"&&mt(e.attrs,"get",""),v(e);if((h=u.__cssModules)&&(h=h[t]))return h;if(o!==Ge&&Fe(o,t))return a[t]=4,o[t];if(g=p.config.globalProperties,Fe(g,t))return g[t]},set({_:e},t,o){let{data:i,setupState:s,ctx:r}=e;return lr(s,t)?(s[t]=o,!0):i!==Ge&&Fe(i,t)?(i[t]=o,!0):Fe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=o,!0)},has({_:{data:e,setupState:t,accessCache:o,ctx:i,appContext:s,props:r,type:a}},u){let p;return!!(o[u]||e!==Ge&&u[0]!=="$"&&Fe(e,u)||lr(t,u)||Fe(r,u)||Fe(i,u)||Fe(ts,u)||Fe(s.config.globalProperties,u)||(p=a.__cssModules)&&p[u])},defineProperty(e,t,o){return o.get!=null?e._.accessCache[t]=0:Fe(o,"value")&&this.set(e,t,o.value,null),Reflect.defineProperty(e,t,o)}};function nl(e){return Se(e)?e.reduce((t,o)=>(t[o]=null,t),{}):e}var fr=!0;function af(e){let t=br(e),o=e.proxy,i=e.ctx;fr=!1,t.beforeCreate&&ol(t.beforeCreate,e,"bc");let{data:s,computed:r,methods:a,watch:u,provide:p,inject:v,created:h,beforeMount:g,mounted:m,beforeUpdate:k,updated:T,activated:w,deactivated:b,beforeDestroy:E,beforeUnmount:N,destroyed:O,unmounted:q,render:M,renderTracked:G,renderTriggered:de,errorCaptured:re,serverPrefetch:D,expose:X,inheritAttrs:le,components:Ee,directives:ae,filters:he}=t;if(v&&lf(v,i,null),a)for(let Ne in a){let Re=a[Ne];Te(Re)&&(i[Ne]=Re.bind(o))}if(s){let Ne=s.call(o,o);He(Ne)&&(e.data=et(Ne))}if(fr=!0,r)for(let Ne in r){let Re=r[Ne],Qe=Te(Re)?Re.bind(o,o):Te(Re.get)?Re.get.bind(o,o):St,Ke=!Te(Re)&&Te(Re.set)?Re.set.bind(o):St,rt=yt({get:Qe,set:Ke});Object.defineProperty(i,Ne,{enumerable:!0,configurable:!0,get:()=>rt.value,set:Ze=>rt.value=Ze})}if(u)for(let Ne in u)_l(u[Ne],i,o,Ne);if(p){let Ne=Te(p)?p.call(o):p;Reflect.ownKeys(Ne).forEach(Re=>{Gn(Re,Ne[Re])})}h&&ol(h,e,"c");function Pe(Ne,Re){Se(Re)?Re.forEach(Qe=>Ne(Qe.bind(o))):Re&&Ne(Re.bind(o))}if(Pe(Zp,g),Pe(on,m),Pe(Dl,k),Pe(Al,T),Pe(Sl,w),Pe(Nl,b),Pe(nf,re),Pe(tf,G),Pe(ef,de),Pe(Wn,N),Pe(cs,q),Pe(xp,D),Se(X))if(X.length){let Ne=e.exposed||(e.exposed={});X.forEach(Re=>{Object.defineProperty(Ne,Re,{get:()=>o[Re],set:Qe=>o[Re]=Qe,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===St&&(e.render=M),le!=null&&(e.inheritAttrs=le),Ee&&(e.components=Ee),ae&&(e.directives=ae),D&&yr(e)}function lf(e,t,o=St){Se(e)&&(e=hr(e));for(let i in e){let s=e[i],r;He(s)?"default"in s?r=Dt(s.from||i,s.default,!0):r=Dt(s.from||i):r=Dt(s),ht(r)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:a=>r.value=a}):t[i]=r}}function ol(e,t,o){$t(Se(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,o)}function _l(e,t,o,i){let s=i.includes(".")?kl(o,i):()=>o[i];if(xe(e)){let r=t[e];Te(r)&&tt(s,r)}else if(Te(e))tt(s,e.bind(o));else if(He(e))if(Se(e))e.forEach(r=>_l(r,t,o,i));else{let r=Te(e.handler)?e.handler.bind(o):t[e.handler];Te(r)&&tt(s,r,e)}}function br(e){let t=e.type,{mixins:o,extends:i}=t,{mixins:s,optionsCache:r,config:{optionMergeStrategies:a}}=e.appContext,u=r.get(t),p;return u?p=u:!s.length&&!o&&!i?p=t:(p={},s.length&&s.forEach(v=>ti(p,v,a,!0)),ti(p,t,a)),He(t)&&r.set(t,p),p}function ti(e,t,o,i=!1){let{mixins:s,extends:r}=t;r&&ti(e,r,o,!0),s&&s.forEach(a=>ti(e,a,o,!0));for(let a in t)if(!(i&&a==="expose")){let u=df[a]||o&&o[a];e[a]=u?u(e[a],t[a]):t[a]}return e}var df={data:sl,props:il,emits:il,methods:Zo,computed:Zo,beforeCreate:kt,created:kt,beforeMount:kt,mounted:kt,beforeUpdate:kt,updated:kt,beforeDestroy:kt,beforeUnmount:kt,destroyed:kt,unmounted:kt,activated:kt,deactivated:kt,errorCaptured:kt,serverPrefetch:kt,components:Zo,directives:Zo,watch:cf,provide:sl,inject:uf};function sl(e,t){return t?e?function(){return it(Te(e)?e.call(this,this):e,Te(t)?t.call(this,this):t)}:t:e}function uf(e,t){return Zo(hr(e),hr(t))}function hr(e){if(Se(e)){let t={};for(let o=0;ot==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${dt(t)}Modifiers`]||e[`${Xt(t)}Modifiers`];function mf(e,t,...o){if(e.isUnmounted)return;let i=e.vnode.props||Ge,s=o,r=t.startsWith("update:"),a=r&&hf(i,t.slice(7));a&&(a.trim&&(s=o.map(h=>xe(h)?h.trim():h)),a.number&&(s=s.map(fo)));let u,p=i[u=Lo(t)]||i[u=Lo(dt(t))];!p&&r&&(p=i[u=Lo(Xt(t))]),p&&$t(p,e,6,s);let v=i[u+"Once"];if(v){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,$t(v,e,6,s)}}var gf=new WeakMap;function Il(e,t,o=!1){let i=o?gf:t.emitsCache,s=i.get(e);if(s!==void 0)return s;let r=e.emits,a={},u=!1;if(!Te(e)){let p=v=>{let h=Il(v,t,!0);h&&(u=!0,it(a,h))};!o&&t.mixins.length&&t.mixins.forEach(p),e.extends&&p(e.extends),e.mixins&&e.mixins.forEach(p)}return!r&&!u?(He(e)&&i.set(e,null),null):(Se(r)?r.forEach(p=>a[p]=null):it(a,r),He(e)&&i.set(e,a),a)}function li(e,t){return!e||!lo(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Fe(e,t[0].toLowerCase()+t.slice(1))||Fe(e,Xt(t))||Fe(e,t))}function dr(e){let{type:t,vnode:o,proxy:i,withProxy:s,propsOptions:[r],slots:a,attrs:u,emit:p,render:v,renderCache:h,props:g,data:m,setupState:k,ctx:T,inheritAttrs:w}=e,b=xs(e),E,N;try{if(o.shapeFlag&4){let M=s||i,G=M;E=nn(v.call(G,M,h,g,k,m,T)),N=u}else{let M=t;E=nn(M.length>1?M(g,{attrs:u,slots:a,emit:p}):M(g,null)),N=t.props?u:vf(u)}}catch(M){jn.length=0,ds(M,e,1),E=Ue(Gt)}let O=E,q;if(N&&w!==!1){let M=Object.keys(N),{shapeFlag:G}=O;M.length&&G&7&&(r&&M.some(uo)&&(N=yf(N,r)),O=bo(O,N,!1,!0))}if(o.dirs&&(O=bo(O,null,!1,!0),O.dirs=O.dirs?O.dirs.concat(o.dirs):o.dirs),o.transition){let M=ii(O.type)&&Cl(O)||O;ss(M,o.transition)}return E=O,xs(b),E}function Ml(e,t=!0){let o;for(let i=0;i{let t;for(let o in e)(o==="class"||o==="style"||lo(o))&&((t||(t={}))[o]=e[o]);return t},yf=(e,t)=>{let o={};for(let i in e)(!uo(i)||!(i.slice(9)in t))&&(o[i]=e[i]);return o};function bf(e,t,o){let{props:i,children:s,component:r}=e,{props:a,children:u,patchFlag:p}=t,v=r.emitsOptions;if(t.dirs||t.transition)return!0;if(o&&p>=0){if(p&1024)return!0;if(p&16)return i?rl(i,a,v):!!a;if(p&8){let h=t.dynamicProps;for(let g=0;gObject.create(ql),Ll=e=>Object.getPrototypeOf(e)===ql;function kf(e,t,o,i=!1){let s={},r=$l();e.propsDefaults=Object.create(null),Ul(e,t,s,r);for(let a in e.propsOptions[0])a in s||(s[a]=void 0);o?e.props=i?s:Xo(s):e.type.props?e.props=s:e.props=r,e.attrs=r}function Cf(e,t,o,i){let{props:s,attrs:r,vnode:{patchFlag:a}}=e,u=ze(s),[p]=e.propsOptions,v=!1;if((i||a>0)&&!(a&16)){if(a&8){let h=e.vnode.dynamicProps;for(let g=0;g{p=!0;let[m,k]=Fl(g,t,!0);it(a,m),k&&u.push(...k)};!o&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!r&&!p)return He(e)&&i.set(e,En),En;if(Se(r))for(let h=0;he==="_"||e==="_ctx"||e==="$stable",kr=e=>Se(e)?e.map(nn):[nn(e)],Sf=(e,t,o)=>{if(t._n)return t;let i=jp((...s)=>kr(t(...s)),o);return i._c=!1,i},Bl=(e,t,o)=>{let i=e._ctx;for(let s in e){if(wr(s))continue;let r=e[s];if(Te(r))t[s]=Sf(s,r,i);else if(r!=null){let a=kr(r);t[s]=()=>a}}},zl=(e,t)=>{let o=kr(t);e.slots.default=()=>o},Hl=(e,t,o)=>{for(let i in t)(o||!wr(i))&&(e[i]=t[i])},Nf=(e,t,o)=>{let i=e.slots=$l();if(e.vnode.shapeFlag&32){let s=t._;s?(Hl(i,t,o),o&&Ls(i,"_",s,!0)):Bl(t,i)}else t&&zl(e,t)},Rf=(e,t,o)=>{let{vnode:i,slots:s}=e,r=!0,a=Ge;if(i.shapeFlag&32){let u=t._;u?o&&u===1?r=!1:Hl(s,t,o):(r=!t.$stable,Bl(t,s)),a=t}else t&&(zl(e,t),a={default:1});if(r)for(let u in s)!wr(u)&&a[u]==null&&delete s[u]};function Df(){let e=[]}var Rt=_f;function jl(e){return Af(e)}function Af(e,t){Df();let o=Uo();o.__VUE__=!0;let{insert:i,remove:s,patchProp:r,createElement:a,createText:u,createComment:p,setText:v,setElementText:h,parentNode:g,nextSibling:m,setScopeId:k=St,insertStaticContent:T}=e,w=(C,R,I,W=null,z=null,Y=null,V=void 0,j=null,ee=!!R.dynamicChildren)=>{if(C===R)return;C&&!Qo(C,R)&&(W=x(C),U(C,z,Y,!0),C=null),R.patchFlag===-2&&(ee=!1,R.dynamicChildren=null),R.dynamicChildren&&C&&C.dynamicChildren&&C.dynamicChildren.hasOnce&&(R.dynamicChildren===En&&(R.dynamicChildren=[]),R.dynamicChildren.hasOnce=!0);let{type:K,ref:me,shapeFlag:ne}=R;switch(K){case di:b(C,R,I,W);break;case Gt:E(C,R,I,W);break;case ns:C==null&&N(R,I,W,V);break;case B:ae(C,R,I,W,z,Y,V,j,ee);break;default:ne&1?G(C,R,I,W,z,Y,V,j,ee):ne&6?he(C,R,I,W,z,Y,V,j,ee):(ne&64||ne&128)&&K.process(C,R,I,W,z,Y,V,j,ee,ue)}me!=null&&z?xo(me,C&&C.ref,Y,R||C,!R):me==null&&C&&C.ref!=null&&xo(C.ref,null,Y,C,!0)},b=(C,R,I,W)=>{if(C==null)i(R.el=u(R.children),I,W);else{let z=R.el=C.el;R.children!==C.children&&v(z,R.children)}},E=(C,R,I,W)=>{C==null?i(R.el=p(R.children||""),I,W):R.el=C.el},N=(C,R,I,W)=>{[C.el,C.anchor]=T(C.children,R,I,W,C.el,C.anchor)},O=(C,R,I,W)=>{if(R.children!==C.children){let z=m(C.anchor);M(C),[R.el,R.anchor]=T(R.children,I,z,W)}else R.el=C.el,R.anchor=C.anchor},q=({el:C,anchor:R},I,W)=>{let z;for(;C&&C!==R;)z=m(C),i(C,I,W),C=z;i(R,I,W)},M=({el:C,anchor:R})=>{let I;for(;C&&C!==R;)I=m(C),s(C),C=I;s(R)},G=(C,R,I,W,z,Y,V,j,ee)=>{if(R.type==="svg"?V="svg":R.type==="math"&&(V="mathml"),C==null)de(R,I,W,z,Y,V,j,ee);else{let K=C.el&&C.el._isVueCE?C.el:null;try{K&&K._beginPatch(),X(C,R,z,Y,V,j,ee)}finally{K&&K._endPatch()}}},de=(C,R,I,W,z,Y,V,j)=>{let ee,K,{props:me,shapeFlag:ne,transition:fe,dirs:ye}=C;if(ee=C.el=a(C.type,Y,me&&me.is,me),ne&8?h(ee,C.children):ne&16&&D(C.children,ee,null,W,z,ur(C,Y),V,j),ye&&zn(C,null,W,"created"),re(ee,C,C.scopeId,V,W),me){for(let Le in me)Le!=="value"&&!co(Le)&&r(ee,Le,null,me[Le],Y,W);"value"in me&&r(ee,"value",null,me.value,Y),(K=me.onVnodeBeforeMount)&&en(K,W,C)}ye&&zn(C,null,W,"beforeMount");let Ae=Tf(z,fe);Ae&&fe.beforeEnter(ee),i(ee,R,I),((K=me&&me.onVnodeMounted)||Ae||ye)&&Rt(()=>{let Be;K&&en(K,W,C),Ae&&fe.enter(ee),ye&&zn(C,null,W,"mounted")},z)},re=(C,R,I,W,z)=>{if(I&&k(C,I),W)for(let Y=0;Y{for(let K=ee;K{let j=R.el=C.el,{patchFlag:ee,dynamicChildren:K,dirs:me}=R;ee|=C.patchFlag&16;let ne=C.props||Ge,fe=R.props||Ge,ye;if(I&&Hn(I,!1),(ye=fe.onVnodeBeforeUpdate)&&en(ye,I,R,C),me&&zn(R,C,I,"beforeUpdate"),I&&Hn(I,!0),K&&(!C.dynamicChildren||C.dynamicChildren.length!==K.length)&&(ee=0,V=!1,K=null),(ne.innerHTML&&fe.innerHTML==null||ne.textContent&&fe.textContent==null)&&h(j,""),K?le(C.dynamicChildren,K,j,I,W,ur(R,z),Y):V||Qe(C,R,j,null,I,W,ur(R,z),Y,!1),ee>0){if(ee&16)Ee(j,ne,fe,I,z);else if(ee&2&&ne.class!==fe.class&&r(j,"class",null,fe.class,z),ee&4&&r(j,"style",ne.style,fe.style,z),ee&8){let Ae=R.dynamicProps;for(let Le=0;Le{ye&&en(ye,I,R,C),me&&zn(R,C,I,"updated")},W)},le=(C,R,I,W,z,Y,V)=>{for(let j=0;j{if(R!==I){if(R!==Ge)for(let Y in R)!co(Y)&&!(Y in I)&&r(C,Y,R[Y],null,z,W);for(let Y in I){if(co(Y))continue;let V=I[Y],j=R[Y];V!==j&&Y!=="value"&&r(C,Y,j,V,z,W)}"value"in I&&r(C,"value",R.value,I.value,z)}},ae=(C,R,I,W,z,Y,V,j,ee)=>{let K=R.el=C?C.el:u(""),me=R.anchor=C?C.anchor:u(""),{patchFlag:ne,dynamicChildren:fe,slotScopeIds:ye}=R;ye&&(j=j?j.concat(ye):ye),C==null?(i(K,I,W),i(me,I,W),D(R.children||[],I,me,z,Y,V,j,ee)):ne>0&&ne&64&&fe&&C.dynamicChildren&&C.dynamicChildren.length===fe.length?(le(C.dynamicChildren,fe,I,z,Y,V,j),(R.key!=null||z&&R===z.subTree)&&Gl(C,R,!0)):Qe(C,R,I,me,z,Y,V,j,ee)},he=(C,R,I,W,z,Y,V,j,ee)=>{R.slotScopeIds=j,C==null?R.shapeFlag&512?z.ctx.activate(R,I,W,V,ee):Ce(R,I,W,z,Y,V,ee):Pe(C,R,ee)},Ce=(C,R,I,W,z,Y,V)=>{let j=C.component=$f(C,W,z);if(ri(C)&&(j.ctx.renderer=ue),Lf(j,!1,V),j.asyncDep){if(z&&z.registerDep(j,Ne,V,Y),!C.el){let ee=j.subTree=Ue(Gt);E(null,ee,R,I),C.placeholder=ee.el}}else Ne(j,C,R,I,z,Y,V)},Pe=(C,R,I)=>{let W=R.component=C.component;if(bf(C,R,I))if(W.asyncDep&&!W.asyncResolved){R.el=C.el,R.placeholder=C.placeholder,Re(W,R,I);return}else W.next=R,W.update();else R.el=C.el,R.placeholder=C.placeholder,W.vnode=R},Ne=(C,R,I,W,z,Y,V)=>{let j=()=>{if(C.isMounted){let{next:ne,bu:fe,u:ye,parent:Ae,vnode:Le}=C;{let lt=Wl(C);if(lt){ne&&(ne.el=Le.el,Re(C,ne,V)),lt.asyncDep.then(()=>{Rt(()=>{C.isUnmounted||K()},z)});return}}let Be=ne,st;Hn(C,!1),ne?(ne.el=Le.el,Re(C,ne,V)):ne=Le,fe&&po(fe),(st=ne.props&&ne.props.onVnodeBeforeUpdate)&&en(st,Ae,ne,Le),Hn(C,!0);let Ye=dr(C),bt=C.subTree;C.subTree=Ye,w(bt,Ye,g(bt.el),x(bt),C,z,Y),ne.el=Ye.el,Be===null&&wf(C,Ye.el),ye&&Rt(ye,z),(st=ne.props&&ne.props.onVnodeUpdated)&&Rt(()=>en(st,Ae,ne,Le),z)}else{let ne,{el:fe,props:ye}=R,{bm:Ae,m:Le,parent:Be,root:st,type:Ye}=C,bt=es(R);if(Hn(C,!1),Ae&&po(Ae),!bt&&(ne=ye&&ye.onVnodeBeforeMount)&&en(ne,Be,R),Hn(C,!0),fe&&Oe){let lt=()=>{C.subTree=dr(C),Oe(fe,C.subTree,C,z,null)};bt&&Ye.__asyncHydrate?Ye.__asyncHydrate(fe,C,lt):lt()}else{st.ce&&st.ce._hasShadowRoot()&&st.ce._injectChildStyle(Ye,C.parent?C.parent.type:void 0);let lt=C.subTree=dr(C);w(null,lt,I,W,C,z,Y),R.el=lt.el}if(Le&&Rt(Le,z),!bt&&(ne=ye&&ye.onVnodeMounted)){let lt=R;Rt(()=>en(ne,Be,lt),z)}(R.shapeFlag&256||Be&&es(Be.vnode)&&Be.vnode.shapeFlag&256)&&C.a&&Rt(C.a,z),C.isMounted=!0,R=I=W=null}};C.scope.on();let ee=C.effect=new mo(j);C.scope.off();let K=C.update=ee.run.bind(ee),me=C.job=ee.runIfDirty.bind(ee);me.i=C,me.id=C.uid,ee.scheduler=()=>vr(me),Hn(C,!0),K()},Re=(C,R,I)=>{R.component=C;let W=C.vnode.props;C.vnode=R,C.next=null,Cf(C,R.props,W,I),Rf(C,R.children,I),zt(),gl(C),Ht()},Qe=(C,R,I,W,z,Y,V,j,ee=!1)=>{let K=C&&C.children,me=C?C.shapeFlag:0,ne=R.children,{patchFlag:fe,shapeFlag:ye}=R;if(fe>0){if(fe&128){rt(K,ne,I,W,z,Y,V,j,ee);return}else if(fe&256){Ke(K,ne,I,W,z,Y,V,j,ee);return}}ye&8?(me&16&&L(K,z,Y),ne!==K&&h(I,ne)):me&16?ye&16?rt(K,ne,I,W,z,Y,V,j,ee):L(K,z,Y,!0):(me&8&&h(I,""),ye&16&&D(ne,I,W,z,Y,V,j,ee))},Ke=(C,R,I,W,z,Y,V,j,ee)=>{C=C||En,R=R||En;let K=C.length,me=R.length,ne=Math.min(K,me),fe;for(fe=0;feme?L(C,z,Y,!0,!1,ne):D(R,I,W,z,Y,V,j,ee,ne)},rt=(C,R,I,W,z,Y,V,j,ee)=>{let K=0,me=R.length,ne=C.length-1,fe=me-1;for(;K<=ne&&K<=fe;){let ye=C[K],Ae=R[K]=ee?fn(R[K]):nn(R[K]);if(Qo(ye,Ae))w(ye,Ae,I,null,z,Y,V,j,ee);else break;K++}for(;K<=ne&&K<=fe;){let ye=C[ne],Ae=R[fe]=ee?fn(R[fe]):nn(R[fe]);if(Qo(ye,Ae))w(ye,Ae,I,null,z,Y,V,j,ee);else break;ne--,fe--}if(K>ne){if(K<=fe){let ye=fe+1,Ae=yefe)for(;K<=ne;)U(C[K],z,Y,!0),K++;else{let ye=K,Ae=K,Le=new Map;for(K=Ae;K<=fe;K++){let F=R[K]=ee?fn(R[K]):nn(R[K]);F.key!=null&&Le.set(F.key,K)}let Be,st=0,Ye=fe-Ae+1,bt=!1,lt=0,S=new Array(Ye);for(K=0;K=Ye){U(F,z,Y,!0);continue}let Q;if(F.key!=null)Q=Le.get(F.key);else for(Be=Ae;Be<=fe;Be++)if(S[Be-Ae]===0&&Qo(F,R[Be])){Q=Be;break}Q===void 0?U(F,z,Y,!0):(S[Q-Ae]=K+1,Q>=lt?lt=Q:bt=!0,w(F,R[Q],I,null,z,Y,V,j,ee),st++)}let _=bt?Pf(S):En;for(Be=_.length-1,K=Ye-1;K>=0;K--){let F=Ae+K,Q=R[F],pe=R[F+1],be=F+1{let{el:Y,type:V,transition:j,children:ee,shapeFlag:K}=C;if(K&6){Ze(C.component.subTree,R,I,W);return}if(K&128){C.suspense.move(R,I,W);return}if(K&64){V.move(C,R,I,ue);return}if(V===B){i(Y,R,I);for(let ne=0;nej.enter(Y),z));else{let{leave:ne,delayLeave:fe,afterLeave:ye}=j,Ae=()=>{C.ctx.isUnmounted?s(Y):i(Y,R,I)},Le=()=>{let Be=Y._isLeaving||!!Y[ar];Y._isLeaving&&Y[ar](!0),j.persisted&&!Be?Ae():ne(Y,()=>{Ae(),ye&&ye()})};fe?fe(Y,Ae,Le):Le()}else i(Y,R,I)},U=(C,R,I,W=!1,z=!1)=>{let{type:Y,props:V,ref:j,children:ee,dynamicChildren:K,shapeFlag:me,patchFlag:ne,dirs:fe,cacheIndex:ye,memo:Ae}=C;if((ne===-2||K&&K.hasOnce)&&(z=!1),j!=null&&(zt(),xo(j,null,I,C,!0),Ht()),ye!=null&&(!C.ctx||C.ctx===R)&&(R.renderCache[ye]=void 0),me&256){R.ctx.deactivate(C);return}let Le=me&1&&fe,Be=!es(C),st;if(Be&&(st=V&&V.onVnodeBeforeUnmount)&&en(st,R,C),me&6)te(C.component,I,W);else{if(me&128){C.suspense.unmount(I,W);return}Le&&zn(C,null,R,"beforeUnmount"),me&64?C.type.remove(C,R,I,ue,W):K&&!K.hasOnce&&(Y!==B||ne>0&&ne&64)?L(K,R,I,!1,!0):(Y===B&&ne&384||!z&&me&16)&&L(ee,R,I),W&&oe(C)}let Ye=Ae!=null&&ye==null;(Be&&(st=V&&V.onVnodeUnmounted)||Le||Ye)&&Rt(()=>{st&&en(st,R,C),Le&&zn(C,null,R,"unmounted"),Ye&&(C.el=null)},I)},oe=C=>{let{type:R,el:I,anchor:W,transition:z}=C,Y=R===B;if(Y&&!z){Z(I,W);return}if(R===ns){M(C),z&&!z.persisted&&z.afterLeave&&z.afterLeave();return}let V=Y?cr(C):C,j=()=>{Y?g(I)&&Z(I,W):s(I),z&&!z.persisted&&z.afterLeave&&z.afterLeave()};if(V&&V.shapeFlag&1&&z&&!z.persisted){let{leave:ee,delayLeave:K}=z,me=V.el,ne=()=>ee(me,j);K?K(me,j,ne):ne()}else j()},Z=(C,R)=>{let I;for(;C!==R;)I=m(C),s(C),C=I;s(R)},te=(C,R,I)=>{let{bum:W,scope:z,job:Y,subTree:V,um:j,m:ee,a:K}=C;ll(ee),ll(K),W&&po(W),z.stop(),Y?(Y.flags|=8,U(V,C,R,I)):C.vnode.el&&V&&(V.transition=C.vnode.transition,U(V,C,R,I)),j&&Rt(j,R),Rt(()=>{C.isUnmounted=!0},R)},L=(C,R,I,W=!1,z=!1,Y=0)=>{for(let V=Y;V{if(C.shapeFlag&6)return x(C.component.subTree);if(C.shapeFlag&128)return C.suspense.next();let R=m(C.anchor||C.el),I=R&&R[Yp];return I?m(I):R},H=(C,R,I)=>{let W=C&&R._vnode?void 0:C&&C.component?C.component.uid:qf();Hp(()=>{C==null?R._vnode&&U(R._vnode,null,null,!0):w(R._vnode||null,C,R,null,null,null,I),R._vnode=C},W)},ue={p:w,um:U,m:Ze,r:oe,mt:Ce,mc:D,pc:Qe,pbc:le,n:x,o:e},we,Oe;return t&&([we,Oe]=t(ue)),{render:H,hydrate:we,createApp:ff(H,we)}}function ur({type:e,props:t},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:o}function Hn({effect:e,job:t},o){o?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Tf(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Gl(e,t,o=!1){let i=e.children,s=t.children;if(Se(i)&&Se(s))for(let r=0;r>1,e[o[u]]0&&(t[i]=o[r-1]),o[r]=i)}}for(r=o.length,a=o[r-1];r-- >0;)o[r]=a,a=t[a];return o}function Wl(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Wl(t)}function ll(e){if(e)for(let t=0;te.__isSuspense;function _f(e,t){t&&t.pendingBranch?Se(e)?t.effects.push(...e):t.effects.push(e):ml(e)}var B=Symbol.for("v-fgt"),di=Symbol.for("v-txt"),Gt=Symbol.for("v-cmt"),ns=Symbol.for("v-stc"),jn=[],It=null;function l(e=!1){jn.push(It=e?null:[])}function Yl(){jn.pop(),It=jn[jn.length-1]||null}var is=1;function ni(e,t=!1){is+=e,e<0&&It&&t&&(It.hasOnce=!0)}function Xl(e){return e.dynamicChildren=is>0?It||En:null,Yl(),is>0&&It&&It.push(e),e}function d(e,t,o,i,s,r){return Xl(n(e,t,o,i,s,r,!0))}function sn(e,t,o,i,s){return Xl(Ue(e,t,o,i,s,!0))}function rs(e){return e?e.__v_isVNode===!0:!1}function Qo(e,t){return e.type===t.type&&e.key===t.key}var Jl=({key:e})=>e??null,Qs=({ref:e,ref_key:t,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?xe(e)||ht(e)||Te(e)?{i:Ot,r:e,k:t,f:!!o}:e:null);function n(e,t=null,o=null,i=0,s=null,r=e===B?0:1,a=!1,u=!1){let p={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Jl(t),ref:t&&Qs(t),scopeId:bl,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Ot};return u?(oi(p,o),r&128&&e.normalize(p)):o&&(p.shapeFlag|=xe(o)?8:16),is>0&&!a&&It&&(p.patchFlag>0||r&6)&&p.patchFlag!==32&&It.push(p),p}var Ue=Of;function Of(e,t=null,o=null,i=0,s=null,r=!1){if((!e||e===sf)&&(e=Gt),rs(e)){let u=bo(e,t,!0);return o&&oi(u,o),is>0&&!r&&It&&(u.shapeFlag&6?It[It.indexOf(e)]=u:It.push(u)),u.patchFlag=-2,u}if(Hf(e)&&(e=e.__vccOpts),t){t=If(t);let{class:u,style:p}=t;u&&!xe(u)&&(t.class=P(u)),He(p)&&(Jo(p)&&!Se(p)&&(p=it({},p)),t.style=$e(p))}let a=xe(e)?1:Kl(e)?128:ii(e)?64:He(e)?4:Te(e)?2:0;return n(e,t,o,i,s,a,r,!0)}function If(e){return e?Jo(e)||Ll(e)?it({},e):e:null}function bo(e,t,o=!1,i=!1){let{props:s,ref:r,patchFlag:a,children:u,transition:p}=e,v=t?Mf(s||{},t):s,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:v,key:v&&Jl(v),ref:t&&t.ref?o&&r?Se(r)?r.concat(Qs(t)):[r,Qs(t)]:Qs(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==B?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:p,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&bo(e.ssContent),ssFallback:e.ssFallback&&bo(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return p&&i&&ss(h,p.clone(h)),h}function y(e=" ",t=0){return Ue(di,null,e,t)}function ke(e,t){let o=Ue(ns,null,e);return o.staticCount=t,o}function f(e="",t=!1){return t?(l(),sn(Gt,null,e)):Ue(Gt,null,e)}function nn(e){return e==null||typeof e=="boolean"?Ue(Gt):Se(e)?Ue(B,null,e.slice()):rs(e)?fn(e):Ue(di,null,String(e))}function fn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:bo(e)}function oi(e,t){let o=0,{shapeFlag:i}=e;if(t==null)t=null;else if(Se(t))o=16;else if(typeof t=="object")if(i&65){let s=t.default;s&&(s._c&&(s._d=!1),oi(e,s()),s._c&&(s._d=!0));return}else{o=32;let s=t._;!s&&!Ll(t)?t._ctx=Ot:s===3&&Ot&&(Ot.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Te(t)){if(i&65){oi(e,{default:t});return}t={default:t,_ctx:Ot},o=32}else t=String(t),i&64?(o=16,t=[y(t)]):o=8;e.children=t,e.shapeFlag|=o}function Mf(...e){let t={};for(let o=0;ovt||Ot,si,as;{let e=Uo(),t=(o,i)=>{let s;return(s=e[o])||(s=e[o]=[]),s.push(i),r=>{s.length>1?s.forEach(a=>a(r)):s[0](r)}};si=t("__VUE_INSTANCE_SETTERS__",o=>vt=o),as=t("__VUE_SSR_SETTERS__",o=>wo=o)}var ps=e=>{let t=vt;return si(e),e.scope.on(),()=>{e.scope.off(),si(t)}},dl=()=>{vt&&vt.scope.off(),si(null)};function Zl(e){return e.vnode.shapeFlag&4}var wo=!1;function Lf(e,t=!1,o=!1){t&&as(t);let{props:i,children:s}=e.vnode,r=Zl(e);kf(e,i,r,t),Nf(e,s,o||t);let a=r?Uf(e,t):void 0;return t&&as(!1),a}function Uf(e,t){let o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,rf);let{setup:i}=o;if(i){zt();let s=e.setupContext=i.length>1?Bf(e):null,r=ps(e),a=ls(i,e,0,[e.props,s]),u=zi(a);if(Ht(),r(),(u||e.sp)&&!es(e)&&yr(e),u){if(a.then(dl,dl),t)return a.then(p=>{as(!0);try{ul(e,p,t)}finally{as(!1)}}).catch(p=>{ds(p,e,0)});e.asyncDep=a}else ul(e,a,t)}else xl(e,t)}function ul(e,t,o){Te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:He(t)&&(e.setupState=Xs(t)),xl(e,o)}var cl,pl;function xl(e,t,o){let i=e.type;if(!e.render){if(!t&&cl&&!i.render){let s=i.template||br(e).template;if(s){let{isCustomElement:r,compilerOptions:a}=e.appContext.config,{delimiters:u,compilerOptions:p}=i,v=it(it({isCustomElement:r,delimiters:u},a),p);i.render=cl(s,v)}}e.render=i.render||St,pl&&pl(e)}{let s=ps(e);zt();try{af(e)}finally{Ht(),s()}}}var Ff={get(e,t){return mt(e,"get",""),e[t]}};function Bf(e){let t=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,Ff),slots:e.slots,emit:e.emit,expose:t}}function ui(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Xs(go(e.exposed)),{get(t,o){if(o in t)return t[o];if(o in ts)return ts[o](e)},has(t,o){return o in t||o in ts}})):e.proxy}function zf(e,t=!0){return Te(e)?e.displayName||e.name:e.name||t&&e.__name}function Hf(e){return Te(e)&&"__vccOpts"in e}var yt=(e,t)=>Xa(e,t,wo);function _e(e,t,o){try{ni(-1);let i=arguments.length;return i===2?He(t)&&!Se(t)?rs(t)?Ue(e,null,[t]):Ue(e,t):Ue(e,null,t):(i>3?o=Array.prototype.slice.call(arguments,2):i===3&&rs(o)&&(o=[o]),Ue(e,t,o))}finally{ni(1)}}var jf="3.5.44";var Rr,ed=typeof window<"u"&&window.trustedTypes;if(ed)try{Rr=ed.createPolicy("vue",{createHTML:e=>e})}catch{}var pd=Rr?e=>Rr.createHTML(e):e=>e,Gf="http://www.w3.org/2000/svg",Wf="http://www.w3.org/1998/Math/MathML",mn=typeof document<"u"?document:null,td=mn&&mn.createElement("template"),Kf={insert:(e,t,o)=>{t.insertBefore(e,o||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,o,i)=>{let s=t==="svg"?mn.createElementNS(Gf,e):t==="mathml"?mn.createElementNS(Wf,e):o?mn.createElement(e,{is:o}):mn.createElement(e);return e==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:e=>mn.createTextNode(e),createComment:e=>mn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>mn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,o,i,s,r){let a=o?o.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),o),!(s===r||!(s=s.nextSibling)););else{td.innerHTML=pd(i==="svg"?`${e}`:i==="mathml"?`${e}`:e);let u=td.content;if(i==="svg"||i==="mathml"){let p=u.firstChild;for(;p.firstChild;)u.appendChild(p.firstChild);u.removeChild(p)}t.insertBefore(u,o)}return[a?a.nextSibling:t.firstChild,o?o.previousSibling:t.lastChild]}};var Yf=Symbol("_vtc");function Xf(e,t,o){let i=e[Yf];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):o?e.setAttribute("class",t):e.className=t}var fi=Symbol("_vod"),fd=Symbol("_vsh"),J={name:"show",beforeMount(e,{value:t},{transition:o}){e[fi]=e.style.display==="none"?"":e.style.display,o&&t?o.beforeEnter(e):fs(e,t)},mounted(e,{value:t},{transition:o}){o&&t&&o.enter(e)},updated(e,{value:t,oldValue:o},{transition:i}){!t!=!o&&(i?t?(i.beforeEnter(e),fs(e,!0),i.enter(e)):i.leave(e,()=>{fs(e,!1)}):fs(e,t))},beforeUnmount(e,{value:t}){fs(e,t)}};function fs(e,t){e.style.display=t?e[fi]:"none",e[fd]=!t}var Jf=Symbol("");var Qf=/(?:^|;)\s*display\s*:/;function Zf(e,t,o){let i=e.style,s=xe(o),r=!1;if(o&&!s){if(t)if(xe(t))for(let a of t.split(";")){let u=a.slice(0,a.indexOf(":")).trim();o[u]==null&&hs(i,u,"")}else for(let a in t)o[a]==null&&hs(i,a,"");for(let a in o){a==="display"&&(r=!0);let u=o[a];u!=null?eh(e,a,!xe(t)&&t?t[a]:void 0,u)||hs(i,a,u):hs(i,a,"")}}else if(s){if(t!==o){let a=i[Jf];a&&(o+=";"+a),i.cssText=o,r=Qf.test(o)}}else t&&e.removeAttribute("style");fi in e&&((!s||t!==o)&&(e[fi]=r?i.display:""),e[fd]&&(i.display="none"))}var ci=/\s*!important$/;function hs(e,t,o){if(Se(o))o.forEach(i=>hs(e,t,i));else if(o==null&&(o=""),t.startsWith("--"))ci.test(o)?e.setProperty(t,o.replace(ci,""),"important"):e.setProperty(t,o);else{let i=xf(e,t);ci.test(o)?e.setProperty(Xt(i),o.replace(ci,""),"important"):e[i]=o}}var nd=["Webkit","Moz","ms"],Er={};function xf(e,t){let o=Er[t];if(o)return o;let i=dt(t);if(i!=="filter"&&i in e)return Er[t]=i;i=Un(i);for(let s=0;sSr||(rh.then(()=>Sr=0),Sr=Date.now());function lh(e,t){let o=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=o.attached)return;let s=o.value;if(Se(s)){let r=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{r.call(i),i._stopped=!0};let a=s.slice(),u=[i];for(let p=0;pe.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,dh=(e,t,o,i,s,r)=>{let a=s==="svg";t==="class"?Xf(e,i,a):t==="style"?Zf(e,o,i):lo(t)?uo(t)||nh(e,t,o,i,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):uh(e,t,i,a))?(id(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&sd(e,t,i,a,r,t!=="value")):e._isVueCE&&(ch(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!xe(i)))?id(e,dt(t),i,r,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),sd(e,t,i,a))};function uh(e,t,o,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&ad(t)&&Te(o));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){let s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return ad(t)&&xe(o)?!1:t in e}function ch(e,t){let o=e._def.props;if(!o)return!1;let i=dt(t);return Array.isArray(o)?o.some(s=>dt(s)===i):Object.keys(o).some(s=>dt(s)===i)}var ko=e=>{let t=e.props["onUpdate:modelValue"]||!1;return Se(t)?o=>po(t,o):t};function ph(e){e.target.composing=!0}function ld(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}var rn=Symbol("_assign"),pi=Symbol("_initialValue");function Nr(e,t,o){return t&&(e=e.trim()),o&&(e=fo(e)),e}var ct={created(e,{modifiers:{lazy:t,trim:o,number:i}},s){e.parentNode&&(e.type==="text"?e[pi]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[pi]=e.defaultValue.replace(/\r\n?/g,` `))),e[rn]=ko(s);let r=i||s.props&&s.props.type==="number";Nn(e,t?"change":"input",a=>{a.target.composing||e[rn](Nr(e.value,o,r))}),(o||r)&&Nn(e,"change",()=>{e.value=Nr(e.value,o,r)}),t||(Nn(e,"compositionstart",ph),Nn(e,"compositionend",ld),Nn(e,"change",ld))},mounted(e,{value:t,modifiers:{trim:o,number:i}}){let s=t??"",r=e[pi];delete e[pi],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[rn](Nr(e.value,o,i)):e.value=s},beforeUpdate(e,{value:t,oldValue:o,modifiers:{lazy:i,trim:s,number:r}},a){if(e[rn]=ko(a),e.composing)return;let u=(r||e.type==="number")&&!/^0\d/.test(e.value)?fo(e.value):e.value,p=t??"";if(u===p)return;let v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(i&&t===o||s&&e.value.trim()===p)||(e.value=p)}},Dr={deep:!0,created(e,t,o){e[rn]=ko(o),Nn(e,"change",()=>{let i=e._modelValue,s=ms(e),r=e.checked,a=e[rn];if(Se(i)){let u=Fs(i,s),p=u!==-1;if(r&&!p)a(i.concat(s));else if(!r&&p){let v=[...i];v.splice(u,1),a(v)}}else if(Ut(i)){let u=new Set(i);r?u.add(s):u.delete(s),a(u)}else a(hd(e,r))})},mounted:dd,beforeUpdate(e,t,o){e[rn]=ko(o),dd(e,t,o)}};function dd(e,{value:t,oldValue:o},i){e._modelValue=t;let s;if(Se(t))s=Fs(t,i.props.value)>-1;else if(Ut(t))s=t.has(i.props.value);else{if(t===o)return;s=Ft(t,hd(e,!0))}e.checked!==s&&(e.checked=s)}var gn={deep:!0,created(e,{value:t,modifiers:{number:o}},i){e._modelValue=t,Nn(e,"change",()=>{let s=Array.prototype.filter.call(e.options,p=>p.selected).map(p=>o?fo(ms(p)):ms(p)),r=e.multiple,a=r?Ut(e._modelValue)?new Set(s):s:s[0],u=e._pendingValue=[r,r?Se(a)?s.slice():s:a];try{e[rn](a)}finally{nt(()=>{e._pendingValue===u&&(e._pendingValue=void 0)})}}),e[rn]=ko(i)},mounted(e,{value:t}){ud(e,t)},beforeUpdate(e,{value:t},o){e._modelValue=t,e[rn]=ko(o)},updated(e,{value:t}){let o=e._pendingValue;e._pendingValue=void 0,(!o||o[0]!==e.multiple||!fh(t,o[1],o[0]))&&ud(e,t)}};function fh(e,t,o){if(!o)return Ft(e,t);if(Se(e))return Ft(e,t);if(Ut(e)){if(e.size!==t.length)return!1;for(let i of t)if(!e.has(i))return!1;return!0}return!1}function ud(e,t){let o=e.multiple,i=Se(t);if(!(o&&!i&&!Ut(t))){for(let s=0,r=e.options.length;sString(v)===String(u)):a.selected=Fs(t,u)>-1}else a.selected=t.has(u);else if(Ft(ms(a),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ms(e){return"_value"in e?e._value:e.value}function hd(e,t){let o=t?"_trueValue":"_falseValue";return o in e?e[o]:t}var hh=["ctrl","shift","alt","meta"],mh={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>hh.some(o=>e[`${o}Key`]&&!t.includes(o))},ce=(e,t)=>{if(!e)return e;let o=e._withMods||(e._withMods={}),i=t.join(".");return o[i]||(o[i]=((s,...r)=>{for(let a=0;a{let o=e._withKeys||(e._withKeys={}),i=t.join(".");return o[i]||(o[i]=(s=>{if(!("key"in s))return;let r=Xt(s.key);if(t.some(a=>a===r||gh[a]===r))return e(s)}))},vh=it({patchProp:dh},Kf),cd;function yh(){return cd||(cd=jl(vh))}var md=((...e)=>{let t=yh().createApp(...e),{mount:o}=t;return t.mount=i=>{let s=wh(i);if(!s)return;let r=t._component;!Te(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");let a=o(s,!1,bh(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),a},t});function bh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function wh(e){return xe(e)?document.querySelector(e):e}var Xn=typeof document<"u";function vd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function kh(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&vd(e.default)}var je=Object.assign;function hi(e,t){let o={};for(let i in t){let s=t[i];o[i]=Lt(s)?s.map(e):e(s)}return o}var Eo=()=>{},Lt=Array.isArray;function Pr(e,t){let o={};for(let i in e)o[i]=i in t?t[i]:e[i];return o}var yd=/#/g,Ch=/&/g,Eh=/\//g,Sh=/=/g,Nh=/\?/g,bd=/\+/g,Rh=/%5B/g,Dh=/%5D/g,wd=/%5E/g,Ah=/%60/g,kd=/%7B/g,Th=/%7C/g,Cd=/%7D/g,Ph=/%20/g;function _r(e){return e==null?"":encodeURI(""+e).replace(Th,"|").replace(Rh,"[").replace(Dh,"]")}function Ed(e){return _r(e).replace(kd,"{").replace(Cd,"}").replace(wd,"^")}function Ar(e){return _r(e).replace(bd,"%2B").replace(Ph,"+").replace(yd,"%23").replace(Ch,"%26").replace(Ah,"`").replace(kd,"{").replace(Cd,"}").replace(wd,"^")}function _h(e){return Ar(e).replace(Sh,"%3D")}function Oh(e){return _r(e).replace(yd,"%23").replace(Nh,"%3F")}function Sd(e){return Oh(e).replace(Eh,"%2F")}function Co(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var Ih=/\/$/,Mh=e=>e.replace(Ih,"");function mi(e,t,o="/"){let i,s={},r="",a="",u=t.indexOf("#"),p=t.indexOf("?");return p=u>=0&&p>u?-1:p,p>=0&&(i=t.slice(0,p),r=t.slice(p,u>0?u:t.length),s=e(r.slice(1))),u>=0&&(i=i||t.slice(0,u),a=t.slice(u,t.length)),i=qh(i??t,o),{fullPath:i+r+a,path:i,query:s,hash:Co(a)}}function Nd(e,t){let o=t.query?e(t.query):"";return t.path+(o&&"?")+o+(t.hash||"")}function Or(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Rd(e,t,o){let i=t.matched.length-1,s=o.matched.length-1;return i>-1&&i===s&&Kn(t.matched[i],o.matched[s])&&Ir(t.params,o.params)&&e(t.query)===e(o.query)&&t.hash===o.hash}function Kn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ir(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var o in e)if(!Vh(e[o],t[o]))return!1;return!0}function Vh(e,t){return Lt(e)?gd(e,t):Lt(t)?gd(t,e):e?.valueOf()===t?.valueOf()}function gd(e,t){return Lt(t)?e.length===t.length&&e.every((o,i)=>o===t[i]):e.length===1&&e[0]===t}function qh(e,t){if(e.startsWith("/"))return e;if(!e)return t;let o=t.split("/"),i=e.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=o.length-1,a,u;for(a=0;a1&&r--;else break;return o.slice(0,r).join("/")+"/"+i.slice(a).join("/")}var yn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},gi=(function(e){return e.pop="pop",e.push="push",e})({}),vi=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Dd(e){if(!e)if(Xn){let t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Mh(e)}var $h=/^[^#]+#/;function Ad(e,t){return e.replace($h,"#")+t}function Lh(e,t){let o=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect();return{behavior:t.behavior,left:i.left-o.left-(t.left||0),top:i.top-o.top-(t.top||0)}}var gs=()=>({left:window.scrollX,top:window.scrollY});function Td(e){let t;if("el"in e){let o=e.el,i=typeof o=="string"&&o.startsWith("#"),s=typeof o=="string"?i?document.getElementById(o.slice(1)):document.querySelector(o):o;if(!s)return;t=Lh(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Mr(e,t){return(history.state?history.state.position-t:-1)+e}var Tr=new Map;function Pd(e,t){Tr.set(e,t)}function _d(e){let t=Tr.get(e);return Tr.delete(e),t}function Uh(e){return typeof e=="string"||e&&typeof e=="object"}function Vr(e){return typeof e=="string"||typeof e=="symbol"}var ot=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({}),Od=Symbol("");var cG={[ot.MATCHER_NOT_FOUND]({location:e,currentLocation:t}){return`No match for ${JSON.stringify(e)}${t?` while being at @@ -11,7 +11,7 @@ while being at `).map(k=>k.trim()).filter(k=>k.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",m).then(()=>{u.accept(g),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",v&&i.cancel(v),v=i(()=>{e.message=null},2500)},k=>{e.saving=!1;let T=k&&k.data&&k.data.error,w="Unable to save your defaults. Please try again.";Promise.all([o("ERRORS."+T),o("ERRORS.unknown_error")]).then(([b,E])=>{e.error=T&&b!==E?b:w},()=>{e.error=w})})},e.deleteAccount=()=>{e.deletingAccount||!e.confirmDeleteAccount||e.deleteUsername!==e.user?.username||(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},Gu=function(e,t,o){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(i=>{o.url("/dashboard")},i=>{e.error=i.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},Wu=function(e,t,o,i,s){e.user&&!e.user.status&&o.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&o.url("/dashboard")}),e.features=[{key:"anonymize",num:"01",eyebrow:"Anonymize",title:"Double-anonymous,",accent:"your rules.",text:"Choose what reviewers may see: links, images, PDFs, notebooks, GitHub Pages. Add your own terms, with regex if you need it, and pick the expiration date.",cta:"Start an anonymization",href:"/anonymize",url:"anonymous.4open.science/anonymize",img:"/imgs/anonymize.png",alt:"The anonymize form: source repository, terms to redact, options and a live README preview"},{key:"review",num:"02",eyebrow:"Review",title:"Reviewers browse",accent:"the real thing.",text:"Highlighted source code, rendered PDFs, images, and notebooks, in a familiar file explorer. GitHub Pages is also supported.",cta:"Open the example",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/",target:"_self",url:"anonymous.4open.science/r/840c8c57-\u2026",img:"/imgs/explorer.png",alt:"The repository explorer with a file tree and a rendered README"},{key:"manage",num:"03",eyebrow:"Manage",title:"One dashboard,",accent:"until the decision.",text:"Monitor views, edit configuration, remove or update your repository. Program chairs can group submissions under a conference with one shared expiry.",cta:"Open the dashboard",href:"/dashboard",needsUser:!0,url:"anonymous.4open.science/dashboard",img:"/imgs/dashboard.png",alt:"The dashboard listing anonymized repositories with status, views and expiry"}],e.feature=e.features[0].key,e.selectFeature=function(u){e.feature=u},e.featureHref=function(u){return u.needsUser&&!e.user?"/signin":u.href},e.featureTarget=function(u){return u.needsUser&&!e.user?"_self":u.target||void 0},e.featureKeydown=function(u,p){let v={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[u.key];if(v===void 0)return;u.preventDefault();let h=e.features.length,g=v==="first"?0:v==="last"?h-1:(p+v+h)%h;e.feature=e.features[g].key,s(()=>{let m=i.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.demoText=`# DeepLearnUtils Developed by Jane Smith at MIT CSAIL. See Smith et al., "Attention That Works," 2026. -Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let u=(e.demoTerms||"").split(/[,\n]/).map(m=>m.trim()).filter(Boolean).sort((m,k)=>k.length-m.length),p=m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!u.length)return[{text:e.demoText}];let v=new RegExp("("+u.map(p).join("|")+")","gi"),h={},g=0;return(e.demoText||"").split(v).filter(m=>m!=="").map(m=>{let k=u.find(T=>T.toLowerCase()===m.toLowerCase());return k?(h[k.toLowerCase()]||(h[k.toLowerCase()]=++g),{text:String(h[k.toLowerCase()]),redacted:!0,original:m}):{text:m}})},e.demoCount=()=>e.demoParts().filter(u=>u.redacted).length,e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}];function r(){t.get("/api/stat/").then(u=>{e.stat=u.data,e.cards[0].total=u.data.nbRepositories,e.cards[1].total=u.data.nbUsers,e.cards[2].total=u.data.nbPageViews,e.cards[3].total=u.data.nbPullRequests}).catch(()=>{})}r();function a(u){let p={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return p;let v=new Array(u.length-1);for(let w=1;w=2){let w=v[h-2];w&&(p.pctChange=(p.deltaToday-w)/w*100)}return p.pctAbs=Math.round(Math.abs(p.pctChange)),p.isUp=p.pctChange>=0,p}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let p=u.data||[];e.history={repositories:a(p.map(v=>v.nbRepositories||0)),users:a(p.map(v=>v.nbUsers||0)),pageViews:a(p.map(v=>v.nbPageViews||0)),pullRequests:a(p.map(v=>v.nbPullRequests||0))}}).catch(()=>{})},Ku=function(e,t,o,i,s,r){let a=Tt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,nt(()=>document.querySelector(".dashboard-quota > summary")?.focus())},bn()(document,"click",D=>{e.quotaExpanded&&!D.target.closest?.(".dashboard-quota")&&(e.quotaExpanded=!1)}),e.filtersExpanded=!1,e.projectView="all",e.selectedProject=null,e.projectName="",e.nameSaving=!1,e.nameError="",e.nameMessage="",e.needsAttention=D=>D.status==="error"||D._broken||p(D.status)==="progress"&&D._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=D=>{e.projectView=D,D==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.projectDetailsId=D=>"project-details-"+encodeURIComponent(D._type+":"+(D._id||D._source||"unknown")),e.showProjectDetails=async D=>{e.selectedProject=D,e.projectName=D.projectName||"",e.nameError="",e.nameMessage="",await nt();let X=document.getElementById(e.projectDetailsId(D));X?.focus(),X?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=D=>{e.selectedProject=null,nt(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(D._type+":"+D._id)}"]`)?.focus())},e.saveProjectName=async D=>{if(e.nameSaving||!D._id)return;let X=e.projectName.trim();if(X.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let le=await t.post("/api/user/project-name",{type:D._type,id:D._id,name:X});D.projectName=le.data.name,D._label=D.projectName||D._fallbackLabel,e.selectedProject===D&&(e.nameMessage=X?"Project name saved.":"Default project name restored."),N||(e.dashboardCursor=null,await q(),e.selectedProject===D&&(e.selectedProject=e.items.find(Ee=>Ee._type===D._type&&Ee._id===D._id)||null))}catch{e.selectedProject===D&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async D=>{if(!D._viewUrl||e.copyingId)return;let X=new URL(D._viewUrl,s.location.origin).href;e.copyingId=D._type+":"+D._id;try{await Bu(X),e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:X})}finally{e.copyingId=null}},e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"In progress",error:"Error",expired:"Expired",removed:"Removed"};let u=["queue","download","downloaded","preparing","anonymizing"];function p(D){return D==="ready"||D==="error"?D:D==="expired"||D==="expiring"?"expired":D==="removed"||D==="removing"?"removed":(u.indexOf(D)>-1,"progress")}let v=7200*1e3,h="dashboard.filterPrefs",g={typeFilter:"all",filters:{status:{ready:!0,progress:!0,error:!0,expired:!0,removed:!1}},orderBy:"-anonymizeDate"},m=loadFilterPrefs(h)||{};e.typeFilter=m.typeFilter||g.typeFilter,e.filters={status:Object.assign({},g.filters.status,m.filters&&m.filters.status||{})},e.orderBy=m.orderBy||g.orderBy;let k={_name:{label:"Anonymous ID",defaultDesc:!1},_label:{label:"Project",defaultDesc:!1},anonymizeDate:{label:"Anonymize date",defaultDesc:!0},status:{label:"Status",defaultDesc:!1},lastView:{label:"Last view",defaultDesc:!0},pageView:{label:"Views",defaultDesc:!0},"options.expirationDate":{label:"Expiration",defaultDesc:!1}};e.sortFields=k,e.sortField=()=>e.orderBy.replace(/^-/,""),e.sortDesc=()=>e.orderBy.charAt(0)==="-",e.sortLabel=()=>{let D=k[e.sortField()];return D?D.label:"Custom"},e.isSortedBy=D=>e.sortField()===D,e.setSort=(D,X)=>{typeof X!="boolean"&&(X=e.isSortedBy(D)?!e.sortDesc():!!(k[D]&&k[D].defaultDesc)),e.orderBy=(X?"-":"")+D},e.toggleSortDirection=()=>{e.setSort(e.sortField(),!e.sortDesc())},e.watchGroup(["typeFilter","orderBy"],()=>{saveFilterPrefs(h,{typeFilter:e.typeFilter,filters:e.filters,orderBy:e.orderBy})}),e.watch("filters",()=>{saveFilterPrefs(h,{typeFilter:e.typeFilter,filters:e.filters,orderBy:e.orderBy})},!0),r.load().then(D=>{e.quota=D},console.error);function T(D,X,le,Ee,ae,he){D.pageView||(D.pageView=0),D.lastView||(D.lastView=""),D.options=D.options||{},D.options.terms=(D.options.terms||[]).filter(Pe=>Pe),D._id=X||"",D._source=Ee,D._broken=!X,D._name=X||Ee||"(unnamed)",D._fallbackLabel=D._type==="gist"?"Gist "+(X||Ee||"without an ID"):Ee||le||D._name,D._label=D.projectName||D._fallbackLabel,D._editUrl=X?ae:null,D._viewUrl=X?he:null,D._broken&&(D.status="error",D.statusMessage="incomplete_record"),D._statusKey=p(D.status);let Ce=D.anonymizeDate||D.lastView;return D._stale=D._statusKey==="progress"&&!!Ce&&Date.now()-new Date(Ce).getTime()>v,D.status==="expired"||D.status==="expiring"?D._expiry={kind:"expired",date:D.options.expirationDate}:D.status!=="ready"?D._expiry={kind:"none"}:D.options.expirationMode==="never"||!D.options.expirationDate?D._expiry={kind:"never"}:D._expiry={kind:"date",date:D.options.expirationDate},D}function w(D){return t.get(D).then(X=>X.data||[],X=>(console.error(X),[]))}function b(){return e.loading=!0,i.all([w("/api/user/anonymized_repositories"),w("/api/user/anonymized_pull_requests"),w("/api/user/anonymized_gists")]).then(D=>{let X=D[0],le=D[1],Ee=D[2],ae=[];X.forEach(he=>{he._type="repo";let Ce=he.source||{};ae.push(T(he,he.repoId,he.repoId,Ce.fullName,"/anonymize/"+he.repoId,"/r/"+he.repoId+"/"))}),le.forEach(he=>{he._type="pr";let Ce=he.source||{};ae.push(T(he,he.pullRequestId,he.pullRequestId,Ce.repositoryFullName?Ce.repositoryFullName+"#"+Ce.pullRequestId:void 0,"/pull-request-anonymize/"+he.pullRequestId,"/pr/"+he.pullRequestId+"/"))}),Ee.forEach(he=>{he._type="gist";let Ce=he.source||{};ae.push(T(he,he.gistId,he.gistId,Ce.gistId,"/gist-anonymize/"+he.gistId,"/gist/"+he.gistId+"/"))}),e.items=ae,e.loading=!1})}let E=0,N=!1;e.dashboardCursor=null,e.dashboardError="";function O(D){let X=D.source||{};return D._type==="repo"?T(D,D.repoId,D.repoId,X.fullName,"/anonymize/"+D.repoId,"/r/"+D.repoId+"/"):D._type==="pr"?T(D,D.pullRequestId,D.pullRequestId,X.repositoryFullName?X.repositoryFullName+"#"+X.pullRequestId:void 0,"/pull-request-anonymize/"+D.pullRequestId,"/pr/"+D.pullRequestId+"/"):T(D,D.gistId,D.gistId,X.gistId,"/gist-anonymize/"+D.gistId,"/gist/"+D.gistId+"/")}function q(D=!1){if(N)return b();let X=++E;return e.loading=!D,e.loadingMore=D,e.dashboardError="",t.get("/api/user/dashboard",{params:{q:e.search,type:e.typeFilter,sort:e.orderBy,statuses:Object.keys(e.filters.status).filter(le=>e.filters.status[le]!==!1).join(",")||"none",attention:String(e.projectView==="attention"),cursor:D?e.dashboardCursor:void 0}}).then(le=>{if(X===E){if(!Array.isArray(le.data?.items))return N=!0,b();e.items=(D?e.items:[]).concat(le.data.items.map(O)),e.dashboardCursor=le.data.cursor,e.dashboardTotals=le.data}},le=>{if(X===E){if(le.status===404)return N=!0,b();e.dashboardError="Projects could not be loaded. Please try again."}}).finally(()=>{X===E&&(e.loading=!1,e.loadingMore=!1)})}e.loadMoreProjects=()=>q(!0);let M;e.watchGroup(["search","typeFilter","orderBy","projectView"],()=>{N||(M&&a.timeout.cancel(M),M=a.timeout(()=>q(),150))},!1),e.watch("filters",()=>{N||q()},!0,!1),e.on("dispose",()=>{E++}),q(),e.openItem=(D,X)=>{if(!D._viewUrl)return;let le=X&&X.target;le&&le.closest&&le.closest("a, button, .dropdown, input")||(s.location.href=D._viewUrl)},e.hiddenStatusCount=()=>Object.keys(e.filters.status).filter(D=>e.filters.status[D]===!1).length,e.hasHiddenStatus=()=>e.hiddenStatusCount()>0,e.hasActiveFilters=()=>e.projectView!=="all"||e.typeFilter!=="all"||e.search.trim().length>0||Object.keys(e.filters.status).some(D=>e.filters.status[D]===!1),e.showClearFilters=()=>e.search.trim().length>0||e.typeFilter!=="all"||e.hiddenStatusCount()>1,e.clearFilters=()=>{e.projectView="all",e.typeFilter="all",e.search="",Object.keys(e.filters.status).forEach(D=>{e.filters.status[D]=!0})};function G(D,X,le,Ee){t.get("/api/repo/"+D).then(async ae=>{let he=Ee!==void 0&&Ee!==ae.data.status;for(let Ce of e.items)if(Ce._type==="repo"&&Ce.repoId==D){he=he||Ce.status!==ae.data.status;let Pe=e.needsAttention(Ce);Ce.status=ae.data.status,Ce.statusMessage=ae.data.statusMessage,Ce._statusKey=p(Ce.status),Ce._statusKey!=="progress"&&(Ce._stale=!1);let Ne=e.needsAttention(Ce);e.dashboardTotals&&Pe!==Ne&&(e.dashboardTotals.attention=Math.max(0,e.dashboardTotals.attention+(Ne?1:-1)));break}if(he&&!N){e.dashboardCursor=null;let Ce=e.selectedProject;await q(),Ce&&e.selectedProject===Ce&&(e.selectedProject=e.items.find(Pe=>Pe._type===Ce._type&&Pe._id===Ce._id)||null)}if(ae.data.status=="ready"||ae.data.status=="error"||ae.data.status=="removed"||ae.data.status=="expired"){X(ae.data);return}a.timeout(()=>G(D,X,le,ae.data.status),2500)},le)}let de=D=>D==="repo"?"repository":D==="gist"?"gist":"pull request",re=D=>D==="repo"?"/api/repo":D==="gist"?"/api/gist":"/api/pr";e.removeItem=D=>{let X=de(D._type);if(confirm(`Are you sure that you want to remove the ${X} ${D._id}?`)){let le=et({title:`Removing ${D._id}...`,date:new Date,body:`The ${X} ${D._id} is going to be removed.`});e.addToast(le);let Ee=`${re(D._type)}/${D._id}`;t.delete(Ee).then(()=>{D._type==="repo"?G(D._id,()=>{le.title=`${D._id} is removed.`,le.body=`The ${X} ${D._id} is removed.`},void 0,D.status):(le.title=`${D._id} is removed.`,le.body=`The ${X} ${D._id} is removed.`,q())},ae=>{le.title=`Error during the removal of ${D._id}.`,le.body=ae.body,q()})}},e.refreshItem=D=>{let X=de(D._type),le=et({title:`Refreshing ${D._id}...`,date:new Date,body:`The ${X} ${D._id} is going to be refreshed.`});e.addToast(le);let Ee=he=>{le.title=`Error during the refresh of ${D._id}.`,le.body=he.data?.error||he.body||"The refresh could not be completed. Please try again.",q()},ae=`${re(D._type)}/${D._id}/refresh`;t.post(ae).then(()=>{D._type==="repo"?G(D._id,he=>{if(he.status!=="ready"){Ee({body:he.statusMessage||`The repository is ${he.status}.`});return}le.title=`${D._id} is refreshed.`,le.body=`The ${X} ${D._id} is refreshed.`},Ee,D.status):(le.title=`${D._id} is refreshed.`,le.body=`The ${X} ${D._id} is refreshed.`,q())},Ee)},e.extendItem=D=>{let X=de(D._type),le=et({title:`Extending ${D._id}...`,date:new Date,body:`The expiration of ${X} ${D._id} is being extended.`});e.addToast(le);let Ee=`${re(D._type)}/${D._id}/extend`;t.post(Ee).then(ae=>{let he=ae?.data?.expirationDate?` until ${new Date(ae.data.expirationDate).toLocaleDateString()}`:"";D._type==="repo"?G(D._id,()=>{le.title=`${D._id} is extended.`,le.body=`${X} ${D._id} is extended${he}.`},void 0,D.status):(le.title=`${D._id} is extended.`,le.body=`${X} ${D._id} is extended${he}.`,q())},ae=>{le.title=`Error during the extension of ${D._id}.`;let he=ae.data&&ae.data.error;le.body=he||ae.body,he&&Object.prototype.hasOwnProperty.call(ro.ERRORS,he)&&(le.body=ro.ERRORS[he]),q()})},e.itemFilter=D=>{if(e.projectView==="attention"&&!e.needsAttention(D)||e.typeFilter!=="all"&&D._type!==e.typeFilter||e.filters.status[D._statusKey]===!1)return!1;let X=e.search.trim().toLowerCase();return!!(X.length==0||D._label&&String(D._label).toLowerCase().indexOf(X)>-1||D._source&&String(D._source).toLowerCase().indexOf(X)>-1||D._id&&String(D._id).toLowerCase().indexOf(X)>-1||D.conference&&String(D.conference).toLowerCase().indexOf(X)>-1)}};var Yu=function(e,t,o){let i=Tt();e.repoId=o.repoId,e.reviewUrl=window.location.origin+"/r/"+encodeURIComponent(o.repoId)+"/",e.repo=null,e.progress=0,e.rateLimitResetAt=0,e.rateLimitCountdown="",e.shareUrl=(window.location?.origin||"")+"/r/"+encodeURIComponent(e.repoId)+"/",e.copied=!1;let s=null;e.copyShareUrl=async()=>{try{await Bu(e.shareUrl),e.copied=!0,s&&i.timeout.cancel(s),s=i.timeout(()=>{e.copied=!1},2e3)}catch{e.addToast?.({title:"Copy this anonymous link",body:e.shareUrl})}};var r=null;let a=null,u=!1;function p(h){e.rateLimitResetAt=h,r&&i.interval.cancel(r);function g(){var m=Math.max(0,Math.ceil((h-Date.now())/1e3));if(m<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,i.interval.cancel(r),r=null;else{var k=Math.floor(m/60),T=m%60;e.rateLimitCountdown=k>0?k+"m "+T+"s":T+"s"}}g(),r=i.interval(g,1e3)}e.on("dispose",function(){u=!0,r&&i.interval.cancel(r),a&&i.timeout.cancel(a)});function v(h){if(!h)return h;var g=h.match(/^rate_limited:(\d+)$/);return g?(p(parseInt(g[1],10)),null):(e.rateLimitResetAt=0,h)}e.getStatus=()=>{u||t.get("/api/repo/"+e.repoId,{repoId:e.repoId,repoUrl:e.repoUrl}).then(h=>{if(!u){e.repo=h.data,h.data.rateLimitResetAt?p(h.data.rateLimitResetAt):e.repo.statusMessage=v(e.repo.statusMessage),e.repo.status=="ready"?e.progress=100:e.repo.status=="queue"?e.progress=10:e.repo.status=="downloaded"?e.progress=50:e.repo.status=="download"||e.repo.status=="preparing"?e.progress=25:e.repo.status=="anonymizing"&&(e.progress=75);var g=!["ready","removed","expired"].includes(e.repo.status);e.repo.status=="error"&&!e.rateLimitResetAt&&(g=!1),g&&(a=i.timeout(e.getStatus,2e3))}},h=>{e.error=h.data.error})},e.getStatus()},$i=function(e,t,o,i,s,r,a){Uu(),e.renderRedacted=Lu,e.sourceUrl="",e.workspaceOpen=!1,e.sourceUrlError="",e.previewStatus="idle",e.sourceLoading=!1,e.mobilePane="settings";let u=window.matchMedia?.("(max-width: 767px)");e.mobileWorkspace=!!u?.matches,u?.addEventListener&&bn()(u,"change",S=>{e.mobileWorkspace=S.matches}),e.selectMobilePane=S=>{e.mobilePane=S};let p=0,v=!1,h=new Set,g=(S,_=!1)=>!v&&S.generation===p&&S.url===e.sourceUrl.trim()&&S.connection===e.githubConnection&&(!_||S.branch===e.source.branch),m=()=>{let S={generation:p,url:e.sourceUrl.trim(),connection:e.githubConnection,branch:e.source.branch};return h.add(S),e.sourceLoading=!0,S},k=S=>{h.delete(S),v||(e.sourceLoading=[...h].some(_=>g(_)))};e.on("dispose",()=>{v=!0,p++});let T=null,w=S=>S.gistId&&!S.repo?"gist:"+S.gistId.toLowerCase():(S.owner+"/"+S.repo).toLowerCase()+(S.pullRequestId?"/pull/"+S.pullRequestId:""),b=Fr(e,["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"],"anonymize:"+(s.path?.()||"")),E=null,N=null,O=null;e.hostingReview=!1,e.previewExpanded=!1,e.taskValidationError="",e.editRepository=()=>{e.mobilePane="settings",e.previewExpanded=!1,nt(()=>document.querySelector(".anonymize-fields .is-invalid")?.focus())},e.submitRepository=S=>{if(e.taskValidationError="",!(e.sourceLoading||e.billingBusy||e.hostingSaving||e.billingPending)){if(bt()||e.anonymize?.invalid||e.sourceUrlError){e.taskValidationError="Check the highlighted fields before continuing.",e.editRepository();return}return e.hostingNeedsPayment()?e.checkoutRepository(Ei(e.hostingChoice())?e.hostingChoice():""):e.anonymizeRepo(S)}},e.hostingPayment=!1,e.hostingAlternatives=!1,e.hostingPrice=S=>S.amount==null?"Price shown at checkout":new Intl.NumberFormat(void 0,{style:"currency",currency:S.currency,minimumFractionDigits:0,maximumFractionDigits:2}).format(S.amount/100)+(S.interval==="year"?" billed annually":" billed monthly"),e.hostingPlan="",e.hostingSaving=!1,e.selectedHostingPlan=()=>e.authorPlans().find(S=>S.id===e.hostingPlan)||e.authorPlans()[0];let q=()=>t.get("/api/user/quota").then(S=>{e.hostingQuota=S.data});Ni(e,t,async()=>{await q(),e.hostingQuotaBlocked=!1},{confirmedMessage:"Hosting status refreshed. Your draft is ready to continue."}),q().catch(()=>{}),e.authorPlans=()=>(e.billing?.plans||[]).filter(S=>["author_monthly","author_annual"].includes(S.id)),e.conferenceHosting=()=>!!(e.conference&&e.conference_data?.hosting),e.hasAuthorHosting=()=>["author_monthly","author_annual"].includes(e.billing?.allowance?.plan),e.hostingNeedsPayment=()=>!e.billing?.enabled||e.detectedType!=="repo"||e.hasAuthorHosting()||e.isUpdate&&e.role!=="owner"?!1:!!(e.options?.expirationMode==="never"&&!e._existingNever&&!e.repositoryGrants("repo_never").length||!e.conferenceHosting()&&e.hostingQuotaBlocked),e.repositoryGrants=S=>(e.billing?.grants||[]).filter(_=>_.planId===S&&_.scope===`repo:${e.repoId}`&&["active","paid","past_due"].includes(_.status)&&new Date(_.until).getTime()>Date.now()),e.repositoryAddonPlans=()=>(e.billing?.plans||[]).filter(S=>Ei(S.id)&&(["repo_extend","repo_pack"].includes(S.id)||!e.repositoryGrants(S.id).length)),e.hostingOneTimePlans=()=>{let S=_=>_.map(F=>(e.billing?.plans||[]).find(Q=>Q.id===F&&!e.repositoryGrants(F).length)).filter(Boolean);return e.options?.expirationMode==="never"&&!e._existingNever&&!e.repositoryGrants("repo_never").length?S(["repo_never"]):e.hostingQuotaBlocked&&!e.conferenceHosting()?S(["repo_slot","repo_pack"]):[]},e.hostingOneTime=()=>e.hostingOneTimePlans()[0],e.neverExpireTag=()=>{if(e.hasAuthorHosting())return"Included in your subscription";if(e.repositoryGrants("repo_never").length)return"Paid for this repository";let S=(e.billing?.plans||[]).find(_=>_.id==="repo_never");return S?.amount!=null?`${e.billingAmount(S)} once, or with a subscription`:"Subscription or one-time add-on"},e.hostingCycle="author_annual",e.hostingSubscriptionPlan=()=>e.authorPlans().find(S=>S.id===e.hostingCycle)||e.authorPlans().find(S=>S.interval==="year")||e.authorPlans()[0],e.hostingAnnualSavings=()=>{let S=e.authorPlans().find(F=>F.interval==="month")?.amount,_=e.authorPlans().find(F=>F.interval==="year")?.amount;return S&&_&&_e.hostingOneTimePlans().concat(e.authorPlans().length?[e.hostingSubscriptionPlan()]:[]),e.hostingOptionName=S=>({repo_slot:"Add this repository",repo_pack:"Paper pack",repo_never:"Never expire",author_annual:"Author subscription",author_monthly:"Author subscription"})[S.id]||S.name,e.hostingOptionBlurb=S=>({repo_slot:"Hosted outside your free repositories. Refresh it by hand.",repo_pack:"Adds automatic updates for 180 days and keeps the link online for a year.",repo_never:"This link never expires. No subscription."})[S.id]||`${S.repositories} repositories, ${e.billingBytes(S.storage)}, automatic updates and links that never expire.`,e.hostingChoice=()=>{let S=e.hostingOneTimePlans();return S.some(_=>_.id===e.hostingPlan)||e.authorPlans().some(_=>_.id===e.hostingPlan)?e.hostingPlan:S[0]?.id||e.authorPlans()[0]?.id||""},e.checkoutRepository=async(S="")=>{if(!(e.hostingSaving||e.billingBusy||!e.billing?.csrf||e.sourceLoading)){e.hostingSaving=!0,e.billingError="";try{let _=b.checkpoint(),F=JSON.stringify(_);(!N||F!==O)&&(N=(await t.post("/api/billing/draft",{path:s.path(),values:_},{headers:{"x-csrf-token":e.billing.csrf}})).data.id,O=F);let Q=e.authorPlans().find(pe=>pe.id===e.hostingPlan)||e.authorPlans()[0];if(!S&&!Q)throw new Error("No author plan available");await e.checkout(S||Q.id,S?e.repoId:"",{draftId:N})}catch{e.billingError="Your draft could not be saved for checkout. Your form is unchanged. Please try again."}finally{e.hostingSaving=!1}}},e.useDatedHosting=()=>{e.options.expirationMode="remove"},e.discardDraft=async()=>{b.discard(),e.workspaceOpen=!!e.sourceUrl,e.error=null,e.sourceUrl?await e.urlSelected(!0):(p++,e.sourceLoading=!1,e.detectedType=null,e.details=null,e.sourceUrlError="",V.cancel(),ne.cancel(),Le.cancel(),e.previewStatus="idle")},e.githubConnection=void 0,e.githubConnections=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1;let M=()=>{let S={};for(let _ of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])S[_]=e[_];sessionStorage.setItem("github-access-draft",JSON.stringify({path:s.path(),savedAt:Date.now(),draft:S}))};e.connectGistApp=()=>{M(),window.location.href="/github/app/login?returnTo="+encodeURIComponent(s.path())},e.connectGistOAuth=()=>{M(),window.location.href="/github/login?returnTo="+encodeURIComponent(s.path())},e.grantGitHubAccess=()=>{M();let S=s.path(),_=he(e.sourceUrl)||"",F=e.githubConnections?.appConnected?"/github/app/install":"/github/app/login";window.location.href=F+"?returnTo="+encodeURIComponent(S)+"&repository="+encodeURIComponent(_)+"&install=1"},e.chooseGitHubConnection=async S=>{e.githubConnection=S,e.readme="",e.sourceUrl&&await Pe()},e.detectedType=null,e.repoId="",e.pullRequestId="",e.gistId="",e.terms="",e.defaultTerms="",e.branches=[],e.source={branch:"",commit:""},e.options={expirationMode:"remove",expirationDate:new Date,update:!1,image:!0,pdf:!0,notebook:!0,link:!0,body:!0,title:!0,origin:!1,diff:!0,content:!0,comments:!0,username:!0,date:!0};function G(){let S=new Date;return S.setMonth(S.getMonth()+6),S}e.options.expirationDate=G();function de(S){let _=S.getFullYear(),F=String(S.getMonth()+1).padStart(2,"0"),Q=String(S.getDate()).padStart(2,"0");return`${_}-${F}-${Q}`}e.minExpirationDate=de(new Date);let re=()=>{let S=new Date,_=new Date(S);if(_.setFullYear(_.getFullYear()+1),e.billing?.enabled&&!e.hasAuthorHosting()){_=new Date(S),_.setMonth(_.getMonth()+(e.billing.freeExpirationMonths||5));for(let pe of e.repositoryGrants("repo_extend"))new Date(pe.until)>_&&(_=new Date(pe.until));e.conference_data?.endDate&&new Date(e.conference_data.endDate)>_&&(_=new Date(e.conference_data.endDate)),e._savedExpirationDate&&e._savedExpirationDate>_&&(_=new Date(e._savedExpirationDate));let F=e.options?.expirationDate,Q=e._savedExpirationDate&&F instanceof Date&&F.getTime()===e._savedExpirationDate.getTime();F instanceof Date&&F>_&&!Q&&(e.options.expirationDate=new Date(_))}e.maxExpirationDate=de(_)};re(),e.watch(()=>[e.billing,e.repoId,e.conference_data,e.isUpdate,e._savedExpirationDate,e.options?.expirationMode],re,!0,!1),e.anonymize_readme="",e.readme="",e.html_readme="",e.isUpdate=!1,e.previousConfigurations=[],e.previousConfigurationId="";let D,X=S=>String(S||"").replace(/\/$/,"").replace(/\.git$/i,"").toLowerCase();async function le(){if(e.isUpdate||i.repoId||i.pullRequestId||i.gistId)return;let S={generation:p,url:e.sourceUrl.trim(),connection:e.githubConnection};try{D||(D=t.get("/api/user/anonymized_repositories").then(Q=>Q.data));let _=await D;if(!g(S))return;let F=X(he(S.url));e.previousConfigurations=_.filter(Q=>Q.repoId&&Q.options&&X(Q.source?.fullName)===F).sort((Q,pe)=>(Date.parse(pe.anonymizeDate)||0)-(Date.parse(Q.anonymizeDate)||0)),e.previousConfigurationId=e.previousConfigurations[0]?.repoId||""}catch{D=void 0}}e.existingConfigurationUrl=()=>{let S=e.previousConfigurations.find(_=>_.repoId===e.previousConfigurationId);return S?"/anonymize/"+encodeURIComponent(S.repoId):null};function Ee(S){t.get("/api/user/default").then(_=>{let F=_.data;F.terms&&(e.defaultTerms=F.terms.join(` +Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let u=(e.demoTerms||"").split(/[,\n]/).map(m=>m.trim()).filter(Boolean).sort((m,k)=>k.length-m.length),p=m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!u.length)return[{text:e.demoText}];let v=new RegExp("("+u.map(p).join("|")+")","gi"),h={},g=0;return(e.demoText||"").split(v).filter(m=>m!=="").map(m=>{let k=u.find(T=>T.toLowerCase()===m.toLowerCase());return k?(h[k.toLowerCase()]||(h[k.toLowerCase()]=++g),{text:String(h[k.toLowerCase()]),redacted:!0,original:m}):{text:m}})},e.demoCount=()=>e.demoParts().filter(u=>u.redacted).length,e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}];function r(){t.get("/api/stat/").then(u=>{e.stat=u.data,e.cards[0].total=u.data.nbRepositories,e.cards[1].total=u.data.nbUsers,e.cards[2].total=u.data.nbPageViews,e.cards[3].total=u.data.nbPullRequests}).catch(()=>{})}r();function a(u){let p={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return p;let v=new Array(u.length-1);for(let w=1;w=2){let w=v[h-2];w&&(p.pctChange=(p.deltaToday-w)/w*100)}return p.pctAbs=Math.round(Math.abs(p.pctChange)),p.isUp=p.pctChange>=0,p}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let p=u.data||[];e.history={repositories:a(p.map(v=>v.nbRepositories||0)),users:a(p.map(v=>v.nbUsers||0)),pageViews:a(p.map(v=>v.nbPageViews||0)),pullRequests:a(p.map(v=>v.nbPullRequests||0))}}).catch(()=>{})},Ku=function(e,t,o,i,s,r){let a=Tt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,nt(()=>document.querySelector(".dashboard-quota > summary")?.focus())},bn()(document,"click",D=>{e.quotaExpanded&&!D.target.closest?.(".dashboard-quota")&&(e.quotaExpanded=!1)}),e.filtersExpanded=!1,e.projectView="all",e.selectedProject=null,e.projectName="",e.nameSaving=!1,e.nameError="",e.nameMessage="",e.needsAttention=D=>D.status==="error"||D._broken||p(D.status)==="progress"&&D._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=D=>{e.projectView=D,D==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.projectDetailsId=D=>"project-details-"+encodeURIComponent(D._type+":"+(D._id||D._source||"unknown")),e.showProjectDetails=async D=>{e.selectedProject=D,e.projectName=D.projectName||"",e.nameError="",e.nameMessage="",await nt();let X=document.getElementById(e.projectDetailsId(D));X?.focus(),X?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=D=>{e.selectedProject=null,nt(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(D._type+":"+D._id)}"]`)?.focus())},e.saveProjectName=async D=>{if(e.nameSaving||!D._id)return;let X=e.projectName.trim();if(X.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let le=await t.post("/api/user/project-name",{type:D._type,id:D._id,name:X});D.projectName=le.data.name,D._label=D.projectName||D._fallbackLabel,e.selectedProject===D&&(e.nameMessage=X?"Project name saved.":"Default project name restored."),N||(e.dashboardCursor=null,await q(),e.selectedProject===D&&(e.selectedProject=e.items.find(Ee=>Ee._type===D._type&&Ee._id===D._id)||null))}catch{e.selectedProject===D&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async D=>{if(!D._viewUrl||e.copyingId)return;let X=new URL(D._viewUrl,s.location.origin).href;e.copyingId=D._type+":"+D._id;try{await Bu(X),e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:X})}finally{e.copyingId=null}},e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"In progress",error:"Error",expired:"Expired",removed:"Removed"};let u=["queue","download","downloaded","preparing","anonymizing"];function p(D){return D==="ready"||D==="error"?D:D==="expired"||D==="expiring"?"expired":D==="removed"||D==="removing"?"removed":(u.indexOf(D)>-1,"progress")}let v=7200*1e3,h="dashboard.filterPrefs",g={typeFilter:"all",filters:{status:{ready:!0,progress:!0,error:!0,expired:!0,removed:!1}},orderBy:"-anonymizeDate"},m=loadFilterPrefs(h)||{};e.typeFilter=m.typeFilter||g.typeFilter,e.filters={status:Object.assign({},g.filters.status,m.filters&&m.filters.status||{})},e.orderBy=m.orderBy||g.orderBy;let k={_name:{label:"Anonymous ID",defaultDesc:!1},_label:{label:"Project",defaultDesc:!1},anonymizeDate:{label:"Anonymize date",defaultDesc:!0},status:{label:"Status",defaultDesc:!1},lastView:{label:"Last view",defaultDesc:!0},pageView:{label:"Views",defaultDesc:!0},"options.expirationDate":{label:"Expiration",defaultDesc:!1}};e.sortFields=k,e.sortField=()=>e.orderBy.replace(/^-/,""),e.sortDesc=()=>e.orderBy.charAt(0)==="-",e.sortLabel=()=>{let D=k[e.sortField()];return D?D.label:"Custom"},e.isSortedBy=D=>e.sortField()===D,e.setSort=(D,X)=>{typeof X!="boolean"&&(X=e.isSortedBy(D)?!e.sortDesc():!!(k[D]&&k[D].defaultDesc)),e.orderBy=(X?"-":"")+D},e.toggleSortDirection=()=>{e.setSort(e.sortField(),!e.sortDesc())},e.watchGroup(["typeFilter","orderBy"],()=>{saveFilterPrefs(h,{typeFilter:e.typeFilter,filters:e.filters,orderBy:e.orderBy})}),e.watch("filters",()=>{saveFilterPrefs(h,{typeFilter:e.typeFilter,filters:e.filters,orderBy:e.orderBy})},!0),r.load().then(D=>{e.quota=D},console.error);function T(D,X,le,Ee,ae,he){D.pageView||(D.pageView=0),D.lastView||(D.lastView=""),D.options=D.options||{},D.options.terms=(D.options.terms||[]).filter(Pe=>Pe),D._id=X||"",D._source=Ee,D._broken=!X,D._name=X||Ee||"(unnamed)",D._fallbackLabel=D._type==="gist"?"Gist "+(X||Ee||"without an ID"):Ee||le||D._name,D._label=D.projectName||D._fallbackLabel,D._editUrl=X?ae:null,D._viewUrl=X?he:null,D._broken&&(D.status="error",D.statusMessage="incomplete_record"),D._statusKey=p(D.status);let Ce=D.anonymizeDate||D.lastView;return D._stale=D._statusKey==="progress"&&!!Ce&&Date.now()-new Date(Ce).getTime()>v,D.status==="expired"||D.status==="expiring"?D._expiry={kind:"expired",date:D.options.expirationDate}:D.status!=="ready"?D._expiry={kind:"none"}:D.options.expirationMode==="never"||!D.options.expirationDate?D._expiry={kind:"never"}:D._expiry={kind:"date",date:D.options.expirationDate},D}function w(D){return t.get(D).then(X=>X.data||[],X=>(console.error(X),[]))}function b(){return e.loading=!0,i.all([w("/api/user/anonymized_repositories"),w("/api/user/anonymized_pull_requests"),w("/api/user/anonymized_gists")]).then(D=>{let X=D[0],le=D[1],Ee=D[2],ae=[];X.forEach(he=>{he._type="repo";let Ce=he.source||{};ae.push(T(he,he.repoId,he.repoId,Ce.fullName,"/anonymize/"+he.repoId,"/r/"+he.repoId+"/"))}),le.forEach(he=>{he._type="pr";let Ce=he.source||{};ae.push(T(he,he.pullRequestId,he.pullRequestId,Ce.repositoryFullName?Ce.repositoryFullName+"#"+Ce.pullRequestId:void 0,"/pull-request-anonymize/"+he.pullRequestId,"/pr/"+he.pullRequestId+"/"))}),Ee.forEach(he=>{he._type="gist";let Ce=he.source||{};ae.push(T(he,he.gistId,he.gistId,Ce.gistId,"/gist-anonymize/"+he.gistId,"/gist/"+he.gistId+"/"))}),e.items=ae,e.loading=!1})}let E=0,N=!1;e.dashboardCursor=null,e.dashboardError="";function O(D){let X=D.source||{};return D._type==="repo"?T(D,D.repoId,D.repoId,X.fullName,"/anonymize/"+D.repoId,"/r/"+D.repoId+"/"):D._type==="pr"?T(D,D.pullRequestId,D.pullRequestId,X.repositoryFullName?X.repositoryFullName+"#"+X.pullRequestId:void 0,"/pull-request-anonymize/"+D.pullRequestId,"/pr/"+D.pullRequestId+"/"):T(D,D.gistId,D.gistId,X.gistId,"/gist-anonymize/"+D.gistId,"/gist/"+D.gistId+"/")}function q(D=!1){if(N)return b();let X=++E;return e.loading=!D,e.loadingMore=D,e.dashboardError="",t.get("/api/user/dashboard",{params:{q:e.search,type:e.typeFilter,sort:e.orderBy,statuses:Object.keys(e.filters.status).filter(le=>e.filters.status[le]!==!1).join(",")||"none",attention:String(e.projectView==="attention"),cursor:D?e.dashboardCursor:void 0}}).then(le=>{if(X===E){if(!Array.isArray(le.data?.items))return N=!0,b();e.items=(D?e.items:[]).concat(le.data.items.map(O)),e.dashboardCursor=le.data.cursor,e.dashboardTotals=le.data}},le=>{if(X===E){if(le.status===404)return N=!0,b();e.dashboardError="Projects could not be loaded. Please try again."}}).finally(()=>{X===E&&(e.loading=!1,e.loadingMore=!1)})}e.loadMoreProjects=()=>q(!0);let M;e.watchGroup(["search","typeFilter","orderBy","projectView"],()=>{N||(M&&a.timeout.cancel(M),M=a.timeout(()=>q(),150))},!1),e.watch("filters",()=>{N||q()},!0,!1),e.on("dispose",()=>{E++}),q(),e.openItem=(D,X)=>{if(!D._viewUrl)return;let le=X&&X.target;le&&le.closest&&le.closest("a, button, .dropdown, input")||(s.location.href=D._viewUrl)},e.hiddenStatusCount=()=>Object.keys(e.filters.status).filter(D=>e.filters.status[D]===!1).length,e.hasHiddenStatus=()=>e.hiddenStatusCount()>0,e.hasActiveFilters=()=>e.projectView!=="all"||e.typeFilter!=="all"||e.search.trim().length>0||Object.keys(e.filters.status).some(D=>e.filters.status[D]===!1),e.showClearFilters=()=>e.search.trim().length>0||e.typeFilter!=="all"||e.hiddenStatusCount()>1,e.clearFilters=()=>{e.projectView="all",e.typeFilter="all",e.search="",Object.keys(e.filters.status).forEach(D=>{e.filters.status[D]=!0})};function G(D,X,le,Ee){t.get("/api/repo/"+D).then(async ae=>{let he=Ee!==void 0&&Ee!==ae.data.status;for(let Ce of e.items)if(Ce._type==="repo"&&Ce.repoId==D){he=he||Ce.status!==ae.data.status;let Pe=e.needsAttention(Ce);Ce.status=ae.data.status,Ce.statusMessage=ae.data.statusMessage,Ce._statusKey=p(Ce.status),Ce._statusKey!=="progress"&&(Ce._stale=!1);let Ne=e.needsAttention(Ce);e.dashboardTotals&&Pe!==Ne&&(e.dashboardTotals.attention=Math.max(0,e.dashboardTotals.attention+(Ne?1:-1)));break}if(he&&!N){e.dashboardCursor=null;let Ce=e.selectedProject;await q(),Ce&&e.selectedProject===Ce&&(e.selectedProject=e.items.find(Pe=>Pe._type===Ce._type&&Pe._id===Ce._id)||null)}if(ae.data.status=="ready"||ae.data.status=="error"||ae.data.status=="removed"||ae.data.status=="expired"){X(ae.data);return}a.timeout(()=>G(D,X,le,ae.data.status),2500)},le)}let de=D=>D==="repo"?"repository":D==="gist"?"gist":"pull request",re=D=>D==="repo"?"/api/repo":D==="gist"?"/api/gist":"/api/pr";e.removeItem=D=>{let X=de(D._type);if(confirm(`Are you sure that you want to remove the ${X} ${D._id}?`)){let le=et({title:`Removing ${D._id}...`,date:new Date,body:`The ${X} ${D._id} is going to be removed.`});e.addToast(le);let Ee=`${re(D._type)}/${D._id}`;t.delete(Ee).then(()=>{D._type==="repo"?G(D._id,()=>{le.title=`${D._id} is removed.`,le.body=`The ${X} ${D._id} is removed.`},void 0,D.status):(le.title=`${D._id} is removed.`,le.body=`The ${X} ${D._id} is removed.`,q())},ae=>{le.title=`Error during the removal of ${D._id}.`,le.body=ae.body,q()})}},e.refreshItem=D=>{let X=de(D._type),le=et({title:`Refreshing ${D._id}...`,date:new Date,body:`The ${X} ${D._id} is going to be refreshed.`});e.addToast(le);let Ee=he=>{le.title=`Error during the refresh of ${D._id}.`,le.body=he.data?.error||he.body||"The refresh could not be completed. Please try again.",q()},ae=`${re(D._type)}/${D._id}/refresh`;t.post(ae).then(()=>{D._type==="repo"?G(D._id,he=>{if(he.status!=="ready"){Ee({body:he.statusMessage||`The repository is ${he.status}.`});return}le.title=`${D._id} is refreshed.`,le.body=`The ${X} ${D._id} is refreshed.`},Ee,D.status):(le.title=`${D._id} is refreshed.`,le.body=`The ${X} ${D._id} is refreshed.`,q())},Ee)},e.extendItem=D=>{let X=de(D._type),le=et({title:`Extending ${D._id}...`,date:new Date,body:`The expiration of ${X} ${D._id} is being extended.`});e.addToast(le);let Ee=`${re(D._type)}/${D._id}/extend`;t.post(Ee).then(ae=>{let he=ae?.data?.expirationDate?` until ${new Date(ae.data.expirationDate).toLocaleDateString()}`:"";D._type==="repo"?G(D._id,()=>{le.title=`${D._id} is extended.`,le.body=`${X} ${D._id} is extended${he}.`},void 0,D.status):(le.title=`${D._id} is extended.`,le.body=`${X} ${D._id} is extended${he}.`,q())},ae=>{le.title=`Error during the extension of ${D._id}.`;let he=ae.data&&ae.data.error;le.body=he||ae.body,he&&Object.prototype.hasOwnProperty.call(ro.ERRORS,he)&&(le.body=ro.ERRORS[he]),q()})},e.itemFilter=D=>{if(e.projectView==="attention"&&!e.needsAttention(D)||e.typeFilter!=="all"&&D._type!==e.typeFilter||e.filters.status[D._statusKey]===!1)return!1;let X=e.search.trim().toLowerCase();return!!(X.length==0||D._label&&String(D._label).toLowerCase().indexOf(X)>-1||D._source&&String(D._source).toLowerCase().indexOf(X)>-1||D._id&&String(D._id).toLowerCase().indexOf(X)>-1||D.conference&&String(D.conference).toLowerCase().indexOf(X)>-1)}};var Yu=function(e,t,o){let i=Tt();e.repoId=o.repoId,e.reviewUrl=window.location.origin+"/r/"+encodeURIComponent(o.repoId)+"/",e.repo=null,e.progress=0,e.rateLimitResetAt=0,e.rateLimitCountdown="",e.shareUrl=(window.location?.origin||"")+"/r/"+encodeURIComponent(e.repoId)+"/",e.copied=!1;let s=null;e.copyShareUrl=async()=>{try{await Bu(e.shareUrl),e.copied=!0,s&&i.timeout.cancel(s),s=i.timeout(()=>{e.copied=!1},2e3)}catch{e.addToast?.({title:"Copy this anonymous link",body:e.shareUrl})}};var r=null;let a=null,u=!1;function p(h){e.rateLimitResetAt=h,r&&i.interval.cancel(r);function g(){var m=Math.max(0,Math.ceil((h-Date.now())/1e3));if(m<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,i.interval.cancel(r),r=null;else{var k=Math.floor(m/60),T=m%60;e.rateLimitCountdown=k>0?k+"m "+T+"s":T+"s"}}g(),r=i.interval(g,1e3)}e.on("dispose",function(){u=!0,r&&i.interval.cancel(r),a&&i.timeout.cancel(a)});function v(h){if(!h)return h;var g=h.match(/^rate_limited:(\d+)$/);return g?(p(parseInt(g[1],10)),null):(e.rateLimitResetAt=0,h)}e.getStatus=()=>{u||t.get("/api/repo/"+e.repoId,{repoId:e.repoId,repoUrl:e.repoUrl}).then(h=>{if(!u){e.repo=h.data,h.data.rateLimitResetAt?p(h.data.rateLimitResetAt):e.repo.statusMessage=v(e.repo.statusMessage),e.repo.status=="ready"?e.progress=100:e.repo.status=="queue"?e.progress=10:e.repo.status=="downloaded"?e.progress=50:e.repo.status=="download"||e.repo.status=="preparing"?e.progress=25:e.repo.status=="anonymizing"&&(e.progress=75);var g=!["ready","removed","expired"].includes(e.repo.status);e.repo.status=="error"&&!e.rateLimitResetAt&&(g=!1),g&&(a=i.timeout(e.getStatus,2e3))}},h=>{e.error=h.data.error})},e.getStatus()},$i=function(e,t,o,i,s,r,a){Uu(),e.renderRedacted=Lu,e.sourceUrl="",e.workspaceOpen=!1,e.sourceUrlError="",e.previewStatus="idle",e.sourceLoading=!1,e.mobilePane="settings";let u=window.matchMedia?.("(max-width: 767px)");e.mobileWorkspace=!!u?.matches,u?.addEventListener&&bn()(u,"change",S=>{e.mobileWorkspace=S.matches}),e.selectMobilePane=S=>{e.mobilePane=S};let p=0,v=!1,h=new Set,g=(S,_=!1)=>!v&&S.generation===p&&S.url===e.sourceUrl.trim()&&S.connection===e.githubConnection&&(!_||S.branch===e.source.branch),m=()=>{let S={generation:p,url:e.sourceUrl.trim(),connection:e.githubConnection,branch:e.source.branch};return h.add(S),e.sourceLoading=!0,S},k=S=>{h.delete(S),v||(e.sourceLoading=[...h].some(_=>g(_)))};e.on("dispose",()=>{v=!0,p++});let T=null,w=S=>S.gistId&&!S.repo?"gist:"+S.gistId.toLowerCase():(S.owner+"/"+S.repo).toLowerCase()+(S.pullRequestId?"/pull/"+S.pullRequestId:""),b=Fr(e,["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"],"anonymize:"+(s.path?.()||"")),E=null,N=null,O=null;e.hostingReview=!1,e.previewExpanded=!1,e.taskValidationError="",e.editRepository=()=>{e.mobilePane="settings",e.previewExpanded=!1,nt(()=>document.querySelector(".anonymize-fields .is-invalid")?.focus())},e.submitRepository=S=>{if(e.taskValidationError="",!(e.sourceLoading||e.billingBusy||e.hostingSaving||e.billingPending)){if(bt()||e.anonymize?.invalid||e.sourceUrlError){e.taskValidationError="Check the highlighted fields before continuing.",e.editRepository();return}return e.hostingNeedsPayment()?e.checkoutRepository(Ei(e.hostingChoice())?e.hostingChoice():""):e.anonymizeRepo(S)}},e.hostingPayment=!1,e.hostingAlternatives=!1,e.hostingPrice=S=>S.amount==null?"Price shown at checkout":new Intl.NumberFormat(void 0,{style:"currency",currency:S.currency,minimumFractionDigits:0,maximumFractionDigits:2}).format(S.amount/100)+(S.interval==="year"?" billed annually":" billed monthly"),e.hostingPlan="",e.hostingSaving=!1,e.selectedHostingPlan=()=>e.authorPlans().find(S=>S.id===e.hostingPlan)||e.hostingSubscriptionPlan?.();let q=()=>t.get("/api/user/quota").then(S=>{e.hostingQuota=S.data});Ni(e,t,async()=>{await q(),e.hostingQuotaBlocked=!1},{confirmedMessage:"Hosting status refreshed. Your draft is ready to continue."}),q().catch(()=>{}),e.authorPlans=()=>(e.billing?.plans||[]).filter(S=>["author_monthly","author_annual"].includes(S.id)),e.conferenceHosting=()=>!!(e.conference&&e.conference_data?.hosting),e.hasAuthorHosting=()=>["author_monthly","author_annual"].includes(e.billing?.allowance?.plan),e.hostingNeedsPayment=()=>!e.billing?.enabled||e.detectedType!=="repo"||e.hasAuthorHosting()||e.isUpdate&&e.role!=="owner"?!1:!!(e.options?.expirationMode==="never"&&!e._existingNever&&!e.repositoryGrants("repo_never").length||!e.conferenceHosting()&&e.hostingQuotaBlocked),e.repositoryGrants=S=>(e.billing?.grants||[]).filter(_=>_.planId===S&&_.scope===`repo:${e.repoId}`&&["active","paid","past_due"].includes(_.status)&&new Date(_.until).getTime()>Date.now()),e.repositoryAddonPlans=()=>(e.billing?.plans||[]).filter(S=>Ei(S.id)&&(["repo_extend","repo_pack"].includes(S.id)||!e.repositoryGrants(S.id).length)),e.hostingOneTimePlans=()=>{let S=_=>_.map(F=>(e.billing?.plans||[]).find(Q=>Q.id===F&&!e.repositoryGrants(F).length)).filter(Boolean);return e.options?.expirationMode==="never"&&!e._existingNever&&!e.repositoryGrants("repo_never").length?S(["repo_never"]):e.hostingQuotaBlocked&&!e.conferenceHosting()?S(["repo_slot","repo_pack"]):[]},e.hostingOneTime=()=>e.hostingOneTimePlans()[0],e.neverExpireTag=()=>{if(e.hasAuthorHosting())return"Included in your subscription";if(e.repositoryGrants("repo_never").length)return"Paid for this repository";let S=(e.billing?.plans||[]).find(_=>_.id==="repo_never");return S?.amount!=null?`${e.billingAmount(S)} once, or with a subscription`:"Subscription or one-time add-on"},e.hostingCycle="author_annual",e.hostingSubscriptionPlan=()=>e.authorPlans().find(S=>S.id===e.hostingCycle)||e.authorPlans().find(S=>S.interval==="year")||e.authorPlans()[0],e.hostingAnnualSavings=()=>{let S=e.authorPlans().find(F=>F.interval==="month")?.amount,_=e.authorPlans().find(F=>F.interval==="year")?.amount;return S&&_&&_e.hostingOneTimePlans().concat(e.authorPlans().length?[e.hostingSubscriptionPlan()]:[]),e.hostingOptionName=S=>({repo_slot:"Add this repository",repo_pack:"Paper pack",repo_never:"Never expire",author_annual:"Author subscription",author_monthly:"Author subscription"})[S.id]||S.name,e.hostingOptionBlurb=S=>({repo_slot:"Hosted outside your free repositories. Refresh it by hand.",repo_pack:"Adds automatic updates for 180 days and keeps the link online for a year.",repo_never:"This link never expires. No subscription."})[S.id]||`${S.repositories} repositories, ${e.billingBytes(S.storage)}, automatic updates and links that never expire.`,e.hostingChoice=()=>{let S=e.hostingOneTimePlans();return S.some(_=>_.id===e.hostingPlan)||e.authorPlans().some(_=>_.id===e.hostingPlan)?e.hostingPlan:S[0]?.id||e.hostingSubscriptionPlan()?.id||""},e.checkoutRepository=async(S="")=>{if(!(e.hostingSaving||e.billingBusy||!e.billing?.csrf||e.sourceLoading)){e.hostingSaving=!0,e.billingError="";try{let _=b.checkpoint(),F=JSON.stringify(_);(!N||F!==O)&&(N=(await t.post("/api/billing/draft",{path:s.path(),values:_},{headers:{"x-csrf-token":e.billing.csrf}})).data.id,O=F);let Q=e.authorPlans().find(pe=>pe.id===e.hostingPlan)||e.hostingSubscriptionPlan();if(!S&&!Q)throw new Error("No author plan available");await e.checkout(S||Q.id,S?e.repoId:"",{draftId:N})}catch{e.billingError="Your draft could not be saved for checkout. Your form is unchanged. Please try again."}finally{e.hostingSaving=!1}}},e.useDatedHosting=()=>{e.options.expirationMode="remove"},e.discardDraft=async()=>{b.discard(),e.workspaceOpen=!!e.sourceUrl,e.error=null,e.sourceUrl?await e.urlSelected(!0):(p++,e.sourceLoading=!1,e.detectedType=null,e.details=null,e.sourceUrlError="",V.cancel(),ne.cancel(),Le.cancel(),e.previewStatus="idle")},e.githubConnection=void 0,e.githubConnections=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1;let M=()=>{let S={};for(let _ of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])S[_]=e[_];sessionStorage.setItem("github-access-draft",JSON.stringify({path:s.path(),savedAt:Date.now(),draft:S}))};e.connectGistApp=()=>{M(),window.location.href="/github/app/login?returnTo="+encodeURIComponent(s.path())},e.connectGistOAuth=()=>{M(),window.location.href="/github/login?returnTo="+encodeURIComponent(s.path())},e.grantGitHubAccess=()=>{M();let S=s.path(),_=he(e.sourceUrl)||"",F=e.githubConnections?.appConnected?"/github/app/install":"/github/app/login";window.location.href=F+"?returnTo="+encodeURIComponent(S)+"&repository="+encodeURIComponent(_)+"&install=1"},e.chooseGitHubConnection=async S=>{e.githubConnection=S,e.readme="",e.sourceUrl&&await Pe()},e.detectedType=null,e.repoId="",e.pullRequestId="",e.gistId="",e.terms="",e.defaultTerms="",e.branches=[],e.source={branch:"",commit:""},e.options={expirationMode:"remove",expirationDate:new Date,update:!1,image:!0,pdf:!0,notebook:!0,link:!0,body:!0,title:!0,origin:!1,diff:!0,content:!0,comments:!0,username:!0,date:!0};function G(){let S=new Date;return S.setMonth(S.getMonth()+6),S}e.options.expirationDate=G();function de(S){let _=S.getFullYear(),F=String(S.getMonth()+1).padStart(2,"0"),Q=String(S.getDate()).padStart(2,"0");return`${_}-${F}-${Q}`}e.minExpirationDate=de(new Date);let re=()=>{let S=new Date,_=new Date(S);if(_.setFullYear(_.getFullYear()+1),e.billing?.enabled&&e.detectedType==="repo"&&!e.hasAuthorHosting()){_=new Date(S),_.setMonth(_.getMonth()+(e.billing.freeExpirationMonths||5));for(let pe of e.repositoryGrants("repo_extend"))new Date(pe.until)>_&&(_=new Date(pe.until));e.conference_data?.endDate&&new Date(e.conference_data.endDate)>_&&(_=new Date(e.conference_data.endDate)),e._savedExpirationDate&&e._savedExpirationDate>_&&(_=new Date(e._savedExpirationDate));let F=e.options?.expirationDate,Q=e._savedExpirationDate&&F instanceof Date&&F.getTime()===e._savedExpirationDate.getTime();F instanceof Date&&F>_&&!Q&&(e.options.expirationDate=new Date(_))}e.maxExpirationDate=de(_)};re(),e.watch(()=>[e.billing,e.repoId,e.conference_data,e.isUpdate,e._savedExpirationDate,e.options?.expirationMode,e.detectedType],re,!0,!1),e.anonymize_readme="",e.readme="",e.html_readme="",e.isUpdate=!1,e.previousConfigurations=[],e.previousConfigurationId="";let D,X=S=>String(S||"").replace(/\/$/,"").replace(/\.git$/i,"").toLowerCase();async function le(){if(e.isUpdate||i.repoId||i.pullRequestId||i.gistId)return;let S={generation:p,url:e.sourceUrl.trim(),connection:e.githubConnection};try{D||(D=t.get("/api/user/anonymized_repositories").then(Q=>Q.data));let _=await D;if(!g(S))return;let F=X(he(S.url));e.previousConfigurations=_.filter(Q=>Q.repoId&&Q.options&&X(Q.source?.fullName)===F).sort((Q,pe)=>(Date.parse(pe.anonymizeDate)||0)-(Date.parse(Q.anonymizeDate)||0)),e.previousConfigurationId=e.previousConfigurations[0]?.repoId||""}catch{D=void 0}}e.existingConfigurationUrl=()=>{let S=e.previousConfigurations.find(_=>_.repoId===e.previousConfigurationId);return S?"/anonymize/"+encodeURIComponent(S.repoId):null};function Ee(S){t.get("/api/user/default").then(_=>{let F=_.data;F.terms&&(e.defaultTerms=F.terms.join(` `)),e.options=Object.assign({},e.options,F.options),e.options.expirationDate=F.options&&F.options.expirationDate?new Date(F.options.expirationDate):G(),!i.repoId&&!i.pullRequestId&&!i.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),S&&S()})}function ae(S,_,F){e.anonymize&&e.anonymize[S]&&e.anonymize[S].setValidity(_,F)}function he(S){try{let _=parseGithubUrl(S);if(_&&_.owner&&_.repo)return _.owner+"/"+_.repo}catch{}return null}e.accessRepairAllowed=!1,e.repairingGitHubAccess=!1,e.accessRepairMessage="",e.repairGitHubAccess=async()=>{if(!e.accessRepairAllowed||e.repairingGitHubAccess||!e.githubConnections?.appEnabled||!i.repoId||e.role!=="owner"||e.githubConnection!=="github-app"||he(e.sourceUrl)!==e._originalFullName)return;e.repairingGitHubAccess=!0,e.accessRepairMessage="";let S=m();try{let _=await t.get("/github/connections");if(e.githubConnections=_.data,!_.data.appEnabled)return;let F=await t.post("/github/connections/migrate",{type:"repository",id:i.repoId,connection:"github-app"},{headers:{"X-CSRF-Token":_.data.csrf}});if(!g(S))return;e.error=null,F.data.fullName&&(e._originalFullName=F.data.fullName,e.source.fullName=F.data.fullName,e.sourceUrl="https://github.com/"+F.data.fullName),e.accessRepairMessage="GitHub access repaired. Your anonymous URL and published commit are unchanged.",await e.urlSelected(!0)}catch{g(S)&&(e.accessRepairMessage="Unable to repair GitHub access. Check the App's repository permissions in Manage access, then retry. Your published snapshot has not been replaced.")}finally{e.repairingGitHubAccess=!1,k(S)}},e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await Re()}catch{}}};function Ce(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:he(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function Pe(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function Ne(){let S=new URLSearchParams(window.location.search).get("billingDraft");if(S){b.restore();try{let F=(await t.get("/api/billing/draft/"+encodeURIComponent(S))).data;if(F.path!==s.path())throw new Error("Wrong task");E=F.values.conference||null;for(let Q of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(F.values,Q)&&(e[Q]=F.values[Q]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),N=F.id,O=JSON.stringify(b.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await Pe(),s.replace?.(s.path()),!0}catch{e.billingError="The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."}}let _;try{_=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!_||_.path!==s.path()||Date.now()-_.savedAt>=30*6e4)return b.restore()?(e.sourceUrl&&await Pe(),!0):!1;b.restore();for(let F of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(_.draft,F)&&(e[F]=_.draft[F]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await Pe(),sessionStorage.removeItem("github-access-draft"),!0}Ee(()=>{!i.repoId&&!i.pullRequestId&&!i.gistId&&a(Ne,0),i.repoId&&i.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=i.repoId,t.get("/api/repo/"+e.repoId).then(async S=>{e.accessRepairAllowed=!["removed","archived","preparing","queue","download","removing","expiring"].includes(S.data.status),e.githubConnection=S.data.connection||"oauth",e.sourceUrl="https://github.com/"+S.data.source.fullName,e._originalFullName=S.data.source.fullName,e.terms=S.data.options.terms.filter(_=>_).join(` `),e.source=S.data.source,e.role=S.data.role||"owner",e._existingNever=S.data.options.expirationMode==="never",e._savedExpirationDate=S.data.options.expirationDate?new Date(S.data.options.expirationDate):null,e.coauthors=S.data.coauthors||[],e._originalBranch=S.data.source.branch,e.options=Object.assign({},e.options,S.data.options),e.conference=S.data.conference,e._originalConference=S.data.conference,e.repositoryID=S.data.source.repositoryID,e._originalRepositoryID=S.data.source.repositoryID,S.data.options.expirationDate&&(e.options.expirationDate=new Date(S.data.options.expirationDate)),T=w(parseGithubUrl(e.sourceUrl)),!await Ne()&&(await Promise.all([Re(),Qe()]),j())},()=>{s.url("/404")})),i.pullRequestId&&i.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=i.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async S=>{if(e.githubConnection=S.data.connection||"oauth",e.sourceUrl="https://github.com/"+S.data.source.repositoryFullName+"/pull/"+S.data.source.pullRequestId,e.terms=S.data.options.terms.filter(_=>_).join(` `),e.source=S.data.source,e.options=Object.assign({},e.options,S.data.options),e.conference=S.data.conference,e._originalConference=S.data.conference,S.data.options.expirationDate&&(e.options.expirationDate=new Date(S.data.options.expirationDate)),T=w(parseGithubUrl(e.sourceUrl)),!await Ne())try{await ee()}catch{}},()=>{s.url("/404")})),i.gistId&&i.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=i.gistId,t.get("/api/gist/"+e.gistId).then(async S=>{e.sourceUrl="https://gist.github.com/"+S.data.source.gistId,e.terms=S.data.options.terms.filter(_=>_).join(` diff --git a/src/config.ts b/src/config.ts index 3442c8c..2cc7194 100644 --- a/src/config.ts +++ b/src/config.ts @@ -14,6 +14,7 @@ interface Config { STRIPE_CONFERENCE_PRICE: string; STRIPE_CONFERENCE_SMALL_PRICE: string; STRIPE_CONFERENCE_LARGE_PRICE: string; + STRIPE_LEGACY_PRICES: string; STRIPE_REPO_EXTEND_PRICE: string; STRIPE_REPO_NEVER_PRICE: string; STRIPE_REPO_SLOT_PRICE: string; @@ -125,6 +126,8 @@ const config: Config = { STRIPE_CONFERENCE_PRICE: "", STRIPE_CONFERENCE_SMALL_PRICE: "", STRIPE_CONFERENCE_LARGE_PRICE: "", + // Retired price IDs that existing purchases still use: "price_old:author_annual,price_x:repo_pack". + STRIPE_LEGACY_PRICES: "", STRIPE_REPO_EXTEND_PRICE: "", STRIPE_REPO_NEVER_PRICE: "", STRIPE_REPO_SLOT_PRICE: "", @@ -296,4 +299,7 @@ if (config.BILLING_ENABLED) { if (!Number.isSafeInteger(config[key]) || config[key] <= 0) throw new Error(`${key} must be a positive integer`); } if (!config.STRIPE_SECRET_KEY || !config.STRIPE_WEBHOOK_SECRET) throw new Error("Billing requires STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET"); + for (const entry of config.STRIPE_LEGACY_PRICES.split(",").map(e => e.trim()).filter(Boolean)) { + if (!/^price_[A-Za-z0-9]+:[a-z_]+$/.test(entry)) throw new Error(`Invalid STRIPE_LEGACY_PRICES entry: ${entry}`); + } } diff --git a/src/core/Repository.ts b/src/core/Repository.ts index 885e10f..01a614f 100644 --- a/src/core/Repository.ts +++ b/src/core/Repository.ts @@ -1,6 +1,6 @@ import { REPOSITORY_ID_COLLATION } from "./repository-id"; -import { allowance, reserveRepository } from "./billing/quotas"; -import { MANUAL_REFRESH_PLANS } from "./billing/config"; +import { reserveRepository } from "./billing/quotas"; +import { hasAutomaticUpdates } from "./billing/expiration"; import { FILE_TREE_BATCH_SIZE, FILE_LISTING_LIMIT, deleteRowsInBatches } from "./file-tree"; import { SourceBase, sourceStorageSize } from "./source/Source"; import { notifyOwnerAccessProblem, withOwnerAccessRecovery } from "./owner-notifications"; @@ -725,7 +725,7 @@ export default class Repository { // Reviewer visits must not trigger an unaffordable refresh after paid access ends. // Free managed repositories can still be refreshed explicitly by their owner. if (config.BILLING_ENABLED && this.model.billingManaged && !opt?.force && - MANUAL_REFRESH_PLANS.includes((await allowance(String(this.model.owner), this.repoId, this.model.conference)).plan)) return; + !(await hasAutomaticUpdates(String(this.model.owner), this.repoId, this.model.conference))) return; const yesterday = new Date(); yesterday.setDate(yesterday.getDate() - 1); if ( diff --git a/src/core/billing/config.ts b/src/core/billing/config.ts index ec7dc2f..494ea5f 100644 --- a/src/core/billing/config.ts +++ b/src/core/billing/config.ts @@ -30,6 +30,18 @@ export function billingPlans() { { id: "conference_large" as PlanId, name: "Large conference", priceId: config.STRIPE_CONFERENCE_LARGE_PRICE, recurring: false, capacity: true, repositories: config.PAID_CONFERENCE_LARGE_REPOSITORIES, storage: config.PAID_CONFERENCE_LARGE_STORAGE, description: "For a large venue with several tracks. A review window of up to 180 days. No automatic renewal." }, ]; } +// Retired Stripe prices keep their plan, so existing subscriptions and +// purchases stay recognized after a price ID is replaced. +export function legacyPricePlans() { + const plans = new Map(); + const ids = new Set(billingPlans().map(p => p.id as string)); + for (const entry of config.STRIPE_LEGACY_PRICES.split(",").map(e => e.trim()).filter(Boolean)) { + const [price, plan] = entry.split(":").map(part => part.trim()); + if (!price || !plan || !ids.has(plan)) throw new Error(`Invalid STRIPE_LEGACY_PRICES entry: ${entry}`); + plans.set(price, plan as PlanId); + } + return plans; +} export function billingError(code: string, status = 400) { return new AnonymousError(code, { httpStatus: status }); } export function billingOrigin() { const url = new URL(config.BILLING_ORIGIN); diff --git a/src/core/billing/expiration.ts b/src/core/billing/expiration.ts index 51f31cc..978e49a 100644 --- a/src/core/billing/expiration.ts +++ b/src/core/billing/expiration.ts @@ -2,8 +2,8 @@ import { reconcileBillingAccount } from "./reconciliation"; import { createLogger } from "../logger"; import config from "../../config"; import { BillingGrant } from "./models"; -import { billingError } from "./config"; -import { usableGrant } from "./quotas"; +import { billingError, MANUAL_REFRESH_PLANS } from "./config"; +import { allowance, usableGrant } from "./quotas"; import Repo from "../model/anonymizedRepositories/anonymizedRepositories.model"; import ConferenceModel from "../model/conference/conferences.model"; @@ -19,6 +19,13 @@ async function hasRepositoryGrant(owner: string, repoId: string, planId: string, return grants.filter(g => usableGrant(g, now)); } +// Automatic updates come from the plan that funds the repository, or from the +// owner's author subscription even when a paid slot funds its storage. +export async function hasAutomaticUpdates(owner: string, repoId: string, conference?: string, now = new Date()) { + if (!MANUAL_REFRESH_PLANS.includes((await allowance(owner, repoId, conference)).plan)) return true; + return (await authorGrants(owner)).some(g => usableGrant(g, now)); +} + // This is an author benefit, independent of which scope pays the storage quota. // A repository's own Never expire add-on also qualifies. export async function neverExpirationDeadline(owner: string, existing?: Date, repoId?: string) { @@ -81,7 +88,7 @@ export async function reconcileNeverExpiration(now = new Date(), reconcile = rec } const previous = repo.billingNeverExpiresUntil!; // Roll the add-on deadline forward weekly rather than on every run. - const rolling = addons.has(`${owner} repo:${repo.repoId}`) && previous.getTime() < now.getTime() + NEVER_EXPIRATION_GRACE_MS - ROLLING_REFRESH_MS + let rolling = addons.has(`${owner} repo:${repo.repoId}`) && previous.getTime() < now.getTime() + NEVER_EXPIRATION_GRACE_MS - ROLLING_REFRESH_MS ? now.getTime() + NEVER_EXPIRATION_GRACE_MS : 0; let deadline = new Date(Math.max(previous.getTime(), deadlines.get(owner)!, rolling)); if (deadline <= now) { @@ -92,7 +99,12 @@ export async function reconcileNeverExpiration(now = new Date(), reconcile = rec verified.add(owner); const fresh = await authorGrants(owner); deadlines.set(owner, Math.max(0, ...fresh.filter(g => !g.revoked && g.until).map(g => g.until!.getTime() + NEVER_EXPIRATION_GRACE_MS))); + // Reconciliation can recover a missed Never expire purchase too. + for (const grant of await BillingGrant.find({ owner, planId: "repo_never", revoked: false, until: { $gt: now } }).select("owner scope status until revoked").lean()) { + if (usableGrant(grant, now)) addons.add(`${grant.owner} ${grant.scope}`); + } } + if (addons.has(`${owner} repo:${repo.repoId}`)) rolling = now.getTime() + NEVER_EXPIRATION_GRACE_MS; deadline = new Date(Math.max(previous.getTime(), deadlines.get(owner)!, rolling)); } catch { deferred.add(owner); diff --git a/src/core/billing/maintenance.ts b/src/core/billing/maintenance.ts index 86f5448..1d39f76 100644 --- a/src/core/billing/maintenance.ts +++ b/src/core/billing/maintenance.ts @@ -3,11 +3,13 @@ import config from "../../config"; import { BillingEvent, BillingAccount } from "./models"; import { processBillingInbox, billingHealth, billingFailure } from "./events"; import { reconcileBillingAccounts } from "./reconciliation"; +import { rememberConfiguredPrices } from "./stripe"; import { createLogger } from "../logger"; const logger = createLogger("billing"); export async function startBillingMaintenance() { if (!config.BILLING_ENABLED) return; await Promise.all([BillingEvent.createIndexes(), BillingAccount.createIndexes()]); + await rememberConfiguredPrices(); let eventsRunning = false; let reconcileRunning = false; const events = async () => { diff --git a/src/core/billing/stripe.ts b/src/core/billing/stripe.ts index a56a52b..8bca1eb 100644 --- a/src/core/billing/stripe.ts +++ b/src/core/billing/stripe.ts @@ -3,7 +3,7 @@ import { randomUUID } from "crypto"; import config from "../../config"; import { BillingAccount, BillingGrant, BillingLock, BillingRevocation, BillingPrice, BillingQuota } from "./models"; import { REPOSITORY_ID_COLLATION } from "../repository-id"; -import { billingError, billingOrigin, billingPlans, requireBilling, REPOSITORY_ADDONS, REPO_EXTEND_MS, REPO_NEVER_UNTIL, PACK_PLANS, isConferencePlan } from "./config"; +import { billingError, billingOrigin, billingPlans, legacyPricePlans, requireBilling, REPOSITORY_ADDONS, REPO_EXTEND_MS, REPO_NEVER_UNTIL, PACK_PLANS, isConferencePlan } from "./config"; import { usableGrant } from "./quotas"; import ConferenceModel from "../model/conference/conferences.model"; import RepositoryModel from "../model/anonymizedRepositories/anonymizedRepositories.model"; @@ -21,6 +21,22 @@ export async function withBillingLock(id: string, work: () => Promise): Pr try { return await work(); } finally { clearInterval(heartbeat); await BillingLock.deleteOne({ _id: id, token }); } } +// The plan a Stripe price pays for: the configured price, then a declared +// legacy price, then a price recorded when it was configured or sold. +export async function planForPrice(priceId: string | undefined, recurring: boolean) { + if (!priceId) return undefined; + const plans = billingPlans().filter(p => p.recurring === recurring); + const configured = plans.find(p => p.priceId === priceId); + if (configured) return configured; + const planId = legacyPricePlans().get(priceId) || (await BillingPrice.findById(priceId).lean())?.planId; + return plans.find(p => p.id === planId); +} +// Record every configured price before it can be replaced, so a later +// configuration change still recognizes subscriptions sold at that price. +export async function rememberConfiguredPrices() { + const prices = [...billingPlans().filter(p => p.priceId).map(p => [p.priceId, p.id] as const), ...legacyPricePlans()]; + for (const [priceId, planId] of prices) await BillingPrice.updateOne({ _id: priceId }, { $setOnInsert: { planId } }, { upsert: true }); +} export async function syncSubscription(id: string, stripe = stripeClient()) { // Compare-and-swap prevents a slow, earlier fetch from overwriting a newer one. for (let retry = 0; retry < 4; retry++) { @@ -31,7 +47,7 @@ export async function syncSubscription(id: string, stripe = stripeClient()) { const account = await BillingAccount.findById(owner).lean(); if (!account || account.customerId !== objectId(sub.customer)) throw billingError("billing_customer_mismatch"); const priceId = sub.items.data[0]?.price.id; - const plan = billingPlans().find(p => p.recurring && p.priceId === priceId); + const plan = await planForPrice(priceId, true); const invoice = sub.latest_invoice as Stripe.Invoice | null; const paid = !!plan && sub.items.data.length === 1 && sub.status === "active" && invoice?.status === "paid"; const periodEnd = sub.items.data[0]?.current_period_end; @@ -47,7 +63,7 @@ export async function syncSubscription(id: string, stripe = stripeClient()) { } } } - const values = { owner, scope: `user:${owner}`, planId: plan?.id || "unknown", customerId: account.customerId, + const values = { owner, scope: `user:${owner}`, planId: plan?.id || "unknown", customerId: account.customerId, priceId, subscriptionId: id, status: sub.status, cancelAtPeriodEnd: sub.cancel_at_period_end || !!sub.cancel_at, until: paidThrough, ...(sub.start_date ? { purchasedAt: new Date(sub.start_date * 1000) } : {}), }; @@ -78,7 +94,7 @@ export async function fulfillCheckout(id: string, stripe = stripeClient()) { && previousGrant?.planId === planId && previousGrant?.scope === previousScope && (!previousGrant.priceId || previousGrant.priceId === priceId); if (!plan || !priceId || session.line_items?.data.length !== 1 || session.line_items.data[0].quantity !== 1 || - !(priceId === plan.priceId || historicalPrice?.planId === planId || acceptedGrant)) throw billingError("billing_invalid_purchase"); + !(priceId === plan.priceId || historicalPrice?.planId === planId || legacyPricePlans().get(priceId) === planId || acceptedGrant)) throw billingError("billing_invalid_purchase"); await BillingPrice.updateOne({ _id: priceId }, { $setOnInsert: { planId } }, { upsert: true }); if (session.payment_status !== "paid" || session.status !== "complete") return; const intent = session.payment_intent as Stripe.PaymentIntent | null; @@ -265,10 +281,9 @@ export async function createCheckout(owner: string, planId: string, target = "", account.checkout.params = params; await account.save(); } - if (!plan.recurring) { - const acceptedPrice = (account.checkout.params as Stripe.Checkout.SessionCreateParams).line_items?.[0]?.price; - if (acceptedPrice) await BillingPrice.updateOne({ _id: acceptedPrice }, { $setOnInsert: { planId } }, { upsert: true }); - } + // Subscriptions too: their price must stay recognizable after a price change. + const acceptedPrice = (account.checkout.params as Stripe.Checkout.SessionCreateParams).line_items?.[0]?.price; + if (acceptedPrice) await BillingPrice.updateOne({ _id: acceptedPrice }, { $setOnInsert: { planId } }, { upsert: true }); const session = await stripe.checkout.sessions.create(account.checkout.params as Stripe.Checkout.SessionCreateParams, { idempotencyKey: account.checkout.key }); account.checkout.id = session.id; await account.save(); diff --git a/src/server/routes/conference.ts b/src/server/routes/conference.ts index 2d20524..3b2cc18 100644 --- a/src/server/routes/conference.ts +++ b/src/server/routes/conference.ts @@ -1,5 +1,7 @@ import config from "../../config"; import { billingError, billingPlans, isConferencePlan } from "../../core/billing/config"; +import { BillingGrant } from "../../core/billing/models"; +import { usableGrant } from "../../core/billing/quotas"; import * as express from "express"; import AnonymousError from "../../core/AnonymousError"; import Conference from "../../core/Conference"; @@ -241,7 +243,9 @@ router.get( const conference = new Conference(data); // Authors see whether the conference pays for their repository's hosting. const now = new Date(); - const hosting = isConferencePlan(data.plan?.planID) && data.status === "ready" && data.startDate <= now && data.endDate > now; + // Mirror admission: a refunded or disputed package no longer hosts anything. + const hosting = config.BILLING_ENABLED && isConferencePlan(data.plan?.planID) && data.status === "ready" && data.startDate <= now && data.endDate > now + && (await BillingGrant.find({ scope: `conference:${data.conferenceID}`, revoked: false, until: { $gt: now } }).select("status until revoked").lean()).some(g => usableGrant(g, now)); try { isOwnerOrAdmin(conference.ownerIDs, user); // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/test/billing-integration.test.js b/test/billing-integration.test.js index 4ed383a..fc42675 100644 --- a/test/billing-integration.test.js +++ b/test/billing-integration.test.js @@ -26,6 +26,7 @@ async function rejects(promise, message) { beforeEach(async () => { Object.assign(config, { BILLING_ENABLED: true, FREE_AUTHOR_REPOSITORIES: 3, FREE_AUTHOR_STORAGE: 100, PAID_AUTHOR_STORAGE: 1000, PAID_AUTHOR_REPOSITORIES: 20, STRIPE_AUTHOR_MONTHLY_PRICE: "price_monthly", STRIPE_AUTHOR_PASS_PRICE: "price_pass", STRIPE_CONFERENCE_PRICE: "price_conf", STRIPE_CONFERENCE_SMALL_PRICE: "price_conf_small", STRIPE_CONFERENCE_LARGE_PRICE: "price_conf_large", PAID_CONFERENCE_SMALL_REPOSITORIES: 25, STRIPE_REPO_EXTEND_PRICE: "", STRIPE_REPO_NEVER_PRICE: "", STRIPE_REPO_SLOT_PRICE: "", STRIPE_REPO_PACK_PRICE: "" }); + Object.assign(config, { STRIPE_AUTHOR_ANNUAL_PRICE: "price_annual", STRIPE_LEGACY_PRICES: "" }); await Promise.all([BillingPrice, BillingAccount, BillingGrant, BillingQuota, BillingLock, BillingEvent, BillingRevocation, BillingDraft, Repo, Conference].map(m => m.deleteMany({}))); await BillingAccount.create({ _id: owner, customerId: "cus_owner" }); }); @@ -464,6 +465,88 @@ async function rejects(promise, message) { expect(limits.repositories).to.equal(25); await assertConferenceAdmission(owner, "repo", "WS"); }); + it("keeps legacy and new annual subscriptions after the annual price is replaced", async () => { + const { rememberConfiguredPrices } = require("../src/core/billing/stripe"); + // Deployed before the switch: the old annual price is recorded at startup. + await rememberConfiguredPrices(); + const annual = (id, price) => subscription({ id, items: { data: [{ price: { id: price }, current_period_end: Math.floor(future().getTime() / 1000) }] } }); + let legacy = annual("sub_owner", "price_annual"); + const stripe = { subscriptions: { retrieve: async id => id === "sub_owner" ? legacy : annual(id, "price_annual_new") } }; + config.STRIPE_AUTHOR_ANNUAL_PRICE = "price_annual_new"; + await syncSubscription("sub_owner", stripe); + let grant = await BillingGrant.findById("sub_owner"); + expect(grant.planId).to.equal("author_annual"); + expect(grant.priceId).to.equal("price_annual"); + expect((await allowance(owner)).plan).to.equal("author_annual"); + // Webhook updates (renewal, cancellation) keep resolving the legacy price. + legacy = { ...legacy, cancel_at_period_end: true }; + await processBillingEvent({ type: "customer.subscription.updated", data: { object: { id: "sub_owner" } } }, stripe); + grant = await BillingGrant.findById("sub_owner"); + expect(grant.planId).to.equal("author_annual"); + expect(grant.cancelAtPeriodEnd).to.equal(true); + // New subscriptions use the new price. + await processBillingEvent({ type: "customer.subscription.created", data: { object: { id: "sub_new" } } }, stripe); + expect((await BillingGrant.findById("sub_new")).planId).to.equal("author_annual"); + }); + it("recognizes a declared legacy price without a recorded one", async () => { + config.STRIPE_AUTHOR_ANNUAL_PRICE = "price_annual_new"; + const stripe = { subscriptions: { retrieve: async () => subscription({ items: { data: [{ price: { id: "price_annual_old" }, current_period_end: Math.floor(future().getTime() / 1000) }] } }) } }; + await syncSubscription("sub_owner", stripe); + expect((await BillingGrant.findById("sub_owner")).planId).to.equal("unknown"); + config.STRIPE_LEGACY_PRICES = "price_annual_old:author_annual"; + await syncSubscription("sub_owner", stripe); + expect((await BillingGrant.findById("sub_owner")).planId).to.equal("author_annual"); + expect((await allowance(owner)).plan).to.equal("author_annual"); + }); + it("keeps historical one-time purchases after their price is replaced", async () => { + const value = session(); value.id = "cs_old_pass"; + await fulfillCheckout("cs_old_pass", { checkout: { sessions: { retrieve: async () => value } } }); + expect((await allowance(owner, "repo")).plan).to.equal("author_pass"); + config.STRIPE_AUTHOR_PASS_PRICE = "price_pass_new"; + // A redelivered webhook for the old sale still fulfills and keeps the grant. + await fulfillCheckout("cs_old_pass", { checkout: { sessions: { retrieve: async () => value } } }); + expect((await BillingGrant.findById("cs_old_pass")).revoked).to.not.equal(true); + expect((await allowance(owner, "repo")).plan).to.equal("author_pass"); + // A sale at an old price never recorded is accepted once it is declared. + const other = session(); other.id = "cs_older"; other.metadata.target = "other"; other.line_items.data[0].price.id = "price_pass_older"; + await rejects(fulfillCheckout("cs_older", { checkout: { sessions: { retrieve: async () => other } } }), "billing_invalid_purchase"); + config.STRIPE_LEGACY_PRICES = "price_pass_older:author_pass"; + await fulfillCheckout("cs_older", { checkout: { sessions: { retrieve: async () => other } } }); + expect((await allowance(owner, "other")).plan).to.equal("author_pass"); + }); + it("keeps a Never expire link online when reconciliation recovers its purchase", async () => { + const { reconcileNeverExpiration, NEVER_EXPIRATION_GRACE_MS } = require("../src/core/billing/expiration"); + const now = new Date(); + await Repo.create({ repoId: "recovered", owner, status: "ready", options: { expirationMode: "never" }, billingNeverExpiresUntil: new Date(now.getTime() - 1000) }); + await reconcileNeverExpiration(now, async () => { + await BillingGrant.create({ _id: "never-recovered", owner, scope: "repo:recovered", status: "paid", until: new Date("9999-12-31T00:00:00Z"), planId: "repo_never" }); + }); + const repo = await Repo.findOne({ repoId: "recovered" }); + expect(repo.options.expirationMode).to.equal("never"); + expect(repo.billingNeverExpiresUntil.getTime()).to.equal(now.getTime() + NEVER_EXPIRATION_GRACE_MS); + }); + it("keeps automatic updates for a paid-slot repository while its owner subscribes", async () => { + const { hasAutomaticUpdates } = require("../src/core/billing/expiration"); + await BillingGrant.create({ _id: "slot", owner, scope: "repo:slotted", status: "paid", until: new Date("9999-12-31T00:00:00Z"), planId: "repo_slot" }); + expect(await hasAutomaticUpdates(owner, "slotted")).to.equal(false); + await BillingGrant.create({ _id: "author", owner, scope: `user:${owner}`, status: "active", until: future(), planId: "author_monthly" }); + expect(await hasAutomaticUpdates(owner, "slotted")).to.equal(true); + }); + it("only reports conference hosting while its package payment stands", async () => { + const utils = require("../src/server/routes/route-utils"); + const router = require("../src/server/routes/conference").default; + const get = router.stack.find(layer => layer.route?.path === "/:conferenceID" && layer.route.methods.get).route.stack[0].handle; + const originalUser = utils.getUser; + utils.getUser = async () => ({ model: { id: "someone-else" }, isAdmin: false }); + try { + await Conference.create({ conferenceID: "PAID", owners: [owner], status: "ready", startDate: new Date(Date.now() - 1000), endDate: future(), plan: { planID: "conference" } }); + await BillingGrant.create({ _id: "conf-paid", owner, scope: "conference:PAID", status: "paid", until: future(), planId: "conference" }); + const hosting = async () => { let body; await get({ params: { conferenceID: "PAID" } }, { json: value => { body = value; } }); return body.hosting; }; + expect(await hosting()).to.equal(true); + await BillingGrant.updateOne({ _id: "conf-paid" }, { $set: { revoked: true } }); + expect(await hosting()).to.equal(false); + } finally { utils.getUser = originalUser; } + }); it("prevents two simultaneous checkout sessions and reuses an open session", async () => { let creates = 0; const stripe = { prices: { retrieve: async () => ({ active: true, currency: "eur", unit_amount: 500, recurring: { interval: "month", interval_count: 1 } }) }, subscriptions: { list: async () => ({ data: [] }) }, checkout: { sessions: { diff --git a/test/vue-ui.test.js b/test/vue-ui.test.js index 8a77788..bd84ce9 100644 --- a/test/vue-ui.test.js +++ b/test/vue-ui.test.js @@ -594,6 +594,34 @@ describe("Vue 3 UI", function () { }); } + it("opens Checkout for the subscription cycle the hosting option shows", async () => { + const billing = { ...taskBilling, plans: [...taskBilling.plans, + { id: "author_annual", amount: 4900, currency: "eur", interval: "year", repositories: 20, storage: 10737418240, description: "Renews yearly." }] }; + ui = await browser("/anonymize", { ...repositorySource, "/api/billing/": billing }); + await delay(20); + const state = ui.window.document.querySelector("#sourceUrl")._field.binding.state; state.detectedType = "repo"; + state.hostingQuotaBlocked = true; + expect(state.hostingOneTimePlans()).to.deep.equal([]); + expect(state.hostingSubscriptionPlan().id).to.equal("author_annual"); + expect(state.hostingChoice()).to.equal("author_annual"); + expect(state.selectedHostingPlan().id).to.equal("author_annual"); + }); + + it("leaves gist and pull request expiration dates outside the repository billing limit", async () => { + ui = await browser("/anonymize", { ...repositorySource, "/api/billing/": taskBilling }); + await delay(20); + const state = ui.window.document.querySelector("#sourceUrl")._field.binding.state; + const later = new Date(); later.setMonth(later.getMonth() + 10); + state.detectedType = "gist"; + state.options.expirationDate = new ui.window.Date(later.getTime()); + await delay(20); + expect(state.options.expirationDate.getTime()).to.equal(later.getTime()); + expect(new Date(state.maxExpirationDate).getTime()).to.be.greaterThan(later.getTime()); + state.detectedType = "repo"; + await delay(20); + expect(state.options.expirationDate.getTime()).to.be.lessThan(later.getTime()); + }); + it("keeps free, conference and coauthor work out of author checkout", async () => { ui = await browser("/anonymize", { ...repositorySource, "/api/billing/": taskBilling }); const state = ui.window.document.querySelector("#sourceUrl")._field.binding.state; state.detectedType = "repo";