@liip/liipgpt 3.11.1 → 3.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/chat/liipgpt-chat.iife.js +2 -2
  2. package/chat/liipgpt-chat.js +2 -2
  3. package/config/index.cjs +3 -1
  4. package/config/index.d.ts +8 -0
  5. package/config/index.js +3 -1
  6. package/configurator/_app/env.js +1 -1
  7. package/configurator/_app/immutable/chunks/{CCYtl4Cx.js → 59Qy4pzN.js} +1 -1
  8. package/configurator/_app/immutable/chunks/{eDqi3535.js → 6ikKRAEA.js} +1 -1
  9. package/configurator/_app/immutable/chunks/{BCwS08XI.js → BBBsf1IY.js} +2 -2
  10. package/configurator/_app/immutable/chunks/{BKIpM6Uh.js → BZRp1cWz.js} +1 -1
  11. package/configurator/_app/immutable/chunks/{Ck-AVw0N.js → Bzr04ZcD.js} +1 -1
  12. package/configurator/_app/immutable/chunks/{B1_pfFrT.js → C1yKSdkL.js} +1 -1
  13. package/configurator/_app/immutable/chunks/{C89VvXMY.js → C32fguu7.js} +1 -1
  14. package/configurator/_app/immutable/chunks/{BJUZhA68.js → CD6_VnKE.js} +1 -1
  15. package/configurator/_app/immutable/chunks/CIHHNprL.js +1 -0
  16. package/configurator/_app/immutable/chunks/{_oGHvI2z.js → COh_IaBC.js} +1 -1
  17. package/configurator/_app/immutable/chunks/Ct3VxfiR.js +1 -0
  18. package/configurator/_app/immutable/chunks/CzUv7c8S.js +1 -0
  19. package/configurator/_app/immutable/chunks/{ZTjVhqEP.js → DBQyBiSh.js} +2 -2
  20. package/configurator/_app/immutable/chunks/{BqUlvFpk.js → MXZgHzgQ.js} +1 -1
  21. package/configurator/_app/immutable/chunks/{avJin-Fq.js → SzunIEqj.js} +1 -1
  22. package/configurator/_app/immutable/chunks/{CMvCHhSP.js → s6x81Lfq.js} +1 -1
  23. package/configurator/_app/immutable/entry/{app.DeI6KmEL.js → app.B_61kXQ4.js} +2 -2
  24. package/configurator/_app/immutable/entry/start.BOhSSe81.js +1 -0
  25. package/configurator/_app/immutable/nodes/{0.BT5ERCvw.js → 0.Bi08LRX0.js} +2 -1
  26. package/configurator/_app/immutable/nodes/{1.Ck4X0PzJ.js → 1.E_trvDMx.js} +1 -1
  27. package/configurator/_app/immutable/nodes/{2.DH-Gvey4.js → 2.BNeVNh0R.js} +9 -9
  28. package/configurator/_app/immutable/nodes/{3.CeOJQlnp.js → 3.D1rPht9H.js} +1 -1
  29. package/configurator/_app/version.json +1 -1
  30. package/configurator/index.html +6 -6
  31. package/configurator/sidebar.html +6 -6
  32. package/index.cjs +4 -1
  33. package/index.d.ts +45 -0
  34. package/index.js +4 -1
  35. package/package.json +1 -1
  36. package/search-summary/liipgpt-search-summary.iife.js +1 -1
  37. package/search-summary/liipgpt-search-summary.js +1 -1
  38. package/configurator/_app/immutable/chunks/D3wB30_g.js +0 -1
  39. package/configurator/_app/immutable/chunks/pHVM4a9g.js +0 -1
  40. package/configurator/_app/immutable/chunks/s8dY_eYY.js +0 -1
  41. package/configurator/_app/immutable/entry/start.B2WsGlY5.js +0 -1
