diff --git a/README.md b/README.md index 2c88d8d..626d73f 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,140 @@ # WikidataSearch -## Introduction -WikidataSearch is a web application and API designed to facilitate the connection between users and the Wikidata Vector Database developed as pasrt of the [Wikidata Embedding Project](https://www.wikidata.org/wiki/Wikidata:Embedding_Project). +WikidataSearch is the API and web app for semantic retrieval over the Wikidata Vector Database from the [Wikidata Embedding Project](https://www.wikidata.org/wiki/Wikidata:Embedding_Project). -**Webapp:** [wd-vectordb.wmcloud.org](https://wd-vectordb.wmcloud.org/) \ -**Docs:** [wd-vectordb.wmcloud.org/docs](https://wd-vectordb.wmcloud.org/docs) \ -**Project Page:** [wikidata.org/wiki/Wikidata:Embedding_Project](https://www.wikidata.org/wiki/Wikidata:Embedding_Project) +This repository powers the public service. The intended usage is the hosted API, not running your own deployment. + +**Hosted Web App:** [https://wd-vectordb.wmcloud.org/](https://wd-vectordb.wmcloud.org/) +**Hosted API Docs (OpenAPI):** [https://wd-vectordb.wmcloud.org/docs](https://wd-vectordb.wmcloud.org/docs) +**Project Page:** [https://www.wikidata.org/wiki/Wikidata:Vector_Database](https://www.wikidata.org/wiki/Wikidata:Vector_Database) + +## Hosted API Usage + +Base URL: + +```text +https://wd-vectordb.wmcloud.org +``` + +Use a descriptive `User-Agent` for query endpoints. Generic user agents are rejected. + +Example header: + +```text +User-Agent: WikidataSearch-Client/1.0 (your-email@example.org) +``` + +Current operational constraints: + +- Rate limit is applied per `User-Agent` (default: `30/minute`). +- `return_vectors=true` is currently disabled and returns `422`. + +## API Endpoints + +### `GET /item/query/` + +Semantic + keyword search for Wikidata items (QIDs), fused with Reciprocal Rank Fusion (RRF). + +Parameters: + +- `query` (required): natural-language query or ID. +- `lang` (default: `all`): vector shard language; unknown languages are translated then searched globally. +- `K` (default/max: `50`): number of top results requested. +- `instanceof` (optional): comma-separated QIDs used as `P31` filter. +- `rerank` (default: `false`): apply reranker on textified Wikidata content. +- `return_vectors` (currently disabled). + +Example: + +```bash +curl -sG 'https://wd-vectordb.wmcloud.org/item/query/' \ + --data-urlencode 'query=Douglas Adams' \ + --data-urlencode 'lang=en' \ + --data-urlencode 'K=10' \ + -H 'User-Agent: WikidataSearch-Client/1.0 (your-email@example.org)' +``` + +### `GET /property/query/` + +Semantic + keyword search for Wikidata properties (PIDs), fused with RRF. + +Parameters: + +- `query` (required) +- `lang` (default: `all`) +- `K` (default/max: `50`) +- `instanceof` (optional): comma-separated QIDs used as `P31` filter. +- `exclude_external_ids` (default: `false`): excludes properties with datatype `external-id`. +- `rerank` (default: `false`) +- `return_vectors` (currently disabled) + +Example: + +```bash +curl -sG 'https://wd-vectordb.wmcloud.org/property/query/' \ + --data-urlencode 'query=instance of' \ + --data-urlencode 'lang=en' \ + --data-urlencode 'exclude_external_ids=true' \ + -H 'User-Agent: WikidataSearch-Client/1.0 (your-email@example.org)' +``` + +### `GET /similarity-score/` + +Similarity scoring for a fixed list of Wikidata IDs (QIDs and/or PIDs) against one query. + +Parameters: + +- `query` (required) +- `qid` (required): comma-separated IDs, for example `Q42,Q5,P31`. +- `lang` (default: `all`) +- `return_vectors` (currently disabled) + +Example: + +```bash +curl -sG 'https://wd-vectordb.wmcloud.org/similarity-score/' \ + --data-urlencode 'query=science fiction writer' \ + --data-urlencode 'qid=Q42,Q25169,P31' \ + -H 'User-Agent: WikidataSearch-Client/1.0 (your-email@example.org)' +``` + +## Response Shape + +`/item/query/` returns objects with: + +- `QID` +- `similarity_score` +- `rrf_score` +- `source` (`Vector Search`, `Keyword Search`, or both) +- `reranker_score` (when `rerank=true`) + +`/property/query/` returns the same shape with `PID` instead of `QID`. + +`/similarity-score/` returns: + +- `QID` or `PID` +- `similarity_score` + +## Architecture + +High-level request flow: + +1. FastAPI route receives the query, enforces user-agent policy, and rate limit. +2. `HybridSearch` orchestrates retrieval: + - Vector path: embeds query with Jina embeddings and searches Astra DB vector collections across language shards in parallel. + - Keyword path: runs Wikidata keyword search against `wikidata.org`. +3. Results are fused with Reciprocal Rank Fusion (RRF), preserving source attribution. +4. Optional reranking fetches Wikidata text representations and reorders top hits with Jina reranker. +5. JSON response is returned and request metadata is logged for analytics. + +Main components in this repo: + +- API app and routing: `wikidatasearch/main.py`, `wikidatasearch/routes/` +- Retrieval orchestration: `wikidatasearch/services/search/HybridSearch.py` +- Vector retrieval backend: `wikidatasearch/services/search/VectorSearch.py` +- Keyword retrieval backend: `wikidatasearch/services/search/KeywordSearch.py` +- Embeddings/reranking client: `wikidatasearch/services/jina.py` ## License -WikidataSearch is open-source software licensed under the MIT License. You are free to use, modify, and distribute the software as you wish. We kindly ask for a citation to this repository if you use WikidataSearch in your projects. -## Contact -For questions, comments, or discussions, please open an issue on this GitHub repository. We are committed to fostering a welcoming and collaborative community. +See [LICENSE](LICENSE). diff --git a/doc/adr/001_ADR_ Language_and_Entity_Type_Sharding.md b/doc/adr/001_ADR_ Language_and_Entity_Type_Sharding.md new file mode 100644 index 0000000..b4fb380 --- /dev/null +++ b/doc/adr/001_ADR_ Language_and_Entity_Type_Sharding.md @@ -0,0 +1,170 @@ +# **Architecture Decision Record**: Language and Entity-Type Sharding for the Wikidata Vector Database + +**Status**: Implemented +**Date**: 12 Mar 2026 + +## Context + +The Wikidata Vector Database initially stored all computed language embeddings for all entity types in a single vector index. As language coverage expanded, this architecture led to rapid index growth, degraded query performance, and reduced retrieval precision. We decided that our operations require a new vector database architecture to scale language support while maintaining search quality. + +The Wikidata Vector Database API exposes the following endpoints to query the vector database: + +* */item/query/* +* */property/query/* +* */similarity-score/* + +The first two */query/* endpoints perform hybrid search using vector search and keyword search, then combine results with Reciprocal Rank Fusion (RRF), optionally followed by reranking with a provided reranker model. + +The initial architecture used a single vector database containing all computed vectors of Wikidata entities, where: + +* Each entity stored one embedding per language +* All languages were stored in the same vector database +* Items and properties were stored together + +As support for additional languages expanded, this architecture introduced several concerns: + +* **Database growth:** Each additional language increased the number of vectors stored per entity, resulting in linear growth in database size. +* **Search performance degradation:** Larger vector indexes increase query latency. This has been evident when comparing query efficiency between the current database and previous experiments on a subset. +* **Decreased retrieval precision:** Larger vector indexes reduce the effectiveness of approximate nearest neighbour (ANN) search. As the index grows, the probability of missing highly relevant vectors increases related to the limits of ANN approximation. +* **Limited control over language exposure:** Results across languages depended solely on embedding similarity scores, making it difficult to ensure balanced exposure of entities across languages. + +These limitations made the single multilingual vector database increasingly slow and difficult to scale as language coverage increased. + +## Decision + +The vector database architecture will be migrated to a sharded design based on language and entity type. Instead of a single database containing all vectors, the system will use **a separate vector database per language per entity type.** + +Entity types include: + +* Wikidata **items** (\~21 million entities) +* Wikidata **properties** (\~12 thousand entities) + +Items and properties are stored in separate vector databases because they are queried through different API endpoints and are never retrieved together. Because the number of items is several orders of magnitude larger than the number of properties, properties could be underrepresented in search results if both entity types shared the same vector index. + +Additionally, combining items and properties in a single index would require additional filtering during vector search to separate entity types. Separating them simplifies query execution by removing the need for entity-type filtering inside the vector database. + +Languages currently supported: + +* **English** (\~21 million items) +* **French** (\~10.6 million items) +* **Arabic** (\~3 million items) +* **German** (\~9.7 million items) + +The new deployment will contain 8 vector databases: + +| Entity Type | Language | Database Name | \# Vectors | +| :---- | :---- | :---- | :---- | +| Item | English (EN) | items\_en | 21,127,781 | +| Item | French (FR) | items\_fr | 10,662,599 | +| Item | Arabic (AR) | items\_ar | 2,986,814 | +| Item | German (DE) | items\_de | 9,793,965 | +| Property | English (EN) | properties\_en | 24,459 | +| Property | French (FR) | properties\_fr | 21,008 | +| Property | Arabic (AR) | properties\_ar | 16,529 | +| Property | German (DE) | properties\_de | 14,174 | + +The new architecture is designed as a **general sharding pattern**, allowing more languages to be added without increasing the size of existing vector databases. + +## Query Orchestration Strategy + +The API server is responsible for orchestrating queries across the vector database shards. + +### Vector Search Execution + +When a query is received: + +1. The query is shared with an API server that computes and returns the embedding vectors. +2. The API determines which language shards the request calls based on the \`lang\` parameter. +3. Vector searches are executed in parallel across the relevant shards via a second API, which calls the vector database similarity search protocol for each shard. +4. Results from each shard are collected. + +### Language Selection + +The language (‘lang’) parameter determines which language shards are queried: +**Specific language:** Only the corresponding language shard is queried. +**All language:** All language shards for the entity type are queried in parallel. +**Unsupported language:** The query is translated to English, and the system falls back to querying all shards. + +**Future consideration**: define a default subset of languages to query, rather than querying all shards. This may become necessary if the number of supported languages increases significantly. + +### Query Endpoints + +Search endpoints (/item/query/ and /property/query/) combine **vector search** and **keyword search** using **Reciprocal Rank Fusion (RRF).** + +Queries are executed against vector databases corresponding to the requested entity type (items or properties). Within that entity type, vector search is executed independently on each relevant language shard. + +* */item/query/* searches item vector databases +* */property/query/* searches property vector databases + +RRF provides a ranking method that is independent of the raw similarity scores produced by individual retrieval methods or language shards. Entities are ranked by their RRF score, which increases when an entity appears in multiple result lists, such as: + +* Results returned from multiple language shards +* Both vector search and keyword search results + +Entities that appear frequently and at higher ranks across these resulting lists receive higher final rankings. + +### Similarity Score Endpoint + +The */similarity-score/* endpoint behaves differently from the search endpoints. Instead of retrieving entities, the user provides a list of entities and requests their similarity scores relative to a given query. + +For the requested entity type, the API performs the following steps: + +1. Queries relevant language shards in parallel. +2. Computes similarity scores between the query embedding and the vectors for the provided entities. +3. For each entity, the highest similarity score across all queried language shards is selected. + +This approach ensures a single, deterministic similarity score per entity while accounting for the best available language representation. + +## Consequences + +### Benefits + +**Scalable language support:** +Adding a new language requires adding a new vector database rather than expanding an existing one. + +**Improved search precision:** +Smaller vector indexes reduce nearest neighbour approximation errors and improve retrieval quality. + +**Improved query efficiency for single-language searches:** +Queries targeting a specific language search a smaller index. + +**Better control of multilingual exposure:** +Using RRF to combine shard results ensures that entities from different languages can appear in results instead of relying solely on embedding similarity scores. + +**Reduced index size per database:** +Smaller indexes are easier to maintain and scale operationally. + +### Trade-offs + +**Increased API complexity:** +The API server must now coordinate multiple vector searches, parallelize queries, and fuse results across shards. + +**Additional development effort:** +The migration required changes to query orchestration, result fusion logic, and search APIs. + +## Operational Considerations + +Shard growth occurs independently per language and entity type. Differences in vector counts between languages are expected. Monitoring should therefore focus on system health and query performance, including metrics such as query latency, query failure rates, and API timeout or retry rates. + +Shards are logically independent. Failure or degradation of a single language shard should not prevent the API from returning results from other shards. + +**Adding a new language requires:** + +1. Creating a new item vector database for the added language. +2. Creating a new property vector database for the added language. +3. Adding the appropriate language-specific configuration in [WikidataTextifier](https://github.com/philippesaade-wmde/WikidataTextifier/blob/main/src/Textifier/language_variables.json). +4. Generating embeddings for all entities in the new language vector database. +5. Generating embeddings for properties, including embeddings that incorporate example usage. +6. Updating the API configuration to include the new shards. + +Because queries may fan out across multiple shards, system capacity should account for the increased parallel query load as additional languages are introduced. + +## Alternatives Considered + +### Single multilingual vector database + +The previous architecture stored all vectors in a single database. This approach was rejected due to poor scalability as language coverage increased. + +### Entity-type split only + +Another option was to separate items and properties, but keep all languages in a single database. This was rejected because language growth would still increase index size and degrade approximate nearest neighbour (similarity) performance. diff --git a/docker-compose.yml b/docker-compose.yml index 4c1a946..3456af0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,8 +10,6 @@ services: MARIADB_ROOT_PASSWORD: ${DB_PASS} volumes: - ./data/mysql:/var/lib/mysql - ports: - - "3306:3306" healthcheck: test: ["CMD-SHELL", "mariadb-admin ping -h 127.0.0.1 -u root -p$${MARIADB_ROOT_PASSWORD} --silent"] interval: 5s @@ -32,8 +30,7 @@ services: ASTRA_DB_COLLECTION: ${ASTRA_DB_COLLECTION} # Embedding model API JINA_API_KEY: ${JINA_API_KEY} - # API key - API_SECRET: ${API_SECRET} + # Admin analytics ANALYTICS_API_SECRET: ${ANALYTICS_API_SECRET} # APIs WD_TEXTIFIER_API: ${WD_TEXTIFIER_API} diff --git a/frontend/dist/assets/index--RxJTflZ.js b/frontend/dist/assets/index-OLX4RYVc.js similarity index 59% rename from frontend/dist/assets/index--RxJTflZ.js rename to frontend/dist/assets/index-OLX4RYVc.js index d97d712..f06c495 100644 --- a/frontend/dist/assets/index--RxJTflZ.js +++ b/frontend/dist/assets/index-OLX4RYVc.js @@ -2,38 +2,38 @@ * @vue/shared v3.4.15 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Ds(e,t){const n=new Set(e.split(","));return t?r=>n.has(r.toLowerCase()):r=>n.has(r)}const pe={},sn=[],ze=()=>{},dc=()=>!1,xr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),$s=e=>e.startsWith("onUpdate:"),Ae=Object.assign,Us=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},hc=Object.prototype.hasOwnProperty,re=(e,t)=>hc.call(e,t),q=Array.isArray,on=e=>Vn(e)==="[object Map]",kr=e=>Vn(e)==="[object Set]",ko=e=>Vn(e)==="[object Date]",J=e=>typeof e=="function",Ce=e=>typeof e=="string",Mt=e=>typeof e=="symbol",me=e=>e!==null&&typeof e=="object",hi=e=>(me(e)||J(e))&&J(e.then)&&J(e.catch),mi=Object.prototype.toString,Vn=e=>mi.call(e),mc=e=>Vn(e).slice(8,-1),pi=e=>Vn(e)==="[object Object]",js=e=>Ce(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,er=Ds(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),wr=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},pc=/-(\w)/g,cn=wr(e=>e.replace(pc,(t,n)=>n?n.toUpperCase():"")),gc=/\B([A-Z])/g,Qt=wr(e=>e.replace(gc,"-$1").toLowerCase()),gi=wr(e=>e.charAt(0).toUpperCase()+e.slice(1)),Wr=wr(e=>e?`on${gi(e)}`:""),Ft=(e,t)=>!Object.is(e,t),tr=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Nn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let wo;const _i=()=>wo||(wo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hs(e){if(q(e)){const t={};for(let n=0;n{if(n){const r=n.split(bc);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Nt(e){let t="";if(Ce(e))t=e;else if(q(e))for(let n=0;nqt(n,t))}const gt=e=>Ce(e)?e:e==null?"":q(e)||me(e)&&(e.toString===mi||!J(e.toString))?JSON.stringify(e,vi,2):String(e),vi=(e,t)=>t&&t.__v_isRef?vi(e,t.value):on(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],s)=>(n[Vr(r,s)+" =>"]=o,n),{})}:kr(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Vr(n))}:Mt(t)?Vr(t):me(t)&&!q(t)&&!pi(t)?String(t):t,Vr=(e,t="")=>{var n;return Mt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +**/function Ds(e,t){const n=new Set(e.split(","));return t?r=>n.has(r.toLowerCase()):r=>n.has(r)}const ge={},sn=[],ze=()=>{},dc=()=>!1,xr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),$s=e=>e.startsWith("onUpdate:"),Ae=Object.assign,Us=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},hc=Object.prototype.hasOwnProperty,re=(e,t)=>hc.call(e,t),q=Array.isArray,on=e=>Vn(e)==="[object Map]",kr=e=>Vn(e)==="[object Set]",ko=e=>Vn(e)==="[object Date]",J=e=>typeof e=="function",Se=e=>typeof e=="string",Ft=e=>typeof e=="symbol",pe=e=>e!==null&&typeof e=="object",hi=e=>(pe(e)||J(e))&&J(e.then)&&J(e.catch),mi=Object.prototype.toString,Vn=e=>mi.call(e),mc=e=>Vn(e).slice(8,-1),pi=e=>Vn(e)==="[object Object]",js=e=>Se(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,er=Ds(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),wr=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},pc=/-(\w)/g,cn=wr(e=>e.replace(pc,(t,n)=>n?n.toUpperCase():"")),gc=/\B([A-Z])/g,Qt=wr(e=>e.replace(gc,"-$1").toLowerCase()),gi=wr(e=>e.charAt(0).toUpperCase()+e.slice(1)),Wr=wr(e=>e?`on${gi(e)}`:""),Dt=(e,t)=>!Object.is(e,t),tr=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Nn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let wo;const _i=()=>wo||(wo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hs(e){if(q(e)){const t={};for(let n=0;n{if(n){const r=n.split(bc);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function vt(e){let t="";if(Se(e))t=e;else if(q(e))for(let n=0;nqt(n,t))}const ut=e=>Se(e)?e:e==null?"":q(e)||pe(e)&&(e.toString===mi||!J(e.toString))?JSON.stringify(e,vi,2):String(e),vi=(e,t)=>t&&t.__v_isRef?vi(e,t.value):on(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],s)=>(n[Vr(r,s)+" =>"]=o,n),{})}:kr(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Vr(n))}:Ft(t)?Vr(t):pe(t)&&!q(t)&&!pi(t)?String(t):t,Vr=(e,t="")=>{var n;return Ft(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** * @vue/reactivity v3.4.15 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let Ze;class yi{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Ze,!t&&Ze&&(this.index=(Ze.scopes||(Ze.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=Ze;try{return Ze=this,t()}finally{Ze=n}}}on(){Ze=this}off(){Ze=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n=2))break}this._dirtyLevel<2&&(this._dirtyLevel=0),Zt()}return this._dirtyLevel>=2}set dirty(t){this._dirtyLevel=t?2:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Pt,n=Gt;try{return Pt=!0,Gt=this,this._runnings++,Io(this),this.fn()}finally{Lo(this),this._runnings--,Gt=n,Pt=t}}stop(){var t;this.active&&(Io(this),Lo(this),(t=this.onStop)==null||t.call(this),this.active=!1)}}function Cc(e){return e.value}function Io(e){e._trackId++,e._depsLength=0}function Lo(e){if(e.deps&&e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},os=new WeakMap,Yt=Symbol(""),ls=Symbol("");function Ye(e,t,n){if(Pt&&Gt){let r=os.get(e);r||os.set(e,r=new Map);let o=r.get(n);o||r.set(n,o=Li(()=>r.delete(n))),ki(Gt,o)}}function bt(e,t,n,r,o,s){const l=os.get(e);if(!l)return;let i=[];if(t==="clear")i=[...l.values()];else if(n==="length"&&q(e)){const a=Number(r);l.forEach((f,d)=>{(d==="length"||!Mt(d)&&d>=a)&&i.push(f)})}else switch(n!==void 0&&i.push(l.get(n)),t){case"add":q(e)?js(n)&&i.push(l.get("length")):(i.push(l.get(Yt)),on(e)&&i.push(l.get(ls)));break;case"delete":q(e)||(i.push(l.get(Yt)),on(e)&&i.push(l.get(ls)));break;case"set":on(e)&&i.push(l.get(Yt));break}Vs();for(const a of i)a&&wi(a,2);Ks()}const Sc=Ds("__proto__,__v_isRef,__isVue"),Ti=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Mt)),To=Oc();function Oc(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=le(this);for(let s=0,l=this.length;s{e[t]=function(...n){zt(),Vs();const r=le(this)[t].apply(this,n);return Ks(),Zt(),r}}),e}function Nc(e){const t=le(this);return Ye(t,"has",e),t.hasOwnProperty(e)}class Ci{constructor(t=!1,n=!1){this._isReadonly=t,this._shallow=n}get(t,n,r){const o=this._isReadonly,s=this._shallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?Kc:Pi:s?Ni:Oi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const l=q(t);if(!o){if(l&&re(To,n))return Reflect.get(To,n,r);if(n==="hasOwnProperty")return Nc}const i=Reflect.get(t,n,r);return(Mt(n)?Ti.has(n):Sc(n))||(o||Ye(t,"get",n),s)?i:We(i)?l&&js(n)?i:i.value:me(i)?o?Ri(i):Lr(i):i}}class Si extends Ci{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];if(!this._shallow){const a=un(s);if(!hr(r)&&!un(r)&&(s=le(s),r=le(r)),!q(t)&&We(s)&&!We(r))return a?!1:(s.value=r,!0)}const l=q(t)&&js(n)?Number(n)e,Ir=e=>Reflect.getPrototypeOf(e);function Gn(e,t,n=!1,r=!1){e=e.__v_raw;const o=le(e),s=le(t);n||(Ft(t,s)&&Ye(o,"get",t),Ye(o,"get",s));const{has:l}=Ir(o),i=r?Bs:n?qs:Pn;if(l.call(o,t))return i(e.get(t));if(l.call(o,s))return i(e.get(s));e!==o&&e.get(t)}function Yn(e,t=!1){const n=this.__v_raw,r=le(n),o=le(e);return t||(Ft(e,o)&&Ye(r,"has",e),Ye(r,"has",o)),e===o?n.has(e):n.has(e)||n.has(o)}function qn(e,t=!1){return e=e.__v_raw,!t&&Ye(le(e),"iterate",Yt),Reflect.get(e,"size",e)}function Co(e){e=le(e);const t=le(this);return Ir(t).has.call(t,e)||(t.add(e),bt(t,"add",e,e)),this}function So(e,t){t=le(t);const n=le(this),{has:r,get:o}=Ir(n);let s=r.call(n,e);s||(e=le(e),s=r.call(n,e));const l=o.call(n,e);return n.set(e,t),s?Ft(t,l)&&bt(n,"set",e,t):bt(n,"add",e,t),this}function Oo(e){const t=le(this),{has:n,get:r}=Ir(t);let o=n.call(t,e);o||(e=le(e),o=n.call(t,e)),r&&r.call(t,e);const s=t.delete(e);return o&&bt(t,"delete",e,void 0),s}function No(){const e=le(this),t=e.size!==0,n=e.clear();return t&&bt(e,"clear",void 0,void 0),n}function Xn(e,t){return function(r,o){const s=this,l=s.__v_raw,i=le(l),a=t?Bs:e?qs:Pn;return!e&&Ye(i,"iterate",Yt),l.forEach((f,d)=>r.call(o,a(f),a(d),s))}}function Jn(e,t,n){return function(...r){const o=this.__v_raw,s=le(o),l=on(s),i=e==="entries"||e===Symbol.iterator&&l,a=e==="keys"&&l,f=o[e](...r),d=n?Bs:t?qs:Pn;return!t&&Ye(s,"iterate",a?ls:Yt),{next(){const{value:h,done:m}=f.next();return m?{value:h,done:m}:{value:i?[d(h[0]),d(h[1])]:d(h),done:m}},[Symbol.iterator](){return this}}}}function xt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Fc(){const e={get(s){return Gn(this,s)},get size(){return qn(this)},has:Yn,add:Co,set:So,delete:Oo,clear:No,forEach:Xn(!1,!1)},t={get(s){return Gn(this,s,!1,!0)},get size(){return qn(this)},has:Yn,add:Co,set:So,delete:Oo,clear:No,forEach:Xn(!1,!0)},n={get(s){return Gn(this,s,!0)},get size(){return qn(this,!0)},has(s){return Yn.call(this,s,!0)},add:xt("add"),set:xt("set"),delete:xt("delete"),clear:xt("clear"),forEach:Xn(!0,!1)},r={get(s){return Gn(this,s,!0,!0)},get size(){return qn(this,!0)},has(s){return Yn.call(this,s,!0)},add:xt("add"),set:xt("set"),delete:xt("delete"),clear:xt("clear"),forEach:Xn(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=Jn(s,!1,!1),n[s]=Jn(s,!0,!1),t[s]=Jn(s,!1,!0),r[s]=Jn(s,!0,!0)}),[e,n,t,r]}const[Dc,$c,Uc,jc]=Fc();function Gs(e,t){const n=t?e?jc:Uc:e?$c:Dc;return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(re(n,o)&&o in r?n:r,o,s)}const Hc={get:Gs(!1,!1)},Wc={get:Gs(!1,!0)},Vc={get:Gs(!0,!1)},Oi=new WeakMap,Ni=new WeakMap,Pi=new WeakMap,Kc=new WeakMap;function Bc(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gc(e){return e.__v_skip||!Object.isExtensible(e)?0:Bc(mc(e))}function Lr(e){return un(e)?e:Ys(e,!1,Ac,Hc,Oi)}function Ai(e){return Ys(e,!1,Mc,Wc,Ni)}function Ri(e){return Ys(e,!0,Rc,Vc,Pi)}function Ys(e,t,n,r,o){if(!me(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=o.get(e);if(s)return s;const l=Gc(e);if(l===0)return e;const i=new Proxy(e,l===2?r:n);return o.set(e,i),i}function ln(e){return un(e)?ln(e.__v_raw):!!(e&&e.__v_isReactive)}function un(e){return!!(e&&e.__v_isReadonly)}function hr(e){return!!(e&&e.__v_isShallow)}function Mi(e){return ln(e)||un(e)}function le(e){const t=e&&e.__v_raw;return t?le(t):e}function Fi(e){return dr(e,"__v_skip",!0),e}const Pn=e=>me(e)?Lr(e):e,qs=e=>me(e)?Ri(e):e;class Di{constructor(t,n,r,o){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Ws(()=>t(this._value),()=>nr(this,1),()=>this.dep&&Ii(this.dep)),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=r}get value(){const t=le(this);return(!t._cacheable||t.effect.dirty)&&Ft(t._value,t._value=t.effect.run())&&nr(t,2),$i(t),t.effect._dirtyLevel>=1&&nr(t,1),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function Yc(e,t,n=!1){let r,o;const s=J(e);return s?(r=e,o=ze):(r=e.get,o=e.set),new Di(r,o,s||!o,n)}function $i(e){Pt&&Gt&&(e=le(e),ki(Gt,e.dep||(e.dep=Li(()=>e.dep=void 0,e instanceof Di?e:void 0))))}function nr(e,t=2,n){e=le(e);const r=e.dep;r&&wi(r,t)}function We(e){return!!(e&&e.__v_isRef===!0)}function fe(e){return Ui(e,!1)}function Xs(e){return Ui(e,!0)}function Ui(e,t){return We(e)?e:new qc(e,t)}class qc{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:le(t),this._value=n?t:Pn(t)}get value(){return $i(this),this._value}set value(t){const n=this.__v_isShallow||hr(t)||un(t);t=n?t:le(t),Ft(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:Pn(t),nr(this,2))}}function Be(e){return We(e)?e.value:e}const Xc={get:(e,t,n)=>Be(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return We(o)&&!We(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function ji(e){return ln(e)?e:new Proxy(e,Xc)}/** +**/let et;class yi{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=et,!t&&et&&(this.index=(et.scopes||(et.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=et;try{return et=this,t()}finally{et=n}}}on(){et=this}off(){et=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n=2))break}this._dirtyLevel<2&&(this._dirtyLevel=0),Zt()}return this._dirtyLevel>=2}set dirty(t){this._dirtyLevel=t?2:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=At,n=Gt;try{return At=!0,Gt=this,this._runnings++,Io(this),this.fn()}finally{Lo(this),this._runnings--,Gt=n,At=t}}stop(){var t;this.active&&(Io(this),Lo(this),(t=this.onStop)==null||t.call(this),this.active=!1)}}function Sc(e){return e.value}function Io(e){e._trackId++,e._depsLength=0}function Lo(e){if(e.deps&&e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},os=new WeakMap,Yt=Symbol(""),ls=Symbol("");function Ye(e,t,n){if(At&&Gt){let r=os.get(e);r||os.set(e,r=new Map);let o=r.get(n);o||r.set(n,o=Li(()=>r.delete(n))),ki(Gt,o)}}function yt(e,t,n,r,o,s){const l=os.get(e);if(!l)return;let i=[];if(t==="clear")i=[...l.values()];else if(n==="length"&&q(e)){const a=Number(r);l.forEach((f,d)=>{(d==="length"||!Ft(d)&&d>=a)&&i.push(f)})}else switch(n!==void 0&&i.push(l.get(n)),t){case"add":q(e)?js(n)&&i.push(l.get("length")):(i.push(l.get(Yt)),on(e)&&i.push(l.get(ls)));break;case"delete":q(e)||(i.push(l.get(Yt)),on(e)&&i.push(l.get(ls)));break;case"set":on(e)&&i.push(l.get(Yt));break}Vs();for(const a of i)a&&wi(a,2);Ks()}const Cc=Ds("__proto__,__v_isRef,__isVue"),Ti=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ft)),To=Oc();function Oc(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=le(this);for(let s=0,l=this.length;s{e[t]=function(...n){zt(),Vs();const r=le(this)[t].apply(this,n);return Ks(),Zt(),r}}),e}function Nc(e){const t=le(this);return Ye(t,"has",e),t.hasOwnProperty(e)}class Si{constructor(t=!1,n=!1){this._isReadonly=t,this._shallow=n}get(t,n,r){const o=this._isReadonly,s=this._shallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?Kc:Pi:s?Ni:Oi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const l=q(t);if(!o){if(l&&re(To,n))return Reflect.get(To,n,r);if(n==="hasOwnProperty")return Nc}const i=Reflect.get(t,n,r);return(Ft(n)?Ti.has(n):Cc(n))||(o||Ye(t,"get",n),s)?i:Ve(i)?l&&js(n)?i:i.value:pe(i)?o?Ri(i):Lr(i):i}}class Ci extends Si{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];if(!this._shallow){const a=un(s);if(!hr(r)&&!un(r)&&(s=le(s),r=le(r)),!q(t)&&Ve(s)&&!Ve(r))return a?!1:(s.value=r,!0)}const l=q(t)&&js(n)?Number(n)e,Ir=e=>Reflect.getPrototypeOf(e);function Gn(e,t,n=!1,r=!1){e=e.__v_raw;const o=le(e),s=le(t);n||(Dt(t,s)&&Ye(o,"get",t),Ye(o,"get",s));const{has:l}=Ir(o),i=r?Bs:n?qs:Pn;if(l.call(o,t))return i(e.get(t));if(l.call(o,s))return i(e.get(s));e!==o&&e.get(t)}function Yn(e,t=!1){const n=this.__v_raw,r=le(n),o=le(e);return t||(Dt(e,o)&&Ye(r,"has",e),Ye(r,"has",o)),e===o?n.has(e):n.has(e)||n.has(o)}function qn(e,t=!1){return e=e.__v_raw,!t&&Ye(le(e),"iterate",Yt),Reflect.get(e,"size",e)}function So(e){e=le(e);const t=le(this);return Ir(t).has.call(t,e)||(t.add(e),yt(t,"add",e,e)),this}function Co(e,t){t=le(t);const n=le(this),{has:r,get:o}=Ir(n);let s=r.call(n,e);s||(e=le(e),s=r.call(n,e));const l=o.call(n,e);return n.set(e,t),s?Dt(t,l)&&yt(n,"set",e,t):yt(n,"add",e,t),this}function Oo(e){const t=le(this),{has:n,get:r}=Ir(t);let o=n.call(t,e);o||(e=le(e),o=n.call(t,e)),r&&r.call(t,e);const s=t.delete(e);return o&&yt(t,"delete",e,void 0),s}function No(){const e=le(this),t=e.size!==0,n=e.clear();return t&&yt(e,"clear",void 0,void 0),n}function Xn(e,t){return function(r,o){const s=this,l=s.__v_raw,i=le(l),a=t?Bs:e?qs:Pn;return!e&&Ye(i,"iterate",Yt),l.forEach((f,d)=>r.call(o,a(f),a(d),s))}}function Jn(e,t,n){return function(...r){const o=this.__v_raw,s=le(o),l=on(s),i=e==="entries"||e===Symbol.iterator&&l,a=e==="keys"&&l,f=o[e](...r),d=n?Bs:t?qs:Pn;return!t&&Ye(s,"iterate",a?ls:Yt),{next(){const{value:h,done:m}=f.next();return m?{value:h,done:m}:{value:i?[d(h[0]),d(h[1])]:d(h),done:m}},[Symbol.iterator](){return this}}}}function wt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Fc(){const e={get(s){return Gn(this,s)},get size(){return qn(this)},has:Yn,add:So,set:Co,delete:Oo,clear:No,forEach:Xn(!1,!1)},t={get(s){return Gn(this,s,!1,!0)},get size(){return qn(this)},has:Yn,add:So,set:Co,delete:Oo,clear:No,forEach:Xn(!1,!0)},n={get(s){return Gn(this,s,!0)},get size(){return qn(this,!0)},has(s){return Yn.call(this,s,!0)},add:wt("add"),set:wt("set"),delete:wt("delete"),clear:wt("clear"),forEach:Xn(!0,!1)},r={get(s){return Gn(this,s,!0,!0)},get size(){return qn(this,!0)},has(s){return Yn.call(this,s,!0)},add:wt("add"),set:wt("set"),delete:wt("delete"),clear:wt("clear"),forEach:Xn(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=Jn(s,!1,!1),n[s]=Jn(s,!0,!1),t[s]=Jn(s,!1,!0),r[s]=Jn(s,!0,!0)}),[e,n,t,r]}const[Dc,$c,Uc,jc]=Fc();function Gs(e,t){const n=t?e?jc:Uc:e?$c:Dc;return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(re(n,o)&&o in r?n:r,o,s)}const Hc={get:Gs(!1,!1)},Wc={get:Gs(!1,!0)},Vc={get:Gs(!0,!1)},Oi=new WeakMap,Ni=new WeakMap,Pi=new WeakMap,Kc=new WeakMap;function Bc(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gc(e){return e.__v_skip||!Object.isExtensible(e)?0:Bc(mc(e))}function Lr(e){return un(e)?e:Ys(e,!1,Ac,Hc,Oi)}function Ai(e){return Ys(e,!1,Mc,Wc,Ni)}function Ri(e){return Ys(e,!0,Rc,Vc,Pi)}function Ys(e,t,n,r,o){if(!pe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=o.get(e);if(s)return s;const l=Gc(e);if(l===0)return e;const i=new Proxy(e,l===2?r:n);return o.set(e,i),i}function ln(e){return un(e)?ln(e.__v_raw):!!(e&&e.__v_isReactive)}function un(e){return!!(e&&e.__v_isReadonly)}function hr(e){return!!(e&&e.__v_isShallow)}function Mi(e){return ln(e)||un(e)}function le(e){const t=e&&e.__v_raw;return t?le(t):e}function Fi(e){return dr(e,"__v_skip",!0),e}const Pn=e=>pe(e)?Lr(e):e,qs=e=>pe(e)?Ri(e):e;class Di{constructor(t,n,r,o){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Ws(()=>t(this._value),()=>nr(this,1),()=>this.dep&&Ii(this.dep)),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=r}get value(){const t=le(this);return(!t._cacheable||t.effect.dirty)&&Dt(t._value,t._value=t.effect.run())&&nr(t,2),$i(t),t.effect._dirtyLevel>=1&&nr(t,1),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function Yc(e,t,n=!1){let r,o;const s=J(e);return s?(r=e,o=ze):(r=e.get,o=e.set),new Di(r,o,s||!o,n)}function $i(e){At&&Gt&&(e=le(e),ki(Gt,e.dep||(e.dep=Li(()=>e.dep=void 0,e instanceof Di?e:void 0))))}function nr(e,t=2,n){e=le(e);const r=e.dep;r&&wi(r,t)}function Ve(e){return!!(e&&e.__v_isRef===!0)}function ue(e){return Ui(e,!1)}function Xs(e){return Ui(e,!0)}function Ui(e,t){return Ve(e)?e:new qc(e,t)}class qc{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:le(t),this._value=n?t:Pn(t)}get value(){return $i(this),this._value}set value(t){const n=this.__v_isShallow||hr(t)||un(t);t=n?t:le(t),Dt(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:Pn(t),nr(this,2))}}function Me(e){return Ve(e)?e.value:e}const Xc={get:(e,t,n)=>Me(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Ve(o)&&!Ve(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function ji(e){return ln(e)?e:new Proxy(e,Xc)}/** * @vue/runtime-core v3.4.15 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function At(e,t,n,r){let o;try{o=r?e(...r):e()}catch(s){Tr(s,t,n)}return o}function nt(e,t,n,r){if(J(e)){const s=At(e,t,n,r);return s&&hi(s)&&s.catch(l=>{Tr(l,t,n)}),s}const o=[];for(let s=0;s>>1,o=Me[r],s=Rn(o);sct&&Me.splice(t,1)}function Zc(e){q(e)?an.push(...e):(!Lt||!Lt.includes(e,e.allowRecurse?Vt+1:Vt))&&an.push(e),Wi()}function Po(e,t,n=An?ct+1:0){for(;nRn(n)-Rn(r));if(an.length=0,Lt){Lt.push(...t);return}for(Lt=t,Vt=0;Vte.id==null?1/0:e.id,eu=(e,t)=>{const n=Rn(e)-Rn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Ki(e){is=!1,An=!0,Me.sort(eu);try{for(ct=0;ctCe(_)?_.trim():_)),h&&(o=n.map(Nn))}let i,a=r[i=Wr(t)]||r[i=Wr(cn(t))];!a&&s&&(a=r[i=Wr(Qt(t))]),a&&nt(a,e,6,o);const f=r[i+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,nt(f,e,6,o)}}function Bi(e,t,n=!1){const r=t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let l={},i=!1;if(!J(e)){const a=f=>{const d=Bi(f,t,!0);d&&(i=!0,Ae(l,d))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!s&&!i?(me(e)&&r.set(e,null),null):(q(s)?s.forEach(a=>l[a]=null):Ae(l,s),me(e)&&r.set(e,l),l)}function Cr(e,t){return!e||!xr(t)?!1:(t=t.slice(2).replace(/Once$/,""),re(e,t[0].toLowerCase()+t.slice(1))||re(e,Qt(t))||re(e,t))}let Ge=null,Gi=null;function mr(e){const t=Ge;return Ge=e,Gi=e&&e.type.__scopeId||null,t}function nu(e,t=Ge,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&Wo(-1);const s=mr(t);let l;try{l=e(...o)}finally{mr(s),r._d&&Wo(1)}return l};return r._n=!0,r._c=!0,r._d=!0,r}function Kr(e){const{type:t,vnode:n,proxy:r,withProxy:o,props:s,propsOptions:[l],slots:i,attrs:a,emit:f,render:d,renderCache:h,data:m,setupState:_,ctx:v,inheritAttrs:x}=e;let w,g;const E=mr(e);try{if(n.shapeFlag&4){const I=o||r,N=I;w=at(d.call(N,I,h,s,_,m,v)),g=a}else{const I=t;w=at(I.length>1?I(s,{attrs:a,slots:i,emit:f}):I(s,null)),g=t.props?a:ru(a)}}catch(I){Tn.length=0,Tr(I,e,1),w=_e(Xt)}let T=w;if(g&&x!==!1){const I=Object.keys(g),{shapeFlag:N}=T;I.length&&N&7&&(l&&I.some($s)&&(g=su(g,l)),T=fn(T,g))}return n.dirs&&(T=fn(T),T.dirs=T.dirs?T.dirs.concat(n.dirs):n.dirs),n.transition&&(T.transition=n.transition),w=T,mr(E),w}const ru=e=>{let t;for(const n in e)(n==="class"||n==="style"||xr(n))&&((t||(t={}))[n]=e[n]);return t},su=(e,t)=>{const n={};for(const r in e)(!$s(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function ou(e,t,n){const{props:r,children:o,component:s}=e,{props:l,children:i,patchFlag:a}=t,f=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return r?Ao(r,l,f):!!l;if(a&8){const d=t.dynamicProps;for(let h=0;he.__isSuspense;function cu(e,t){t&&t.pendingBranch?q(e)?t.effects.push(...e):t.effects.push(e):Zc(e)}const uu=Symbol.for("v-scx"),fu=()=>dt(uu),Qn={};function Rt(e,t,n){return Yi(e,t,n)}function Yi(e,t,{immediate:n,deep:r,flush:o,once:s,onTrack:l,onTrigger:i}=pe){if(t&&s){const L=t;t=(...M)=>{L(...M),N()}}const a=Fe,f=L=>r===!0?L:Kt(L,r===!1?1:void 0);let d,h=!1,m=!1;if(We(e)?(d=()=>e.value,h=hr(e)):ln(e)?(d=()=>f(e),h=!0):q(e)?(m=!0,h=e.some(L=>ln(L)||hr(L)),d=()=>e.map(L=>{if(We(L))return L.value;if(ln(L))return f(L);if(J(L))return At(L,a,2)})):J(e)?t?d=()=>At(e,a,2):d=()=>(_&&_(),nt(e,a,3,[v])):d=ze,t&&r){const L=d;d=()=>Kt(L())}let _,v=L=>{_=T.onStop=()=>{At(L,a,4),_=T.onStop=void 0}},x;if(Pr)if(v=ze,t?n&&nt(t,a,3,[d(),m?[]:void 0,v]):d(),o==="sync"){const L=fu();x=L.__watcherHandles||(L.__watcherHandles=[])}else return ze;let w=m?new Array(e.length).fill(Qn):Qn;const g=()=>{if(!(!T.active||!T.dirty))if(t){const L=T.run();(r||h||(m?L.some((M,R)=>Ft(M,w[R])):Ft(L,w)))&&(_&&_(),nt(t,a,3,[L,w===Qn?void 0:m&&w[0]===Qn?[]:w,v]),w=L)}else T.run()};g.allowRecurse=!!t;let E;o==="sync"?E=g:o==="post"?E=()=>Ke(g,a&&a.suspense):(g.pre=!0,a&&(g.id=a.uid),E=()=>zs(g));const T=new Ws(d,ze,E),I=Tc(),N=()=>{T.stop(),I&&Us(I.effects,T)};return t?n?g():w=T.run():o==="post"?Ke(T.run.bind(T),a&&a.suspense):T.run(),x&&x.push(N),N}function du(e,t,n){const r=this.proxy,o=Ce(e)?e.includes(".")?qi(r,e):()=>r[e]:e.bind(r,r);let s;J(t)?s=t:(s=t.handler,n=t);const l=Bn(this),i=Yi(o,s.bind(r),n);return l(),i}function qi(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o0){if(n>=t)return e;n++}if(r=r||new Set,r.has(e))return e;if(r.add(e),We(e))Kt(e.value,t,n,r);else if(q(e))for(let o=0;o{Kt(o,t,n,r)});else if(pi(e))for(const o in e)Kt(e[o],t,n,r);return e}function rr(e,t){if(Ge===null)return e;const n=Ar(Ge)||Ge.proxy,r=e.dirs||(e.dirs=[]);for(let o=0;o!!e.type.__asyncLoader,Xi=e=>e.type.__isKeepAlive;function hu(e,t){Ji(e,"a",t)}function mu(e,t){Ji(e,"da",t)}function Ji(e,t,n=Fe){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Sr(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Xi(o.parent.vnode)&&pu(r,t,n,o),o=o.parent}}function pu(e,t,n,r){const o=Sr(t,e,r,!0);Zs(()=>{Us(r[t],o)},n)}function Sr(e,t,n=Fe,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...l)=>{if(n.isUnmounted)return;zt();const i=Bn(n),a=nt(t,n,e,l);return i(),Zt(),a});return r?o.unshift(s):o.push(s),s}}const yt=e=>(t,n=Fe)=>(!Pr||e==="sp")&&Sr(e,(...r)=>t(...r),n),Qi=yt("bm"),Or=yt("m"),gu=yt("bu"),_u=yt("u"),bu=yt("bum"),Zs=yt("um"),vu=yt("sp"),yu=yt("rtg"),Eu=yt("rtc");function xu(e,t=Fe){Sr("ec",e,t)}function as(e,t,n,r){let o;const s=n&&n[r];if(q(e)||Ce(e)){o=new Array(e.length);for(let l=0,i=e.length;lt(l,i,void 0,s&&s[i]));else{const l=Object.keys(e);o=new Array(l.length);for(let i=0,a=l.length;ie?ua(e)?Ar(e)||e.proxy:cs(e.parent):null,Ln=Ae(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=>cs(e.parent),$root:e=>cs(e.root),$emit:e=>e.emit,$options:e=>eo(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,zs(e.update)}),$nextTick:e=>e.n||(e.n=Qs.bind(e.proxy)),$watch:e=>du.bind(e)}),Br=(e,t)=>e!==pe&&!e.__isScriptSetup&&re(e,t),ku={get({_:e},t){const{ctx:n,setupState:r,data:o,props:s,accessCache:l,type:i,appContext:a}=e;let f;if(t[0]!=="$"){const _=l[t];if(_!==void 0)switch(_){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(Br(r,t))return l[t]=1,r[t];if(o!==pe&&re(o,t))return l[t]=2,o[t];if((f=e.propsOptions[0])&&re(f,t))return l[t]=3,s[t];if(n!==pe&&re(n,t))return l[t]=4,n[t];us&&(l[t]=0)}}const d=Ln[t];let h,m;if(d)return t==="$attrs"&&Ye(e,"get",t),d(e);if((h=i.__cssModules)&&(h=h[t]))return h;if(n!==pe&&re(n,t))return l[t]=4,n[t];if(m=a.config.globalProperties,re(m,t))return m[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:s}=e;return Br(o,t)?(o[t]=n,!0):r!==pe&&re(r,t)?(r[t]=n,!0):re(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,propsOptions:s}},l){let i;return!!n[l]||e!==pe&&re(e,l)||Br(t,l)||(i=s[0])&&re(i,l)||re(r,l)||re(Ln,l)||re(o.config.globalProperties,l)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:re(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ro(e){return q(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let us=!0;function wu(e){const t=eo(e),n=e.proxy,r=e.ctx;us=!1,t.beforeCreate&&Mo(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:l,watch:i,provide:a,inject:f,created:d,beforeMount:h,mounted:m,beforeUpdate:_,updated:v,activated:x,deactivated:w,beforeDestroy:g,beforeUnmount:E,destroyed:T,unmounted:I,render:N,renderTracked:L,renderTriggered:M,errorCaptured:R,serverPrefetch:Q,expose:te,inheritAttrs:be,components:ue,directives:de,filters:De}=t;if(f&&Iu(f,r,null),l)for(const z in l){const ne=l[z];J(ne)&&(r[z]=ne.bind(n))}if(o){const z=o.call(n,n);me(z)&&(e.data=Lr(z))}if(us=!0,s)for(const z in s){const ne=s[z],Re=J(ne)?ne.bind(n,n):J(ne.get)?ne.get.bind(n,n):ze,ke=!J(ne)&&J(ne.set)?ne.set.bind(n):ze,Ne=Ee({get:Re,set:ke});Object.defineProperty(r,z,{enumerable:!0,configurable:!0,get:()=>Ne.value,set:we=>Ne.value=we})}if(i)for(const z in i)zi(i[z],r,n,z);if(a){const z=J(a)?a.call(n):a;Reflect.ownKeys(z).forEach(ne=>{or(ne,z[ne])})}d&&Mo(d,e,"c");function se(z,ne){q(ne)?ne.forEach(Re=>z(Re.bind(n))):ne&&z(ne.bind(n))}if(se(Qi,h),se(Or,m),se(gu,_),se(_u,v),se(hu,x),se(mu,w),se(xu,R),se(Eu,L),se(yu,M),se(bu,E),se(Zs,I),se(vu,Q),q(te))if(te.length){const z=e.exposed||(e.exposed={});te.forEach(ne=>{Object.defineProperty(z,ne,{get:()=>n[ne],set:Re=>n[ne]=Re})})}else e.exposed||(e.exposed={});N&&e.render===ze&&(e.render=N),be!=null&&(e.inheritAttrs=be),ue&&(e.components=ue),de&&(e.directives=de)}function Iu(e,t,n=ze){q(e)&&(e=fs(e));for(const r in e){const o=e[r];let s;me(o)?"default"in o?s=dt(o.from||r,o.default,!0):s=dt(o.from||r):s=dt(o),We(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:l=>s.value=l}):t[r]=s}}function Mo(e,t,n){nt(q(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function zi(e,t,n,r){const o=r.includes(".")?qi(n,r):()=>n[r];if(Ce(e)){const s=t[e];J(s)&&Rt(o,s)}else if(J(e))Rt(o,e.bind(n));else if(me(e))if(q(e))e.forEach(s=>zi(s,t,n,r));else{const s=J(e.handler)?e.handler.bind(n):t[e.handler];J(s)&&Rt(o,s,e)}}function eo(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:l}}=e.appContext,i=s.get(t);let a;return i?a=i:!o.length&&!n&&!r?a=t:(a={},o.length&&o.forEach(f=>pr(a,f,l,!0)),pr(a,t,l)),me(t)&&s.set(t,a),a}function pr(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&pr(e,s,n,!0),o&&o.forEach(l=>pr(e,l,n,!0));for(const l in t)if(!(r&&l==="expose")){const i=Lu[l]||n&&n[l];e[l]=i?i(e[l],t[l]):t[l]}return e}const Lu={data:Fo,props:Do,emits:Do,methods:In,computed:In,beforeCreate:Ue,created:Ue,beforeMount:Ue,mounted:Ue,beforeUpdate:Ue,updated:Ue,beforeDestroy:Ue,beforeUnmount:Ue,destroyed:Ue,unmounted:Ue,activated:Ue,deactivated:Ue,errorCaptured:Ue,serverPrefetch:Ue,components:In,directives:In,watch:Cu,provide:Fo,inject:Tu};function Fo(e,t){return t?e?function(){return Ae(J(e)?e.call(this,this):e,J(t)?t.call(this,this):t)}:t:e}function Tu(e,t){return In(fs(e),fs(t))}function fs(e){if(q(e)){const t={};for(let n=0;n1)return n&&J(t)?t.call(r&&r.proxy):t}}function Nu(e,t,n,r=!1){const o={},s={};dr(s,Nr,1),e.propsDefaults=Object.create(null),ea(e,t,o,s);for(const l in e.propsOptions[0])l in o||(o[l]=void 0);n?e.props=r?o:Ai(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function Pu(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:l}}=e,i=le(o),[a]=e.propsOptions;let f=!1;if((r||l>0)&&!(l&16)){if(l&8){const d=e.vnode.dynamicProps;for(let h=0;h{a=!0;const[m,_]=ta(h,t,!0);Ae(l,m),_&&i.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!s&&!a)return me(e)&&r.set(e,sn),sn;if(q(s))for(let d=0;d-1,_[1]=x<0||v-1||re(_,"default"))&&i.push(h)}}}const f=[l,i];return me(e)&&r.set(e,f),f}function $o(e){return e[0]!=="$"}function Uo(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function jo(e,t){return Uo(e)===Uo(t)}function Ho(e,t){return q(t)?t.findIndex(n=>jo(n,e)):J(t)&&jo(t,e)?0:-1}const na=e=>e[0]==="_"||e==="$stable",to=e=>q(e)?e.map(at):[at(e)],Au=(e,t,n)=>{if(t._n)return t;const r=nu((...o)=>to(t(...o)),n);return r._c=!1,r},ra=(e,t,n)=>{const r=e._ctx;for(const o in e){if(na(o))continue;const s=e[o];if(J(s))t[o]=Au(o,s,r);else if(s!=null){const l=to(s);t[o]=()=>l}}},sa=(e,t)=>{const n=to(t);e.slots.default=()=>n},Ru=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=le(t),dr(t,"_",n)):ra(t,e.slots={})}else e.slots={},t&&sa(e,t);dr(e.slots,Nr,1)},Mu=(e,t,n)=>{const{vnode:r,slots:o}=e;let s=!0,l=pe;if(r.shapeFlag&32){const i=t._;i?n&&i===1?s=!1:(Ae(o,t),!n&&i===1&&delete o._):(s=!t.$stable,ra(t,o)),l=t}else t&&(sa(e,t),l={default:1});if(s)for(const i in o)!na(i)&&l[i]==null&&delete o[i]};function hs(e,t,n,r,o=!1){if(q(e)){e.forEach((m,_)=>hs(m,t&&(q(t)?t[_]:t),n,r,o));return}if(sr(r)&&!o)return;const s=r.shapeFlag&4?Ar(r.component)||r.component.proxy:r.el,l=o?null:s,{i,r:a}=e,f=t&&t.r,d=i.refs===pe?i.refs={}:i.refs,h=i.setupState;if(f!=null&&f!==a&&(Ce(f)?(d[f]=null,re(h,f)&&(h[f]=null)):We(f)&&(f.value=null)),J(a))At(a,i,12,[l,d]);else{const m=Ce(a),_=We(a),v=e.f;if(m||_){const x=()=>{if(v){const w=m?re(h,a)?h[a]:d[a]:a.value;o?q(w)&&Us(w,s):q(w)?w.includes(s)||w.push(s):m?(d[a]=[s],re(h,a)&&(h[a]=d[a])):(a.value=[s],e.k&&(d[e.k]=a.value))}else m?(d[a]=l,re(h,a)&&(h[a]=l)):_&&(a.value=l,e.k&&(d[e.k]=l))};o||v?x():(x.id=-1,Ke(x,n))}}}const Ke=cu;function Fu(e){return Du(e)}function Du(e,t){const n=_i();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:l,createText:i,createComment:a,setText:f,setElementText:d,parentNode:h,nextSibling:m,setScopeId:_=ze,insertStaticContent:v}=e,x=(u,c,p,b=null,k=null,O=null,F=void 0,A=null,U=!!c.dynamicChildren)=>{if(u===c)return;u&&!En(u,c)&&(b=S(u),we(u,k,O,!0),u=null),c.patchFlag===-2&&(U=!1,c.dynamicChildren=null);const{type:P,ref:V,shapeFlag:W}=c;switch(P){case Kn:w(u,c,p,b);break;case Xt:g(u,c,p,b);break;case lr:u==null&&E(c,p,b,F);break;case He:ue(u,c,p,b,k,O,F,A,U);break;default:W&1?N(u,c,p,b,k,O,F,A,U):W&6?de(u,c,p,b,k,O,F,A,U):(W&64||W&128)&&P.process(u,c,p,b,k,O,F,A,U,K)}V!=null&&k&&hs(V,u&&u.ref,O,c||u,!c)},w=(u,c,p,b)=>{if(u==null)r(c.el=i(c.children),p,b);else{const k=c.el=u.el;c.children!==u.children&&f(k,c.children)}},g=(u,c,p,b)=>{u==null?r(c.el=a(c.children||""),p,b):c.el=u.el},E=(u,c,p,b)=>{[u.el,u.anchor]=v(u.children,c,p,b,u.el,u.anchor)},T=({el:u,anchor:c},p,b)=>{let k;for(;u&&u!==c;)k=m(u),r(u,p,b),u=k;r(c,p,b)},I=({el:u,anchor:c})=>{let p;for(;u&&u!==c;)p=m(u),o(u),u=p;o(c)},N=(u,c,p,b,k,O,F,A,U)=>{c.type==="svg"?F="svg":c.type==="math"&&(F="mathml"),u==null?L(c,p,b,k,O,F,A,U):Q(u,c,k,O,F,A,U)},L=(u,c,p,b,k,O,F,A)=>{let U,P;const{props:V,shapeFlag:W,transition:y,dirs:C}=u;if(U=u.el=l(u.type,O,V&&V.is,V),W&8?d(U,u.children):W&16&&R(u.children,U,null,b,k,Gr(u,O),F,A),C&&jt(u,null,b,"created"),M(U,u,u.scopeId,F,b),V){for(const G in V)G!=="value"&&!er(G)&&s(U,G,null,V[G],O,u.children,b,k,xe);"value"in V&&s(U,"value",null,V.value,O),(P=V.onVnodeBeforeMount)&<(P,b,u)}C&&jt(u,null,b,"beforeMount");const B=$u(k,y);B&&y.beforeEnter(U),r(U,c,p),((P=V&&V.onVnodeMounted)||B||C)&&Ke(()=>{P&<(P,b,u),B&&y.enter(U),C&&jt(u,null,b,"mounted")},k)},M=(u,c,p,b,k)=>{if(p&&_(u,p),b)for(let O=0;O{for(let P=U;P{const A=c.el=u.el;let{patchFlag:U,dynamicChildren:P,dirs:V}=c;U|=u.patchFlag&16;const W=u.props||pe,y=c.props||pe;let C;if(p&&Ht(p,!1),(C=y.onVnodeBeforeUpdate)&<(C,p,c,u),V&&jt(c,u,p,"beforeUpdate"),p&&Ht(p,!0),P?te(u.dynamicChildren,P,A,p,b,Gr(c,k),O):F||ne(u,c,A,null,p,b,Gr(c,k),O,!1),U>0){if(U&16)be(A,c,W,y,p,b,k);else if(U&2&&W.class!==y.class&&s(A,"class",null,y.class,k),U&4&&s(A,"style",W.style,y.style,k),U&8){const B=c.dynamicProps;for(let G=0;G{C&<(C,p,c,u),V&&jt(c,u,p,"updated")},b)},te=(u,c,p,b,k,O,F)=>{for(let A=0;A{if(p!==b){if(p!==pe)for(const A in p)!er(A)&&!(A in b)&&s(u,A,p[A],null,F,c.children,k,O,xe);for(const A in b){if(er(A))continue;const U=b[A],P=p[A];U!==P&&A!=="value"&&s(u,A,P,U,F,c.children,k,O,xe)}"value"in b&&s(u,"value",p.value,b.value,F)}},ue=(u,c,p,b,k,O,F,A,U)=>{const P=c.el=u?u.el:i(""),V=c.anchor=u?u.anchor:i("");let{patchFlag:W,dynamicChildren:y,slotScopeIds:C}=c;C&&(A=A?A.concat(C):C),u==null?(r(P,p,b),r(V,p,b),R(c.children||[],p,V,k,O,F,A,U)):W>0&&W&64&&y&&u.dynamicChildren?(te(u.dynamicChildren,y,p,k,O,F,A),(c.key!=null||k&&c===k.subTree)&&oa(u,c,!0)):ne(u,c,p,V,k,O,F,A,U)},de=(u,c,p,b,k,O,F,A,U)=>{c.slotScopeIds=A,u==null?c.shapeFlag&512?k.ctx.activate(c,p,b,F,U):De(c,p,b,k,O,F,U):$e(u,c,U)},De=(u,c,p,b,k,O,F)=>{const A=u.component=Yu(u,b,k);if(Xi(u)&&(A.ctx.renderer=K),qu(A),A.asyncDep){if(k&&k.registerDep(A,se),!u.el){const U=A.subTree=_e(Xt);g(null,U,c,p)}}else se(A,u,c,p,k,O,F)},$e=(u,c,p)=>{const b=c.component=u.component;if(ou(u,c,p))if(b.asyncDep&&!b.asyncResolved){z(b,c,p);return}else b.next=c,zc(b.update),b.effect.dirty=!0,b.update();else c.el=u.el,b.vnode=c},se=(u,c,p,b,k,O,F)=>{const A=()=>{if(u.isMounted){let{next:V,bu:W,u:y,parent:C,vnode:B}=u;{const Et=la(u);if(Et){V&&(V.el=B.el,z(u,V,F)),Et.asyncDep.then(()=>{u.isUnmounted||A()});return}}let G=V,oe;Ht(u,!1),V?(V.el=B.el,z(u,V,F)):V=B,W&&tr(W),(oe=V.props&&V.props.onVnodeBeforeUpdate)&<(oe,C,V,B),Ht(u,!0);const ve=Kr(u),Se=u.subTree;u.subTree=ve,x(Se,ve,h(Se.el),S(Se),u,k,O),V.el=ve.el,G===null&&lu(u,ve.el),y&&Ke(y,k),(oe=V.props&&V.props.onVnodeUpdated)&&Ke(()=>lt(oe,C,V,B),k)}else{let V;const{el:W,props:y}=c,{bm:C,m:B,parent:G}=u,oe=sr(c);if(Ht(u,!1),C&&tr(C),!oe&&(V=y&&y.onVnodeBeforeMount)&<(V,G,c),Ht(u,!0),W&&ie){const ve=()=>{u.subTree=Kr(u),ie(W,u.subTree,u,k,null)};oe?c.type.__asyncLoader().then(()=>!u.isUnmounted&&ve()):ve()}else{const ve=u.subTree=Kr(u);x(null,ve,p,b,u,k,O),c.el=ve.el}if(B&&Ke(B,k),!oe&&(V=y&&y.onVnodeMounted)){const ve=c;Ke(()=>lt(V,G,ve),k)}(c.shapeFlag&256||G&&sr(G.vnode)&&G.vnode.shapeFlag&256)&&u.a&&Ke(u.a,k),u.isMounted=!0,c=p=b=null}},U=u.effect=new Ws(A,ze,()=>zs(P),u.scope),P=u.update=()=>{U.dirty&&U.run()};P.id=u.uid,Ht(u,!0),P()},z=(u,c,p)=>{c.component=u;const b=u.vnode.props;u.vnode=c,u.next=null,Pu(u,c.props,b,p),Mu(u,c.children,p),zt(),Po(u),Zt()},ne=(u,c,p,b,k,O,F,A,U=!1)=>{const P=u&&u.children,V=u?u.shapeFlag:0,W=c.children,{patchFlag:y,shapeFlag:C}=c;if(y>0){if(y&128){ke(P,W,p,b,k,O,F,A,U);return}else if(y&256){Re(P,W,p,b,k,O,F,A,U);return}}C&8?(V&16&&xe(P,k,O),W!==P&&d(p,W)):V&16?C&16?ke(P,W,p,b,k,O,F,A,U):xe(P,k,O,!0):(V&8&&d(p,""),C&16&&R(W,p,b,k,O,F,A,U))},Re=(u,c,p,b,k,O,F,A,U)=>{u=u||sn,c=c||sn;const P=u.length,V=c.length,W=Math.min(P,V);let y;for(y=0;yV?xe(u,k,O,!0,!1,W):R(c,p,b,k,O,F,A,U,W)},ke=(u,c,p,b,k,O,F,A,U)=>{let P=0;const V=c.length;let W=u.length-1,y=V-1;for(;P<=W&&P<=y;){const C=u[P],B=c[P]=U?Tt(c[P]):at(c[P]);if(En(C,B))x(C,B,p,null,k,O,F,A,U);else break;P++}for(;P<=W&&P<=y;){const C=u[W],B=c[y]=U?Tt(c[y]):at(c[y]);if(En(C,B))x(C,B,p,null,k,O,F,A,U);else break;W--,y--}if(P>W){if(P<=y){const C=y+1,B=Cy)for(;P<=W;)we(u[P],k,O,!0),P++;else{const C=P,B=P,G=new Map;for(P=B;P<=y;P++){const Xe=c[P]=U?Tt(c[P]):at(c[P]);Xe.key!=null&&G.set(Xe.key,P)}let oe,ve=0;const Se=y-B+1;let Et=!1,Hr=0;const yn=new Array(Se);for(P=0;P=Se){we(Xe,k,O,!0);continue}let ot;if(Xe.key!=null)ot=G.get(Xe.key);else for(oe=B;oe<=y;oe++)if(yn[oe-B]===0&&En(Xe,c[oe])){ot=oe;break}ot===void 0?we(Xe,k,O,!0):(yn[ot-B]=P+1,ot>=Hr?Hr=ot:Et=!0,x(Xe,c[ot],p,null,k,O,F,A,U),ve++)}const Eo=Et?Uu(yn):sn;for(oe=Eo.length-1,P=Se-1;P>=0;P--){const Xe=B+P,ot=c[Xe],xo=Xe+1{const{el:O,type:F,transition:A,children:U,shapeFlag:P}=u;if(P&6){Ne(u.component.subTree,c,p,b);return}if(P&128){u.suspense.move(c,p,b);return}if(P&64){F.move(u,c,p,K);return}if(F===He){r(O,c,p);for(let W=0;WA.enter(O),k);else{const{leave:W,delayLeave:y,afterLeave:C}=A,B=()=>r(O,c,p),G=()=>{W(O,()=>{B(),C&&C()})};y?y(O,B,G):G()}else r(O,c,p)},we=(u,c,p,b=!1,k=!1)=>{const{type:O,props:F,ref:A,children:U,dynamicChildren:P,shapeFlag:V,patchFlag:W,dirs:y}=u;if(A!=null&&hs(A,null,p,u,!0),V&256){c.ctx.deactivate(u);return}const C=V&1&&y,B=!sr(u);let G;if(B&&(G=F&&F.onVnodeBeforeUnmount)&<(G,c,u),V&6)st(u.component,p,b);else{if(V&128){u.suspense.unmount(p,b);return}C&&jt(u,null,c,"beforeUnmount"),V&64?u.type.remove(u,c,p,k,K,b):P&&(O!==He||W>0&&W&64)?xe(P,c,p,!1,!0):(O===He&&W&384||!k&&V&16)&&xe(U,c,p),b&&Je(u)}(B&&(G=F&&F.onVnodeUnmounted)||C)&&Ke(()=>{G&<(G,c,u),C&&jt(u,null,c,"unmounted")},p)},Je=u=>{const{type:c,el:p,anchor:b,transition:k}=u;if(c===He){qe(p,b);return}if(c===lr){I(u);return}const O=()=>{o(p),k&&!k.persisted&&k.afterLeave&&k.afterLeave()};if(u.shapeFlag&1&&k&&!k.persisted){const{leave:F,delayLeave:A}=k,U=()=>F(p,O);A?A(u.el,O,U):U()}else O()},qe=(u,c)=>{let p;for(;u!==c;)p=m(u),o(u),u=p;o(c)},st=(u,c,p)=>{const{bum:b,scope:k,update:O,subTree:F,um:A}=u;b&&tr(b),k.stop(),O&&(O.active=!1,we(F,u,c,p)),A&&Ke(A,c),Ke(()=>{u.isUnmounted=!0},c),c&&c.pendingBranch&&!c.isUnmounted&&u.asyncDep&&!u.asyncResolved&&u.suspenseId===c.pendingId&&(c.deps--,c.deps===0&&c.resolve())},xe=(u,c,p,b=!1,k=!1,O=0)=>{for(let F=O;Fu.shapeFlag&6?S(u.component.subTree):u.shapeFlag&128?u.suspense.next():m(u.anchor||u.el);let j=!1;const $=(u,c,p)=>{u==null?c._vnode&&we(c._vnode,null,null,!0):x(c._vnode||null,u,c,null,null,null,p),j||(j=!0,Po(),Vi(),j=!1),c._vnode=u},K={p:x,um:we,m:Ne,r:Je,mt:De,mc:R,pc:ne,pbc:te,n:S,o:e};let Z,ie;return t&&([Z,ie]=t(K)),{render:$,hydrate:Z,createApp:Ou($,Z)}}function Gr({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Ht({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function $u(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function oa(e,t,n=!1){const r=e.children,o=t.children;if(q(r)&&q(o))for(let s=0;s>1,e[n[i]]0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,l=n[s-1];s-- >0;)n[s]=l,l=t[l];return n}function la(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:la(t)}const ju=e=>e.__isTeleport,He=Symbol.for("v-fgt"),Kn=Symbol.for("v-txt"),Xt=Symbol.for("v-cmt"),lr=Symbol.for("v-stc"),Tn=[];let et=null;function ye(e=!1){Tn.push(et=e?null:[])}function Hu(){Tn.pop(),et=Tn[Tn.length-1]||null}let Mn=1;function Wo(e){Mn+=e}function ia(e){return e.dynamicChildren=Mn>0?et||sn:null,Hu(),Mn>0&&et&&et.push(e),e}function Ie(e,t,n,r,o,s){return ia(D(e,t,n,r,o,s,!0))}function no(e,t,n,r,o){return ia(_e(e,t,n,r,o,!0))}function ms(e){return e?e.__v_isVNode===!0:!1}function En(e,t){return e.type===t.type&&e.key===t.key}const Nr="__vInternal",aa=({key:e})=>e??null,ir=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ce(e)||We(e)||J(e)?{i:Ge,r:e,k:t,f:!!n}:e:null);function D(e,t=null,n=null,r=0,o=null,s=e===He?0:1,l=!1,i=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&aa(t),ref:t&&ir(t),scopeId:Gi,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ge};return i?(ro(a,n),s&128&&e.normalize(a)):n&&(a.shapeFlag|=Ce(n)?8:16),Mn>0&&!l&&et&&(a.patchFlag>0||s&6)&&a.patchFlag!==32&&et.push(a),a}const _e=Wu;function Wu(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===iu)&&(e=Xt),ms(e)){const i=fn(e,t,!0);return n&&ro(i,n),Mn>0&&!s&&et&&(i.shapeFlag&6?et[et.indexOf(e)]=i:et.push(i)),i.patchFlag|=-2,i}if(zu(e)&&(e=e.__vccOpts),t){t=Vu(t);let{class:i,style:a}=t;i&&!Ce(i)&&(t.class=Nt(i)),me(a)&&(Mi(a)&&!q(a)&&(a=Ae({},a)),t.style=Hs(a))}const l=Ce(e)?1:au(e)?128:ju(e)?64:me(e)?4:J(e)?2:0;return D(e,t,n,r,o,l,s,!0)}function Vu(e){return e?Mi(e)||Nr in e?Ae({},e):e:null}function fn(e,t,n=!1){const{props:r,ref:o,patchFlag:s,children:l}=e,i=t?Ku(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:i,key:i&&aa(i),ref:t&&t.ref?n&&o?q(o)?o.concat(ir(t)):[o,ir(t)]:ir(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==He?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&fn(e.ssContent),ssFallback:e.ssFallback&&fn(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function ut(e=" ",t=0){return _e(Kn,null,e,t)}function ca(e,t){const n=_e(lr,null,e);return n.staticCount=t,n}function nn(e="",t=!1){return t?(ye(),no(Xt,null,e)):_e(Xt,null,e)}function at(e){return e==null||typeof e=="boolean"?_e(Xt):q(e)?_e(He,null,e.slice()):typeof e=="object"?Tt(e):_e(Kn,null,String(e))}function Tt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:fn(e)}function ro(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(q(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),ro(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!(Nr in t)?t._ctx=Ge:o===3&&Ge&&(Ge.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else J(t)?(t={default:t,_ctx:Ge},n=32):(t=String(t),r&64?(n=16,t=[ut(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ku(...e){const t={};for(let n=0;nFe||Ge;let _r,ps;{const e=_i(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(l=>l(s)):o[0](s)}};_r=t("__VUE_INSTANCE_SETTERS__",n=>Fe=n),ps=t("__VUE_SSR_SETTERS__",n=>Pr=n)}const Bn=e=>{const t=Fe;return _r(e),e.scope.on(),()=>{e.scope.off(),_r(t)}},Vo=()=>{Fe&&Fe.scope.off(),_r(null)};function ua(e){return e.vnode.shapeFlag&4}let Pr=!1;function qu(e,t=!1){t&&ps(t);const{props:n,children:r}=e.vnode,o=ua(e);Nu(e,n,o,t),Ru(e,r);const s=o?Xu(e,t):void 0;return t&&ps(!1),s}function Xu(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Fi(new Proxy(e.ctx,ku));const{setup:r}=n;if(r){const o=e.setupContext=r.length>1?Qu(e):null,s=Bn(e);zt();const l=At(r,e,0,[e.props,o]);if(Zt(),s(),hi(l)){if(l.then(Vo,Vo),t)return l.then(i=>{Ko(e,i,t)}).catch(i=>{Tr(i,e,0)});e.asyncDep=l}else Ko(e,l,t)}else fa(e,t)}function Ko(e,t,n){J(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:me(t)&&(e.setupState=ji(t)),fa(e,n)}let Bo;function fa(e,t,n){const r=e.type;if(!e.render){if(!t&&Bo&&!r.render){const o=r.template||eo(e).template;if(o){const{isCustomElement:s,compilerOptions:l}=e.appContext.config,{delimiters:i,compilerOptions:a}=r,f=Ae(Ae({isCustomElement:s,delimiters:i},l),a);r.render=Bo(o,f)}}e.render=r.render||ze}{const o=Bn(e);zt();try{wu(e)}finally{Zt(),o()}}}function Ju(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return Ye(e,"get","$attrs"),t[n]}}))}function Qu(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return Ju(e)},slots:e.slots,emit:e.emit,expose:t}}function Ar(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(ji(Fi(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ln)return Ln[n](e)},has(t,n){return n in t||n in Ln}}))}function zu(e){return J(e)&&"__vccOpts"in e}const Ee=(e,t)=>Yc(e,t,Pr);function dn(e,t,n){const r=arguments.length;return r===2?me(t)&&!q(t)?ms(t)?_e(e,null,[t]):_e(e,t):_e(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ms(n)&&(n=[n]),_e(e,t,n))}const Zu="3.4.15";/** +**/function Rt(e,t,n,r){let o;try{o=r?e(...r):e()}catch(s){Tr(s,t,n)}return o}function rt(e,t,n,r){if(J(e)){const s=Rt(e,t,n,r);return s&&hi(s)&&s.catch(l=>{Tr(l,t,n)}),s}const o=[];for(let s=0;s>>1,o=Fe[r],s=Rn(o);sft&&Fe.splice(t,1)}function Zc(e){q(e)?an.push(...e):(!St||!St.includes(e,e.allowRecurse?Kt+1:Kt))&&an.push(e),Wi()}function Po(e,t,n=An?ft+1:0){for(;nRn(n)-Rn(r));if(an.length=0,St){St.push(...t);return}for(St=t,Kt=0;Kte.id==null?1/0:e.id,eu=(e,t)=>{const n=Rn(e)-Rn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Ki(e){is=!1,An=!0,Fe.sort(eu);try{for(ft=0;ftSe(_)?_.trim():_)),h&&(o=n.map(Nn))}let i,a=r[i=Wr(t)]||r[i=Wr(cn(t))];!a&&s&&(a=r[i=Wr(Qt(t))]),a&&rt(a,e,6,o);const f=r[i+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,rt(f,e,6,o)}}function Bi(e,t,n=!1){const r=t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let l={},i=!1;if(!J(e)){const a=f=>{const d=Bi(f,t,!0);d&&(i=!0,Ae(l,d))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!s&&!i?(pe(e)&&r.set(e,null),null):(q(s)?s.forEach(a=>l[a]=null):Ae(l,s),pe(e)&&r.set(e,l),l)}function Sr(e,t){return!e||!xr(t)?!1:(t=t.slice(2).replace(/Once$/,""),re(e,t[0].toLowerCase()+t.slice(1))||re(e,Qt(t))||re(e,t))}let Ge=null,Gi=null;function mr(e){const t=Ge;return Ge=e,Gi=e&&e.type.__scopeId||null,t}function nu(e,t=Ge,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&Wo(-1);const s=mr(t);let l;try{l=e(...o)}finally{mr(s),r._d&&Wo(1)}return l};return r._n=!0,r._c=!0,r._d=!0,r}function Kr(e){const{type:t,vnode:n,proxy:r,withProxy:o,props:s,propsOptions:[l],slots:i,attrs:a,emit:f,render:d,renderCache:h,data:m,setupState:_,ctx:w,inheritAttrs:v}=e;let y,g;const x=mr(e);try{if(n.shapeFlag&4){const I=o||r,N=I;y=ct(d.call(N,I,h,s,_,m,w)),g=a}else{const I=t;y=ct(I.length>1?I(s,{attrs:a,slots:i,emit:f}):I(s,null)),g=t.props?a:ru(a)}}catch(I){Tn.length=0,Tr(I,e,1),y=he(Xt)}let L=y;if(g&&v!==!1){const I=Object.keys(g),{shapeFlag:N}=L;I.length&&N&7&&(l&&I.some($s)&&(g=su(g,l)),L=fn(L,g))}return n.dirs&&(L=fn(L),L.dirs=L.dirs?L.dirs.concat(n.dirs):n.dirs),n.transition&&(L.transition=n.transition),y=L,mr(x),y}const ru=e=>{let t;for(const n in e)(n==="class"||n==="style"||xr(n))&&((t||(t={}))[n]=e[n]);return t},su=(e,t)=>{const n={};for(const r in e)(!$s(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function ou(e,t,n){const{props:r,children:o,component:s}=e,{props:l,children:i,patchFlag:a}=t,f=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return r?Ao(r,l,f):!!l;if(a&8){const d=t.dynamicProps;for(let h=0;he.__isSuspense;function cu(e,t){t&&t.pendingBranch?q(e)?t.effects.push(...e):t.effects.push(e):Zc(e)}const uu=Symbol.for("v-scx"),fu=()=>ht(uu),Qn={};function Mt(e,t,n){return Yi(e,t,n)}function Yi(e,t,{immediate:n,deep:r,flush:o,once:s,onTrack:l,onTrigger:i}=ge){if(t&&s){const T=t;t=(...F)=>{T(...F),N()}}const a=De,f=T=>r===!0?T:Bt(T,r===!1?1:void 0);let d,h=!1,m=!1;if(Ve(e)?(d=()=>e.value,h=hr(e)):ln(e)?(d=()=>f(e),h=!0):q(e)?(m=!0,h=e.some(T=>ln(T)||hr(T)),d=()=>e.map(T=>{if(Ve(T))return T.value;if(ln(T))return f(T);if(J(T))return Rt(T,a,2)})):J(e)?t?d=()=>Rt(e,a,2):d=()=>(_&&_(),rt(e,a,3,[w])):d=ze,t&&r){const T=d;d=()=>Bt(T())}let _,w=T=>{_=L.onStop=()=>{Rt(T,a,4),_=L.onStop=void 0}},v;if(Pr)if(w=ze,t?n&&rt(t,a,3,[d(),m?[]:void 0,w]):d(),o==="sync"){const T=fu();v=T.__watcherHandles||(T.__watcherHandles=[])}else return ze;let y=m?new Array(e.length).fill(Qn):Qn;const g=()=>{if(!(!L.active||!L.dirty))if(t){const T=L.run();(r||h||(m?T.some((F,M)=>Dt(F,y[M])):Dt(T,y)))&&(_&&_(),rt(t,a,3,[T,y===Qn?void 0:m&&y[0]===Qn?[]:y,w]),y=T)}else L.run()};g.allowRecurse=!!t;let x;o==="sync"?x=g:o==="post"?x=()=>Be(g,a&&a.suspense):(g.pre=!0,a&&(g.id=a.uid),x=()=>zs(g));const L=new Ws(d,ze,x),I=Tc(),N=()=>{L.stop(),I&&Us(I.effects,L)};return t?n?g():y=L.run():o==="post"?Be(L.run.bind(L),a&&a.suspense):L.run(),v&&v.push(N),N}function du(e,t,n){const r=this.proxy,o=Se(e)?e.includes(".")?qi(r,e):()=>r[e]:e.bind(r,r);let s;J(t)?s=t:(s=t.handler,n=t);const l=Bn(this),i=Yi(o,s.bind(r),n);return l(),i}function qi(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o0){if(n>=t)return e;n++}if(r=r||new Set,r.has(e))return e;if(r.add(e),Ve(e))Bt(e.value,t,n,r);else if(q(e))for(let o=0;o{Bt(o,t,n,r)});else if(pi(e))for(const o in e)Bt(e[o],t,n,r);return e}function rr(e,t){if(Ge===null)return e;const n=Ar(Ge)||Ge.proxy,r=e.dirs||(e.dirs=[]);for(let o=0;o!!e.type.__asyncLoader,Xi=e=>e.type.__isKeepAlive;function hu(e,t){Ji(e,"a",t)}function mu(e,t){Ji(e,"da",t)}function Ji(e,t,n=De){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Cr(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Xi(o.parent.vnode)&&pu(r,t,n,o),o=o.parent}}function pu(e,t,n,r){const o=Cr(t,e,r,!0);Zs(()=>{Us(r[t],o)},n)}function Cr(e,t,n=De,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...l)=>{if(n.isUnmounted)return;zt();const i=Bn(n),a=rt(t,n,e,l);return i(),Zt(),a});return r?o.unshift(s):o.push(s),s}}const xt=e=>(t,n=De)=>(!Pr||e==="sp")&&Cr(e,(...r)=>t(...r),n),Qi=xt("bm"),Or=xt("m"),gu=xt("bu"),_u=xt("u"),bu=xt("bum"),Zs=xt("um"),vu=xt("sp"),yu=xt("rtg"),Eu=xt("rtc");function xu(e,t=De){Cr("ec",e,t)}function as(e,t,n,r){let o;const s=n&&n[r];if(q(e)||Se(e)){o=new Array(e.length);for(let l=0,i=e.length;lt(l,i,void 0,s&&s[i]));else{const l=Object.keys(e);o=new Array(l.length);for(let i=0,a=l.length;ie?ua(e)?Ar(e)||e.proxy:cs(e.parent):null,Ln=Ae(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=>cs(e.parent),$root:e=>cs(e.root),$emit:e=>e.emit,$options:e=>eo(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,zs(e.update)}),$nextTick:e=>e.n||(e.n=Qs.bind(e.proxy)),$watch:e=>du.bind(e)}),Br=(e,t)=>e!==ge&&!e.__isScriptSetup&&re(e,t),ku={get({_:e},t){const{ctx:n,setupState:r,data:o,props:s,accessCache:l,type:i,appContext:a}=e;let f;if(t[0]!=="$"){const _=l[t];if(_!==void 0)switch(_){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(Br(r,t))return l[t]=1,r[t];if(o!==ge&&re(o,t))return l[t]=2,o[t];if((f=e.propsOptions[0])&&re(f,t))return l[t]=3,s[t];if(n!==ge&&re(n,t))return l[t]=4,n[t];us&&(l[t]=0)}}const d=Ln[t];let h,m;if(d)return t==="$attrs"&&Ye(e,"get",t),d(e);if((h=i.__cssModules)&&(h=h[t]))return h;if(n!==ge&&re(n,t))return l[t]=4,n[t];if(m=a.config.globalProperties,re(m,t))return m[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:s}=e;return Br(o,t)?(o[t]=n,!0):r!==ge&&re(r,t)?(r[t]=n,!0):re(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,propsOptions:s}},l){let i;return!!n[l]||e!==ge&&re(e,l)||Br(t,l)||(i=s[0])&&re(i,l)||re(r,l)||re(Ln,l)||re(o.config.globalProperties,l)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:re(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ro(e){return q(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let us=!0;function wu(e){const t=eo(e),n=e.proxy,r=e.ctx;us=!1,t.beforeCreate&&Mo(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:l,watch:i,provide:a,inject:f,created:d,beforeMount:h,mounted:m,beforeUpdate:_,updated:w,activated:v,deactivated:y,beforeDestroy:g,beforeUnmount:x,destroyed:L,unmounted:I,render:N,renderTracked:T,renderTriggered:F,errorCaptured:M,serverPrefetch:Q,expose:te,inheritAttrs:be,components:fe,directives:de,filters:$e}=t;if(f&&Iu(f,r,null),l)for(const z in l){const ne=l[z];J(ne)&&(r[z]=ne.bind(n))}if(o){const z=o.call(n,n);pe(z)&&(e.data=Lr(z))}if(us=!0,s)for(const z in s){const ne=s[z],Re=J(ne)?ne.bind(n,n):J(ne.get)?ne.get.bind(n,n):ze,ke=!J(ne)&&J(ne.set)?ne.set.bind(n):ze,Ne=Ee({get:Re,set:ke});Object.defineProperty(r,z,{enumerable:!0,configurable:!0,get:()=>Ne.value,set:we=>Ne.value=we})}if(i)for(const z in i)zi(i[z],r,n,z);if(a){const z=J(a)?a.call(n):a;Reflect.ownKeys(z).forEach(ne=>{or(ne,z[ne])})}d&&Mo(d,e,"c");function se(z,ne){q(ne)?ne.forEach(Re=>z(Re.bind(n))):ne&&z(ne.bind(n))}if(se(Qi,h),se(Or,m),se(gu,_),se(_u,w),se(hu,v),se(mu,y),se(xu,M),se(Eu,T),se(yu,F),se(bu,x),se(Zs,I),se(vu,Q),q(te))if(te.length){const z=e.exposed||(e.exposed={});te.forEach(ne=>{Object.defineProperty(z,ne,{get:()=>n[ne],set:Re=>n[ne]=Re})})}else e.exposed||(e.exposed={});N&&e.render===ze&&(e.render=N),be!=null&&(e.inheritAttrs=be),fe&&(e.components=fe),de&&(e.directives=de)}function Iu(e,t,n=ze){q(e)&&(e=fs(e));for(const r in e){const o=e[r];let s;pe(o)?"default"in o?s=ht(o.from||r,o.default,!0):s=ht(o.from||r):s=ht(o),Ve(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:l=>s.value=l}):t[r]=s}}function Mo(e,t,n){rt(q(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function zi(e,t,n,r){const o=r.includes(".")?qi(n,r):()=>n[r];if(Se(e)){const s=t[e];J(s)&&Mt(o,s)}else if(J(e))Mt(o,e.bind(n));else if(pe(e))if(q(e))e.forEach(s=>zi(s,t,n,r));else{const s=J(e.handler)?e.handler.bind(n):t[e.handler];J(s)&&Mt(o,s,e)}}function eo(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:l}}=e.appContext,i=s.get(t);let a;return i?a=i:!o.length&&!n&&!r?a=t:(a={},o.length&&o.forEach(f=>pr(a,f,l,!0)),pr(a,t,l)),pe(t)&&s.set(t,a),a}function pr(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&pr(e,s,n,!0),o&&o.forEach(l=>pr(e,l,n,!0));for(const l in t)if(!(r&&l==="expose")){const i=Lu[l]||n&&n[l];e[l]=i?i(e[l],t[l]):t[l]}return e}const Lu={data:Fo,props:Do,emits:Do,methods:In,computed:In,beforeCreate:je,created:je,beforeMount:je,mounted:je,beforeUpdate:je,updated:je,beforeDestroy:je,beforeUnmount:je,destroyed:je,unmounted:je,activated:je,deactivated:je,errorCaptured:je,serverPrefetch:je,components:In,directives:In,watch:Su,provide:Fo,inject:Tu};function Fo(e,t){return t?e?function(){return Ae(J(e)?e.call(this,this):e,J(t)?t.call(this,this):t)}:t:e}function Tu(e,t){return In(fs(e),fs(t))}function fs(e){if(q(e)){const t={};for(let n=0;n1)return n&&J(t)?t.call(r&&r.proxy):t}}function Nu(e,t,n,r=!1){const o={},s={};dr(s,Nr,1),e.propsDefaults=Object.create(null),ea(e,t,o,s);for(const l in e.propsOptions[0])l in o||(o[l]=void 0);n?e.props=r?o:Ai(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function Pu(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:l}}=e,i=le(o),[a]=e.propsOptions;let f=!1;if((r||l>0)&&!(l&16)){if(l&8){const d=e.vnode.dynamicProps;for(let h=0;h{a=!0;const[m,_]=ta(h,t,!0);Ae(l,m),_&&i.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!s&&!a)return pe(e)&&r.set(e,sn),sn;if(q(s))for(let d=0;d-1,_[1]=v<0||w-1||re(_,"default"))&&i.push(h)}}}const f=[l,i];return pe(e)&&r.set(e,f),f}function $o(e){return e[0]!=="$"}function Uo(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function jo(e,t){return Uo(e)===Uo(t)}function Ho(e,t){return q(t)?t.findIndex(n=>jo(n,e)):J(t)&&jo(t,e)?0:-1}const na=e=>e[0]==="_"||e==="$stable",to=e=>q(e)?e.map(ct):[ct(e)],Au=(e,t,n)=>{if(t._n)return t;const r=nu((...o)=>to(t(...o)),n);return r._c=!1,r},ra=(e,t,n)=>{const r=e._ctx;for(const o in e){if(na(o))continue;const s=e[o];if(J(s))t[o]=Au(o,s,r);else if(s!=null){const l=to(s);t[o]=()=>l}}},sa=(e,t)=>{const n=to(t);e.slots.default=()=>n},Ru=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=le(t),dr(t,"_",n)):ra(t,e.slots={})}else e.slots={},t&&sa(e,t);dr(e.slots,Nr,1)},Mu=(e,t,n)=>{const{vnode:r,slots:o}=e;let s=!0,l=ge;if(r.shapeFlag&32){const i=t._;i?n&&i===1?s=!1:(Ae(o,t),!n&&i===1&&delete o._):(s=!t.$stable,ra(t,o)),l=t}else t&&(sa(e,t),l={default:1});if(s)for(const i in o)!na(i)&&l[i]==null&&delete o[i]};function hs(e,t,n,r,o=!1){if(q(e)){e.forEach((m,_)=>hs(m,t&&(q(t)?t[_]:t),n,r,o));return}if(sr(r)&&!o)return;const s=r.shapeFlag&4?Ar(r.component)||r.component.proxy:r.el,l=o?null:s,{i,r:a}=e,f=t&&t.r,d=i.refs===ge?i.refs={}:i.refs,h=i.setupState;if(f!=null&&f!==a&&(Se(f)?(d[f]=null,re(h,f)&&(h[f]=null)):Ve(f)&&(f.value=null)),J(a))Rt(a,i,12,[l,d]);else{const m=Se(a),_=Ve(a),w=e.f;if(m||_){const v=()=>{if(w){const y=m?re(h,a)?h[a]:d[a]:a.value;o?q(y)&&Us(y,s):q(y)?y.includes(s)||y.push(s):m?(d[a]=[s],re(h,a)&&(h[a]=d[a])):(a.value=[s],e.k&&(d[e.k]=a.value))}else m?(d[a]=l,re(h,a)&&(h[a]=l)):_&&(a.value=l,e.k&&(d[e.k]=l))};o||w?v():(v.id=-1,Be(v,n))}}}const Be=cu;function Fu(e){return Du(e)}function Du(e,t){const n=_i();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:l,createText:i,createComment:a,setText:f,setElementText:d,parentNode:h,nextSibling:m,setScopeId:_=ze,insertStaticContent:w}=e,v=(u,c,p,b=null,k=null,O=null,D=void 0,R=null,U=!!c.dynamicChildren)=>{if(u===c)return;u&&!En(u,c)&&(b=C(u),we(u,k,O,!0),u=null),c.patchFlag===-2&&(U=!1,c.dynamicChildren=null);const{type:P,ref:V,shapeFlag:W}=c;switch(P){case Kn:y(u,c,p,b);break;case Xt:g(u,c,p,b);break;case lr:u==null&&x(c,p,b,D);break;case We:fe(u,c,p,b,k,O,D,R,U);break;default:W&1?N(u,c,p,b,k,O,D,R,U):W&6?de(u,c,p,b,k,O,D,R,U):(W&64||W&128)&&P.process(u,c,p,b,k,O,D,R,U,K)}V!=null&&k&&hs(V,u&&u.ref,O,c||u,!c)},y=(u,c,p,b)=>{if(u==null)r(c.el=i(c.children),p,b);else{const k=c.el=u.el;c.children!==u.children&&f(k,c.children)}},g=(u,c,p,b)=>{u==null?r(c.el=a(c.children||""),p,b):c.el=u.el},x=(u,c,p,b)=>{[u.el,u.anchor]=w(u.children,c,p,b,u.el,u.anchor)},L=({el:u,anchor:c},p,b)=>{let k;for(;u&&u!==c;)k=m(u),r(u,p,b),u=k;r(c,p,b)},I=({el:u,anchor:c})=>{let p;for(;u&&u!==c;)p=m(u),o(u),u=p;o(c)},N=(u,c,p,b,k,O,D,R,U)=>{c.type==="svg"?D="svg":c.type==="math"&&(D="mathml"),u==null?T(c,p,b,k,O,D,R,U):Q(u,c,k,O,D,R,U)},T=(u,c,p,b,k,O,D,R)=>{let U,P;const{props:V,shapeFlag:W,transition:E,dirs:S}=u;if(U=u.el=l(u.type,O,V&&V.is,V),W&8?d(U,u.children):W&16&&M(u.children,U,null,b,k,Gr(u,O),D,R),S&&Ht(u,null,b,"created"),F(U,u,u.scopeId,D,b),V){for(const G in V)G!=="value"&&!er(G)&&s(U,G,null,V[G],O,u.children,b,k,xe);"value"in V&&s(U,"value",null,V.value,O),(P=V.onVnodeBeforeMount)&&it(P,b,u)}S&&Ht(u,null,b,"beforeMount");const B=$u(k,E);B&&E.beforeEnter(U),r(U,c,p),((P=V&&V.onVnodeMounted)||B||S)&&Be(()=>{P&&it(P,b,u),B&&E.enter(U),S&&Ht(u,null,b,"mounted")},k)},F=(u,c,p,b,k)=>{if(p&&_(u,p),b)for(let O=0;O{for(let P=U;P{const R=c.el=u.el;let{patchFlag:U,dynamicChildren:P,dirs:V}=c;U|=u.patchFlag&16;const W=u.props||ge,E=c.props||ge;let S;if(p&&Wt(p,!1),(S=E.onVnodeBeforeUpdate)&&it(S,p,c,u),V&&Ht(c,u,p,"beforeUpdate"),p&&Wt(p,!0),P?te(u.dynamicChildren,P,R,p,b,Gr(c,k),O):D||ne(u,c,R,null,p,b,Gr(c,k),O,!1),U>0){if(U&16)be(R,c,W,E,p,b,k);else if(U&2&&W.class!==E.class&&s(R,"class",null,E.class,k),U&4&&s(R,"style",W.style,E.style,k),U&8){const B=c.dynamicProps;for(let G=0;G{S&&it(S,p,c,u),V&&Ht(c,u,p,"updated")},b)},te=(u,c,p,b,k,O,D)=>{for(let R=0;R{if(p!==b){if(p!==ge)for(const R in p)!er(R)&&!(R in b)&&s(u,R,p[R],null,D,c.children,k,O,xe);for(const R in b){if(er(R))continue;const U=b[R],P=p[R];U!==P&&R!=="value"&&s(u,R,P,U,D,c.children,k,O,xe)}"value"in b&&s(u,"value",p.value,b.value,D)}},fe=(u,c,p,b,k,O,D,R,U)=>{const P=c.el=u?u.el:i(""),V=c.anchor=u?u.anchor:i("");let{patchFlag:W,dynamicChildren:E,slotScopeIds:S}=c;S&&(R=R?R.concat(S):S),u==null?(r(P,p,b),r(V,p,b),M(c.children||[],p,V,k,O,D,R,U)):W>0&&W&64&&E&&u.dynamicChildren?(te(u.dynamicChildren,E,p,k,O,D,R),(c.key!=null||k&&c===k.subTree)&&oa(u,c,!0)):ne(u,c,p,V,k,O,D,R,U)},de=(u,c,p,b,k,O,D,R,U)=>{c.slotScopeIds=R,u==null?c.shapeFlag&512?k.ctx.activate(c,p,b,D,U):$e(c,p,b,k,O,D,U):Ue(u,c,U)},$e=(u,c,p,b,k,O,D)=>{const R=u.component=Yu(u,b,k);if(Xi(u)&&(R.ctx.renderer=K),qu(R),R.asyncDep){if(k&&k.registerDep(R,se),!u.el){const U=R.subTree=he(Xt);g(null,U,c,p)}}else se(R,u,c,p,k,O,D)},Ue=(u,c,p)=>{const b=c.component=u.component;if(ou(u,c,p))if(b.asyncDep&&!b.asyncResolved){z(b,c,p);return}else b.next=c,zc(b.update),b.effect.dirty=!0,b.update();else c.el=u.el,b.vnode=c},se=(u,c,p,b,k,O,D)=>{const R=()=>{if(u.isMounted){let{next:V,bu:W,u:E,parent:S,vnode:B}=u;{const kt=la(u);if(kt){V&&(V.el=B.el,z(u,V,D)),kt.asyncDep.then(()=>{u.isUnmounted||R()});return}}let G=V,oe;Wt(u,!1),V?(V.el=B.el,z(u,V,D)):V=B,W&&tr(W),(oe=V.props&&V.props.onVnodeBeforeUpdate)&&it(oe,S,V,B),Wt(u,!0);const ve=Kr(u),Ce=u.subTree;u.subTree=ve,v(Ce,ve,h(Ce.el),C(Ce),u,k,O),V.el=ve.el,G===null&&lu(u,ve.el),E&&Be(E,k),(oe=V.props&&V.props.onVnodeUpdated)&&Be(()=>it(oe,S,V,B),k)}else{let V;const{el:W,props:E}=c,{bm:S,m:B,parent:G}=u,oe=sr(c);if(Wt(u,!1),S&&tr(S),!oe&&(V=E&&E.onVnodeBeforeMount)&&it(V,G,c),Wt(u,!0),W&&ie){const ve=()=>{u.subTree=Kr(u),ie(W,u.subTree,u,k,null)};oe?c.type.__asyncLoader().then(()=>!u.isUnmounted&&ve()):ve()}else{const ve=u.subTree=Kr(u);v(null,ve,p,b,u,k,O),c.el=ve.el}if(B&&Be(B,k),!oe&&(V=E&&E.onVnodeMounted)){const ve=c;Be(()=>it(V,G,ve),k)}(c.shapeFlag&256||G&&sr(G.vnode)&&G.vnode.shapeFlag&256)&&u.a&&Be(u.a,k),u.isMounted=!0,c=p=b=null}},U=u.effect=new Ws(R,ze,()=>zs(P),u.scope),P=u.update=()=>{U.dirty&&U.run()};P.id=u.uid,Wt(u,!0),P()},z=(u,c,p)=>{c.component=u;const b=u.vnode.props;u.vnode=c,u.next=null,Pu(u,c.props,b,p),Mu(u,c.children,p),zt(),Po(u),Zt()},ne=(u,c,p,b,k,O,D,R,U=!1)=>{const P=u&&u.children,V=u?u.shapeFlag:0,W=c.children,{patchFlag:E,shapeFlag:S}=c;if(E>0){if(E&128){ke(P,W,p,b,k,O,D,R,U);return}else if(E&256){Re(P,W,p,b,k,O,D,R,U);return}}S&8?(V&16&&xe(P,k,O),W!==P&&d(p,W)):V&16?S&16?ke(P,W,p,b,k,O,D,R,U):xe(P,k,O,!0):(V&8&&d(p,""),S&16&&M(W,p,b,k,O,D,R,U))},Re=(u,c,p,b,k,O,D,R,U)=>{u=u||sn,c=c||sn;const P=u.length,V=c.length,W=Math.min(P,V);let E;for(E=0;EV?xe(u,k,O,!0,!1,W):M(c,p,b,k,O,D,R,U,W)},ke=(u,c,p,b,k,O,D,R,U)=>{let P=0;const V=c.length;let W=u.length-1,E=V-1;for(;P<=W&&P<=E;){const S=u[P],B=c[P]=U?Ct(c[P]):ct(c[P]);if(En(S,B))v(S,B,p,null,k,O,D,R,U);else break;P++}for(;P<=W&&P<=E;){const S=u[W],B=c[E]=U?Ct(c[E]):ct(c[E]);if(En(S,B))v(S,B,p,null,k,O,D,R,U);else break;W--,E--}if(P>W){if(P<=E){const S=E+1,B=SE)for(;P<=W;)we(u[P],k,O,!0),P++;else{const S=P,B=P,G=new Map;for(P=B;P<=E;P++){const Xe=c[P]=U?Ct(c[P]):ct(c[P]);Xe.key!=null&&G.set(Xe.key,P)}let oe,ve=0;const Ce=E-B+1;let kt=!1,Hr=0;const yn=new Array(Ce);for(P=0;P=Ce){we(Xe,k,O,!0);continue}let lt;if(Xe.key!=null)lt=G.get(Xe.key);else for(oe=B;oe<=E;oe++)if(yn[oe-B]===0&&En(Xe,c[oe])){lt=oe;break}lt===void 0?we(Xe,k,O,!0):(yn[lt-B]=P+1,lt>=Hr?Hr=lt:kt=!0,v(Xe,c[lt],p,null,k,O,D,R,U),ve++)}const Eo=kt?Uu(yn):sn;for(oe=Eo.length-1,P=Ce-1;P>=0;P--){const Xe=B+P,lt=c[Xe],xo=Xe+1{const{el:O,type:D,transition:R,children:U,shapeFlag:P}=u;if(P&6){Ne(u.component.subTree,c,p,b);return}if(P&128){u.suspense.move(c,p,b);return}if(P&64){D.move(u,c,p,K);return}if(D===We){r(O,c,p);for(let W=0;WR.enter(O),k);else{const{leave:W,delayLeave:E,afterLeave:S}=R,B=()=>r(O,c,p),G=()=>{W(O,()=>{B(),S&&S()})};E?E(O,B,G):G()}else r(O,c,p)},we=(u,c,p,b=!1,k=!1)=>{const{type:O,props:D,ref:R,children:U,dynamicChildren:P,shapeFlag:V,patchFlag:W,dirs:E}=u;if(R!=null&&hs(R,null,p,u,!0),V&256){c.ctx.deactivate(u);return}const S=V&1&&E,B=!sr(u);let G;if(B&&(G=D&&D.onVnodeBeforeUnmount)&&it(G,c,u),V&6)ot(u.component,p,b);else{if(V&128){u.suspense.unmount(p,b);return}S&&Ht(u,null,c,"beforeUnmount"),V&64?u.type.remove(u,c,p,k,K,b):P&&(O!==We||W>0&&W&64)?xe(P,c,p,!1,!0):(O===We&&W&384||!k&&V&16)&&xe(U,c,p),b&&Je(u)}(B&&(G=D&&D.onVnodeUnmounted)||S)&&Be(()=>{G&&it(G,c,u),S&&Ht(u,null,c,"unmounted")},p)},Je=u=>{const{type:c,el:p,anchor:b,transition:k}=u;if(c===We){qe(p,b);return}if(c===lr){I(u);return}const O=()=>{o(p),k&&!k.persisted&&k.afterLeave&&k.afterLeave()};if(u.shapeFlag&1&&k&&!k.persisted){const{leave:D,delayLeave:R}=k,U=()=>D(p,O);R?R(u.el,O,U):U()}else O()},qe=(u,c)=>{let p;for(;u!==c;)p=m(u),o(u),u=p;o(c)},ot=(u,c,p)=>{const{bum:b,scope:k,update:O,subTree:D,um:R}=u;b&&tr(b),k.stop(),O&&(O.active=!1,we(D,u,c,p)),R&&Be(R,c),Be(()=>{u.isUnmounted=!0},c),c&&c.pendingBranch&&!c.isUnmounted&&u.asyncDep&&!u.asyncResolved&&u.suspenseId===c.pendingId&&(c.deps--,c.deps===0&&c.resolve())},xe=(u,c,p,b=!1,k=!1,O=0)=>{for(let D=O;Du.shapeFlag&6?C(u.component.subTree):u.shapeFlag&128?u.suspense.next():m(u.anchor||u.el);let j=!1;const $=(u,c,p)=>{u==null?c._vnode&&we(c._vnode,null,null,!0):v(c._vnode||null,u,c,null,null,null,p),j||(j=!0,Po(),Vi(),j=!1),c._vnode=u},K={p:v,um:we,m:Ne,r:Je,mt:$e,mc:M,pc:ne,pbc:te,n:C,o:e};let Z,ie;return t&&([Z,ie]=t(K)),{render:$,hydrate:Z,createApp:Ou($,Z)}}function Gr({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Wt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function $u(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function oa(e,t,n=!1){const r=e.children,o=t.children;if(q(r)&&q(o))for(let s=0;s>1,e[n[i]]0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,l=n[s-1];s-- >0;)n[s]=l,l=t[l];return n}function la(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:la(t)}const ju=e=>e.__isTeleport,We=Symbol.for("v-fgt"),Kn=Symbol.for("v-txt"),Xt=Symbol.for("v-cmt"),lr=Symbol.for("v-stc"),Tn=[];let tt=null;function ye(e=!1){Tn.push(tt=e?null:[])}function Hu(){Tn.pop(),tt=Tn[Tn.length-1]||null}let Mn=1;function Wo(e){Mn+=e}function ia(e){return e.dynamicChildren=Mn>0?tt||sn:null,Hu(),Mn>0&&tt&&tt.push(e),e}function Ie(e,t,n,r,o,s){return ia(A(e,t,n,r,o,s,!0))}function no(e,t,n,r,o){return ia(he(e,t,n,r,o,!0))}function ms(e){return e?e.__v_isVNode===!0:!1}function En(e,t){return e.type===t.type&&e.key===t.key}const Nr="__vInternal",aa=({key:e})=>e??null,ir=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Se(e)||Ve(e)||J(e)?{i:Ge,r:e,k:t,f:!!n}:e:null);function A(e,t=null,n=null,r=0,o=null,s=e===We?0:1,l=!1,i=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&aa(t),ref:t&&ir(t),scopeId:Gi,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ge};return i?(ro(a,n),s&128&&e.normalize(a)):n&&(a.shapeFlag|=Se(n)?8:16),Mn>0&&!l&&tt&&(a.patchFlag>0||s&6)&&a.patchFlag!==32&&tt.push(a),a}const he=Wu;function Wu(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===iu)&&(e=Xt),ms(e)){const i=fn(e,t,!0);return n&&ro(i,n),Mn>0&&!s&&tt&&(i.shapeFlag&6?tt[tt.indexOf(e)]=i:tt.push(i)),i.patchFlag|=-2,i}if(zu(e)&&(e=e.__vccOpts),t){t=Vu(t);let{class:i,style:a}=t;i&&!Se(i)&&(t.class=vt(i)),pe(a)&&(Mi(a)&&!q(a)&&(a=Ae({},a)),t.style=Hs(a))}const l=Se(e)?1:au(e)?128:ju(e)?64:pe(e)?4:J(e)?2:0;return A(e,t,n,r,o,l,s,!0)}function Vu(e){return e?Mi(e)||Nr in e?Ae({},e):e:null}function fn(e,t,n=!1){const{props:r,ref:o,patchFlag:s,children:l}=e,i=t?Ku(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:i,key:i&&aa(i),ref:t&&t.ref?n&&o?q(o)?o.concat(ir(t)):[o,ir(t)]:ir(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==We?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&fn(e.ssContent),ssFallback:e.ssFallback&&fn(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Ze(e=" ",t=0){return he(Kn,null,e,t)}function ca(e,t){const n=he(lr,null,e);return n.staticCount=t,n}function nn(e="",t=!1){return t?(ye(),no(Xt,null,e)):he(Xt,null,e)}function ct(e){return e==null||typeof e=="boolean"?he(Xt):q(e)?he(We,null,e.slice()):typeof e=="object"?Ct(e):he(Kn,null,String(e))}function Ct(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:fn(e)}function ro(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(q(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),ro(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!(Nr in t)?t._ctx=Ge:o===3&&Ge&&(Ge.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else J(t)?(t={default:t,_ctx:Ge},n=32):(t=String(t),r&64?(n=16,t=[Ze(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ku(...e){const t={};for(let n=0;nDe||Ge;let _r,ps;{const e=_i(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(l=>l(s)):o[0](s)}};_r=t("__VUE_INSTANCE_SETTERS__",n=>De=n),ps=t("__VUE_SSR_SETTERS__",n=>Pr=n)}const Bn=e=>{const t=De;return _r(e),e.scope.on(),()=>{e.scope.off(),_r(t)}},Vo=()=>{De&&De.scope.off(),_r(null)};function ua(e){return e.vnode.shapeFlag&4}let Pr=!1;function qu(e,t=!1){t&&ps(t);const{props:n,children:r}=e.vnode,o=ua(e);Nu(e,n,o,t),Ru(e,r);const s=o?Xu(e,t):void 0;return t&&ps(!1),s}function Xu(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Fi(new Proxy(e.ctx,ku));const{setup:r}=n;if(r){const o=e.setupContext=r.length>1?Qu(e):null,s=Bn(e);zt();const l=Rt(r,e,0,[e.props,o]);if(Zt(),s(),hi(l)){if(l.then(Vo,Vo),t)return l.then(i=>{Ko(e,i,t)}).catch(i=>{Tr(i,e,0)});e.asyncDep=l}else Ko(e,l,t)}else fa(e,t)}function Ko(e,t,n){J(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:pe(t)&&(e.setupState=ji(t)),fa(e,n)}let Bo;function fa(e,t,n){const r=e.type;if(!e.render){if(!t&&Bo&&!r.render){const o=r.template||eo(e).template;if(o){const{isCustomElement:s,compilerOptions:l}=e.appContext.config,{delimiters:i,compilerOptions:a}=r,f=Ae(Ae({isCustomElement:s,delimiters:i},l),a);r.render=Bo(o,f)}}e.render=r.render||ze}{const o=Bn(e);zt();try{wu(e)}finally{Zt(),o()}}}function Ju(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return Ye(e,"get","$attrs"),t[n]}}))}function Qu(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return Ju(e)},slots:e.slots,emit:e.emit,expose:t}}function Ar(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(ji(Fi(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ln)return Ln[n](e)},has(t,n){return n in t||n in Ln}}))}function zu(e){return J(e)&&"__vccOpts"in e}const Ee=(e,t)=>Yc(e,t,Pr);function dn(e,t,n){const r=arguments.length;return r===2?pe(t)&&!q(t)?ms(t)?he(e,null,[t]):he(e,t):he(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ms(n)&&(n=[n]),he(e,t,n))}const Zu="3.4.15";/** * @vue/runtime-dom v3.4.15 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const ef="http://www.w3.org/2000/svg",tf="http://www.w3.org/1998/Math/MathML",Ct=typeof document<"u"?document:null,Go=Ct&&Ct.createElement("template"),nf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?Ct.createElementNS(ef,e):t==="mathml"?Ct.createElementNS(tf,e):Ct.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>Ct.createTextNode(e),createComment:e=>Ct.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ct.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const l=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{Go.innerHTML=r==="svg"?`${e}`:r==="mathml"?`${e}`:e;const i=Go.content;if(r==="svg"||r==="mathml"){const a=i.firstChild;for(;a.firstChild;)i.appendChild(a.firstChild);i.removeChild(a)}t.insertBefore(i,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},rf=Symbol("_vtc");function sf(e,t,n){const r=e[rf];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const of=Symbol("_vod"),lf=Symbol("");function af(e,t,n){const r=e.style,o=r.display,s=Ce(n);if(n&&!s){if(t&&!Ce(t))for(const l in t)n[l]==null&&gs(r,l,"");for(const l in n)gs(r,l,n[l])}else if(s){if(t!==n){const l=r[lf];l&&(n+=";"+l),r.cssText=n}}else t&&e.removeAttribute("style");of in e&&(r.display=o)}const Yo=/\s*!important$/;function gs(e,t,n){if(q(n))n.forEach(r=>gs(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=cf(e,t);Yo.test(n)?e.setProperty(Qt(r),n.replace(Yo,""),"important"):e[r]=n}}const qo=["Webkit","Moz","ms"],Yr={};function cf(e,t){const n=Yr[t];if(n)return n;let r=cn(t);if(r!=="filter"&&r in e)return Yr[t]=r;r=gi(r);for(let o=0;oqr||(pf.then(()=>qr=0),qr=Date.now());function _f(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;nt(bf(r,n.value),t,5,[r])};return n.value=e,n.attached=gf(),n}function bf(e,t){if(q(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const zo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,vf=(e,t,n,r,o,s,l,i,a)=>{const f=o==="svg";t==="class"?sf(e,r,f):t==="style"?af(e,n,r):xr(t)?$s(t)||hf(e,t,n,r,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):yf(e,t,r,f))?ff(e,t,r,s,l,i,a):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),uf(e,t,r,f))};function yf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&zo(t)&&J(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return zo(t)&&Ce(n)?!1:t in e}const hn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return q(t)?n=>tr(t,n):t};function Ef(e){e.target.composing=!0}function Zo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const vt=Symbol("_assign"),da={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[vt]=hn(o);const s=r||o.props&&o.props.type==="number";Ot(e,t?"change":"input",l=>{if(l.target.composing)return;let i=e.value;n&&(i=i.trim()),s&&(i=Nn(i)),e[vt](i)}),n&&Ot(e,"change",()=>{e.value=e.value.trim()}),t||(Ot(e,"compositionstart",Ef),Ot(e,"compositionend",Zo),Ot(e,"change",Zo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:r,number:o}},s){if(e[vt]=hn(s),e.composing)return;const l=o||e.type==="number"?Nn(e.value):e.value,i=t??"";l!==i&&(document.activeElement===e&&e.type!=="range"&&(n||r&&e.value.trim()===i)||(e.value=i))}},xf={created(e,{value:t},n){e.checked=qt(t,n.props.value),e[vt]=hn(n),Ot(e,"change",()=>{e[vt](Dn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[vt]=hn(r),t!==n&&(e.checked=qt(t,r.props.value))}},kf={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=kr(t);Ot(e,"change",()=>{const s=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>n?Nn(Dn(l)):Dn(l));e[vt](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,Qs(()=>{e._assigning=!1})}),e[vt]=hn(r)},mounted(e,{value:t,oldValue:n,modifiers:{number:r}}){el(e,t,n,r)},beforeUpdate(e,t,n){e[vt]=hn(n)},updated(e,{value:t,oldValue:n,modifiers:{number:r}}){e._assigning||el(e,t,n,r)}};function el(e,t,n,r){const o=e.multiple,s=q(t);if(!(o&&!s&&!kr(t))&&!(s&&qt(t,n))){for(let l=0,i=e.options.length;l-1}else a.selected=t.has(f);else if(qt(Dn(a),t)){e.selectedIndex!==l&&(e.selectedIndex=l);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Dn(e){return"_value"in e?e._value:e.value}const wf=["ctrl","shift","alt","meta"],If={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)=>wf.some(n=>e[`${n}Key`]&&!t.includes(n))},Xr=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...s)=>{for(let l=0;l{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const s=Qt(o.key);if(t.some(l=>l===s||Lf[l]===s))return e(o)})},Tf=Ae({patchProp:vf},nf);let tl;function Cf(){return tl||(tl=Fu(Tf))}const Sf=(...e)=>{const t=Cf().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=Nf(r);if(!o)return;const s=t._component;!J(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.innerHTML="";const l=n(o,!1,Of(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},t};function Of(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Nf(e){return Ce(e)?document.querySelector(e):e}/*! +**/const ef="http://www.w3.org/2000/svg",tf="http://www.w3.org/1998/Math/MathML",Ot=typeof document<"u"?document:null,Go=Ot&&Ot.createElement("template"),nf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?Ot.createElementNS(ef,e):t==="mathml"?Ot.createElementNS(tf,e):Ot.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>Ot.createTextNode(e),createComment:e=>Ot.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ot.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const l=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{Go.innerHTML=r==="svg"?`${e}`:r==="mathml"?`${e}`:e;const i=Go.content;if(r==="svg"||r==="mathml"){const a=i.firstChild;for(;a.firstChild;)i.appendChild(a.firstChild);i.removeChild(a)}t.insertBefore(i,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},rf=Symbol("_vtc");function sf(e,t,n){const r=e[rf];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const of=Symbol("_vod"),lf=Symbol("");function af(e,t,n){const r=e.style,o=r.display,s=Se(n);if(n&&!s){if(t&&!Se(t))for(const l in t)n[l]==null&&gs(r,l,"");for(const l in n)gs(r,l,n[l])}else if(s){if(t!==n){const l=r[lf];l&&(n+=";"+l),r.cssText=n}}else t&&e.removeAttribute("style");of in e&&(r.display=o)}const Yo=/\s*!important$/;function gs(e,t,n){if(q(n))n.forEach(r=>gs(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=cf(e,t);Yo.test(n)?e.setProperty(Qt(r),n.replace(Yo,""),"important"):e[r]=n}}const qo=["Webkit","Moz","ms"],Yr={};function cf(e,t){const n=Yr[t];if(n)return n;let r=cn(t);if(r!=="filter"&&r in e)return Yr[t]=r;r=gi(r);for(let o=0;oqr||(pf.then(()=>qr=0),qr=Date.now());function _f(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;rt(bf(r,n.value),t,5,[r])};return n.value=e,n.attached=gf(),n}function bf(e,t){if(q(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const zo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,vf=(e,t,n,r,o,s,l,i,a)=>{const f=o==="svg";t==="class"?sf(e,r,f):t==="style"?af(e,n,r):xr(t)?$s(t)||hf(e,t,n,r,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):yf(e,t,r,f))?ff(e,t,r,s,l,i,a):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),uf(e,t,r,f))};function yf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&zo(t)&&J(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return zo(t)&&Se(n)?!1:t in e}const hn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return q(t)?n=>tr(t,n):t};function Ef(e){e.target.composing=!0}function Zo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Et=Symbol("_assign"),da={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[Et]=hn(o);const s=r||o.props&&o.props.type==="number";Pt(e,t?"change":"input",l=>{if(l.target.composing)return;let i=e.value;n&&(i=i.trim()),s&&(i=Nn(i)),e[Et](i)}),n&&Pt(e,"change",()=>{e.value=e.value.trim()}),t||(Pt(e,"compositionstart",Ef),Pt(e,"compositionend",Zo),Pt(e,"change",Zo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:r,number:o}},s){if(e[Et]=hn(s),e.composing)return;const l=o||e.type==="number"?Nn(e.value):e.value,i=t??"";l!==i&&(document.activeElement===e&&e.type!=="range"&&(n||r&&e.value.trim()===i)||(e.value=i))}},xf={created(e,{value:t},n){e.checked=qt(t,n.props.value),e[Et]=hn(n),Pt(e,"change",()=>{e[Et](Dn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Et]=hn(r),t!==n&&(e.checked=qt(t,r.props.value))}},kf={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=kr(t);Pt(e,"change",()=>{const s=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>n?Nn(Dn(l)):Dn(l));e[Et](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,Qs(()=>{e._assigning=!1})}),e[Et]=hn(r)},mounted(e,{value:t,oldValue:n,modifiers:{number:r}}){el(e,t,n,r)},beforeUpdate(e,t,n){e[Et]=hn(n)},updated(e,{value:t,oldValue:n,modifiers:{number:r}}){e._assigning||el(e,t,n,r)}};function el(e,t,n,r){const o=e.multiple,s=q(t);if(!(o&&!s&&!kr(t))&&!(s&&qt(t,n))){for(let l=0,i=e.options.length;l-1}else a.selected=t.has(f);else if(qt(Dn(a),t)){e.selectedIndex!==l&&(e.selectedIndex=l);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Dn(e){return"_value"in e?e._value:e.value}const wf=["ctrl","shift","alt","meta"],If={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)=>wf.some(n=>e[`${n}Key`]&&!t.includes(n))},Xr=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...s)=>{for(let l=0;l{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const s=Qt(o.key);if(t.some(l=>l===s||Lf[l]===s))return e(o)})},Tf=Ae({patchProp:vf},nf);let tl;function Sf(){return tl||(tl=Fu(Tf))}const Cf=(...e)=>{const t=Sf().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=Nf(r);if(!o)return;const s=t._component;!J(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.innerHTML="";const l=n(o,!1,Of(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},t};function Of(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Nf(e){return Se(e)?document.querySelector(e):e}/*! * shared v9.9.0 * (c) 2024 kazuya kawaguchi * Released under the MIT License. - */const br=typeof window<"u",$t=(e,t=!1)=>t?Symbol.for(e):Symbol(e),Pf=(e,t,n)=>Af({l:e,k:t,s:n}),Af=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Le=e=>typeof e=="number"&&isFinite(e),Rf=e=>pa(e)==="[object Date]",Dt=e=>pa(e)==="[object RegExp]",Rr=e=>X(e)&&Object.keys(e).length===0,Pe=Object.assign;let nl;const _t=()=>nl||(nl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function rl(e){return e.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const Mf=Object.prototype.hasOwnProperty;function vr(e,t){return Mf.call(e,t)}const ge=Array.isArray,he=e=>typeof e=="function",H=e=>typeof e=="string",ee=e=>typeof e=="boolean",ae=e=>e!==null&&typeof e=="object",Ff=e=>ae(e)&&he(e.then)&&he(e.catch),ma=Object.prototype.toString,pa=e=>ma.call(e),X=e=>{if(!ae(e))return!1;const t=Object.getPrototypeOf(e);return t===null||t.constructor===Object},Df=e=>e==null?"":ge(e)||X(e)&&e.toString===ma?JSON.stringify(e,null,2):String(e);function $f(e,t=""){return e.reduce((n,r,o)=>o===0?n+r:n+t+r,"")}function so(e){let t=e;return()=>++t}function Uf(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const zn=e=>!ae(e)||ge(e);function ar(e,t){if(zn(e)||zn(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:r,des:o}=n.pop();Object.keys(r).forEach(s=>{zn(r[s])||zn(o[s])?o[s]=r[s]:n.push({src:r[s],des:o[s]})})}}/*! + */const br=typeof window<"u",Ut=(e,t=!1)=>t?Symbol.for(e):Symbol(e),Pf=(e,t,n)=>Af({l:e,k:t,s:n}),Af=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Le=e=>typeof e=="number"&&isFinite(e),Rf=e=>pa(e)==="[object Date]",$t=e=>pa(e)==="[object RegExp]",Rr=e=>X(e)&&Object.keys(e).length===0,Pe=Object.assign;let nl;const bt=()=>nl||(nl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function rl(e){return e.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const Mf=Object.prototype.hasOwnProperty;function vr(e,t){return Mf.call(e,t)}const _e=Array.isArray,me=e=>typeof e=="function",H=e=>typeof e=="string",ee=e=>typeof e=="boolean",ae=e=>e!==null&&typeof e=="object",Ff=e=>ae(e)&&me(e.then)&&me(e.catch),ma=Object.prototype.toString,pa=e=>ma.call(e),X=e=>{if(!ae(e))return!1;const t=Object.getPrototypeOf(e);return t===null||t.constructor===Object},Df=e=>e==null?"":_e(e)||X(e)&&e.toString===ma?JSON.stringify(e,null,2):String(e);function $f(e,t=""){return e.reduce((n,r,o)=>o===0?n+r:n+t+r,"")}function so(e){let t=e;return()=>++t}function Uf(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const zn=e=>!ae(e)||_e(e);function ar(e,t){if(zn(e)||zn(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:r,des:o}=n.pop();Object.keys(r).forEach(s=>{zn(r[s])||zn(o[s])?o[s]=r[s]:n.push({src:r[s],des:o[s]})})}}/*! * message-compiler v9.9.0 * (c) 2024 kazuya kawaguchi * Released under the MIT License. - */function jf(e,t,n){return{line:e,column:t,offset:n}}function _s(e,t,n){const r={start:e,end:t};return n!=null&&(r.source=n),r}const Hf=/\{([0-9a-zA-Z]+)\}/g;function Wf(e,...t){return t.length===1&&Vf(t[0])&&(t=t[0]),(!t||!t.hasOwnProperty)&&(t={}),e.replace(Hf,(n,r)=>t.hasOwnProperty(r)?t[r]:"")}const ga=Object.assign,sl=e=>typeof e=="string",Vf=e=>e!==null&&typeof e=="object";function _a(e,t=""){return e.reduce((n,r,o)=>o===0?n+r:n+t+r,"")}const Y={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},Kf={[Y.EXPECTED_TOKEN]:"Expected token: '{0}'",[Y.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[Y.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[Y.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[Y.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[Y.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[Y.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[Y.EMPTY_PLACEHOLDER]:"Empty placeholder",[Y.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[Y.INVALID_LINKED_FORMAT]:"Invalid linked format",[Y.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[Y.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[Y.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[Y.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[Y.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[Y.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function vn(e,t,n={}){const{domain:r,messages:o,args:s}=n,l=Wf((o||Kf)[e]||"",...s||[]),i=new SyntaxError(String(l));return i.code=e,t&&(i.location=t),i.domain=r,i}function Bf(e){throw e}const mt=" ",Gf="\r",je=` -`,Yf="\u2028",qf="\u2029";function Xf(e){const t=e;let n=0,r=1,o=1,s=0;const l=M=>t[M]===Gf&&t[M+1]===je,i=M=>t[M]===je,a=M=>t[M]===qf,f=M=>t[M]===Yf,d=M=>l(M)||i(M)||a(M)||f(M),h=()=>n,m=()=>r,_=()=>o,v=()=>s,x=M=>l(M)||a(M)||f(M)?je:t[M],w=()=>x(n),g=()=>x(n+s);function E(){return s=0,d(n)&&(r++,o=0),l(n)&&n++,n++,o++,t[n]}function T(){return l(n+s)&&s++,s++,t[n+s]}function I(){n=0,r=1,o=1,s=0}function N(M=0){s=M}function L(){const M=n+s;for(;M!==n;)E();s=0}return{index:h,line:m,column:_,peekOffset:v,charAt:x,currentChar:w,currentPeek:g,next:E,peek:T,reset:I,resetPeek:N,skipToPeek:L}}const kt=void 0,Jf=".",ol="'",Qf="tokenizer";function zf(e,t={}){const n=t.location!==!1,r=Xf(e),o=()=>r.index(),s=()=>jf(r.line(),r.column(),r.index()),l=s(),i=o(),a={currentType:14,offset:i,startLoc:l,endLoc:l,lastType:14,lastOffset:i,lastStartLoc:l,lastEndLoc:l,braceNest:0,inLinked:!1,text:""},f=()=>a,{onError:d}=t;function h(u,c,p,...b){const k=f();if(c.column+=p,c.offset+=p,d){const O=n?_s(k.startLoc,c):null,F=vn(u,O,{domain:Qf,args:b});d(F)}}function m(u,c,p){u.endLoc=s(),u.currentType=c;const b={type:c};return n&&(b.loc=_s(u.startLoc,u.endLoc)),p!=null&&(b.value=p),b}const _=u=>m(u,14);function v(u,c){return u.currentChar()===c?(u.next(),c):(h(Y.EXPECTED_TOKEN,s(),0,c),"")}function x(u){let c="";for(;u.currentPeek()===mt||u.currentPeek()===je;)c+=u.currentPeek(),u.peek();return c}function w(u){const c=x(u);return u.skipToPeek(),c}function g(u){if(u===kt)return!1;const c=u.charCodeAt(0);return c>=97&&c<=122||c>=65&&c<=90||c===95}function E(u){if(u===kt)return!1;const c=u.charCodeAt(0);return c>=48&&c<=57}function T(u,c){const{currentType:p}=c;if(p!==2)return!1;x(u);const b=g(u.currentPeek());return u.resetPeek(),b}function I(u,c){const{currentType:p}=c;if(p!==2)return!1;x(u);const b=u.currentPeek()==="-"?u.peek():u.currentPeek(),k=E(b);return u.resetPeek(),k}function N(u,c){const{currentType:p}=c;if(p!==2)return!1;x(u);const b=u.currentPeek()===ol;return u.resetPeek(),b}function L(u,c){const{currentType:p}=c;if(p!==8)return!1;x(u);const b=u.currentPeek()===".";return u.resetPeek(),b}function M(u,c){const{currentType:p}=c;if(p!==9)return!1;x(u);const b=g(u.currentPeek());return u.resetPeek(),b}function R(u,c){const{currentType:p}=c;if(!(p===8||p===12))return!1;x(u);const b=u.currentPeek()===":";return u.resetPeek(),b}function Q(u,c){const{currentType:p}=c;if(p!==10)return!1;const b=()=>{const O=u.currentPeek();return O==="{"?g(u.peek()):O==="@"||O==="%"||O==="|"||O===":"||O==="."||O===mt||!O?!1:O===je?(u.peek(),b()):g(O)},k=b();return u.resetPeek(),k}function te(u){x(u);const c=u.currentPeek()==="|";return u.resetPeek(),c}function be(u){const c=x(u),p=u.currentPeek()==="%"&&u.peek()==="{";return u.resetPeek(),{isModulo:p,hasSpace:c.length>0}}function ue(u,c=!0){const p=(k=!1,O="",F=!1)=>{const A=u.currentPeek();return A==="{"?O==="%"?!1:k:A==="@"||!A?O==="%"?!0:k:A==="%"?(u.peek(),p(k,"%",!0)):A==="|"?O==="%"||F?!0:!(O===mt||O===je):A===mt?(u.peek(),p(!0,mt,F)):A===je?(u.peek(),p(!0,je,F)):!0},b=p();return c&&u.resetPeek(),b}function de(u,c){const p=u.currentChar();return p===kt?kt:c(p)?(u.next(),p):null}function De(u){return de(u,p=>{const b=p.charCodeAt(0);return b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===95||b===36})}function $e(u){return de(u,p=>{const b=p.charCodeAt(0);return b>=48&&b<=57})}function se(u){return de(u,p=>{const b=p.charCodeAt(0);return b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102})}function z(u){let c="",p="";for(;c=$e(u);)p+=c;return p}function ne(u){w(u);const c=u.currentChar();return c!=="%"&&h(Y.EXPECTED_TOKEN,s(),0,c),u.next(),"%"}function Re(u){let c="";for(;;){const p=u.currentChar();if(p==="{"||p==="}"||p==="@"||p==="|"||!p)break;if(p==="%")if(ue(u))c+=p,u.next();else break;else if(p===mt||p===je)if(ue(u))c+=p,u.next();else{if(te(u))break;c+=p,u.next()}else c+=p,u.next()}return c}function ke(u){w(u);let c="",p="";for(;c=De(u);)p+=c;return u.currentChar()===kt&&h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),p}function Ne(u){w(u);let c="";return u.currentChar()==="-"?(u.next(),c+=`-${z(u)}`):c+=z(u),u.currentChar()===kt&&h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),c}function we(u){w(u),v(u,"'");let c="",p="";const b=O=>O!==ol&&O!==je;for(;c=de(u,b);)c==="\\"?p+=Je(u):p+=c;const k=u.currentChar();return k===je||k===kt?(h(Y.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),k===je&&(u.next(),v(u,"'")),p):(v(u,"'"),p)}function Je(u){const c=u.currentChar();switch(c){case"\\":case"'":return u.next(),`\\${c}`;case"u":return qe(u,c,4);case"U":return qe(u,c,6);default:return h(Y.UNKNOWN_ESCAPE_SEQUENCE,s(),0,c),""}}function qe(u,c,p){v(u,c);let b="";for(let k=0;kk!=="{"&&k!=="}"&&k!==mt&&k!==je;for(;c=de(u,b);)p+=c;return p}function xe(u){let c="",p="";for(;c=De(u);)p+=c;return p}function S(u){const c=(p=!1,b)=>{const k=u.currentChar();return k==="{"||k==="%"||k==="@"||k==="|"||k==="("||k===")"||!k||k===mt?b:k===je||k===Jf?(b+=k,u.next(),c(p,b)):(b+=k,u.next(),c(!0,b))};return c(!1,"")}function j(u){w(u);const c=v(u,"|");return w(u),c}function $(u,c){let p=null;switch(u.currentChar()){case"{":return c.braceNest>=1&&h(Y.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),u.next(),p=m(c,2,"{"),w(u),c.braceNest++,p;case"}":return c.braceNest>0&&c.currentType===2&&h(Y.EMPTY_PLACEHOLDER,s(),0),u.next(),p=m(c,3,"}"),c.braceNest--,c.braceNest>0&&w(u),c.inLinked&&c.braceNest===0&&(c.inLinked=!1),p;case"@":return c.braceNest>0&&h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),p=K(u,c)||_(c),c.braceNest=0,p;default:let k=!0,O=!0,F=!0;if(te(u))return c.braceNest>0&&h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),p=m(c,1,j(u)),c.braceNest=0,c.inLinked=!1,p;if(c.braceNest>0&&(c.currentType===5||c.currentType===6||c.currentType===7))return h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),c.braceNest=0,Z(u,c);if(k=T(u,c))return p=m(c,5,ke(u)),w(u),p;if(O=I(u,c))return p=m(c,6,Ne(u)),w(u),p;if(F=N(u,c))return p=m(c,7,we(u)),w(u),p;if(!k&&!O&&!F)return p=m(c,13,st(u)),h(Y.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,p.value),w(u),p;break}return p}function K(u,c){const{currentType:p}=c;let b=null;const k=u.currentChar();switch((p===8||p===9||p===12||p===10)&&(k===je||k===mt)&&h(Y.INVALID_LINKED_FORMAT,s(),0),k){case"@":return u.next(),b=m(c,8,"@"),c.inLinked=!0,b;case".":return w(u),u.next(),m(c,9,".");case":":return w(u),u.next(),m(c,10,":");default:return te(u)?(b=m(c,1,j(u)),c.braceNest=0,c.inLinked=!1,b):L(u,c)||R(u,c)?(w(u),K(u,c)):M(u,c)?(w(u),m(c,12,xe(u))):Q(u,c)?(w(u),k==="{"?$(u,c)||b:m(c,11,S(u))):(p===8&&h(Y.INVALID_LINKED_FORMAT,s(),0),c.braceNest=0,c.inLinked=!1,Z(u,c))}}function Z(u,c){let p={type:14};if(c.braceNest>0)return $(u,c)||_(c);if(c.inLinked)return K(u,c)||_(c);switch(u.currentChar()){case"{":return $(u,c)||_(c);case"}":return h(Y.UNBALANCED_CLOSING_BRACE,s(),0),u.next(),m(c,3,"}");case"@":return K(u,c)||_(c);default:if(te(u))return p=m(c,1,j(u)),c.braceNest=0,c.inLinked=!1,p;const{isModulo:k,hasSpace:O}=be(u);if(k)return O?m(c,0,Re(u)):m(c,4,ne(u));if(ue(u))return m(c,0,Re(u));break}return p}function ie(){const{currentType:u,offset:c,startLoc:p,endLoc:b}=a;return a.lastType=u,a.lastOffset=c,a.lastStartLoc=p,a.lastEndLoc=b,a.offset=o(),a.startLoc=s(),r.currentChar()===kt?m(a,14):Z(r,a)}return{nextToken:ie,currentOffset:o,currentPosition:s,context:f}}const Zf="parser",ed=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function td(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(t||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function nd(e={}){const t=e.location!==!1,{onError:n}=e;function r(g,E,T,I,...N){const L=g.currentPosition();if(L.offset+=I,L.column+=I,n){const M=t?_s(T,L):null,R=vn(E,M,{domain:Zf,args:N});n(R)}}function o(g,E,T){const I={type:g};return t&&(I.start=E,I.end=E,I.loc={start:T,end:T}),I}function s(g,E,T,I){I&&(g.type=I),t&&(g.end=E,g.loc&&(g.loc.end=T))}function l(g,E){const T=g.context(),I=o(3,T.offset,T.startLoc);return I.value=E,s(I,g.currentOffset(),g.currentPosition()),I}function i(g,E){const T=g.context(),{lastOffset:I,lastStartLoc:N}=T,L=o(5,I,N);return L.index=parseInt(E,10),g.nextToken(),s(L,g.currentOffset(),g.currentPosition()),L}function a(g,E){const T=g.context(),{lastOffset:I,lastStartLoc:N}=T,L=o(4,I,N);return L.key=E,g.nextToken(),s(L,g.currentOffset(),g.currentPosition()),L}function f(g,E){const T=g.context(),{lastOffset:I,lastStartLoc:N}=T,L=o(9,I,N);return L.value=E.replace(ed,td),g.nextToken(),s(L,g.currentOffset(),g.currentPosition()),L}function d(g){const E=g.nextToken(),T=g.context(),{lastOffset:I,lastStartLoc:N}=T,L=o(8,I,N);return E.type!==12?(r(g,Y.UNEXPECTED_EMPTY_LINKED_MODIFIER,T.lastStartLoc,0),L.value="",s(L,I,N),{nextConsumeToken:E,node:L}):(E.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,it(E)),L.value=E.value||"",s(L,g.currentOffset(),g.currentPosition()),{node:L})}function h(g,E){const T=g.context(),I=o(7,T.offset,T.startLoc);return I.value=E,s(I,g.currentOffset(),g.currentPosition()),I}function m(g){const E=g.context(),T=o(6,E.offset,E.startLoc);let I=g.nextToken();if(I.type===9){const N=d(g);T.modifier=N.node,I=N.nextConsumeToken||g.nextToken()}switch(I.type!==10&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,it(I)),I=g.nextToken(),I.type===2&&(I=g.nextToken()),I.type){case 11:I.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,it(I)),T.key=h(g,I.value||"");break;case 5:I.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,it(I)),T.key=a(g,I.value||"");break;case 6:I.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,it(I)),T.key=i(g,I.value||"");break;case 7:I.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,it(I)),T.key=f(g,I.value||"");break;default:r(g,Y.UNEXPECTED_EMPTY_LINKED_KEY,E.lastStartLoc,0);const N=g.context(),L=o(7,N.offset,N.startLoc);return L.value="",s(L,N.offset,N.startLoc),T.key=L,s(T,N.offset,N.startLoc),{nextConsumeToken:I,node:T}}return s(T,g.currentOffset(),g.currentPosition()),{node:T}}function _(g){const E=g.context(),T=E.currentType===1?g.currentOffset():E.offset,I=E.currentType===1?E.endLoc:E.startLoc,N=o(2,T,I);N.items=[];let L=null;do{const Q=L||g.nextToken();switch(L=null,Q.type){case 0:Q.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,it(Q)),N.items.push(l(g,Q.value||""));break;case 6:Q.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,it(Q)),N.items.push(i(g,Q.value||""));break;case 5:Q.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,it(Q)),N.items.push(a(g,Q.value||""));break;case 7:Q.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,it(Q)),N.items.push(f(g,Q.value||""));break;case 8:const te=m(g);N.items.push(te.node),L=te.nextConsumeToken||null;break}}while(E.currentType!==14&&E.currentType!==1);const M=E.currentType===1?E.lastOffset:g.currentOffset(),R=E.currentType===1?E.lastEndLoc:g.currentPosition();return s(N,M,R),N}function v(g,E,T,I){const N=g.context();let L=I.items.length===0;const M=o(1,E,T);M.cases=[],M.cases.push(I);do{const R=_(g);L||(L=R.items.length===0),M.cases.push(R)}while(N.currentType!==14);return L&&r(g,Y.MUST_HAVE_MESSAGES_IN_PLURAL,T,0),s(M,g.currentOffset(),g.currentPosition()),M}function x(g){const E=g.context(),{offset:T,startLoc:I}=E,N=_(g);return E.currentType===14?N:v(g,T,I,N)}function w(g){const E=zf(g,ga({},e)),T=E.context(),I=o(0,T.offset,T.startLoc);return t&&I.loc&&(I.loc.source=g),I.body=x(E),e.onCacheKey&&(I.cacheKey=e.onCacheKey(g)),T.currentType!==14&&r(E,Y.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,g[T.offset]||""),s(I,E.currentOffset(),E.currentPosition()),I}return{parse:w}}function it(e){if(e.type===14)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function rd(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function ll(e,t){for(let n=0;nil(n)),e}function il(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;ni;function f(w,g){i.code+=w}function d(w,g=!0){const E=g?o:"";f(s?E+" ".repeat(w):E)}function h(w=!0){const g=++i.indentLevel;w&&d(g)}function m(w=!0){const g=--i.indentLevel;w&&d(g)}function _(){d(i.indentLevel)}return{context:a,push:f,indent:h,deindent:m,newline:_,helper:w=>`_${w}`,needIndent:()=>i.needIndent}}function cd(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),mn(e,t.key),t.modifier?(e.push(", "),mn(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function ud(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let s=0;s1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let s=0;s{const n=sl(t.mode)?t.mode:"normal",r=sl(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` + */function jf(e,t,n){return{line:e,column:t,offset:n}}function _s(e,t,n){const r={start:e,end:t};return n!=null&&(r.source=n),r}const Hf=/\{([0-9a-zA-Z]+)\}/g;function Wf(e,...t){return t.length===1&&Vf(t[0])&&(t=t[0]),(!t||!t.hasOwnProperty)&&(t={}),e.replace(Hf,(n,r)=>t.hasOwnProperty(r)?t[r]:"")}const ga=Object.assign,sl=e=>typeof e=="string",Vf=e=>e!==null&&typeof e=="object";function _a(e,t=""){return e.reduce((n,r,o)=>o===0?n+r:n+t+r,"")}const Y={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},Kf={[Y.EXPECTED_TOKEN]:"Expected token: '{0}'",[Y.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[Y.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[Y.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[Y.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[Y.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[Y.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[Y.EMPTY_PLACEHOLDER]:"Empty placeholder",[Y.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[Y.INVALID_LINKED_FORMAT]:"Invalid linked format",[Y.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[Y.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[Y.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[Y.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[Y.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[Y.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function vn(e,t,n={}){const{domain:r,messages:o,args:s}=n,l=Wf((o||Kf)[e]||"",...s||[]),i=new SyntaxError(String(l));return i.code=e,t&&(i.location=t),i.domain=r,i}function Bf(e){throw e}const pt=" ",Gf="\r",He=` +`,Yf="\u2028",qf="\u2029";function Xf(e){const t=e;let n=0,r=1,o=1,s=0;const l=F=>t[F]===Gf&&t[F+1]===He,i=F=>t[F]===He,a=F=>t[F]===qf,f=F=>t[F]===Yf,d=F=>l(F)||i(F)||a(F)||f(F),h=()=>n,m=()=>r,_=()=>o,w=()=>s,v=F=>l(F)||a(F)||f(F)?He:t[F],y=()=>v(n),g=()=>v(n+s);function x(){return s=0,d(n)&&(r++,o=0),l(n)&&n++,n++,o++,t[n]}function L(){return l(n+s)&&s++,s++,t[n+s]}function I(){n=0,r=1,o=1,s=0}function N(F=0){s=F}function T(){const F=n+s;for(;F!==n;)x();s=0}return{index:h,line:m,column:_,peekOffset:w,charAt:v,currentChar:y,currentPeek:g,next:x,peek:L,reset:I,resetPeek:N,skipToPeek:T}}const It=void 0,Jf=".",ol="'",Qf="tokenizer";function zf(e,t={}){const n=t.location!==!1,r=Xf(e),o=()=>r.index(),s=()=>jf(r.line(),r.column(),r.index()),l=s(),i=o(),a={currentType:14,offset:i,startLoc:l,endLoc:l,lastType:14,lastOffset:i,lastStartLoc:l,lastEndLoc:l,braceNest:0,inLinked:!1,text:""},f=()=>a,{onError:d}=t;function h(u,c,p,...b){const k=f();if(c.column+=p,c.offset+=p,d){const O=n?_s(k.startLoc,c):null,D=vn(u,O,{domain:Qf,args:b});d(D)}}function m(u,c,p){u.endLoc=s(),u.currentType=c;const b={type:c};return n&&(b.loc=_s(u.startLoc,u.endLoc)),p!=null&&(b.value=p),b}const _=u=>m(u,14);function w(u,c){return u.currentChar()===c?(u.next(),c):(h(Y.EXPECTED_TOKEN,s(),0,c),"")}function v(u){let c="";for(;u.currentPeek()===pt||u.currentPeek()===He;)c+=u.currentPeek(),u.peek();return c}function y(u){const c=v(u);return u.skipToPeek(),c}function g(u){if(u===It)return!1;const c=u.charCodeAt(0);return c>=97&&c<=122||c>=65&&c<=90||c===95}function x(u){if(u===It)return!1;const c=u.charCodeAt(0);return c>=48&&c<=57}function L(u,c){const{currentType:p}=c;if(p!==2)return!1;v(u);const b=g(u.currentPeek());return u.resetPeek(),b}function I(u,c){const{currentType:p}=c;if(p!==2)return!1;v(u);const b=u.currentPeek()==="-"?u.peek():u.currentPeek(),k=x(b);return u.resetPeek(),k}function N(u,c){const{currentType:p}=c;if(p!==2)return!1;v(u);const b=u.currentPeek()===ol;return u.resetPeek(),b}function T(u,c){const{currentType:p}=c;if(p!==8)return!1;v(u);const b=u.currentPeek()===".";return u.resetPeek(),b}function F(u,c){const{currentType:p}=c;if(p!==9)return!1;v(u);const b=g(u.currentPeek());return u.resetPeek(),b}function M(u,c){const{currentType:p}=c;if(!(p===8||p===12))return!1;v(u);const b=u.currentPeek()===":";return u.resetPeek(),b}function Q(u,c){const{currentType:p}=c;if(p!==10)return!1;const b=()=>{const O=u.currentPeek();return O==="{"?g(u.peek()):O==="@"||O==="%"||O==="|"||O===":"||O==="."||O===pt||!O?!1:O===He?(u.peek(),b()):g(O)},k=b();return u.resetPeek(),k}function te(u){v(u);const c=u.currentPeek()==="|";return u.resetPeek(),c}function be(u){const c=v(u),p=u.currentPeek()==="%"&&u.peek()==="{";return u.resetPeek(),{isModulo:p,hasSpace:c.length>0}}function fe(u,c=!0){const p=(k=!1,O="",D=!1)=>{const R=u.currentPeek();return R==="{"?O==="%"?!1:k:R==="@"||!R?O==="%"?!0:k:R==="%"?(u.peek(),p(k,"%",!0)):R==="|"?O==="%"||D?!0:!(O===pt||O===He):R===pt?(u.peek(),p(!0,pt,D)):R===He?(u.peek(),p(!0,He,D)):!0},b=p();return c&&u.resetPeek(),b}function de(u,c){const p=u.currentChar();return p===It?It:c(p)?(u.next(),p):null}function $e(u){return de(u,p=>{const b=p.charCodeAt(0);return b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===95||b===36})}function Ue(u){return de(u,p=>{const b=p.charCodeAt(0);return b>=48&&b<=57})}function se(u){return de(u,p=>{const b=p.charCodeAt(0);return b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102})}function z(u){let c="",p="";for(;c=Ue(u);)p+=c;return p}function ne(u){y(u);const c=u.currentChar();return c!=="%"&&h(Y.EXPECTED_TOKEN,s(),0,c),u.next(),"%"}function Re(u){let c="";for(;;){const p=u.currentChar();if(p==="{"||p==="}"||p==="@"||p==="|"||!p)break;if(p==="%")if(fe(u))c+=p,u.next();else break;else if(p===pt||p===He)if(fe(u))c+=p,u.next();else{if(te(u))break;c+=p,u.next()}else c+=p,u.next()}return c}function ke(u){y(u);let c="",p="";for(;c=$e(u);)p+=c;return u.currentChar()===It&&h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),p}function Ne(u){y(u);let c="";return u.currentChar()==="-"?(u.next(),c+=`-${z(u)}`):c+=z(u),u.currentChar()===It&&h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),c}function we(u){y(u),w(u,"'");let c="",p="";const b=O=>O!==ol&&O!==He;for(;c=de(u,b);)c==="\\"?p+=Je(u):p+=c;const k=u.currentChar();return k===He||k===It?(h(Y.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),k===He&&(u.next(),w(u,"'")),p):(w(u,"'"),p)}function Je(u){const c=u.currentChar();switch(c){case"\\":case"'":return u.next(),`\\${c}`;case"u":return qe(u,c,4);case"U":return qe(u,c,6);default:return h(Y.UNKNOWN_ESCAPE_SEQUENCE,s(),0,c),""}}function qe(u,c,p){w(u,c);let b="";for(let k=0;kk!=="{"&&k!=="}"&&k!==pt&&k!==He;for(;c=de(u,b);)p+=c;return p}function xe(u){let c="",p="";for(;c=$e(u);)p+=c;return p}function C(u){const c=(p=!1,b)=>{const k=u.currentChar();return k==="{"||k==="%"||k==="@"||k==="|"||k==="("||k===")"||!k||k===pt?b:k===He||k===Jf?(b+=k,u.next(),c(p,b)):(b+=k,u.next(),c(!0,b))};return c(!1,"")}function j(u){y(u);const c=w(u,"|");return y(u),c}function $(u,c){let p=null;switch(u.currentChar()){case"{":return c.braceNest>=1&&h(Y.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),u.next(),p=m(c,2,"{"),y(u),c.braceNest++,p;case"}":return c.braceNest>0&&c.currentType===2&&h(Y.EMPTY_PLACEHOLDER,s(),0),u.next(),p=m(c,3,"}"),c.braceNest--,c.braceNest>0&&y(u),c.inLinked&&c.braceNest===0&&(c.inLinked=!1),p;case"@":return c.braceNest>0&&h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),p=K(u,c)||_(c),c.braceNest=0,p;default:let k=!0,O=!0,D=!0;if(te(u))return c.braceNest>0&&h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),p=m(c,1,j(u)),c.braceNest=0,c.inLinked=!1,p;if(c.braceNest>0&&(c.currentType===5||c.currentType===6||c.currentType===7))return h(Y.UNTERMINATED_CLOSING_BRACE,s(),0),c.braceNest=0,Z(u,c);if(k=L(u,c))return p=m(c,5,ke(u)),y(u),p;if(O=I(u,c))return p=m(c,6,Ne(u)),y(u),p;if(D=N(u,c))return p=m(c,7,we(u)),y(u),p;if(!k&&!O&&!D)return p=m(c,13,ot(u)),h(Y.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,p.value),y(u),p;break}return p}function K(u,c){const{currentType:p}=c;let b=null;const k=u.currentChar();switch((p===8||p===9||p===12||p===10)&&(k===He||k===pt)&&h(Y.INVALID_LINKED_FORMAT,s(),0),k){case"@":return u.next(),b=m(c,8,"@"),c.inLinked=!0,b;case".":return y(u),u.next(),m(c,9,".");case":":return y(u),u.next(),m(c,10,":");default:return te(u)?(b=m(c,1,j(u)),c.braceNest=0,c.inLinked=!1,b):T(u,c)||M(u,c)?(y(u),K(u,c)):F(u,c)?(y(u),m(c,12,xe(u))):Q(u,c)?(y(u),k==="{"?$(u,c)||b:m(c,11,C(u))):(p===8&&h(Y.INVALID_LINKED_FORMAT,s(),0),c.braceNest=0,c.inLinked=!1,Z(u,c))}}function Z(u,c){let p={type:14};if(c.braceNest>0)return $(u,c)||_(c);if(c.inLinked)return K(u,c)||_(c);switch(u.currentChar()){case"{":return $(u,c)||_(c);case"}":return h(Y.UNBALANCED_CLOSING_BRACE,s(),0),u.next(),m(c,3,"}");case"@":return K(u,c)||_(c);default:if(te(u))return p=m(c,1,j(u)),c.braceNest=0,c.inLinked=!1,p;const{isModulo:k,hasSpace:O}=be(u);if(k)return O?m(c,0,Re(u)):m(c,4,ne(u));if(fe(u))return m(c,0,Re(u));break}return p}function ie(){const{currentType:u,offset:c,startLoc:p,endLoc:b}=a;return a.lastType=u,a.lastOffset=c,a.lastStartLoc=p,a.lastEndLoc=b,a.offset=o(),a.startLoc=s(),r.currentChar()===It?m(a,14):Z(r,a)}return{nextToken:ie,currentOffset:o,currentPosition:s,context:f}}const Zf="parser",ed=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function td(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(t||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function nd(e={}){const t=e.location!==!1,{onError:n}=e;function r(g,x,L,I,...N){const T=g.currentPosition();if(T.offset+=I,T.column+=I,n){const F=t?_s(L,T):null,M=vn(x,F,{domain:Zf,args:N});n(M)}}function o(g,x,L){const I={type:g};return t&&(I.start=x,I.end=x,I.loc={start:L,end:L}),I}function s(g,x,L,I){I&&(g.type=I),t&&(g.end=x,g.loc&&(g.loc.end=L))}function l(g,x){const L=g.context(),I=o(3,L.offset,L.startLoc);return I.value=x,s(I,g.currentOffset(),g.currentPosition()),I}function i(g,x){const L=g.context(),{lastOffset:I,lastStartLoc:N}=L,T=o(5,I,N);return T.index=parseInt(x,10),g.nextToken(),s(T,g.currentOffset(),g.currentPosition()),T}function a(g,x){const L=g.context(),{lastOffset:I,lastStartLoc:N}=L,T=o(4,I,N);return T.key=x,g.nextToken(),s(T,g.currentOffset(),g.currentPosition()),T}function f(g,x){const L=g.context(),{lastOffset:I,lastStartLoc:N}=L,T=o(9,I,N);return T.value=x.replace(ed,td),g.nextToken(),s(T,g.currentOffset(),g.currentPosition()),T}function d(g){const x=g.nextToken(),L=g.context(),{lastOffset:I,lastStartLoc:N}=L,T=o(8,I,N);return x.type!==12?(r(g,Y.UNEXPECTED_EMPTY_LINKED_MODIFIER,L.lastStartLoc,0),T.value="",s(T,I,N),{nextConsumeToken:x,node:T}):(x.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,L.lastStartLoc,0,at(x)),T.value=x.value||"",s(T,g.currentOffset(),g.currentPosition()),{node:T})}function h(g,x){const L=g.context(),I=o(7,L.offset,L.startLoc);return I.value=x,s(I,g.currentOffset(),g.currentPosition()),I}function m(g){const x=g.context(),L=o(6,x.offset,x.startLoc);let I=g.nextToken();if(I.type===9){const N=d(g);L.modifier=N.node,I=N.nextConsumeToken||g.nextToken()}switch(I.type!==10&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,at(I)),I=g.nextToken(),I.type===2&&(I=g.nextToken()),I.type){case 11:I.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,at(I)),L.key=h(g,I.value||"");break;case 5:I.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,at(I)),L.key=a(g,I.value||"");break;case 6:I.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,at(I)),L.key=i(g,I.value||"");break;case 7:I.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,at(I)),L.key=f(g,I.value||"");break;default:r(g,Y.UNEXPECTED_EMPTY_LINKED_KEY,x.lastStartLoc,0);const N=g.context(),T=o(7,N.offset,N.startLoc);return T.value="",s(T,N.offset,N.startLoc),L.key=T,s(L,N.offset,N.startLoc),{nextConsumeToken:I,node:L}}return s(L,g.currentOffset(),g.currentPosition()),{node:L}}function _(g){const x=g.context(),L=x.currentType===1?g.currentOffset():x.offset,I=x.currentType===1?x.endLoc:x.startLoc,N=o(2,L,I);N.items=[];let T=null;do{const Q=T||g.nextToken();switch(T=null,Q.type){case 0:Q.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,at(Q)),N.items.push(l(g,Q.value||""));break;case 6:Q.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,at(Q)),N.items.push(i(g,Q.value||""));break;case 5:Q.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,at(Q)),N.items.push(a(g,Q.value||""));break;case 7:Q.value==null&&r(g,Y.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,at(Q)),N.items.push(f(g,Q.value||""));break;case 8:const te=m(g);N.items.push(te.node),T=te.nextConsumeToken||null;break}}while(x.currentType!==14&&x.currentType!==1);const F=x.currentType===1?x.lastOffset:g.currentOffset(),M=x.currentType===1?x.lastEndLoc:g.currentPosition();return s(N,F,M),N}function w(g,x,L,I){const N=g.context();let T=I.items.length===0;const F=o(1,x,L);F.cases=[],F.cases.push(I);do{const M=_(g);T||(T=M.items.length===0),F.cases.push(M)}while(N.currentType!==14);return T&&r(g,Y.MUST_HAVE_MESSAGES_IN_PLURAL,L,0),s(F,g.currentOffset(),g.currentPosition()),F}function v(g){const x=g.context(),{offset:L,startLoc:I}=x,N=_(g);return x.currentType===14?N:w(g,L,I,N)}function y(g){const x=zf(g,ga({},e)),L=x.context(),I=o(0,L.offset,L.startLoc);return t&&I.loc&&(I.loc.source=g),I.body=v(x),e.onCacheKey&&(I.cacheKey=e.onCacheKey(g)),L.currentType!==14&&r(x,Y.UNEXPECTED_LEXICAL_ANALYSIS,L.lastStartLoc,0,g[L.offset]||""),s(I,x.currentOffset(),x.currentPosition()),I}return{parse:y}}function at(e){if(e.type===14)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function rd(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function ll(e,t){for(let n=0;nil(n)),e}function il(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;ni;function f(y,g){i.code+=y}function d(y,g=!0){const x=g?o:"";f(s?x+" ".repeat(y):x)}function h(y=!0){const g=++i.indentLevel;y&&d(g)}function m(y=!0){const g=--i.indentLevel;y&&d(g)}function _(){d(i.indentLevel)}return{context:a,push:f,indent:h,deindent:m,newline:_,helper:y=>`_${y}`,needIndent:()=>i.needIndent}}function cd(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),mn(e,t.key),t.modifier?(e.push(", "),mn(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function ud(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let s=0;s1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let s=0;s{const n=sl(t.mode)?t.mode:"normal",r=sl(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` `,l=t.needIndent?t.needIndent:n!=="arrow",i=e.helpers||[],a=ad(e,{mode:n,filename:r,sourceMap:o,breakLineCode:s,needIndent:l});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(l),i.length>0&&(a.push(`const { ${_a(i.map(h=>`${h}: _${h}`),", ")} } = ctx`),a.newline()),a.push("return "),mn(a,e),a.deindent(l),a.push("}"),delete e.helpers;const{code:f,map:d}=a.context();return{ast:e,code:f,map:d?d.toJSON():void 0}};function md(e,t={}){const n=ga({},t),r=!!n.jit,o=!!n.minify,s=n.optimize==null?!0:n.optimize,i=nd(n).parse(e);return r?(s&&od(i),o&&en(i),{ast:i,code:""}):(sd(i,n),hd(i,n))}/*! * core-base v9.9.0 * (c) 2024 kazuya kawaguchi * Released under the MIT License. - */function pd(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(_t().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(_t().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(_t().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}const Ut=[];Ut[0]={w:[0],i:[3,0],"[":[4],o:[7]};Ut[1]={w:[1],".":[2],"[":[4],o:[7]};Ut[2]={w:[2],i:[3,0],0:[3,0]};Ut[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Ut[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Ut[5]={"'":[4,0],o:8,l:[5,0]};Ut[6]={'"':[4,0],o:8,l:[6,0]};const gd=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function _d(e){return gd.test(e)}function bd(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function vd(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function yd(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:_d(t)?bd(t):"*"+t}function Ed(e){const t=[];let n=-1,r=0,o=0,s,l,i,a,f,d,h;const m=[];m[0]=()=>{l===void 0?l=i:l+=i},m[1]=()=>{l!==void 0&&(t.push(l),l=void 0)},m[2]=()=>{m[0](),o++},m[3]=()=>{if(o>0)o--,r=4,m[0]();else{if(o=0,l===void 0||(l=yd(l),l===!1))return!1;m[1]()}};function _(){const v=e[n+1];if(r===5&&v==="'"||r===6&&v==='"')return n++,i="\\"+v,m[0](),!0}for(;r!==null;)if(n++,s=e[n],!(s==="\\"&&_())){if(a=vd(s),h=Ut[r],f=h[a]||h.l||8,f===8||(r=f[0],f[1]!==void 0&&(d=m[f[1]],d&&(i=s,d()===!1))))return;if(r===7)return t}}const al=new Map;function xd(e,t){return ae(e)?e[t]:null}function kd(e,t){if(!ae(e))return null;let n=al.get(t);if(n||(n=Ed(t),n&&al.set(t,n)),!n)return null;const r=n.length;let o=e,s=0;for(;se,Id=e=>"",Ld="text",Td=e=>e.length===0?"":$f(e),Cd=Df;function cl(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function Sd(e){const t=Le(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(Le(e.named.count)||Le(e.named.n))?Le(e.named.count)?e.named.count:Le(e.named.n)?e.named.n:t:t}function Od(e,t){t.count||(t.count=e),t.n||(t.n=e)}function Nd(e={}){const t=e.locale,n=Sd(e),r=ae(e.pluralRules)&&H(t)&&he(e.pluralRules[t])?e.pluralRules[t]:cl,o=ae(e.pluralRules)&&H(t)&&he(e.pluralRules[t])?cl:void 0,s=g=>g[r(n,g.length,o)],l=e.list||[],i=g=>l[g],a=e.named||{};Le(e.pluralIndex)&&Od(n,a);const f=g=>a[g];function d(g){const E=he(e.messages)?e.messages(g):ae(e.messages)?e.messages[g]:!1;return E||(e.parent?e.parent.message(g):Id)}const h=g=>e.modifiers?e.modifiers[g]:wd,m=X(e.processor)&&he(e.processor.normalize)?e.processor.normalize:Td,_=X(e.processor)&&he(e.processor.interpolate)?e.processor.interpolate:Cd,v=X(e.processor)&&H(e.processor.type)?e.processor.type:Ld,w={list:i,named:f,plural:s,linked:(g,...E)=>{const[T,I]=E;let N="text",L="";E.length===1?ae(T)?(L=T.modifier||L,N=T.type||N):H(T)&&(L=T||L):E.length===2&&(H(T)&&(L=T||L),H(I)&&(N=I||N));const M=d(g)(w),R=N==="vnode"&&ge(M)&&L?M[0]:M;return L?h(L)(R,N):R},message:d,type:v,interpolate:_,normalize:m,values:Pe({},l,a)};return w}let $n=null;function Pd(e){$n=e}function Ad(e,t,n){$n&&$n.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const Rd=Md("function:translate");function Md(e){return t=>$n&&$n.emit(e,t)}const Fd={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,__EXTEND_POINT__:8},ba=Y.__EXTEND_POINT__,Wt=so(ba),tt={INVALID_ARGUMENT:ba,INVALID_DATE_ARGUMENT:Wt(),INVALID_ISO_DATE_ARGUMENT:Wt(),NOT_SUPPORT_NON_STRING_MESSAGE:Wt(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:Wt(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:Wt(),NOT_SUPPORT_LOCALE_TYPE:Wt(),__EXTEND_POINT__:Wt()};function ft(e){return vn(e,null,void 0)}function lo(e,t){return t.locale!=null?ul(t.locale):ul(e.locale)}let Jr;function ul(e){if(H(e))return e;if(he(e)){if(e.resolvedOnce&&Jr!=null)return Jr;if(e.constructor.name==="Function"){const t=e();if(Ff(t))throw ft(tt.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Jr=t}else throw ft(tt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw ft(tt.NOT_SUPPORT_LOCALE_TYPE)}function Dd(e,t,n){return[...new Set([n,...ge(t)?t:ae(t)?Object.keys(t):H(t)?[t]:[n]])]}function va(e,t,n){const r=H(n)?n:pn,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(r);if(!s){s=[];let l=[n];for(;ge(l);)l=fl(s,l,t);const i=ge(t)||!X(t)?t:t.default?t.default:null;l=H(i)?[i]:i,ge(l)&&fl(s,l,!1),o.__localeChainCache.set(r,s)}return s}function fl(e,t,n){let r=!0;for(let o=0;o`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function Hd(){return{upper:(e,t)=>t==="text"&&H(e)?e.toUpperCase():t==="vnode"&&ae(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&H(e)?e.toLowerCase():t==="vnode"&&ae(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&H(e)?hl(e):t==="vnode"&&ae(e)&&"__v_isVNode"in e?hl(e.children):e}}let ya;function ml(e){ya=e}let Ea;function Wd(e){Ea=e}let xa;function Vd(e){xa=e}let ka=null;const Kd=e=>{ka=e},Bd=()=>ka;let wa=null;const pl=e=>{wa=e},Gd=()=>wa;let gl=0;function Yd(e={}){const t=he(e.onWarn)?e.onWarn:Uf,n=H(e.version)?e.version:jd,r=H(e.locale)||he(e.locale)?e.locale:pn,o=he(r)?pn:r,s=ge(e.fallbackLocale)||X(e.fallbackLocale)||H(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,l=X(e.messages)?e.messages:{[o]:{}},i=X(e.datetimeFormats)?e.datetimeFormats:{[o]:{}},a=X(e.numberFormats)?e.numberFormats:{[o]:{}},f=Pe({},e.modifiers||{},Hd()),d=e.pluralRules||{},h=he(e.missing)?e.missing:null,m=ee(e.missingWarn)||Dt(e.missingWarn)?e.missingWarn:!0,_=ee(e.fallbackWarn)||Dt(e.fallbackWarn)?e.fallbackWarn:!0,v=!!e.fallbackFormat,x=!!e.unresolving,w=he(e.postTranslation)?e.postTranslation:null,g=X(e.processor)?e.processor:null,E=ee(e.warnHtmlMessage)?e.warnHtmlMessage:!0,T=!!e.escapeParameter,I=he(e.messageCompiler)?e.messageCompiler:ya,N=he(e.messageResolver)?e.messageResolver:Ea||xd,L=he(e.localeFallbacker)?e.localeFallbacker:xa||Dd,M=ae(e.fallbackContext)?e.fallbackContext:void 0,R=e,Q=ae(R.__datetimeFormatters)?R.__datetimeFormatters:new Map,te=ae(R.__numberFormatters)?R.__numberFormatters:new Map,be=ae(R.__meta)?R.__meta:{};gl++;const ue={version:n,cid:gl,locale:r,fallbackLocale:s,messages:l,modifiers:f,pluralRules:d,missing:h,missingWarn:m,fallbackWarn:_,fallbackFormat:v,unresolving:x,postTranslation:w,processor:g,warnHtmlMessage:E,escapeParameter:T,messageCompiler:I,messageResolver:N,localeFallbacker:L,fallbackContext:M,onWarn:t,__meta:be};return ue.datetimeFormats=i,ue.numberFormats=a,ue.__datetimeFormatters=Q,ue.__numberFormatters=te,__INTLIFY_PROD_DEVTOOLS__&&Ad(ue,n,be),ue}function io(e,t,n,r,o){const{missing:s,onWarn:l}=e;if(s!==null){const i=s(e,n,t,o);return H(i)?i:t}else return t}function xn(e,t,n){const r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function Qr(e){return n=>qd(n,e)}function qd(e,t){const n=t.b||t.body;if((n.t||n.type)===1){const r=n,o=r.c||r.cases;return e.plural(o.reduce((s,l)=>[...s,_l(e,l)],[]))}else return _l(e,n)}function _l(e,t){const n=t.s||t.static;if(n)return e.type==="text"?n:e.normalize([n]);{const r=(t.i||t.items).reduce((o,s)=>[...o,bs(e,s)],[]);return e.normalize(r)}}function bs(e,t){const n=t.t||t.type;switch(n){case 3:const r=t;return r.v||r.value;case 9:const o=t;return o.v||o.value;case 4:const s=t;return e.interpolate(e.named(s.k||s.key));case 5:const l=t;return e.interpolate(e.list(l.i!=null?l.i:l.index));case 6:const i=t,a=i.m||i.modifier;return e.linked(bs(e,i.k||i.key),a?bs(e,a):void 0,e.type);case 7:const f=t;return f.v||f.value;case 8:const d=t;return d.v||d.value;default:throw new Error(`unhandled node type on format message part: ${n}`)}}const Ia=e=>e;let rn=Object.create(null);const gn=e=>ae(e)&&(e.t===0||e.type===0)&&("b"in e||"body"in e);function La(e,t={}){let n=!1;const r=t.onError||Bf;return t.onError=o=>{n=!0,r(o)},{...md(e,t),detectError:n}}const Xd=(e,t)=>{if(!H(e))throw ft(tt.NOT_SUPPORT_NON_STRING_MESSAGE);{ee(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||Ia)(e),o=rn[r];if(o)return o;const{code:s,detectError:l}=La(e,t),i=new Function(`return ${s}`)();return l?i:rn[r]=i}};function Jd(e,t){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&H(e)){ee(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||Ia)(e),o=rn[r];if(o)return o;const{ast:s,detectError:l}=La(e,{...t,location:!1,jit:!0}),i=Qr(s);return l?i:rn[r]=i}else{const n=e.cacheKey;if(n){const r=rn[n];return r||(rn[n]=Qr(e))}else return Qr(e)}}const bl=()=>"",Qe=e=>he(e);function vl(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:s,fallbackLocale:l,messages:i}=e,[a,f]=vs(...t),d=ee(f.missingWarn)?f.missingWarn:e.missingWarn,h=ee(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn,m=ee(f.escapeParameter)?f.escapeParameter:e.escapeParameter,_=!!f.resolvedMessage,v=H(f.default)||ee(f.default)?ee(f.default)?s?a:()=>a:f.default:n?s?a:()=>a:"",x=n||v!=="",w=lo(e,f);m&&Qd(f);let[g,E,T]=_?[a,w,i[w]||{}]:Ta(e,a,w,l,h,d),I=g,N=a;if(!_&&!(H(I)||gn(I)||Qe(I))&&x&&(I=v,N=I),!_&&(!(H(I)||gn(I)||Qe(I))||!H(E)))return o?Mr:a;let L=!1;const M=()=>{L=!0},R=Qe(I)?I:Ca(e,a,E,I,N,M);if(L)return I;const Q=eh(e,E,T,f),te=Nd(Q),be=zd(e,R,te),ue=r?r(be,a):be;if(__INTLIFY_PROD_DEVTOOLS__){const de={timestamp:Date.now(),key:H(a)?a:Qe(I)?I.key:"",locale:E||(Qe(I)?I.locale:""),format:H(I)?I:Qe(I)?I.source:"",message:ue};de.meta=Pe({},e.__meta,Bd()||{}),Rd(de)}return ue}function Qd(e){ge(e.list)?e.list=e.list.map(t=>H(t)?rl(t):t):ae(e.named)&&Object.keys(e.named).forEach(t=>{H(e.named[t])&&(e.named[t]=rl(e.named[t]))})}function Ta(e,t,n,r,o,s){const{messages:l,onWarn:i,messageResolver:a,localeFallbacker:f}=e,d=f(e,r,n);let h={},m,_=null;const v="translate";for(let x=0;xr;return f.locale=n,f.key=t,f}const a=l(r,Zd(e,n,o,r,i,s));return a.locale=n,a.key=t,a.source=r,a}function zd(e,t,n){return t(n)}function vs(...e){const[t,n,r]=e,o={};if(!H(t)&&!Le(t)&&!Qe(t)&&!gn(t))throw ft(tt.INVALID_ARGUMENT);const s=Le(t)?String(t):(Qe(t),t);return Le(n)?o.plural=n:H(n)?o.default=n:X(n)&&!Rr(n)?o.named=n:ge(n)&&(o.list=n),Le(r)?o.plural=r:H(r)?o.default=r:X(r)&&Pe(o,r),[s,o]}function Zd(e,t,n,r,o,s){return{locale:t,key:n,warnHtmlMessage:o,onError:l=>{throw s&&s(l),l},onCacheKey:l=>Pf(t,n,l)}}function eh(e,t,n,r){const{modifiers:o,pluralRules:s,messageResolver:l,fallbackLocale:i,fallbackWarn:a,missingWarn:f,fallbackContext:d}=e,m={locale:t,modifiers:o,pluralRules:s,messages:_=>{let v=l(n,_);if(v==null&&d){const[,,x]=Ta(d,_,t,i,a,f);v=l(x,_)}if(H(v)||gn(v)){let x=!1;const g=Ca(e,_,t,v,_,()=>{x=!0});return x?bl:g}else return Qe(v)?v:bl}};return e.processor&&(m.processor=e.processor),r.list&&(m.list=r.list),r.named&&(m.named=r.named),Le(r.plural)&&(m.pluralIndex=r.plural),m}function yl(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:l}=e,{__datetimeFormatters:i}=e,[a,f,d,h]=ys(...t),m=ee(d.missingWarn)?d.missingWarn:e.missingWarn;ee(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn;const _=!!d.part,v=lo(e,d),x=l(e,o,v);if(!H(a)||a==="")return new Intl.DateTimeFormat(v,h).format(f);let w={},g,E=null;const T="datetime format";for(let L=0;L{Sa.includes(a)?l[a]=n[a]:s[a]=n[a]}),H(r)?s.locale=r:X(r)&&(l=r),X(o)&&(l=o),[s.key||"",i,s,l]}function El(e,t,n){const r=e;for(const o in n){const s=`${t}__${o}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function xl(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:l}=e,{__numberFormatters:i}=e,[a,f,d,h]=Es(...t),m=ee(d.missingWarn)?d.missingWarn:e.missingWarn;ee(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn;const _=!!d.part,v=lo(e,d),x=l(e,o,v);if(!H(a)||a==="")return new Intl.NumberFormat(v,h).format(f);let w={},g,E=null;const T="number format";for(let L=0;L{Oa.includes(a)?l[a]=n[a]:s[a]=n[a]}),H(r)?s.locale=r:X(r)&&(l=r),X(o)&&(l=o),[s.key||"",i,s,l]}function kl(e,t,n){const r=e;for(const o in n){const s=`${t}__${o}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}pd();/*! + */function pd(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(bt().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(bt().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(bt().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}const jt=[];jt[0]={w:[0],i:[3,0],"[":[4],o:[7]};jt[1]={w:[1],".":[2],"[":[4],o:[7]};jt[2]={w:[2],i:[3,0],0:[3,0]};jt[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};jt[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};jt[5]={"'":[4,0],o:8,l:[5,0]};jt[6]={'"':[4,0],o:8,l:[6,0]};const gd=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function _d(e){return gd.test(e)}function bd(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function vd(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function yd(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:_d(t)?bd(t):"*"+t}function Ed(e){const t=[];let n=-1,r=0,o=0,s,l,i,a,f,d,h;const m=[];m[0]=()=>{l===void 0?l=i:l+=i},m[1]=()=>{l!==void 0&&(t.push(l),l=void 0)},m[2]=()=>{m[0](),o++},m[3]=()=>{if(o>0)o--,r=4,m[0]();else{if(o=0,l===void 0||(l=yd(l),l===!1))return!1;m[1]()}};function _(){const w=e[n+1];if(r===5&&w==="'"||r===6&&w==='"')return n++,i="\\"+w,m[0](),!0}for(;r!==null;)if(n++,s=e[n],!(s==="\\"&&_())){if(a=vd(s),h=jt[r],f=h[a]||h.l||8,f===8||(r=f[0],f[1]!==void 0&&(d=m[f[1]],d&&(i=s,d()===!1))))return;if(r===7)return t}}const al=new Map;function xd(e,t){return ae(e)?e[t]:null}function kd(e,t){if(!ae(e))return null;let n=al.get(t);if(n||(n=Ed(t),n&&al.set(t,n)),!n)return null;const r=n.length;let o=e,s=0;for(;se,Id=e=>"",Ld="text",Td=e=>e.length===0?"":$f(e),Sd=Df;function cl(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function Cd(e){const t=Le(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(Le(e.named.count)||Le(e.named.n))?Le(e.named.count)?e.named.count:Le(e.named.n)?e.named.n:t:t}function Od(e,t){t.count||(t.count=e),t.n||(t.n=e)}function Nd(e={}){const t=e.locale,n=Cd(e),r=ae(e.pluralRules)&&H(t)&&me(e.pluralRules[t])?e.pluralRules[t]:cl,o=ae(e.pluralRules)&&H(t)&&me(e.pluralRules[t])?cl:void 0,s=g=>g[r(n,g.length,o)],l=e.list||[],i=g=>l[g],a=e.named||{};Le(e.pluralIndex)&&Od(n,a);const f=g=>a[g];function d(g){const x=me(e.messages)?e.messages(g):ae(e.messages)?e.messages[g]:!1;return x||(e.parent?e.parent.message(g):Id)}const h=g=>e.modifiers?e.modifiers[g]:wd,m=X(e.processor)&&me(e.processor.normalize)?e.processor.normalize:Td,_=X(e.processor)&&me(e.processor.interpolate)?e.processor.interpolate:Sd,w=X(e.processor)&&H(e.processor.type)?e.processor.type:Ld,y={list:i,named:f,plural:s,linked:(g,...x)=>{const[L,I]=x;let N="text",T="";x.length===1?ae(L)?(T=L.modifier||T,N=L.type||N):H(L)&&(T=L||T):x.length===2&&(H(L)&&(T=L||T),H(I)&&(N=I||N));const F=d(g)(y),M=N==="vnode"&&_e(F)&&T?F[0]:F;return T?h(T)(M,N):M},message:d,type:w,interpolate:_,normalize:m,values:Pe({},l,a)};return y}let $n=null;function Pd(e){$n=e}function Ad(e,t,n){$n&&$n.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const Rd=Md("function:translate");function Md(e){return t=>$n&&$n.emit(e,t)}const Fd={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,__EXTEND_POINT__:8},ba=Y.__EXTEND_POINT__,Vt=so(ba),nt={INVALID_ARGUMENT:ba,INVALID_DATE_ARGUMENT:Vt(),INVALID_ISO_DATE_ARGUMENT:Vt(),NOT_SUPPORT_NON_STRING_MESSAGE:Vt(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:Vt(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:Vt(),NOT_SUPPORT_LOCALE_TYPE:Vt(),__EXTEND_POINT__:Vt()};function dt(e){return vn(e,null,void 0)}function lo(e,t){return t.locale!=null?ul(t.locale):ul(e.locale)}let Jr;function ul(e){if(H(e))return e;if(me(e)){if(e.resolvedOnce&&Jr!=null)return Jr;if(e.constructor.name==="Function"){const t=e();if(Ff(t))throw dt(nt.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Jr=t}else throw dt(nt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw dt(nt.NOT_SUPPORT_LOCALE_TYPE)}function Dd(e,t,n){return[...new Set([n,..._e(t)?t:ae(t)?Object.keys(t):H(t)?[t]:[n]])]}function va(e,t,n){const r=H(n)?n:pn,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(r);if(!s){s=[];let l=[n];for(;_e(l);)l=fl(s,l,t);const i=_e(t)||!X(t)?t:t.default?t.default:null;l=H(i)?[i]:i,_e(l)&&fl(s,l,!1),o.__localeChainCache.set(r,s)}return s}function fl(e,t,n){let r=!0;for(let o=0;o`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function Hd(){return{upper:(e,t)=>t==="text"&&H(e)?e.toUpperCase():t==="vnode"&&ae(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&H(e)?e.toLowerCase():t==="vnode"&&ae(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&H(e)?hl(e):t==="vnode"&&ae(e)&&"__v_isVNode"in e?hl(e.children):e}}let ya;function ml(e){ya=e}let Ea;function Wd(e){Ea=e}let xa;function Vd(e){xa=e}let ka=null;const Kd=e=>{ka=e},Bd=()=>ka;let wa=null;const pl=e=>{wa=e},Gd=()=>wa;let gl=0;function Yd(e={}){const t=me(e.onWarn)?e.onWarn:Uf,n=H(e.version)?e.version:jd,r=H(e.locale)||me(e.locale)?e.locale:pn,o=me(r)?pn:r,s=_e(e.fallbackLocale)||X(e.fallbackLocale)||H(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,l=X(e.messages)?e.messages:{[o]:{}},i=X(e.datetimeFormats)?e.datetimeFormats:{[o]:{}},a=X(e.numberFormats)?e.numberFormats:{[o]:{}},f=Pe({},e.modifiers||{},Hd()),d=e.pluralRules||{},h=me(e.missing)?e.missing:null,m=ee(e.missingWarn)||$t(e.missingWarn)?e.missingWarn:!0,_=ee(e.fallbackWarn)||$t(e.fallbackWarn)?e.fallbackWarn:!0,w=!!e.fallbackFormat,v=!!e.unresolving,y=me(e.postTranslation)?e.postTranslation:null,g=X(e.processor)?e.processor:null,x=ee(e.warnHtmlMessage)?e.warnHtmlMessage:!0,L=!!e.escapeParameter,I=me(e.messageCompiler)?e.messageCompiler:ya,N=me(e.messageResolver)?e.messageResolver:Ea||xd,T=me(e.localeFallbacker)?e.localeFallbacker:xa||Dd,F=ae(e.fallbackContext)?e.fallbackContext:void 0,M=e,Q=ae(M.__datetimeFormatters)?M.__datetimeFormatters:new Map,te=ae(M.__numberFormatters)?M.__numberFormatters:new Map,be=ae(M.__meta)?M.__meta:{};gl++;const fe={version:n,cid:gl,locale:r,fallbackLocale:s,messages:l,modifiers:f,pluralRules:d,missing:h,missingWarn:m,fallbackWarn:_,fallbackFormat:w,unresolving:v,postTranslation:y,processor:g,warnHtmlMessage:x,escapeParameter:L,messageCompiler:I,messageResolver:N,localeFallbacker:T,fallbackContext:F,onWarn:t,__meta:be};return fe.datetimeFormats=i,fe.numberFormats=a,fe.__datetimeFormatters=Q,fe.__numberFormatters=te,__INTLIFY_PROD_DEVTOOLS__&&Ad(fe,n,be),fe}function io(e,t,n,r,o){const{missing:s,onWarn:l}=e;if(s!==null){const i=s(e,n,t,o);return H(i)?i:t}else return t}function xn(e,t,n){const r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function Qr(e){return n=>qd(n,e)}function qd(e,t){const n=t.b||t.body;if((n.t||n.type)===1){const r=n,o=r.c||r.cases;return e.plural(o.reduce((s,l)=>[...s,_l(e,l)],[]))}else return _l(e,n)}function _l(e,t){const n=t.s||t.static;if(n)return e.type==="text"?n:e.normalize([n]);{const r=(t.i||t.items).reduce((o,s)=>[...o,bs(e,s)],[]);return e.normalize(r)}}function bs(e,t){const n=t.t||t.type;switch(n){case 3:const r=t;return r.v||r.value;case 9:const o=t;return o.v||o.value;case 4:const s=t;return e.interpolate(e.named(s.k||s.key));case 5:const l=t;return e.interpolate(e.list(l.i!=null?l.i:l.index));case 6:const i=t,a=i.m||i.modifier;return e.linked(bs(e,i.k||i.key),a?bs(e,a):void 0,e.type);case 7:const f=t;return f.v||f.value;case 8:const d=t;return d.v||d.value;default:throw new Error(`unhandled node type on format message part: ${n}`)}}const Ia=e=>e;let rn=Object.create(null);const gn=e=>ae(e)&&(e.t===0||e.type===0)&&("b"in e||"body"in e);function La(e,t={}){let n=!1;const r=t.onError||Bf;return t.onError=o=>{n=!0,r(o)},{...md(e,t),detectError:n}}const Xd=(e,t)=>{if(!H(e))throw dt(nt.NOT_SUPPORT_NON_STRING_MESSAGE);{ee(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||Ia)(e),o=rn[r];if(o)return o;const{code:s,detectError:l}=La(e,t),i=new Function(`return ${s}`)();return l?i:rn[r]=i}};function Jd(e,t){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&H(e)){ee(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||Ia)(e),o=rn[r];if(o)return o;const{ast:s,detectError:l}=La(e,{...t,location:!1,jit:!0}),i=Qr(s);return l?i:rn[r]=i}else{const n=e.cacheKey;if(n){const r=rn[n];return r||(rn[n]=Qr(e))}else return Qr(e)}}const bl=()=>"",Qe=e=>me(e);function vl(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:s,fallbackLocale:l,messages:i}=e,[a,f]=vs(...t),d=ee(f.missingWarn)?f.missingWarn:e.missingWarn,h=ee(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn,m=ee(f.escapeParameter)?f.escapeParameter:e.escapeParameter,_=!!f.resolvedMessage,w=H(f.default)||ee(f.default)?ee(f.default)?s?a:()=>a:f.default:n?s?a:()=>a:"",v=n||w!=="",y=lo(e,f);m&&Qd(f);let[g,x,L]=_?[a,y,i[y]||{}]:Ta(e,a,y,l,h,d),I=g,N=a;if(!_&&!(H(I)||gn(I)||Qe(I))&&v&&(I=w,N=I),!_&&(!(H(I)||gn(I)||Qe(I))||!H(x)))return o?Mr:a;let T=!1;const F=()=>{T=!0},M=Qe(I)?I:Sa(e,a,x,I,N,F);if(T)return I;const Q=eh(e,x,L,f),te=Nd(Q),be=zd(e,M,te),fe=r?r(be,a):be;if(__INTLIFY_PROD_DEVTOOLS__){const de={timestamp:Date.now(),key:H(a)?a:Qe(I)?I.key:"",locale:x||(Qe(I)?I.locale:""),format:H(I)?I:Qe(I)?I.source:"",message:fe};de.meta=Pe({},e.__meta,Bd()||{}),Rd(de)}return fe}function Qd(e){_e(e.list)?e.list=e.list.map(t=>H(t)?rl(t):t):ae(e.named)&&Object.keys(e.named).forEach(t=>{H(e.named[t])&&(e.named[t]=rl(e.named[t]))})}function Ta(e,t,n,r,o,s){const{messages:l,onWarn:i,messageResolver:a,localeFallbacker:f}=e,d=f(e,r,n);let h={},m,_=null;const w="translate";for(let v=0;vr;return f.locale=n,f.key=t,f}const a=l(r,Zd(e,n,o,r,i,s));return a.locale=n,a.key=t,a.source=r,a}function zd(e,t,n){return t(n)}function vs(...e){const[t,n,r]=e,o={};if(!H(t)&&!Le(t)&&!Qe(t)&&!gn(t))throw dt(nt.INVALID_ARGUMENT);const s=Le(t)?String(t):(Qe(t),t);return Le(n)?o.plural=n:H(n)?o.default=n:X(n)&&!Rr(n)?o.named=n:_e(n)&&(o.list=n),Le(r)?o.plural=r:H(r)?o.default=r:X(r)&&Pe(o,r),[s,o]}function Zd(e,t,n,r,o,s){return{locale:t,key:n,warnHtmlMessage:o,onError:l=>{throw s&&s(l),l},onCacheKey:l=>Pf(t,n,l)}}function eh(e,t,n,r){const{modifiers:o,pluralRules:s,messageResolver:l,fallbackLocale:i,fallbackWarn:a,missingWarn:f,fallbackContext:d}=e,m={locale:t,modifiers:o,pluralRules:s,messages:_=>{let w=l(n,_);if(w==null&&d){const[,,v]=Ta(d,_,t,i,a,f);w=l(v,_)}if(H(w)||gn(w)){let v=!1;const g=Sa(e,_,t,w,_,()=>{v=!0});return v?bl:g}else return Qe(w)?w:bl}};return e.processor&&(m.processor=e.processor),r.list&&(m.list=r.list),r.named&&(m.named=r.named),Le(r.plural)&&(m.pluralIndex=r.plural),m}function yl(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:l}=e,{__datetimeFormatters:i}=e,[a,f,d,h]=ys(...t),m=ee(d.missingWarn)?d.missingWarn:e.missingWarn;ee(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn;const _=!!d.part,w=lo(e,d),v=l(e,o,w);if(!H(a)||a==="")return new Intl.DateTimeFormat(w,h).format(f);let y={},g,x=null;const L="datetime format";for(let T=0;T{Ca.includes(a)?l[a]=n[a]:s[a]=n[a]}),H(r)?s.locale=r:X(r)&&(l=r),X(o)&&(l=o),[s.key||"",i,s,l]}function El(e,t,n){const r=e;for(const o in n){const s=`${t}__${o}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function xl(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:l}=e,{__numberFormatters:i}=e,[a,f,d,h]=Es(...t),m=ee(d.missingWarn)?d.missingWarn:e.missingWarn;ee(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn;const _=!!d.part,w=lo(e,d),v=l(e,o,w);if(!H(a)||a==="")return new Intl.NumberFormat(w,h).format(f);let y={},g,x=null;const L="number format";for(let T=0;T{Oa.includes(a)?l[a]=n[a]:s[a]=n[a]}),H(r)?s.locale=r:X(r)&&(l=r),X(o)&&(l=o),[s.key||"",i,s,l]}function kl(e,t,n){const r=e;for(const o in n){const s=`${t}__${o}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}pd();/*! * vue-i18n v9.9.0 * (c) 2024 kazuya kawaguchi * Released under the MIT License. - */const th="9.9.0";function nh(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(_t().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(_t().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(_t().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(_t().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(_t().__INTLIFY_PROD_DEVTOOLS__=!1)}const Na=Fd.__EXTEND_POINT__,wt=so(Na);wt(),wt(),wt(),wt(),wt(),wt(),wt(),wt();const Pa=tt.__EXTEND_POINT__,Ve=so(Pa),Te={UNEXPECTED_RETURN_TYPE:Pa,INVALID_ARGUMENT:Ve(),MUST_BE_CALL_SETUP_TOP:Ve(),NOT_INSTALLED:Ve(),NOT_AVAILABLE_IN_LEGACY_MODE:Ve(),REQUIRED_VALUE:Ve(),INVALID_VALUE:Ve(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Ve(),NOT_INSTALLED_WITH_PROVIDE:Ve(),UNEXPECTED_ERROR:Ve(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Ve(),BRIDGE_SUPPORT_VUE_2_ONLY:Ve(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Ve(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Ve(),__EXTEND_POINT__:Ve()};function Oe(e,...t){return vn(e,null,void 0)}const xs=$t("__translateVNode"),ks=$t("__datetimeParts"),ws=$t("__numberParts"),Aa=$t("__setPluralRules"),Ra=$t("__injectWithOption"),Is=$t("__dispose");function Un(e){if(!ae(e))return e;for(const t in e)if(vr(e,t))if(!t.includes("."))ae(e[t])&&Un(e[t]);else{const n=t.split("."),r=n.length-1;let o=e,s=!1;for(let l=0;l{if("locale"in i&&"resource"in i){const{locale:a,resource:f}=i;a?(l[a]=l[a]||{},ar(f,l[a])):ar(f,l)}else H(i)&&ar(JSON.parse(i),l)}),o==null&&s)for(const i in l)vr(l,i)&&Un(l[i]);return l}function Ma(e){return e.type}function Fa(e,t,n){let r=ae(t.messages)?t.messages:{};"__i18nGlobal"in n&&(r=Fr(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(s=>{e.mergeLocaleMessage(s,r[s])});{if(ae(t.datetimeFormats)){const s=Object.keys(t.datetimeFormats);s.length&&s.forEach(l=>{e.mergeDateTimeFormat(l,t.datetimeFormats[l])})}if(ae(t.numberFormats)){const s=Object.keys(t.numberFormats);s.length&&s.forEach(l=>{e.mergeNumberFormat(l,t.numberFormats[l])})}}}function wl(e){return _e(Kn,null,e,0)}const Il="__INTLIFY_META__",Ll=()=>[],rh=()=>!1;let Tl=0;function Cl(e){return(t,n,r,o)=>e(n,r,Fn()||void 0,o)}const sh=()=>{const e=Fn();let t=null;return e&&(t=Ma(e)[Il])?{[Il]:t}:null};function ao(e={},t){const{__root:n,__injectWithOption:r}=e,o=n===void 0,s=e.flatJson,l=br?fe:Xs;let i=ee(e.inheritLocale)?e.inheritLocale:!0;const a=l(n&&i?n.locale.value:H(e.locale)?e.locale:pn),f=l(n&&i?n.fallbackLocale.value:H(e.fallbackLocale)||ge(e.fallbackLocale)||X(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:a.value),d=l(Fr(a.value,e)),h=l(X(e.datetimeFormats)?e.datetimeFormats:{[a.value]:{}}),m=l(X(e.numberFormats)?e.numberFormats:{[a.value]:{}});let _=n?n.missingWarn:ee(e.missingWarn)||Dt(e.missingWarn)?e.missingWarn:!0,v=n?n.fallbackWarn:ee(e.fallbackWarn)||Dt(e.fallbackWarn)?e.fallbackWarn:!0,x=n?n.fallbackRoot:ee(e.fallbackRoot)?e.fallbackRoot:!0,w=!!e.fallbackFormat,g=he(e.missing)?e.missing:null,E=he(e.missing)?Cl(e.missing):null,T=he(e.postTranslation)?e.postTranslation:null,I=n?n.warnHtmlMessage:ee(e.warnHtmlMessage)?e.warnHtmlMessage:!0,N=!!e.escapeParameter;const L=n?n.modifiers:X(e.modifiers)?e.modifiers:{};let M=e.pluralRules||n&&n.pluralRules,R;R=(()=>{o&&pl(null);const y={version:th,locale:a.value,fallbackLocale:f.value,messages:d.value,modifiers:L,pluralRules:M,missing:E===null?void 0:E,missingWarn:_,fallbackWarn:v,fallbackFormat:w,unresolving:!0,postTranslation:T===null?void 0:T,warnHtmlMessage:I,escapeParameter:N,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};y.datetimeFormats=h.value,y.numberFormats=m.value,y.__datetimeFormatters=X(R)?R.__datetimeFormatters:void 0,y.__numberFormatters=X(R)?R.__numberFormatters:void 0;const C=Yd(y);return o&&pl(C),C})(),xn(R,a.value,f.value);function te(){return[a.value,f.value,d.value,h.value,m.value]}const be=Ee({get:()=>a.value,set:y=>{a.value=y,R.locale=a.value}}),ue=Ee({get:()=>f.value,set:y=>{f.value=y,R.fallbackLocale=f.value,xn(R,a.value,y)}}),de=Ee(()=>d.value),De=Ee(()=>h.value),$e=Ee(()=>m.value);function se(){return he(T)?T:null}function z(y){T=y,R.postTranslation=y}function ne(){return g}function Re(y){y!==null&&(E=Cl(y)),g=y,R.missing=E}const ke=(y,C,B,G,oe,ve)=>{te();let Se;try{__INTLIFY_PROD_DEVTOOLS__,o||(R.fallbackContext=n?Gd():void 0),Se=y(R)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(R.fallbackContext=void 0)}if(B!=="translate exists"&&Le(Se)&&Se===Mr||B==="translate exists"&&!Se){const[Et,Hr]=C();return n&&x?G(n):oe(Et)}else{if(ve(Se))return Se;throw Oe(Te.UNEXPECTED_RETURN_TYPE)}};function Ne(...y){return ke(C=>Reflect.apply(vl,null,[C,...y]),()=>vs(...y),"translate",C=>Reflect.apply(C.t,C,[...y]),C=>C,C=>H(C))}function we(...y){const[C,B,G]=y;if(G&&!ae(G))throw Oe(Te.INVALID_ARGUMENT);return Ne(C,B,Pe({resolvedMessage:!0},G||{}))}function Je(...y){return ke(C=>Reflect.apply(yl,null,[C,...y]),()=>ys(...y),"datetime format",C=>Reflect.apply(C.d,C,[...y]),()=>dl,C=>H(C))}function qe(...y){return ke(C=>Reflect.apply(xl,null,[C,...y]),()=>Es(...y),"number format",C=>Reflect.apply(C.n,C,[...y]),()=>dl,C=>H(C))}function st(y){return y.map(C=>H(C)||Le(C)||ee(C)?wl(String(C)):C)}const S={normalize:st,interpolate:y=>y,type:"vnode"};function j(...y){return ke(C=>{let B;const G=C;try{G.processor=S,B=Reflect.apply(vl,null,[G,...y])}finally{G.processor=null}return B},()=>vs(...y),"translate",C=>C[xs](...y),C=>[wl(C)],C=>ge(C))}function $(...y){return ke(C=>Reflect.apply(xl,null,[C,...y]),()=>Es(...y),"number format",C=>C[ws](...y),Ll,C=>H(C)||ge(C))}function K(...y){return ke(C=>Reflect.apply(yl,null,[C,...y]),()=>ys(...y),"datetime format",C=>C[ks](...y),Ll,C=>H(C)||ge(C))}function Z(y){M=y,R.pluralRules=M}function ie(y,C){return ke(()=>{if(!y)return!1;const B=H(C)?C:a.value,G=p(B),oe=R.messageResolver(G,y);return gn(oe)||Qe(oe)||H(oe)},()=>[y],"translate exists",B=>Reflect.apply(B.te,B,[y,C]),rh,B=>ee(B))}function u(y){let C=null;const B=va(R,f.value,a.value);for(let G=0;G{i&&(a.value=y,R.locale=y,xn(R,a.value,f.value))}),Rt(n.fallbackLocale,y=>{i&&(f.value=y,R.fallbackLocale=y,xn(R,a.value,f.value))}));const W={id:Tl,locale:be,fallbackLocale:ue,get inheritLocale(){return i},set inheritLocale(y){i=y,y&&n&&(a.value=n.locale.value,f.value=n.fallbackLocale.value,xn(R,a.value,f.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:de,get modifiers(){return L},get pluralRules(){return M||{}},get isGlobal(){return o},get missingWarn(){return _},set missingWarn(y){_=y,R.missingWarn=_},get fallbackWarn(){return v},set fallbackWarn(y){v=y,R.fallbackWarn=v},get fallbackRoot(){return x},set fallbackRoot(y){x=y},get fallbackFormat(){return w},set fallbackFormat(y){w=y,R.fallbackFormat=w},get warnHtmlMessage(){return I},set warnHtmlMessage(y){I=y,R.warnHtmlMessage=y},get escapeParameter(){return N},set escapeParameter(y){N=y,R.escapeParameter=y},t:Ne,getLocaleMessage:p,setLocaleMessage:b,mergeLocaleMessage:k,getPostTranslationHandler:se,setPostTranslationHandler:z,getMissingHandler:ne,setMissingHandler:Re,[Aa]:Z};return W.datetimeFormats=De,W.numberFormats=$e,W.rt=we,W.te=ie,W.tm=c,W.d=Je,W.n=qe,W.getDateTimeFormat=O,W.setDateTimeFormat=F,W.mergeDateTimeFormat=A,W.getNumberFormat=U,W.setNumberFormat=P,W.mergeNumberFormat=V,W[Ra]=r,W[xs]=j,W[ks]=K,W[ws]=$,W}function oh(e){const t=H(e.locale)?e.locale:pn,n=H(e.fallbackLocale)||ge(e.fallbackLocale)||X(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,r=he(e.missing)?e.missing:void 0,o=ee(e.silentTranslationWarn)||Dt(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,s=ee(e.silentFallbackWarn)||Dt(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,l=ee(e.fallbackRoot)?e.fallbackRoot:!0,i=!!e.formatFallbackMessages,a=X(e.modifiers)?e.modifiers:{},f=e.pluralizationRules,d=he(e.postTranslation)?e.postTranslation:void 0,h=H(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,m=!!e.escapeParameterHtml,_=ee(e.sync)?e.sync:!0;let v=e.messages;if(X(e.sharedMessages)){const N=e.sharedMessages;v=Object.keys(N).reduce((M,R)=>{const Q=M[R]||(M[R]={});return Pe(Q,N[R]),M},v||{})}const{__i18n:x,__root:w,__injectWithOption:g}=e,E=e.datetimeFormats,T=e.numberFormats,I=e.flatJson;return{locale:t,fallbackLocale:n,messages:v,flatJson:I,datetimeFormats:E,numberFormats:T,missing:r,missingWarn:o,fallbackWarn:s,fallbackRoot:l,fallbackFormat:i,modifiers:a,pluralRules:f,postTranslation:d,warnHtmlMessage:h,escapeParameter:m,messageResolver:e.messageResolver,inheritLocale:_,__i18n:x,__root:w,__injectWithOption:g}}function Ls(e={},t){{const n=ao(oh(e)),{__extender:r}=e,o={id:n.id,get locale(){return n.locale.value},set locale(s){n.locale.value=s},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(s){n.fallbackLocale.value=s},get messages(){return n.messages.value},get datetimeFormats(){return n.datetimeFormats.value},get numberFormats(){return n.numberFormats.value},get availableLocales(){return n.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(s){},get missing(){return n.getMissingHandler()},set missing(s){n.setMissingHandler(s)},get silentTranslationWarn(){return ee(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(s){n.missingWarn=ee(s)?!s:s},get silentFallbackWarn(){return ee(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(s){n.fallbackWarn=ee(s)?!s:s},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(s){n.fallbackFormat=s},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(s){n.setPostTranslationHandler(s)},get sync(){return n.inheritLocale},set sync(s){n.inheritLocale=s},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){n.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(s){n.escapeParameter=s},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(s){},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...s){const[l,i,a]=s,f={};let d=null,h=null;if(!H(l))throw Oe(Te.INVALID_ARGUMENT);const m=l;return H(i)?f.locale=i:ge(i)?d=i:X(i)&&(h=i),ge(a)?d=a:X(a)&&(h=a),Reflect.apply(n.t,n,[m,d||h||{},f])},rt(...s){return Reflect.apply(n.rt,n,[...s])},tc(...s){const[l,i,a]=s,f={plural:1};let d=null,h=null;if(!H(l))throw Oe(Te.INVALID_ARGUMENT);const m=l;return H(i)?f.locale=i:Le(i)?f.plural=i:ge(i)?d=i:X(i)&&(h=i),H(a)?f.locale=a:ge(a)?d=a:X(a)&&(h=a),Reflect.apply(n.t,n,[m,d||h||{},f])},te(s,l){return n.te(s,l)},tm(s){return n.tm(s)},getLocaleMessage(s){return n.getLocaleMessage(s)},setLocaleMessage(s,l){n.setLocaleMessage(s,l)},mergeLocaleMessage(s,l){n.mergeLocaleMessage(s,l)},d(...s){return Reflect.apply(n.d,n,[...s])},getDateTimeFormat(s){return n.getDateTimeFormat(s)},setDateTimeFormat(s,l){n.setDateTimeFormat(s,l)},mergeDateTimeFormat(s,l){n.mergeDateTimeFormat(s,l)},n(...s){return Reflect.apply(n.n,n,[...s])},getNumberFormat(s){return n.getNumberFormat(s)},setNumberFormat(s,l){n.setNumberFormat(s,l)},mergeNumberFormat(s,l){n.mergeNumberFormat(s,l)},getChoiceIndex(s,l){return-1}};return o.__extender=r,o}}const co={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function lh({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((r,o)=>[...r,...o.type===He?o.children:[o]],[]):t.reduce((n,r)=>{const o=e[r];return o&&(n[r]=o()),n},{})}function Da(e){return He}const ih=ht({name:"i18n-t",props:Pe({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Le(e)||!isNaN(e)}},co),setup(e,t){const{slots:n,attrs:r}=t,o=e.i18n||uo({useScope:e.scope,__useComponent:!0});return()=>{const s=Object.keys(n).filter(h=>h!=="_"),l={};e.locale&&(l.locale=e.locale),e.plural!==void 0&&(l.plural=H(e.plural)?+e.plural:e.plural);const i=lh(t,s),a=o[xs](e.keypath,i,l),f=Pe({},r),d=H(e.tag)||ae(e.tag)?e.tag:Da();return dn(d,f,a)}}}),Sl=ih;function ah(e){return ge(e)&&!H(e[0])}function $a(e,t,n,r){const{slots:o,attrs:s}=t;return()=>{const l={part:!0};let i={};e.locale&&(l.locale=e.locale),H(e.format)?l.key=e.format:ae(e.format)&&(H(e.format.key)&&(l.key=e.format.key),i=Object.keys(e.format).reduce((m,_)=>n.includes(_)?Pe({},m,{[_]:e.format[_]}):m,{}));const a=r(e.value,l,i);let f=[l.key];ge(a)?f=a.map((m,_)=>{const v=o[m.type],x=v?v({[m.type]:m.value,index:_,parts:a}):[m.value];return ah(x)&&(x[0].key=`${m.type}-${_}`),x}):H(a)&&(f=[a]);const d=Pe({},s),h=H(e.tag)||ae(e.tag)?e.tag:Da();return dn(h,d,f)}}const ch=ht({name:"i18n-n",props:Pe({value:{type:Number,required:!0},format:{type:[String,Object]}},co),setup(e,t){const n=e.i18n||uo({useScope:"parent",__useComponent:!0});return $a(e,t,Oa,(...r)=>n[ws](...r))}}),Ol=ch,uh=ht({name:"i18n-d",props:Pe({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},co),setup(e,t){const n=e.i18n||uo({useScope:"parent",__useComponent:!0});return $a(e,t,Sa,(...r)=>n[ks](...r))}}),Nl=uh;function fh(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const r=n.__getInstance(t);return r!=null?r.__composer:e.global.__composer}}function dh(e){const t=l=>{const{instance:i,modifiers:a,value:f}=l;if(!i||!i.$)throw Oe(Te.UNEXPECTED_ERROR);const d=fh(e,i.$),h=Pl(f);return[Reflect.apply(d.t,d,[...Al(h)]),d]};return{created:(l,i)=>{const[a,f]=t(i);br&&e.global===f&&(l.__i18nWatcher=Rt(f.locale,()=>{i.instance&&i.instance.$forceUpdate()})),l.__composer=f,l.textContent=a},unmounted:l=>{br&&l.__i18nWatcher&&(l.__i18nWatcher(),l.__i18nWatcher=void 0,delete l.__i18nWatcher),l.__composer&&(l.__composer=void 0,delete l.__composer)},beforeUpdate:(l,{value:i})=>{if(l.__composer){const a=l.__composer,f=Pl(i);l.textContent=Reflect.apply(a.t,a,[...Al(f)])}},getSSRProps:l=>{const[i]=t(l);return{textContent:i}}}}function Pl(e){if(H(e))return{path:e};if(X(e)){if(!("path"in e))throw Oe(Te.REQUIRED_VALUE,"path");return e}else throw Oe(Te.INVALID_VALUE)}function Al(e){const{path:t,locale:n,args:r,choice:o,plural:s}=e,l={},i=r||{};return H(n)&&(l.locale=n),Le(o)&&(l.plural=o),Le(s)&&(l.plural=s),[t,i,l]}function hh(e,t,...n){const r=X(n[0])?n[0]:{},o=!!r.useI18nComponentName;(ee(r.globalInstall)?r.globalInstall:!0)&&([o?"i18n":Sl.name,"I18nT"].forEach(l=>e.component(l,Sl)),[Ol.name,"I18nN"].forEach(l=>e.component(l,Ol)),[Nl.name,"I18nD"].forEach(l=>e.component(l,Nl))),e.directive("t",dh(t))}function mh(e,t,n){return{beforeCreate(){const r=Fn();if(!r)throw Oe(Te.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const s=o.i18n;if(o.__i18n&&(s.__i18n=o.__i18n),s.__root=t,this===this.$root)this.$i18n=Rl(e,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=Ls(s);const l=this.$i18n;l.__extender&&(l.__disposer=l.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Rl(e,o);else{this.$i18n=Ls({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&Fa(t,o,o),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,l)=>this.$i18n.te(s,l),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=Fn();if(!r)throw Oe(Te.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(r),delete this.$i18n}}}function Rl(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[Aa](t.pluralizationRules||e.pluralizationRules);const n=Fr(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(r=>e.mergeLocaleMessage(r,n[r])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(r=>e.mergeDateTimeFormat(r,t.datetimeFormats[r])),t.numberFormats&&Object.keys(t.numberFormats).forEach(r=>e.mergeNumberFormat(r,t.numberFormats[r])),e}const ph=$t("global-vue-i18n");function gh(e={},t){const n=__VUE_I18N_LEGACY_API__&&ee(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,r=ee(e.globalInjection)?e.globalInjection:!0,o=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,s=new Map,[l,i]=_h(e,n),a=$t("");function f(m){return s.get(m)||null}function d(m,_){s.set(m,_)}function h(m){s.delete(m)}{const m={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return o},async install(_,...v){if(_.__VUE_I18N_SYMBOL__=a,_.provide(_.__VUE_I18N_SYMBOL__,m),X(v[0])){const g=v[0];m.__composerExtend=g.__composerExtend,m.__vueI18nExtend=g.__vueI18nExtend}let x=null;!n&&r&&(x=Lh(_,m.global)),__VUE_I18N_FULL_INSTALL__&&hh(_,m,...v),__VUE_I18N_LEGACY_API__&&n&&_.mixin(mh(i,i.__composer,m));const w=_.unmount;_.unmount=()=>{x&&x(),m.dispose(),w()}},get global(){return i},dispose(){l.stop()},__instances:s,__getInstance:f,__setInstance:d,__deleteInstance:h};return m}}function uo(e={}){const t=Fn();if(t==null)throw Oe(Te.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Oe(Te.NOT_INSTALLED);const n=bh(t),r=yh(n),o=Ma(t),s=vh(e,o);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Oe(Te.NOT_AVAILABLE_IN_LEGACY_MODE);return wh(t,s,r,e)}if(s==="global")return Fa(r,e,o),r;if(s==="parent"){let a=Eh(n,t,e.__useComponent);return a==null&&(a=r),a}const l=n;let i=l.__getInstance(t);if(i==null){const a=Pe({},e);"__i18n"in o&&(a.__i18n=o.__i18n),r&&(a.__root=r),i=ao(a),l.__composerExtend&&(i[Is]=l.__composerExtend(i)),kh(l,t,i),l.__setInstance(t,i)}return i}function _h(e,t,n){const r=Ic();{const o=__VUE_I18N_LEGACY_API__&&t?r.run(()=>Ls(e)):r.run(()=>ao(e));if(o==null)throw Oe(Te.UNEXPECTED_ERROR);return[r,o]}}function bh(e){{const t=dt(e.isCE?ph:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Oe(e.isCE?Te.NOT_INSTALLED_WITH_PROVIDE:Te.UNEXPECTED_ERROR);return t}}function vh(e,t){return Rr(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function yh(e){return e.mode==="composition"?e.global:e.global.__composer}function Eh(e,t,n=!1){let r=null;const o=t.root;let s=xh(t,n);for(;s!=null;){const l=e;if(e.mode==="composition")r=l.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const i=l.__getInstance(s);i!=null&&(r=i.__composer,n&&r&&!r[Ra]&&(r=null))}if(r!=null||o===s)break;s=s.parent}return r}function xh(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function kh(e,t,n){Or(()=>{},t),Zs(()=>{const r=n;e.__deleteInstance(t);const o=r[Is];o&&(o(),delete r[Is])},t)}function wh(e,t,n,r={}){const o=t==="local",s=Xs(null);if(o&&e.proxy&&!(e.proxy.$options.i18n||e.proxy.$options.__i18n))throw Oe(Te.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const l=ee(r.inheritLocale)?r.inheritLocale:!H(r.locale),i=fe(!o||l?n.locale.value:H(r.locale)?r.locale:pn),a=fe(!o||l?n.fallbackLocale.value:H(r.fallbackLocale)||ge(r.fallbackLocale)||X(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:i.value),f=fe(Fr(i.value,r)),d=fe(X(r.datetimeFormats)?r.datetimeFormats:{[i.value]:{}}),h=fe(X(r.numberFormats)?r.numberFormats:{[i.value]:{}}),m=o?n.missingWarn:ee(r.missingWarn)||Dt(r.missingWarn)?r.missingWarn:!0,_=o?n.fallbackWarn:ee(r.fallbackWarn)||Dt(r.fallbackWarn)?r.fallbackWarn:!0,v=o?n.fallbackRoot:ee(r.fallbackRoot)?r.fallbackRoot:!0,x=!!r.fallbackFormat,w=he(r.missing)?r.missing:null,g=he(r.postTranslation)?r.postTranslation:null,E=o?n.warnHtmlMessage:ee(r.warnHtmlMessage)?r.warnHtmlMessage:!0,T=!!r.escapeParameter,I=o?n.modifiers:X(r.modifiers)?r.modifiers:{},N=r.pluralRules||o&&n.pluralRules;function L(){return[i.value,a.value,f.value,d.value,h.value]}const M=Ee({get:()=>s.value?s.value.locale.value:i.value,set:c=>{s.value&&(s.value.locale.value=c),i.value=c}}),R=Ee({get:()=>s.value?s.value.fallbackLocale.value:a.value,set:c=>{s.value&&(s.value.fallbackLocale.value=c),a.value=c}}),Q=Ee(()=>s.value?s.value.messages.value:f.value),te=Ee(()=>d.value),be=Ee(()=>h.value);function ue(){return s.value?s.value.getPostTranslationHandler():g}function de(c){s.value&&s.value.setPostTranslationHandler(c)}function De(){return s.value?s.value.getMissingHandler():w}function $e(c){s.value&&s.value.setMissingHandler(c)}function se(c){return L(),c()}function z(...c){return s.value?se(()=>Reflect.apply(s.value.t,null,[...c])):se(()=>"")}function ne(...c){return s.value?Reflect.apply(s.value.rt,null,[...c]):""}function Re(...c){return s.value?se(()=>Reflect.apply(s.value.d,null,[...c])):se(()=>"")}function ke(...c){return s.value?se(()=>Reflect.apply(s.value.n,null,[...c])):se(()=>"")}function Ne(c){return s.value?s.value.tm(c):{}}function we(c,p){return s.value?s.value.te(c,p):!1}function Je(c){return s.value?s.value.getLocaleMessage(c):{}}function qe(c,p){s.value&&(s.value.setLocaleMessage(c,p),f.value[c]=p)}function st(c,p){s.value&&s.value.mergeLocaleMessage(c,p)}function xe(c){return s.value?s.value.getDateTimeFormat(c):{}}function S(c,p){s.value&&(s.value.setDateTimeFormat(c,p),d.value[c]=p)}function j(c,p){s.value&&s.value.mergeDateTimeFormat(c,p)}function $(c){return s.value?s.value.getNumberFormat(c):{}}function K(c,p){s.value&&(s.value.setNumberFormat(c,p),h.value[c]=p)}function Z(c,p){s.value&&s.value.mergeNumberFormat(c,p)}const ie={get id(){return s.value?s.value.id:-1},locale:M,fallbackLocale:R,messages:Q,datetimeFormats:te,numberFormats:be,get inheritLocale(){return s.value?s.value.inheritLocale:l},set inheritLocale(c){s.value&&(s.value.inheritLocale=c)},get availableLocales(){return s.value?s.value.availableLocales:Object.keys(f.value)},get modifiers(){return s.value?s.value.modifiers:I},get pluralRules(){return s.value?s.value.pluralRules:N},get isGlobal(){return s.value?s.value.isGlobal:!1},get missingWarn(){return s.value?s.value.missingWarn:m},set missingWarn(c){s.value&&(s.value.missingWarn=c)},get fallbackWarn(){return s.value?s.value.fallbackWarn:_},set fallbackWarn(c){s.value&&(s.value.missingWarn=c)},get fallbackRoot(){return s.value?s.value.fallbackRoot:v},set fallbackRoot(c){s.value&&(s.value.fallbackRoot=c)},get fallbackFormat(){return s.value?s.value.fallbackFormat:x},set fallbackFormat(c){s.value&&(s.value.fallbackFormat=c)},get warnHtmlMessage(){return s.value?s.value.warnHtmlMessage:E},set warnHtmlMessage(c){s.value&&(s.value.warnHtmlMessage=c)},get escapeParameter(){return s.value?s.value.escapeParameter:T},set escapeParameter(c){s.value&&(s.value.escapeParameter=c)},t:z,getPostTranslationHandler:ue,setPostTranslationHandler:de,getMissingHandler:De,setMissingHandler:$e,rt:ne,d:Re,n:ke,tm:Ne,te:we,getLocaleMessage:Je,setLocaleMessage:qe,mergeLocaleMessage:st,getDateTimeFormat:xe,setDateTimeFormat:S,mergeDateTimeFormat:j,getNumberFormat:$,setNumberFormat:K,mergeNumberFormat:Z};function u(c){c.locale.value=i.value,c.fallbackLocale.value=a.value,Object.keys(f.value).forEach(p=>{c.mergeLocaleMessage(p,f.value[p])}),Object.keys(d.value).forEach(p=>{c.mergeDateTimeFormat(p,d.value[p])}),Object.keys(h.value).forEach(p=>{c.mergeNumberFormat(p,h.value[p])}),c.escapeParameter=T,c.fallbackFormat=x,c.fallbackRoot=v,c.fallbackWarn=_,c.missingWarn=m,c.warnHtmlMessage=E}return Qi(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Oe(Te.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const c=s.value=e.proxy.$i18n.__composer;t==="global"?(i.value=c.locale.value,a.value=c.fallbackLocale.value,f.value=c.messages.value,d.value=c.datetimeFormats.value,h.value=c.numberFormats.value):o&&u(c)}),ie}const Ih=["locale","fallbackLocale","availableLocales"],Ml=["t","rt","d","n","tm","te"];function Lh(e,t){const n=Object.create(null);return Ih.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s)throw Oe(Te.UNEXPECTED_ERROR);const l=We(s.value)?{get(){return s.value.value},set(i){s.value.value=i}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,o,l)}),e.config.globalProperties.$i18n=n,Ml.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s||!s.value)throw Oe(Te.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,s)}),()=>{delete e.config.globalProperties.$i18n,Ml.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}nh();__INTLIFY_JIT_COMPILATION__?ml(Jd):ml(Xd);Wd(kd);Vd(va);if(__INTLIFY_PROD_DEVTOOLS__){const e=_t();e.__INTLIFY__=!0,Pd(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}/*! + */const th="9.9.0";function nh(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(bt().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(bt().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(bt().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(bt().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(bt().__INTLIFY_PROD_DEVTOOLS__=!1)}const Na=Fd.__EXTEND_POINT__,Lt=so(Na);Lt(),Lt(),Lt(),Lt(),Lt(),Lt(),Lt(),Lt();const Pa=nt.__EXTEND_POINT__,Ke=so(Pa),Te={UNEXPECTED_RETURN_TYPE:Pa,INVALID_ARGUMENT:Ke(),MUST_BE_CALL_SETUP_TOP:Ke(),NOT_INSTALLED:Ke(),NOT_AVAILABLE_IN_LEGACY_MODE:Ke(),REQUIRED_VALUE:Ke(),INVALID_VALUE:Ke(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Ke(),NOT_INSTALLED_WITH_PROVIDE:Ke(),UNEXPECTED_ERROR:Ke(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Ke(),BRIDGE_SUPPORT_VUE_2_ONLY:Ke(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Ke(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Ke(),__EXTEND_POINT__:Ke()};function Oe(e,...t){return vn(e,null,void 0)}const xs=Ut("__translateVNode"),ks=Ut("__datetimeParts"),ws=Ut("__numberParts"),Aa=Ut("__setPluralRules"),Ra=Ut("__injectWithOption"),Is=Ut("__dispose");function Un(e){if(!ae(e))return e;for(const t in e)if(vr(e,t))if(!t.includes("."))ae(e[t])&&Un(e[t]);else{const n=t.split("."),r=n.length-1;let o=e,s=!1;for(let l=0;l{if("locale"in i&&"resource"in i){const{locale:a,resource:f}=i;a?(l[a]=l[a]||{},ar(f,l[a])):ar(f,l)}else H(i)&&ar(JSON.parse(i),l)}),o==null&&s)for(const i in l)vr(l,i)&&Un(l[i]);return l}function Ma(e){return e.type}function Fa(e,t,n){let r=ae(t.messages)?t.messages:{};"__i18nGlobal"in n&&(r=Fr(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(s=>{e.mergeLocaleMessage(s,r[s])});{if(ae(t.datetimeFormats)){const s=Object.keys(t.datetimeFormats);s.length&&s.forEach(l=>{e.mergeDateTimeFormat(l,t.datetimeFormats[l])})}if(ae(t.numberFormats)){const s=Object.keys(t.numberFormats);s.length&&s.forEach(l=>{e.mergeNumberFormat(l,t.numberFormats[l])})}}}function wl(e){return he(Kn,null,e,0)}const Il="__INTLIFY_META__",Ll=()=>[],rh=()=>!1;let Tl=0;function Sl(e){return(t,n,r,o)=>e(n,r,Fn()||void 0,o)}const sh=()=>{const e=Fn();let t=null;return e&&(t=Ma(e)[Il])?{[Il]:t}:null};function ao(e={},t){const{__root:n,__injectWithOption:r}=e,o=n===void 0,s=e.flatJson,l=br?ue:Xs;let i=ee(e.inheritLocale)?e.inheritLocale:!0;const a=l(n&&i?n.locale.value:H(e.locale)?e.locale:pn),f=l(n&&i?n.fallbackLocale.value:H(e.fallbackLocale)||_e(e.fallbackLocale)||X(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:a.value),d=l(Fr(a.value,e)),h=l(X(e.datetimeFormats)?e.datetimeFormats:{[a.value]:{}}),m=l(X(e.numberFormats)?e.numberFormats:{[a.value]:{}});let _=n?n.missingWarn:ee(e.missingWarn)||$t(e.missingWarn)?e.missingWarn:!0,w=n?n.fallbackWarn:ee(e.fallbackWarn)||$t(e.fallbackWarn)?e.fallbackWarn:!0,v=n?n.fallbackRoot:ee(e.fallbackRoot)?e.fallbackRoot:!0,y=!!e.fallbackFormat,g=me(e.missing)?e.missing:null,x=me(e.missing)?Sl(e.missing):null,L=me(e.postTranslation)?e.postTranslation:null,I=n?n.warnHtmlMessage:ee(e.warnHtmlMessage)?e.warnHtmlMessage:!0,N=!!e.escapeParameter;const T=n?n.modifiers:X(e.modifiers)?e.modifiers:{};let F=e.pluralRules||n&&n.pluralRules,M;M=(()=>{o&&pl(null);const E={version:th,locale:a.value,fallbackLocale:f.value,messages:d.value,modifiers:T,pluralRules:F,missing:x===null?void 0:x,missingWarn:_,fallbackWarn:w,fallbackFormat:y,unresolving:!0,postTranslation:L===null?void 0:L,warnHtmlMessage:I,escapeParameter:N,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};E.datetimeFormats=h.value,E.numberFormats=m.value,E.__datetimeFormatters=X(M)?M.__datetimeFormatters:void 0,E.__numberFormatters=X(M)?M.__numberFormatters:void 0;const S=Yd(E);return o&&pl(S),S})(),xn(M,a.value,f.value);function te(){return[a.value,f.value,d.value,h.value,m.value]}const be=Ee({get:()=>a.value,set:E=>{a.value=E,M.locale=a.value}}),fe=Ee({get:()=>f.value,set:E=>{f.value=E,M.fallbackLocale=f.value,xn(M,a.value,E)}}),de=Ee(()=>d.value),$e=Ee(()=>h.value),Ue=Ee(()=>m.value);function se(){return me(L)?L:null}function z(E){L=E,M.postTranslation=E}function ne(){return g}function Re(E){E!==null&&(x=Sl(E)),g=E,M.missing=x}const ke=(E,S,B,G,oe,ve)=>{te();let Ce;try{__INTLIFY_PROD_DEVTOOLS__,o||(M.fallbackContext=n?Gd():void 0),Ce=E(M)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(M.fallbackContext=void 0)}if(B!=="translate exists"&&Le(Ce)&&Ce===Mr||B==="translate exists"&&!Ce){const[kt,Hr]=S();return n&&v?G(n):oe(kt)}else{if(ve(Ce))return Ce;throw Oe(Te.UNEXPECTED_RETURN_TYPE)}};function Ne(...E){return ke(S=>Reflect.apply(vl,null,[S,...E]),()=>vs(...E),"translate",S=>Reflect.apply(S.t,S,[...E]),S=>S,S=>H(S))}function we(...E){const[S,B,G]=E;if(G&&!ae(G))throw Oe(Te.INVALID_ARGUMENT);return Ne(S,B,Pe({resolvedMessage:!0},G||{}))}function Je(...E){return ke(S=>Reflect.apply(yl,null,[S,...E]),()=>ys(...E),"datetime format",S=>Reflect.apply(S.d,S,[...E]),()=>dl,S=>H(S))}function qe(...E){return ke(S=>Reflect.apply(xl,null,[S,...E]),()=>Es(...E),"number format",S=>Reflect.apply(S.n,S,[...E]),()=>dl,S=>H(S))}function ot(E){return E.map(S=>H(S)||Le(S)||ee(S)?wl(String(S)):S)}const C={normalize:ot,interpolate:E=>E,type:"vnode"};function j(...E){return ke(S=>{let B;const G=S;try{G.processor=C,B=Reflect.apply(vl,null,[G,...E])}finally{G.processor=null}return B},()=>vs(...E),"translate",S=>S[xs](...E),S=>[wl(S)],S=>_e(S))}function $(...E){return ke(S=>Reflect.apply(xl,null,[S,...E]),()=>Es(...E),"number format",S=>S[ws](...E),Ll,S=>H(S)||_e(S))}function K(...E){return ke(S=>Reflect.apply(yl,null,[S,...E]),()=>ys(...E),"datetime format",S=>S[ks](...E),Ll,S=>H(S)||_e(S))}function Z(E){F=E,M.pluralRules=F}function ie(E,S){return ke(()=>{if(!E)return!1;const B=H(S)?S:a.value,G=p(B),oe=M.messageResolver(G,E);return gn(oe)||Qe(oe)||H(oe)},()=>[E],"translate exists",B=>Reflect.apply(B.te,B,[E,S]),rh,B=>ee(B))}function u(E){let S=null;const B=va(M,f.value,a.value);for(let G=0;G{i&&(a.value=E,M.locale=E,xn(M,a.value,f.value))}),Mt(n.fallbackLocale,E=>{i&&(f.value=E,M.fallbackLocale=E,xn(M,a.value,f.value))}));const W={id:Tl,locale:be,fallbackLocale:fe,get inheritLocale(){return i},set inheritLocale(E){i=E,E&&n&&(a.value=n.locale.value,f.value=n.fallbackLocale.value,xn(M,a.value,f.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:de,get modifiers(){return T},get pluralRules(){return F||{}},get isGlobal(){return o},get missingWarn(){return _},set missingWarn(E){_=E,M.missingWarn=_},get fallbackWarn(){return w},set fallbackWarn(E){w=E,M.fallbackWarn=w},get fallbackRoot(){return v},set fallbackRoot(E){v=E},get fallbackFormat(){return y},set fallbackFormat(E){y=E,M.fallbackFormat=y},get warnHtmlMessage(){return I},set warnHtmlMessage(E){I=E,M.warnHtmlMessage=E},get escapeParameter(){return N},set escapeParameter(E){N=E,M.escapeParameter=E},t:Ne,getLocaleMessage:p,setLocaleMessage:b,mergeLocaleMessage:k,getPostTranslationHandler:se,setPostTranslationHandler:z,getMissingHandler:ne,setMissingHandler:Re,[Aa]:Z};return W.datetimeFormats=$e,W.numberFormats=Ue,W.rt=we,W.te=ie,W.tm=c,W.d=Je,W.n=qe,W.getDateTimeFormat=O,W.setDateTimeFormat=D,W.mergeDateTimeFormat=R,W.getNumberFormat=U,W.setNumberFormat=P,W.mergeNumberFormat=V,W[Ra]=r,W[xs]=j,W[ks]=K,W[ws]=$,W}function oh(e){const t=H(e.locale)?e.locale:pn,n=H(e.fallbackLocale)||_e(e.fallbackLocale)||X(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,r=me(e.missing)?e.missing:void 0,o=ee(e.silentTranslationWarn)||$t(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,s=ee(e.silentFallbackWarn)||$t(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,l=ee(e.fallbackRoot)?e.fallbackRoot:!0,i=!!e.formatFallbackMessages,a=X(e.modifiers)?e.modifiers:{},f=e.pluralizationRules,d=me(e.postTranslation)?e.postTranslation:void 0,h=H(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,m=!!e.escapeParameterHtml,_=ee(e.sync)?e.sync:!0;let w=e.messages;if(X(e.sharedMessages)){const N=e.sharedMessages;w=Object.keys(N).reduce((F,M)=>{const Q=F[M]||(F[M]={});return Pe(Q,N[M]),F},w||{})}const{__i18n:v,__root:y,__injectWithOption:g}=e,x=e.datetimeFormats,L=e.numberFormats,I=e.flatJson;return{locale:t,fallbackLocale:n,messages:w,flatJson:I,datetimeFormats:x,numberFormats:L,missing:r,missingWarn:o,fallbackWarn:s,fallbackRoot:l,fallbackFormat:i,modifiers:a,pluralRules:f,postTranslation:d,warnHtmlMessage:h,escapeParameter:m,messageResolver:e.messageResolver,inheritLocale:_,__i18n:v,__root:y,__injectWithOption:g}}function Ls(e={},t){{const n=ao(oh(e)),{__extender:r}=e,o={id:n.id,get locale(){return n.locale.value},set locale(s){n.locale.value=s},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(s){n.fallbackLocale.value=s},get messages(){return n.messages.value},get datetimeFormats(){return n.datetimeFormats.value},get numberFormats(){return n.numberFormats.value},get availableLocales(){return n.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(s){},get missing(){return n.getMissingHandler()},set missing(s){n.setMissingHandler(s)},get silentTranslationWarn(){return ee(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(s){n.missingWarn=ee(s)?!s:s},get silentFallbackWarn(){return ee(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(s){n.fallbackWarn=ee(s)?!s:s},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(s){n.fallbackFormat=s},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(s){n.setPostTranslationHandler(s)},get sync(){return n.inheritLocale},set sync(s){n.inheritLocale=s},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){n.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(s){n.escapeParameter=s},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(s){},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...s){const[l,i,a]=s,f={};let d=null,h=null;if(!H(l))throw Oe(Te.INVALID_ARGUMENT);const m=l;return H(i)?f.locale=i:_e(i)?d=i:X(i)&&(h=i),_e(a)?d=a:X(a)&&(h=a),Reflect.apply(n.t,n,[m,d||h||{},f])},rt(...s){return Reflect.apply(n.rt,n,[...s])},tc(...s){const[l,i,a]=s,f={plural:1};let d=null,h=null;if(!H(l))throw Oe(Te.INVALID_ARGUMENT);const m=l;return H(i)?f.locale=i:Le(i)?f.plural=i:_e(i)?d=i:X(i)&&(h=i),H(a)?f.locale=a:_e(a)?d=a:X(a)&&(h=a),Reflect.apply(n.t,n,[m,d||h||{},f])},te(s,l){return n.te(s,l)},tm(s){return n.tm(s)},getLocaleMessage(s){return n.getLocaleMessage(s)},setLocaleMessage(s,l){n.setLocaleMessage(s,l)},mergeLocaleMessage(s,l){n.mergeLocaleMessage(s,l)},d(...s){return Reflect.apply(n.d,n,[...s])},getDateTimeFormat(s){return n.getDateTimeFormat(s)},setDateTimeFormat(s,l){n.setDateTimeFormat(s,l)},mergeDateTimeFormat(s,l){n.mergeDateTimeFormat(s,l)},n(...s){return Reflect.apply(n.n,n,[...s])},getNumberFormat(s){return n.getNumberFormat(s)},setNumberFormat(s,l){n.setNumberFormat(s,l)},mergeNumberFormat(s,l){n.mergeNumberFormat(s,l)},getChoiceIndex(s,l){return-1}};return o.__extender=r,o}}const co={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function lh({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((r,o)=>[...r,...o.type===We?o.children:[o]],[]):t.reduce((n,r)=>{const o=e[r];return o&&(n[r]=o()),n},{})}function Da(e){return We}const ih=mt({name:"i18n-t",props:Pe({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Le(e)||!isNaN(e)}},co),setup(e,t){const{slots:n,attrs:r}=t,o=e.i18n||uo({useScope:e.scope,__useComponent:!0});return()=>{const s=Object.keys(n).filter(h=>h!=="_"),l={};e.locale&&(l.locale=e.locale),e.plural!==void 0&&(l.plural=H(e.plural)?+e.plural:e.plural);const i=lh(t,s),a=o[xs](e.keypath,i,l),f=Pe({},r),d=H(e.tag)||ae(e.tag)?e.tag:Da();return dn(d,f,a)}}}),Cl=ih;function ah(e){return _e(e)&&!H(e[0])}function $a(e,t,n,r){const{slots:o,attrs:s}=t;return()=>{const l={part:!0};let i={};e.locale&&(l.locale=e.locale),H(e.format)?l.key=e.format:ae(e.format)&&(H(e.format.key)&&(l.key=e.format.key),i=Object.keys(e.format).reduce((m,_)=>n.includes(_)?Pe({},m,{[_]:e.format[_]}):m,{}));const a=r(e.value,l,i);let f=[l.key];_e(a)?f=a.map((m,_)=>{const w=o[m.type],v=w?w({[m.type]:m.value,index:_,parts:a}):[m.value];return ah(v)&&(v[0].key=`${m.type}-${_}`),v}):H(a)&&(f=[a]);const d=Pe({},s),h=H(e.tag)||ae(e.tag)?e.tag:Da();return dn(h,d,f)}}const ch=mt({name:"i18n-n",props:Pe({value:{type:Number,required:!0},format:{type:[String,Object]}},co),setup(e,t){const n=e.i18n||uo({useScope:"parent",__useComponent:!0});return $a(e,t,Oa,(...r)=>n[ws](...r))}}),Ol=ch,uh=mt({name:"i18n-d",props:Pe({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},co),setup(e,t){const n=e.i18n||uo({useScope:"parent",__useComponent:!0});return $a(e,t,Ca,(...r)=>n[ks](...r))}}),Nl=uh;function fh(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const r=n.__getInstance(t);return r!=null?r.__composer:e.global.__composer}}function dh(e){const t=l=>{const{instance:i,modifiers:a,value:f}=l;if(!i||!i.$)throw Oe(Te.UNEXPECTED_ERROR);const d=fh(e,i.$),h=Pl(f);return[Reflect.apply(d.t,d,[...Al(h)]),d]};return{created:(l,i)=>{const[a,f]=t(i);br&&e.global===f&&(l.__i18nWatcher=Mt(f.locale,()=>{i.instance&&i.instance.$forceUpdate()})),l.__composer=f,l.textContent=a},unmounted:l=>{br&&l.__i18nWatcher&&(l.__i18nWatcher(),l.__i18nWatcher=void 0,delete l.__i18nWatcher),l.__composer&&(l.__composer=void 0,delete l.__composer)},beforeUpdate:(l,{value:i})=>{if(l.__composer){const a=l.__composer,f=Pl(i);l.textContent=Reflect.apply(a.t,a,[...Al(f)])}},getSSRProps:l=>{const[i]=t(l);return{textContent:i}}}}function Pl(e){if(H(e))return{path:e};if(X(e)){if(!("path"in e))throw Oe(Te.REQUIRED_VALUE,"path");return e}else throw Oe(Te.INVALID_VALUE)}function Al(e){const{path:t,locale:n,args:r,choice:o,plural:s}=e,l={},i=r||{};return H(n)&&(l.locale=n),Le(o)&&(l.plural=o),Le(s)&&(l.plural=s),[t,i,l]}function hh(e,t,...n){const r=X(n[0])?n[0]:{},o=!!r.useI18nComponentName;(ee(r.globalInstall)?r.globalInstall:!0)&&([o?"i18n":Cl.name,"I18nT"].forEach(l=>e.component(l,Cl)),[Ol.name,"I18nN"].forEach(l=>e.component(l,Ol)),[Nl.name,"I18nD"].forEach(l=>e.component(l,Nl))),e.directive("t",dh(t))}function mh(e,t,n){return{beforeCreate(){const r=Fn();if(!r)throw Oe(Te.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const s=o.i18n;if(o.__i18n&&(s.__i18n=o.__i18n),s.__root=t,this===this.$root)this.$i18n=Rl(e,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=Ls(s);const l=this.$i18n;l.__extender&&(l.__disposer=l.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Rl(e,o);else{this.$i18n=Ls({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&Fa(t,o,o),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,l)=>this.$i18n.te(s,l),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=Fn();if(!r)throw Oe(Te.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(r),delete this.$i18n}}}function Rl(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[Aa](t.pluralizationRules||e.pluralizationRules);const n=Fr(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(r=>e.mergeLocaleMessage(r,n[r])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(r=>e.mergeDateTimeFormat(r,t.datetimeFormats[r])),t.numberFormats&&Object.keys(t.numberFormats).forEach(r=>e.mergeNumberFormat(r,t.numberFormats[r])),e}const ph=Ut("global-vue-i18n");function gh(e={},t){const n=__VUE_I18N_LEGACY_API__&&ee(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,r=ee(e.globalInjection)?e.globalInjection:!0,o=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,s=new Map,[l,i]=_h(e,n),a=Ut("");function f(m){return s.get(m)||null}function d(m,_){s.set(m,_)}function h(m){s.delete(m)}{const m={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return o},async install(_,...w){if(_.__VUE_I18N_SYMBOL__=a,_.provide(_.__VUE_I18N_SYMBOL__,m),X(w[0])){const g=w[0];m.__composerExtend=g.__composerExtend,m.__vueI18nExtend=g.__vueI18nExtend}let v=null;!n&&r&&(v=Lh(_,m.global)),__VUE_I18N_FULL_INSTALL__&&hh(_,m,...w),__VUE_I18N_LEGACY_API__&&n&&_.mixin(mh(i,i.__composer,m));const y=_.unmount;_.unmount=()=>{v&&v(),m.dispose(),y()}},get global(){return i},dispose(){l.stop()},__instances:s,__getInstance:f,__setInstance:d,__deleteInstance:h};return m}}function uo(e={}){const t=Fn();if(t==null)throw Oe(Te.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Oe(Te.NOT_INSTALLED);const n=bh(t),r=yh(n),o=Ma(t),s=vh(e,o);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Oe(Te.NOT_AVAILABLE_IN_LEGACY_MODE);return wh(t,s,r,e)}if(s==="global")return Fa(r,e,o),r;if(s==="parent"){let a=Eh(n,t,e.__useComponent);return a==null&&(a=r),a}const l=n;let i=l.__getInstance(t);if(i==null){const a=Pe({},e);"__i18n"in o&&(a.__i18n=o.__i18n),r&&(a.__root=r),i=ao(a),l.__composerExtend&&(i[Is]=l.__composerExtend(i)),kh(l,t,i),l.__setInstance(t,i)}return i}function _h(e,t,n){const r=Ic();{const o=__VUE_I18N_LEGACY_API__&&t?r.run(()=>Ls(e)):r.run(()=>ao(e));if(o==null)throw Oe(Te.UNEXPECTED_ERROR);return[r,o]}}function bh(e){{const t=ht(e.isCE?ph:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Oe(e.isCE?Te.NOT_INSTALLED_WITH_PROVIDE:Te.UNEXPECTED_ERROR);return t}}function vh(e,t){return Rr(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function yh(e){return e.mode==="composition"?e.global:e.global.__composer}function Eh(e,t,n=!1){let r=null;const o=t.root;let s=xh(t,n);for(;s!=null;){const l=e;if(e.mode==="composition")r=l.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const i=l.__getInstance(s);i!=null&&(r=i.__composer,n&&r&&!r[Ra]&&(r=null))}if(r!=null||o===s)break;s=s.parent}return r}function xh(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function kh(e,t,n){Or(()=>{},t),Zs(()=>{const r=n;e.__deleteInstance(t);const o=r[Is];o&&(o(),delete r[Is])},t)}function wh(e,t,n,r={}){const o=t==="local",s=Xs(null);if(o&&e.proxy&&!(e.proxy.$options.i18n||e.proxy.$options.__i18n))throw Oe(Te.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const l=ee(r.inheritLocale)?r.inheritLocale:!H(r.locale),i=ue(!o||l?n.locale.value:H(r.locale)?r.locale:pn),a=ue(!o||l?n.fallbackLocale.value:H(r.fallbackLocale)||_e(r.fallbackLocale)||X(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:i.value),f=ue(Fr(i.value,r)),d=ue(X(r.datetimeFormats)?r.datetimeFormats:{[i.value]:{}}),h=ue(X(r.numberFormats)?r.numberFormats:{[i.value]:{}}),m=o?n.missingWarn:ee(r.missingWarn)||$t(r.missingWarn)?r.missingWarn:!0,_=o?n.fallbackWarn:ee(r.fallbackWarn)||$t(r.fallbackWarn)?r.fallbackWarn:!0,w=o?n.fallbackRoot:ee(r.fallbackRoot)?r.fallbackRoot:!0,v=!!r.fallbackFormat,y=me(r.missing)?r.missing:null,g=me(r.postTranslation)?r.postTranslation:null,x=o?n.warnHtmlMessage:ee(r.warnHtmlMessage)?r.warnHtmlMessage:!0,L=!!r.escapeParameter,I=o?n.modifiers:X(r.modifiers)?r.modifiers:{},N=r.pluralRules||o&&n.pluralRules;function T(){return[i.value,a.value,f.value,d.value,h.value]}const F=Ee({get:()=>s.value?s.value.locale.value:i.value,set:c=>{s.value&&(s.value.locale.value=c),i.value=c}}),M=Ee({get:()=>s.value?s.value.fallbackLocale.value:a.value,set:c=>{s.value&&(s.value.fallbackLocale.value=c),a.value=c}}),Q=Ee(()=>s.value?s.value.messages.value:f.value),te=Ee(()=>d.value),be=Ee(()=>h.value);function fe(){return s.value?s.value.getPostTranslationHandler():g}function de(c){s.value&&s.value.setPostTranslationHandler(c)}function $e(){return s.value?s.value.getMissingHandler():y}function Ue(c){s.value&&s.value.setMissingHandler(c)}function se(c){return T(),c()}function z(...c){return s.value?se(()=>Reflect.apply(s.value.t,null,[...c])):se(()=>"")}function ne(...c){return s.value?Reflect.apply(s.value.rt,null,[...c]):""}function Re(...c){return s.value?se(()=>Reflect.apply(s.value.d,null,[...c])):se(()=>"")}function ke(...c){return s.value?se(()=>Reflect.apply(s.value.n,null,[...c])):se(()=>"")}function Ne(c){return s.value?s.value.tm(c):{}}function we(c,p){return s.value?s.value.te(c,p):!1}function Je(c){return s.value?s.value.getLocaleMessage(c):{}}function qe(c,p){s.value&&(s.value.setLocaleMessage(c,p),f.value[c]=p)}function ot(c,p){s.value&&s.value.mergeLocaleMessage(c,p)}function xe(c){return s.value?s.value.getDateTimeFormat(c):{}}function C(c,p){s.value&&(s.value.setDateTimeFormat(c,p),d.value[c]=p)}function j(c,p){s.value&&s.value.mergeDateTimeFormat(c,p)}function $(c){return s.value?s.value.getNumberFormat(c):{}}function K(c,p){s.value&&(s.value.setNumberFormat(c,p),h.value[c]=p)}function Z(c,p){s.value&&s.value.mergeNumberFormat(c,p)}const ie={get id(){return s.value?s.value.id:-1},locale:F,fallbackLocale:M,messages:Q,datetimeFormats:te,numberFormats:be,get inheritLocale(){return s.value?s.value.inheritLocale:l},set inheritLocale(c){s.value&&(s.value.inheritLocale=c)},get availableLocales(){return s.value?s.value.availableLocales:Object.keys(f.value)},get modifiers(){return s.value?s.value.modifiers:I},get pluralRules(){return s.value?s.value.pluralRules:N},get isGlobal(){return s.value?s.value.isGlobal:!1},get missingWarn(){return s.value?s.value.missingWarn:m},set missingWarn(c){s.value&&(s.value.missingWarn=c)},get fallbackWarn(){return s.value?s.value.fallbackWarn:_},set fallbackWarn(c){s.value&&(s.value.missingWarn=c)},get fallbackRoot(){return s.value?s.value.fallbackRoot:w},set fallbackRoot(c){s.value&&(s.value.fallbackRoot=c)},get fallbackFormat(){return s.value?s.value.fallbackFormat:v},set fallbackFormat(c){s.value&&(s.value.fallbackFormat=c)},get warnHtmlMessage(){return s.value?s.value.warnHtmlMessage:x},set warnHtmlMessage(c){s.value&&(s.value.warnHtmlMessage=c)},get escapeParameter(){return s.value?s.value.escapeParameter:L},set escapeParameter(c){s.value&&(s.value.escapeParameter=c)},t:z,getPostTranslationHandler:fe,setPostTranslationHandler:de,getMissingHandler:$e,setMissingHandler:Ue,rt:ne,d:Re,n:ke,tm:Ne,te:we,getLocaleMessage:Je,setLocaleMessage:qe,mergeLocaleMessage:ot,getDateTimeFormat:xe,setDateTimeFormat:C,mergeDateTimeFormat:j,getNumberFormat:$,setNumberFormat:K,mergeNumberFormat:Z};function u(c){c.locale.value=i.value,c.fallbackLocale.value=a.value,Object.keys(f.value).forEach(p=>{c.mergeLocaleMessage(p,f.value[p])}),Object.keys(d.value).forEach(p=>{c.mergeDateTimeFormat(p,d.value[p])}),Object.keys(h.value).forEach(p=>{c.mergeNumberFormat(p,h.value[p])}),c.escapeParameter=L,c.fallbackFormat=v,c.fallbackRoot=w,c.fallbackWarn=_,c.missingWarn=m,c.warnHtmlMessage=x}return Qi(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Oe(Te.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const c=s.value=e.proxy.$i18n.__composer;t==="global"?(i.value=c.locale.value,a.value=c.fallbackLocale.value,f.value=c.messages.value,d.value=c.datetimeFormats.value,h.value=c.numberFormats.value):o&&u(c)}),ie}const Ih=["locale","fallbackLocale","availableLocales"],Ml=["t","rt","d","n","tm","te"];function Lh(e,t){const n=Object.create(null);return Ih.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s)throw Oe(Te.UNEXPECTED_ERROR);const l=Ve(s.value)?{get(){return s.value.value},set(i){s.value.value=i}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,o,l)}),e.config.globalProperties.$i18n=n,Ml.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s||!s.value)throw Oe(Te.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,s)}),()=>{delete e.config.globalProperties.$i18n,Ml.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}nh();__INTLIFY_JIT_COMPILATION__?ml(Jd):ml(Xd);Wd(kd);Vd(va);if(__INTLIFY_PROD_DEVTOOLS__){const e=bt();e.__INTLIFY__=!0,Pd(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}/*! * vue-router v4.2.5 * (c) 2023 Eduardo San Martin Morote * @license MIT - */const tn=typeof window<"u";function Th(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const ce=Object.assign;function zr(e,t){const n={};for(const r in t){const o=t[r];n[r]=rt(o)?o.map(e):e(o)}return n}const Cn=()=>{},rt=Array.isArray,Ch=/\/$/,Sh=e=>e.replace(Ch,"");function Zr(e,t,n="/"){let r,o={},s="",l="";const i=t.indexOf("#");let a=t.indexOf("?");return i=0&&(a=-1),a>-1&&(r=t.slice(0,a),s=t.slice(a+1,i>-1?i:t.length),o=e(s)),i>-1&&(r=r||t.slice(0,i),l=t.slice(i,t.length)),r=Ah(r??t,n),{fullPath:r+(s&&"?")+s+l,path:r,query:o,hash:l}}function Oh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Fl(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Nh(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&_n(t.matched[r],n.matched[o])&&Ua(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function _n(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ua(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Ph(e[n],t[n]))return!1;return!0}function Ph(e,t){return rt(e)?Dl(e,t):rt(t)?Dl(t,e):e===t}function Dl(e,t){return rt(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Ah(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,l,i;for(l=0;l1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(l-(l===r.length?1:0)).join("/")}var jn;(function(e){e.pop="pop",e.push="push"})(jn||(jn={}));var Sn;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Sn||(Sn={}));function Rh(e){if(!e)if(tn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Sh(e)}const Mh=/^[^#]+#/;function Fh(e,t){return e.replace(Mh,"#")+t}function Dh(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Dr=()=>({left:window.pageXOffset,top:window.pageYOffset});function $h(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Dh(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function $l(e,t){return(history.state?history.state.position-t:-1)+e}const Ts=new Map;function Uh(e,t){Ts.set(e,t)}function jh(e){const t=Ts.get(e);return Ts.delete(e),t}let Hh=()=>location.protocol+"//"+location.host;function ja(e,t){const{pathname:n,search:r,hash:o}=t,s=e.indexOf("#");if(s>-1){let i=o.includes(e.slice(s))?e.slice(s).length:1,a=o.slice(i);return a[0]!=="/"&&(a="/"+a),Fl(a,"")}return Fl(n,e)+r+o}function Wh(e,t,n,r){let o=[],s=[],l=null;const i=({state:m})=>{const _=ja(e,location),v=n.value,x=t.value;let w=0;if(m){if(n.value=_,t.value=m,l&&l===v){l=null;return}w=x?m.position-x.position:0}else r(_);o.forEach(g=>{g(n.value,v,{delta:w,type:jn.pop,direction:w?w>0?Sn.forward:Sn.back:Sn.unknown})})};function a(){l=n.value}function f(m){o.push(m);const _=()=>{const v=o.indexOf(m);v>-1&&o.splice(v,1)};return s.push(_),_}function d(){const{history:m}=window;m.state&&m.replaceState(ce({},m.state,{scroll:Dr()}),"")}function h(){for(const m of s)m();s=[],window.removeEventListener("popstate",i),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",i),window.addEventListener("beforeunload",d,{passive:!0}),{pauseListeners:a,listen:f,destroy:h}}function Ul(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?Dr():null}}function Vh(e){const{history:t,location:n}=window,r={value:ja(e,n)},o={value:t.state};o.value||s(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(a,f,d){const h=e.indexOf("#"),m=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+a:Hh()+e+a;try{t[d?"replaceState":"pushState"](f,"",m),o.value=f}catch(_){console.error(_),n[d?"replace":"assign"](m)}}function l(a,f){const d=ce({},t.state,Ul(o.value.back,a,o.value.forward,!0),f,{position:o.value.position});s(a,d,!0),r.value=a}function i(a,f){const d=ce({},o.value,t.state,{forward:a,scroll:Dr()});s(d.current,d,!0);const h=ce({},Ul(r.value,a,null),{position:d.position+1},f);s(a,h,!1),r.value=a}return{location:r,state:o,push:i,replace:l}}function Kh(e){e=Rh(e);const t=Vh(e),n=Wh(e,t.state,t.location,t.replace);function r(s,l=!0){l||n.pauseListeners(),history.go(s)}const o=ce({location:"",base:e,go:r,createHref:Fh.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function Bh(e){return typeof e=="string"||e&&typeof e=="object"}function Ha(e){return typeof e=="string"||typeof e=="symbol"}const It={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Wa=Symbol("");var jl;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(jl||(jl={}));function bn(e,t){return ce(new Error,{type:e,[Wa]:!0},t)}function pt(e,t){return e instanceof Error&&Wa in e&&(t==null||!!(e.type&t))}const Hl="[^/]+?",Gh={sensitive:!1,strict:!1,start:!0,end:!0},Yh=/[.+*?^${}()[\]/\\]/g;function qh(e,t){const n=ce({},Gh,t),r=[];let o=n.start?"^":"";const s=[];for(const f of e){const d=f.length?[]:[90];n.strict&&!f.length&&(o+="/");for(let h=0;ht.length?t.length===1&&t[0]===80?1:-1:0}function Jh(e,t){let n=0;const r=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const Qh={type:0,value:""},zh=/[a-zA-Z0-9_]/;function Zh(e){if(!e)return[[]];if(e==="/")return[[Qh]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${f}": ${_}`)}let n=0,r=n;const o=[];let s;function l(){s&&o.push(s),s=[]}let i=0,a,f="",d="";function h(){f&&(n===0?s.push({type:0,value:f}):n===1||n===2||n===3?(s.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:f,regexp:d,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),f="")}function m(){f+=a}for(;i{l(E)}:Cn}function l(d){if(Ha(d)){const h=r.get(d);h&&(r.delete(d),n.splice(n.indexOf(h),1),h.children.forEach(l),h.alias.forEach(l))}else{const h=n.indexOf(d);h>-1&&(n.splice(h,1),d.record.name&&r.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function i(){return n}function a(d){let h=0;for(;h=0&&(d.record.path!==n[h].record.path||!Va(d,n[h]));)h++;n.splice(h,0,d),d.record.name&&!Kl(d)&&r.set(d.record.name,d)}function f(d,h){let m,_={},v,x;if("name"in d&&d.name){if(m=r.get(d.name),!m)throw bn(1,{location:d});x=m.record.name,_=ce(Vl(h.params,m.keys.filter(E=>!E.optional).map(E=>E.name)),d.params&&Vl(d.params,m.keys.map(E=>E.name))),v=m.stringify(_)}else if("path"in d)v=d.path,m=n.find(E=>E.re.test(v)),m&&(_=m.parse(v),x=m.record.name);else{if(m=h.name?r.get(h.name):n.find(E=>E.re.test(h.path)),!m)throw bn(1,{location:d,currentLocation:h});x=m.record.name,_=ce({},h.params,d.params),v=m.stringify(_)}const w=[];let g=m;for(;g;)w.unshift(g.record),g=g.parent;return{name:x,path:v,params:_,matched:w,meta:sm(w)}}return e.forEach(d=>s(d)),{addRoute:s,resolve:f,removeRoute:l,getRoutes:i,getRecordMatcher:o}}function Vl(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function nm(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:rm(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function rm(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Kl(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function sm(e){return e.reduce((t,n)=>ce(t,n.meta),{})}function Bl(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function Va(e,t){return t.children.some(n=>n===e||Va(e,n))}const Ka=/#/g,om=/&/g,lm=/\//g,im=/=/g,am=/\?/g,Ba=/\+/g,cm=/%5B/g,um=/%5D/g,Ga=/%5E/g,fm=/%60/g,Ya=/%7B/g,dm=/%7C/g,qa=/%7D/g,hm=/%20/g;function fo(e){return encodeURI(""+e).replace(dm,"|").replace(cm,"[").replace(um,"]")}function mm(e){return fo(e).replace(Ya,"{").replace(qa,"}").replace(Ga,"^")}function Cs(e){return fo(e).replace(Ba,"%2B").replace(hm,"+").replace(Ka,"%23").replace(om,"%26").replace(fm,"`").replace(Ya,"{").replace(qa,"}").replace(Ga,"^")}function pm(e){return Cs(e).replace(im,"%3D")}function gm(e){return fo(e).replace(Ka,"%23").replace(am,"%3F")}function _m(e){return e==null?"":gm(e).replace(lm,"%2F")}function yr(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function bm(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;os&&Cs(s)):[r&&Cs(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function vm(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=rt(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const ym=Symbol(""),Yl=Symbol(""),ho=Symbol(""),Xa=Symbol(""),Ss=Symbol("");function kn(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function St(e,t,n,r,o){const s=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((l,i)=>{const a=h=>{h===!1?i(bn(4,{from:n,to:t})):h instanceof Error?i(h):Bh(h)?i(bn(2,{from:t,to:h})):(s&&r.enterCallbacks[o]===s&&typeof h=="function"&&s.push(h),l())},f=e.call(r&&r.instances[o],t,n,a);let d=Promise.resolve(f);e.length<3&&(d=d.then(a)),d.catch(h=>i(h))})}function es(e,t,n,r){const o=[];for(const s of e)for(const l in s.components){let i=s.components[l];if(!(t!=="beforeRouteEnter"&&!s.instances[l]))if(Em(i)){const f=(i.__vccOpts||i)[t];f&&o.push(St(f,n,r,s,l))}else{let a=i();o.push(()=>a.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${l}" at "${s.path}"`));const d=Th(f)?f.default:f;s.components[l]=d;const m=(d.__vccOpts||d)[t];return m&&St(m,n,r,s,l)()}))}}return o}function Em(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function ql(e){const t=dt(ho),n=dt(Xa),r=Ee(()=>t.resolve(Be(e.to))),o=Ee(()=>{const{matched:a}=r.value,{length:f}=a,d=a[f-1],h=n.matched;if(!d||!h.length)return-1;const m=h.findIndex(_n.bind(null,d));if(m>-1)return m;const _=Xl(a[f-2]);return f>1&&Xl(d)===_&&h[h.length-1].path!==_?h.findIndex(_n.bind(null,a[f-2])):m}),s=Ee(()=>o.value>-1&&Im(n.params,r.value.params)),l=Ee(()=>o.value>-1&&o.value===n.matched.length-1&&Ua(n.params,r.value.params));function i(a={}){return wm(a)?t[Be(e.replace)?"replace":"push"](Be(e.to)).catch(Cn):Promise.resolve()}return{route:r,href:Ee(()=>r.value.href),isActive:s,isExactActive:l,navigate:i}}const xm=ht({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:ql,setup(e,{slots:t}){const n=Lr(ql(e)),{options:r}=dt(ho),o=Ee(()=>({[Jl(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Jl(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=t.default&&t.default(n);return e.custom?s:dn("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),km=xm;function wm(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Im(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!rt(o)||o.length!==r.length||r.some((s,l)=>s!==o[l]))return!1}return!0}function Xl(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Jl=(e,t,n)=>e??t??n,Lm=ht({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=dt(Ss),o=Ee(()=>e.route||r.value),s=dt(Yl,0),l=Ee(()=>{let f=Be(s);const{matched:d}=o.value;let h;for(;(h=d[f])&&!h.components;)f++;return f}),i=Ee(()=>o.value.matched[l.value]);or(Yl,Ee(()=>l.value+1)),or(ym,i),or(Ss,o);const a=fe();return Rt(()=>[a.value,i.value,e.name],([f,d,h],[m,_,v])=>{d&&(d.instances[h]=f,_&&_!==d&&f&&f===m&&(d.leaveGuards.size||(d.leaveGuards=_.leaveGuards),d.updateGuards.size||(d.updateGuards=_.updateGuards))),f&&d&&(!_||!_n(d,_)||!m)&&(d.enterCallbacks[h]||[]).forEach(x=>x(f))},{flush:"post"}),()=>{const f=o.value,d=e.name,h=i.value,m=h&&h.components[d];if(!m)return Ql(n.default,{Component:m,route:f});const _=h.props[d],v=_?_===!0?f.params:typeof _=="function"?_(f):_:null,w=dn(m,ce({},v,t,{onVnodeUnmounted:g=>{g.component.isUnmounted&&(h.instances[d]=null)},ref:a}));return Ql(n.default,{Component:w,route:f})||w}}});function Ql(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Ja=Lm;function Tm(e){const t=tm(e.routes,e),n=e.parseQuery||bm,r=e.stringifyQuery||Gl,o=e.history,s=kn(),l=kn(),i=kn(),a=Xs(It);let f=It;tn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=zr.bind(null,S=>""+S),h=zr.bind(null,_m),m=zr.bind(null,yr);function _(S,j){let $,K;return Ha(S)?($=t.getRecordMatcher(S),K=j):K=S,t.addRoute(K,$)}function v(S){const j=t.getRecordMatcher(S);j&&t.removeRoute(j)}function x(){return t.getRoutes().map(S=>S.record)}function w(S){return!!t.getRecordMatcher(S)}function g(S,j){if(j=ce({},j||a.value),typeof S=="string"){const c=Zr(n,S,j.path),p=t.resolve({path:c.path},j),b=o.createHref(c.fullPath);return ce(c,p,{params:m(p.params),hash:yr(c.hash),redirectedFrom:void 0,href:b})}let $;if("path"in S)$=ce({},S,{path:Zr(n,S.path,j.path).path});else{const c=ce({},S.params);for(const p in c)c[p]==null&&delete c[p];$=ce({},S,{params:h(c)}),j.params=h(j.params)}const K=t.resolve($,j),Z=S.hash||"";K.params=d(m(K.params));const ie=Oh(r,ce({},S,{hash:mm(Z),path:K.path})),u=o.createHref(ie);return ce({fullPath:ie,hash:Z,query:r===Gl?vm(S.query):S.query||{}},K,{redirectedFrom:void 0,href:u})}function E(S){return typeof S=="string"?Zr(n,S,a.value.path):ce({},S)}function T(S,j){if(f!==S)return bn(8,{from:j,to:S})}function I(S){return M(S)}function N(S){return I(ce(E(S),{replace:!0}))}function L(S){const j=S.matched[S.matched.length-1];if(j&&j.redirect){const{redirect:$}=j;let K=typeof $=="function"?$(S):$;return typeof K=="string"&&(K=K.includes("?")||K.includes("#")?K=E(K):{path:K},K.params={}),ce({query:S.query,hash:S.hash,params:"path"in K?{}:S.params},K)}}function M(S,j){const $=f=g(S),K=a.value,Z=S.state,ie=S.force,u=S.replace===!0,c=L($);if(c)return M(ce(E(c),{state:typeof c=="object"?ce({},Z,c.state):Z,force:ie,replace:u}),j||$);const p=$;p.redirectedFrom=j;let b;return!ie&&Nh(r,K,$)&&(b=bn(16,{to:p,from:K}),Ne(K,K,!0,!1)),(b?Promise.resolve(b):te(p,K)).catch(k=>pt(k)?pt(k,2)?k:ke(k):ne(k,p,K)).then(k=>{if(k){if(pt(k,2))return M(ce({replace:u},E(k.to),{state:typeof k.to=="object"?ce({},Z,k.to.state):Z,force:ie}),j||p)}else k=ue(p,K,!0,u,Z);return be(p,K,k),k})}function R(S,j){const $=T(S,j);return $?Promise.reject($):Promise.resolve()}function Q(S){const j=qe.values().next().value;return j&&typeof j.runWithContext=="function"?j.runWithContext(S):S()}function te(S,j){let $;const[K,Z,ie]=Cm(S,j);$=es(K.reverse(),"beforeRouteLeave",S,j);for(const c of K)c.leaveGuards.forEach(p=>{$.push(St(p,S,j))});const u=R.bind(null,S,j);return $.push(u),xe($).then(()=>{$=[];for(const c of s.list())$.push(St(c,S,j));return $.push(u),xe($)}).then(()=>{$=es(Z,"beforeRouteUpdate",S,j);for(const c of Z)c.updateGuards.forEach(p=>{$.push(St(p,S,j))});return $.push(u),xe($)}).then(()=>{$=[];for(const c of ie)if(c.beforeEnter)if(rt(c.beforeEnter))for(const p of c.beforeEnter)$.push(St(p,S,j));else $.push(St(c.beforeEnter,S,j));return $.push(u),xe($)}).then(()=>(S.matched.forEach(c=>c.enterCallbacks={}),$=es(ie,"beforeRouteEnter",S,j),$.push(u),xe($))).then(()=>{$=[];for(const c of l.list())$.push(St(c,S,j));return $.push(u),xe($)}).catch(c=>pt(c,8)?c:Promise.reject(c))}function be(S,j,$){i.list().forEach(K=>Q(()=>K(S,j,$)))}function ue(S,j,$,K,Z){const ie=T(S,j);if(ie)return ie;const u=j===It,c=tn?history.state:{};$&&(K||u?o.replace(S.fullPath,ce({scroll:u&&c&&c.scroll},Z)):o.push(S.fullPath,Z)),a.value=S,Ne(S,j,$,u),ke()}let de;function De(){de||(de=o.listen((S,j,$)=>{if(!st.listening)return;const K=g(S),Z=L(K);if(Z){M(ce(Z,{replace:!0}),K).catch(Cn);return}f=K;const ie=a.value;tn&&Uh($l(ie.fullPath,$.delta),Dr()),te(K,ie).catch(u=>pt(u,12)?u:pt(u,2)?(M(u.to,K).then(c=>{pt(c,20)&&!$.delta&&$.type===jn.pop&&o.go(-1,!1)}).catch(Cn),Promise.reject()):($.delta&&o.go(-$.delta,!1),ne(u,K,ie))).then(u=>{u=u||ue(K,ie,!1),u&&($.delta&&!pt(u,8)?o.go(-$.delta,!1):$.type===jn.pop&&pt(u,20)&&o.go(-1,!1)),be(K,ie,u)}).catch(Cn)}))}let $e=kn(),se=kn(),z;function ne(S,j,$){ke(S);const K=se.list();return K.length?K.forEach(Z=>Z(S,j,$)):console.error(S),Promise.reject(S)}function Re(){return z&&a.value!==It?Promise.resolve():new Promise((S,j)=>{$e.add([S,j])})}function ke(S){return z||(z=!S,De(),$e.list().forEach(([j,$])=>S?$(S):j()),$e.reset()),S}function Ne(S,j,$,K){const{scrollBehavior:Z}=e;if(!tn||!Z)return Promise.resolve();const ie=!$&&jh($l(S.fullPath,0))||(K||!$)&&history.state&&history.state.scroll||null;return Qs().then(()=>Z(S,j,ie)).then(u=>u&&$h(u)).catch(u=>ne(u,S,j))}const we=S=>o.go(S);let Je;const qe=new Set,st={currentRoute:a,listening:!0,addRoute:_,removeRoute:v,hasRoute:w,getRoutes:x,resolve:g,options:e,push:I,replace:N,go:we,back:()=>we(-1),forward:()=>we(1),beforeEach:s.add,beforeResolve:l.add,afterEach:i.add,onError:se.add,isReady:Re,install(S){const j=this;S.component("RouterLink",km),S.component("RouterView",Ja),S.config.globalProperties.$router=j,Object.defineProperty(S.config.globalProperties,"$route",{enumerable:!0,get:()=>Be(a)}),tn&&!Je&&a.value===It&&(Je=!0,I(o.location).catch(Z=>{}));const $={};for(const Z in It)Object.defineProperty($,Z,{get:()=>a.value[Z],enumerable:!0});S.provide(ho,j),S.provide(Xa,Ai($)),S.provide(Ss,a);const K=S.unmount;qe.add(S),S.unmount=function(){qe.delete(S),qe.size<1&&(f=It,de&&de(),de=null,a.value=It,Je=!1,z=!1),K()}}};function xe(S){return S.reduce((j,$)=>j.then(()=>Q($)),Promise.resolve())}return st}function Cm(e,t){const n=[],r=[],o=[],s=Math.max(t.matched.length,e.matched.length);for(let l=0;l_n(f,i))?r.push(i):n.push(i));const a=e.matched[l];a&&(t.matched.find(f=>_n(f,a))||o.push(a))}return[n,r,o]}const Sm=ht({__name:"App",setup(e){return(t,n)=>(ye(),no(Be(Ja)))}}),On=/^[a-z0-9]+(-[a-z0-9]+)*$/,$r=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const i=o.pop(),a=o.pop(),f={provider:o.length>0?o[0]:r,prefix:a,name:i};return t&&!cr(f)?null:f}const s=o[0],l=s.split("-");if(l.length>1){const i={provider:r,prefix:l.shift(),name:l.join("-")};return t&&!cr(i)?null:i}if(n&&r===""){const i={provider:r,prefix:"",name:s};return t&&!cr(i,n)?null:i}return null},cr=(e,t)=>e?!!((e.provider===""||e.provider.match(On))&&(t&&e.prefix===""||e.prefix.match(On))&&e.name.match(On)):!1,Qa=Object.freeze({left:0,top:0,width:16,height:16}),Er=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ur=Object.freeze({...Qa,...Er}),Os=Object.freeze({...Ur,body:"",hidden:!1});function Om(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function zl(e,t){const n=Om(e,t);for(const r in Os)r in Er?r in e&&!(r in n)&&(n[r]=Er[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Nm(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(l){if(n[l])return o[l]=[];if(!(l in o)){o[l]=null;const i=r[l]&&r[l].parent,a=i&&s(i);a&&(o[l]=[i].concat(a))}return o[l]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(s),o}function Pm(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function l(i){s=zl(r[i]||o[i],s)}return l(t),n.forEach(l),zl(e,s)}function za(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=Nm(e);for(const o in r){const s=r[o];s&&(t(o,Pm(e,o,s)),n.push(o))}return n}const Am={provider:"",aliases:{},not_found:{},...Qa};function ts(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Za(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ts(e,Am))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(On)||typeof s.body!="string"||!ts(s,Os))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],l=s.parent;if(!o.match(On)||typeof l!="string"||!n[l]&&!r[l]||!ts(s,Os))return null}return t}const Zl=Object.create(null);function Rm(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Jt(e,t){const n=Zl[e]||(Zl[e]=Object.create(null));return n[t]||(n[t]=Rm(e,t))}function mo(e,t){return Za(t)?za(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Mm(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let Hn=!1;function ec(e){return typeof e=="boolean"&&(Hn=e),Hn}function Fm(e){const t=typeof e=="string"?$r(e,!0,Hn):e;if(t){const n=Jt(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Dm(e,t){const n=$r(e,!0,Hn);if(!n)return!1;const r=Jt(n.provider,n.prefix);return Mm(r,n.name,t)}function $m(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Hn&&!t&&!e.prefix){let o=!1;return Za(e)&&(e.prefix="",za(e,(s,l)=>{l&&Dm(s,l)&&(o=!0)})),o}const n=e.prefix;if(!cr({provider:t,prefix:n,name:"a"}))return!1;const r=Jt(t,n);return!!mo(r,e)}const tc=Object.freeze({width:null,height:null}),nc=Object.freeze({...tc,...Er}),Um=/(-?[0-9.]*[0-9]+[0-9.]*)/g,jm=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ei(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Um);if(r===null||!r.length)return e;const o=[];let s=r.shift(),l=jm.test(s);for(;;){if(l){const i=parseFloat(s);isNaN(i)?o.push(s):o.push(Math.ceil(i*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");l=!l}}const Hm=e=>e==="unset"||e==="undefined"||e==="none";function Wm(e,t){const n={...Ur,...e},r={...nc,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(v=>{const x=[],w=v.hFlip,g=v.vFlip;let E=v.rotate;w?g?E+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):g&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let T;switch(E<0&&(E-=Math.floor(E/4)*4),E=E%4,E){case 1:T=o.height/2+o.top,x.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:T=o.width/2+o.left,x.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}E%2===1&&(o.left!==o.top&&(T=o.left,o.left=o.top,o.top=T),o.width!==o.height&&(T=o.width,o.width=o.height,o.height=T)),x.length&&(s=''+s+"")});const l=r.width,i=r.height,a=o.width,f=o.height;let d,h;l===null?(h=i===null?"1em":i==="auto"?f:i,d=ei(h,a/f)):(d=l==="auto"?a:l,h=i===null?ei(d,f/a):i==="auto"?f:i);const m={},_=(v,x)=>{Hm(x)||(m[v]=x.toString())};return _("width",d),_("height",h),m.viewBox=o.left.toString()+" "+o.top.toString()+" "+a.toString()+" "+f.toString(),{attributes:m,body:s}}const Vm=/\sid="(\S+)"/g,Km="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Bm=0;function Gm(e,t=Km){const n=[];let r;for(;r=Vm.exec(e);)n.push(r[1]);if(!n.length)return e;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const l=typeof t=="function"?t(s):t+(Bm++).toString(),i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+l+o+"$3")}),e=e.replace(new RegExp(o,"g"),""),e}const Ns=Object.create(null);function Ym(e,t){Ns[e]=t}function Ps(e){return Ns[e]||Ns[""]}function po(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const go=Object.create(null),wn=["https://api.simplesvg.com","https://api.unisvg.com"],ur=[];for(;wn.length>0;)wn.length===1||Math.random()>.5?ur.push(wn.shift()):ur.push(wn.pop());go[""]=po({resources:["https://api.iconify.design"].concat(ur)});function qm(e,t){const n=po(t);return n===null?!1:(go[e]=n,!0)}function _o(e){return go[e]}const Xm=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ti=Xm();function Jm(e,t){const n=_o(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(l=>{o=Math.max(o,l.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function Qm(e){return e===404}const zm=(e,t,n)=>{const r=[],o=Jm(e,t),s="icons";let l={type:s,provider:e,prefix:t,icons:[]},i=0;return n.forEach((a,f)=>{i+=a.length+1,i>=o&&f>0&&(r.push(l),l={type:s,provider:e,prefix:t,icons:[]},i=a.length),l.icons.push(a)}),r.push(l),r};function Zm(e){if(typeof e=="string"){const t=_o(e);if(t)return t.path}return"/"}const ep=(e,t,n)=>{if(!ti){n("abort",424);return}let r=Zm(t.provider);switch(t.type){case"icons":{const s=t.prefix,i=t.icons.join(","),a=new URLSearchParams({icons:i});r+=s+".json?"+a.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;ti(e+r).then(s=>{const l=s.status;if(l!==200){setTimeout(()=>{n(Qm(l)?"abort":"next",l)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},tp={prepare:zm,send:ep};function np(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,l=o.prefix,i=o.name,a=n[s]||(n[s]=Object.create(null)),f=a[l]||(a[l]=Jt(s,l));let d;i in f.icons?d=t.loaded:l===""||f.missing.has(i)?d=t.missing:d=t.pending;const h={provider:s,prefix:l,name:i};d.push(h)}),t}function rc(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function rp(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const l=s.icons,i=l.pending.length;l.pending=l.pending.filter(a=>{if(a.prefix!==o)return!0;const f=a.name;if(e.icons[f])l.loaded.push({provider:r,prefix:o,name:f});else if(e.missing.has(f))l.missing.push({provider:r,prefix:o,name:f});else return n=!0,!0;return!1}),l.pending.length!==i&&(n||rc([e],s.id),s.callback(l.loaded.slice(0),l.missing.slice(0),l.pending.slice(0),s.abort))})}))}let sp=0;function op(e,t,n){const r=sp++,o=rc.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(l=>{(l.loaderCallbacks||(l.loaderCallbacks=[])).push(s)}),o}function lp(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?$r(o,t,n):o;s&&r.push(s)}),r}var ip={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ap(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let l;if(e.random){let L=e.resources.slice(0);for(l=[];L.length>1;){const M=Math.floor(Math.random()*L.length);l.push(L[M]),L=L.slice(0,M).concat(L.slice(M+1))}l=l.concat(L)}else l=e.resources.slice(s).concat(e.resources.slice(0,s));const i=Date.now();let a="pending",f=0,d,h=null,m=[],_=[];typeof r=="function"&&_.push(r);function v(){h&&(clearTimeout(h),h=null)}function x(){a==="pending"&&(a="aborted"),v(),m.forEach(L=>{L.status==="pending"&&(L.status="aborted")}),m=[]}function w(L,M){M&&(_=[]),typeof L=="function"&&_.push(L)}function g(){return{startTime:i,payload:t,status:a,queriesSent:f,queriesPending:m.length,subscribe:w,abort:x}}function E(){a="failed",_.forEach(L=>{L(void 0,d)})}function T(){m.forEach(L=>{L.status==="pending"&&(L.status="aborted")}),m=[]}function I(L,M,R){const Q=M!=="success";switch(m=m.filter(te=>te!==L),a){case"pending":break;case"failed":if(Q||!e.dataAfterTimeout)return;break;default:return}if(M==="abort"){d=R,E();return}if(Q){d=R,m.length||(l.length?N():E());return}if(v(),T(),!e.random){const te=e.resources.indexOf(L.resource);te!==-1&&te!==e.index&&(e.index=te)}a="completed",_.forEach(te=>{te(R)})}function N(){if(a!=="pending")return;v();const L=l.shift();if(L===void 0){if(m.length){h=setTimeout(()=>{v(),a==="pending"&&(T(),E())},e.timeout);return}E();return}const M={status:"pending",resource:L,callback:(R,Q)=>{I(M,R,Q)}};m.push(M),f++,h=setTimeout(N,e.rotate),n(L,t,M.callback)}return setTimeout(N),g}function sc(e){const t={...ip,...e};let n=[];function r(){n=n.filter(i=>i().status==="pending")}function o(i,a,f){const d=ap(t,i,a,(h,m)=>{r(),f&&f(h,m)});return n.push(d),d}function s(i){return n.find(a=>i(a))||null}return{query:o,find:s,setIndex:i=>{t.index=i},getIndex:()=>t.index,cleanup:r}}function ni(){}const ns=Object.create(null);function cp(e){if(!ns[e]){const t=_o(e);if(!t)return;const n=sc(t),r={config:t,redundancy:n};ns[e]=r}return ns[e]}function up(e,t,n){let r,o;if(typeof e=="string"){const s=Ps(e);if(!s)return n(void 0,424),ni;o=s.send;const l=cp(e);l&&(r=l.redundancy)}else{const s=po(e);if(s){r=sc(s);const l=e.resources?e.resources[0]:"",i=Ps(l);i&&(o=i.send)}}return!r||!o?(n(void 0,424),ni):r.query(t,o,n)().abort}const ri="iconify2",Wn="iconify",oc=Wn+"-count",si=Wn+"-version",lc=36e5,fp=168;function As(e,t){try{return e.getItem(t)}catch{}}function bo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function oi(e,t){try{e.removeItem(t)}catch{}}function Rs(e,t){return bo(e,oc,t.toString())}function Ms(e){return parseInt(As(e,oc))||0}const jr={local:!0,session:!0},ic={local:new Set,session:new Set};let vo=!1;function dp(e){vo=e}let Zn=typeof window>"u"?{}:window;function ac(e){const t=e+"Storage";try{if(Zn&&Zn[t]&&typeof Zn[t].length=="number")return Zn[t]}catch{}jr[e]=!1}function cc(e,t){const n=ac(e);if(!n)return;const r=As(n,si);if(r!==ri){if(r){const i=Ms(n);for(let a=0;a{const a=Wn+i.toString(),f=As(n,a);if(typeof f=="string"){try{const d=JSON.parse(f);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>o&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,i))return!0}catch{}oi(n,a)}};let l=Ms(n);for(let i=l-1;i>=0;i--)s(i)||(i===l-1?(l--,Rs(n,l)):ic[e].add(i))}function uc(){if(!vo){dp(!0);for(const e in jr)cc(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=Jt(r,o);if(!mo(s,n).length)return!1;const l=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,l):l,!0})}}function hp(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in jr)cc(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function mp(e,t){vo||uc();function n(r){let o;if(!jr[r]||!(o=ac(r)))return;const s=ic[r];let l;if(s.size)s.delete(l=Array.from(s).shift());else if(l=Ms(o),!Rs(o,l+1))return;const i={cached:Math.floor(Date.now()/lc),provider:e.provider,data:t};return bo(o,Wn+l.toString(),JSON.stringify(i))}t.lastModified&&!hp(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function li(){}function pp(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,rp(e)}))}function gp(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=Ps(n)))return;s.prepare(n,r,o).forEach(i=>{up(n,i,a=>{if(typeof a!="object")i.icons.forEach(f=>{e.missing.add(f)});else try{const f=mo(e,a);if(!f.length)return;const d=e.pendingIcons;d&&f.forEach(h=>{d.delete(h)}),mp(e,a)}catch(f){console.error(f)}pp(e)})})}))}const _p=(e,t)=>{const n=lp(e,!0,ec()),r=np(n);if(!r.pending.length){let a=!0;return t&&setTimeout(()=>{a&&t(r.loaded,r.missing,r.pending,li)}),()=>{a=!1}}const o=Object.create(null),s=[];let l,i;return r.pending.forEach(a=>{const{provider:f,prefix:d}=a;if(d===i&&f===l)return;l=f,i=d,s.push(Jt(f,d));const h=o[f]||(o[f]=Object.create(null));h[d]||(h[d]=[])}),r.pending.forEach(a=>{const{provider:f,prefix:d,name:h}=a,m=Jt(f,d),_=m.pendingIcons||(m.pendingIcons=new Set);_.has(h)||(_.add(h),o[f][d].push(h))}),s.forEach(a=>{const{provider:f,prefix:d}=a;o[f][d].length&&gp(a,o[f][d])}),t?op(t,r,s):li};function bp(e,t){const n={...e};for(const r in t){const o=t[r],s=typeof o;r in tc?(o===null||o&&(s==="string"||s==="number"))&&(n[r]=o):s===typeof n[r]&&(n[r]=r==="rotate"?o%4:o)}return n}const vp=/[\s,]+/;function yp(e,t){t.split(vp).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Ep(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}function xp(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}function kp(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function wp(e){return"data:image/svg+xml,"+kp(e)}function Ip(e){return'url("'+wp(e)+'")'}const ii={...nc,inline:!1},Lp={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Tp={display:"inline-block"},Fs={backgroundColor:"currentColor"},fc={backgroundColor:"transparent"},ai={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},ci={webkitMask:Fs,mask:Fs,background:fc};for(const e in ci){const t=ci[e];for(const n in ai)t[e+n]=ai[n]}const fr={};["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";fr[e+"-flip"]=t,fr[e.slice(0,1)+"-flip"]=t,fr[e+"Flip"]=t});function ui(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const fi=(e,t)=>{const n=bp(ii,t),r={...Lp},o=t.mode||"svg",s={},l=t.style,i=typeof l=="object"&&!(l instanceof Array)?l:{};for(let x in t){const w=t[x];if(w!==void 0)switch(x){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[x]=w===!0||w==="true"||w===1;break;case"flip":typeof w=="string"&&yp(n,w);break;case"color":s.color=w;break;case"rotate":typeof w=="string"?n[x]=Ep(w):typeof w=="number"&&(n[x]=w);break;case"ariaHidden":case"aria-hidden":w!==!0&&w!=="true"&&delete r["aria-hidden"];break;default:{const g=fr[x];g?(w===!0||w==="true"||w===1)&&(n[g]=!0):ii[x]===void 0&&(r[x]=w)}}}const a=Wm(e,n),f=a.attributes;if(n.inline&&(s.verticalAlign="-0.125em"),o==="svg"){r.style={...s,...i},Object.assign(r,f);let x=0,w=t.id;return typeof w=="string"&&(w=w.replace(/-/g,"_")),r.innerHTML=Gm(a.body,w?()=>w+"ID"+x++:"iconifyVue"),dn("svg",r)}const{body:d,width:h,height:m}=e,_=o==="mask"||(o==="bg"?!1:d.indexOf("currentColor")!==-1),v=xp(d,{...f,width:h+"",height:m+""});return r.style={...s,"--svg":Ip(v),width:ui(f.width),height:ui(f.height),...Tp,..._?Fs:fc,...i},dn("span",r)};ec(!0);Ym("",tp);if(typeof document<"u"&&typeof window<"u"){uc();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!$m(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;qm(n,o)||console.error(r)}catch{console.error(r)}}}}const Cp={...Ur,body:""},Bt=ht({inheritAttrs:!1,data(){return{iconMounted:!1,counter:0}},mounted(){this._name="",this._loadingIcon=null,this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let n;if(typeof e!="string"||(n=$r(e,!1,!0))===null)return this.abortLoading(),null;const r=Fm(n);if(!r)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",r!==null&&(this._loadingIcon={name:e,abort:_p([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const o=["iconify"];return n.prefix!==""&&o.push("iconify--"+n.prefix),n.provider!==""&&o.push("iconify--"+n.provider),{data:r,classes:o}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted?this.getIcon(e.icon,e.onLoad):null;if(!t)return fi(Cp,e);let n=e;return t.classes&&(n={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),fi({...Ur,...t.data},n)}}),Sp={class:"flex flex-col space-y-6 text-light-text dark:text-dark-text"},Op={key:0,class:"w-full h-6 rounded-sm bg-light-distinct-text dark:bg-dark-distinct-text animate-pulse"},Np=["href"],Pp={class:"flex-1 space-y-2"},Ap={class:"text-xl font-semibold"},Rp={class:"text-md text-light-muted dark:text-dark-muted"},Mp={class:"text-md text-light-accent dark:text-dark-accent"},Fp={class:"text-md text-light-accent dark:text-dark-accent"},Dp={class:"flex items-center gap-2 mt-2"},$p={key:0,class:"text-sm text-light-text dark:text-dark-text"},Up=["onClick"],jp=D("p",{class:"text-sm"},"Helpful",-1),Hp=["onClick"],Wp=D("p",{class:"text-sm"},"Not Helpful",-1),Vp=D("div",{class:"absolute left-1/2 -translate-x-1/2 top-full mt-1 w-64 p-2 bg-light-menu dark:bg-dark-menu text-xs text-light-text dark:text-dark-text rounded shadow-lg opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity z-10 pointer-events-none",role:"tooltip"}," Feedback is anonymous and only used for evaluation purposes. ",-1),Kp={key:0,class:"flex-shrink-0 text-lg text-light-muted dark:text-dark-muted"},Bp=["href"],Gp=["src","alt"],Yp={class:"mt-1 text-xs text-center text-light-text dark:text-dark-text"},qp=["href"],di=ht({__name:"FieldAnswer",props:{response:{},isLoading:{type:Boolean}},setup(e){const t=e,n=fe([]),r=fe([]);function o(i,a){const f=[];for(let d=0;dt.response,async()=>{if(!t.response||t.response.length===0)return;const i=t.response.map(f=>f.id),a=o(i,50);try{const f={};await Promise.all(a.map(async d=>{var x,w,g;let h=[(g=(w=(x=t.response)==null?void 0:x[0])==null?void 0:w.lang)==null?void 0:g.toLowerCase(),"mul","en"];const m=`https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&ids=${d.join("|")}&props=labels|descriptions|claims&languages=${h.join(",")}&origin=*`,v=await(await fetch(m,{headers:{"User-Agent":"Wikidata Search (philippe.saade@wikimedia.de)"}})).json();Object.assign(f,v.entities||{})})),n.value=t.response.map(d=>{var w,g,E,T,I,N,L,M,R,Q,te,be,ue,de,De,$e,se,z;const h=f[d.id],m=((I=(T=(E=(g=(w=h==null?void 0:h.claims)==null?void 0:w.P18)==null?void 0:g[0])==null?void 0:E.mainsnak)==null?void 0:T.datavalue)==null?void 0:I.value)||null,_=((N=d.lang)==null?void 0:N.toLowerCase())||"en",v=m?`https://commons.wikimedia.org/wiki/Special:FilePath/${encodeURIComponent(m)}`:void 0,x=m?`https://commons.wikimedia.org/wiki/File:${encodeURIComponent(m.replace(/ /g,"_"))}`:void 0;return{...d,label:((M=(L=h==null?void 0:h.labels)==null?void 0:L[_])==null?void 0:M.value)||((Q=(R=h==null?void 0:h.labels)==null?void 0:R.mul)==null?void 0:Q.value)||((be=(te=h==null?void 0:h.labels)==null?void 0:te.en)==null?void 0:be.value)||"Unknown",description:((de=(ue=h==null?void 0:h.descriptions)==null?void 0:ue[_])==null?void 0:de.value)||(($e=(De=h==null?void 0:h.descriptions)==null?void 0:De.mul)==null?void 0:$e.value)||((z=(se=h==null?void 0:h.descriptions)==null?void 0:se.en)==null?void 0:z.value)||"No description available",imageUrl:v,imagePageUrl:x,query:d.query}}),r.value=Array(n.value.length).fill("")}catch(f){console.error("Error fetching Wikidata info:",f)}},{immediate:!0});const l=async(i,a,f)=>{if(!n.value)return;const d=n.value[f].query??"";try{const h=await fetch(`/feedback?query=${encodeURIComponent(d)}&id=${i}&sentiment=${a}&index=${f}`,{method:"POST",headers:{"Content-Type":"application/json"}});h.status===200?r.value[f]="thanks":console.error("Feedback submission failed",h.status)}catch(h){console.error("Error sending feedback",h)}};return(i,a)=>{var f;return ye(),Ie("div",Sp,[i.isLoading?(ye(),Ie("div",Op)):(f=n.value)!=null&&f.length?(ye(!0),Ie(He,{key:1},as(n.value,(d,h)=>(ye(),Ie("div",{key:d.id,class:"p-4 m-2 rounded-lg bg-light-bg dark:bg-dark-bg border border-light-border dark:border-dark-border hover:shadow-lg hover:bg-light-hover dark:hover:bg-dark-hover transition cursor-pointer"},[D("a",{href:"https://www.wikidata.org/wiki/"+(d.id.startsWith("P")?"Property:"+d.id:d.id),target:"_blank",class:"flex items-start gap-6"},[D("div",Pp,[D("div",Ap,gt(d.label)+" ("+gt(d.id)+")",1),D("div",Rp,gt(d.description),1),D("div",Mp,"Similarity Score: "+gt(d.similarity_score),1),D("div",Fp,"Source: "+gt(d.source),1),D("div",Dp,[r.value[h]==="thanks"?(ye(),Ie("span",$p," ✅ Thanks for your feedback! ")):(ye(),Ie(He,{key:1},[D("button",{onClick:Xr(m=>l(d.id,"up",h),["prevent"]),class:"flex items-center gap-2 px-3 py-1 bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-200 rounded hover:bg-green-200 dark:hover:bg-green-800 transition"},[ut(" 👍 "),jp],8,Up),D("button",{onClick:Xr(m=>l(d.id,"down",h),["prevent"]),class:"flex items-center gap-2 px-3 py-1 bg-red-100 dark:bg-red-900 text-red-700 dark:text-red-200 rounded hover:bg-red-200 dark:hover:bg-red-800 transition"},[ut(" 👎 "),Wp],8,Hp)],64)),D("div",{class:"relative group ml-1 inline-flex items-center",tabindex:"0","aria-label":"Feedback info",onClick:a[0]||(a[0]=Xr(()=>{},["stop"]))},[_e(Be(Bt),{icon:"fluent:info-16-regular",class:"text-blue-600 dark:text-blue-400 cursor-pointer"}),Vp])])]),d.imageUrl?(ye(),Ie("div",Kp,[D("a",{href:d.imagePageUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"View this image on Wikimedia Commons"},[D("img",{class:"rounded-2xl max-h-32 shadow-md border border-light-border dark:border-dark-border",src:d.imageUrl,alt:d.label},null,8,Gp)],8,Bp),D("p",Yp,[D("a",{href:d.imagePageUrl,target:"_blank",rel:"noopener noreferrer",class:"underline"}," From Wikimedia Commons ",8,qp)])])):nn("",!0)],8,Np)]))),128)):nn("",!0)])}}}),Xp={class:"absolute z-10 bg-light-content dark:bg-dark-content w-screen h-screen overflow-auto"},Jp={class:"flex justify-end p-4"},Qp={class:"max-w-screen-lg mx-auto px-4 sm:px-8 md:px-12 space-y-12 pb-16"},zp=ca('
Wikidata Embedding Project Logo

Wikidata Vector Database

The Wikidata Vector Database, part of the Wikidata Embedding Project , stores semantic embeddings of Wikidata entities to enable context-aware search using vector similarity.


 

',3),Zp={key:0,class:"text-center py-8"},eg=D("div",{class:"inline-block animate-spin rounded-full h-10 w-10 border-b-2 border-blue-600"},null,-1),tg=D("p",{class:"mt-4 text-light-text dark:text-dark-text"},"Checking API access...",-1),ng=[eg,tg],rg={key:1,class:"flex flex-col sm:flex-row gap-4 items-center"},sg={class:"relative flex-grow"},og=["placeholder"],lg={key:2,class:"flex justify-center"},ig={class:"!mt-1 text-sm text-red-500"},ag=ca('

Help Us Improve

Share your thoughts and projects if you’re using the Wikidata vector database!

Take the Survey

 

Partners

 

Contributors

Philippe Saadé
Philippe Saadé

AI/ML Project Manager, WMDE

Robert Timm
Robert Timm

Senior Software Engineer, Wikibase Suite, WMDE

Jonathan Fraine
Jonathan Fraine

Co-Head of Software Development, CTO, WMDE

Andrew Tavis McAllister
Andrew Tavis McAllister

Data Analyst, WMDE

 

Resources

 

',5),cg=ht({__name:"Settings",emits:["close"],setup(e,{emit:t}){const n=t,r=fe(f()||""),o=fe(""),s=fe(!1),l=fe(!0),i=Ee(()=>!s.value&&(!l.value||f()));Or(async()=>{await d()});function a(){sessionStorage.setItem("api-secret",r.value)}function f(){const v=sessionStorage.getItem("api-secret");return v!=null&&v.length?v:null}async function d(){s.value=!0,o.value="";try{const v=await fetch("/item/query/?query=");l.value=v.status===401}catch{l.value=!0}finally{s.value=!1}}async function h(){o.value="";try{(await fetch("/item/query/?query=",{headers:{"x-api-secret":r.value}})).status===401?o.value="Invalid API secret. Please try again.":a()}catch{o.value="Network error. Please try again later."}}async function m(){await h(),o.value||n("close")}const _=fe("");return fe(""),fe(!1),fe(!1),fe(!1),Ee(()=>/\S+@\S+\.\S+/.test(_.value)),(v,x)=>(ye(),Ie("div",Xp,[D("div",Jp,[_e(Be(Bt),{class:Nt(["text-3xl",{"text-light-disabled-text dark:text-dark-disabled-text":!i.value,"cursor-pointer text-light-text dark:text-dark-text hover:text-light-distinct-text dark:hover:text-dark-distinct-text transition-colors":i.value}]),icon:"fluent:dismiss-24-filled",onClick:x[0]||(x[0]=w=>i.value&&v.$emit("close"))},null,8,["class"])]),D("div",Qp,[zp,s.value?(ye(),Ie("div",Zp,ng)):l.value?(ye(),Ie("div",rg,[D("div",sg,[_e(Be(Bt),{class:Nt(["absolute left-3 top-3 text-xl",{"text-light-text dark:text-dark-text":r.value.length>0}]),icon:"fluent:lock-closed-24-filled"},null,8,["class"]),rr(D("input",{"onUpdate:modelValue":x[1]||(x[1]=w=>r.value=w),type:"password",class:"w-full pl-10 pr-4 h-14 rounded-lg border border-light-distinct-text dark:border-dark-distinct-text bg-light-menu dark:bg-dark-menu text-light-text dark:text-dark-text focus:ring-2 focus:ring-blue-500 outline-none text-lg",placeholder:v.$t("enter-api-secret"),autocomplete:"off",onInput:a,onKeyup:ha(m,["enter"])},null,40,og),[[da,r.value]])]),D("button",{class:"px-8 py-3 bg-blue-600 text-white font-semibold rounded-lg hover:bg-blue-700 transition-colors text-lg",onClick:m}," Start ")])):(ye(),Ie("div",lg,[D("button",{class:"px-10 py-4 bg-blue-600 text-white font-semibold rounded-lg hover:bg-blue-700 transition-colors text-xl",onClick:x[2]||(x[2]=w=>v.$emit("close"))}," Start ")])),D("p",ig,gt(o.value)+" ",1),ag])]))}}),ug={class:"w-screen min-h-screen bg-light-content dark:bg-dark-content overflow-auto"},fg={class:"max-w-screen-2xl mx-auto px-4 sm:px-8 md:px-12 py-12 space-y-12"},dg=D("div",{class:"flex flex-col sm:flex-row items-center gap-6 text-center sm:text-left justify-center"},[D("a",{href:"https://www.wikidata.org/wiki/Wikidata:Embedding_Project",target:"_blank",class:"shrink-0"},[D("img",{src:"https://upload.wikimedia.org/wikipedia/commons/0/01/Wikidata_Embedding_Project_Logo.png",alt:"Wikidata Embedding Project Logo",class:"h-24 object-contain"})]),D("div",null,[D("h1",{class:"text-5xl font-bold py-2"}," Wikidata Vector Database ")])],-1),hg={class:"flex justify-center w-full"},mg={class:"flex flex-col w-full md:w-4/5 space-y-4"},pg={class:"flex flex-nowrap items-center gap-3"},gg={class:"relative flex-1 min-w-0 text-2xl rounded-lg bg-light-menu dark:bg-dark-menu elem-shadow-sm"},_g=["placeholder"],bg={class:"relative group inline-flex items-center shrink-0",tabindex:"0","aria-label":"How to search"},vg=D("div",{class:"absolute right-0 top-full mt-2 w-[28rem] max-w-[90vw] p-3 bg-light-menu dark:bg-dark-menu text-sm text-light-text dark:text-dark-text rounded shadow-lg z-20 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity pointer-events-none",role:"tooltip"},[D("p",{class:"font-semibold mb-2"},"How vector search works"),D("p",{class:"text-sm mb-1"},"What it does:"),D("ul",{class:"list-disc pl-5 space-y-1"},[D("li",null,"Explore Wikidata entities"),D("li",null,"Fuzzy search by meaning and context"),D("li",null,"Surface similar items")]),D("p",{class:"text-sm mt-2 mb-1"},"What it doesn't do:"),D("ul",{class:"list-disc pl-5 space-y-1"},[D("li",null,"Answer questions (Use results to investigate further)"),D("li",null,"Return complete lists (Use SPARQL for that)")]),D("p",{class:"text-sm mt-2 mb-1"},"Examples:"),D("ul",{class:"list-disc pl-5 space-y-1"},[D("li",null,[D("code",null,"English science-fiction novel")]),D("li",null,[D("code",null,"Q42")]),D("li",null,[D("code",null,"Who wrote Hitchhiker's Guide to the Galaxy?")])])],-1),yg={class:"flex items-center justify-between gap-4 flex-wrap text-sm text-light-text dark:text-dark-text"},Eg={class:"flex flex-col md:flex-row items-start md:items-center gap-4 text-sm text-light-text dark:text-dark-text"},xg={class:"flex gap-4 items-center flex-wrap"},kg=["value"],wg={key:0,class:"flex items-center gap-2 relative group"},Ig=["value"],Lg=D("div",{class:"absolute left-1/2 -translate-x-1/2 top-full mt-1 w-80 p-3 bg-light-menu dark:bg-dark-menu text-sm text-light-text dark:text-dark-text rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none"},[D("p",{class:"font-semibold mb-3"},"Language Selection Info"),D("p",{class:"mb-2"},[D("strong",null,"Radio buttons"),ut(" represent languages with dedicated vector datasets. Selecting one queries vectors in that language. ")]),D("p",{class:"mb-2"},[D("strong",null,"Dropdown menu"),ut(" shows other languages without dedicated vectors. Selecting one will translate your query to English and search the full vector database. ")]),D("p",null,[ut(" The "),D("strong",null,"'ALL'"),ut(" option queries the full vector database regardless of language. More languages will be added as dedicated vectors in future releases. ")])],-1),Tg={class:"flex items-center gap-2"},Cg={class:"inline-flex h-8 rounded-lg overflow-hidden border border-light-distinct-text dark:border-dark-distinct-text"},Sg=D("p",{class:"text-sm text-light-text dark:text-dark-text"},[ut(" ⚠️ This tool is in early testing, and results may be incomplete or inaccurate. Your queries are sent to a third-party service (JinaAI) for processing, and we store them for up to 90 days for quality improvements. We welcome your feedback! Please help us improve by filling out "),D("a",{href:"https://wikimedia.sslsurvey.de/Wikidata-Vector-DB-Feedback-Alpha-release",target:"_blank",class:"text-blue-600 dark:text-blue-400 hover:underline"}," our survey "),ut(". ")],-1),Og={key:0,class:"mt-0 text-sm text-red-500"},Ng={key:0,class:"flex justify-center w-full"},Pg={class:"flex flex-col w-full md:w-4/5 space-y-7"},Ag={key:1,class:"flex justify-center w-full"},Rg={class:"flex flex-col w-full md:w-4/5 space-y-5"},Mg=ht({__name:"ChatView",setup(e){const t=fe(""),n=fe(),r=fe(),o=fe(!1),s=fe(!1),l=fe(!0),i=fe("item"),a=fe([]),f=fe([]),d=fe("All");function h(){const _=sessionStorage.getItem("api-secret");return _!=null&&_.length?_:null}Or(async()=>{try{const v=await(await fetch("/languages")).json();a.value=["all",...v.vectordb_langs],f.value=v.other_langs,a.value.includes(d.value.toLowerCase())||(d.value="ALL")}catch(_){console.error("Failed to fetch languages",_)}});async function m(){n.value=void 0,r.value=void 0,o.value=!0;const _=h();let v=d.value.toLowerCase()||"all";try{const x=i.value==="property"?"/property/query":"/item/query",w=await fetch(`${x}/?query=${encodeURIComponent(t.value)}&rerank=True&lang=${v}`,{headers:_?{"x-api-secret":_}:{}});if(w.status===401){l.value=!0,o.value=!1;return}const g=await w.json();(!v||v==="all")&&(v="en"),n.value=g.map(E=>({...E,id:E.QID??E.PID,query:t.value,lang:v}))}catch(x){o.value=!1,console.error(x),r.value="Sorry. Failed to retrieve response."}}return(_,v)=>(ye(),Ie("main",ug,[l.value?(ye(),no(cg,{key:0,onClose:v[0]||(v[0]=x=>l.value=!1)})):nn("",!0),_e(Be(Bt),{class:"text-4xl absolute right-4 top-4 cursor-pointer text-light-text dark:text-dark-text hover:text-light-distinct-text dark:hover:text-dark-distinct-text transition-colors",icon:"mdi:home",onClick:v[1]||(v[1]=x=>l.value=!0)}),D("div",fg,[dg,D("div",hg,[D("div",mg,[D("div",pg,[D("div",gg,[rr(D("input",{"onUpdate:modelValue":v[2]||(v[2]=x=>t.value=x),type:"text",class:"w-full pl-4 pr-24 bg-transparent rounded-lg h-12 placeholder:text-light-distinct-text dark:placeholder:text-dark-distinct-text text-light-text dark:text-dark-text",placeholder:_.$t("chat-prompt"),autocomplete:"off",onKeyup:v[3]||(v[3]=ha(x=>t.value.length>0?m():{},["enter"])),onFocus:v[4]||(v[4]=x=>s.value=!0),onBlur:v[5]||(v[5]=x=>s.value=!1)},null,40,_g),[[da,t.value]]),_e(Be(Bt),{class:Nt(["absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer",{"text-light-text dark:text-dark-text":s.value&&t.value.length===0,"text-light-text dark:text-dark-text hover:text-light-distinct-text dark:hover:text-dark-distinct-text":s.value&&t.value.length>0,"text-light-distinct-text dark:text-dark-distinct-text":!s.value}]),icon:"fluent:send-24-filled",size:"2em",onClick:v[6]||(v[6]=x=>t.value.length>0?m():{})},null,8,["class"])]),D("div",bg,[_e(Be(Bt),{icon:"fluent:info-16-regular",class:"text-blue-600 dark:text-blue-400 cursor-pointer",size:"2.5em"}),vg])]),D("div",yg,[D("div",Eg,[D("div",xg,[(ye(!0),Ie(He,null,as(a.value,x=>(ye(),Ie("label",{key:x,class:"flex items-center gap-1 cursor-pointer px-2 py-1 border rounded-lg hover:bg-light-menu dark:hover:bg-dark-menu transition-colors"},[rr(D("input",{type:"radio",value:x,"onUpdate:modelValue":v[7]||(v[7]=w=>d.value=w),class:"accent-blue-600"},null,8,kg),[[xf,d.value]]),ut(" "+gt(x.toUpperCase()),1)]))),128))]),f.value.length>0?(ye(),Ie("div",wg,[rr(D("select",{"onUpdate:modelValue":v[8]||(v[8]=x=>d.value=x),class:"rounded-lg border border-light-distinct-text dark:border-dark-distinct-text bg-light-menu dark:bg-dark-menu text-light-text dark:text-dark-text h-8 px-2"},[(ye(!0),Ie(He,null,as(f.value,x=>(ye(),Ie("option",{key:x,value:x},gt(x.toUpperCase()),9,Ig))),128))],512),[[kf,d.value]]),D("div",null,[_e(Be(Bt),{icon:"fluent:info-16-regular",class:"text-blue-600 dark:text-blue-400 cursor-pointer ml-1"}),Lg])])):nn("",!0)]),D("div",Tg,[D("div",Cg,[D("button",{class:Nt(["px-3 h-full flex items-center text-base font-medium",i.value==="item"?"bg-light-menu dark:bg-dark-menu text-light-text dark:text-dark-text":"bg-transparent text-light-distinct-text dark:text-dark-distinct-text"]),onClick:v[9]||(v[9]=x=>i.value="item"),type:"button"}," Items ",2),D("button",{class:Nt(["px-3 h-full flex items-center text-base font-medium",i.value==="property"?"bg-light-menu dark:bg-dark-menu text-light-text dark:text-dark-text":"bg-transparent text-light-distinct-text dark:text-dark-distinct-text"]),onClick:v[10]||(v[10]=x=>i.value="property"),type:"button"}," Properties ",2)])])]),Sg,r.value&&r.value.length?(ye(),Ie("p",Og,gt(r.value),1)):nn("",!0)])]),n.value?(ye(),Ie("div",Ng,[D("div",Pg,[_e(di,{response:n.value,isLoading:!1},null,8,["response"])])])):o.value&&!n.value?(ye(),Ie("div",Ag,[D("div",Rg,[_e(di,{isLoading:!0})])])):nn("",!0)])]))}}),Fg=Tm({history:Kh("/"),routes:[{path:"/",name:"chat",component:Mg}]}),Dg=gh({locale:window.navigator.language,fallbackLocale:"de",messages:{en:{"chat-prompt":"Search Wikidata...","no-response-message":"Sorry, but no valid response was returned for your question. Please try rephrasing it.",source:"Source","enter-api-secret":"Enter your API secret"},de:{"chat-prompt":"Suche in Wikidata...","no-response-message":"Leider wurde auf Ihre Frage keine gültige Antwort zurückgegeben. Bitte versuchen Sie es umzuformulieren.",source:"Quelle","enter-api-secret":"API Passwort eingeben"}}}),yo=Sf(Sm);yo.use(Dg);yo.use(Fg);yo.mount("#app"); + */const tn=typeof window<"u";function Th(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const ce=Object.assign;function zr(e,t){const n={};for(const r in t){const o=t[r];n[r]=st(o)?o.map(e):e(o)}return n}const Sn=()=>{},st=Array.isArray,Sh=/\/$/,Ch=e=>e.replace(Sh,"");function Zr(e,t,n="/"){let r,o={},s="",l="";const i=t.indexOf("#");let a=t.indexOf("?");return i=0&&(a=-1),a>-1&&(r=t.slice(0,a),s=t.slice(a+1,i>-1?i:t.length),o=e(s)),i>-1&&(r=r||t.slice(0,i),l=t.slice(i,t.length)),r=Ah(r??t,n),{fullPath:r+(s&&"?")+s+l,path:r,query:o,hash:l}}function Oh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Fl(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Nh(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&_n(t.matched[r],n.matched[o])&&Ua(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function _n(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ua(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Ph(e[n],t[n]))return!1;return!0}function Ph(e,t){return st(e)?Dl(e,t):st(t)?Dl(t,e):e===t}function Dl(e,t){return st(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Ah(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,l,i;for(l=0;l1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(l-(l===r.length?1:0)).join("/")}var jn;(function(e){e.pop="pop",e.push="push"})(jn||(jn={}));var Cn;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Cn||(Cn={}));function Rh(e){if(!e)if(tn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ch(e)}const Mh=/^[^#]+#/;function Fh(e,t){return e.replace(Mh,"#")+t}function Dh(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Dr=()=>({left:window.pageXOffset,top:window.pageYOffset});function $h(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Dh(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function $l(e,t){return(history.state?history.state.position-t:-1)+e}const Ts=new Map;function Uh(e,t){Ts.set(e,t)}function jh(e){const t=Ts.get(e);return Ts.delete(e),t}let Hh=()=>location.protocol+"//"+location.host;function ja(e,t){const{pathname:n,search:r,hash:o}=t,s=e.indexOf("#");if(s>-1){let i=o.includes(e.slice(s))?e.slice(s).length:1,a=o.slice(i);return a[0]!=="/"&&(a="/"+a),Fl(a,"")}return Fl(n,e)+r+o}function Wh(e,t,n,r){let o=[],s=[],l=null;const i=({state:m})=>{const _=ja(e,location),w=n.value,v=t.value;let y=0;if(m){if(n.value=_,t.value=m,l&&l===w){l=null;return}y=v?m.position-v.position:0}else r(_);o.forEach(g=>{g(n.value,w,{delta:y,type:jn.pop,direction:y?y>0?Cn.forward:Cn.back:Cn.unknown})})};function a(){l=n.value}function f(m){o.push(m);const _=()=>{const w=o.indexOf(m);w>-1&&o.splice(w,1)};return s.push(_),_}function d(){const{history:m}=window;m.state&&m.replaceState(ce({},m.state,{scroll:Dr()}),"")}function h(){for(const m of s)m();s=[],window.removeEventListener("popstate",i),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",i),window.addEventListener("beforeunload",d,{passive:!0}),{pauseListeners:a,listen:f,destroy:h}}function Ul(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?Dr():null}}function Vh(e){const{history:t,location:n}=window,r={value:ja(e,n)},o={value:t.state};o.value||s(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(a,f,d){const h=e.indexOf("#"),m=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+a:Hh()+e+a;try{t[d?"replaceState":"pushState"](f,"",m),o.value=f}catch(_){console.error(_),n[d?"replace":"assign"](m)}}function l(a,f){const d=ce({},t.state,Ul(o.value.back,a,o.value.forward,!0),f,{position:o.value.position});s(a,d,!0),r.value=a}function i(a,f){const d=ce({},o.value,t.state,{forward:a,scroll:Dr()});s(d.current,d,!0);const h=ce({},Ul(r.value,a,null),{position:d.position+1},f);s(a,h,!1),r.value=a}return{location:r,state:o,push:i,replace:l}}function Kh(e){e=Rh(e);const t=Vh(e),n=Wh(e,t.state,t.location,t.replace);function r(s,l=!0){l||n.pauseListeners(),history.go(s)}const o=ce({location:"",base:e,go:r,createHref:Fh.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function Bh(e){return typeof e=="string"||e&&typeof e=="object"}function Ha(e){return typeof e=="string"||typeof e=="symbol"}const Tt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Wa=Symbol("");var jl;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(jl||(jl={}));function bn(e,t){return ce(new Error,{type:e,[Wa]:!0},t)}function gt(e,t){return e instanceof Error&&Wa in e&&(t==null||!!(e.type&t))}const Hl="[^/]+?",Gh={sensitive:!1,strict:!1,start:!0,end:!0},Yh=/[.+*?^${}()[\]/\\]/g;function qh(e,t){const n=ce({},Gh,t),r=[];let o=n.start?"^":"";const s=[];for(const f of e){const d=f.length?[]:[90];n.strict&&!f.length&&(o+="/");for(let h=0;ht.length?t.length===1&&t[0]===80?1:-1:0}function Jh(e,t){let n=0;const r=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const Qh={type:0,value:""},zh=/[a-zA-Z0-9_]/;function Zh(e){if(!e)return[[]];if(e==="/")return[[Qh]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${f}": ${_}`)}let n=0,r=n;const o=[];let s;function l(){s&&o.push(s),s=[]}let i=0,a,f="",d="";function h(){f&&(n===0?s.push({type:0,value:f}):n===1||n===2||n===3?(s.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:f,regexp:d,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),f="")}function m(){f+=a}for(;i{l(x)}:Sn}function l(d){if(Ha(d)){const h=r.get(d);h&&(r.delete(d),n.splice(n.indexOf(h),1),h.children.forEach(l),h.alias.forEach(l))}else{const h=n.indexOf(d);h>-1&&(n.splice(h,1),d.record.name&&r.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function i(){return n}function a(d){let h=0;for(;h=0&&(d.record.path!==n[h].record.path||!Va(d,n[h]));)h++;n.splice(h,0,d),d.record.name&&!Kl(d)&&r.set(d.record.name,d)}function f(d,h){let m,_={},w,v;if("name"in d&&d.name){if(m=r.get(d.name),!m)throw bn(1,{location:d});v=m.record.name,_=ce(Vl(h.params,m.keys.filter(x=>!x.optional).map(x=>x.name)),d.params&&Vl(d.params,m.keys.map(x=>x.name))),w=m.stringify(_)}else if("path"in d)w=d.path,m=n.find(x=>x.re.test(w)),m&&(_=m.parse(w),v=m.record.name);else{if(m=h.name?r.get(h.name):n.find(x=>x.re.test(h.path)),!m)throw bn(1,{location:d,currentLocation:h});v=m.record.name,_=ce({},h.params,d.params),w=m.stringify(_)}const y=[];let g=m;for(;g;)y.unshift(g.record),g=g.parent;return{name:v,path:w,params:_,matched:y,meta:sm(y)}}return e.forEach(d=>s(d)),{addRoute:s,resolve:f,removeRoute:l,getRoutes:i,getRecordMatcher:o}}function Vl(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function nm(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:rm(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function rm(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Kl(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function sm(e){return e.reduce((t,n)=>ce(t,n.meta),{})}function Bl(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function Va(e,t){return t.children.some(n=>n===e||Va(e,n))}const Ka=/#/g,om=/&/g,lm=/\//g,im=/=/g,am=/\?/g,Ba=/\+/g,cm=/%5B/g,um=/%5D/g,Ga=/%5E/g,fm=/%60/g,Ya=/%7B/g,dm=/%7C/g,qa=/%7D/g,hm=/%20/g;function fo(e){return encodeURI(""+e).replace(dm,"|").replace(cm,"[").replace(um,"]")}function mm(e){return fo(e).replace(Ya,"{").replace(qa,"}").replace(Ga,"^")}function Ss(e){return fo(e).replace(Ba,"%2B").replace(hm,"+").replace(Ka,"%23").replace(om,"%26").replace(fm,"`").replace(Ya,"{").replace(qa,"}").replace(Ga,"^")}function pm(e){return Ss(e).replace(im,"%3D")}function gm(e){return fo(e).replace(Ka,"%23").replace(am,"%3F")}function _m(e){return e==null?"":gm(e).replace(lm,"%2F")}function yr(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function bm(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;os&&Ss(s)):[r&&Ss(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function vm(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=st(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const ym=Symbol(""),Yl=Symbol(""),ho=Symbol(""),Xa=Symbol(""),Cs=Symbol("");function kn(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Nt(e,t,n,r,o){const s=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((l,i)=>{const a=h=>{h===!1?i(bn(4,{from:n,to:t})):h instanceof Error?i(h):Bh(h)?i(bn(2,{from:t,to:h})):(s&&r.enterCallbacks[o]===s&&typeof h=="function"&&s.push(h),l())},f=e.call(r&&r.instances[o],t,n,a);let d=Promise.resolve(f);e.length<3&&(d=d.then(a)),d.catch(h=>i(h))})}function es(e,t,n,r){const o=[];for(const s of e)for(const l in s.components){let i=s.components[l];if(!(t!=="beforeRouteEnter"&&!s.instances[l]))if(Em(i)){const f=(i.__vccOpts||i)[t];f&&o.push(Nt(f,n,r,s,l))}else{let a=i();o.push(()=>a.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${l}" at "${s.path}"`));const d=Th(f)?f.default:f;s.components[l]=d;const m=(d.__vccOpts||d)[t];return m&&Nt(m,n,r,s,l)()}))}}return o}function Em(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function ql(e){const t=ht(ho),n=ht(Xa),r=Ee(()=>t.resolve(Me(e.to))),o=Ee(()=>{const{matched:a}=r.value,{length:f}=a,d=a[f-1],h=n.matched;if(!d||!h.length)return-1;const m=h.findIndex(_n.bind(null,d));if(m>-1)return m;const _=Xl(a[f-2]);return f>1&&Xl(d)===_&&h[h.length-1].path!==_?h.findIndex(_n.bind(null,a[f-2])):m}),s=Ee(()=>o.value>-1&&Im(n.params,r.value.params)),l=Ee(()=>o.value>-1&&o.value===n.matched.length-1&&Ua(n.params,r.value.params));function i(a={}){return wm(a)?t[Me(e.replace)?"replace":"push"](Me(e.to)).catch(Sn):Promise.resolve()}return{route:r,href:Ee(()=>r.value.href),isActive:s,isExactActive:l,navigate:i}}const xm=mt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:ql,setup(e,{slots:t}){const n=Lr(ql(e)),{options:r}=ht(ho),o=Ee(()=>({[Jl(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Jl(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=t.default&&t.default(n);return e.custom?s:dn("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),km=xm;function wm(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Im(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!st(o)||o.length!==r.length||r.some((s,l)=>s!==o[l]))return!1}return!0}function Xl(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Jl=(e,t,n)=>e??t??n,Lm=mt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=ht(Cs),o=Ee(()=>e.route||r.value),s=ht(Yl,0),l=Ee(()=>{let f=Me(s);const{matched:d}=o.value;let h;for(;(h=d[f])&&!h.components;)f++;return f}),i=Ee(()=>o.value.matched[l.value]);or(Yl,Ee(()=>l.value+1)),or(ym,i),or(Cs,o);const a=ue();return Mt(()=>[a.value,i.value,e.name],([f,d,h],[m,_,w])=>{d&&(d.instances[h]=f,_&&_!==d&&f&&f===m&&(d.leaveGuards.size||(d.leaveGuards=_.leaveGuards),d.updateGuards.size||(d.updateGuards=_.updateGuards))),f&&d&&(!_||!_n(d,_)||!m)&&(d.enterCallbacks[h]||[]).forEach(v=>v(f))},{flush:"post"}),()=>{const f=o.value,d=e.name,h=i.value,m=h&&h.components[d];if(!m)return Ql(n.default,{Component:m,route:f});const _=h.props[d],w=_?_===!0?f.params:typeof _=="function"?_(f):_:null,y=dn(m,ce({},w,t,{onVnodeUnmounted:g=>{g.component.isUnmounted&&(h.instances[d]=null)},ref:a}));return Ql(n.default,{Component:y,route:f})||y}}});function Ql(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Ja=Lm;function Tm(e){const t=tm(e.routes,e),n=e.parseQuery||bm,r=e.stringifyQuery||Gl,o=e.history,s=kn(),l=kn(),i=kn(),a=Xs(Tt);let f=Tt;tn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=zr.bind(null,C=>""+C),h=zr.bind(null,_m),m=zr.bind(null,yr);function _(C,j){let $,K;return Ha(C)?($=t.getRecordMatcher(C),K=j):K=C,t.addRoute(K,$)}function w(C){const j=t.getRecordMatcher(C);j&&t.removeRoute(j)}function v(){return t.getRoutes().map(C=>C.record)}function y(C){return!!t.getRecordMatcher(C)}function g(C,j){if(j=ce({},j||a.value),typeof C=="string"){const c=Zr(n,C,j.path),p=t.resolve({path:c.path},j),b=o.createHref(c.fullPath);return ce(c,p,{params:m(p.params),hash:yr(c.hash),redirectedFrom:void 0,href:b})}let $;if("path"in C)$=ce({},C,{path:Zr(n,C.path,j.path).path});else{const c=ce({},C.params);for(const p in c)c[p]==null&&delete c[p];$=ce({},C,{params:h(c)}),j.params=h(j.params)}const K=t.resolve($,j),Z=C.hash||"";K.params=d(m(K.params));const ie=Oh(r,ce({},C,{hash:mm(Z),path:K.path})),u=o.createHref(ie);return ce({fullPath:ie,hash:Z,query:r===Gl?vm(C.query):C.query||{}},K,{redirectedFrom:void 0,href:u})}function x(C){return typeof C=="string"?Zr(n,C,a.value.path):ce({},C)}function L(C,j){if(f!==C)return bn(8,{from:j,to:C})}function I(C){return F(C)}function N(C){return I(ce(x(C),{replace:!0}))}function T(C){const j=C.matched[C.matched.length-1];if(j&&j.redirect){const{redirect:$}=j;let K=typeof $=="function"?$(C):$;return typeof K=="string"&&(K=K.includes("?")||K.includes("#")?K=x(K):{path:K},K.params={}),ce({query:C.query,hash:C.hash,params:"path"in K?{}:C.params},K)}}function F(C,j){const $=f=g(C),K=a.value,Z=C.state,ie=C.force,u=C.replace===!0,c=T($);if(c)return F(ce(x(c),{state:typeof c=="object"?ce({},Z,c.state):Z,force:ie,replace:u}),j||$);const p=$;p.redirectedFrom=j;let b;return!ie&&Nh(r,K,$)&&(b=bn(16,{to:p,from:K}),Ne(K,K,!0,!1)),(b?Promise.resolve(b):te(p,K)).catch(k=>gt(k)?gt(k,2)?k:ke(k):ne(k,p,K)).then(k=>{if(k){if(gt(k,2))return F(ce({replace:u},x(k.to),{state:typeof k.to=="object"?ce({},Z,k.to.state):Z,force:ie}),j||p)}else k=fe(p,K,!0,u,Z);return be(p,K,k),k})}function M(C,j){const $=L(C,j);return $?Promise.reject($):Promise.resolve()}function Q(C){const j=qe.values().next().value;return j&&typeof j.runWithContext=="function"?j.runWithContext(C):C()}function te(C,j){let $;const[K,Z,ie]=Sm(C,j);$=es(K.reverse(),"beforeRouteLeave",C,j);for(const c of K)c.leaveGuards.forEach(p=>{$.push(Nt(p,C,j))});const u=M.bind(null,C,j);return $.push(u),xe($).then(()=>{$=[];for(const c of s.list())$.push(Nt(c,C,j));return $.push(u),xe($)}).then(()=>{$=es(Z,"beforeRouteUpdate",C,j);for(const c of Z)c.updateGuards.forEach(p=>{$.push(Nt(p,C,j))});return $.push(u),xe($)}).then(()=>{$=[];for(const c of ie)if(c.beforeEnter)if(st(c.beforeEnter))for(const p of c.beforeEnter)$.push(Nt(p,C,j));else $.push(Nt(c.beforeEnter,C,j));return $.push(u),xe($)}).then(()=>(C.matched.forEach(c=>c.enterCallbacks={}),$=es(ie,"beforeRouteEnter",C,j),$.push(u),xe($))).then(()=>{$=[];for(const c of l.list())$.push(Nt(c,C,j));return $.push(u),xe($)}).catch(c=>gt(c,8)?c:Promise.reject(c))}function be(C,j,$){i.list().forEach(K=>Q(()=>K(C,j,$)))}function fe(C,j,$,K,Z){const ie=L(C,j);if(ie)return ie;const u=j===Tt,c=tn?history.state:{};$&&(K||u?o.replace(C.fullPath,ce({scroll:u&&c&&c.scroll},Z)):o.push(C.fullPath,Z)),a.value=C,Ne(C,j,$,u),ke()}let de;function $e(){de||(de=o.listen((C,j,$)=>{if(!ot.listening)return;const K=g(C),Z=T(K);if(Z){F(ce(Z,{replace:!0}),K).catch(Sn);return}f=K;const ie=a.value;tn&&Uh($l(ie.fullPath,$.delta),Dr()),te(K,ie).catch(u=>gt(u,12)?u:gt(u,2)?(F(u.to,K).then(c=>{gt(c,20)&&!$.delta&&$.type===jn.pop&&o.go(-1,!1)}).catch(Sn),Promise.reject()):($.delta&&o.go(-$.delta,!1),ne(u,K,ie))).then(u=>{u=u||fe(K,ie,!1),u&&($.delta&&!gt(u,8)?o.go(-$.delta,!1):$.type===jn.pop&>(u,20)&&o.go(-1,!1)),be(K,ie,u)}).catch(Sn)}))}let Ue=kn(),se=kn(),z;function ne(C,j,$){ke(C);const K=se.list();return K.length?K.forEach(Z=>Z(C,j,$)):console.error(C),Promise.reject(C)}function Re(){return z&&a.value!==Tt?Promise.resolve():new Promise((C,j)=>{Ue.add([C,j])})}function ke(C){return z||(z=!C,$e(),Ue.list().forEach(([j,$])=>C?$(C):j()),Ue.reset()),C}function Ne(C,j,$,K){const{scrollBehavior:Z}=e;if(!tn||!Z)return Promise.resolve();const ie=!$&&jh($l(C.fullPath,0))||(K||!$)&&history.state&&history.state.scroll||null;return Qs().then(()=>Z(C,j,ie)).then(u=>u&&$h(u)).catch(u=>ne(u,C,j))}const we=C=>o.go(C);let Je;const qe=new Set,ot={currentRoute:a,listening:!0,addRoute:_,removeRoute:w,hasRoute:y,getRoutes:v,resolve:g,options:e,push:I,replace:N,go:we,back:()=>we(-1),forward:()=>we(1),beforeEach:s.add,beforeResolve:l.add,afterEach:i.add,onError:se.add,isReady:Re,install(C){const j=this;C.component("RouterLink",km),C.component("RouterView",Ja),C.config.globalProperties.$router=j,Object.defineProperty(C.config.globalProperties,"$route",{enumerable:!0,get:()=>Me(a)}),tn&&!Je&&a.value===Tt&&(Je=!0,I(o.location).catch(Z=>{}));const $={};for(const Z in Tt)Object.defineProperty($,Z,{get:()=>a.value[Z],enumerable:!0});C.provide(ho,j),C.provide(Xa,Ai($)),C.provide(Cs,a);const K=C.unmount;qe.add(C),C.unmount=function(){qe.delete(C),qe.size<1&&(f=Tt,de&&de(),de=null,a.value=Tt,Je=!1,z=!1),K()}}};function xe(C){return C.reduce((j,$)=>j.then(()=>Q($)),Promise.resolve())}return ot}function Sm(e,t){const n=[],r=[],o=[],s=Math.max(t.matched.length,e.matched.length);for(let l=0;l_n(f,i))?r.push(i):n.push(i));const a=e.matched[l];a&&(t.matched.find(f=>_n(f,a))||o.push(a))}return[n,r,o]}const Cm=mt({__name:"App",setup(e){return(t,n)=>(ye(),no(Me(Ja)))}}),On=/^[a-z0-9]+(-[a-z0-9]+)*$/,$r=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const i=o.pop(),a=o.pop(),f={provider:o.length>0?o[0]:r,prefix:a,name:i};return t&&!cr(f)?null:f}const s=o[0],l=s.split("-");if(l.length>1){const i={provider:r,prefix:l.shift(),name:l.join("-")};return t&&!cr(i)?null:i}if(n&&r===""){const i={provider:r,prefix:"",name:s};return t&&!cr(i,n)?null:i}return null},cr=(e,t)=>e?!!((e.provider===""||e.provider.match(On))&&(t&&e.prefix===""||e.prefix.match(On))&&e.name.match(On)):!1,Qa=Object.freeze({left:0,top:0,width:16,height:16}),Er=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ur=Object.freeze({...Qa,...Er}),Os=Object.freeze({...Ur,body:"",hidden:!1});function Om(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function zl(e,t){const n=Om(e,t);for(const r in Os)r in Er?r in e&&!(r in n)&&(n[r]=Er[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Nm(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(l){if(n[l])return o[l]=[];if(!(l in o)){o[l]=null;const i=r[l]&&r[l].parent,a=i&&s(i);a&&(o[l]=[i].concat(a))}return o[l]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(s),o}function Pm(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function l(i){s=zl(r[i]||o[i],s)}return l(t),n.forEach(l),zl(e,s)}function za(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=Nm(e);for(const o in r){const s=r[o];s&&(t(o,Pm(e,o,s)),n.push(o))}return n}const Am={provider:"",aliases:{},not_found:{},...Qa};function ts(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Za(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ts(e,Am))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(On)||typeof s.body!="string"||!ts(s,Os))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],l=s.parent;if(!o.match(On)||typeof l!="string"||!n[l]&&!r[l]||!ts(s,Os))return null}return t}const Zl=Object.create(null);function Rm(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Jt(e,t){const n=Zl[e]||(Zl[e]=Object.create(null));return n[t]||(n[t]=Rm(e,t))}function mo(e,t){return Za(t)?za(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Mm(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let Hn=!1;function ec(e){return typeof e=="boolean"&&(Hn=e),Hn}function Fm(e){const t=typeof e=="string"?$r(e,!0,Hn):e;if(t){const n=Jt(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Dm(e,t){const n=$r(e,!0,Hn);if(!n)return!1;const r=Jt(n.provider,n.prefix);return Mm(r,n.name,t)}function $m(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Hn&&!t&&!e.prefix){let o=!1;return Za(e)&&(e.prefix="",za(e,(s,l)=>{l&&Dm(s,l)&&(o=!0)})),o}const n=e.prefix;if(!cr({provider:t,prefix:n,name:"a"}))return!1;const r=Jt(t,n);return!!mo(r,e)}const tc=Object.freeze({width:null,height:null}),nc=Object.freeze({...tc,...Er}),Um=/(-?[0-9.]*[0-9]+[0-9.]*)/g,jm=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ei(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Um);if(r===null||!r.length)return e;const o=[];let s=r.shift(),l=jm.test(s);for(;;){if(l){const i=parseFloat(s);isNaN(i)?o.push(s):o.push(Math.ceil(i*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");l=!l}}const Hm=e=>e==="unset"||e==="undefined"||e==="none";function Wm(e,t){const n={...Ur,...e},r={...nc,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(w=>{const v=[],y=w.hFlip,g=w.vFlip;let x=w.rotate;y?g?x+=2:(v.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),v.push("scale(-1 1)"),o.top=o.left=0):g&&(v.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),v.push("scale(1 -1)"),o.top=o.left=0);let L;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:L=o.height/2+o.top,v.unshift("rotate(90 "+L.toString()+" "+L.toString()+")");break;case 2:v.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:L=o.width/2+o.left,v.unshift("rotate(-90 "+L.toString()+" "+L.toString()+")");break}x%2===1&&(o.left!==o.top&&(L=o.left,o.left=o.top,o.top=L),o.width!==o.height&&(L=o.width,o.width=o.height,o.height=L)),v.length&&(s=''+s+"")});const l=r.width,i=r.height,a=o.width,f=o.height;let d,h;l===null?(h=i===null?"1em":i==="auto"?f:i,d=ei(h,a/f)):(d=l==="auto"?a:l,h=i===null?ei(d,f/a):i==="auto"?f:i);const m={},_=(w,v)=>{Hm(v)||(m[w]=v.toString())};return _("width",d),_("height",h),m.viewBox=o.left.toString()+" "+o.top.toString()+" "+a.toString()+" "+f.toString(),{attributes:m,body:s}}const Vm=/\sid="(\S+)"/g,Km="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Bm=0;function Gm(e,t=Km){const n=[];let r;for(;r=Vm.exec(e);)n.push(r[1]);if(!n.length)return e;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const l=typeof t=="function"?t(s):t+(Bm++).toString(),i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+l+o+"$3")}),e=e.replace(new RegExp(o,"g"),""),e}const Ns=Object.create(null);function Ym(e,t){Ns[e]=t}function Ps(e){return Ns[e]||Ns[""]}function po(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const go=Object.create(null),wn=["https://api.simplesvg.com","https://api.unisvg.com"],ur=[];for(;wn.length>0;)wn.length===1||Math.random()>.5?ur.push(wn.shift()):ur.push(wn.pop());go[""]=po({resources:["https://api.iconify.design"].concat(ur)});function qm(e,t){const n=po(t);return n===null?!1:(go[e]=n,!0)}function _o(e){return go[e]}const Xm=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ti=Xm();function Jm(e,t){const n=_o(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(l=>{o=Math.max(o,l.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function Qm(e){return e===404}const zm=(e,t,n)=>{const r=[],o=Jm(e,t),s="icons";let l={type:s,provider:e,prefix:t,icons:[]},i=0;return n.forEach((a,f)=>{i+=a.length+1,i>=o&&f>0&&(r.push(l),l={type:s,provider:e,prefix:t,icons:[]},i=a.length),l.icons.push(a)}),r.push(l),r};function Zm(e){if(typeof e=="string"){const t=_o(e);if(t)return t.path}return"/"}const ep=(e,t,n)=>{if(!ti){n("abort",424);return}let r=Zm(t.provider);switch(t.type){case"icons":{const s=t.prefix,i=t.icons.join(","),a=new URLSearchParams({icons:i});r+=s+".json?"+a.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;ti(e+r).then(s=>{const l=s.status;if(l!==200){setTimeout(()=>{n(Qm(l)?"abort":"next",l)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},tp={prepare:zm,send:ep};function np(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,l=o.prefix,i=o.name,a=n[s]||(n[s]=Object.create(null)),f=a[l]||(a[l]=Jt(s,l));let d;i in f.icons?d=t.loaded:l===""||f.missing.has(i)?d=t.missing:d=t.pending;const h={provider:s,prefix:l,name:i};d.push(h)}),t}function rc(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function rp(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const l=s.icons,i=l.pending.length;l.pending=l.pending.filter(a=>{if(a.prefix!==o)return!0;const f=a.name;if(e.icons[f])l.loaded.push({provider:r,prefix:o,name:f});else if(e.missing.has(f))l.missing.push({provider:r,prefix:o,name:f});else return n=!0,!0;return!1}),l.pending.length!==i&&(n||rc([e],s.id),s.callback(l.loaded.slice(0),l.missing.slice(0),l.pending.slice(0),s.abort))})}))}let sp=0;function op(e,t,n){const r=sp++,o=rc.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(l=>{(l.loaderCallbacks||(l.loaderCallbacks=[])).push(s)}),o}function lp(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?$r(o,t,n):o;s&&r.push(s)}),r}var ip={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ap(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let l;if(e.random){let T=e.resources.slice(0);for(l=[];T.length>1;){const F=Math.floor(Math.random()*T.length);l.push(T[F]),T=T.slice(0,F).concat(T.slice(F+1))}l=l.concat(T)}else l=e.resources.slice(s).concat(e.resources.slice(0,s));const i=Date.now();let a="pending",f=0,d,h=null,m=[],_=[];typeof r=="function"&&_.push(r);function w(){h&&(clearTimeout(h),h=null)}function v(){a==="pending"&&(a="aborted"),w(),m.forEach(T=>{T.status==="pending"&&(T.status="aborted")}),m=[]}function y(T,F){F&&(_=[]),typeof T=="function"&&_.push(T)}function g(){return{startTime:i,payload:t,status:a,queriesSent:f,queriesPending:m.length,subscribe:y,abort:v}}function x(){a="failed",_.forEach(T=>{T(void 0,d)})}function L(){m.forEach(T=>{T.status==="pending"&&(T.status="aborted")}),m=[]}function I(T,F,M){const Q=F!=="success";switch(m=m.filter(te=>te!==T),a){case"pending":break;case"failed":if(Q||!e.dataAfterTimeout)return;break;default:return}if(F==="abort"){d=M,x();return}if(Q){d=M,m.length||(l.length?N():x());return}if(w(),L(),!e.random){const te=e.resources.indexOf(T.resource);te!==-1&&te!==e.index&&(e.index=te)}a="completed",_.forEach(te=>{te(M)})}function N(){if(a!=="pending")return;w();const T=l.shift();if(T===void 0){if(m.length){h=setTimeout(()=>{w(),a==="pending"&&(L(),x())},e.timeout);return}x();return}const F={status:"pending",resource:T,callback:(M,Q)=>{I(F,M,Q)}};m.push(F),f++,h=setTimeout(N,e.rotate),n(T,t,F.callback)}return setTimeout(N),g}function sc(e){const t={...ip,...e};let n=[];function r(){n=n.filter(i=>i().status==="pending")}function o(i,a,f){const d=ap(t,i,a,(h,m)=>{r(),f&&f(h,m)});return n.push(d),d}function s(i){return n.find(a=>i(a))||null}return{query:o,find:s,setIndex:i=>{t.index=i},getIndex:()=>t.index,cleanup:r}}function ni(){}const ns=Object.create(null);function cp(e){if(!ns[e]){const t=_o(e);if(!t)return;const n=sc(t),r={config:t,redundancy:n};ns[e]=r}return ns[e]}function up(e,t,n){let r,o;if(typeof e=="string"){const s=Ps(e);if(!s)return n(void 0,424),ni;o=s.send;const l=cp(e);l&&(r=l.redundancy)}else{const s=po(e);if(s){r=sc(s);const l=e.resources?e.resources[0]:"",i=Ps(l);i&&(o=i.send)}}return!r||!o?(n(void 0,424),ni):r.query(t,o,n)().abort}const ri="iconify2",Wn="iconify",oc=Wn+"-count",si=Wn+"-version",lc=36e5,fp=168;function As(e,t){try{return e.getItem(t)}catch{}}function bo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function oi(e,t){try{e.removeItem(t)}catch{}}function Rs(e,t){return bo(e,oc,t.toString())}function Ms(e){return parseInt(As(e,oc))||0}const jr={local:!0,session:!0},ic={local:new Set,session:new Set};let vo=!1;function dp(e){vo=e}let Zn=typeof window>"u"?{}:window;function ac(e){const t=e+"Storage";try{if(Zn&&Zn[t]&&typeof Zn[t].length=="number")return Zn[t]}catch{}jr[e]=!1}function cc(e,t){const n=ac(e);if(!n)return;const r=As(n,si);if(r!==ri){if(r){const i=Ms(n);for(let a=0;a{const a=Wn+i.toString(),f=As(n,a);if(typeof f=="string"){try{const d=JSON.parse(f);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>o&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,i))return!0}catch{}oi(n,a)}};let l=Ms(n);for(let i=l-1;i>=0;i--)s(i)||(i===l-1?(l--,Rs(n,l)):ic[e].add(i))}function uc(){if(!vo){dp(!0);for(const e in jr)cc(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=Jt(r,o);if(!mo(s,n).length)return!1;const l=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,l):l,!0})}}function hp(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in jr)cc(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function mp(e,t){vo||uc();function n(r){let o;if(!jr[r]||!(o=ac(r)))return;const s=ic[r];let l;if(s.size)s.delete(l=Array.from(s).shift());else if(l=Ms(o),!Rs(o,l+1))return;const i={cached:Math.floor(Date.now()/lc),provider:e.provider,data:t};return bo(o,Wn+l.toString(),JSON.stringify(i))}t.lastModified&&!hp(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function li(){}function pp(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,rp(e)}))}function gp(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=Ps(n)))return;s.prepare(n,r,o).forEach(i=>{up(n,i,a=>{if(typeof a!="object")i.icons.forEach(f=>{e.missing.add(f)});else try{const f=mo(e,a);if(!f.length)return;const d=e.pendingIcons;d&&f.forEach(h=>{d.delete(h)}),mp(e,a)}catch(f){console.error(f)}pp(e)})})}))}const _p=(e,t)=>{const n=lp(e,!0,ec()),r=np(n);if(!r.pending.length){let a=!0;return t&&setTimeout(()=>{a&&t(r.loaded,r.missing,r.pending,li)}),()=>{a=!1}}const o=Object.create(null),s=[];let l,i;return r.pending.forEach(a=>{const{provider:f,prefix:d}=a;if(d===i&&f===l)return;l=f,i=d,s.push(Jt(f,d));const h=o[f]||(o[f]=Object.create(null));h[d]||(h[d]=[])}),r.pending.forEach(a=>{const{provider:f,prefix:d,name:h}=a,m=Jt(f,d),_=m.pendingIcons||(m.pendingIcons=new Set);_.has(h)||(_.add(h),o[f][d].push(h))}),s.forEach(a=>{const{provider:f,prefix:d}=a;o[f][d].length&&gp(a,o[f][d])}),t?op(t,r,s):li};function bp(e,t){const n={...e};for(const r in t){const o=t[r],s=typeof o;r in tc?(o===null||o&&(s==="string"||s==="number"))&&(n[r]=o):s===typeof n[r]&&(n[r]=r==="rotate"?o%4:o)}return n}const vp=/[\s,]+/;function yp(e,t){t.split(vp).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Ep(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}function xp(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}function kp(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function wp(e){return"data:image/svg+xml,"+kp(e)}function Ip(e){return'url("'+wp(e)+'")'}const ii={...nc,inline:!1},Lp={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Tp={display:"inline-block"},Fs={backgroundColor:"currentColor"},fc={backgroundColor:"transparent"},ai={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},ci={webkitMask:Fs,mask:Fs,background:fc};for(const e in ci){const t=ci[e];for(const n in ai)t[e+n]=ai[n]}const fr={};["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";fr[e+"-flip"]=t,fr[e.slice(0,1)+"-flip"]=t,fr[e+"Flip"]=t});function ui(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const fi=(e,t)=>{const n=bp(ii,t),r={...Lp},o=t.mode||"svg",s={},l=t.style,i=typeof l=="object"&&!(l instanceof Array)?l:{};for(let v in t){const y=t[v];if(y!==void 0)switch(v){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[v]=y===!0||y==="true"||y===1;break;case"flip":typeof y=="string"&&yp(n,y);break;case"color":s.color=y;break;case"rotate":typeof y=="string"?n[v]=Ep(y):typeof y=="number"&&(n[v]=y);break;case"ariaHidden":case"aria-hidden":y!==!0&&y!=="true"&&delete r["aria-hidden"];break;default:{const g=fr[v];g?(y===!0||y==="true"||y===1)&&(n[g]=!0):ii[v]===void 0&&(r[v]=y)}}}const a=Wm(e,n),f=a.attributes;if(n.inline&&(s.verticalAlign="-0.125em"),o==="svg"){r.style={...s,...i},Object.assign(r,f);let v=0,y=t.id;return typeof y=="string"&&(y=y.replace(/-/g,"_")),r.innerHTML=Gm(a.body,y?()=>y+"ID"+v++:"iconifyVue"),dn("svg",r)}const{body:d,width:h,height:m}=e,_=o==="mask"||(o==="bg"?!1:d.indexOf("currentColor")!==-1),w=xp(d,{...f,width:h+"",height:m+""});return r.style={...s,"--svg":Ip(w),width:ui(f.width),height:ui(f.height),...Tp,..._?Fs:fc,...i},dn("span",r)};ec(!0);Ym("",tp);if(typeof document<"u"&&typeof window<"u"){uc();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!$m(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;qm(n,o)||console.error(r)}catch{console.error(r)}}}}const Sp={...Ur,body:""},_t=mt({inheritAttrs:!1,data(){return{iconMounted:!1,counter:0}},mounted(){this._name="",this._loadingIcon=null,this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let n;if(typeof e!="string"||(n=$r(e,!1,!0))===null)return this.abortLoading(),null;const r=Fm(n);if(!r)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",r!==null&&(this._loadingIcon={name:e,abort:_p([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const o=["iconify"];return n.prefix!==""&&o.push("iconify--"+n.prefix),n.provider!==""&&o.push("iconify--"+n.provider),{data:r,classes:o}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted?this.getIcon(e.icon,e.onLoad):null;if(!t)return fi(Sp,e);let n=e;return t.classes&&(n={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),fi({...Ur,...t.data},n)}}),Cp={class:"flex flex-col space-y-6 text-light-text dark:text-dark-text"},Op={key:0,class:"w-full h-6 rounded-sm bg-light-distinct-text dark:bg-dark-distinct-text animate-pulse"},Np=["href"],Pp={class:"flex-1 space-y-2"},Ap={class:"text-xl font-semibold"},Rp={class:"text-md text-light-muted dark:text-dark-muted"},Mp={class:"text-md text-light-accent dark:text-dark-accent"},Fp={class:"text-md text-light-accent dark:text-dark-accent"},Dp={class:"flex items-center gap-2 mt-2"},$p={key:0,class:"text-sm text-light-text dark:text-dark-text"},Up=["onClick"],jp=A("p",{class:"text-sm"},"Helpful",-1),Hp=["onClick"],Wp=A("p",{class:"text-sm"},"Not Helpful",-1),Vp=A("div",{class:"absolute left-1/2 -translate-x-1/2 top-full mt-1 w-64 p-2 bg-light-menu dark:bg-dark-menu text-sm text-light-text dark:text-dark-text rounded shadow-lg opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity z-10 pointer-events-none",role:"tooltip"}," Feedback is anonymous and only used for evaluation purposes. ",-1),Kp={key:0,class:"flex-shrink-0 text-lg text-light-muted dark:text-dark-muted"},Bp=["href"],Gp=["src","alt"],Yp={class:"mt-1 text-xs text-center text-light-text dark:text-dark-text"},qp=["href"],di=mt({__name:"FieldAnswer",props:{response:{},isLoading:{type:Boolean}},setup(e){const t=e,n=ue([]),r=ue([]);function o(i,a){const f=[];for(let d=0;dt.response,async()=>{if(!t.response||t.response.length===0)return;const i=t.response.map(f=>f.id),a=o(i,50);try{const f={};await Promise.all(a.map(async d=>{var v,y,g;let h=[(g=(y=(v=t.response)==null?void 0:v[0])==null?void 0:y.lang)==null?void 0:g.toLowerCase(),"mul","en"];const m=`https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&ids=${d.join("|")}&props=labels|descriptions|claims&languages=${h.join(",")}&origin=*`,w=await(await fetch(m,{headers:{"User-Agent":"Wikidata Search (philippe.saade@wikimedia.de)"}})).json();Object.assign(f,w.entities||{})})),n.value=t.response.map(d=>{var y,g,x,L,I,N,T,F,M,Q,te,be,fe,de,$e,Ue,se,z;const h=f[d.id],m=((I=(L=(x=(g=(y=h==null?void 0:h.claims)==null?void 0:y.P18)==null?void 0:g[0])==null?void 0:x.mainsnak)==null?void 0:L.datavalue)==null?void 0:I.value)||null,_=((N=d.lang)==null?void 0:N.toLowerCase())||"en",w=m?`https://commons.wikimedia.org/wiki/Special:FilePath/${encodeURIComponent(m)}`:void 0,v=m?`https://commons.wikimedia.org/wiki/File:${encodeURIComponent(m.replace(/ /g,"_"))}`:void 0;return{...d,label:((F=(T=h==null?void 0:h.labels)==null?void 0:T[_])==null?void 0:F.value)||((Q=(M=h==null?void 0:h.labels)==null?void 0:M.mul)==null?void 0:Q.value)||((be=(te=h==null?void 0:h.labels)==null?void 0:te.en)==null?void 0:be.value)||"Unknown",description:((de=(fe=h==null?void 0:h.descriptions)==null?void 0:fe[_])==null?void 0:de.value)||((Ue=($e=h==null?void 0:h.descriptions)==null?void 0:$e.mul)==null?void 0:Ue.value)||((z=(se=h==null?void 0:h.descriptions)==null?void 0:se.en)==null?void 0:z.value)||"No description available",imageUrl:w,imagePageUrl:v,query:d.query}}),r.value=Array(n.value.length).fill("")}catch(f){console.error("Error fetching Wikidata info:",f)}},{immediate:!0});const l=async(i,a,f)=>{if(!n.value)return;const d=n.value[f].query??"";try{const h=await fetch(`/feedback?query=${encodeURIComponent(d)}&id=${i}&sentiment=${a}&index=${f}`,{method:"POST",headers:{"Content-Type":"application/json"}});h.status===200?r.value[f]="thanks":console.error("Feedback submission failed",h.status)}catch(h){console.error("Error sending feedback",h)}};return(i,a)=>{var f;return ye(),Ie("div",Cp,[i.isLoading?(ye(),Ie("div",Op)):(f=n.value)!=null&&f.length?(ye(!0),Ie(We,{key:1},as(n.value,(d,h)=>(ye(),Ie("div",{key:d.id,class:"p-4 m-2 rounded-lg bg-light-bg dark:bg-dark-bg border border-light-border dark:border-dark-border hover:shadow-lg hover:bg-light-hover dark:hover:bg-dark-hover transition cursor-pointer"},[A("a",{href:"https://www.wikidata.org/wiki/"+(d.id.startsWith("P")?"Property:"+d.id:d.id),target:"_blank",class:"flex items-start gap-6"},[A("div",Pp,[A("div",Ap,ut(d.label)+" ("+ut(d.id)+")",1),A("div",Rp,ut(d.description),1),A("div",Mp,"Similarity Score: "+ut(d.similarity_score),1),A("div",Fp,"Source: "+ut(d.source),1),A("div",Dp,[r.value[h]==="thanks"?(ye(),Ie("span",$p," ✅ Thanks for your feedback! ")):(ye(),Ie(We,{key:1},[A("button",{onClick:Xr(m=>l(d.id,"up",h),["prevent"]),class:"flex items-center gap-2 px-3 py-1 bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-200 rounded hover:bg-green-200 dark:hover:bg-green-800 transition"},[Ze(" 👍 "),jp],8,Up),A("button",{onClick:Xr(m=>l(d.id,"down",h),["prevent"]),class:"flex items-center gap-2 px-3 py-1 bg-red-100 dark:bg-red-900 text-red-700 dark:text-red-200 rounded hover:bg-red-200 dark:hover:bg-red-800 transition"},[Ze(" 👎 "),Wp],8,Hp)],64)),A("div",{class:"relative group ml-1 inline-flex items-center",tabindex:"0","aria-label":"Feedback info",onClick:a[0]||(a[0]=Xr(()=>{},["stop"]))},[he(Me(_t),{icon:"fluent:info-16-regular",class:"text-blue-600 dark:text-blue-400 cursor-pointer"}),Vp])])]),d.imageUrl?(ye(),Ie("div",Kp,[A("a",{href:d.imagePageUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"View this image on Wikimedia Commons"},[A("img",{class:"rounded-2xl max-h-32 shadow-md border border-light-border dark:border-dark-border",src:d.imageUrl,alt:d.label},null,8,Gp)],8,Bp),A("p",Yp,[A("a",{href:d.imagePageUrl,target:"_blank",rel:"noopener noreferrer",class:"underline"}," From Wikimedia Commons ",8,qp)])])):nn("",!0)],8,Np)]))),128)):nn("",!0)])}}}),Xp={class:"absolute z-10 bg-light-content dark:bg-dark-content w-screen h-screen overflow-auto"},Jp={class:"flex justify-end p-4"},Qp={class:"max-w-screen-lg mx-auto px-4 sm:px-8 md:px-12 space-y-12 pb-16"},zp=ca('
Wikidata Embedding Project Logo

Wikidata Vector Database

The Wikidata Vector Database, part of the Wikidata Embedding Project , stores semantic embeddings of Wikidata entities to enable context-aware search using vector similarity.


 

',3),Zp={key:0,class:"text-center py-8"},eg=A("div",{class:"inline-block animate-spin rounded-full h-10 w-10 border-b-2 border-blue-600"},null,-1),tg=A("p",{class:"mt-4 text-light-text dark:text-dark-text"},"Checking API access...",-1),ng=[eg,tg],rg={key:1,class:"flex flex-col sm:flex-row gap-4 items-center"},sg={class:"relative flex-grow"},og=["placeholder"],lg={key:2,class:"flex justify-center"},ig={class:"!mt-1 text-sm text-red-500"},ag=ca('

Help Us Improve

Share your thoughts and projects if you’re using the Wikidata vector database!

Take the Survey

 

Partners

 

Contributors

Philippe Saadé
Philippe Saadé

AI/ML Project Manager, WMDE

Robert Timm
Robert Timm

Senior Software Engineer, Wikibase Suite, WMDE

Jonathan Fraine
Jonathan Fraine

Co-Head of Software Development, CTO, WMDE

Andrew Tavis McAllister
Andrew Tavis McAllister

Data Analyst, WMDE

 

Resources

 

',5),cg=mt({__name:"Settings",emits:["close"],setup(e,{emit:t}){const n=t,r=ue(f()||""),o=ue(""),s=ue(!1),l=ue(!0),i=Ee(()=>!s.value&&(!l.value||f()));Or(async()=>{await d()});function a(){sessionStorage.setItem("api-secret",r.value)}function f(){const w=sessionStorage.getItem("api-secret");return w!=null&&w.length?w:null}async function d(){s.value=!0,o.value="";try{const w=await fetch("/item/query/?query=");l.value=w.status===401}catch{l.value=!0}finally{s.value=!1}}async function h(){o.value="";try{(await fetch("/item/query/?query=",{headers:{"x-api-secret":r.value}})).status===401?o.value="Invalid API secret. Please try again.":a()}catch{o.value="Network error. Please try again later."}}async function m(){await h(),o.value||n("close")}const _=ue("");return ue(""),ue(!1),ue(!1),ue(!1),Ee(()=>/\S+@\S+\.\S+/.test(_.value)),(w,v)=>(ye(),Ie("div",Xp,[A("div",Jp,[he(Me(_t),{class:vt(["text-3xl",{"text-light-disabled-text dark:text-dark-disabled-text":!i.value,"cursor-pointer text-light-text dark:text-dark-text hover:text-light-distinct-text dark:hover:text-dark-distinct-text transition-colors":i.value}]),icon:"fluent:dismiss-24-filled",onClick:v[0]||(v[0]=y=>i.value&&w.$emit("close"))},null,8,["class"])]),A("div",Qp,[zp,s.value?(ye(),Ie("div",Zp,ng)):l.value?(ye(),Ie("div",rg,[A("div",sg,[he(Me(_t),{class:vt(["absolute left-3 top-3 text-xl",{"text-light-text dark:text-dark-text":r.value.length>0}]),icon:"fluent:lock-closed-24-filled"},null,8,["class"]),rr(A("input",{"onUpdate:modelValue":v[1]||(v[1]=y=>r.value=y),type:"password",class:"w-full pl-10 pr-4 h-14 rounded-lg border border-light-distinct-text dark:border-dark-distinct-text bg-light-menu dark:bg-dark-menu text-light-text dark:text-dark-text focus:ring-2 focus:ring-blue-500 outline-none text-lg",placeholder:w.$t("enter-api-secret"),autocomplete:"off",onInput:a,onKeyup:ha(m,["enter"])},null,40,og),[[da,r.value]])]),A("button",{class:"px-8 py-3 bg-blue-600 text-white font-semibold rounded-lg hover:bg-blue-700 transition-colors text-lg",onClick:m}," Start ")])):(ye(),Ie("div",lg,[A("button",{class:"px-10 py-4 bg-blue-600 text-white font-semibold rounded-lg hover:bg-blue-700 transition-colors text-xl",onClick:v[2]||(v[2]=y=>w.$emit("close"))}," Start ")])),A("p",ig,ut(o.value)+" ",1),ag])]))}}),ug={class:"w-screen min-h-screen bg-light-content dark:bg-dark-content overflow-auto"},fg={class:"max-w-screen-2xl mx-auto px-4 sm:px-8 md:px-12 py-12 space-y-12"},dg=A("div",{class:"flex flex-col sm:flex-row items-center gap-6 text-center sm:text-left justify-center"},[A("a",{href:"https://www.wikidata.org/wiki/Wikidata:Embedding_Project",target:"_blank",class:"shrink-0"},[A("img",{src:"https://upload.wikimedia.org/wikipedia/commons/0/01/Wikidata_Embedding_Project_Logo.png",alt:"Wikidata Embedding Project Logo",class:"h-24 object-contain"})]),A("div",null,[A("h1",{class:"text-5xl font-bold py-2"}," Wikidata Vector Database ")])],-1),hg={class:"flex justify-center w-full"},mg={class:"flex flex-col w-full md:w-4/5 space-y-4"},pg={class:"flex flex-nowrap items-center gap-3"},gg={class:"relative flex-1 min-w-0 text-2xl rounded-lg bg-light-menu dark:bg-dark-menu elem-shadow-sm"},_g=["placeholder"],bg={class:"relative group inline-flex items-center shrink-0",tabindex:"0","aria-label":"How to search"},vg=A("div",{class:"absolute right-0 top-full mt-2 w-[28rem] max-w-[90vw] p-3 bg-light-menu dark:bg-dark-menu text-sm text-light-text dark:text-dark-text rounded shadow-lg z-20 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity pointer-events-none",role:"tooltip"},[A("p",{class:"font-semibold mb-2"},"How vector search works"),A("p",{class:"text-sm mb-1"},"What it does:"),A("ul",{class:"list-disc pl-5 space-y-1"},[A("li",null,"Explore Wikidata entities"),A("li",null,"Fuzzy search by meaning and context"),A("li",null,"Surface similar items")]),A("p",{class:"text-sm mt-2 mb-1"},"What it doesn't do:"),A("ul",{class:"list-disc pl-5 space-y-1"},[A("li",null,"Answer questions (Use results to investigate further)"),A("li",null,"Return complete lists (Use SPARQL for that)")]),A("p",{class:"text-sm mt-2 mb-1"},"Examples:"),A("ul",{class:"list-disc pl-5 space-y-1"},[A("li",null,[A("code",null,"English science-fiction novel")]),A("li",null,[A("code",null,"Q42")]),A("li",null,[A("code",null,"Who wrote Hitchhiker's Guide to the Galaxy?")])])],-1),yg={class:"flex items-center justify-between gap-4 flex-wrap text-sm text-light-text dark:text-dark-text"},Eg={class:"flex flex-col md:flex-row items-start md:items-center gap-4 text-sm text-light-text dark:text-dark-text"},xg=A("span",{class:"font-medium"},"Language:",-1),kg={class:"flex gap-4 items-center flex-wrap"},wg=["value"],Ig={key:0,class:"flex items-center gap-2 relative group"},Lg=["value"],Tg=A("div",{class:"absolute left-1/2 -translate-x-1/2 top-full mt-1 w-80 p-3 bg-light-menu dark:bg-dark-menu text-sm text-light-text dark:text-dark-text rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none"},[A("p",{class:"font-semibold mb-3"},"Language Selection Info"),A("p",{class:"mb-2"},[A("strong",null,"Radio buttons"),Ze(" represent languages with dedicated vector datasets. Selecting one queries vectors in that language. ")]),A("p",{class:"mb-2"},[A("strong",null,"Dropdown menu"),Ze(" shows other languages without dedicated vectors. Selecting one will translate your query to English and search the full vector database. ")]),A("p",null,[Ze(" The "),A("strong",null,"'ALL'"),Ze(" option queries the full vector database regardless of language. More languages will be added as dedicated vectors in future releases. ")])],-1),Sg={class:"flex items-center gap-2 relative group"},Cg=A("span",{class:"font-medium"},"Search type:",-1),Og={class:"inline-flex h-8 rounded-lg overflow-hidden border border-light-distinct-text dark:border-dark-distinct-text"},Ng=A("div",{class:"absolute left-1/2 -translate-x-1/2 top-full mt-1 w-80 p-3 bg-light-menu dark:bg-dark-menu text-sm text-light-text dark:text-dark-text rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none"},[A("p",{class:"font-semibold mb-2"},"Search Type Info"),A("p",null,[A("strong",null,"Items"),Ze(" searches Wikidata entities (QIDs), while "),A("strong",null,"Properties"),Ze(" searches Wikidata properties (PIDs).")])],-1),Pg={class:"flex items-center gap-2 relative group text-sm text-light-text dark:text-dark-text"},Ag=A("span",{class:"font-medium"},"Rerank:",-1),Rg=A("div",{class:"absolute left-1/2 -translate-x-1/2 top-full mt-1 w-80 p-3 bg-light-menu dark:bg-dark-menu text-sm text-light-text dark:text-dark-text rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none"},[A("p",{class:"font-semibold mb-2"},"Rerank Info"),A("p",null,"Rerank applies an extra relevance model to reorder top results, which can improve quality but increases response time.")],-1),Mg=A("p",{class:"text-sm text-light-text dark:text-dark-text"},[Ze(" ⚠️ This tool is in early testing, and results may be incomplete or inaccurate. Your queries are sent to a third-party service (JinaAI) for processing, and we store them for up to 90 days for quality improvements. We welcome your feedback! Please help us improve by filling out "),A("a",{href:"https://wikimedia.sslsurvey.de/Wikidata-Vector-DB-Feedback-Alpha-release",target:"_blank",class:"text-blue-600 dark:text-blue-400 hover:underline"}," our survey "),Ze(". ")],-1),Fg={key:0,class:"mt-0 text-sm text-red-500"},Dg={key:0,class:"flex justify-center w-full"},$g={class:"flex flex-col w-full md:w-4/5 space-y-7"},Ug={key:1,class:"flex justify-center w-full"},jg={class:"flex flex-col w-full md:w-4/5 space-y-5"},Hg=mt({__name:"ChatView",setup(e){const t=ue(""),n=ue(),r=ue(),o=ue(!1),s=ue(!1),l=ue(!0),i=ue("item"),a=ue(!1),f=ue([]),d=ue([]),h=ue("all");function m(){const w=sessionStorage.getItem("api-secret");return w!=null&&w.length?w:null}Or(async()=>{try{const v=await(await fetch("/languages")).json();f.value=["all",...v.vectordb_langs],d.value=v.other_langs,f.value.includes(h.value.toLowerCase())||(h.value="all")}catch(w){console.error("Failed to fetch languages",w)}});async function _(){n.value=void 0,r.value=void 0,o.value=!0;const w=m();let v=h.value.toLowerCase()||"all";try{const y=i.value==="property"?"/property/query":"/item/query",g=new URLSearchParams({query:t.value,lang:v,rerank:String(a.value)}),x=await fetch(`${y}/?${g.toString()}`,{headers:w?{"x-api-secret":w}:{}});if(x.status===401){l.value=!0,o.value=!1;return}const L=await x.json();(!v||v==="all")&&(v="en"),n.value=L.map(I=>({...I,id:I.QID??I.PID,query:t.value,lang:v}))}catch(y){o.value=!1,console.error(y),r.value="Sorry. Failed to retrieve response."}}return(w,v)=>(ye(),Ie("main",ug,[l.value?(ye(),no(cg,{key:0,onClose:v[0]||(v[0]=y=>l.value=!1)})):nn("",!0),he(Me(_t),{class:"text-4xl absolute right-4 top-4 cursor-pointer text-light-text dark:text-dark-text hover:text-light-distinct-text dark:hover:text-dark-distinct-text transition-colors",icon:"mdi:home",onClick:v[1]||(v[1]=y=>l.value=!0)}),A("div",fg,[dg,A("div",hg,[A("div",mg,[A("div",pg,[A("div",gg,[rr(A("input",{"onUpdate:modelValue":v[2]||(v[2]=y=>t.value=y),type:"text",class:"w-full pl-4 pr-24 bg-transparent rounded-lg h-12 placeholder:text-light-distinct-text dark:placeholder:text-dark-distinct-text text-light-text dark:text-dark-text",placeholder:w.$t("chat-prompt"),autocomplete:"off",onKeyup:v[3]||(v[3]=ha(y=>t.value.length>0?_():{},["enter"])),onFocus:v[4]||(v[4]=y=>s.value=!0),onBlur:v[5]||(v[5]=y=>s.value=!1)},null,40,_g),[[da,t.value]]),he(Me(_t),{class:vt(["absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer",{"text-light-text dark:text-dark-text":s.value&&t.value.length===0,"text-light-text dark:text-dark-text hover:text-light-distinct-text dark:hover:text-dark-distinct-text":s.value&&t.value.length>0,"text-light-distinct-text dark:text-dark-distinct-text":!s.value}]),icon:"fluent:send-24-filled",size:"2em",onClick:v[6]||(v[6]=y=>t.value.length>0?_():{})},null,8,["class"])]),A("div",bg,[he(Me(_t),{icon:"fluent:info-16-regular",class:"text-blue-600 dark:text-blue-400 cursor-pointer",size:"2.5em"}),vg])]),A("div",yg,[A("div",Eg,[xg,A("div",kg,[(ye(!0),Ie(We,null,as(f.value,y=>(ye(),Ie("label",{key:y,class:"flex items-center gap-1 cursor-pointer px-2 py-1 border rounded-lg hover:bg-light-menu dark:hover:bg-dark-menu transition-colors"},[rr(A("input",{type:"radio",value:y,"onUpdate:modelValue":v[7]||(v[7]=g=>h.value=g),class:"accent-blue-600"},null,8,wg),[[xf,h.value]]),Ze(" "+ut(y.toUpperCase()),1)]))),128))]),d.value.length>0?(ye(),Ie("div",Ig,[rr(A("select",{"onUpdate:modelValue":v[8]||(v[8]=y=>h.value=y),class:"rounded-lg border border-light-distinct-text dark:border-dark-distinct-text bg-light-menu dark:bg-dark-menu text-light-text dark:text-dark-text h-8 px-2"},[(ye(!0),Ie(We,null,as(d.value,y=>(ye(),Ie("option",{key:y,value:y},ut(y.toUpperCase()),9,Lg))),128))],512),[[kf,h.value]]),A("div",null,[he(Me(_t),{icon:"fluent:info-16-regular",class:"text-blue-600 dark:text-blue-400 cursor-pointer ml-1"}),Tg])])):nn("",!0)]),A("div",Sg,[Cg,A("div",Og,[A("button",{class:vt(["px-3 h-full flex items-center text-base font-medium",i.value==="item"?"bg-light-menu dark:bg-dark-menu text-light-text dark:text-dark-text":"bg-transparent text-light-distinct-text dark:text-dark-distinct-text"]),onClick:v[9]||(v[9]=y=>i.value="item"),type:"button"}," Items ",2),A("button",{class:vt(["px-3 h-full flex items-center text-base font-medium",i.value==="property"?"bg-light-menu dark:bg-dark-menu text-light-text dark:text-dark-text":"bg-transparent text-light-distinct-text dark:text-dark-distinct-text"]),onClick:v[10]||(v[10]=y=>i.value="property"),type:"button"}," Properties ",2)]),A("div",null,[he(Me(_t),{icon:"fluent:info-16-regular",class:"text-blue-600 dark:text-blue-400 cursor-pointer ml-1"}),Ng])])]),A("div",Pg,[Ag,A("button",{class:vt(["inline-flex h-8 items-center rounded-lg border px-3 font-medium transition-colors",a.value?"border-blue-600 bg-blue-600 text-white":"border-light-distinct-text dark:border-dark-distinct-text bg-transparent text-light-distinct-text dark:text-dark-distinct-text hover:bg-light-menu dark:hover:bg-dark-menu"]),onClick:v[11]||(v[11]=y=>a.value=!a.value),type:"button"},ut(a.value?"ON":"OFF"),3),A("div",null,[he(Me(_t),{icon:"fluent:info-16-regular",class:"text-blue-600 dark:text-blue-400 cursor-pointer ml-1"}),Rg])]),Mg,r.value&&r.value.length?(ye(),Ie("p",Fg,ut(r.value),1)):nn("",!0)])]),n.value?(ye(),Ie("div",Dg,[A("div",$g,[he(di,{response:n.value,isLoading:!1},null,8,["response"])])])):o.value&&!n.value?(ye(),Ie("div",Ug,[A("div",jg,[he(di,{isLoading:!0})])])):nn("",!0)])]))}}),Wg=Tm({history:Kh("/"),routes:[{path:"/",name:"chat",component:Hg}]}),Vg=gh({locale:window.navigator.language,fallbackLocale:"de",messages:{en:{"chat-prompt":"Search Wikidata...","no-response-message":"Sorry, but no valid response was returned for your question. Please try rephrasing it.",source:"Source","enter-api-secret":"Enter your API secret"},de:{"chat-prompt":"Suche in Wikidata...","no-response-message":"Leider wurde auf Ihre Frage keine gültige Antwort zurückgegeben. Bitte versuchen Sie es umzuformulieren.",source:"Quelle","enter-api-secret":"API Passwort eingeben"}}}),yo=Cf(Cm);yo.use(Vg);yo.use(Wg);yo.mount("#app"); diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 768af8e..ed9ed9c 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -5,7 +5,7 @@ Wikidata Search - + diff --git a/frontend/src/views/ChatView.vue b/frontend/src/views/ChatView.vue index ce1445b..27f37f6 100644 --- a/frontend/src/views/ChatView.vue +++ b/frontend/src/views/ChatView.vue @@ -104,6 +104,7 @@
+ Language:
@@ -136,6 +137,7 @@ /> -
+
+ Search type:
+ +
+ + +
+ +
+ Rerank: + + +
+ + +
+
+

⚠️ This tool is in early testing, and results may be incomplete or inaccurate. Your queries are sent to a third-party service (JinaAI) for processing, and we store them for up to 90 days for quality improvements. We welcome your feedback! Please help us improve by filling out @@ -227,11 +273,12 @@ const displayResponse = ref(false) const inputFocused = ref(false) const showSettings = ref(true) const searchType = ref<'item' | 'property'>('item') +const useRerank = ref(false) // Languages const vectordbLangs = ref([]) const otherLanguages = ref([]) -const selectedLanguage = ref('All') +const selectedLanguage = ref('all') function apiSecret() { const secret = sessionStorage.getItem('api-secret') @@ -246,7 +293,7 @@ onMounted(async () => { vectordbLangs.value = ['all', ...data.vectordb_langs] otherLanguages.value = data.other_langs if (!vectordbLangs.value.includes(selectedLanguage.value.toLowerCase())) { - selectedLanguage.value = 'ALL' + selectedLanguage.value = 'all' } } catch (e) { console.error('Failed to fetch languages', e) @@ -263,8 +310,13 @@ async function search() { try { const base = searchType.value === 'property' ? '/property/query' : '/item/query' + const params = new URLSearchParams({ + query: inputText.value, + lang, + rerank: String(useRerank.value), + }) const fetchResult = await fetch( - `${base}/?query=${encodeURIComponent(inputText.value)}&rerank=True&lang=${lang}`, + `${base}/?${params.toString()}`, { headers: secret ? { 'x-api-secret': secret } : {} } diff --git a/pyproject.toml b/pyproject.toml index d46f31c..51f803a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ dependencies = [ "pandas>=2.3.3", "plotly>=6.3.1", "pymysql>=1.1.2", + "requests>=2.32.0", "setuptools>=80.9.0", "slowapi>=0.1.9", "sqlalchemy>=2.0.43", diff --git a/requirements.txt b/requirements.txt index 3e29272..604e3d8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -212,6 +212,8 @@ pygments==2.19.2 # via rich pymongo==4.14.1 # via astrapy +pymysql==1.1.2 + # via wikidatasearch python-dateutil==2.9.0.post0 # via # pandas @@ -236,6 +238,7 @@ requests==2.32.5 # langchain-community # langsmith # requests-toolbelt + # wikidatasearch requests-toolbelt==1.0.0 # via langsmith rich==14.2.0 diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..545a9fc --- /dev/null +++ b/tests/README.md @@ -0,0 +1,75 @@ +# Tests + +This folder contains backend tests split into three layers: + +- **Unit (`tests/unit`)**: Fast isolated tests with stubs/mocks. Use these for quick local checks while coding. +- **Integration (`tests/integration`)**: Route-level tests against a running local API server. +- **Analysis/Benchmark (`tests/analysis`)**: Slower split-analysis style checks for retrieval behavior. + +## What Is Covered + +### Unit (`tests/unit`) + +- Route validation behavior for `item`, `property`, and `similarity` handlers. +- Search-call argument wiring (filters, lowercased language, `ks_K` behavior). +- Error-path checks (`422` cases like invalid `instanceof`, too many IDs, disabled vectors). +- Helper logic in search services (RRF merge behavior, dedup behavior, keyword cleaning). + +### Integration (`tests/integration`) + +- Local HTTP endpoint contracts (status codes, payload shape, result limits). +- Route behavior for `/languages`, `/item/query/`, `/property/query/`, `/similarity-score/`. +- Validation responses for invalid request shapes (empty query, oversized `K`, etc.). +- Split-analysis style API checks (`lang=all` vs language-specific behavior). + +### Analysis/Benchmark (`tests/analysis`) + +- V1 vs V2 runtime sampling across multilingual query sets. +- Top-N similarity proxy comparisons. +- Language exposure metrics (raw similarity + RRF-based exposure). +- Expanded-`K` recall checks (whether larger `K` recovers V1-only IDs). + +## Setup + +From project root: + +```bash +uv sync --locked +``` + +## Common Commands + +Run recommended fast suite (unit + integration): + +```bash +uv run pytest -q tests/unit tests/integration +``` + +Run unit tests only: + +```bash +uv run pytest -q tests/unit +``` + +Run integration tests only: + +```bash +uv run pytest -q tests/integration -m integration -rs +``` + +Run analysis/benchmark tests only: + +```bash +uv run pytest -q tests/analysis/test_split_benchmark.py -m "analysis and benchmark" -rs +``` + +Run all tests: + +```bash +uv run pytest -q tests +``` + +## Notes + +- Integration tests are local-only and expect the API at `http://127.0.0.1:8080`. +- Analysis/benchmark tests require valid Astra/Jina keys in `.env` or `tests/.env`. diff --git a/tests/analysis/test_split_benchmark.py b/tests/analysis/test_split_benchmark.py new file mode 100644 index 0000000..d0d9d77 --- /dev/null +++ b/tests/analysis/test_split_benchmark.py @@ -0,0 +1,501 @@ +"""Benchmark analysis tests for language sharding vector search behavior.""" + +import statistics +import sys +import time +from concurrent.futures import ThreadPoolExecutor +from pathlib import Path + +import pytest + + +pytestmark = [pytest.mark.analysis, pytest.mark.benchmark, pytest.mark.slow] + +LANGS = ["en", "fr", "de", "ar"] +SEARCH_CACHE = {} +BASE_K = 50 +EXPANDED_K = 100 +COMPARE_TOP_N = 10 +TOP_N_ACCURACY = 5 +TOP_N_EXPOSURE = 20 +MIN_EXPECTED_RECOVERY = 0.0 + +QUERIES_BY_LANG = { + "en": [ + "What is the capital of France?", + "Who is the president of the United States?", + "What is the largest mammal?", + "Who won the FIFA World Cup in 2018?", + "What is the chemical formula for water?", + "Who wrote The Hitchhiker's Guide to the Galaxy?", + "What is the tallest mountain in the world?", + "What is the currency of Japan?", + ], + "fr": [ + "Quelle est la capitale de la France ?", + "Qui est le president des Etats-Unis ?", + "Quel est le plus grand mammifere ?", + "Qui a gagne la Coupe du monde 2018 ?", + "Quelle est la formule chimique de l'eau ?", + "Qui a ecrit Le Guide du voyageur galactique ?", + "Quelle est la plus haute montagne du monde ?", + "Quelle est la monnaie du Japon ?", + ], + "de": [ + "Was ist die Hauptstadt von Frankreich?", + "Wer ist der Prasident der Vereinigten Staaten?", + "Was ist das grosste Saugetier?", + "Wer hat die Fussball-Weltmeisterschaft 2018 gewonnen?", + "Was ist die chemische Formel von Wasser?", + "Wer schrieb Per Anhalter durch die Galaxis?", + "Was ist der hochste Berg der Welt?", + "Was ist die Wahrung Japans?", + ], + "ar": [ + "ما هي عاصمة فرنسا؟", + "من هو رئيس الولايات المتحدة؟", + "ما هو اكبر حيوان ثديي؟", + "من فاز بكاس العالم 2018؟", + "ما هي الصيغة الكيميائية للماء؟", + "من كتب دليل المسافر إلى المجرة؟", + "ما هو اعلى جبل في العالم؟", + "ما هي عملة اليابان؟", + ], +} + + +def _read_dotenv(path: Path) -> dict[str, str]: + """Read key-value pairs from a dotenv file.""" + data: dict[str, str] = {} + if not path.exists(): + return data + for line in path.read_text(encoding="utf-8").splitlines(): + stripped = line.strip() + if not stripped or stripped.startswith("#") or "=" not in stripped: + continue + key, value = stripped.split("=", 1) + data[key.strip()] = value.strip().strip('"').strip("'") + return data + + +def _load_api_keys() -> dict[str, str]: + """Load and validate API keys required for benchmark execution.""" + root = Path(__file__).resolve().parents[2] + merged = {} + merged.update(_read_dotenv(root / ".env")) + merged.update(_read_dotenv(root / "tests" / ".env")) + + required = [ + "ASTRA_DB_APPLICATION_TOKEN", + "ASTRA_DB_API_ENDPOINT", + "ASTRA_DB_COLLECTION", + "JINA_API_KEY", + ] + missing = [key for key in required if not merged.get(key)] + if missing: + pytest.skip( + "Missing required keys in .env/tests/.env for benchmark: " + ", ".join(missing) + ) + return merged + + +def _import_search_classes(): + """Import search classes or skip when dependencies are missing.""" + root = Path(__file__).resolve().parents[2] + if str(root) not in sys.path: + sys.path.insert(0, str(root)) + + try: + from wikidatasearch.services.search.HybridSearch import HybridSearch + from wikidatasearch.services.search.VectorSearch import VectorSearch + except ModuleNotFoundError as exc: + pytest.skip( + f"Missing Python module '{exc.name}'. Install dependencies before running benchmark tests." + ) + + return HybridSearch, VectorSearch + + +def _run_with_retry(func, *args, retries=3, backoff_s=0.5, measure_time=True, **kwargs): + """Execute a callable with retry and optional runtime measurement.""" + last_error = None + for attempt in range(retries): + start = time.time() if measure_time else None + try: + result = func(*args, **kwargs) + if measure_time: + return result, time.time() - start + return result + except Exception as exc: + last_error = exc + if attempt == retries - 1: + raise + time.sleep(backoff_s * (attempt + 1)) + raise last_error + + +def _make_search(VectorSearch, api_keys, lang=None, max_k=50): + """Get or create a cached vector search instance.""" + key = (lang, max_k) + if key not in SEARCH_CACHE: + SEARCH_CACHE[key] = VectorSearch( + api_keys=api_keys, + collection=api_keys["ASTRA_DB_COLLECTION"], + lang=lang, + max_K=max_k, + ) + return SEARCH_CACHE[key] + + +def _timed_vdb_search(vdb, lang, query, embedding, K, search_filter): + """Run one shard search and return rows plus runtime metadata.""" + start = time.time() + rows = vdb.find( + filter=search_filter, + sort={"$vector": embedding}, + projection={"metadata": 1}, + limit=K, + include_similarity=True, + ) + duration = time.time() - start + rows = [{**row, "_shard_lang": lang} for row in rows] + return {"lang": lang, "results": rows, "duration": duration} + + +def _v1_vector_search(VectorSearch, api_keys, query, K=50, max_k=None): + """Run all-in-one database vector search across all languages.""" + search = _make_search(VectorSearch, api_keys, max_k=max_k or K) + embedding, _ = search.calculate_embedding(query, lang="all") + if embedding is None: + return [] + return search.find( + filter={"metadata.IsItem": True}, + sort={"$vector": embedding}, + projection={"metadata": 1}, + limit=K, + include_similarity=True, + ) + + +def _v2_vector_search(VectorSearch, api_keys, query, langs=None, K=50, max_k=None, include_thread_times=False): + """Run sharded-language vector search across all languages.""" + langs = langs or LANGS + max_k = max_k or K + searches = {lang: _make_search(VectorSearch, api_keys, lang=lang, max_k=max_k) for lang in langs} + embedding = next(iter(searches.values())).embedding_model.embed_query(query) + search_filter = {"metadata.IsItem": True} + + with ThreadPoolExecutor(max_workers=len(langs)) as ex: + futures = [ + ex.submit(_timed_vdb_search, searches[lang], lang, query, embedding, K, search_filter) + for lang in langs + ] + + payloads = [future.result() for future in futures] + results = {payload["lang"]: payload["results"] for payload in payloads} + + if include_thread_times: + return { + "results": results, + "thread_runtimes": {payload["lang"]: payload["duration"] for payload in payloads}, + } + return results + + +def _v1_vector_search_lang(VectorSearch, api_keys, query, lang="en", K=50, max_k=None): + """Run all-in-one database vector search for one language.""" + search = _make_search(VectorSearch, api_keys, max_k=max_k or K) + embedding, _ = search.calculate_embedding(query, lang=lang) + if embedding is None: + return [] + return search.find( + filter={"metadata.IsItem": True, "metadata.Language": lang}, + sort={"$vector": embedding}, + projection={"metadata": 1}, + limit=K, + include_similarity=True, + ) + + +def _v2_vector_search_lang(VectorSearch, api_keys, query, lang="en", K=50, max_k=None): + """Run sharded-language vector search for one language.""" + search = _make_search(VectorSearch, api_keys, lang=lang, max_k=max_k or K) + embedding, _ = search.calculate_embedding(query, lang=lang) + if embedding is None: + return [] + rows = search.find( + filter={"metadata.IsItem": True}, + sort={"$vector": embedding}, + projection={"metadata": 1}, + limit=K, + include_similarity=True, + ) + return [{**row, "_shard_lang": lang} for row in rows] + + +def _entity_id(item): + """Extract a stable entity ID from a search result.""" + metadata = item.get("metadata", {}) + return ( + item.get("QID") + or item.get("PID") + or metadata.get("QID") + or metadata.get("PID") + or metadata.get("_id") + or item.get("_id") + ) + + +def _normalize_results(VectorSearch, raw_results, K=50): + """Normalize and remove duplicates from vector search results.""" + deduped = VectorSearch.remove_duplicates(raw_results) + return deduped[:K] + + +def _average_similarity(results, top_n=5): + """Compute mean similarity for the top-N results.""" + rows = results[:top_n] + if not rows: + return 0.0 + return sum(row["similarity_score"] for row in rows) / len(rows) + + +def _average_dicts(dicts, keys=None): + """Compute key-wise averages over a list of dictionaries.""" + if not dicts: + return {} + keys = keys or dicts[0].keys() + return {key: sum(d[key] for d in dicts) / len(dicts) for key in keys} + + +def _lang_stats_raw(results): + """Estimate language exposure ratios from raw search results (before merging).""" + rows = sorted(results, key=lambda x: x.get("$similarity", 0.0), reverse=True)[:TOP_N_EXPOSURE] + if not rows: + return {lang: 0.0 for lang in LANGS} + denom = float(len(rows)) + stats = {} + for lang in LANGS: + count = 0 + for row in rows: + row_lang = row.get("metadata", {}).get("Language") or row.get("_shard_lang") + if row_lang == lang: + count += 1 + stats[lang] = count / denom + return stats + + +def _lang_stats_rrf(results): + """Estimate language exposure ratios from merged results with RRF.""" + rows = sorted(results, key=lambda x: x["similarity_score"], reverse=True)[:TOP_N_EXPOSURE] + if not rows: + return {lang: 0.0 for lang in LANGS} + denom = float(len(rows)) + return {lang: sum(1 for row in rows if lang in row.get("source", "")) / denom for lang in LANGS} + + +@pytest.fixture(scope="module") +def split_benchmark_payload(): + """Build benchmark payloads for runtime, quality, and recall assertions.""" + HybridSearch, VectorSearch = _import_search_classes() + api_keys = _load_api_keys() + + all_query_rows = [ + {"query_lang": lang, "query": query} + for lang in LANGS + for query in QUERIES_BY_LANG[lang] + ] + + v1_results, v2_results = [], [] + runtime_v1, runtime_v2 = [], [] + v2_thread_runtimes = [] + query_lang_runtime_v1 = {lang: [] for lang in LANGS} + query_lang_runtime_v2 = {lang: [] for lang in LANGS} + query_lang_thread_runtimes = {lang: {shard: [] for shard in LANGS} for lang in LANGS} + + for row in all_query_rows: + query = row["query"] + query_lang = row["query_lang"] + + result, duration = _run_with_retry(_v1_vector_search, VectorSearch, api_keys, query, K=BASE_K) + v1_results.append(result) + runtime_v1.append(duration) + query_lang_runtime_v1[query_lang].append(duration) + + payload, duration = _run_with_retry( + _v2_vector_search, + VectorSearch, + api_keys, + query, + langs=LANGS, + K=BASE_K, + include_thread_times=True, + ) + v2_results.append(payload["results"]) + runtime_v2.append(duration) + v2_thread_runtimes.append(payload["thread_runtimes"]) + query_lang_runtime_v2[query_lang].append(duration) + for shard_lang, shard_duration in payload["thread_runtimes"].items(): + query_lang_thread_runtimes[query_lang][shard_lang].append(shard_duration) + + lang_runtime_v1 = {lang: [] for lang in LANGS} + lang_runtime_v2 = {lang: [] for lang in LANGS} + for lang in LANGS: + for query in QUERIES_BY_LANG[lang]: + _, duration = _run_with_retry(_v1_vector_search_lang, VectorSearch, api_keys, query, lang=lang, K=BASE_K) + lang_runtime_v1[lang].append(duration) + _, duration = _run_with_retry(_v2_vector_search_lang, VectorSearch, api_keys, query, lang=lang, K=BASE_K) + lang_runtime_v2[lang].append(duration) + + v1_norm = [_normalize_results(VectorSearch, results, K=BASE_K) for results in v1_results] + v2_flat = [[row for per_lang in per_query.values() for row in per_lang] for per_query in v2_results] + v2_norm = [_normalize_results(VectorSearch, results, K=BASE_K) for results in v2_flat] + accuracies_v1 = [_average_similarity(result, top_n=TOP_N_ACCURACY) for result in v1_norm] + accuracies_v2 = [_average_similarity(result, top_n=TOP_N_ACCURACY) for result in v2_norm] + + v2_lang_stats_raw = [_lang_stats_raw(results) for results in v2_flat] + v1_lang_stats_raw = [_lang_stats_raw(results) for results in v1_results] + v2_lang_stats_raw_avg = _average_dicts(v2_lang_stats_raw, keys=LANGS) + v1_lang_stats_raw_avg = _average_dicts(v1_lang_stats_raw, keys=LANGS) + + v2_rrf_inputs = [ + [(LANGS[i], _normalize_results(VectorSearch, per_query[LANGS[i]], K=BASE_K)) for i in range(len(LANGS))] + for per_query in v2_results + ] + v2_rrf_results = [HybridSearch.reciprocal_rank_fusion(inputs) for inputs in v2_rrf_inputs] + v2_lang_stats_rrf_avg = _average_dicts([_lang_stats_rrf(results) for results in v2_rrf_results], keys=LANGS) + + v1_rrf_inputs = [ + [ + ( + lang, + _normalize_results( + VectorSearch, + [row for row in per_query if row.get("metadata", {}).get("Language") == lang], + K=BASE_K, + ), + ) + for lang in LANGS + ] + for per_query in v1_results + ] + v1_rrf_results = [HybridSearch.reciprocal_rank_fusion(inputs) for inputs in v1_rrf_inputs] + v1_lang_stats_rrf_avg = _average_dicts([_lang_stats_rrf(results) for results in v1_rrf_results], keys=LANGS) + + recall_rows = [] + for lang in LANGS: + for query in QUERIES_BY_LANG[lang]: + v1_raw = _run_with_retry( + _v1_vector_search_lang, + VectorSearch, + api_keys, + query, + lang=lang, + K=BASE_K, + max_k=BASE_K, + measure_time=False, + ) + v2_raw = _run_with_retry( + _v2_vector_search_lang, + VectorSearch, + api_keys, + query, + lang=lang, + K=BASE_K, + max_k=BASE_K, + measure_time=False, + ) + v2_expanded_raw = _run_with_retry( + _v2_vector_search_lang, + VectorSearch, + api_keys, + query, + lang=lang, + K=EXPANDED_K, + max_k=EXPANDED_K, + measure_time=False, + ) + + v1_top = _normalize_results(VectorSearch, v1_raw, K=BASE_K)[:COMPARE_TOP_N] + v2_top = _normalize_results(VectorSearch, v2_raw, K=BASE_K)[:COMPARE_TOP_N] + v2_expanded = _normalize_results(VectorSearch, v2_expanded_raw, K=EXPANDED_K) + + v1_ids = {_entity_id(row) for row in v1_top if _entity_id(row)} + v2_ids = {_entity_id(row) for row in v2_top if _entity_id(row)} + v2_expanded_ids = {_entity_id(row) for row in v2_expanded if _entity_id(row)} + + v1_only = sorted(v1_ids - v2_ids) + recovered = sorted([qid for qid in v1_only if qid in v2_expanded_ids]) + recovery_rate = (len(recovered) / len(v1_only)) if v1_only else 1.0 + + recall_rows.append( + { + "lang": lang, + "query": query, + "v1_avg_top10": _average_similarity(v1_top, top_n=COMPARE_TOP_N), + "v2_avg_top10": _average_similarity(v2_top, top_n=COMPARE_TOP_N), + "v1_only_count": len(v1_only), + "recovered_count": len(recovered), + "recovery_rate": recovery_rate, + } + ) + + return { + "runtime_v1": runtime_v1, + "runtime_v2": runtime_v2, + "v2_thread_runtimes": v2_thread_runtimes, + "query_lang_runtime_v1": query_lang_runtime_v1, + "query_lang_runtime_v2": query_lang_runtime_v2, + "query_lang_thread_runtimes": query_lang_thread_runtimes, + "lang_runtime_v1": lang_runtime_v1, + "lang_runtime_v2": lang_runtime_v2, + "accuracies_v1": accuracies_v1, + "accuracies_v2": accuracies_v2, + "v1_lang_stats_raw_avg": v1_lang_stats_raw_avg, + "v2_lang_stats_raw_avg": v2_lang_stats_raw_avg, + "v1_lang_stats_rrf_avg": v1_lang_stats_rrf_avg, + "v2_lang_stats_rrf_avg": v2_lang_stats_rrf_avg, + "recall_rows": recall_rows, + } + + +def test_split_benchmark_runtime_and_precision(split_benchmark_payload): + """Validate runtime and similarity results are present and as expected.""" + payload = split_benchmark_payload + assert payload["runtime_v1"] and payload["runtime_v2"] + assert statistics.mean(payload["runtime_v1"]) > 0.0 + assert statistics.mean(payload["runtime_v2"]) > 0.0 + assert payload["accuracies_v1"] and payload["accuracies_v2"] + assert all(score >= 0.0 for score in payload["accuracies_v1"]) + assert all(score >= 0.0 for score in payload["accuracies_v2"]) + for lang in LANGS: + assert payload["query_lang_runtime_v1"][lang] + assert payload["query_lang_runtime_v2"][lang] + assert payload["lang_runtime_v1"][lang] + assert payload["lang_runtime_v2"][lang] + + +def test_split_benchmark_exposure_metrics(split_benchmark_payload): + """Validate exposure metrics stay within expected bounds.""" + payload = split_benchmark_payload + for key in [ + "v1_lang_stats_raw_avg", + "v2_lang_stats_raw_avg", + "v1_lang_stats_rrf_avg", + "v2_lang_stats_rrf_avg", + ]: + stats = payload[key] + assert set(stats.keys()) == set(LANGS) + assert all(0.0 <= value <= 1.0 for value in stats.values()) + + +def test_split_benchmark_expanded_recall(split_benchmark_payload): + """Validate expanded-k recall recovery stays above threshold.""" + rows = split_benchmark_payload["recall_rows"] + assert rows + for row in rows: + assert row["v1_only_count"] >= 0 + assert row["recovered_count"] >= 0 + assert 0.0 <= row["recovery_rate"] <= 1.0 + avg_recovery = statistics.mean(row["recovery_rate"] for row in rows) + assert avg_recovery >= MIN_EXPECTED_RECOVERY diff --git a/tests/integration/test_live_routes.py b/tests/integration/test_live_routes.py new file mode 100644 index 0000000..b850a1a --- /dev/null +++ b/tests/integration/test_live_routes.py @@ -0,0 +1,227 @@ +"""Live integration tests against the local FastAPI service.""" + +import json +from urllib.error import HTTPError, URLError +from urllib.parse import urlencode, urlparse +from urllib.request import Request, urlopen + +import pytest + + +pytestmark = pytest.mark.integration +LOCAL_BASE_URL = "http://127.0.0.1:8080" + + +def _api_get(path: str, params: dict | None = None, expected_status: int | None = 200) -> dict: + """Submit a GET request to the local API and return parsed response data.""" + base_url = LOCAL_BASE_URL + query = f"?{urlencode(params or {}, doseq=True)}" if params else "" + req = Request( + f"{base_url}{path}{query}", + method="GET", + headers={ + "User-Agent": "Pytest Integration Suite/1.0 (integration-tests@example.org)", + "Accept": "application/json", + }, + ) + + try: + with urlopen(req, timeout=60) as res: + status = res.status + body_bytes = res.read() + headers = dict(res.headers.items()) + except HTTPError as e: + status = e.code + body_bytes = e.read() + headers = dict(e.headers.items()) if e.headers else {} + except URLError as e: + pytest.fail(f"Local API is unreachable at {base_url}: {e}") + + body_text = body_bytes.decode("utf-8", errors="replace") + try: + payload = json.loads(body_text) + except json.JSONDecodeError: + payload = body_text + + if expected_status is not None: + assert status == expected_status, f"{path} expected {expected_status}, got {status}: {payload}" + + return {"status": status, "payload": payload, "headers": headers} + + +def _ids(rows: list[dict]) -> set[str]: + """Collect entity IDs from API response.""" + return {row.get("QID") or row.get("PID") for row in rows if isinstance(row, dict)} + + +def _scores_non_increasing(rows: list[dict]) -> bool: + """Check that similarity scores are sorted in descending order.""" + scores = [row.get("similarity_score", 0.0) for row in rows] + return all(left >= right for left, right in zip(scores, scores[1:])) + + +def test_root_returns_html(): + """Validate home root returns html.""" + result = _api_get("/", expected_status=200) + content_type = result["headers"].get("Content-Type") or result["headers"].get("content-type", "") + assert "text/html" in content_type + + +def test_languages_contract(): + """Validate languages contract.""" + result = _api_get("/languages", expected_status=200) + payload = result["payload"] + + assert isinstance(payload, dict) + assert set(payload.keys()) == {"vectordb_langs", "other_langs"} + assert "all" not in set(payload["vectordb_langs"]) + + +def test_item_query_contract_and_limit(): + """Validate response and limit for item query route.""" + k = 5 + result = _api_get( + "/item/query/", + params={"query": "Douglas Adams", "lang": "all", "K": k, "rerank": False}, + expected_status=200, + ) + rows = result["payload"] + + assert isinstance(rows, list) + assert len(rows) <= k + assert all("QID" in row for row in rows) + assert all("similarity_score" in row for row in rows) + + +def test_property_query_contract_and_limit(): + """Validate response and limit for property query route.""" + k = 5 + result = _api_get( + "/property/query/", + params={"query": "instance of", "lang": "all", "K": k, "rerank": False}, + expected_status=200, + ) + rows = result["payload"] + + assert isinstance(rows, list) + assert len(rows) <= k + assert all("PID" in row for row in rows) + assert all("similarity_score" in row for row in rows) + + +def test_similarity_score_mixed_ids_contract(): + """Validate mixed PIDs and QIDs response with similarity score route.""" + qid = "Q42,P31,Q5" + result = _api_get( + "/similarity-score/", + params={"query": "capital of France", "qid": qid, "lang": "all"}, + expected_status=200, + ) + rows = result["payload"] + requested = {value.strip() for value in qid.split(",")} + + assert isinstance(rows, list) + assert _ids(rows).issubset(requested) + assert all(("QID" in row) ^ ("PID" in row) for row in rows) + assert all("similarity_score" in row for row in rows) + assert _scores_non_increasing(rows) + + +def test_return_vectors_for_item_property_and_similarity(): + """Validate vector payloads are returned when return_vectors=true.""" + item = _api_get( + "/item/query/", + params={"query": "Douglas Adams", "return_vectors": True}, + expected_status=200, + ) + prop = _api_get( + "/property/query/", + params={"query": "instance of", "return_vectors": True}, + expected_status=200, + ) + sim = _api_get( + "/similarity-score/", + params={"query": "capital of France", "qid": "Q42", "return_vectors": True}, + expected_status=200, + ) + + for result in (item, prop, sim): + rows = result["payload"] + assert isinstance(rows, list) + if rows: + assert all("vector" in row for row in rows) + assert all(isinstance(row["vector"], list) for row in rows) + + +def test_similarity_score_rejects_more_than_100_ids(): + """Validate ID limit with more than 100 ids for similarity score route.""" + many_ids = ",".join(f"Q{i}" for i in range(1, 105)) + result = _api_get( + "/similarity-score/", + params={"query": "test query", "qid": many_ids, "lang": "all"}, + expected_status=422, + ) + payload = result["payload"] + + assert isinstance(payload, dict) + assert "detail" in payload + + +def test_item_query_rejects_empty_query(): + """Validate rejection of empty query for item query route.""" + result = _api_get( + "/item/query/", + params={"query": "", "lang": "all", "K": 5}, + expected_status=422, + ) + assert result["status"] == 422 + + +def test_property_query_rejects_empty_query(): + """Validate rejection of empty query for property query route.""" + result = _api_get( + "/property/query/", + params={"query": "", "lang": "all", "K": 5}, + expected_status=422, + ) + assert result["status"] == 422 + + +def test_similarity_score_rejects_empty_query(): + """Validate rejection of empty query for similarity score route.""" + result = _api_get( + "/similarity-score/", + params={"query": "", "qid": "Q42", "lang": "all"}, + expected_status=422, + ) + assert result["status"] == 422 + + +def test_similarity_score_rejects_missing_qid(): + """Validate rejection of missing qid for similarity score route.""" + result = _api_get( + "/similarity-score/", + params={"query": "capital of France", "lang": "all"}, + expected_status=422, + ) + assert result["status"] == 422 + + +def test_item_query_rejects_k_too_large(): + """Validate K limit for item query route.""" + result = _api_get( + "/item/query/", + params={"query": "Douglas Adams", "lang": "all", "K": 9999}, + expected_status=422, + ) + assert result["status"] == 422 + + +def test_property_query_rejects_k_too_large(): + """Validate K limit for property query route.""" + result = _api_get( + "/property/query/", + params={"query": "instance of", "lang": "all", "K": 9999}, + expected_status=422, + ) + assert result["status"] == 422 diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py new file mode 100644 index 0000000..a77d535 --- /dev/null +++ b/tests/unit/conftest.py @@ -0,0 +1,195 @@ +"""Setup for unit tests: fixtures and mock service implementations.""" + +import asyncio +import importlib +import sys +import types +from pathlib import Path +from urllib.parse import urlencode + +import pytest +from starlette.requests import Request + +ROOT = Path(__file__).resolve().parents[2] +if str(ROOT) not in sys.path: + sys.path.insert(0, str(ROOT)) + + +class DummyLogger: + """Dummy class that captures logger calls.""" + calls = [] + + @staticmethod + def add_request(*args, **kwargs): + """Record a logger call for testing.""" + DummyLogger.calls.append({"args": args, "kwargs": kwargs}) + + +class DummyFeedback: + """Dummy class that captures feedback writes.""" + calls = [] + + @staticmethod + def add_feedback(*args, **kwargs): + """Record a feedback call for testing.""" + DummyFeedback.calls.append({"args": args, "kwargs": kwargs}) + + +class DummySearch: + """Dummy class that returns hard-coded search results.""" + def __init__(self): + """Initialize search results.""" + self.calls = [] + self.vectordb_langs = ["en", "fr"] + self.translator = types.SimpleNamespace(mint_langs=["en", "fr", "de", "ar"]) + + def search(self, query, **kwargs): + """Return hard-coded search rows based on filter type.""" + self.calls.append({"name": "search", "query": query, "kwargs": kwargs}) + filt = kwargs.get("filter") or {} + if filt.get("metadata.IsProperty"): + return [ + { + "PID": "P31", + "similarity_score": 0.91, + "rrf_score": 0.04, + "source": "Vector Search", + } + ] + return [ + { + "QID": "Q42", + "similarity_score": 0.95, + "rrf_score": 0.05, + "source": "Vector Search", + } + ] + + def get_similarity_scores(self, query, qids, **kwargs): + """Return hard-coded similarity scores for provided IDs.""" + self.calls.append( + { + "name": "get_similarity_scores", + "query": query, + "qids": list(qids), + "kwargs": kwargs, + } + ) + out = [] + for idx, qid in enumerate(qids): + score = max(0.0, 1.0 - idx * 0.1) + if qid.startswith("Q"): + out.append({"QID": qid, "similarity_score": score}) + elif qid.startswith("P"): + out.append({"PID": qid, "similarity_score": score}) + return out + + +class DummyLimiter: + """Dummy class used to bypass rate limiting in unit tests.""" + def limit(self, *_args, **_kwargs): + """Return a no-op rate-limit decorator.""" + def _deco(fn): + return fn + + return _deco + + +def _identity_cache(*_args, **_kwargs): + """Return a decorator that leaves wrapped functions unchanged.""" + def _deco(fn): + return fn + + return _deco + + +@pytest.fixture(scope="session") +def test_ctx(): + """Build an isolated module context with stubbed dependencies.""" + # Ensure a clean import path for this isolated unit-test setup. + for mod in list(sys.modules): + if mod.startswith("wikidatasearch"): + sys.modules.pop(mod, None) + + dummy_search = DummySearch() + + fake_config = types.ModuleType("wikidatasearch.config") + fake_settings = types.SimpleNamespace( + CACHE_TTL=60, + RATE_LIMIT="1000/minute", + MAX_VECTORDB_K=50, + FRONTEND_STATIC_DIR="frontend/dist", + ANALYTICS_API_SECRET="", + ) + fake_config.settings = fake_settings + fake_config.SEARCH = dummy_search + sys.modules["wikidatasearch.config"] = fake_config + + fake_logger = types.ModuleType("wikidatasearch.services.logger") + fake_logger.Logger = DummyLogger + fake_logger.Feedback = DummyFeedback + fake_logger.engine = object() + sys.modules["wikidatasearch.services.logger"] = fake_logger + + fake_analytics = types.ModuleType("wikidatasearch.services.analytics") + fake_analytics.build_analytics_app = lambda: None + sys.modules["wikidatasearch.services.analytics"] = fake_analytics + + fake_dependencies = types.ModuleType("wikidatasearch.dependencies") + fake_dependencies.limiter = DummyLimiter() + fake_dependencies.register_rate_limit = lambda _app: None + fake_dependencies.require_descriptive_user_agent = lambda _request: None + sys.modules["wikidatasearch.dependencies"] = fake_dependencies + + fake_cache_module = types.ModuleType("fastapi_cache.decorator") + fake_cache_module.cache = _identity_cache + sys.modules["fastapi_cache.decorator"] = fake_cache_module + + # Avoid importing the real app module via wikidatasearch/__init__.py side effects. + fake_main = types.ModuleType("wikidatasearch.main") + fake_main.app = object() + sys.modules["wikidatasearch.main"] = fake_main + + ctx = { + "search": dummy_search, + "logger": DummyLogger, + "feedback": DummyFeedback, + "item": importlib.import_module("wikidatasearch.routes.item"), + "property": importlib.import_module("wikidatasearch.routes.property"), + "similarity": importlib.import_module("wikidatasearch.routes.similarity"), + "frontend": importlib.import_module("wikidatasearch.routes.frontend"), + } + return ctx + + +@pytest.fixture +def run_async(): + """Run an async coroutine in unit tests.""" + def _run(coro): + return asyncio.run(coro) + + return _run + + +@pytest.fixture +def make_request(): + """Create a minimal Starlette request object for route calls.""" + def _make(path: str, method: str = "GET", params: dict | None = None) -> Request: + """Construct a request scope with query params and test headers.""" + query_string = urlencode(params or {}, doseq=True).encode() + scope = { + "type": "http", + "http_version": "1.1", + "method": method, + "path": path, + "query_string": query_string, + "headers": [ + (b"user-agent", b"Unit Test Client/1.0 (unit-tests@example.org)"), + ], + "client": ("127.0.0.1", 12345), + "scheme": "http", + "server": ("testserver", 80), + } + return Request(scope) + + return _make diff --git a/tests/unit/test_routes.py b/tests/unit/test_routes.py new file mode 100644 index 0000000..13edc98 --- /dev/null +++ b/tests/unit/test_routes.py @@ -0,0 +1,283 @@ +"""Unit tests for API routes, including response shape and rules, input validation, filter building, language normalization, and error handling.""" + +from fastapi import BackgroundTasks, HTTPException +import pytest + + +def test_languages_route_returns_split_languages(test_ctx, run_async): + """Validate languages route returns split languages.""" + frontend = test_ctx["frontend"] + data = run_async(frontend.languages()) + assert data["vectordb_langs"] == ["en", "fr"] + assert "de" in data["other_langs"] + assert "ar" in data["other_langs"] + + +def test_item_query_route_returns_items_and_sets_item_filter(test_ctx, run_async, make_request): + """Validate results and built filter for item query route.""" + item = test_ctx["item"] + req = make_request("/item/query/") + result = run_async( + item.item_query_route( + req, + BackgroundTasks(), + query="Douglas Adams", + lang="all", + K=5, + instanceof=None, + rerank=False, + return_vectors=False, + ) + ) + assert result[0]["QID"] == "Q42" + last_call = test_ctx["search"].calls[-1] + assert last_call["name"] == "search" + assert last_call["kwargs"]["filter"]["metadata.IsItem"] is True + assert last_call["kwargs"]["lang"] == "all" + assert last_call["kwargs"]["ks_K"] == 1 + + +def test_property_query_route_returns_properties(test_ctx, run_async, make_request): + """Validate results and built filter for property query route.""" + property_route = test_ctx["property"] + req = make_request("/property/query/") + result = run_async( + property_route.property_query_route( + req, + BackgroundTasks(), + query="instance of", + lang="all", + K=5, + instanceof=None, + rerank=False, + return_vectors=False, + exclude_external_ids=True, + ) + ) + assert result[0]["PID"] == "P31" + last_call = test_ctx["search"].calls[-1] + assert last_call["name"] == "search" + assert last_call["kwargs"]["filter"]["metadata.IsProperty"] is True + assert last_call["kwargs"]["filter"]["metadata.DataType"] == {"$ne": "external-id"} + assert last_call["kwargs"]["lang"] == "all" + assert last_call["kwargs"]["ks_K"] == 1 + + +def test_item_query_route_lowercases_lang_and_uses_expected_ks_k(test_ctx, run_async, make_request): + """Validate language normalization and uses expected k for item query route.""" + item = test_ctx["item"] + req = make_request("/item/query/") + run_async( + item.item_query_route( + req, + BackgroundTasks(), + query="Douglas Adams", + lang="EN", + K=11, + instanceof=None, + rerank=False, + return_vectors=False, + ) + ) + last_call = test_ctx["search"].calls[-1] + assert last_call["kwargs"]["lang"] == "en" + assert last_call["kwargs"]["ks_K"] == 2 + + +def test_property_query_route_without_exclude_external_ids_does_not_set_datatype_filter(test_ctx, run_async, make_request): + """Validate external ids exclusion for property query route.""" + property_route = test_ctx["property"] + req = make_request("/property/query/") + run_async( + property_route.property_query_route( + req, + BackgroundTasks(), + query="instance of", + lang="EN", + K=20, + instanceof=None, + rerank=False, + return_vectors=False, + exclude_external_ids=False, + ) + ) + last_call = test_ctx["search"].calls[-1] + assert last_call["kwargs"]["lang"] == "en" + assert last_call["kwargs"]["ks_K"] == 2 + assert "metadata.DataType" not in last_call["kwargs"]["filter"] + + +def test_similarity_score_route_returns_qids_and_pids(test_ctx, run_async, make_request): + """Validate qids and pids results for similarity score route.""" + similarity = test_ctx["similarity"] + req = make_request("/similarity-score/") + result = run_async( + similarity.similarity_score_route( + req, + BackgroundTasks(), + query="science fiction writer", + qid="Q42,P31", + lang="all", + return_vectors=False, + ) + ) + ids = {item.get("QID") or item.get("PID") for item in result} + assert ids == {"Q42", "P31"} + last_call = test_ctx["search"].calls[-1] + assert last_call["name"] == "get_similarity_scores" + assert last_call["kwargs"]["lang"] == "all" + + +def test_similarity_score_route_rejects_too_many_ids_with_422(test_ctx, run_async, make_request): + """Validate IDs limit 422 error for similarity score route.""" + similarity = test_ctx["similarity"] + req = make_request("/similarity-score/") + qids = ",".join([f"Q{i}" for i in range(101)]) + + with pytest.raises(HTTPException) as exc: + run_async( + similarity.similarity_score_route( + req, + BackgroundTasks(), + query="test", + qid=qids, + lang="all", + return_vectors=False, + ) + ) + + assert exc.value.status_code == 422 + + +@pytest.mark.parametrize( + ("route_name", "route_path", "call_kwargs", "search_call_name"), + [ + ( + "item", + "/item/query/", + { + "query": "Douglas Adams", + "lang": "all", + "K": 5, + "instanceof": None, + "rerank": False, + "return_vectors": True, + }, + "search", + ), + ( + "property", + "/property/query/", + { + "query": "instance of", + "lang": "all", + "K": 5, + "instanceof": None, + "rerank": False, + "return_vectors": True, + "exclude_external_ids": False, + }, + "search", + ), + ( + "similarity", + "/similarity-score/", + { + "query": "science fiction writer", + "qid": "Q42,P31", + "lang": "all", + "return_vectors": True, + }, + "get_similarity_scores", + ), + ], +) +def test_routes_accept_and_forward_return_vectors( + test_ctx, + run_async, + make_request, + route_name, + route_path, + call_kwargs, + search_call_name, +): + """Validate return_vectors=True is accepted and forwarded to the search layer.""" + route = test_ctx[route_name] + req = make_request(route_path) + route_fn_name = { + "item": "item_query_route", + "property": "property_query_route", + "similarity": "similarity_score_route", + }[route_name] + route_fn = getattr(route, route_fn_name) + + result = run_async(route_fn(req, BackgroundTasks(), **call_kwargs)) + assert result + last_call = test_ctx["search"].calls[-1] + assert last_call["name"] == search_call_name + assert last_call["kwargs"]["return_vectors"] is True + + +def test_item_query_route_rejects_invalid_instanceof(test_ctx, run_async, make_request): + """Validate rejection of invalid instanceof for item query route.""" + item = test_ctx["item"] + req = make_request("/item/query/") + + with pytest.raises(HTTPException) as exc: + run_async( + item.item_query_route( + req, + BackgroundTasks(), + query="Douglas Adams", + lang="all", + K=5, + instanceof=" , , ", + rerank=False, + return_vectors=False, + ) + ) + + assert exc.value.status_code == 422 + + +def test_property_query_route_rejects_invalid_instanceof(test_ctx, run_async, make_request): + """Validate rejection of invalid instanceof for property query route.""" + property_route = test_ctx["property"] + req = make_request("/property/query/") + + with pytest.raises(HTTPException) as exc: + run_async( + property_route.property_query_route( + req, + BackgroundTasks(), + query="instance of", + lang="all", + K=5, + instanceof=" , ", + rerank=False, + return_vectors=False, + exclude_external_ids=False, + ) + ) + + assert exc.value.status_code == 422 + + +def test_similarity_score_route_rejects_empty_qid_list(test_ctx, run_async, make_request): + """Validate rejection of empty qid list for similarity score route.""" + similarity = test_ctx["similarity"] + req = make_request("/similarity-score/") + + with pytest.raises(HTTPException) as exc: + run_async( + similarity.similarity_score_route( + req, + BackgroundTasks(), + query="science fiction writer", + qid=" , , ", + lang="all", + return_vectors=False, + ) + ) + + assert exc.value.status_code == 422 diff --git a/tests/unit/test_search_helpers.py b/tests/unit/test_search_helpers.py new file mode 100644 index 0000000..2b7d463 --- /dev/null +++ b/tests/unit/test_search_helpers.py @@ -0,0 +1,196 @@ +"""Unit tests for search helpers, including reciprocal rank fusion, deduplication, query cleaning, search routing, and embedding lookup by ID.""" + +import importlib +import sys +import types + + +def _ensure_service_import_stubs(): + """Install lightweight stubs into system modules for unit tests without real extneral dependencies""" + if "requests" not in sys.modules: + fake_requests = types.ModuleType("requests") + fake_requests.get = lambda *args, **kwargs: None + fake_requests.post = lambda *args, **kwargs: None + sys.modules["requests"] = fake_requests + + if "stopwordsiso" not in sys.modules: + fake_stopwordsiso = types.ModuleType("stopwordsiso") + fake_stopwordsiso.stopwords = lambda _lang: {"the", "a", "an"} + sys.modules["stopwordsiso"] = fake_stopwordsiso + + if "astrapy" not in sys.modules: + fake_astrapy = types.ModuleType("astrapy") + fake_astrapy.DataAPIClient = object + sys.modules["astrapy"] = fake_astrapy + + if "astrapy.api_options" not in sys.modules: + fake_api_options = types.ModuleType("astrapy.api_options") + fake_api_options.APIOptions = object + fake_api_options.TimeoutOptions = object + sys.modules["astrapy.api_options"] = fake_api_options + + if "wikidatasearch.services.jina" not in sys.modules: + fake_jina = types.ModuleType("wikidatasearch.services.jina") + + class _DummyJina: + """Minimal Jina client stub""" + def __init__(self, *_args, **_kwargs): + """Accept arbitrary constructor args in tests.""" + pass + + fake_jina.JinaAIAPI = _DummyJina + sys.modules["wikidatasearch.services.jina"] = fake_jina + + +def _service_classes(): + """Import and return search service classes with the dependency stubs.""" + _ensure_service_import_stubs() + + hybrid_module = importlib.import_module("wikidatasearch.services.search.HybridSearch") + keyword_module = importlib.import_module("wikidatasearch.services.search.KeywordSearch") + vector_module = importlib.import_module("wikidatasearch.services.search.VectorSearch") + + return hybrid_module.HybridSearch, keyword_module.KeywordSearch, vector_module.VectorSearch + +def test_reciprocal_rank_fusion_merges_sources_and_accumulates_rrf(test_ctx): + """Validate reciprocal rank fusion sources and accumulates rrf score.""" + HybridSearch, _, _ = _service_classes() + vector_results = [ + {"QID": "Q42", "similarity_score": 0.95}, + {"QID": "Q5", "similarity_score": 0.90}, + ] + keyword_results = [ + {"QID": "Q5", "similarity_score": 0.80}, + {"QID": "Q42", "similarity_score": 0.70}, + ] + + fused = HybridSearch.reciprocal_rank_fusion( + [ + ("Vector Search", vector_results), + ("Keyword Search", keyword_results), + ] + ) + + by_id = {row["QID"]: row for row in fused} + assert set(by_id.keys()) == {"Q42", "Q5"} + assert by_id["Q42"]["source"] == "Vector Search, Keyword Search" + assert by_id["Q5"]["source"] == "Vector Search, Keyword Search" + assert by_id["Q42"]["similarity_score"] == 0.95 + assert by_id["Q5"]["similarity_score"] == 0.90 + assert by_id["Q42"]["rrf_score"] > 0 + assert by_id["Q5"]["rrf_score"] > 0 + + +def test_vector_remove_duplicates_prefers_best_similarity_and_keeps_unique_results(test_ctx): + """Validate removing duplicates that keeps unique results with the highest similarity scores""" + _, _, VectorSearch = _service_classes() + raw_results = [ + {"metadata": {"QID": "Q42"}, "$similarity": 0.60, "$vector": [0.1], "content": "A"}, + {"metadata": {"QID": "Q42"}, "$similarity": 0.95, "$vector": [0.9], "content": "B"}, + {"metadata": {"PID": "P31"}, "$similarity": 0.70, "$vector": [0.2], "content": "C"}, + ] + + deduped = VectorSearch.remove_duplicates( + raw_results, + return_vectors=True, + return_text=True, + ) + + assert len(deduped) == 2 + assert deduped[0]["QID"] == "Q42" + assert deduped[0]["similarity_score"] == 0.95 + assert deduped[0]["vector"] == [0.9] + assert deduped[0]["text"] == "B" + assert deduped[1]["PID"] == "P31" + assert deduped[1]["similarity_score"] == 0.70 + + +def test_reciprocal_rank_fusion_drops_non_positive_similarity(test_ctx): + """Validate reciprocal rank fusion that drops negative similarity scores.""" + HybridSearch, _, _ = _service_classes() + fused = HybridSearch.reciprocal_rank_fusion( + [ + ( + "Vector Search", + [ + {"QID": "Q3", "similarity_score": 0.25}, + {"QID": "Q1", "similarity_score": 0.0}, + {"QID": "Q2", "similarity_score": -0.1}, + ], + ) + ] + ) + + assert [row["QID"] for row in fused] == ["Q3"] + + +def test_keyword_clean_query_removes_stopwords_and_caps_length(test_ctx): + """Validate KeywordSearch's clean query that removes stopwords and caps length.""" + _, KeywordSearch, _ = _service_classes() + keyword = KeywordSearch() + + cleaned = keyword._clean_query("the quick brown fox", "all") + assert "the" not in cleaned.lower() + assert "quick" in cleaned.lower() + assert len(cleaned) <= 300 + + very_long = "word " * 500 + cleaned_long = keyword._clean_query(very_long, "en") + assert len(cleaned_long) <= 300 + + +def test_vector_find_routes_pid_filters_to_property_collection(test_ctx): + """Validate PID filters route to the property vector database.""" + _, _, VectorSearch = _service_classes() + + class _FakeCollection: + """Minimal collection stub that records find calls.""" + + def __init__(self, name): + """Store the collection name and initialize captured calls.""" + self.name = name + self.calls = [] + + def find(self, *args, **kwargs): + """Capture call arguments and return one deterministic row.""" + self.calls.append({"args": args, "kwargs": kwargs}) + if self.name == "property": + return [{"metadata": {"PID": "P31"}, "$similarity": 0.9}] + return [{"metadata": {"QID": "Q42"}, "$similarity": 0.9}] + + vector = VectorSearch.__new__(VectorSearch) + vector.icollection = _FakeCollection("item") + vector.pcollection = _FakeCollection("property") + vector.max_K = 50 + + rows = vector.find( + {"metadata.PID": {"$in": ["P31"]}}, + projection={"metadata": 1}, + limit=None, + ) + + assert rows and rows[0]["metadata"]["PID"] == "P31" + assert len(vector.pcollection.calls) == 1 + assert len(vector.icollection.calls) == 0 + + +def test_get_embedding_by_id_marks_property_ids_as_property_filter(test_ctx): + """Validate that property lookups build the correct filter before querying.""" + _, _, VectorSearch = _service_classes() + + captured = {} + + def _fake_find(filter, projection=None, limit=50, sort=None, include_similarity=True): + """Capture incoming filter and return one vector row.""" + captured.update(filter) + return [{"metadata": {"PID": "P31"}, "$vector": [0.1, 0.2]}] + + vector = VectorSearch.__new__(VectorSearch) + vector.find = _fake_find + + item, embedding = vector.get_embedding_by_id("P31") + + assert item["metadata"]["PID"] == "P31" + assert embedding == [0.1, 0.2] + assert captured["metadata.PID"] == "P31" + assert captured["metadata.IsProperty"] is True diff --git a/uv.lock b/uv.lock index d972b97..444bfe0 100644 --- a/uv.lock +++ b/uv.lock @@ -1685,6 +1685,7 @@ dependencies = [ { name = "pandas" }, { name = "plotly" }, { name = "pymysql" }, + { name = "requests" }, { name = "setuptools" }, { name = "slowapi" }, { name = "sqlalchemy" }, @@ -1703,6 +1704,7 @@ requires-dist = [ { name = "pandas", specifier = ">=2.3.3" }, { name = "plotly", specifier = ">=6.3.1" }, { name = "pymysql", specifier = ">=1.1.2" }, + { name = "requests", specifier = ">=2.32.0" }, { name = "setuptools", specifier = ">=80.9.0" }, { name = "slowapi", specifier = ">=0.1.9" }, { name = "sqlalchemy", specifier = ">=2.0.43" }, diff --git a/wikidatasearch/__init__.py b/wikidatasearch/__init__.py index f01a49c..cbb59c5 100644 --- a/wikidatasearch/__init__.py +++ b/wikidatasearch/__init__.py @@ -1,3 +1,9 @@ -from .main import app +__all__ = ["app"] -__all__ = ["app"] \ No newline at end of file + +def __getattr__(name: str): + if name == "app": + from .main import app + + return app + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/wikidatasearch/config.py b/wikidatasearch/config.py index fda620b..c592306 100644 --- a/wikidatasearch/config.py +++ b/wikidatasearch/config.py @@ -8,6 +8,7 @@ class Settings(BaseSettings): CACHE_TTL: int = 180 # 3 minutes RATE_LIMIT: str = "30/minute" DEST_LANG: str = "en" + MAX_VECTORDB_K: int = 50 VECTORDb_LANGS: list[str] = ["en", "fr", "ar", "de"] # --- From .env --- @@ -19,7 +20,6 @@ class Settings(BaseSettings): JINA_API_KEY: str | None = None - API_SECRET: str | None = None ANALYTICS_API_SECRET: str | None = None model_config = SettingsConfigDict( @@ -40,5 +40,6 @@ class Settings(BaseSettings): "JINA_API_KEY": settings.JINA_API_KEY, }, dest_lang=settings.DEST_LANG, - vectordb_langs=settings.VECTORDb_LANGS -) \ No newline at end of file + vectordb_langs=settings.VECTORDb_LANGS, + max_K=settings.MAX_VECTORDB_K +) diff --git a/wikidatasearch/dependencies.py b/wikidatasearch/dependencies.py index a7feba4..4deeabe 100644 --- a/wikidatasearch/dependencies.py +++ b/wikidatasearch/dependencies.py @@ -1,11 +1,9 @@ import time -from fastapi import Security, HTTPException, Request, FastAPI, Depends -from fastapi.security.api_key import APIKeyHeader +from fastapi import HTTPException, Request, FastAPI from slowapi import Limiter, _rate_limit_exceeded_handler from slowapi.errors import RateLimitExceeded -from .config import settings from .services.logger import Logger def user_agent_key(request: Request) -> str: @@ -24,16 +22,6 @@ def user_agent_key(request: Request) -> str: # Consider the user agent for rate limiting since WMcloud requests share the same IP. limiter = Limiter(key_func=user_agent_key) -api_key_header = APIKeyHeader(name="X-API-SECRET", auto_error=False) - -def verify_api_key(x_api_secret: str = Security(api_key_header)) -> str | None: - """ - Verify X-API-SECRET against settings.API_SECRET. - If API_SECRET is unset, auth is effectively disabled. - """ - if settings.API_SECRET and x_api_secret != settings.API_SECRET: - raise HTTPException(status_code=401, detail="X-API-SECRET incorrect or missing") - return x_api_secret def require_descriptive_user_agent(request: Request) -> None: """ diff --git a/wikidatasearch/main.py b/wikidatasearch/main.py index d9e8dba..338b8f2 100644 --- a/wikidatasearch/main.py +++ b/wikidatasearch/main.py @@ -13,7 +13,7 @@ app = FastAPI( title="Wikidata Vector Search", description="API for querying the Wikidata Vector Database", - version="2.1.0", + version="0.2.1", openapi_url="/openapi.json", docs_url="/docs", redoc_url="/redoc", diff --git a/wikidatasearch/routes/frontend.py b/wikidatasearch/routes/frontend.py index 83fed7f..dc1cb7a 100644 --- a/wikidatasearch/routes/frontend.py +++ b/wikidatasearch/routes/frontend.py @@ -22,8 +22,8 @@ def mount_static(app): @router.get("/languages", summary="Supported languages") @cache(expire=settings.CACHE_TTL) async def languages(): - vectordb_langs = set(SEARCH.vectorsearch.vectordb_langs) - other_langs = set(SEARCH.vectorsearch.translator.mint_langs) - vectordb_langs + vectordb_langs = set(SEARCH.vectordb_langs) + other_langs = set(SEARCH.translator.mint_langs) - vectordb_langs return { "vectordb_langs": sorted(vectordb_langs), "other_langs": sorted(other_langs), @@ -33,10 +33,10 @@ async def languages(): @router.post("/feedback", include_in_schema=False) async def feedback( request: Request, - query: str = Query(..., example="testing"), - id: str = Query(..., example="Q5"), - sentiment: str = Query(..., example="up"), - index: int = Query(..., example=0)): + query: str = Query(..., examples=["testing"]), + id: str = Query(..., examples=["Q5"]), + sentiment: str = Query(..., examples=["up"]), + index: int = Query(..., examples=[0])): Feedback.add_feedback(query, id, sentiment, index) return True \ No newline at end of file diff --git a/wikidatasearch/routes/item.py b/wikidatasearch/routes/item.py index 36e3404..a272ad6 100644 --- a/wikidatasearch/routes/item.py +++ b/wikidatasearch/routes/item.py @@ -6,15 +6,16 @@ import traceback from ..config import settings, SEARCH -from ..dependencies import verify_api_key, limiter, require_descriptive_user_agent +from ..dependencies import limiter, require_descriptive_user_agent from ..services.logger import Logger class ItemQuery(BaseModel): - QID: str = Field(..., example="Q42", description="Wikidata item QID") - similarity_score: float = Field(..., example=0.95, description="Dot product similarity") - rrf_score: Optional[float] = Field(0.0, example=8.43, description="Reciprocal Rank Fusion score") - source: Optional[str] = Field('', example="Keyword Search, Vector Search") + """Represents one item search result.""" + QID: str = Field(..., description="Wikidata item QID") + similarity_score: float = Field(..., description="Dot product similarity") + rrf_score: Optional[float] = Field(0.0, description="Reciprocal Rank Fusion score") + source: Optional[str] = Field('', description="Source of the search") vector: Optional[list[float]] = Field(None, description="Present when return_vectors is True") reranker_score: Optional[float] = Field(None, description="Present when rerank is True") @@ -23,7 +24,6 @@ class ItemQuery(BaseModel): prefix="/item", tags=["Queries"], dependencies=[ - Depends(verify_api_key), Depends(require_descriptive_user_agent) ], responses={ @@ -42,7 +42,6 @@ class ItemQuery(BaseModel): } }, }, - 401: {"description": "Missing or invalid API key (if required)"}, 422: {"description": "Missing or invalid parameters"}, 500: {"description": "Internal Server Error"}, }, @@ -61,15 +60,20 @@ class ItemQuery(BaseModel): async def item_query_route( request: Request, background_tasks: BackgroundTasks, - query: str = Query(..., example="Douglas Adams", description="Query string to search for"), + query: str = Query(..., examples=["Douglas Adams", "Q42", "Who wrote 1984?"], description="Query string to search for"), lang: str = Query( "all", description='Language code for the query. Use "all" to search across all vectors.', ), - K: int = Query(50, description="Number of top results to return"), + K: int = Query( + settings.MAX_VECTORDB_K, + ge=1, + le=settings.MAX_VECTORDB_K, + description="Number of top results to return", + ), instanceof: Optional[str] = Query( None, - example="Q5,Q634", + examples=["Q2", "Q5,Q634"], description='Comma separated QIDs to filter by "instance of".', ), rerank: bool = Query(False, description="If true, apply a reranker model."), @@ -90,7 +94,8 @@ async def item_query_route( - **instanceof** (str, optional): Comma-separated list of QIDs to filter results by a specific "instance of" class. - **rerank** (bool): If True, rerank results using a reranker model (This option is slower and generally not necessary for RAG applications). - - **return_vectors** (bool): If True, include vector embeddings in the response. + - **return_vectors** (bool): Currently unavailable; if set to True this endpoint + returns HTTP 422. **Returns:** @@ -101,7 +106,8 @@ async def item_query_route( - **similarity_score** (float): Similarity score (dot product) between the item and the query. - **rrf_score** (float): Reciprocal Rank Fusion score combining vector and keyword results. - **source** (str): Indicates whether the item was found by "Keyword Search", "Vector Search", or both. - - **vector** (list[float], optional): Vector embedding of the item, if "return_vectors" is True. + - **vector** (list[float], optional): Vector embedding of the item. + Currently omitted because `return_vectors` is disabled. - **reranker_score** (float, optional): Relevance score from the reranker model, if "rerank" is True. """ start_time = time.time() @@ -111,6 +117,11 @@ async def item_query_route( Logger.add_request(request, 422, start_time, error=response) raise HTTPException(status_code=422, detail=response) + if K > settings.MAX_VECTORDB_K: + response = f"K must be less than {settings.MAX_VECTORDB_K}" + Logger.add_request(request, 422, start_time, error=response) + raise HTTPException(status_code=422, detail=response) + # Build filter filt = {"metadata.IsItem": True} if instanceof: diff --git a/wikidatasearch/routes/property.py b/wikidatasearch/routes/property.py index 11d665b..717b497 100644 --- a/wikidatasearch/routes/property.py +++ b/wikidatasearch/routes/property.py @@ -6,15 +6,16 @@ import traceback from ..config import settings, SEARCH -from ..dependencies import verify_api_key, limiter, require_descriptive_user_agent +from ..dependencies import limiter, require_descriptive_user_agent from ..services.logger import Logger class PropertyQuery(BaseModel): - PID: str = Field(..., example="P31", description="Wikidata property PID") - similarity_score: float = Field(..., example=0.89, description="Dot product similarity") - rrf_score: Optional[float] = Field(0.0, example=7.20, description="Reciprocal Rank Fusion score") - source: Optional[str] = Field('', example="Keyword Search, Vector Search") + """Represents one property search result.""" + PID: str = Field(..., description="Wikidata property PID") + similarity_score: float = Field(..., description="Dot product similarity") + rrf_score: Optional[float] = Field(0.0, description="Reciprocal Rank Fusion score") + source: Optional[str] = Field('', description="Source of the search") vector: Optional[list[float]] = Field(None, description="Present when return_vectors is True") reranker_score: Optional[float] = Field(None, description="Present when rerank is True") @@ -23,7 +24,6 @@ class PropertyQuery(BaseModel): prefix="/property", tags=["Queries"], dependencies=[ - Depends(verify_api_key), Depends(require_descriptive_user_agent) ], responses={ @@ -42,7 +42,6 @@ class PropertyQuery(BaseModel): } }, }, - 401: {"description": "Missing or invalid API key (if required)"}, 422: {"description": "Missing or invalid parameters"}, 500: {"description": "Internal Server Error"}, }, @@ -61,15 +60,20 @@ class PropertyQuery(BaseModel): async def property_query_route( request: Request, background_tasks: BackgroundTasks, - query: str = Query(..., example="instance of", description="Query string to search for"), + query: str = Query(..., examples=["instance of", "P31"], description="Query string to search for"), lang: str = Query( "all", description='Language code for the query. Use "all" to search across all vectors.', ), - K: int = Query(50, description="Number of top results to return"), + K: int = Query( + settings.MAX_VECTORDB_K, + ge=1, + le=settings.MAX_VECTORDB_K, + description="Number of top results to return", + ), instanceof: Optional[str] = Query( None, - example="Q18616576", + examples=["Q18616576"], description='Comma separated QIDs to filter by "instance of" class', ), rerank: bool = Query(False, description="If true, apply a reranker model."), @@ -91,7 +95,8 @@ async def property_query_route( - **instanceof** (str, optional): Comma-separated list of QIDs to filter results by a specific "instance of" class. - **rerank** (bool): If True, rerank results using a reranker model (This option is slower and generally not necessary for RAG applications). - - **return_vectors** (bool): If True, include vector embeddings in the response. + - **return_vectors** (bool): Currently unavailable; if set to True this endpoint + returns HTTP 422. - **exclude_external_ids** (bool): If True, exclude properties with external identifier datatype. @@ -103,7 +108,8 @@ async def property_query_route( - **similarity_score** (float): Similarity score (dot product) between the property and the query. - **rrf_score** (float): Reciprocal Rank Fusion score combining vector and keyword results. - **source** (str): Indicates whether the property was found by "Keyword Search", "Vector Search", or both. - - **vector** (list[float], optional): Vector embedding of the property, if "return_vectors" is True. + - **vector** (list[float], optional): Vector embedding of the property. + Currently omitted because `return_vectors` is disabled. - **reranker_score** (float, optional): Relevance score from the reranker model, if "rerank" is True. """ start_time = time.time() @@ -113,6 +119,11 @@ async def property_query_route( Logger.add_request(request, 422, start_time, error=response) raise HTTPException(status_code=422, detail=response) + if K > settings.MAX_VECTORDB_K: + response = f"K must be less than {settings.MAX_VECTORDB_K}" + Logger.add_request(request, 422, start_time, error=response) + raise HTTPException(status_code=422, detail=response) + filt = {"metadata.IsProperty": True} if instanceof: qids = [qid.strip() for qid in instanceof.split(",") if qid.strip()] diff --git a/wikidatasearch/routes/similarity.py b/wikidatasearch/routes/similarity.py index b64a713..905fb1f 100644 --- a/wikidatasearch/routes/similarity.py +++ b/wikidatasearch/routes/similarity.py @@ -1,26 +1,33 @@ from typing import List, Optional -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, model_validator from fastapi import APIRouter, Depends, Query, Request, BackgroundTasks, HTTPException from fastapi_cache.decorator import cache import time import traceback from ..config import settings, SEARCH -from ..dependencies import verify_api_key, limiter, require_descriptive_user_agent +from ..dependencies import limiter, require_descriptive_user_agent from ..services.logger import Logger class SimilarityScore(BaseModel): - QID: str = Field(..., example="Q2", description="Wikidata entity QID") - similarity_score: float = Field(..., example=0.78, description="Dot product similarity") + """Represents one similarity score result for a Wikidata entity (With either a QID or PID).""" + QID: Optional[str] = Field(None, description="Wikidata entity QID") + PID: Optional[str] = Field(None, description="Wikidata property PID") + similarity_score: float = Field(..., description="Dot product similarity") vector: Optional[list[float]] = Field(None, description="Present when return_vectors is True") + @model_validator(mode="after") + def check_id(self): + """Ensures that exactly one of QID or PID is provided.""" + if (self.QID is None) == (self.PID is None): + raise ValueError("One of QID or PID must be present") + return self router = APIRouter( prefix="", tags=["Queries"], dependencies=[ - Depends(verify_api_key), Depends(require_descriptive_user_agent) ], responses={ @@ -35,7 +42,6 @@ class SimilarityScore(BaseModel): } }, }, - 401: {"description": "Missing or invalid API key"}, 422: {"description": "Missing or invalid parameters"}, 500: {"description": "Internal Server Error"}, }, @@ -44,7 +50,7 @@ class SimilarityScore(BaseModel): @router.get( "/similarity-score/", - summary="Compute similarity scores for specific Wikidata QIDs", + summary="Compute similarity scores for specific Wikidata QIDs and PIDs", operation_id="similarityScoreQuery", response_model=List[SimilarityScore], response_model_exclude_none=True, @@ -54,10 +60,10 @@ class SimilarityScore(BaseModel): async def similarity_score_route( request: Request, background_tasks: BackgroundTasks, - query: str = Query(..., example="origin of the universe", description="Query string to compare against Wikidata entities."), - qid: str = Query(..., example="Q42,Q2,Q36153", description="Comma separated list of Wikidata QIDs to compare the query to."), + query: str = Query(..., examples=["origin of the universe"], description="Query string to compare against Wikidata entities."), + qid: str = Query(..., examples=["Q42,Q2,Q36153", "Q2"], description="Comma separated list of Wikidata IDs (QIDs and/or PIDs) to compare the query to."), lang: str = Query( - "en", + "all", description='Language code for the query. Use "all" to compare against all vectors. ' 'If a specific language is provided, only vectors in that language are used. ' 'If no vectors exist for that language, the query will be translated to English and compared against all vectors.', @@ -71,21 +77,24 @@ async def similarity_score_route( **Args:** - **query** (str): Query string to compare against Wikidata entities. - - **qid** (str): Comma-separated list of Wikidata QIDs to compare the query to. + - **qid** (str): Comma-separated list of Wikidata IDs (QIDs and/or PIDs) + to compare the query to. - **lang** (str): Language code for the query. Use "all" to compare with all vectors in the database. If a specific language is provided, only vectors in that language will be used. If no vectors exist for that language, the query will be translated to English and compared against all vectors. - - **return_vectors** (bool): If True, include vector embeddings in the response. + - **return_vectors** (bool): Currently unavailable; if set to True this endpoint + returns HTTP 422. **Returns:** Each item in the result list includes: - - **QID** (str): Wikidata QID of the compared entity. + - **QID**/**PID** (str): Wikidata entity ID of the compared entity. - **similarity_score** (float): Similarity score (dot product) between the entity and the query. - - **vector** (list[float], optional): Vector embedding of the entity, if "return_vectors" is True. + - **vector** (list[float], optional): Vector embedding of the entity. + Currently omitted because `return_vectors` is disabled. """ start_time = time.time() @@ -99,14 +108,20 @@ async def similarity_score_route( Logger.add_request(request, 422, start_time, error=response) raise HTTPException(status_code=422, detail=response) - try: - qids = [q.strip() for q in qid.split(",") if q.strip()] - if not qids: - response = "No valid QIDs provided" - Logger.add_request(request, 422, start_time, error=response) - raise HTTPException(status_code=422, detail=response) + qids = [q.strip() for q in qid.split(",") if q.strip()] + if not qids: + response = "No valid QIDs provided" + Logger.add_request(request, 422, start_time, error=response) + raise HTTPException(status_code=422, detail=response) - results = SEARCH.vectorsearch.get_similarity_scores( + MAX_NQIDs = 100 + if len(qids) > MAX_NQIDs: + response = "Too many QIDs provided. Please provide 100 or fewer QIDs." + Logger.add_request(request, 422, start_time, error=response) + raise HTTPException(status_code=422, detail=response) + + try: + results = SEARCH.get_similarity_scores( query=query, qids=qids, lang=lang, diff --git a/wikidatasearch/services/__init__.py b/wikidatasearch/services/__init__.py index a996fe9..e498321 100644 --- a/wikidatasearch/services/__init__.py +++ b/wikidatasearch/services/__init__.py @@ -1,5 +1,15 @@ from .search import HybridSearch -from .logger import Logger, Feedback -from .analytics import build_analytics_app -__all__ = ["HybridSearch", "Logger", "Feedback", "build_analytics_app"] \ No newline at end of file +__all__ = ["HybridSearch", "Logger", "Feedback", "build_analytics_app"] + + +def __getattr__(name: str): + if name in {"Logger", "Feedback"}: + from .logger import Feedback, Logger + + return {"Logger": Logger, "Feedback": Feedback}[name] + if name == "build_analytics_app": + from .analytics import build_analytics_app + + return build_analytics_app + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/wikidatasearch/services/datastax.py b/wikidatasearch/services/datastax.py deleted file mode 100644 index 743dbb4..0000000 --- a/wikidatasearch/services/datastax.py +++ /dev/null @@ -1,108 +0,0 @@ -from astrapy import DataAPIClient -from astrapy.api_options import APIOptions, TimeoutOptions -from langchain_core.documents import Document - -class AstraDBConnect: - def __init__(self, datastax_tokens, embedding_model): - """ - Initialize the AstraDBConnect object with the corresponding embedding model. - - Parameters: - - datastax_token (dict): Credentials for DataStax Astra, including token and API endpoint. - - collection_name (str): Name of the collection (table) where data is stored. - - model (str): The embedding model to use ("nvidia" or "jina"). Default is 'nvidia'. - - batch_size (int): Number of documents to accumulate before pushing to AstraDB. Default is 8. - - cache_embeddings (bool): Whether to cache embeddings when using the Jina model. Default is False. - """ - ASTRA_DB_APPLICATION_TOKEN = datastax_tokens['ASTRA_DB_APPLICATION_TOKEN'] - ASTRA_DB_API_ENDPOINT = datastax_tokens["ASTRA_DB_API_ENDPOINT"] - ASTRA_DB_COLLECTION = datastax_tokens["ASTRA_DB_COLLECTION"] - - timeout_options = TimeoutOptions(request_timeout_ms=100000) - api_options = APIOptions(timeout_options=timeout_options) - - client = DataAPIClient( - ASTRA_DB_APPLICATION_TOKEN, - api_options=api_options - ) - database0 = client.get_database(ASTRA_DB_API_ENDPOINT) - self.wikiDataCollection = database0.get_collection(ASTRA_DB_COLLECTION) - self.wikiDataCollectionProperties = database0.get_collection(ASTRA_DB_COLLECTION+"_properties") - - self.embedding_model = embedding_model - - def find(self, - filter, - sort={}, - projection={"metadata": 1}, - limit=50, - include_similarity=True): - - collection = self.wikiDataCollection - if filter.get('metadata.IsProperty', False): - del filter['metadata.IsProperty'] - collection = self.wikiDataCollectionProperties - elif filter.get('metadata.IsItem', False): - del filter['metadata.IsItem'] - collection = self.wikiDataCollection - - return collection.find( - filter, - sort=sort, - projection=projection, - limit=limit, - include_similarity=include_similarity - ) - - def add_document(self, id, text, metadata): - """ - Push the current batch of documents to AstraDB for storage. - - Retries automatically if a connection issue occurs, waiting for - an active internet connection. - """ - doc = Document(page_content=text, metadata=metadata) - self.graph_store.add_documents([doc], ids=[id]) - - def get_similar_qids(self, query, filter={}, K=100): - """ - Retrieve similar QIDs for a given query string. - - Parameters: - - query (str): The text query used to find similar documents. - - filter (dict): Additional filtering criteria. Default is an empty dict. - - K (int): Number of top results to return. Default is 50. - - Returns: - - tuple: (list_of_qids, list_of_scores) - where list_of_qids are the QIDs of the results and - list_of_scores are the corresponding similarity scores. - """ - - embedding = self.embedding_model.embed_query(query) - relevant_items = self.wikiDataCollection.find( - filter, - sort={"$vector": embedding}, - limit=K, - include_similarity=True - ) - - seen_qids = set() - output = [] - for item in relevant_items: - ID = item['metadata']['QID'] - if ID not in seen_qids: - - ID_name = ID[0]+'ID' - - output.append({ - ID_name: ID, - 'similarity_score': item['$similarity'] - }) - - seen_qids.add(ID) - - if len(seen_qids) >= K: - break - - return output \ No newline at end of file diff --git a/wikidatasearch/services/jina.py b/wikidatasearch/services/jina.py index 628952d..504f719 100644 --- a/wikidatasearch/services/jina.py +++ b/wikidatasearch/services/jina.py @@ -138,3 +138,16 @@ def rerank(self, query: str, docs: List[dict]) -> List[dict]: docs.sort(key=lambda x: x['reranker_score'], reverse=True) return docs + + def similarity(self, vec1: List[float], vec2: List[float]) -> float: + """ + Computes a clamped dot product between two vectors. + + Args: + vec1 (List[float]): The first vector. + vec2 (List[float]): The second vector. + + Returns: + float: max(0.0, dot(vec1, vec2)). + """ + return max(0.0, np.dot(vec1, vec2)) diff --git a/wikidatasearch/services/search.py b/wikidatasearch/services/search.py deleted file mode 100644 index 3019692..0000000 --- a/wikidatasearch/services/search.py +++ /dev/null @@ -1,536 +0,0 @@ -from abc import ABC, abstractmethod -from concurrent.futures import ThreadPoolExecutor -from stopwordsiso import stopwords -import requests -import re -import os - -from .datastax import AstraDBConnect -from .jina import JinaAIAPI -from .translator import Translator - -class Search(ABC): - """ - Abstract base class for search functionality. - """ - name: str # The name of the search implementation. - - @abstractmethod - def search(self, - query: str, - filter: dict = {}, - K: int = 100) -> list: - """ - Search for items based on the query and filter. - - Args: - query (str): The search query string. - filter (dict, optional): Additional filtering criteria. - K (int, optional): Number of top results to return. Defaults to 100. - - Returns: - list: A list of dictionaries containing search results. - """ - pass - - - def get_text_by_id(self, qid, format='triplet', lang='en') -> str: - """ - Fetches the textual representations of a Wikidata entity by its QID. - - Args: - id: A Wikidata entity ID. - - Returns: - text: A textual representation of the Wikidata entity. - """ - if (not bool(lang)) or (lang == 'all'): - lang = 'en' - - params = { - 'id': qid, - 'lang': lang, - 'external_ids': False, - 'format': format - } - headers = { - 'User-Agent': 'Wikidata Vector Database/Alpha Version (embedding@wikimedia.de)' - } - - url = os.environ.get("WD_TEXTIFIER_API", "https://wd-textify.wmcloud.org") - results = requests.get(url, params=params, headers=headers) - results.raise_for_status() - - text = results.json() - return text - - -class VectorSearch(Search): - name = "Vector Search" - - def __init__(self, - datastax_tokens: dict, - embedding_model, - dest_lang: str = 'en', - vectordb_langs: list = []): - """ - Initialize the Vector Database connection and embedding model. - - Args: - datastax_token (dict): Credentials for DataStax Astra, including token and API endpoint. - embedding_model (object): The initialised embedding model. - """ - self.embedding_model = embedding_model - self.vectorDB = AstraDBConnect(datastax_tokens, embedding_model) - self.translator = Translator(dest_lang) - self.vectordb_langs = vectordb_langs - - def search(self, - query: str, - filter: dict = {}, - lang: str = 'all', - K: int = 50, - return_vectors: bool = False, - return_text: bool = False) -> list: - """ - Retrieve similar Wikidata items from the vector database for a given query string. - - Args: - query (str): The search query string. - filter (dict, optional): Additional filtering criteria. - lang (str): The language of the vectors to query. Defaults to 'all'. - K (int, optional): Number of top results to return. Defaults to 50. - - Returns: - list: A list of dictionaries where each countains the QIDs or PIDs of the results and the similarity scores. - """ - embedding = None - output = [] - seen_qids = set() - - # If the query is a QID or PID, fetch its embedding directly. - if re.fullmatch(r'[PQ]\d+', query): - item, embedding = self.get_embedding_by_id( - query, - return_text=return_text, - lang=lang - ) - - if not item: - try: - query = self.get_text_by_id(query, format='text', lang=lang) - except: - return [] - else: - ID_name = 'QID' if query.startswith('Q') else 'PID' - - # Do not include the entity if it does not match the filter. - item_search = (ID_name == 'QID') and (filter.get("metadata.IsItem", False)) - property_search = (ID_name == 'PID') and (filter.get("metadata.IsProperty", False)) - - if item_search or property_search: - item_output = { - ID_name: query, - 'similarity_score': 1.0 - } - if return_vectors: - item_output['vector'] = embedding - if return_text: - item_output['text'] = item['content'] - - output.append(item_output) - seen_qids.add(query) - - if not embedding: - try: - # Translate the query if necessary - # Not need to translate if the language is present in the vector database. - if bool(lang) and \ - (lang != 'all') and \ - (lang not in self.vectordb_langs): - query = self.translator.translate( - query, - src_lang=lang - ) - except Exception as e: - # If translation fails, use the original query - print(f"Translation failed: {e}") - pass - - embedding = self.embedding_model.embed_query(query) - - if lang in self.vectordb_langs: - filter['metadata.Language'] = lang - - projection={"metadata": 1} - if return_text: - projection["content"] = 1 - if return_vectors: - projection["$vector"] = 1 - - relevant_items = self.vectorDB.find( - filter, - sort={"$vector": embedding}, - projection=projection, - limit=50, - include_similarity=True, - ) - - for item in relevant_items: - ID = item['metadata'].get('QID', item['metadata'].get('PID')) - if ID not in seen_qids: - - ID_name = 'QID' if ID.startswith('Q') else 'PID' - item_output = { - ID_name: ID, - 'similarity_score': item['$similarity'] - } - if return_vectors: - item_output['vector'] = item['$vector'] - if return_text: - item_output['text'] = item['content'] - - output.append(item_output) - - seen_qids.add(ID) - - if len(seen_qids) >= K: - break - - return output - - def get_similarity_scores(self, - query: str, - qids: list, - lang: str = 'all', - return_vectors: bool = False, - return_text: bool = False) -> list: - """ - Retrieve similarity scores for a list of QIDs based on a query. - - Args: - query (str): The search query string. - qids (list): A list of Wikidata items to retrieve similarity scores for. - lang (str): The language of the vectors to query. Defaults to 'all'. - return_vectors (bool): Whether to return the vector embeddings of the entity. - return_text (bool): Whether to return the text content of the entity. - - Returns: - list: A list of dictionaries containing the similarity score. - """ - results = [] - qids_found = [] - while len(results) < len(qids): - remaining_qids = [qid for qid in qids if qid not in qids_found] - if len(remaining_qids) == 0: - break - - filter = {"$or": [ - {"metadata.QID": {"$in": [q for q in remaining_qids if q.startswith("Q")]}}, - {"metadata.PID": {"$in": [p for p in remaining_qids if p.startswith("P")]}} - ]} - if lang in self.vectordb_langs: - filter['metadata.Language'] = lang - - remaining_results = self.search( - query, - filter=filter, - K=50, - return_vectors=return_vectors, - return_text=return_text - ) - if len(remaining_results) == 0: - break - - results.extend(remaining_results) - - results = sorted( - results, - key=lambda x: x['similarity_score'], - reverse=True - ) - return results - - def get_embedding_by_id(self, qid, lang = 'all', return_text = False): - """ - Fetches the embedding of a Wikidata entity by its QID. - - Args: - qid: A Wikidata entity ID. - lang (str): The language of the vectors to query. Defaults to 'all'. - return_text (bool): Whether to return the text content of the entity. - - Returns: - item: The Wikidata entity from the vector database. - embedding: The embedding of the Wikidata entity. - """ - filter = {"metadata.QID": qid} - - if lang in self.vectordb_langs: - filter['metadata.Language'] = lang - - projection={"metadata": 1, "$vector": 1} - if return_text: - projection["content"] = 1 - - results = self.vectorDB.find( - filter, - projection=projection, - limit=1 - ) - - item = next(results, {}) - return item, item.get('$vector') - -class KeywordSearch(Search): - name = "Keyword Search" - - def __init__(self): - """ - Initialize nothing! - """ - pass - - def search(self, - query: str, - filter: dict = {}, - lang: str = 'en', - K: int = 5) -> list: - """ - Retrieve Wikidata items based on keyword matching for a given query string. - - Args: - query (str): The search query string. - filter (dict, optional): Additional filtering criteria. - lang (str): The language of the query. Defaults to 'en'. - K (int, optional): Number of top results to return. Defaults to 100. - - Returns: - list: A list of QIDs or PIDs of the results. - """ - - # If the query is a QID or PID, return it directly. - if re.fullmatch(r'[PQ]\d+', query): - return [query] - - query = self._clean_query(query, lang) - - if filter.get("metadata.InstanceOf"): - instance_of_filter = filter.get("metadata.InstanceOf")['$in'] - instance_of_filter = '|P31='.join(instance_of_filter) - instance_of_filter = "haswbstatement:P31=" + instance_of_filter - query = query + " " + instance_of_filter - - params = { - 'cirrusDumpResult': '', - 'search': query, - 'srlimit': K - } - headers = { - 'User-Agent': 'Wikidata Vector Database/Alpha Version (embedding@wikimedia.de)' - } - - if filter.get("metadata.IsItem", False): - params['ns0'] = 1 - if filter.get("metadata.IsProperty", False): - params['ns120'] = 1 - - url = "https://www.wikidata.org/w/index.php" - results = requests.get(url, params=params, headers=headers) - - results = results.json()['__main__']['result']['hits']['hits'] - qids = [item['_source']['title'] for item in results] - - return qids[:K] - - def _clean_query(self, query: str, lang: str) -> str: - """ - Remove stop words and split the query into individual terms separated by "OR" for the search. - - Parameters: - - query (str): The query string to process. - - Returns: - - str: The cleaned query string suitable for searching. - """ - if (not bool(lang)) or (lang == 'all'): - lang = 'en' - - # Remove stopwords - query = re.sub(r'[^\w\s]', '', query) - query_terms = [tok for tok in query.split() \ - if tok.lower() not in stopwords(lang)] - - # Join terms with "OR" for Elasticsearch compatibility - cleaned_query = " OR ".join(query_terms) - if cleaned_query == "": - return query - - # Max allowed characters is 300, required by the API - return cleaned_query[:300] - -class HybridSearch(Search): - def __init__(self, - api_keys: dict, - dest_lang: str = 'en', - vectordb_langs: list = []): - """ - Initialize the AstraDBConnect object with the corresponding embedding model. - - Args: - api_keys (dict): Credentials for DataStax Astra, including token and Jina API endpoint. - dest_lang (str): The destination language to translate to that best fits the vector database. - vectordb_langs (list): List of languages found in the vector database. - """ - self.embedding_model = JinaAIAPI(api_keys['JINA_API_KEY']) - - self.vectorsearch = VectorSearch( - api_keys, - self.embedding_model, - dest_lang, - vectordb_langs - ) - self.keywordsearch = KeywordSearch() - - def search(self, - query: str, - filter: dict = {}, - vs_K: int = 50, - ks_K: int = 5, - lang: str = 'all', - rerank: bool = False, - return_vectors: bool = False) -> list: - """ - Search for items based on the query and filter using both keyword and vector search. - - Args: - query (str): The search query string. - filter (dict, optional): Additional filtering criteria. - vs_K (int, optional): Number of top results from Vector Search. Defaults to 50. - ks_K (int, optional): Number of top results from Keyword Search. Defaults to 5. - src_lang (str): The source language of the query. Defaults to 'en'. - rerank (bool): Whether to rerank the results. Defaults to False. - return_vectors (bool): Whether to return the vector embeddings of the entity. Defaults to False. - - Returns: - list: A list of dictionaries containing search results. - """ - - def _vector_search_thread(): - local_query = query - - # Perform vector search - vector_results = self.vectorsearch.search( - local_query, - filter=filter, - lang=lang, - K=vs_K, - return_vectors=return_vectors, - return_text=rerank # If reranking is requested, we need the text - ) - - return vector_results - - def _keyword_search_thread(): - local_query = query - - # Perform keyword search - keyword_results = self.keywordsearch.search( - local_query, - filter=filter, - lang=lang, - K=ks_K - ) - - # Get similarity scores for keyword results - keyword_results = self.vectorsearch.get_similarity_scores( - local_query, - keyword_results, - lang=lang, - return_vectors=return_vectors, - return_text=rerank # If reranking is requested, we need the text - ) - - return keyword_results - - with ThreadPoolExecutor(max_workers=2) as ex: - f1 = ex.submit(_vector_search_thread) - f2 = ex.submit(_keyword_search_thread) - vector_results = f1.result() - keyword_results = f2.result() - - # Combine results using Reciprocal Rank Fusion - results = self.reciprocal_rank_fusion({ - self.vectorsearch.name: vector_results, - self.keywordsearch.name: keyword_results - }) - - if rerank: - # Rerank the results with the current Wikidata values. - - ids = [r.get('QID', r.get('PID')) for r in results] - wd_data = self.get_text_by_id( - ','.join(ids), - format='triplet', - lang=lang - ) - for i in range(len(results)): - rid = results[i].get('QID', results[i].get('PID')) - if rid in wd_data: - results[i]['text'] = wd_data[rid] - - results = [r for r in results if r['text']] - results = self.embedding_model.rerank(query, results) - - # Remove text from results to reduce payload size - for r in results: - r.pop('text', None) - - return results - - def reciprocal_rank_fusion(self, - results: dict, - k: int = 50) -> list: - """ - Combines search results into one list with RRF (Reciprocal Rank Fusion). - - Parameters: - - results (dict): Dictionary containing lists of results - - k (int): Smoothing factor - - Returns: - - list[dict]: where dict countains the QIDs or PIDs of the results and the similarity scores. - """ - scores = {} - - for source_name, source_results in results.items(): - - for rank, item in enumerate(source_results): - ID = item.get('QID', item.get('PID')) - - similarity_score = item.get('similarity_score', 0.0) - rrf_score = 1.0 / (k + rank + 1) - - if ID not in scores: - scores[ID] = { - **item, - 'rrf_score': rrf_score, - 'source': source_name, - } - - else: - scores[ID]['similarity_score'] = max( - similarity_score, - scores[ID].get('similarity_score', 0.0) - ) - scores[ID]['rrf_score'] += rrf_score - - if source_name not in scores[ID]['source']: - scores[ID]['source'] += f", {source_name}" - - fused_results = sorted( - scores.values(), - key=lambda x: (x["rrf_score"], x.get("similarity_score", 0.0)), - reverse=True - ) - return fused_results diff --git a/wikidatasearch/services/search/HybridSearch.py b/wikidatasearch/services/search/HybridSearch.py new file mode 100644 index 0000000..2773660 --- /dev/null +++ b/wikidatasearch/services/search/HybridSearch.py @@ -0,0 +1,306 @@ +from .Search import Search +from .VectorSearch import VectorSearch +from .KeywordSearch import KeywordSearch +from ..translator import Translator +from ..jina import JinaAIAPI + +from concurrent.futures import ThreadPoolExecutor +import re + +class HybridSearch(Search): + name = "Hybrid Search" + + def __init__(self, + api_keys, + dest_lang: str = "en", + vectordb_langs: list[str] | None = None, + max_K: int = 50): + """ + Initialize hybrid search with keyword and per-language vector backends. + + Args: + api_keys (dict): API credentials and AstraDB configuration. + dest_lang (str, optional): Default translation target language. + vectordb_langs (list[str] | None, optional): Languages available in the + vector database. + max_K (int, optional): Maximum number of vector neighbors requested per + shard. + """ + vectordb_langs = vectordb_langs or [] + collection = api_keys['ASTRA_DB_COLLECTION'] + self.embedding_model = JinaAIAPI(api_keys["JINA_API_KEY"]) + self.vectordb_langs = vectordb_langs + + self.vectorsearch = { + lang: VectorSearch( + api_keys, + collection, + lang, + embedding_model=self.embedding_model, + max_K=max_K + ) + for lang in vectordb_langs + } + self.keywordsearch = KeywordSearch() + self.translator = Translator(dest_lang) + + + def search(self, + query: str, + filter: dict | None = None, + embedding: list | None = None, + vs_K: int = 50, + ks_K: int = 5, + lang: str = 'all', + rerank: bool = False, + return_vectors: bool = False) -> list: + """ + Search for items based on the query and filter using both keyword and vector search. + + Args: + query (str): The search query string. + filter (dict, optional): Additional filtering criteria. + vs_K (int, optional): Number of top results from Vector Search. Defaults to 50. + ks_K (int, optional): Number of top results from Keyword Search. Defaults to 5. + lang (str): The source language of the query. Defaults to "all". + rerank (bool): Whether to rerank the results. Defaults to False. + return_vectors (bool): Whether to return the vector embeddings of the entity. Defaults to False. + + Returns: + list: A list of fused search results for items and/or properties. + """ + query_filter = dict(filter or {}) + is_id = re.fullmatch(r'[PQ]\d+', query) + + lang = (lang or "all").lower() + vector_query = query + + if lang != "all" and lang not in self.vectorsearch: + # Translate only if we are about to compute embedding here + if not is_id and embedding is None: + vector_query = self.translator.translate(query, src_lang=lang) + lang = "all" + + # Reuse embedding when provided + if not is_id and embedding is None: + embedding = self.embedding_model.embed_query(vector_query) + + num_shards = sum([int(vdblang == lang or lang == 'all') for vdblang, _ in self.vectorsearch.items()]) + num_shards = max(num_shards, 1) + vs_K = max(10, min(vs_K, (vs_K*2 +1)//num_shards)) + + with ThreadPoolExecutor(max_workers=4) as ex: + vfunc = [] + for vdblang, vdb in self.vectorsearch.items(): + if vdblang == lang or lang == 'all': + func = ex.submit( + vdb.search, + vector_query, + filter=query_filter.copy(), + embedding=embedding, + lang=vdblang, + K=vs_K, + return_vectors=return_vectors, + ) + vfunc.append((vdblang, func)) + + kfunc = ex.submit(self.keyword_search, + query, + filter=query_filter.copy(), + embedding=embedding, + lang=lang, + K=ks_K, + return_vectors=return_vectors) + + vector_results = {vdblang: f.result() for vdblang, f in vfunc} + keyword_results = kfunc.result() + + # Combine results using Reciprocal Rank Fusion + combined_results = [ + (self.vectorsearch[vdblang].name, vector_results[vdblang]) + for vdblang, _ in vfunc + ] + combined_results.append((self.keywordsearch.name, keyword_results)) + results = self.reciprocal_rank_fusion(combined_results) + results = results[:vs_K] + + if rerank: + # Rerank the results with the current Wikidata values. + ids = [r.get('QID', r.get('PID')) for r in results] + ids = [rid for rid in ids if rid] + if not ids: + return results + + wd_data = self.get_text_by_ids( + ids, + format='triplet', + lang=lang + ) + for i in range(len(results)): + rid = results[i].get('QID', results[i].get('PID')) + if rid in wd_data: + results[i]['text'] = wd_data[rid] + + results = [r for r in results if r.get('text')] + if not results: + return results + + results = self.embedding_model.rerank(query, results) + + # Remove text from results to reduce payload size + for r in results: + r.pop('text', None) + + return results + + def keyword_search(self, + query: str, + filter: dict | None = None, + embedding: list | None = None, + lang: str = 'all', + K: int = 50, + return_vectors: bool = False, + return_text: bool = False) -> list: + filter = filter or {} + + # Perform keyword search + keyword_results = self.keywordsearch.search( + query, + filter=filter, + lang=lang, + K=K + ) + + # Get similarity scores for keyword results + keyword_results = self.get_similarity_scores( + query, + keyword_results, + embedding=embedding, + lang=lang, + return_vectors=return_vectors, + return_text=return_text + ) + + return keyword_results + + + def get_similarity_scores(self, + query: str, + qids: list, + embedding: list | None = None, + lang: str = "all", + return_vectors: bool = False, + return_text: bool = False) -> list: + """ + Get similarity scores for a list of items against a query. + + Args: + query (str): The query string. + qids (list): The list of Wikidata IDs (QIDs/PIDs) to compare against. + lang (str): Query language. Defaults to "all". + return_vectors (bool): Whether to return vector representations. + return_text (bool): Whether to return text representations. + + Returns: + list: Similarity-scored entities sorted in descending score order. + """ + if not qids: + return [] + + if len(qids) > 100: + raise ValueError("Too many QIDs provided for similarity scoring. Please provide 100 or fewer QIDs.") + + is_id = re.fullmatch(r'[PQ]\d+', query) + lang = (lang or "all").lower() + vector_query = query + + if lang != "all" and lang not in self.vectorsearch: + # Translate only if we are about to compute embedding here + if not is_id and embedding is None: + vector_query = self.translator.translate(query, src_lang=lang) + lang = "all" + + # Reuse embedding when provided + if not is_id and embedding is None: + embedding = self.embedding_model.embed_query(vector_query) + + with ThreadPoolExecutor(max_workers=4) as ex: + vfunc = [] + for vdblang, vdb in self.vectorsearch.items(): + if vdblang == lang or lang == 'all': + func = ex.submit( + vdb.get_similarity_scores, + vector_query, + qids, + embedding=embedding, + return_vectors=return_vectors, + return_text=return_text + ) + vfunc.append((vdblang, func)) + + vector_results = [item for _, f in vfunc for item in f.result()] + + best_by_id = {} + for item in vector_results: + entity_id = item.get("QID") or item.get("PID") + if not entity_id: + continue + previous = best_by_id.get(entity_id) + if previous is None or item.get("similarity_score", 0.0) > previous.get("similarity_score", 0.0): + best_by_id[entity_id] = item + + results = sorted( + best_by_id.values(), + key=lambda x: x.get("similarity_score", 0.0), + reverse=True + ) + return results[:len(qids)] + + @staticmethod + def reciprocal_rank_fusion(results: list, + k: int = 50) -> list: + """ + Combine result lists with Reciprocal Rank Fusion (RRF). + + Args: + results (list): Sequence of `(source_name, source_results)` tuples. + k (int): Smoothing factor for rank contribution. + + Returns: + list[dict]: Fused results including QID/PID, similarity score, source, + and `rrf_score`. + """ + scores = {} + + for source_name, source_results in results: + + for rank, item in enumerate(source_results): + ID = item.get('QID', item.get('PID')) + + similarity_score = item.get('similarity_score', 0.0) + rrf_score = 1.0 / (k + rank + 1) + + if similarity_score > 0.0: + if ID not in scores: + scores[ID] = { + **item, + 'rrf_score': rrf_score, + 'source': source_name, + } + + else: + scores[ID]['similarity_score'] = max( + similarity_score, + scores[ID].get('similarity_score', 0.0) + ) + scores[ID]['rrf_score'] += rrf_score + + if source_name not in scores[ID]['source']: + scores[ID]['source'] += f", {source_name}" + + fused_results = sorted( + scores.values(), + key=lambda x: (x["rrf_score"], x.get("similarity_score", 0.0)), + reverse=True + ) + return fused_results diff --git a/wikidatasearch/services/search/KeywordSearch.py b/wikidatasearch/services/search/KeywordSearch.py new file mode 100644 index 0000000..3a545be --- /dev/null +++ b/wikidatasearch/services/search/KeywordSearch.py @@ -0,0 +1,94 @@ +from .Search import Search +from stopwordsiso import stopwords +import requests +import re + +class KeywordSearch(Search): + name = "Keyword Search" + + def __init__(self): + """ + Initialize nothing! + """ + pass + + def search(self, + query: str, + filter: dict | None = None, + lang: str = 'en', + K: int = 5) -> list: + """ + Retrieve Wikidata items based on keyword matching for a given query string. + + Args: + query (str): The search query string. + filter (dict, optional): Additional filtering criteria. + lang (str): The language of the query. Defaults to 'en'. + K (int, optional): Number of top results to return. Defaults to 100. + + Returns: + list: A list of QIDs or PIDs of the results. + """ + + filter = filter or {} + + # If the query is a QID or PID, return it directly. + if re.fullmatch(r'[PQ]\d+', query): + return [query] + + query = self._clean_query(query, lang) + + if filter.get("metadata.InstanceOf"): + instance_of_filter = filter.get("metadata.InstanceOf")['$in'] + instance_of_filter = '|P31='.join(instance_of_filter) + instance_of_filter = "haswbstatement:P31=" + instance_of_filter + query = query + " " + instance_of_filter + + params = { + 'cirrusDumpResult': '', + 'search': query, + 'srlimit': K + } + headers = { + 'User-Agent': 'Wikidata Vector Database/Alpha Version (embedding@wikimedia.de)' + } + + if filter.get("metadata.IsItem", False): + params['ns0'] = 1 + if filter.get("metadata.IsProperty", False): + params['ns120'] = 1 + + url = "https://www.wikidata.org/w/index.php" + results = requests.get(url, params=params, headers=headers) + results.raise_for_status() + + results = results.json()['__main__']['result']['hits']['hits'] + qids = [item['_source']['title'] for item in results] + + return qids[:K] + + def _clean_query(self, query: str, lang: str) -> str: + """ + Remove stop words and split the query into individual terms separated by "OR" for the search. + + Parameters: + - query (str): The query string to process. + + Returns: + - str: The cleaned query string suitable for searching. + """ + if (not bool(lang)) or (lang == 'all'): + lang = 'en' + + # Remove stopwords + query = re.sub(r'[^\w\s]', '', query) + query_terms = [tok for tok in query.split() \ + if tok.lower() not in stopwords(lang)] + + # Join terms with "OR" for Elasticsearch compatibility + cleaned_query = " OR ".join(query_terms) + if cleaned_query == "": + return query + + # Max allowed characters is 300, required by the API + return cleaned_query[:300] diff --git a/wikidatasearch/services/search/Search.py b/wikidatasearch/services/search/Search.py new file mode 100644 index 0000000..98eb22e --- /dev/null +++ b/wikidatasearch/services/search/Search.py @@ -0,0 +1,61 @@ +from abc import ABC, abstractmethod +import requests +import os + +class Search(ABC): + """ + Abstract base class for search functionality. + """ + name: str # The name of the search implementation. + + @abstractmethod + def search(self, + query: str, + filter: dict | None = None, + K: int = 100) -> list: + """ + Search for items based on the query and filter. + + Args: + query (str): The search query string. + filter (dict, optional): Additional filtering criteria. + K (int, optional): Number of top results to return. Defaults to 100. + + Returns: + list: A list of dictionaries containing search results. + """ + pass + + + def get_text_by_ids(self, ids, format='triplet', lang='en') -> str: + """ + Fetches the textual representations of a Wikidata entity by its QID. + + Args: + ids: A Wikidata entity ID. + + Returns: + text: A textual representation of the Wikidata entity. + """ + if (not bool(lang)) or (lang == 'all'): + lang = 'en' + + text = {} + for i in range(0, len(ids), 50): + qid = ','.join(ids[i:i + 50]) + params = { + 'id': qid, + 'lang': lang, + 'external_ids': False, + 'format': format + } + headers = { + 'User-Agent': 'Wikidata Vector Database (embedding@wikimedia.de)' + } + + url = os.environ.get("WD_TEXTIFIER_API", "https://wd-textify.wmcloud.org") + results = requests.get(url, params=params, headers=headers) + results.raise_for_status() + text.update(results.json()) + + return text diff --git a/wikidatasearch/services/search/VectorSearch.py b/wikidatasearch/services/search/VectorSearch.py new file mode 100644 index 0000000..d4476bc --- /dev/null +++ b/wikidatasearch/services/search/VectorSearch.py @@ -0,0 +1,353 @@ +from .Search import Search +from ..jina import JinaAIAPI + +import re + +from astrapy import DataAPIClient +from astrapy.api_options import APIOptions, TimeoutOptions + +class VectorSearch(Search): + name = "Vector Search" + + def __init__(self, + api_keys, + collection: str, + lang: str | None = None, + embedding_model=None, + max_K: int = 50 + ): + """ + Initialize the Vector Database connection and embedding model. + + Args: + api_keys (dict): API credentials for AstraDB and Jina. + collection (str): Base collection name. + lang (str | None, optional): Language shard suffix. If `None`, uses + non-language-specific collections. + embedding_model (object, optional): Pre-initialized embedding model. + max_K (int, optional): Maximum nearest-neighbor result size. + """ + ASTRA_DB_APPLICATION_TOKEN = api_keys['ASTRA_DB_APPLICATION_TOKEN'] + ASTRA_DB_API_ENDPOINT = api_keys['ASTRA_DB_API_ENDPOINT'] + JINA_API_KEY = api_keys['JINA_API_KEY'] + + timeout_options = TimeoutOptions(request_timeout_ms=100000) + api_options = APIOptions(timeout_options=timeout_options) + + client = DataAPIClient( + ASTRA_DB_APPLICATION_TOKEN, + api_options=api_options + ) + database0 = client.get_database(ASTRA_DB_API_ENDPOINT) + + if lang: + self.icollection = database0.get_collection( + f"{collection}_items_{lang}" + ) + self.pcollection = database0.get_collection( + f"{collection}_properties_{lang}" + ) + else: + self.icollection = database0.get_collection( + collection + ) + self.pcollection = database0.get_collection( + f"{collection}_properties" + ) + + if embedding_model is not None: + self.embedding_model = embedding_model + else: + self.embedding_model = JinaAIAPI(JINA_API_KEY) + + self.max_K = max_K + + def search(self, + query: str, + filter: dict | None = None, + embedding: list | None = None, + lang: str = 'all', + K: int = 50, + return_vectors: bool = False, + return_text: bool = False) -> list: + """ + Retrieve similar Wikidata items from the vector database for a given query string. + + Args: + query (str): The search query string. + filter (dict, optional): Additional filtering criteria. + embedding (list | None, optional): Precomputed query embedding. + lang (str): The language of the vectors to query. Defaults to 'all'. + K (int, optional): Number of top results to return. Defaults to 50. + return_vectors (bool): Whether to include vectors in the response. + return_text (bool): Whether to include text content in the response. + + Returns: + list: Deduplicated entities with QID/PID and similarity scores. + """ + query_filter = dict(filter or {}) + relevant_items = [] + + if embedding is None: + embedding, item = self.calculate_embedding( + query, + lang=lang, + return_text=return_text + ) + + if item: + ID_name = 'QID' if query.startswith('Q') else 'PID' + + # Include the entity in the results if it matches the filter. + item_search = (ID_name == 'QID') and (query_filter.get("metadata.IsItem", False)) + property_search = (ID_name == 'PID') and (query_filter.get("metadata.IsProperty", False)) + + if item_search or property_search: + item['$similarity'] = 1.0 + relevant_items.append(item) + + if embedding is None: + return relevant_items + + projection={"metadata": 1} + if return_text: + projection["content"] = 1 + if return_vectors: + projection["$vector"] = 1 + + relevant_items.extend(self.find( + query_filter, + sort={"$vector": embedding}, + projection=projection, + limit=K, + include_similarity=True, + )) + + relevant_items = VectorSearch.remove_duplicates( + relevant_items, + return_vectors=return_vectors, + return_text=return_text + ) + return relevant_items + + def calculate_embedding(self, + query, + lang: str = 'en', + return_text=False): + if re.fullmatch(r'[PQ]\d+', query): + item, embedding = self.get_embedding_by_id( + query, + return_text=return_text, + ) + + if not item: + try: + query_text = self.get_text_by_ids([query], format='text', lang=lang) + + query = query_text.get(query) + if not query: + return None, None + except Exception: + return None, None + else: + return embedding, item + + embedding = self.embedding_model.embed_query(query) + return embedding, None + + + def get_similarity_scores(self, + query: str, + qids: list, + embedding: list | None = None, + lang: str = 'all', + return_vectors: bool = False, + return_text: bool = False) -> list: + """ + Retrieve similarity scores for specific Wikidata IDs using one query. + + Args: + query (str): The search query string. + qids (list): A list of Wikidata IDs (QIDs/PIDs). + embedding (list | None, optional): Precomputed query embedding. + lang (str): The language of the vectors to query. Defaults to 'all'. + return_vectors (bool): Whether to return the vector embeddings of the entity. + return_text (bool): Whether to return the text content of the entity. + + Returns: + list: Matching entities with similarity scores. + """ + if not qids: + return [] + + if len(qids) > 100: + raise ValueError("Too many QIDs provided for similarity scoring. Please provide 100 or fewer QIDs.") + + if embedding is None: + embedding, _ = self.calculate_embedding( + query, + lang=lang, + return_text=return_text + ) + + if embedding is None: + return [] + + qids = list(set(qids)) + q_list = [q for q in qids if q.startswith("Q")] + p_list = [p for p in qids if p.startswith("P")] + + + projection={ + "metadata": 1, + "$vector": 1, + } + if return_text: + projection["content"] = 1 + + results = [] + if q_list: + filter = { + "metadata.QID": {"$in": q_list}, + "metadata.IsItem": True + } + results.extend(self.find( + filter, + projection=projection, + limit=None, + )) + if p_list: + filter = { + "metadata.PID": {"$in": p_list}, + "metadata.IsProperty": True + } + results.extend(self.find( + filter, + projection=projection, + limit=None, + )) + + relevant_items = [] + for item in results: + similarity = self.embedding_model.similarity( + embedding, + item.get("$vector") + ) + relevant_items.append({ + **item, + "$similarity": similarity + }) + + relevant_items = VectorSearch.remove_duplicates( + relevant_items, + return_vectors=return_vectors, + return_text=return_text + ) + return relevant_items + + + def get_embedding_by_id(self, qid, return_text = False): + """ + Fetch the stored embedding for one Wikidata entity ID. + + Args: + qid (str): A Wikidata entity ID (QID or PID). + return_text (bool): Whether to return the text content of the entity. + + Returns: + tuple[dict, list | None]: The matching database record and its vector. + """ + if qid.startswith("Q"): + filter = {"metadata.QID": qid, "metadata.IsItem": True} + else: + filter = {"metadata.PID": qid, "metadata.IsProperty": True} + + projection={"metadata": 1, "$vector": 1} + if return_text: + projection["content"] = 1 + + results = self.find( + filter, + projection=projection, + limit=1, + ) + + item = results[0] if results else {} + return item, item.get('$vector') + + + def find(self, + filter, + sort=None, + projection=None, + limit=50, + include_similarity=True): + query_filter = dict(filter or {}) + + collection = self.icollection + if query_filter.pop('metadata.IsProperty', False): + collection = self.pcollection + elif query_filter.pop('metadata.IsItem', False): + collection = self.icollection + elif "metadata.PID" in query_filter: + collection = self.pcollection + elif "metadata.QID" in query_filter: + collection = self.icollection + + if sort: + if limit is None: + limit = self.max_K + limit = max(1, min(limit, self.max_K)) + + results = collection.find( + query_filter, + sort=sort, + projection=projection or {"metadata": 1}, + limit=limit, + include_similarity=include_similarity + ) + else: + results = collection.find( + query_filter, + projection=projection or {"metadata": 1}, + ) + return list(results) + + @staticmethod + def remove_duplicates( + results, + return_vectors=False, + return_text=False + ): + + results = sorted( + results, + key=lambda x: x.get('$similarity', x.get('similarity_score', 0.0)), + reverse=True + ) + + seen_qids = set() + output = [] + + for item in results: + metadata = item.get("metadata", {}) + ID = metadata.get('QID', metadata.get('PID')) + if not ID: + continue + if ID not in seen_qids: + + ID_name = 'QID' if ID.startswith('Q') else 'PID' + item_output = { + ID_name: ID, + 'similarity_score': item.get('$similarity', item.get('similarity_score', 0.0)) + } + if return_vectors: + item_output['vector'] = item.get('$vector') + if return_text: + item_output['text'] = item.get('content', item.get('text')) + + output.append(item_output) + + seen_qids.add(ID) + + return output diff --git a/wikidatasearch/services/search/__init__.py b/wikidatasearch/services/search/__init__.py new file mode 100644 index 0000000..62a3022 --- /dev/null +++ b/wikidatasearch/services/search/__init__.py @@ -0,0 +1,5 @@ +from .KeywordSearch import KeywordSearch +from .VectorSearch import VectorSearch +from .HybridSearch import HybridSearch + +__all__ = ["KeywordSearch", "VectorSearch", "HybridSearch"] \ No newline at end of file