@@ -57,7 +57,7 @@ ${e}</tr>
57
57
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
58
58
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${il(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=al(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+il(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=al(e);if(i===null)return il(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${il(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:il(e.text)}},ml=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},hl=class e{options;renderer;textRenderer;constructor(e){this.options=e||Zs,this.options.renderer=this.options.renderer||new pl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ml}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
59
59
  `+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},gl=class{options;block;constructor(e){this.options=e||Zs}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?fl.lex:fl.lexInline}provideParser(){return this.block?hl.parse:hl.parseInline}},_l=class{defaults=Xs();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=hl;Renderer=pl;TextRenderer=ml;Lexer=fl;Tokenizer=dl;Hooks=gl;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new pl(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new dl(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new gl;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];gl.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return fl.lex(e,t??this.defaults)}parser(e,t){return hl.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?fl.lex:fl.lexInline,s=i.hooks?i.hooks.provideParser():e?hl.parse:hl.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
60
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+il(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},vl=new _l;function q(e,t){return vl.parse(e,t)}q.options=q.setOptions=function(e){return vl.setOptions(e),q.defaults=vl.defaults,Qs(q.defaults),q},q.getDefaults=Xs,q.defaults=Zs,q.use=function(...e){return vl.use(...e),q.defaults=vl.defaults,Qs(q.defaults),q},q.walkTokens=function(e,t){return vl.walkTokens(e,t)},q.parseInline=vl.parseInline,q.Parser=hl,q.parser=hl.parse,q.Renderer=pl,q.TextRenderer=ml,q.Lexer=fl,q.lexer=fl.lex,q.Tokenizer=dl,q.Hooks=gl,q.parse=q,q.options,q.setOptions,q.use,q.walkTokens,q.parseInline,hl.parse,fl.lex;var yl=e=>(Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t];n&&typeof n==`object`&&yl(n)}),Object.freeze(e)),bl=yl({all:[],used:[],unused:[]}),xl=(e,t)=>{let n=Ys(e);return n.addHook(`uponSanitizeElement`,function(e,t){let n=t.tagName||e.nodeName.toLowerCase();n.startsWith(`liipgpt-`)&&(t.allowedTags[n]=!0)}),n.addHook(`afterSanitizeAttributes`,function(e){if(e.tagName!==`A`||!e.getAttribute(`href`)?.startsWith(`http`)||(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`),!t||e.querySelector(`.sr-only`)))return;let n=e.ownerDocument.createElement(`span`);n.className=`sr-only`,n.textContent=` ${t}`,e.appendChild(n)}),n},Sl=class{marked;currentReferences=bl;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new _l({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=xl(e.window,e.newTabSrText)}createFootnoteExtension=()=>{let e=this;return{extensions:[{name:`footnote`,level:`inline`,start(e){return e.match(/\[\^(\d+(?:\.\d+)?)\]/)?.index},tokenizer(e){let t=/^\[\^(\d+(?:\.\d+)?)\]/.exec(e);if(t){let[e,n]=t;return{type:`footnote`,raw:e,refNumber:n}}},renderer(t){if(t.type===`footnote`){let n=e.currentReferences.all,r=n.some(e=>e.citationId!==void 0)?n.findIndex(e=>e.citationId===t.refNumber):/^\d+$/.test(t.refNumber)?Number(t.refNumber)-1:-1,i=e.currentReferences.all[r];if(!i)return console.error(`Could not find ref for citation:`,t.refNumber),``;let a;return i?.referenceIndex.used?a=i.referenceIndex.used:(e.currentReferences.used.push(i),e.lastUsedIndex++,a=e.lastUsedIndex,i.referenceIndex.used=a),` <liipgpt-reference-number data-all-index="${r}" data-used-index="${a}" data-source="${JSON.stringify(i).replace(/"/g,`&quot;`)}"></liipgpt-reference-number>`}}}]}};parse(e){return this.DomPurity.sanitize(this.marked.parse(e),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:[`hr`],ADD_ATTR:[`target`]})}toHTML(e,t){this.currentReferences=t;let n=this.parse(e);return this.currentReferences=bl,n}};function Cl(){let e,t;return{promise:new Promise((n,r)=>{t=n,e=r}),reject:e,resolve:t}}var wl=class{promise;resolve;reject;constructor(){let{promise:e,resolve:t,reject:n}=Cl();this.promise=e,this.resolve=t,this.reject=n}then(e,t){return this.promise.then(e,t)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]=`Flag`},Tl=class{hasValue=new wl;currentValue;setValue(e){this.currentValue=e,this.hasValue.resolve()}cleanup(e){this.hasValue.reject(e)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(e,t){return this.toPromise().then(e,t)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]=`FutureValue`},El=e=>{try{return new URL(e).hostname}catch{return e}};function Dl(e){return e.replace(/<[^>]*>/g,``).replace(/&nbsp;/g,` `).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`)}var Ol=({citationId:e,url:t,considered:n,title:r,description:i,summary:a})=>{let o=El(t),s=i||a;return{...e?{citationId:e}:{},url:t,considered:n,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:s,badge:t},listItem:{title:r,badge:o}}}},kl=class{store;content=new Tl;backendSendsMappedRefs=!1;constructor(e){this.options=e,this.store=nt({id:e.id,state:`loading`,errors:[],type:`bot`,time:new Date().toISOString(),message:{markdown:``,html:``,text:``},references:{all:[],used:[],unused:[]},retrievalQuestion:e.userQuestion})}pushError(e){this.options.onError?.(e),this.store.update(t=>({...t,errors:[...t.errors,e]}))}updateRequestId(e){this.store.update(t=>({...t,id:e}))}updateText(e){this.store.update(t=>{let n=t.message.markdown+e,r=this.options.markdownRenderer.toHTML(n,t.references);return{...t,state:`streaming`,message:{markdown:n,html:r,text:``}}})}finishMessage(){this.store.update(e=>{let t={...e,state:`done`};return t.references.unused=t.references.all.filter(e=>e.referenceIndex.used===void 0),t.message.text=Dl(t.message.html),this.options?.onFinish?.(t),this.content.setValue(t),t})}addReference(e){this.store.update(t=>{let n=t.references.all,r=n.length,i=[...n,{...e,referenceIndex:{all:r}}];return{...t,references:{used:t.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(Ol(e))}updateRetrievalQuestion(e){this.store.update(t=>({...t,retrievalQuestion:e}))}setNoFeedback(){this.store.update(e=>({...e,noFeedback:!0}))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}},Al=[{type:`email`,check:e=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(e)},{type:`creditCard`,check:e=>/\b(?:\d[ -]*?){13,16}\b/.test(e)},{type:`ahv`,check:e=>/\b756\.\d{4}\.\d{4}\.\d{2}\b/.test(e)},{type:`phoneSwiss`,check:e=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(e)},{type:`phoneInternational`,check:e=>/(?:\+|00)(?:\s*\d){10,}\b/.test(e)},{type:`swissPassport`,check:e=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(e)},{type:`longNumber`,check:e=>/\b\d{9,}\b/.test(e)}];Object.freeze({status:`aborted`});function J(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var jl=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ml={};function Nl(e){return e&&Object.assign(Ml,e),Ml}function Pl(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Fl(e,t){return typeof t==`bigint`?t.toString():t}function Il(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Ll(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var Rl=Symbol(`evaluating`);function zl(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Rl)return r===void 0&&(r=Rl,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Bl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Vl(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}var Hl=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ul(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Wl(e){if(Ul(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Ul(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Gl(e){return Wl(e)?{...e}:Array.isArray(e)?[...e]:e}var Kl=new Set([`string`,`number`,`symbol`]);function ql(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Jl(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Yl(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Xl(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Zl={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ql(e,t){if(!Wl(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Jl(e,Vl(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Bl(this,`shape`,n),n}}))}function $l(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Jl(t,Vl(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Bl(this,`shape`,i),i},checks:[]}))}function eu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function tu(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function nu(e){return typeof e==`string`?e:e?.message}function ru(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=nu(e.inst?._zod.def?.error?.(e))??nu(t?.error?.(e))??nu(n.customError?.(e))??nu(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}var iu=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Fl,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},au=J(`$ZodError`,iu),ou=J(`$ZodError`,iu,{Parent:Error}),su=(e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new jl;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ru(e,a,Nl())));throw Hl(t,i?.callee),t}return o.value})(ou),cu=(e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ru(e,a,Nl())));throw Hl(t,i?.callee),t}return o.value})(ou),lu=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new jl;return a.issues.length?{success:!1,error:new(e??au)(a.issues.map(e=>ru(e,i,Nl())))}:{success:!0,data:a.value}})(ou),uu=(e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ru(e,i,Nl())))}:{success:!0,data:a.value}})(ou),du=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;`${du}`;function fu(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pu(e){let t=fu({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${du}T(?:${r})$`)}var mu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},hu=/^-?\d+$/,gu=/^-?\d+(?:\.\d+)?$/,_u=/^(?:true|false)$/i,vu=J(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),yu=J(`$ZodCheckNumberFormat`,(e,t)=>{vu.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Zl[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=hu)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),bu=J(`$ZodCheckStringFormat`,(e,t)=>{var n,r;vu.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),xu={major:4,minor:3,patch:6},Su=J(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xu;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=eu(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new jl;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=eu(e,t))});else{if(e.issues.length===t)continue;r||=eu(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(eu(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new jl;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new jl;return o.then(e=>t(e,r,a))}return t(o,r,a)}}zl(e,`~standard`,()=>({validate:t=>{try{let n=lu(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return uu(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Cu=J(`$ZodString`,(e,t)=>{Su.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??mu(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),wu=J(`$ZodStringFormat`,(e,t)=>{bu.init(e,t),Cu.init(e,t)}),Tu=J(`$ZodURL`,(e,t)=>{wu.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Eu=J(`$ZodISODateTime`,(e,t)=>{t.pattern??=pu(t),wu.init(e,t)}),Du=J(`$ZodNumber`,(e,t)=>{Su.init(e,t),e._zod.pattern=e._zod.bag.pattern??gu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Ou=J(`$ZodNumberFormat`,(e,t)=>{yu.init(e,t),Du.init(e,t)}),ku=J(`$ZodBoolean`,(e,t)=>{Su.init(e,t),e._zod.pattern=_u,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Au=J(`$ZodUnknown`,(e,t)=>{Su.init(e,t),e._zod.parse=e=>e});function ju(e,t,n){e.issues.length&&t.issues.push(...tu(n,e.issues)),t.value[n]=e.value}var Mu=J(`$ZodArray`,(e,t)=>{Su.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ju(t,n,e))):ju(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Nu(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...tu(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Pu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Xl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Fu(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Nu(e,n,i,t,u))):Nu(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Iu=J(`$ZodObject`,(e,t)=>{if(Su.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Il(()=>Pu(t));zl(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Ul,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Nu(n,t,e,s,r))):Nu(i,t,e,s,r)}return i?Fu(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}});function Lu(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!eu(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ru(e,r,Nl())))}),t)}var Ru=J(`$ZodUnion`,(e,t)=>{Su.init(e,t),zl(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),zl(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),zl(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),zl(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ll(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Lu(t,i,e,a)):Lu(s,i,e,a)}}),zu=J(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ru.init(e,t);let n=e._zod.parse;zl(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Il(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Ul(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Bu=J(`$ZodIntersection`,(e,t)=>{Su.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Hu(e,t,n)):Hu(e,i,a)}});function Vu(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Wl(e)&&Wl(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Vu(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Vu(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Hu(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),eu(e))return e;let o=Vu(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Uu=J(`$ZodRecord`,(e,t)=>{Su.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Wl(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...tu(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...tu(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&gu.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ru(e,r,Nl())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...tu(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...tu(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Wu=J(`$ZodEnum`,(e,t)=>{Su.init(e,t);let n=Pl(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Kl.has(typeof e)).map(e=>typeof e==`string`?ql(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Gu=J(`$ZodLiteral`,(e,t)=>{if(Su.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ql(e):e?ql(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}});function Ku(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var qu=J(`$ZodOptional`,(e,t)=>{Su.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,zl(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),zl(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ll(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Ku(t,e.value)):Ku(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ju=J(`$ZodNullable`,(e,t)=>{Su.init(e,t),zl(e._zod,`optin`,()=>t.innerType._zod.optin),zl(e._zod,`optout`,()=>t.innerType._zod.optout),zl(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ll(e.source)}|null)$`):void 0}),zl(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Yu=J(`$ZodDefault`,(e,t)=>{Su.init(e,t),e._zod.optin=`optional`,zl(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Xu(e,t)):Xu(r,t)}});function Xu(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Zu,Qu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function $u(){return new Qu}(Zu=globalThis).__zod_globalRegistry??(Zu.__zod_globalRegistry=$u()),globalThis.__zod_globalRegistry;function ed(e,t){return new e({type:`string`,...Yl(t)})}function td(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Yl(t)})}function nd(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Yl(t)})}function rd(e,t){return new e({type:`number`,checks:[],...Yl(t)})}function id(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Yl(t)})}function ad(e,t){return new e({type:`boolean`,...Yl(t)})}function od(e){return new e({type:`unknown`})}var sd=J(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);Su.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>su(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>lu(e,t,n),e.parseAsync=async(t,n)=>cu(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>uu(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>Jl(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),cd=J(`ZodMiniString`,(e,t)=>{Cu.init(e,t),sd.init(e,t)});function Y(e){return ed(cd,e)}var ld=J(`ZodMiniStringFormat`,(e,t)=>{wu.init(e,t),cd.init(e,t)}),ud=J(`ZodMiniURL`,(e,t)=>{Tu.init(e,t),ld.init(e,t)});function dd(e){return td(ud,e)}var fd=J(`ZodMiniNumber`,(e,t)=>{Du.init(e,t),sd.init(e,t)});function pd(e){return rd(fd,e)}var md=J(`ZodMiniNumberFormat`,(e,t)=>{Ou.init(e,t),fd.init(e,t)});function hd(e){return id(md,e)}var gd=J(`ZodMiniBoolean`,(e,t)=>{ku.init(e,t),sd.init(e,t)});function X(e){return ad(gd,e)}var _d=J(`ZodMiniUnknown`,(e,t)=>{Au.init(e,t),sd.init(e,t)});function vd(){return od(_d)}var yd=J(`ZodMiniArray`,(e,t)=>{Mu.init(e,t),sd.init(e,t)});function Z(e,t){return new yd({type:`array`,element:e,...Yl(t)})}var bd=J(`ZodMiniObject`,(e,t)=>{Iu.init(e,t),sd.init(e,t),zl(e,`shape`,()=>t.shape)});function Q(e,t){return new bd({type:`object`,shape:e??{},...Yl(t)})}function xd(e,t){return Ql(e,t)}function Sd(e,t){return $l(Id,e,t)}var Cd=J(`ZodMiniUnion`,(e,t)=>{Ru.init(e,t),sd.init(e,t)});function wd(e,t){return new Cd({type:`union`,options:e,...Yl(t)})}var Td=J(`ZodMiniDiscriminatedUnion`,(e,t)=>{zu.init(e,t),sd.init(e,t)});function Ed(e,t,n){return new Td({type:`union`,options:t,discriminator:e,...Yl(n)})}var Dd=J(`ZodMiniIntersection`,(e,t)=>{Bu.init(e,t),sd.init(e,t)});function Od(e,t){return new Dd({type:`intersection`,left:e,right:t})}var kd=J(`ZodMiniRecord`,(e,t)=>{Uu.init(e,t),sd.init(e,t)});function Ad(e,t,n){return new kd({type:`record`,keyType:e,valueType:t,...Yl(n)})}function jd(e,t,n){let r=Jl(e);return r._zod.values=void 0,new kd({type:`record`,keyType:r,valueType:t,...Yl(n)})}var Md=J(`ZodMiniEnum`,(e,t)=>{Wu.init(e,t),sd.init(e,t),e.options=Object.values(t.entries)});function Nd(e,t){return new Md({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Yl(t)})}var Pd=J(`ZodMiniLiteral`,(e,t)=>{Gu.init(e,t),sd.init(e,t)});function Fd(e,t){return new Pd({type:`literal`,values:Array.isArray(e)?e:[e],...Yl(t)})}var Id=J(`ZodMiniOptional`,(e,t)=>{qu.init(e,t),sd.init(e,t)});function $(e){return new Id({type:`optional`,innerType:e})}var Ld=J(`ZodMiniNullable`,(e,t)=>{Ju.init(e,t),sd.init(e,t)});function Rd(e){return new Ld({type:`nullable`,innerType:e})}var zd=J(`ZodMiniDefault`,(e,t)=>{Yu.init(e,t),sd.init(e,t)});function Bd(e,t){return new zd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Gl(t)}})}var Vd=J(`ZodMiniISODateTime`,(e,t)=>{Eu.init(e,t),ld.init(e,t)});function Hd(e){return nd(Vd,e)}var Ud=Q({name:Y(),namePlural:$(Y()),intro:$(Y()),placeholder:Y(),values:Ad(Y(),Y())}),Wd=Q({introductionTitle:Y(),introductionDisclaimer:$(Y()),termsInvitationToConsent:$(Y()),chatInputPlaceholder:Y(),chatInputPlaceholderListening:$(Y()),chatInputSubmit:Y(),chatInputAbort:Y(),chatInputStartListening:Y(),chatInputStopListening:Y(),referenceLink:Y(),referencesDisplay:Y(),referencesHide:Y(),referencesTitle:Y(),referencesFurtherTitle:Y(),newChat:Y(),maintenanceModeError:Y(),messageBotLoading:Y(),messageBotError:Y(),messageBotDefaultError:Y(),noResultsFound:Y(),chatFooterText:$(Y()),scrollToBottom:Y(),openButtonTitle:$(Y()),openButtonDescription:$(Y()),openMenu:Y(),openInfo:Y(),aboutThisChat:$(Y()),closeMenu:Y(),closeChat:Y(),close:Y(),send:Y(),thankYouForFeedback:Y(),answerFormThankYou:Y(),giveFeedback:Y(),sendFeedback:Y(),feedbackFormTitle:Y(),feedbackFormMessage:Y(),feedbackFormMessagePlaceholder:Y(),feedbackFormEmail:Y(),feedbackFormEmailPlaceholder:Y(),askQuestionAgain:Y(),answerGood:Y(),answerBad:Y(),classificationSubmit:Y(),classificationThankYou:Y(),classificationTitle:Y(),selectLanguage:Y(),languageChanged:Y(),selectColorTheme:Y(),lightMode:Y(),darkMode:Y(),ariaMainNavigation:Y(),ariaMainNavigationInfo:Y(),ariaMainNavigationLinks:Y(),ariaMainNavigationLanguageSwitch:Y(),ariaMainNavigationColorMode:Y(),ariaGotoMainNavigation:Y(),ariaAskQuestion:Y(),ariaAskQuestionRegion:Y(),ariaNotifications:Y(),ariaPredefinedQuestions:Y(),ariaPredefinedQuestionsRegion:Y(),ariaChatHistory:Y(),ariaOpenChat:Y(),ariaQuestionFromYou:Y(),ariaAnswerFromBot:Y(),ariaLastAnswerNavigation:Y(),ariaQuestionSent:Y(),ariaAnswerReady:Y(),ariaAnswerFinished:Y(),ariaAnswerFinishedWithSelectedTopic:Y(),ariaAskQuestionAgain:Y(),ariaAnswerGood:Y(),ariaAnswerBad:Y(),ariaReferenceSource:Y(),ariaGiveFeedback:Y(),ariaAnswerForm:Y(),ariaLanguageChanged:Y(),ariaLightSelected:Y(),ariaDarkSelected:Y(),ariaSettings:Y(),ariaSettingsRegion:Y(),ariaReferencesRegion:Y(),ariaOpensInNewTab:Y(),ariaPageTitle:Y(),ariaCloseWithEsc:Y(),ariaInfoTitle:Y(),ariaFlyoutRegion:Y(),ariaSelected:Y(),ariaUnselected:Y(),ariaAllSelected:Y(),ariaAllUnselected:Y(),ariaAllReseted:Y(),ariaChangeTopic:Y(),popups:$(Z(Q({hash:Y(),title:Y(),content:Y(),actions:$(Z(Q({action:Y(),label:Y(),type:$(Nd([`primary`,`secondary`]))})))}))),termsAcceptButton:$(Y()),termsReadButton:$(Y()),selectors:$(Ad(Y(),Ud)),hideSettings:Y(),showSettings:Y(),chooseAtLeastOneOption:Y(),selectAll:Y(),selectNone:Y(),resetToDefaults:Y(),messageTooLong:Y(),selectedTopic:Y(),changeTopic:Y(),searchSummaryExpand:Y(),searchSummaryCollapse:Y(),searchSummaryOptInDefault:Y(),searchSummaryOptOut:Y(),searchSummaryError:Y(),searchSummaryDisclaimer:$(Y()),searchSummaryLoading:Y(),searchSummaryFollowUpPlaceholder:Y(),searchSummaryFollowUpSubmit:Y(),ariaSearchSummaryExpand:Y(),ariaSearchSummaryCollapse:Y(),ariaSearchSummaryOptOut:Y(),ariaSearchSummaryFollowUpInput:Y(),jsonLdEventDate:Y(),jsonLdEventLocation:Y(),jsonLdEventDescription:Y(),jsonLdEventCtaLabel:Y(),jsonLdCtaLabel:Y(),jsonLdMapOpenMap:Y(),ariaJsonLdMapCanvas:Y(),ariaJsonLdEventCard:Y(),ariaJsonLdMapCard:Y(),ariaJsonLdCtaCard:Y()}),Gd=Nd(e),Kd=jd(Gd,xd(Sd(Wd),{selectors:$(Ad(Y(),Ud))})),qd=jd(Gd,Y()),Jd=Od(Ed(`componentName`,[Q({componentName:Fd(`buttons`),data:Q({caption:$(Y()),buttons:Z(Q({label:Y(),href:$(dd()),value:Y(),variant:$(Nd([`primary`,`secondary`,`tertiary`])),icon:$(Y()),target:$(Y())}))})}),Q({componentName:Fd(`combobox`),data:Q({caption:$(qd),placeholder:qd,values:Z(Q({label:qd,value:Y(),metadata:$(Ad(Y(),vd()))})),removeComponentAfterValueSelection:$(X()),selectorKey:$(Y())})}),Q({componentName:Fd(`alva-init`),data:Q({})}),Q({componentName:Fd(`alva-score-survey`),data:Q({})})]),Q({type:Fd(`component`),id:$(Y()),time:$(Y()),hideAvatar:$(X()),noSectionPadding:$(X()),hideChatInput:$(X())})),Yd=wd([Y(),pd(),X(),Z(Y()),Z(pd()),Z(X())]),Xd=Q({title:Y(),description:$(Y()),badge:$(Y()),breadcrumbs:$(Z(Y())),previewImage:$(Y()),date:$(Hd())}),Zd=xd(Q({url:dd(),score:pd(),metadata:Ad(Y(),Yd),language:$(Y())}),Xd.shape),Qd=Q({type:Fd(`user`),time:Y(),message:Y(),id:$(Y())}),$d=xd(Q({citationId:$(Y()),url:Y(),score:pd(),metadata:Ad(Y(),wd([Y(),pd(),X(),Z(Y()),Z(pd()),Z(X())])),considered:X(),display:Q({card:Xd,listItem:Xd})}),{referenceIndex:Q({all:pd(),used:$(pd())})}),ef=Q({type:Fd(`bot`),time:Y(),id:Y(),message:Q({markdown:Y(),html:Y(),text:Y()}),references:Q({all:Z($d),used:Z($d),unused:Z($d)}),errors:Z(wd([Nd([`pii-detected`,`blocked`,`maintenance`,`rate-limit`,`server-error`,`too-short`,`too-long`,`quota-reached`,`aborted`]),Fd(`sse-error`),Fd(`client-error`),Fd(`unexpected-call`)])),retrievalQuestion:$(Y()),noFeedback:$(X()),feedback:$(Nd([`up`,`down`]))}),tf=wd([wd([xd(ef,{state:Fd(`loading`)}),xd(ef,{state:Nd([`streaming`,`done`])})]),Qd,Jd]),nf=Z(Q({question:Y(),answer:Y()})),rf=wd([Q({minRem:pd(),maxRem:pd()}),Y()]),af=Q({0:$(Y()),50:Y(),100:Y(),200:Y(),300:Y(),400:Y(),500:Y(),600:Y(),700:Y(),800:Y(),900:Y(),950:Y(),1e3:$(Y())}),of=Q({color:$(Y()),background:$(Y()),borderWidth:$(Y()),borderColor:$(Y()),boxShadow:$(Y())}),sf=Q({customCSS:$(Y()),fontCSS:$(Y()),fontURLs:$(Z(Y())),tokens:$(Q({font:$(Q({family:$(Y())})),colors:$(Q({brand:$(Sd(af)),accent:$(Sd(af)),highlight:$(Sd(af)),grey:$(Sd(af))})),base:$(Q({fontSizeXs:$(rf),fontSizeSm:$(rf),fontSizeBody:$(rf),fontSizeH3:$(rf),fontSizeH2:$(rf),fontSizeH1:$(rf),fontWeightNormal:$(Y()),fontWeightBold:$(Y()),fontWeightTitle:$(Y()),lineHeightDefault:$(Y()),lineHeightSnug:$(Y()),lineHeightTight:$(Y()),borderRadius:$(rf),lineColor:$(Y()),boxShadow:$(Y())})),components:$(Ad(Y(),Od(Q({borderRadius:$(rf),custom:$(Ad(Y(),wd([Y(),pd()]))),hover:$(of),focus:$(of)}),of))),svgs:$(jd(Nd(`predefinedQuestion.edit.newConversation.voteUp.voteDown.retry.message.messageLoading.thread.submit.abort.expand.help.attach.record.reward.share.audio.copy.dismiss.menu.info.menuClose.chevronDown.chevronUp.chevronTopDown.chevronDownSmall.internalLink.externalLink.liip.avatar.avatarLarge.openChat.speechInput.listUnordered.lightMode.darkMode.settings.settingsClose.sources.model.checkbox.warning.topic.headerLogo.embedAvatar.forward.phone.email`.split(`.`)),Y()))}))}),cf=Q({light:$(sf),dark:$(sf)}),lf=Q({50:Y(),100:Y(),200:Y(),300:Y(),400:Y(),500:Y(),600:Y(),700:Y(),800:Y(),900:Y(),950:Y()}),uf=Nd([`slate`,`gray`,`zinc`,`neutral`,`stone`,`red`,`orange`,`amber`,`yellow`,`lime`,`green`,`emerald`,`teal`,`cyan`,`sky`,`blue`,`indigo`,`violet`,`purple`,`fuchsia`,`pink`,`rose`]),df=wd([lf,uf]),ff=Q({avatarImageUrl:$(Y()),colors:$(Q({brand:$(df),highlight:$(df),grey:$(wd([Od(lf,Q({0:Y(),1e3:Y()})),uf])),background:$(Y()),text:$(Y()),anchor:$(Q({default:$(Y()),hover:$(Y())}))})),font:$(Q({family:$(Y()),urls:$(Z(Y())),sizeXs:$(rf),sizeSm:$(rf),sizeBody:$(rf),sizeH3:$(rf),sizeH2:$(rf),sizeH1:$(rf),weightNormal:$(Y()),weightBold:$(Y()),weightTitle:$(Y())})),borderRadius:$(rf),fineGrained:$(cf)}),pf=Q({label:Y(),options:Z(Q({label:Y(),value:pd()}))}),mf=Q({label:Y(),icon:Y(),url:Y(),target:$(Nd([`_blank`,`_self`]))}),hf=Q({id:$(Y()),label:Rd(Y()),question:Y(),switchQuestionId:$(Y())}),gf=Q({impact:$(pf),quality:$(pf)}),_f=Q({predefinedQuestions:Z(hf)}),vf=wd([Q({maintenance:Fd(!0)}),Q({id:Y(),cID:Y()})]),yf=Q({settingName:Y(),iconName:Y(),settingIntro:$(Y()),type:Nd([`single-select`,`multi-select`]),allowEmpty:X(),values:Z(Y()),defaultValues:$(Z(Y()))}),bf=Q({receiverEmail:Y(),triggerLabel:qd,title:$(qd),caption:$(qd),submitLabel:qd,fields:Z(Q({type:Nd([`text`,`select`,`checkbox`,`radio`]),name:Y(),label:qd,placeholder:$(qd),required:$(X()),options:$(Z(Q({value:Y(),label:qd})))}))}),xf=Q({before:$(Z(tf)),after:$(Z(tf))}),Sf=Od(Sd(Q({forcePredefinedQuestions:$(X()),forceChatPage:$(X()),showOverallFeedbackButton:X(),showOverallFeedbackEmail:X(),showCloseChatButton:X(),showContextMenu:X(),showContextInfo:X(),showReferencesByDefault:X(),showExpandedSelectors:X(),showTextFeedback:X(),inlineLayout:X(),allowAudioInput:X(),blockPII:X(),questionPrefix:Y(),menu:$(jd(Gd,Z(mf))),supportedLanguages:Z(Gd),classification:$(gf),answerForm:$(bf),theme:ff,translations:Kd,buttonHref:$(Y()),addQueryToUrlParams:$(X()),addRetrievalQuestionToUrlParams:$(X()),renderKatex:$(X()),reflectLanguageInPath:$(X()),sendReferrer:$(Nd([`all`,`own`,`none`,`location`])),selectorsConfig:Bd(Z(yf),[]),questionLengthLimit:$(pd()),forceConsent:$(X()),askQuestionAgain:X(),enableBackdrop:$(X()),parentPageContext:Q({extractSelectors:$(Z(Y()))}),messageAdditions:$(Q({init:$(Z(tf)),bot:$(xf),user:$(xf)})),contextVersion:$(pd()),selectedTopicResetPredefinedQuestionId:$(Y())})),Q({theme:$(Q({name:$(Y())}))})),Cf=class{id;constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,t){return this.chatResponseData.readableStore.subscribe(e,t)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(e){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,e)}},wf=class{latestRequest=new Tl;state=nt({state:`idle`});id;history=[];constructor(e){this.clientPrimitive=e,this.id=e.createConversationId()}subscribe(e){return this.state.subscribe(e)}chat(e,t={}){let n=this.clientPrimitive.chat(this.id,e,t);return this.history.push(n),this.latestRequest.setValue({question:e,response:n}),n}async abort(){let e=this.history.map(e=>e.abort());await Promise.all(e)}async thumbsUp(){let{question:e,response:t}=await this.latestRequest;await t.isReadyForFeedback(),await this.clientPrimitive.thumbsUp(t.id,e)}async thumbsDown(){let{question:e,response:t}=await this.latestRequest;await t.isReadyForFeedback(),await this.clientPrimitive.thumbsDown(t.id,e)}async feedback(e){let{question:t,response:n}=await this.latestRequest;await n.isReadyForFeedback(),await this.clientPrimitive.feedback(n.id,t,e)}},Tf=[];for(let e=0;e<256;++e)Tf.push((e+256).toString(16).slice(1));function Ef(e,t=0){return(Tf[e[t+0]]+Tf[e[t+1]]+Tf[e[t+2]]+Tf[e[t+3]]+`-`+Tf[e[t+4]]+Tf[e[t+5]]+`-`+Tf[e[t+6]]+Tf[e[t+7]]+`-`+Tf[e[t+8]]+Tf[e[t+9]]+`-`+Tf[e[t+10]]+Tf[e[t+11]]+Tf[e[t+12]]+Tf[e[t+13]]+Tf[e[t+14]]+Tf[e[t+15]]).toLowerCase()}var Df,Of=new Uint8Array(16);function kf(){if(!Df){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Df=crypto.getRandomValues.bind(crypto)}return Df(Of)}var Af={};function jf(e,t,n){let r;if(e)r=Nf(e.random??e.rng?.()??kf(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=kf();Mf(Af,e,i),r=Nf(i,Af.msecs,Af.seq,t,n)}return t??Ef(r)}function Mf(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Nf(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}var Pf=new Map,Ff=class{get length(){return Pf.size}clear(){Pf.clear()}getItem(e){return Pf.get(e)||null}key(e){return Array.from(Pf.keys())[e]||null}removeItem(e){Pf.delete(e)}setItem(e,t){Pf.set(e,String(t))}},If=globalThis.localStorage??new Ff,Lf=async(e,t)=>{try{let n=If.getItem(`liipgpt:uID`)||If.getItem(`uID`),r={method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:n,...t?{startParameters:t}:{}})},i=await e.fetchData(`/login`,vf,{},r).catch(t=>(console.log(`Failed to /login use /log`,t),e.fetchData(`/log`,vf,{},r)));if(`maintenance`in i&&i.maintenance)return{mode:`maintenance`};if(!(`id`in i))throw Error(`Invalid response format: missing user id`);return If.setItem(`liipgpt:uID`,i.id),{mode:`ready`,userId:i.id}}catch(e){throw console.error(`Failed to fetch user data:`,e),e}},Rf=function(e,t){if(!(this instanceof Rf))return new Rf(e,t);this.url=e,t||={},this.headers=t.headers||{},this.payload=t.payload===void 0?``:t.payload,this.method=t.method||this.payload&&`POST`||`GET`,this.withCredentials=!!t.withCredentials,this.debug=!!t.debug,this.autoReconnect=t.autoReconnect===void 0?!1:t.autoReconnect,this.reconnectDelay=t.reconnectDelay===void 0?3e3:t.reconnectDelay,this.maxRetries=t.maxRetries===void 0?null:t.maxRetries,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=t.useLastEventId===void 0?!0:t.useLastEventId,this.FIELD_SEPARATOR=`:`,this.listeners={},this.xhr=null,this.readyState=Rf.INITIALIZING,this.progress=0,this.chunk=``,this.lastEventId=``,this._hasParsedBom=!1,this.addEventListener=function(e,t){this.listeners[e]===void 0&&(this.listeners[e]=[]),this.listeners[e].indexOf(t)===-1&&this.listeners[e].push(t)},this.removeEventListener=function(e,t){if(this.listeners[e]===void 0)return;let n=[];this.listeners[e].forEach(function(e){e!==t&&n.push(e)}),n.length===0?delete this.listeners[e]:this.listeners[e]=n},this.dispatchEvent=function(e){if(!e)return!0;this.debug&&console.debug(e),e.source=this;let t=`on`+e.type;return this.hasOwnProperty(t)&&(this[t].call(this,e),e.defaultPrevented)?!1:this.listeners[e.type]?this.listeners[e.type].every(function(t){return t(e),!e.defaultPrevented}):!0},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk=``,this._setReadyState(Rf.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?`/`+this.maxRetries:``})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(e){let t=new CustomEvent(`readystatechange`);t.readyState=e,this.readyState=e,this.dispatchEvent(t)},this._onStreamFailure=function(e){let t=new CustomEvent(`error`);t.responseCode=e.currentTarget.status,t.data=e.currentTarget.response,this.dispatchEvent(t),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent(`abort`)),this._markClosed()},this._onStreamProgress=function(e){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(e);return}this.retryCount=0;let t=this.xhr.responseText.substring(this.progress);this.progress+=t.length,!this._hasParsedBom&&this.chunk.length===0&&(t.charCodeAt(0)===65279&&(t=t.substring(1)),this._hasParsedBom=!0);let n=(this.chunk+t).split(/(\r\n\r\n|\r\r|\n\n)/g),r=n.pop();n.forEach(function(e){e.trim().length>0&&this.dispatchEvent(this._parseEventChunk(e))}.bind(this)),this.chunk=r},this._onStreamLoaded=function(e){this._onStreamProgress(e),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk=``,this._markClosed()},this._parseEventChunk=function(e){if(!e||e.length===0)return null;this.debug&&console.debug(e);let t={id:null,retry:null,data:null,event:null};if(e.split(/\n|\r\n|\r/).forEach(function(e){let n=e.indexOf(this.FIELD_SEPARATOR),r,i;if(n>0){let t=e[n+1]===` `?2:1;r=e.substring(0,n),i=e.substring(n+t)}else if(n<0)r=e,i=``;else return;r in t&&(r===`data`&&t[r]!==null?t.data+=`
60
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+il(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},vl=new _l;function q(e,t){return vl.parse(e,t)}q.options=q.setOptions=function(e){return vl.setOptions(e),q.defaults=vl.defaults,Qs(q.defaults),q},q.getDefaults=Xs,q.defaults=Zs,q.use=function(...e){return vl.use(...e),q.defaults=vl.defaults,Qs(q.defaults),q},q.walkTokens=function(e,t){return vl.walkTokens(e,t)},q.parseInline=vl.parseInline,q.Parser=hl,q.parser=hl.parse,q.Renderer=pl,q.TextRenderer=ml,q.Lexer=fl,q.lexer=fl.lex,q.Tokenizer=dl,q.Hooks=gl,q.parse=q,q.options,q.setOptions,q.use,q.walkTokens,q.parseInline,hl.parse,fl.lex;var yl=e=>(Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t];n&&typeof n==`object`&&yl(n)}),Object.freeze(e)),bl=yl({all:[],used:[],unused:[]}),xl=(e,t)=>{let n=Ys(e);return n.addHook(`uponSanitizeElement`,function(e,t){let n=t.tagName||e.nodeName.toLowerCase();n.startsWith(`liipgpt-`)&&(t.allowedTags[n]=!0)}),n.addHook(`afterSanitizeAttributes`,function(e){if(e.tagName!==`A`||!e.getAttribute(`href`)?.startsWith(`http`)||(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`),!t||e.querySelector(`.sr-only`)))return;let n=e.ownerDocument.createElement(`span`);n.className=`sr-only`,n.textContent=` ${t}`,e.appendChild(n)}),n},Sl=class{marked;currentReferences=bl;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new _l({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=xl(e.window,e.newTabSrText)}createFootnoteExtension=()=>{let e=this;return{extensions:[{name:`footnote`,level:`inline`,start(e){return e.match(/\[\^(\d+(?:\.\d+)?)\]/)?.index},tokenizer(e){let t=/^\[\^(\d+(?:\.\d+)?)\]/.exec(e);if(t){let[e,n]=t;return{type:`footnote`,raw:e,refNumber:n}}},renderer(t){if(t.type===`footnote`){let n=e.currentReferences.all,r=n.some(e=>e.citationId!==void 0)?n.findIndex(e=>e.citationId===t.refNumber):/^\d+$/.test(t.refNumber)?Number(t.refNumber)-1:-1,i=e.currentReferences.all[r];if(!i)return console.error(`Could not find ref for citation:`,t.refNumber),``;let a;return i?.referenceIndex.used?a=i.referenceIndex.used:(e.currentReferences.used.push(i),e.lastUsedIndex++,a=e.lastUsedIndex,i.referenceIndex.used=a),` <liipgpt-reference-number data-all-index="${r}" data-used-index="${a}" data-source="${JSON.stringify(i).replace(/"/g,`&quot;`)}"></liipgpt-reference-number>`}}}]}};parse(e){return this.DomPurity.sanitize(this.marked.parse(e),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:[`hr`],ADD_ATTR:[`target`]})}toHTML(e,t){this.currentReferences=t;let n=this.parse(e);return this.currentReferences=bl,n}};function Cl(){let e,t;return{promise:new Promise((n,r)=>{t=n,e=r}),reject:e,resolve:t}}var wl=class{promise;resolve;reject;constructor(){let{promise:e,resolve:t,reject:n}=Cl();this.promise=e,this.resolve=t,this.reject=n}then(e,t){return this.promise.then(e,t)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]=`Flag`},Tl=class{hasValue=new wl;currentValue;setValue(e){this.currentValue=e,this.hasValue.resolve()}cleanup(e){this.hasValue.reject(e)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(e,t){return this.toPromise().then(e,t)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]=`FutureValue`},El=e=>{try{return new URL(e).hostname}catch{return e}};function Dl(e){return e.replace(/<[^>]*>/g,``).replace(/&nbsp;/g,` `).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`)}var Ol=({citationId:e,url:t,considered:n,title:r,description:i,summary:a})=>{let o=El(t),s=i||a;return{...e?{citationId:e}:{},url:t,considered:n,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:s,badge:t},listItem:{title:r,badge:o}}}},kl=class{store;content=new Tl;backendSendsMappedRefs=!1;constructor(e){this.options=e,this.store=nt({id:e.id,state:`loading`,errors:[],type:`bot`,time:new Date().toISOString(),message:{markdown:``,html:``,text:``},references:{all:[],used:[],unused:[]},retrievalQuestion:e.userQuestion})}pushError(e){this.options.onError?.(e),this.store.update(t=>({...t,errors:[...t.errors,e]}))}updateRequestId(e){this.store.update(t=>({...t,id:e}))}updateText(e){this.store.update(t=>{let n=t.message.markdown+e,r=this.options.markdownRenderer.toHTML(n,t.references);return{...t,state:`streaming`,message:{markdown:n,html:r,text:``}}})}finishMessage(){this.store.update(e=>{let t={...e,state:`done`};return t.references.unused=t.references.all.filter(e=>e.referenceIndex.used===void 0),t.message.text=Dl(t.message.html),this.options?.onFinish?.(t),this.content.setValue(t),t})}addReference(e){this.store.update(t=>{let n=t.references.all,r=n.length,i=[...n,{...e,referenceIndex:{all:r}}];return{...t,references:{used:t.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(Ol(e))}updateRetrievalQuestion(e){this.store.update(t=>({...t,retrievalQuestion:e}))}setNoFeedback(){this.store.update(e=>({...e,noFeedback:!0}))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}},Al=[{type:`email`,check:e=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(e)},{type:`creditCard`,check:e=>/\b(?:\d[ -]*?){13,16}\b/.test(e)},{type:`ahv`,check:e=>/\b756\.\d{4}\.\d{4}\.\d{2}\b/.test(e)},{type:`phoneSwiss`,check:e=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(e)},{type:`phoneInternational`,check:e=>/(?:\+|00)(?:\s*\d){10,}\b/.test(e)},{type:`swissPassport`,check:e=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(e)},{type:`longNumber`,check:e=>/\b\d{9,}\b/.test(e)}];Object.freeze({status:`aborted`});function J(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var jl=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ml={};function Nl(e){return e&&Object.assign(Ml,e),Ml}function Pl(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Fl(e,t){return typeof t==`bigint`?t.toString():t}function Il(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Ll(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var Rl=Symbol(`evaluating`);function zl(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Rl)return r===void 0&&(r=Rl,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Bl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Vl(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}var Hl=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ul(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Wl(e){if(Ul(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Ul(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Gl(e){return Wl(e)?{...e}:Array.isArray(e)?[...e]:e}var Kl=new Set([`string`,`number`,`symbol`]);function ql(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Jl(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Yl(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Xl(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Zl={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ql(e,t){if(!Wl(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Jl(e,Vl(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Bl(this,`shape`,n),n}}))}function $l(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Jl(t,Vl(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Bl(this,`shape`,i),i},checks:[]}))}function eu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function tu(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function nu(e){return typeof e==`string`?e:e?.message}function ru(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=nu(e.inst?._zod.def?.error?.(e))??nu(t?.error?.(e))??nu(n.customError?.(e))??nu(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}var iu=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Fl,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},au=J(`$ZodError`,iu),ou=J(`$ZodError`,iu,{Parent:Error}),su=(e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new jl;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ru(e,a,Nl())));throw Hl(t,i?.callee),t}return o.value})(ou),cu=(e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ru(e,a,Nl())));throw Hl(t,i?.callee),t}return o.value})(ou),lu=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new jl;return a.issues.length?{success:!1,error:new(e??au)(a.issues.map(e=>ru(e,i,Nl())))}:{success:!0,data:a.value}})(ou),uu=(e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ru(e,i,Nl())))}:{success:!0,data:a.value}})(ou),du=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;`${du}`;function fu(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pu(e){let t=fu({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${du}T(?:${r})$`)}var mu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},hu=/^-?\d+$/,gu=/^-?\d+(?:\.\d+)?$/,_u=/^(?:true|false)$/i,vu=J(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),yu=J(`$ZodCheckNumberFormat`,(e,t)=>{vu.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Zl[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=hu)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),bu=J(`$ZodCheckStringFormat`,(e,t)=>{var n,r;vu.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),xu={major:4,minor:3,patch:6},Su=J(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xu;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=eu(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new jl;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=eu(e,t))});else{if(e.issues.length===t)continue;r||=eu(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(eu(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new jl;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new jl;return o.then(e=>t(e,r,a))}return t(o,r,a)}}zl(e,`~standard`,()=>({validate:t=>{try{let n=lu(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return uu(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Cu=J(`$ZodString`,(e,t)=>{Su.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??mu(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),wu=J(`$ZodStringFormat`,(e,t)=>{bu.init(e,t),Cu.init(e,t)}),Tu=J(`$ZodURL`,(e,t)=>{wu.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Eu=J(`$ZodISODateTime`,(e,t)=>{t.pattern??=pu(t),wu.init(e,t)}),Du=J(`$ZodNumber`,(e,t)=>{Su.init(e,t),e._zod.pattern=e._zod.bag.pattern??gu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Ou=J(`$ZodNumberFormat`,(e,t)=>{yu.init(e,t),Du.init(e,t)}),ku=J(`$ZodBoolean`,(e,t)=>{Su.init(e,t),e._zod.pattern=_u,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Au=J(`$ZodUnknown`,(e,t)=>{Su.init(e,t),e._zod.parse=e=>e});function ju(e,t,n){e.issues.length&&t.issues.push(...tu(n,e.issues)),t.value[n]=e.value}var Mu=J(`$ZodArray`,(e,t)=>{Su.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ju(t,n,e))):ju(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Nu(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...tu(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Pu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Xl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Fu(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Nu(e,n,i,t,u))):Nu(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Iu=J(`$ZodObject`,(e,t)=>{if(Su.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Il(()=>Pu(t));zl(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Ul,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Nu(n,t,e,s,r))):Nu(i,t,e,s,r)}return i?Fu(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}});function Lu(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!eu(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ru(e,r,Nl())))}),t)}var Ru=J(`$ZodUnion`,(e,t)=>{Su.init(e,t),zl(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),zl(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),zl(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),zl(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ll(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Lu(t,i,e,a)):Lu(s,i,e,a)}}),zu=J(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ru.init(e,t);let n=e._zod.parse;zl(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Il(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Ul(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Bu=J(`$ZodIntersection`,(e,t)=>{Su.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Hu(e,t,n)):Hu(e,i,a)}});function Vu(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Wl(e)&&Wl(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Vu(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Vu(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Hu(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),eu(e))return e;let o=Vu(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Uu=J(`$ZodRecord`,(e,t)=>{Su.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Wl(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...tu(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...tu(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&gu.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ru(e,r,Nl())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...tu(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...tu(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Wu=J(`$ZodEnum`,(e,t)=>{Su.init(e,t);let n=Pl(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Kl.has(typeof e)).map(e=>typeof e==`string`?ql(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Gu=J(`$ZodLiteral`,(e,t)=>{if(Su.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ql(e):e?ql(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}});function Ku(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var qu=J(`$ZodOptional`,(e,t)=>{Su.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,zl(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),zl(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ll(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Ku(t,e.value)):Ku(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ju=J(`$ZodNullable`,(e,t)=>{Su.init(e,t),zl(e._zod,`optin`,()=>t.innerType._zod.optin),zl(e._zod,`optout`,()=>t.innerType._zod.optout),zl(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ll(e.source)}|null)$`):void 0}),zl(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Yu=J(`$ZodDefault`,(e,t)=>{Su.init(e,t),e._zod.optin=`optional`,zl(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Xu(e,t)):Xu(r,t)}});function Xu(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Zu,Qu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function $u(){return new Qu}(Zu=globalThis).__zod_globalRegistry??(Zu.__zod_globalRegistry=$u()),globalThis.__zod_globalRegistry;function ed(e,t){return new e({type:`string`,...Yl(t)})}function td(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Yl(t)})}function nd(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Yl(t)})}function rd(e,t){return new e({type:`number`,checks:[],...Yl(t)})}function id(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Yl(t)})}function ad(e,t){return new e({type:`boolean`,...Yl(t)})}function od(e){return new e({type:`unknown`})}var sd=J(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);Su.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>su(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>lu(e,t,n),e.parseAsync=async(t,n)=>cu(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>uu(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>Jl(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),cd=J(`ZodMiniString`,(e,t)=>{Cu.init(e,t),sd.init(e,t)});function Y(e){return ed(cd,e)}var ld=J(`ZodMiniStringFormat`,(e,t)=>{wu.init(e,t),cd.init(e,t)}),ud=J(`ZodMiniURL`,(e,t)=>{Tu.init(e,t),ld.init(e,t)});function dd(e){return td(ud,e)}var fd=J(`ZodMiniNumber`,(e,t)=>{Du.init(e,t),sd.init(e,t)});function pd(e){return rd(fd,e)}var md=J(`ZodMiniNumberFormat`,(e,t)=>{Ou.init(e,t),fd.init(e,t)});function hd(e){return id(md,e)}var gd=J(`ZodMiniBoolean`,(e,t)=>{ku.init(e,t),sd.init(e,t)});function X(e){return ad(gd,e)}var _d=J(`ZodMiniUnknown`,(e,t)=>{Au.init(e,t),sd.init(e,t)});function vd(){return od(_d)}var yd=J(`ZodMiniArray`,(e,t)=>{Mu.init(e,t),sd.init(e,t)});function Z(e,t){return new yd({type:`array`,element:e,...Yl(t)})}var bd=J(`ZodMiniObject`,(e,t)=>{Iu.init(e,t),sd.init(e,t),zl(e,`shape`,()=>t.shape)});function Q(e,t){return new bd({type:`object`,shape:e??{},...Yl(t)})}function xd(e,t){return Ql(e,t)}function Sd(e,t){return $l(Id,e,t)}var Cd=J(`ZodMiniUnion`,(e,t)=>{Ru.init(e,t),sd.init(e,t)});function wd(e,t){return new Cd({type:`union`,options:e,...Yl(t)})}var Td=J(`ZodMiniDiscriminatedUnion`,(e,t)=>{zu.init(e,t),sd.init(e,t)});function Ed(e,t,n){return new Td({type:`union`,options:t,discriminator:e,...Yl(n)})}var Dd=J(`ZodMiniIntersection`,(e,t)=>{Bu.init(e,t),sd.init(e,t)});function Od(e,t){return new Dd({type:`intersection`,left:e,right:t})}var kd=J(`ZodMiniRecord`,(e,t)=>{Uu.init(e,t),sd.init(e,t)});function Ad(e,t,n){return new kd({type:`record`,keyType:e,valueType:t,...Yl(n)})}function jd(e,t,n){let r=Jl(e);return r._zod.values=void 0,new kd({type:`record`,keyType:r,valueType:t,...Yl(n)})}var Md=J(`ZodMiniEnum`,(e,t)=>{Wu.init(e,t),sd.init(e,t),e.options=Object.values(t.entries)});function Nd(e,t){return new Md({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Yl(t)})}var Pd=J(`ZodMiniLiteral`,(e,t)=>{Gu.init(e,t),sd.init(e,t)});function Fd(e,t){return new Pd({type:`literal`,values:Array.isArray(e)?e:[e],...Yl(t)})}var Id=J(`ZodMiniOptional`,(e,t)=>{qu.init(e,t),sd.init(e,t)});function $(e){return new Id({type:`optional`,innerType:e})}var Ld=J(`ZodMiniNullable`,(e,t)=>{Ju.init(e,t),sd.init(e,t)});function Rd(e){return new Ld({type:`nullable`,innerType:e})}var zd=J(`ZodMiniDefault`,(e,t)=>{Yu.init(e,t),sd.init(e,t)});function Bd(e,t){return new zd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Gl(t)}})}var Vd=J(`ZodMiniISODateTime`,(e,t)=>{Eu.init(e,t),ld.init(e,t)});function Hd(e){return nd(Vd,e)}var Ud=Q({name:Y(),namePlural:$(Y()),intro:$(Y()),placeholder:Y(),values:Ad(Y(),Y())}),Wd=Q({introductionTitle:Y(),introductionDisclaimer:$(Y()),termsInvitationToConsent:$(Y()),chatInputPlaceholder:Y(),chatInputPlaceholderListening:$(Y()),chatInputSubmit:Y(),chatInputAbort:Y(),chatInputStartListening:Y(),chatInputStopListening:Y(),referenceLink:Y(),referencesDisplay:Y(),referencesHide:Y(),referencesTitle:Y(),referencesFurtherTitle:Y(),newChat:Y(),maintenanceModeError:Y(),messageBotLoading:Y(),messageBotError:Y(),messageBotDefaultError:Y(),noResultsFound:Y(),chatFooterText:$(Y()),scrollToBottom:Y(),openButtonTitle:$(Y()),openButtonDescription:$(Y()),openMenu:Y(),openInfo:Y(),aboutThisChat:$(Y()),closeMenu:Y(),closeChat:Y(),close:Y(),send:Y(),thankYouForFeedback:Y(),answerFormThankYou:Y(),giveFeedback:Y(),sendFeedback:Y(),feedbackFormTitle:Y(),feedbackFormMessage:Y(),feedbackFormMessagePlaceholder:Y(),feedbackFormEmail:Y(),feedbackFormEmailPlaceholder:Y(),askQuestionAgain:Y(),answerGood:Y(),answerBad:Y(),classificationSubmit:Y(),classificationThankYou:Y(),classificationTitle:Y(),selectLanguage:Y(),languageChanged:Y(),selectColorTheme:Y(),lightMode:Y(),darkMode:Y(),ariaMainNavigation:Y(),ariaMainNavigationInfo:Y(),ariaMainNavigationLinks:Y(),ariaMainNavigationLanguageSwitch:Y(),ariaMainNavigationColorMode:Y(),ariaGotoMainNavigation:Y(),ariaAskQuestion:Y(),ariaAskQuestionRegion:Y(),ariaNotifications:Y(),ariaPredefinedQuestions:Y(),ariaPredefinedQuestionsRegion:Y(),ariaChatHistory:Y(),ariaOpenChat:Y(),ariaQuestionFromYou:Y(),ariaAnswerFromBot:Y(),ariaLastAnswerNavigation:Y(),ariaQuestionSent:Y(),ariaAnswerReady:Y(),ariaAnswerFinished:Y(),ariaAnswerFinishedWithSelectedTopic:Y(),ariaAskQuestionAgain:Y(),ariaAnswerGood:Y(),ariaAnswerBad:Y(),ariaReferenceSource:Y(),ariaGiveFeedback:Y(),ariaAnswerForm:Y(),ariaLanguageChanged:Y(),ariaLightSelected:Y(),ariaDarkSelected:Y(),ariaSettings:Y(),ariaSettingsRegion:Y(),ariaReferencesRegion:Y(),ariaOpensInNewTab:Y(),ariaPageTitle:Y(),ariaCloseWithEsc:Y(),ariaInfoTitle:Y(),ariaFlyoutRegion:Y(),ariaSelected:Y(),ariaUnselected:Y(),ariaAllSelected:Y(),ariaAllUnselected:Y(),ariaAllReseted:Y(),ariaChangeTopic:Y(),popups:$(Z(Q({hash:Y(),title:Y(),content:Y(),actions:$(Z(Q({action:Y(),label:Y(),type:$(Nd([`primary`,`secondary`]))})))}))),termsAcceptButton:$(Y()),termsReadButton:$(Y()),selectors:$(Ad(Y(),Ud)),hideSettings:Y(),showSettings:Y(),chooseAtLeastOneOption:Y(),selectAll:Y(),selectNone:Y(),resetToDefaults:Y(),messageTooLong:Y(),selectedTopic:Y(),changeTopic:Y(),searchSummaryExpand:Y(),searchSummaryCollapse:Y(),searchSummaryOptInDefault:Y(),searchSummaryOptOut:Y(),searchSummaryError:Y(),searchSummaryDisclaimer:$(Y()),searchSummaryLoading:Y(),searchSummaryFollowUpPlaceholder:Y(),searchSummaryFollowUpSubmit:Y(),ariaSearchSummaryExpand:Y(),ariaSearchSummaryCollapse:Y(),ariaSearchSummaryOptOut:Y(),ariaSearchSummaryFollowUpInput:Y(),jsonLdEventDate:Y(),jsonLdEventLocation:Y(),jsonLdEventDescription:Y(),jsonLdEventCtaLabel:Y(),jsonLdCtaLabel:Y(),jsonLdMapOpenMap:Y(),ariaJsonLdMapCanvas:Y(),ariaJsonLdEventCard:Y(),ariaJsonLdMapCard:Y(),ariaJsonLdCtaCard:Y()}),Gd=Nd(e),Kd=jd(Gd,xd(Sd(Wd),{selectors:$(Ad(Y(),Ud))})),qd=jd(Gd,Y()),Jd=Od(Ed(`componentName`,[Q({componentName:Fd(`buttons`),data:Q({caption:$(Y()),buttons:Z(Q({label:Y(),href:$(dd()),value:Y(),variant:$(Nd([`primary`,`secondary`,`tertiary`])),icon:$(Y()),target:$(Y())}))})}),Q({componentName:Fd(`combobox`),data:Q({caption:$(qd),placeholder:qd,values:Z(Q({label:qd,value:Y(),metadata:$(Ad(Y(),vd()))})),removeComponentAfterValueSelection:$(X()),selectorKey:$(Y())})}),Q({componentName:Fd(`alva-init`),data:Q({})}),Q({componentName:Fd(`alva-score-survey`),data:Q({})})]),Q({type:Fd(`component`),id:$(Y()),time:$(Y()),hideAvatar:$(X()),noSectionPadding:$(X()),hideChatInput:$(X())})),Yd=wd([Y(),pd(),X(),Z(Y()),Z(pd()),Z(X())]),Xd=Q({title:Y(),description:$(Y()),badge:$(Y()),breadcrumbs:$(Z(Y())),previewImage:$(Y()),date:$(Hd())}),Zd=xd(Q({url:dd(),score:pd(),metadata:Ad(Y(),Yd),language:$(Y())}),Xd.shape),Qd=Q({type:Fd(`user`),time:Y(),message:Y(),id:$(Y())}),$d=xd(Q({citationId:$(Y()),url:Y(),score:pd(),metadata:Ad(Y(),wd([Y(),pd(),X(),Z(Y()),Z(pd()),Z(X())])),considered:X(),display:Q({card:Xd,listItem:Xd})}),{referenceIndex:Q({all:pd(),used:$(pd())})}),ef=Q({type:Fd(`bot`),time:Y(),id:Y(),message:Q({markdown:Y(),html:Y(),text:Y()}),references:Q({all:Z($d),used:Z($d),unused:Z($d)}),errors:Z(wd([Nd([`pii-detected`,`blocked`,`maintenance`,`rate-limit`,`server-error`,`too-short`,`too-long`,`quota-reached`,`aborted`]),Fd(`sse-error`),Fd(`client-error`),Fd(`unexpected-call`)])),retrievalQuestion:$(Y()),noFeedback:$(X()),feedback:$(Nd([`up`,`down`]))}),tf=wd([wd([xd(ef,{state:Fd(`loading`)}),xd(ef,{state:Nd([`streaming`,`done`])})]),Qd,Jd]),nf=Z(Q({question:Y(),answer:Y()})),rf=wd([Q({minRem:pd(),maxRem:pd()}),Y()]),af=Q({0:$(Y()),50:Y(),100:Y(),200:Y(),300:Y(),400:Y(),500:Y(),600:Y(),700:Y(),800:Y(),900:Y(),950:Y(),1e3:$(Y())}),of=Q({color:$(Y()),background:$(Y()),borderWidth:$(Y()),borderColor:$(Y()),boxShadow:$(Y())}),sf=Q({customCSS:$(Y()),fontCSS:$(Y()),fontURLs:$(Z(Y())),tokens:$(Q({font:$(Q({family:$(Y())})),colors:$(Q({brand:$(Sd(af)),accent:$(Sd(af)),highlight:$(Sd(af)),grey:$(Sd(af))})),base:$(Q({fontSizeXs:$(rf),fontSizeSm:$(rf),fontSizeBody:$(rf),fontSizeH3:$(rf),fontSizeH2:$(rf),fontSizeH1:$(rf),fontWeightNormal:$(Y()),fontWeightBold:$(Y()),fontWeightTitle:$(Y()),lineHeightDefault:$(Y()),lineHeightSnug:$(Y()),lineHeightTight:$(Y()),borderRadius:$(rf),lineColor:$(Y()),boxShadow:$(Y())})),components:$(Ad(Y(),Od(Q({borderRadius:$(rf),custom:$(Ad(Y(),wd([Y(),pd()]))),hover:$(of),focus:$(of)}),of))),svgs:$(jd(Nd(`predefinedQuestion.edit.newConversation.voteUp.voteDown.retry.message.messageLoading.thread.submit.abort.expand.help.attach.record.reward.share.audio.copy.dismiss.menu.info.menuClose.chevronDown.chevronUp.chevronTopDown.chevronDownSmall.internalLink.externalLink.liip.avatar.avatarLarge.openChat.speechInput.listUnordered.lightMode.darkMode.settings.settingsClose.sources.model.checkbox.warning.topic.headerLogo.embedAvatar.forward.phone.email`.split(`.`)),Y()))}))}),cf=Q({light:$(sf),dark:$(sf)}),lf=Q({50:Y(),100:Y(),200:Y(),300:Y(),400:Y(),500:Y(),600:Y(),700:Y(),800:Y(),900:Y(),950:Y()}),uf=Nd([`slate`,`gray`,`zinc`,`neutral`,`stone`,`red`,`orange`,`amber`,`yellow`,`lime`,`green`,`emerald`,`teal`,`cyan`,`sky`,`blue`,`indigo`,`violet`,`purple`,`fuchsia`,`pink`,`rose`]),df=wd([lf,uf]),ff=Q({avatarImageUrl:$(Y()),colors:$(Q({brand:$(df),highlight:$(df),grey:$(wd([Od(lf,Q({0:Y(),1e3:Y()})),uf])),background:$(Y()),text:$(Y()),anchor:$(Q({default:$(Y()),hover:$(Y())}))})),font:$(Q({family:$(Y()),urls:$(Z(Y())),sizeXs:$(rf),sizeSm:$(rf),sizeBody:$(rf),sizeH3:$(rf),sizeH2:$(rf),sizeH1:$(rf),weightNormal:$(Y()),weightBold:$(Y()),weightTitle:$(Y())})),borderRadius:$(rf),fineGrained:$(cf)}),pf=Q({label:Y(),options:Z(Q({label:Y(),value:pd()}))}),mf=Q({label:Y(),icon:Y(),url:Y(),target:$(Nd([`_blank`,`_self`]))}),hf=Q({id:$(Y()),label:Rd(Y()),question:Y(),switchQuestionId:$(Y())}),gf=Q({impact:$(pf),quality:$(pf),order:$(Z(Nd([`quality`,`impact`])))}),_f=Q({predefinedQuestions:Z(hf)}),vf=wd([Q({maintenance:Fd(!0)}),Q({id:Y(),cID:Y()})]),yf=Q({settingName:Y(),iconName:Y(),settingIntro:$(Y()),type:Nd([`single-select`,`multi-select`]),allowEmpty:X(),values:Z(Y()),defaultValues:$(Z(Y()))}),bf=Q({receiverEmail:Y(),triggerLabel:qd,title:$(qd),caption:$(qd),submitLabel:qd,fields:Z(Q({type:Nd([`text`,`select`,`checkbox`,`radio`]),name:Y(),label:qd,placeholder:$(qd),required:$(X()),options:$(Z(Q({value:Y(),label:qd})))}))}),xf=Q({before:$(Z(tf)),after:$(Z(tf))}),Sf=Od(Sd(Q({forcePredefinedQuestions:$(X()),forceChatPage:$(X()),showOverallFeedbackButton:X(),showOverallFeedbackEmail:X(),showCloseChatButton:X(),showContextMenu:X(),showContextInfo:X(),showReferencesByDefault:X(),showExpandedSelectors:X(),showTextFeedback:X(),inlineLayout:X(),allowAudioInput:X(),blockPII:X(),questionPrefix:Y(),menu:$(jd(Gd,Z(mf))),supportedLanguages:Z(Gd),classification:$(gf),answerForm:$(bf),theme:ff,translations:Kd,buttonHref:$(Y()),addQueryToUrlParams:$(X()),addRetrievalQuestionToUrlParams:$(X()),renderKatex:$(X()),reflectLanguageInPath:$(X()),sendReferrer:$(Nd([`all`,`own`,`none`,`location`])),selectorsConfig:Bd(Z(yf),[]),questionLengthLimit:$(pd()),forceConsent:$(X()),askQuestionAgain:X(),enableBackdrop:$(X()),parentPageContext:Q({extractSelectors:$(Z(Y()))}),messageAdditions:$(Q({init:$(Z(tf)),bot:$(xf),user:$(xf)})),contextVersion:$(pd()),selectedTopicResetPredefinedQuestionId:$(Y())})),Q({theme:$(Q({name:$(Y())}))})),Cf=class{id;constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,t){return this.chatResponseData.readableStore.subscribe(e,t)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(e){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,e)}},wf=class{latestRequest=new Tl;state=nt({state:`idle`});id;history=[];constructor(e){this.clientPrimitive=e,this.id=e.createConversationId()}subscribe(e){return this.state.subscribe(e)}chat(e,t={}){let n=this.clientPrimitive.chat(this.id,e,t);return this.history.push(n),this.latestRequest.setValue({question:e,response:n}),n}async abort(){let e=this.history.map(e=>e.abort());await Promise.all(e)}async thumbsUp(){let{question:e,response:t}=await this.latestRequest;await t.isReadyForFeedback(),await this.clientPrimitive.thumbsUp(t.id,e)}async thumbsDown(){let{question:e,response:t}=await this.latestRequest;await t.isReadyForFeedback(),await this.clientPrimitive.thumbsDown(t.id,e)}async feedback(e){let{question:t,response:n}=await this.latestRequest;await n.isReadyForFeedback(),await this.clientPrimitive.feedback(n.id,t,e)}},Tf=[];for(let e=0;e<256;++e)Tf.push((e+256).toString(16).slice(1));function Ef(e,t=0){return(Tf[e[t+0]]+Tf[e[t+1]]+Tf[e[t+2]]+Tf[e[t+3]]+`-`+Tf[e[t+4]]+Tf[e[t+5]]+`-`+Tf[e[t+6]]+Tf[e[t+7]]+`-`+Tf[e[t+8]]+Tf[e[t+9]]+`-`+Tf[e[t+10]]+Tf[e[t+11]]+Tf[e[t+12]]+Tf[e[t+13]]+Tf[e[t+14]]+Tf[e[t+15]]).toLowerCase()}var Df,Of=new Uint8Array(16);function kf(){if(!Df){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Df=crypto.getRandomValues.bind(crypto)}return Df(Of)}var Af={};function jf(e,t,n){let r;if(e)r=Nf(e.random??e.rng?.()??kf(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=kf();Mf(Af,e,i),r=Nf(i,Af.msecs,Af.seq,t,n)}return t??Ef(r)}function Mf(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Nf(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}var Pf=new Map,Ff=class{get length(){return Pf.size}clear(){Pf.clear()}getItem(e){return Pf.get(e)||null}key(e){return Array.from(Pf.keys())[e]||null}removeItem(e){Pf.delete(e)}setItem(e,t){Pf.set(e,String(t))}},If=globalThis.localStorage??new Ff,Lf=async(e,t)=>{try{let n=If.getItem(`liipgpt:uID`)||If.getItem(`uID`),r={method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:n,...t?{startParameters:t}:{}})},i=await e.fetchData(`/login`,vf,{},r).catch(t=>(console.log(`Failed to /login use /log`,t),e.fetchData(`/log`,vf,{},r)));if(`maintenance`in i&&i.maintenance)return{mode:`maintenance`};if(!(`id`in i))throw Error(`Invalid response format: missing user id`);return If.setItem(`liipgpt:uID`,i.id),{mode:`ready`,userId:i.id}}catch(e){throw console.error(`Failed to fetch user data:`,e),e}},Rf=function(e,t){if(!(this instanceof Rf))return new Rf(e,t);this.url=e,t||={},this.headers=t.headers||{},this.payload=t.payload===void 0?``:t.payload,this.method=t.method||this.payload&&`POST`||`GET`,this.withCredentials=!!t.withCredentials,this.debug=!!t.debug,this.autoReconnect=t.autoReconnect===void 0?!1:t.autoReconnect,this.reconnectDelay=t.reconnectDelay===void 0?3e3:t.reconnectDelay,this.maxRetries=t.maxRetries===void 0?null:t.maxRetries,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=t.useLastEventId===void 0?!0:t.useLastEventId,this.FIELD_SEPARATOR=`:`,this.listeners={},this.xhr=null,this.readyState=Rf.INITIALIZING,this.progress=0,this.chunk=``,this.lastEventId=``,this._hasParsedBom=!1,this.addEventListener=function(e,t){this.listeners[e]===void 0&&(this.listeners[e]=[]),this.listeners[e].indexOf(t)===-1&&this.listeners[e].push(t)},this.removeEventListener=function(e,t){if(this.listeners[e]===void 0)return;let n=[];this.listeners[e].forEach(function(e){e!==t&&n.push(e)}),n.length===0?delete this.listeners[e]:this.listeners[e]=n},this.dispatchEvent=function(e){if(!e)return!0;this.debug&&console.debug(e),e.source=this;let t=`on`+e.type;return this.hasOwnProperty(t)&&(this[t].call(this,e),e.defaultPrevented)?!1:this.listeners[e.type]?this.listeners[e.type].every(function(t){return t(e),!e.defaultPrevented}):!0},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk=``,this._setReadyState(Rf.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?`/`+this.maxRetries:``})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(e){let t=new CustomEvent(`readystatechange`);t.readyState=e,this.readyState=e,this.dispatchEvent(t)},this._onStreamFailure=function(e){let t=new CustomEvent(`error`);t.responseCode=e.currentTarget.status,t.data=e.currentTarget.response,this.dispatchEvent(t),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent(`abort`)),this._markClosed()},this._onStreamProgress=function(e){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(e);return}this.retryCount=0;let t=this.xhr.responseText.substring(this.progress);this.progress+=t.length,!this._hasParsedBom&&this.chunk.length===0&&(t.charCodeAt(0)===65279&&(t=t.substring(1)),this._hasParsedBom=!0);let n=(this.chunk+t).split(/(\r\n\r\n|\r\r|\n\n)/g),r=n.pop();n.forEach(function(e){e.trim().length>0&&this.dispatchEvent(this._parseEventChunk(e))}.bind(this)),this.chunk=r},this._onStreamLoaded=function(e){this._onStreamProgress(e),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk=``,this._markClosed()},this._parseEventChunk=function(e){if(!e||e.length===0)return null;this.debug&&console.debug(e);let t={id:null,retry:null,data:null,event:null};if(e.split(/\n|\r\n|\r/).forEach(function(e){let n=e.indexOf(this.FIELD_SEPARATOR),r,i;if(n>0){let t=e[n+1]===` `?2:1;r=e.substring(0,n),i=e.substring(n+t)}else if(n<0)r=e,i=``;else return;r in t&&(r===`data`&&t[r]!==null?t.data+=`
61
61
  `+i:t[r]=i)}.bind(this)),t.id!==null&&t.id.indexOf(`\0`)===-1&&(this.lastEventId=t.id),t.retry!==null&&/^[0-9]+$/.test(t.retry)&&(this.reconnectDelay=parseInt(t.retry,10)),t.data===null)return null;let n=new CustomEvent(t.event||`message`);return n.id=t.id,n.data=t.data||``,n.lastEventId=this.lastEventId,n},this._onReadyStateChange=function(){if(this.xhr&&this.xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED){let e={},t=this.xhr.getAllResponseHeaders().trim().split(`\r
62
62
  `);for(let n of t){let[t,...r]=n.split(`:`),i=r.join(`:`).trim();e[t.trim().toLowerCase()]=e[t.trim().toLowerCase()]||[],e[t.trim().toLowerCase()].push(i)}let n=new CustomEvent(`open`);n.responseCode=this.xhr.status,n.headers=e,this.dispatchEvent(n),this._setReadyState(Rf.OPEN)}},this.stream=function(){if(!this.xhr){this._setReadyState(Rf.CONNECTING),this.xhr=new XMLHttpRequest,this.xhr.addEventListener(`progress`,this._onStreamProgress.bind(this)),this.xhr.addEventListener(`load`,this._onStreamLoaded.bind(this)),this.xhr.addEventListener(`readystatechange`,this._onReadyStateChange.bind(this)),this.xhr.addEventListener(`error`,this._onStreamFailure.bind(this)),this.xhr.addEventListener(`abort`,this._onStreamAbort.bind(this)),this.xhr.open(this.method,this.url);for(let e in this.headers)this.xhr.setRequestHeader(e,this.headers[e]);this.useLastEventId&&this.lastEventId.length>0&&this.xhr.setRequestHeader(`Last-Event-ID`,this.lastEventId),this.xhr.withCredentials=this.withCredentials,this.xhr.send(this.payload)}},this.close=function(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.autoReconnect=!1,this.xhr&&this.xhr.abort()},(t.start===void 0||t.start)&&this.stream()};Rf.INITIALIZING=-1,Rf.CONNECTING=0,Rf.OPEN=1,Rf.CLOSED=2;var zf=class{eventSource;triggeredOnClose=!1;constructor(e,t,n){this.options=t,this.payload=n;let r={headers:{"content-type":`application/json`}};n&&(r.payload=JSON.stringify(n)),t.apiKey&&(r.headers[`api-key`]=t.apiKey),this.eventSource=new(t.EventSource??Rf)(e,r),this.eventSource.onmessage=e=>{try{let n=JSON.parse(e.data);t.onMessage(n)}catch(e){t.onError(new CustomEvent(`parse-error`,{detail:e}))}},this.eventSource.onerror=e=>{t.onError(e),this.isClosed()&&this.close()}}isClosed(){return this.eventSource.readyState===EventSource.CLOSED}close(){this.isClosed()||this.eventSource.close(),this.triggeredOnClose||(this.triggeredOnClose=!0,this.options.onClose())}},Bf=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>t!=null)),Vf=class{constructor(e){this.options=e}getDefaultHeaders(e={}){let t={"Content-Type":`application/json`,...e};return this.options.apiKey&&(t[`api-key`]=this.options.apiKey),t}get speechRecognitionApiKey(){return this.options.speechRecognitionApiKey}async subscribeSse(e,t={},n){let r=Bf(t);return this.options.apiKey&&(n.apiKey=this.options.apiKey),new zf(`${this.options.apiUrl}${e}`,n,r)}async fetchData(e,t,n={},r={}){let i=`${this.options.apiUrl}${e}?${new URLSearchParams(Bf(n)).toString()}`,a={...r,headers:this.getDefaultHeaders(r?.headers)},o=await fetch(i,a);if(!o.ok){let e=await o.text();throw Error(`API request failed: ${o.status} - ${e}`)}let s=await o.json(),{success:c,data:l,error:u}=t.safeParse(s);if(this.options.strict){if(!c)throw console.error(`Server response has wrong type:
63
63
  `,{error:u,url:i,opts:a,data:s}),Error(`Server response has wrong type: ${u.message}`);return l}else return c||console.warn(`Server response has wrong type:
@@ -1 +0,0 @@
1
- import"./CsGLkWF6.js";import{i as e,t}from"./eDqi3535.js";import"./BaFk5JeE.js";import{n}from"./pHVM4a9g.js";import{t as r}from"./s8dY_eYY.js";var i=async e=>r(await(await fetch(`${e}/chatconfig`)).json());async function a({apiUrl:r,lang:a,forceTheme:o}){let s=e(await i(r));return{chatConfig:s,language:n(a,s.supportedLanguages),colorScheme:t(Object.keys(s.fullTheme))}}export{a as loadChatConfig};
@@ -1 +0,0 @@
1
- import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as ee,g as c,h as l,i as u,m as d,n as te,o as f,p,r as ne,s as m,t as h,u as g,v as _,w as v,x as y,y as b}from"./BaFk5JeE.js";var x=n(`ZodMiniISODateTime`,(e,t)=>{v.init(e,t),te.init(e,t)});function S(t){return e(x,t)}var C=[`en`,`de`,`fr`,`it`],w=d({blocked:b(),maintenance:b(),"rate-limit":b(),"server-error":b(),"too-short":b(),"too-long":b(),"quota-reached":b(),aborted:b(),"sse-error":b(),"client-error":b(),"unexpected-call":b(),"incomplete-error":b(),"feedback-failed":b(),"answer-form-failed":b(),"speech-not-supported":b(),"speech-transcription-failed":b(),"speech-no-text-detected":b(),"speech-microphone-access-denied":b(),"pii-detected":b()}),re=d({email:b(),creditCard:b(),ahv:b(),phoneSwiss:b(),phoneInternational:b(),swissPassport:b(),longNumber:b()}),T=d({name:b(),namePlural:l(b()),intro:l(b()),placeholder:b(),values:_(b(),b())}),E=d({action:b(),label:b(),type:l(u([`primary`,`secondary`]))}),D=d({hash:b(),title:b(),content:b(),actions:l(i(E))}),O=d({introductionTitle:b(),introductionDisclaimer:l(b()),termsInvitationToConsent:l(b()),chatInputPlaceholder:b(),chatInputPlaceholderListening:l(b()),chatInputSubmit:b(),chatInputAbort:b(),chatInputStartListening:b(),chatInputStopListening:b(),referenceLink:b(),referencesDisplay:b(),referencesHide:b(),referencesTitle:b(),referencesFurtherTitle:b(),newChat:b(),maintenanceModeError:b(),messageBotLoading:b(),messageBotError:b(),messageBotDefaultError:b(),noResultsFound:b(),chatFooterText:l(b()),scrollToBottom:b(),openButtonTitle:l(b()),openButtonDescription:l(b()),openMenu:b(),openInfo:b(),aboutThisChat:l(b()),closeMenu:b(),closeChat:b(),close:b(),send:b(),thankYouForFeedback:b(),answerFormThankYou:b(),giveFeedback:b(),sendFeedback:b(),feedbackFormTitle:b(),feedbackFormMessage:b(),feedbackFormMessagePlaceholder:b(),feedbackFormEmail:b(),feedbackFormEmailPlaceholder:b(),askQuestionAgain:b(),answerGood:b(),answerBad:b(),classificationSubmit:b(),classificationThankYou:b(),classificationTitle:b(),selectLanguage:b(),languageChanged:b(),selectColorTheme:b(),lightMode:b(),darkMode:b(),ariaMainNavigation:b(),ariaMainNavigationInfo:b(),ariaMainNavigationLinks:b(),ariaMainNavigationLanguageSwitch:b(),ariaMainNavigationColorMode:b(),ariaGotoMainNavigation:b(),ariaAskQuestion:b(),ariaAskQuestionRegion:b(),ariaNotifications:b(),ariaPredefinedQuestions:b(),ariaPredefinedQuestionsRegion:b(),ariaChatHistory:b(),ariaOpenChat:b(),ariaQuestionFromYou:b(),ariaAnswerFromBot:b(),ariaLastAnswerNavigation:b(),ariaQuestionSent:b(),ariaAnswerReady:b(),ariaAnswerFinished:b(),ariaAnswerFinishedWithSelectedTopic:b(),ariaAskQuestionAgain:b(),ariaAnswerGood:b(),ariaAnswerBad:b(),ariaReferenceSource:b(),ariaGiveFeedback:b(),ariaAnswerForm:b(),ariaLanguageChanged:b(),ariaLightSelected:b(),ariaDarkSelected:b(),ariaSettings:b(),ariaSettingsRegion:b(),ariaReferencesRegion:b(),ariaOpensInNewTab:b(),ariaPageTitle:b(),ariaCloseWithEsc:b(),ariaInfoTitle:b(),ariaFlyoutRegion:b(),ariaSelected:b(),ariaUnselected:b(),ariaAllSelected:b(),ariaAllUnselected:b(),ariaAllReseted:b(),ariaChangeTopic:b(),popups:l(i(D)),termsAcceptButton:l(b()),termsReadButton:l(b()),selectors:l(_(b(),T)),hideSettings:b(),showSettings:b(),chooseAtLeastOneOption:b(),selectAll:b(),selectNone:b(),resetToDefaults:b(),messageTooLong:b(),selectedTopic:b(),changeTopic:b(),searchSummaryExpand:b(),searchSummaryCollapse:b(),searchSummaryOptInDefault:b(),searchSummaryOptOut:b(),searchSummaryError:b(),searchSummaryDisclaimer:l(b()),searchSummaryLoading:b(),searchSummaryFollowUpPlaceholder:b(),searchSummaryFollowUpSubmit:b(),ariaSearchSummaryExpand:b(),ariaSearchSummaryCollapse:b(),ariaSearchSummaryOptOut:b(),ariaSearchSummaryFollowUpInput:b(),jsonLdEventDate:b(),jsonLdEventLocation:b(),jsonLdEventDescription:b(),jsonLdEventCtaLabel:b(),jsonLdCtaLabel:b(),jsonLdMapOpenMap:b(),ariaJsonLdMapCanvas:b(),ariaJsonLdEventCard:b(),ariaJsonLdMapCard:b(),ariaJsonLdCtaCard:b()}),k=u(C),A=r(k,o(c(O),{selectors:l(_(b(),T))}));_(k,w),_(k,re);var j=r(k,b()),M=d({componentName:s(`buttons`),data:d({caption:l(b()),buttons:i(d({label:b(),href:l(t()),value:b(),variant:l(u([`primary`,`secondary`,`tertiary`])),icon:l(b()),target:l(b())}))})}),N=d({componentName:s(`combobox`),data:d({caption:l(j),placeholder:j,values:i(d({label:j,value:b(),metadata:l(_(b(),y()))})),removeComponentAfterValueSelection:l(f()),selectorKey:l(b())})}),P=d({componentName:s(`alva-init`),data:d({})}),F=d({componentName:s(`alva-score-survey`),data:d({})}),I=d({type:s(`component`),id:l(b()),time:l(b()),hideAvatar:l(f()),noSectionPadding:l(f()),hideChatInput:l(f())}),L=g(m(`componentName`,[M,N,P,F]),I),R=a([b(),p(),f(),i(b()),i(p()),i(f())]),z=d({title:b(),description:l(b()),badge:l(b()),breadcrumbs:l(i(b())),previewImage:l(b()),date:l(S())}),B=o(d({url:t(),score:p(),metadata:_(b(),R),language:l(b())}),z.shape);u([`start`,`chat`]),m(`name`,[d({name:s(`start-page`),prefill:l(b())}),d({name:s(`consent-page`)}),d({name:s(`chat-page`),query:l(b()),predefinedQuestionId:l(b()),switchQuestionId:l(b())})]);var V=d({type:s(`user`),time:b(),message:b(),id:l(b())});u([`idle`,`searching`,`answering`]);var H=a([b(),p(),f(),i(b()),i(p()),i(f())]),U=o(d({citationId:l(b()),url:b(),score:p(),metadata:_(b(),H),considered:f(),display:d({card:z,listItem:z})}),{referenceIndex:d({all:p(),used:l(p())})}),W=d({all:i(U),used:i(U),unused:i(U)}),G=a([u([`pii-detected`,`blocked`,`maintenance`,`rate-limit`,`server-error`,`too-short`,`too-long`,`quota-reached`,`aborted`]),s(`sse-error`),s(`client-error`),s(`unexpected-call`)]),K=d({type:s(`bot`),time:b(),id:b(),message:d({markdown:b(),html:b(),text:b()}),references:W,errors:i(G),retrievalQuestion:l(b()),noFeedback:l(f()),feedback:l(u([`up`,`down`]))}),ie=o(K,{state:u([`streaming`,`done`])}),q=a([a([o(K,{state:s(`loading`)}),ie]),V,L]),J=i(d({question:b(),answer:b()})),Y=d({label:b(),options:i(d({label:b(),value:p()}))}),ae=d({label:b(),icon:b(),url:b(),target:l(u([`_blank`,`_self`]))}),oe=d({id:l(b()),label:ee(b()),question:b(),switchQuestionId:l(b())}),X=d({impact:l(Y),quality:l(Y)});d({classification:l(X)});var se=d({predefinedQuestions:i(oe)}),ce=a([d({maintenance:s(!0)}),d({id:b(),cID:b()})]);_(k,O),d({label:b(),placeholder:b(),locked:l(f())});var le=d({settingName:b(),iconName:b(),settingIntro:l(b()),type:u([`single-select`,`multi-select`]),allowEmpty:f(),values:i(b()),defaultValues:l(i(b()))}),ue=d({type:u([`text`,`select`,`checkbox`,`radio`]),name:b(),label:j,placeholder:l(j),required:l(f()),options:l(i(d({value:b(),label:j})))}),de=d({receiverEmail:b(),triggerLabel:j,title:l(j),caption:l(j),submitLabel:j,fields:i(ue)}),Z=d({before:l(i(q)),after:l(i(q))}),fe=d({init:l(i(q)),bot:l(Z),user:l(Z)}),pe=g(c(d({forcePredefinedQuestions:l(f()),forceChatPage:l(f()),showOverallFeedbackButton:f(),showOverallFeedbackEmail:f(),showCloseChatButton:f(),showContextMenu:f(),showContextInfo:f(),showReferencesByDefault:f(),showExpandedSelectors:f(),showTextFeedback:f(),inlineLayout:f(),allowAudioInput:f(),blockPII:f(),questionPrefix:b(),menu:l(r(k,i(ae))),supportedLanguages:i(k),classification:l(X),answerForm:l(de),theme:h,translations:A,buttonHref:l(b()),addQueryToUrlParams:l(f()),addRetrievalQuestionToUrlParams:l(f()),renderKatex:l(f()),reflectLanguageInPath:l(f()),sendReferrer:l(u([`all`,`own`,`none`,`location`])),selectorsConfig:ne(i(le),[]),questionLengthLimit:l(p()),forceConsent:l(f()),askQuestionAgain:f(),enableBackdrop:l(f()),parentPageContext:d({extractSelectors:l(i(b()))}),messageAdditions:l(fe),contextVersion:l(p()),selectedTopicResetPredefinedQuestionId:l(b())})),d({theme:l(d({name:l(b())}))})),Q=(e,t)=>t.includes(e),$=(e,t)=>{if(Q(e,t))return e;let n=me();return Q(n,t)?n:`en`},me=()=>navigator.language.split(`-`)[0],he=(e,t)=>{localStorage.setItem(`liipgpt:selectedLanguage`,e),t&&(t.lang=e)},ge=e=>$(localStorage.getItem(`liipgpt:selectedLanguage`),e),_e=(e,t,n)=>{if(!e)return``;if(e[t])return e[t];for(let t of n)if(e[t])return e[t];return e.en?e.en:Object.values(e).find(e=>typeof e==`string`&&e.length>0)??``},ve=(e,t)=>Array.from(new Set([e,...t,`en`,...C])),ye=(e,t,n,r)=>{for(let i of ve(n,r)){let n=e[i]?.selectors?.[t];if(n)return n}};export{he as a,ce as c,A as d,S as f,_e as i,J as l,$ as n,pe as o,ye as r,se as s,ge as t,B as u};
@@ -1 +0,0 @@
1
- import{o as e}from"./pHVM4a9g.js";var t=t=>e.parse(t);export{t};
@@ -1 +0,0 @@
1
- import"../chunks/rEsbAd0y.js";import{n as e,s as t}from"../chunks/CCYtl4Cx.js";import"../chunks/Bo0U8J3e.js";export{t as load_css,e as start};