Socket
Socket
Sign inDemoInstall

@fluid-topics/public-api

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluid-topics/public-api - npm Package Compare versions

Comparing version 1.0.66 to 1.0.67

10

build/cjs/types/ft-common/public.js

@@ -566,3 +566,2 @@ "use strict";

&& (isString(o.query))
&& (o.scope == null || (0, exports.isFtSearchScope)(o.scope))
&& ((0, exports.isFtPageRequest)(o.paging))

@@ -573,9 +572,12 @@ && ((Array.isArray(o.filters)

&& o.sort.every((v) => (0, exports.isFtSearchSortCriterion)(v))))
&& (o.virtualField == null || (0, exports.isFtVirtualField)(o.virtualField))
&& ((Array.isArray(o.facets)
&& o.facets.every((v) => (0, exports.isFtSearchFacetConf)(v))))
&& (o.scope == null || (0, exports.isFtSearchScope)(o.scope))
&& (o.uiLocale == null || isString(o.uiLocale))
&& (o.virtualField == null || (0, exports.isFtVirtualField)(o.virtualField))
&& (o.contentLocale == null || isString(o.contentLocale))
&& (o.priors == null || (Array.isArray(o.priors)
&& o.priors.every((v) => (0, exports.isFtSearchPrior)(v))))
&& ((Array.isArray(o.facets)
&& o.facets.every((v) => (0, exports.isFtSearchFacetConf)(v))));
&& (o.clusterSortCriterions == null || (Array.isArray(o.clusterSortCriterions)
&& o.clusterSortCriterions.every((v) => (0, exports.isFtPublicClusterSortCriterion)(v))));
};

@@ -582,0 +584,0 @@ exports.isFtSearchRequest = isFtSearchRequest;

7

build/mjs/types/ft-common/public.d.ts

@@ -428,12 +428,13 @@ export interface FtHttpErrorDetails {

query: string;
scope?: FtSearchScopeKeys;
paging: FtPageRequest;
filters: Array<FtSearchFilter>;
sort: Array<FtSearchSortCriterion>;
virtualField?: FtVirtualFieldKeys;
facets: Array<FtSearchFacetConf>;
scope?: FtSearchScopeKeys;
lastModified?: any;
uiLocale?: string;
virtualField?: FtVirtualFieldKeys;
contentLocale?: string;
priors?: Array<FtSearchPrior>;
facets: Array<FtSearchFacetConf>;
clusterSortCriterions?: Array<FtPublicClusterSortCriterion>;
}

@@ -440,0 +441,0 @@ export declare const isFtSearchRequest: (o: any) => o is FtSearchRequest;

@@ -505,3 +505,2 @@ const isObject = (o) => typeof o === "object" && o != null;

&& (isString(o.query))
&& (o.scope == null || isFtSearchScope(o.scope))
&& (isFtPageRequest(o.paging))

@@ -512,9 +511,12 @@ && ((Array.isArray(o.filters)

&& o.sort.every((v) => isFtSearchSortCriterion(v))))
&& (o.virtualField == null || isFtVirtualField(o.virtualField))
&& ((Array.isArray(o.facets)
&& o.facets.every((v) => isFtSearchFacetConf(v))))
&& (o.scope == null || isFtSearchScope(o.scope))
&& (o.uiLocale == null || isString(o.uiLocale))
&& (o.virtualField == null || isFtVirtualField(o.virtualField))
&& (o.contentLocale == null || isString(o.contentLocale))
&& (o.priors == null || (Array.isArray(o.priors)
&& o.priors.every((v) => isFtSearchPrior(v))))
&& ((Array.isArray(o.facets)
&& o.facets.every((v) => isFtSearchFacetConf(v))));
&& (o.clusterSortCriterions == null || (Array.isArray(o.clusterSortCriterions)
&& o.clusterSortCriterions.every((v) => isFtPublicClusterSortCriterion(v))));
};

@@ -521,0 +523,0 @@ export const isFtSearchResultCluster = (o) => {

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).fluidtopics={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};!function(e){!function(t){var r={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function u(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function d(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,r,i=u(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=c(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i<t.length;i++)r[i]=String.fromCharCode(t[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=s(e),t=n(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=n(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),o(e)},l.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),o(e)},l.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),o(e)},r.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function A(e,t){var r,i,a=(t=t||{}).body;if(e instanceof A){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(r=t.method||this.method||"GET",i=r.toUpperCase(),y.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a)}function f(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),a=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(a))}})),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},h.call(A.prototype),h.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];m.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function g(e,i){return new Promise((function(a,s){var n=new A(e,i);if(n.signal&&n.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),i=r.shift().trim();if(i){var a=r.join(":").trim();t.append(i,a)}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;a(new m(i,r))},o.onerror=function(){s(new TypeError("Network request failed"))},o.ontimeout=function(){s(new TypeError("Network request failed"))},o.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},o.open(n.method,n.url,!0),"include"===n.credentials?o.withCredentials=!0:"omit"===n.credentials&&(o.withCredentials=!1),"responseType"in o&&r.blob&&(o.responseType="blob"),n.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),n.signal&&(n.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&n.signal.removeEventListener("abort",u)}),o.send(void 0===n._bodyInit?null:n._bodyInit)}))}g.polyfill=!0,e.fetch||(e.fetch=g,e.Headers=l,e.Request=A,e.Response=m),t.Headers=l,t.Request=A,t.Response=m,t.fetch=g,Object.defineProperty(t,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:t);class r{reader;decoder=new TextDecoder;partialChunk="";constructor(e){this.reader=e}async*read(){for(;;){const{done:e,value:t}=await this.reader.read();if(e)return void(yield*this.readRemainingChunks());yield*this.readChunksFromValue(t)}}*readRemainingChunks(){yield*this.parseLine(this.partialChunk)}*readChunksFromValue(e){const t=(this.partialChunk+this.decoder.decode(e)).split("\n");this.partialChunk=t.pop();for(let e of t)yield*this.parseLine(e)}*parseLine(e){const[t,r]=e.split(/:(.*)/);"data"==t&&r.length>0&&(yield JSON.parse(r))}}const i=e=>"object"==typeof e&&null!=e,a=e=>"boolean"==typeof e,s=e=>"number"==typeof e,n=e=>"string"==typeof e;var o;e.FtMyLibraryColors=void 0,(o=e.FtMyLibraryColors||(e.FtMyLibraryColors={})).black="black",o.green="green",o.blue="blue",o.purple="purple",o.red="red",o.orange="orange",o.yellow="yellow";const l=e=>["black","green","blue","purple","red","orange","yellow"].includes(e);var u;e.FtTopicOriginType=void 0,(u=e.FtTopicOriginType||(e.FtTopicOriginType={})).OFFICIAL="OFFICIAL",u.PERSONAL="PERSONAL",u.SHARED="SHARED";const c=e=>["OFFICIAL","PERSONAL","SHARED"].includes(e),d=e=>i(e)&&Array.isArray(e.values)&&e.values.every((e=>Array.isArray(e)&&e.every((e=>n(e)))))&&n(e.key),p=e=>i(e)&&n(e.notes)&&Array.isArray(e.children)&&e.children.every((e=>p(e)))&&(null==e.topicLink||h(e.topicLink))&&n(e.title)&&(null==e.htmlContent||n(e.htmlContent)),h=e=>i(e)&&n(e.tocId)&&n(e.contentId)&&n(e.mapId),y=e=>i(e)&&n(e.topicStylesheetUrl)&&n(e.titleStylesheetUrl)&&Array.isArray(e.customCssClasses)&&e.customCssClasses.every((e=>n(e))),A=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&(null==e.hasRating||a(e.hasRating))&&n(e.tocId)&&Array.isArray(e.children)&&e.children.every((e=>A(e)))&&(null==e.origin||f(e.origin))&&n(e.contentId)&&n(e.title),f=e=>i(e)&&n(e.mapTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&n(e.contentId)&&n(e.mapId)&&c(e.type);var m;e.FtTopicContentTarget=void 0,(m=e.FtTopicContentTarget||(e.FtTopicContentTarget={})).THIRD_PARTY="THIRD_PARTY",m.OFF_THE_GRID="OFF_THE_GRID",m.CONTENT_PACKAGER="CONTENT_PACKAGER",m.PAGES="PAGES",m.DESIGNED_READER="DESIGNED_READER";var E;e.FtMetadataHomeLayout=void 0,(E=e.FtMetadataHomeLayout||(e.FtMetadataHomeLayout={})).CLASSIC="CLASSIC",E.CUSTOM="CUSTOM",E.DESIGNER="DESIGNER";const g=e=>i(e)&&s(e.count)&&n(e.label)&&(null==e.lang||n(e.lang));var S;e.FtFacetType=void 0,(S=e.FtFacetType||(e.FtFacetType={})).AND="AND",S.OR="OR",S.MONOVALUED="MONOVALUED";const T=e=>i(e)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&(null==e.hierarchicalValues||Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>n(e))))))&&n(e.label)&&n(e.key);var b;e.FtMetadataSortRule=void 0,(b=e.FtMetadataSortRule||(e.FtMetadataSortRule={})).NONE="NONE",b.ALPHABET="ALPHABET",b.VERSION="VERSION";const R=e=>["NONE","ALPHABET","VERSION"].includes(e),F=e=>i(e)&&R(e.sortRule)&&n(e.label)&&a(e.reverseSort)&&n(e.key),O=e=>i(e)&&(null==e.periodFilter||N(e.periodFilter))&&n(e.query)&&(null==e.scope||le(e.scope))&&Array.isArray(e.filters)&&e.filters.every((e=>Q(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>pe(e)))&&(null==e.virtualField||K(e.virtualField))&&(null==e.contentLocale||n(e.contentLocale));var I;e.FtRatingType=void 0,(I=e.FtRatingType||(e.FtRatingType={})).STARS="STARS",I.LIKE="LIKE",I.DICHOTOMOUS="DICHOTOMOUS",I.NO_RATING="NO_RATING";const U=e=>["STARS","LIKE","DICHOTOMOUS","NO_RATING"].includes(e),v=e=>i(e)&&n(e.date)&&U(e.type)&&s(e.value),_=e=>i(e)&&(null==e.rating||v(e.rating))&&U(e.type),C=e=>i(e)&&n(e.date)&&n(e.tocId)&&U(e.type)&&s(e.value),L=e=>i(e)&&Array.isArray(e.ratings)&&e.ratings.every((e=>C(e)))&&U(e.type),P=e=>i(e)&&Array.isArray(e.filter)&&e.filter.every((e=>n(e)))&&Array.isArray(e.prior)&&e.prior.every((e=>n(e))),D=e=>i(e)&&n(e.from)&&n(e.to),N=e=>i(e)&&(null==e.period||D(e.period))&&M(e.periodType);var k;e.FtPeriodFilterType=void 0,(k=e.FtPeriodFilterType||(e.FtPeriodFilterType={})).LAST_WEEK="LAST_WEEK",k.LAST_MONTH="LAST_MONTH",k.LAST_QUARTER="LAST_QUARTER",k.LAST_YEAR="LAST_YEAR",k.CUSTOM="CUSTOM";const M=e=>["LAST_WEEK","LAST_MONTH","LAST_QUARTER","LAST_YEAR","CUSTOM"].includes(e),w=e=>i(e)&&a(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&n(e.key);var B;e.FtSearchSortCriterionOrder=void 0,(B=e.FtSearchSortCriterionOrder||(e.FtSearchSortCriterionOrder={})).ASC="ASC",B.DESC="DESC";const H=e=>["ASC","DESC"].includes(e);var x;e.FtSearchSortCriterionType=void 0,(x=e.FtSearchSortCriterionType||(e.FtSearchSortCriterionType={})).ALPHA="ALPHA",x.NATURAL="NATURAL";const V=e=>["ALPHA","NATURAL"].includes(e);var $;e.FtVirtualField=void 0,($=e.FtVirtualField||(e.FtVirtualField={})).EVERYWHERE="EVERYWHERE",$.TITLE_ONLY="TITLE_ONLY",$.NONE="NONE";const K=e=>["EVERYWHERE","TITLE_ONLY","NONE"].includes(e),G=e=>i(e)&&s(e.totalResultsCount)&&a(e.isLastPage)&&s(e.currentPage)&&s(e.totalClustersCount);var j;e.FtEditorialType=void 0,(j=e.FtEditorialType||(e.FtEditorialType={})).ARTICLE="ARTICLE",j.BOOK="BOOK",j.SHARED_BOOK="SHARED_BOOK";const q=e=>["ARTICLE","BOOK","SHARED_BOOK"].includes(e);var X;e.FtOpenMode=void 0,(X=e.FtOpenMode||(e.FtOpenMode={})).FLUIDTOPICS="FLUIDTOPICS",X.EXTERNAL="EXTERNAL";const Y=e=>["FLUIDTOPICS","EXTERNAL"].includes(e),z=e=>i(e)&&(null==e.perPage||s(e.perPage))&&s(e.page);var W;e.FtCollectionDocumentType=void 0,(W=e.FtCollectionDocumentType||(e.FtCollectionDocumentType={})).MAP="MAP",W.DOCUMENT="DOCUMENT",W.TOPIC="TOPIC",W.PERSONAL_BOOK="PERSONAL_BOOK",W.SHARED_BOOK="SHARED_BOOK";const J=e=>["MAP","DOCUMENT","TOPIC","PERSONAL_BOOK","SHARED_BOOK"].includes(e),Q=e=>i(e)&&a(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&n(e.label)&&n(e.key),Z=e=>i(e)&&s(e.weight)&&n(e.value)&&n(e.key),ee=e=>i(e)&&Array.isArray(e.entries)&&e.entries.every((e=>te(e)))&&(null==e.metadataVariableAxis||n(e.metadataVariableAxis)),te=e=>i(e)&&Array.isArray(e.missingTerms)&&e.missingTerms.every((e=>n(e)))&&(null==e.document||re(e.document))&&(null==e.topic||ae(e.topic))&&ne(e.type)&&(null==e.map||ie(e.map)),re=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&Y(e.openMode)&&n(e.documentUrl)&&n(e.mimeType)&&n(e.title)&&(null==e.lastPublicationDate||n(e.lastPublicationDate))&&n(e.viewerUrl)&&n(e.contentUrl)&&n(e.filename)&&n(e.htmlTitle)&&(null==e.originUrl||n(e.originUrl))&&n(e.documentId)&&n(e.lastEditionDate)&&n(e.htmlExcerpt),ie=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&(null==e.openMode||Y(e.openMode))&&q(e.editorialType)&&n(e.title)&&(null==e.lastPublicationDate||n(e.lastPublicationDate))&&n(e.htmlTitle)&&(null==e.originUrl||n(e.originUrl))&&n(e.mapUrl)&&n(e.readerUrl)&&n(e.mapId)&&(null==e.lastEditionDate||n(e.lastEditionDate))&&n(e.htmlExcerpt),ae=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&Y(e.openMode)&&n(e.contentId)&&Array.isArray(e.resources)&&e.resources.every((e=>ye(e)))&&n(e.title)&&n(e.mapTitle)&&n(e.topicUrl)&&n(e.contentUrl)&&n(e.htmlTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&(null==e.originUrl||n(e.originUrl))&&n(e.readerUrl)&&n(e.mapId)&&(null==e.lastEditionDate||n(e.lastEditionDate))&&n(e.htmlExcerpt);var se;e.FtSearchResultType=void 0,(se=e.FtSearchResultType||(e.FtSearchResultType={})).MAP="MAP",se.DOCUMENT="DOCUMENT",se.TOPIC="TOPIC";const ne=e=>["MAP","DOCUMENT","TOPIC"].includes(e);var oe;e.FtSearchScope=void 0,(oe=e.FtSearchScope||(e.FtSearchScope={})).DEFAULT="DEFAULT",oe.DOCUMENTS="DOCUMENTS",oe.ALL_TOPICS="ALL_TOPICS";const le=e=>["DEFAULT","DOCUMENTS","ALL_TOPICS"].includes(e),ue=e=>i(e)&&a(e.hierarchical)&&n(e.label)&&a(e.multiSelectionable)&&n(e.key)&&Array.isArray(e.rootNodes)&&e.rootNodes.every((e=>de(e))),ce=e=>i(e)&&(null==e.maxDepth||s(e.maxDepth))&&n(e.id),de=e=>i(e)&&s(e.totalResultsCount)&&a(e.descendantSelected)&&Array.isArray(e.childNodes)&&e.childNodes.every((e=>de(e)))&&n(e.label)&&n(e.value)&&a(e.selected),pe=e=>i(e)&&V(e.type)&&n(e.key)&&H(e.order),he=e=>i(e)&&n(e.suggestedQuery)&&n(e.htmlSuggestedQuery),ye=e=>i(e)&&n(e.filename)&&n(e.resourceUrl)&&n(e.id)&&n(e.mimeType)&&n(e.resourceContentUrl)&&n(e.viewerUrl),Ae=e=>i(e)&&n(e.contentUrl)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.excerpt)&&s(e.relevance),fe=e=>i(e)&&(null==e.filenameExtension||n(e.filenameExtension))&&(null==e.editorialType||q(e.editorialType))&&(null==e.mimeType||n(e.mimeType))&&ne(e.type)&&n(e.value);var me;e.FtUserRole=void 0,(me=e.FtUserRole||(e.FtUserRole={})).PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",me.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",me.HTML_EXPORT_USER="HTML_EXPORT_USER",me.PDF_EXPORT_USER="PDF_EXPORT_USER",me.SAVED_SEARCH_USER="SAVED_SEARCH_USER",me.COLLECTION_USER="COLLECTION_USER",me.OFFLINE_USER="OFFLINE_USER",me.ANALYTICS_USER="ANALYTICS_USER",me.BETA_USER="BETA_USER",me.DEBUG_USER="DEBUG_USER",me.PRINT_USER="PRINT_USER",me.RATING_USER="RATING_USER",me.FEEDBACK_USER="FEEDBACK_USER",me.GENERATIVE_AI_USER="GENERATIVE_AI_USER",me.CONTENT_PUBLISHER="CONTENT_PUBLISHER",me.KHUB_ADMIN="KHUB_ADMIN",me.USERS_ADMIN="USERS_ADMIN",me.PORTAL_ADMIN="PORTAL_ADMIN",me.ADMIN="ADMIN",me.DEVELOPER="DEVELOPER";const Ee=e=>["PERSONAL_BOOK_USER","PERSONAL_BOOK_SHARE_USER","HTML_EXPORT_USER","PDF_EXPORT_USER","SAVED_SEARCH_USER","COLLECTION_USER","OFFLINE_USER","ANALYTICS_USER","BETA_USER","DEBUG_USER","PRINT_USER","RATING_USER","FEEDBACK_USER","GENERATIVE_AI_USER","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(e),ge=e=>i(e)&&n(e.identifier)&&n(e.realm),Se=e=>i(e)&&Array.isArray(e.defaultFilters)&&e.defaultFilters.every((e=>w(e))),Te=e=>i(e)&&(null==e.emailAddress||n(e.emailAddress))&&(null==e.displayName||n(e.displayName))&&Array.isArray(e.roles)&&e.roles.every((e=>Ee(e)))&&(null==e.userId||n(e.userId)),be=e=>i(e)&&n(e.color)&&Array.isArray(e.text)&&e.text.every((e=>n(e)))&&s(e.opacity),Re=e=>"object"==typeof e&&null!=e,Fe=e=>"boolean"==typeof e,Oe=e=>"number"==typeof e,Ie=e=>"string"==typeof e;var Ue;e.FtConfigurationHistoryEntryStatus=void 0,(Ue=e.FtConfigurationHistoryEntryStatus||(e.FtConfigurationHistoryEntryStatus={})).VALID="VALID",Ue.INVALID="INVALID";const ve=e=>Re(e)&&Fe(e.mailsSentByFluidTopics)&&Fe(e.mailsSentByFluidTopicsForUnauthenticatedUsers)&&Array.isArray(e.recipients)&&e.recipients.every((e=>Ie(e)))&&Array.isArray(e.bodyMetadataIds)&&e.bodyMetadataIds.every((e=>Ie(e)))&&Array.isArray(e.subjectMetadataIds)&&e.subjectMetadataIds.every((e=>Ie(e))),_e=e=>Re(e)&&Ie(e.role)&&Ie(e.content),Ce=e=>Re(e)&&(null==e.parentsVisibility||Array.isArray(e.parentsVisibility)&&e.parentsVisibility.every((e=>Fe(e))))&&Fe(e.isVisible),Le=e=>Re(e)&&(null==e.prettyUrl||Ie(e.prettyUrl))&&(null==e.hasRating||Fe(e.hasRating))&&(null==e.pageToc||Array.isArray(e.pageToc))&&(null==e.tocId||Ie(e.tocId))&&Array.isArray(e.children)&&e.children.every((e=>Le(e)))&&(null==e.pageConfiguration||Ce(e.pageConfiguration))&&(null==e.contentId||Ie(e.contentId))&&(null==e.title||Ie(e.title)),Pe=e=>Re(e)&&Fe(e.splitCurrentPageToc),De=e=>Re(e)&&Array.isArray(e.values)&&e.values.every((e=>Ie(e)))&&Ie(e.key),Ne={[e.FtUserRole.PERSONAL_BOOK_SHARE_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.HTML_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.PDF_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.KHUB_ADMIN]:[e.FtUserRole.CONTENT_PUBLISHER],[e.FtUserRole.ADMIN]:[e.FtUserRole.KHUB_ADMIN,e.FtUserRole.USERS_ADMIN,e.FtUserRole.PORTAL_ADMIN],[e.FtUserRole.DEVELOPER]:[e.FtUserRole.BETA_USER,e.FtUserRole.DEBUG_USER]};function ke(e,t){return e===t||(Ne[e]??[]).some((e=>ke(e,t)))}const Me="undefined"==typeof window?globalThis:window;function we(e){let t={};for(let r in e){let i=e[r];("object"!=typeof i||Array.isArray(i))&&(i={prior:i});for(let e of["prior","filter"])i[e]=Array.isArray(i[e])?i[e]:[i[e]],i[e]=i[e].map((e=>null!=e?""+e:"")).filter((e=>""!==e));t[r]=i}return t}function Be(e){return`${e}-FluidTopicsUnauthenticatedUserSearchPreferences`}const He="undefined"==typeof window?globalThis:window;class xe extends Error{method;endpoint;status;statusText;body;constructor(e,t,r,i,a){super(`${e} ${t} -> ${r} - ${i}: ${a}`),this.method=e,this.endpoint=t,this.status=r,this.statusText=i,this.body=a}}class Ve extends CustomEvent{constructor(e){super("ft-api-http-error",{detail:e})}}async function $e(e,t,r){if(!r.ok){let i={method:e,endpoint:t,status:r.status,statusText:r.statusText,body:await r.text()};throw"function"==typeof He.dispatchEvent&&He.dispatchEvent(new Ve(i)),new xe(i.method,i.endpoint,i.status,i.statusText,i.body)}return r}function Ke(e){return"application/json"===e.headers.get("Content-Type")?e.json():e.text()}class Ge{tenantBaseUrl;ftCallingApp;authorization;searchLabel;endpoints={authentication:{login:"api/authentication/login",logout:"api/authentication/logout",currentSession:"api/authentication/current-session"},khub:{maps:{mapId:e=>({info:`api/khub/maps/${e}`,toc:`api/khub/maps/${e}/toc`,pages:`api/khub/maps/${e}/pages`,feedback:`api/khub/maps/${e}/feedback`,rating:`api/khub/maps/${e}/rating`,attachments:{list:`api/khub/maps/${e}/attachments`,attachmentId:t=>({content:`api/khub/maps/${e}/attachments/${t}/content`})},resources:{list:`api/khub/maps/${e}/resources`,resourceId:t=>({content:`api/khub/maps/${e}/resources/${t}/content`})},topics:{contentId:t=>({info:`api/khub/maps/${e}/topics/${t}`,content:`api/khub/maps/${e}/topics/${t}/content`}),tocId:t=>({feedback:`api/khub/maps/${e}/topics/${t}/feedback`,rating:`api/khub/maps/${e}/topics/${t}/rating`})}})},documents:{documentId:e=>({info:`api/khub/documents/${e}`,content:`api/khub/documents/${e}/content`,text:`api/khub/documents/${e}/content/text`,feedback:`api/khub/documents/${e}/feedback`,rating:`api/khub/documents/${e}/rating`})},suggest:"api/khub/suggest",clusteredSearch:"api/khub/clustered-search",locales:"api/khub/locales"},users:{userId:e=>({collections:{collectionId:t=>({documents:`api/users/${e}/collections/${t}/documents`})},searches:{list:`api/users/${e}/searches`},bookmarks:{list:`api/users/${e}/bookmarks`}})},stylesheets:{fonts:"stylesheets/fonts.css",theme:"stylesheets/theme.css",content:{title:"stylesheets/content/title.css",topic:"stylesheets/content/topic.css"}},configuration:{reader:"api/configuration/reader",metadata:"api/configuration/metadata"},locales:{ui:"api/locales/ui"},messages:{locale:e=>({fluidTopics:{contextName:t=>({endpoint:`api/messages/${e}/fluid-topics/${t}`})},custom:{contextName:t=>({endpoint:`api/messages/${e}/custom/${t}`})}})},ai:{generate:"api/ai/generate",sendFeedback:"api/ai/rate",chat:"/api/ai/rag/chat"}};get defaultHeaders(){return{...this.authorization,...this.searchLabel,"Ft-Calling-App":this.ftCallingApp}}constructor(e,t,r){e=(e??He.fluidTopicsBaseUrl??He.__gwt_ft_moduleBase??"").trim(),this.tenantBaseUrl=e.endsWith("/")?e:e+"/",r&&void 0!==He.location&&He.location.href.startsWith(this.tenantBaseUrl)?this.ftCallingApp=t:this.ftCallingApp=`ft-public-api/${t}`}setApiKey(e){this.authorization={Authorization:"Bearer "+e}}setCredentials(e,t){var r;this.authorization={Authorization:"Basic "+(r=`${e}:${t}`,"undefined"!=typeof Buffer?Buffer.from(r).toString("base64"):btoa(r))}}clearAuthentication(){this.authorization=void 0}setSearchLabel(e){this.searchLabel={"FT-search-label":e}}clearSearchLabel(){this.searchLabel=void 0}login(e,t){let r={login:e,password:t,rememberMe:!0};return this.post(this.endpoints.authentication.login,r).then((r=>(this.setCredentials(e,t),r)))}logout(){return this.post(this.endpoints.authentication.logout).then((()=>this.clearAuthentication()))}getCurrentSession(){return this.get(this.endpoints.authentication.currentSession)}getReaderConfiguration(){return this.get(this.endpoints.configuration.reader)}getMap(e,t){return this.get(this.endpoints.khub.maps.mapId(e).info,t)}getTableOfContent(e,t){return this.get(this.endpoints.khub.maps.mapId(e).toc,t)}getPages(e,t){return this.get(this.endpoints.khub.maps.mapId(e).pages,t)}getTopic(e,t,r){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).info,r)}getTopicHTMLContent(e,t,r,i){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).content+(r?"?target="+r:""),i)}getMapAttachments(e,t){return this.get(this.endpoints.khub.maps.mapId(e).attachments.list,t)}getMapAttachmentContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).attachments.attachmentId(t).content,r)}getMapResources(e,t){return this.get(this.endpoints.khub.maps.mapId(e).resources.list,t)}getMapResourceContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).resources.resourceId(t).content,r)}getUnstructuredDocument(e,t){return this.get(this.endpoints.khub.documents.documentId(e).info,t)}getUnstructuredDocumentContent(e,t){return this.fetchRawData(this.endpoints.khub.documents.documentId(e).content,t)}getUnstructuredDocumentTextContent(e,t){return this.get(this.endpoints.khub.documents.documentId(e).text,t)}getCollectionDocuments(e,t){return this.get(this.endpoints.users.userId(e).collections.collectionId(t).documents)}getSuggestions(e){return this.post(this.endpoints.khub.suggest,e)}search(e){return this.post(this.endpoints.khub.clusteredSearch,e)}getAvailableSearchLocales(){return this.get(this.endpoints.khub.locales)}getAvailableUiLocales(){return this.get(this.endpoints.khub.locales)}getMetadataConfiguration(){return this.get(this.endpoints.configuration.metadata)}getMapRating(e){return this.get(this.endpoints.khub.maps.mapId(e).rating)}rateMap(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).rating,{type:t,value:r})}unrateMap(e){return this.delete(this.endpoints.khub.maps.mapId(e).rating)}sendMapFeedback(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).feedback,{message:t,from:r})}rateTopic(e,t,r,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating,{type:r,value:i})}unrateTopic(e,t){return this.delete(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating)}sendTopicFeedback(e,t,r,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).feedback,{message:r,from:i})}getDocumentRating(e){return this.get(this.endpoints.khub.documents.documentId(e).rating)}rateDocument(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).rating,{type:t,value:r})}unrateDocument(e){return this.delete(this.endpoints.khub.documents.documentId(e).rating)}sendDocumentFeedback(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).feedback,{message:t,from:r})}getFluidTopicsMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).fluidTopics.contextName(t).endpoint)}getCustomMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).custom.contextName(t).endpoint)}listMySearches(e){return this.get(this.endpoints.users.userId(e).searches.list)}listMyBookmarks(e){return this.get(this.endpoints.users.userId(e).bookmarks.list)}async*generate(e,t){const i=await this.fetch(this.endpoints.ai.generate,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e,parameters:t}),credentials:null==this.authorization?"include":void 0});await $e("POST",this.endpoints.ai.generate,i);const a=new r(i.body.getReader());yield*a.read()}async*chat(e){const t=await this.fetch(this.endpoints.ai.chat,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:null==this.authorization?"include":void 0});await $e("POST",this.endpoints.ai.chat,t);const i=new r(t.body.getReader());yield*i.read()}sendFeedback(e){return this.post(this.endpoints.ai.sendFeedback,e)}get(e,t){return this.makeRequest("GET",this.withVersion(e,t))}post(e,t){return this.makeRequest("POST",e,t)}put(e,t){return this.makeRequest("PUT",e,t)}delete(e){return this.makeRequest("DELETE",e)}makeAbsolute(e){return e.startsWith(this.tenantBaseUrl)?e:this.tenantBaseUrl+e.replace(/^\//,"")}async fetch(e,t){const r=t;return await fetch(this.makeAbsolute(e),{...r??{},headers:{...this.defaultHeaders,...r?.headers??{}}})}upload(e,t,r,i=(()=>{})){return"undefined"!=typeof XMLHttpRequest?new Promise(((a,s)=>{let n=new XMLHttpRequest;n.onload=()=>{if(n.status>=200&&n.status<300){let e="application/json"===n.getResponseHeader("Content-Type")?JSON.parse(n.responseText):n.responseText;a(e)}else s(new xe("GET",t,n.status,n.statusText,n.responseText))},n.upload.onprogress=e=>i(e),n.open(e,this.makeAbsolute(t),!0),n.send(r)})):this.fetch(t,{method:e,body:r}).then((r=>$e(e,t,r))).then(Ke)}makeRequest(e,t,r){return this.fetch(t,{method:e,headers:{...null!=r?{"Content-Type":"application/json"}:{}},body:null!=r?JSON.stringify(r):void 0,credentials:null==this.authorization?"include":void 0}).then((r=>$e(e,t,r))).then(Ke)}fetchRawData(e,t){return fetch(this.withVersion(e,t),{headers:this.defaultHeaders,credentials:null==this.authorization?"include":void 0}).then((t=>$e("GET",e,t))).then((e=>e.arrayBuffer()))}withVersion(e,t){let r=new URL(this.makeAbsolute(e));return t&&r.searchParams.append("v",t),r.toString()}}e.FluidTopicsApi=Ge,e.HttpError=xe,e.HttpErrorEvent=Ve,e.addUnauthenticatedUserSearchPreferencesChangeHandler=function(e,t){if(Me.localStorage){const r=Be(e),i=e=>{e.storageArea===Me.localStorage&&e.key===r&&t(JSON.parse(e.newValue??"{}"))};return Me.addEventListener("storage",i),{removeHandler:()=>Me.removeEventListener("storage",i)}}console.error("Cannot handle unauthenticated preferences: local storage is unavailable.")},e.default=Ge,e.getUnauthenticatedUserSearchPreferences=function(e){if(Me.localStorage)return JSON.parse(Me.localStorage.getItem(Be(e))??"{}");console.error("Cannot get unauthenticated preferences: local storage is unavailable.")},e.isFtAuthenticatedSession=e=>i(e)&&ge(e.authenticationIdentifier)&&Te(e.profile),e.isFtAuthenticationIdentifier=ge,e.isFtBookmark=e=>i(e)&&n(e.mapTitle)&&l(e.color)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&n(e.lastUpdate)&&n(e.readerUrl)&&n(e.mapId)&&n(e.id)&&n(e.title)&&n(e.creationDate),e.isFtCollectionDocument=e=>i(e)&&a(e.deleted)&&(null==e.apiUrl||n(e.apiUrl))&&(null==e.portalUrl||n(e.portalUrl))&&n(e.id)&&n(e.title)&&J(e.type),e.isFtCollectionDocumentType=J,e.isFtConfigurationHistoryEntryStatus=e=>["VALID","INVALID"].includes(e),e.isFtCredentials=e=>i(e)&&n(e.password)&&(null==e.newPassword||n(e.newPassword))&&a(e.rememberMe)&&n(e.login),e.isFtEditorialType=q,e.isFtFacetType=e=>["AND","OR","MONOVALUED"].includes(e),e.isFtFeedbackCreation=e=>i(e)&&(null==e.from||n(e.from))&&n(e.message),e.isFtGenAIGenerateInput=e=>Re(e)&&Ie(e.profileId)&&(null==e.parameters||Re(e.parameters)&&Object.keys(e.parameters).every((e=>Ie(e)))&&Object.values(e.parameters).every((e=>Ie(e)))),e.isFtGenAIRating=e=>Re(e)&&Oe(e.rating)&&Ie(e.comment)&&Ie(e.queryId),e.isFtHttpErrorDetails=e=>i(e)&&n(e.endpoint)&&n(e.method)&&n(e.statusText)&&n(e.body)&&s(e.status),e.isFtLabeledSearchFilter=Q,e.isFtMap=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&(null==e.watermark||be(e.watermark))&&Y(e.openMode)&&(null==e.topicsApiEndpoint||n(e.topicsApiEndpoint))&&(null==e.description||n(e.description))&&(null==e.attachmentsApiEndpoint||n(e.attachmentsApiEndpoint))&&q(e.editorialType)&&n(e.baseId)&&n(e.clusterId)&&n(e.title)&&n(e.lastPublication)&&a(e.pbkConfidential)&&n(e.lastEdition)&&n(e.originId)&&(null==e.rightsApiEndpoint||n(e.rightsApiEndpoint))&&y(e.contentStyles)&&(null==e.originUrl||n(e.originUrl))&&n(e.fingerprint)&&n(e.readerUrl)&&(null==e.khubVersion||n(e.khubVersion))&&n(e.id)&&(null==e.lang||n(e.lang)),e.isFtMapAttachment=e=>Re(e)&&Ie(e.file)&&(null==e.size||Oe(e.size))&&Fe(e.externalLink)&&Ie(e.name)&&Ie(e.id)&&(null==e.mimeType||Ie(e.mimeType))&&(null==e.viewerUrl||Ie(e.viewerUrl)),e.isFtMapResource=e=>i(e)&&n(e.contentUrl)&&n(e.filename)&&n(e.id)&&n(e.mimeType),e.isFtMapStyles=y,e.isFtMessageContext=e=>i(e)&&n(e.name)&&i(e.messages)&&Object.keys(e.messages).every((e=>n(e)))&&Object.values(e.messages).every((e=>n(e)))&&n(e.locale),e.isFtMetadata=T,e.isFtMetadataConfiguration=e=>i(e)&&Array.isArray(e.descriptors)&&e.descriptors.every((e=>F(e))),e.isFtMetadataDescriptor=F,e.isFtMetadataHomeLayout=e=>["CLASSIC","CUSTOM","DESIGNER"].includes(e),e.isFtMetadataPreferenceConfiguration=P,e.isFtMetadataSortRule=R,e.isFtMyLibraryColors=l,e.isFtMySearch=e=>i(e)&&O(e.searchRequest)&&l(e.color)&&a(e.alert)&&n(e.description)&&n(e.id)&&n(e.ownerId)&&n(e.title)&&n(e.creationDate),e.isFtMySearchRequest=O,e.isFtOpenMode=Y,e.isFtPageConfiguration=Ce,e.isFtPageRequest=z,e.isFtPaginatedToc=e=>Re(e)&&Pe(e.configuration)&&Array.isArray(e.paginatedToc)&&e.paginatedToc.every((e=>Le(e))),e.isFtPaginatedTocNode=Le,e.isFtPaginationConfiguration=Pe,e.isFtPeriod=D,e.isFtPeriodFilter=N,e.isFtPeriodFilterType=M,e.isFtPersonalBookCreation=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>d(e)))&&Array.isArray(e.nodes)&&e.nodes.every((e=>p(e)))&&n(e.description)&&n(e.title),e.isFtPersonalBookMetadataUpdate=d,e.isFtPersonalBookNodeCreation=p,e.isFtPersonalBookTopicLinkCreation=h,e.isFtPublicClusterSortCriterion=e=>i(e)&&n(e.key),e.isFtPublicationRating=v,e.isFtPublicationRatingSummary=_,e.isFtRagHistory=_e,e.isFtRagInput=e=>Re(e)&&Ie(e.profileId)&&Ie(e.query)&&(null==e.messages||Array.isArray(e.messages)&&e.messages.every((e=>_e(e))))&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>De(e)))),e.isFtRatingCreation=e=>i(e)&&U(e.type)&&s(e.value),e.isFtRatingSummary=e=>i(e)&&(null==e.topics||L(e.topics))&&_(e.publication),e.isFtRatingType=U,e.isFtReaderConfiguration=e=>Re(e)&&ve(e.feedback)&&Oe(e.loadAfterLastVisibleTopic)&&Ie(e.relativeTopicPivotMetadata)&&Oe(e.loadBeforeFirstVisibleTopic)&&Ie(e.relativePivotMetadata),e.isFtReaderFeedbackConfiguration=ve,e.isFtSearchFacet=ue,e.isFtSearchFacetConf=ce,e.isFtSearchFacetEntry=de,e.isFtSearchFilter=w,e.isFtSearchLocale=g,e.isFtSearchLocales=e=>i(e)&&Array.isArray(e.contentLocales)&&e.contentLocales.every((e=>g(e))),e.isFtSearchPreferences=Se,e.isFtSearchPreferencesConfiguration=e=>i(e)&&i(e.metadata)&&Object.keys(e.metadata).every((e=>n(e)))&&Object.values(e.metadata).every((e=>P(e))),e.isFtSearchPreset=e=>i(e)&&n(e.name)&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&s(e.priority)&&(null==e.contentLocale||n(e.contentLocale)),e.isFtSearchPrior=Z,e.isFtSearchRequest=e=>i(e)&&(null==e.periodFilter||N(e.periodFilter))&&n(e.query)&&(null==e.scope||le(e.scope))&&z(e.paging)&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>pe(e)))&&(null==e.uiLocale||n(e.uiLocale))&&(null==e.virtualField||K(e.virtualField))&&(null==e.contentLocale||n(e.contentLocale))&&(null==e.priors||Array.isArray(e.priors)&&e.priors.every((e=>Z(e))))&&Array.isArray(e.facets)&&e.facets.every((e=>ce(e))),e.isFtSearchResultCluster=ee,e.isFtSearchResultClusterEntry=te,e.isFtSearchResultMap=ie,e.isFtSearchResultTopic=ae,e.isFtSearchResultType=ne,e.isFtSearchResultUnstructuredDocument=re,e.isFtSearchResults=e=>i(e)&&(null==e.spellcheck||he(e.spellcheck))&&G(e.paging)&&Array.isArray(e.results)&&e.results.every((e=>ee(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>ue(e))),e.isFtSearchResultsPageInfo=G,e.isFtSearchScope=le,e.isFtSearchSortCriterion=pe,e.isFtSearchSortCriterionOrder=H,e.isFtSearchSortCriterionType=V,e.isFtSemanticSearchFilter=De,e.isFtSemanticSearchRequest=e=>Re(e)&&Ie(e.query)&&Array.isArray(e.filters)&&e.filters.every((e=>De(e)))&&Oe(e.nbResults),e.isFtSemanticSearchResponse=e=>i(e)&&Array.isArray(e.items)&&e.items.every((e=>Ae(e))),e.isFtSemanticSearchResponseItem=Ae,e.isFtSession=e=>i(e)&&(null==e.authenticationIdentifier||ge(e.authenticationIdentifier))&&s(e.idleTimeoutInMillis)&&Te(e.profile)&&a(e.sessionAuthenticated)&&Se(e.searchPreferences),e.isFtSpellcheck=he,e.isFtSuggestRequest=e=>i(e)&&n(e.input)&&(null==e.scope||le(e.scope))&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>pe(e)))&&(null==e.maxCount||s(e.maxCount))&&(null==e.contentLocale||n(e.contentLocale)),e.isFtSuggestResult=fe,e.isFtSuggestResults=e=>i(e)&&Array.isArray(e.suggestions)&&e.suggestions.every((e=>fe(e))),e.isFtTocNode=A,e.isFtTopic=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.id)&&n(e.contentApiEndpoint)&&n(e.title),e.isFtTopicContentTarget=e=>["THIRD_PARTY","OFF_THE_GRID","CONTENT_PACKAGER","PAGES","DESIGNED_READER"].includes(e),e.isFtTopicOrigin=f,e.isFtTopicOriginType=c,e.isFtTopicRating=C,e.isFtTopicResource=ye,e.isFtTopicsRatingSummary=L,e.isFtUiLocale=e=>i(e)&&n(e.displayName)&&n(e.languageTag)&&a(e.translated),e.isFtUnstructuredDocument=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.openMode)&&(null==e.description||n(e.description))&&n(e.mimeType)&&(null==e.baseId||n(e.baseId))&&(null==e.clusterId||n(e.clusterId))&&n(e.contentApiEndpoint)&&n(e.title)&&(null==e.lastPublication||n(e.lastPublication))&&n(e.viewerUrl)&&n(e.lastEdition)&&n(e.filename)&&(null==e.originId||n(e.originId))&&n(e.rightsApiEndpoint)&&(null==e.originUrl||n(e.originUrl))&&(null==e.khubVersion||n(e.khubVersion))&&n(e.id)&&(null==e.lang||n(e.lang)),e.isFtUserProfile=Te,e.isFtUserRole=Ee,e.isFtVirtualField=K,e.isFtWatermark=be,e.setUnauthenticatedUserSearchPreferences=function(e,t){if(Me.localStorage){let r={...t,metadata:we(t.metadata??{})};const i=Be(e),a=JSON.stringify(r);return Me.localStorage.setItem(i,a),Me.dispatchEvent(new StorageEvent("storage",{key:i,newValue:a,storageArea:Me.localStorage,url:Me.location.href})),r}console.error("Cannot set unauthenticated preferences: local storage is unavailable.")},e.userHasRole=function(e,t){return null!=e&&(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some((e=>ke(e,t)))}}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).fluidtopics={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};!function(e){!function(t){var r={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function u(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function d(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,r,i=u(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=c(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i<t.length;i++)r[i]=String.fromCharCode(t[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=s(e),t=n(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=n(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),o(e)},l.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),o(e)},l.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),o(e)},r.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function A(e,t){var r,i,a=(t=t||{}).body;if(e instanceof A){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(r=t.method||this.method||"GET",i=r.toUpperCase(),y.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a)}function f(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),a=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(a))}})),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},h.call(A.prototype),h.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];m.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function g(e,i){return new Promise((function(a,s){var n=new A(e,i);if(n.signal&&n.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),i=r.shift().trim();if(i){var a=r.join(":").trim();t.append(i,a)}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;a(new m(i,r))},o.onerror=function(){s(new TypeError("Network request failed"))},o.ontimeout=function(){s(new TypeError("Network request failed"))},o.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},o.open(n.method,n.url,!0),"include"===n.credentials?o.withCredentials=!0:"omit"===n.credentials&&(o.withCredentials=!1),"responseType"in o&&r.blob&&(o.responseType="blob"),n.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),n.signal&&(n.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&n.signal.removeEventListener("abort",u)}),o.send(void 0===n._bodyInit?null:n._bodyInit)}))}g.polyfill=!0,e.fetch||(e.fetch=g,e.Headers=l,e.Request=A,e.Response=m),t.Headers=l,t.Request=A,t.Response=m,t.fetch=g,Object.defineProperty(t,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:t);class r{reader;decoder=new TextDecoder;partialChunk="";constructor(e){this.reader=e}async*read(){for(;;){const{done:e,value:t}=await this.reader.read();if(e)return void(yield*this.readRemainingChunks());yield*this.readChunksFromValue(t)}}*readRemainingChunks(){yield*this.parseLine(this.partialChunk)}*readChunksFromValue(e){const t=(this.partialChunk+this.decoder.decode(e)).split("\n");this.partialChunk=t.pop();for(let e of t)yield*this.parseLine(e)}*parseLine(e){const[t,r]=e.split(/:(.*)/);"data"==t&&r.length>0&&(yield JSON.parse(r))}}const i=e=>"object"==typeof e&&null!=e,a=e=>"boolean"==typeof e,s=e=>"number"==typeof e,n=e=>"string"==typeof e;var o;e.FtMyLibraryColors=void 0,(o=e.FtMyLibraryColors||(e.FtMyLibraryColors={})).black="black",o.green="green",o.blue="blue",o.purple="purple",o.red="red",o.orange="orange",o.yellow="yellow";const l=e=>["black","green","blue","purple","red","orange","yellow"].includes(e);var u;e.FtTopicOriginType=void 0,(u=e.FtTopicOriginType||(e.FtTopicOriginType={})).OFFICIAL="OFFICIAL",u.PERSONAL="PERSONAL",u.SHARED="SHARED";const c=e=>["OFFICIAL","PERSONAL","SHARED"].includes(e),d=e=>i(e)&&Array.isArray(e.values)&&e.values.every((e=>Array.isArray(e)&&e.every((e=>n(e)))))&&n(e.key),p=e=>i(e)&&n(e.notes)&&Array.isArray(e.children)&&e.children.every((e=>p(e)))&&(null==e.topicLink||h(e.topicLink))&&n(e.title)&&(null==e.htmlContent||n(e.htmlContent)),h=e=>i(e)&&n(e.tocId)&&n(e.contentId)&&n(e.mapId),y=e=>i(e)&&n(e.topicStylesheetUrl)&&n(e.titleStylesheetUrl)&&Array.isArray(e.customCssClasses)&&e.customCssClasses.every((e=>n(e))),A=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&(null==e.hasRating||a(e.hasRating))&&n(e.tocId)&&Array.isArray(e.children)&&e.children.every((e=>A(e)))&&(null==e.origin||f(e.origin))&&n(e.contentId)&&n(e.title),f=e=>i(e)&&n(e.mapTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&n(e.contentId)&&n(e.mapId)&&c(e.type);var m;e.FtTopicContentTarget=void 0,(m=e.FtTopicContentTarget||(e.FtTopicContentTarget={})).THIRD_PARTY="THIRD_PARTY",m.OFF_THE_GRID="OFF_THE_GRID",m.CONTENT_PACKAGER="CONTENT_PACKAGER",m.PAGES="PAGES",m.DESIGNED_READER="DESIGNED_READER";var E;e.FtMetadataHomeLayout=void 0,(E=e.FtMetadataHomeLayout||(e.FtMetadataHomeLayout={})).CLASSIC="CLASSIC",E.CUSTOM="CUSTOM",E.DESIGNER="DESIGNER";const g=e=>i(e)&&s(e.count)&&n(e.label)&&(null==e.lang||n(e.lang));var S;e.FtFacetType=void 0,(S=e.FtFacetType||(e.FtFacetType={})).AND="AND",S.OR="OR",S.MONOVALUED="MONOVALUED";const T=e=>i(e)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&(null==e.hierarchicalValues||Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>n(e))))))&&n(e.label)&&n(e.key);var b;e.FtMetadataSortRule=void 0,(b=e.FtMetadataSortRule||(e.FtMetadataSortRule={})).NONE="NONE",b.ALPHABET="ALPHABET",b.VERSION="VERSION";const R=e=>["NONE","ALPHABET","VERSION"].includes(e),F=e=>i(e)&&R(e.sortRule)&&n(e.label)&&a(e.reverseSort)&&n(e.key),O=e=>i(e)&&(null==e.periodFilter||N(e.periodFilter))&&n(e.query)&&(null==e.scope||ue(e.scope))&&Array.isArray(e.filters)&&e.filters.every((e=>Z(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>he(e)))&&(null==e.virtualField||K(e.virtualField))&&(null==e.contentLocale||n(e.contentLocale));var I;e.FtRatingType=void 0,(I=e.FtRatingType||(e.FtRatingType={})).STARS="STARS",I.LIKE="LIKE",I.DICHOTOMOUS="DICHOTOMOUS",I.NO_RATING="NO_RATING";const v=e=>["STARS","LIKE","DICHOTOMOUS","NO_RATING"].includes(e),U=e=>i(e)&&n(e.date)&&v(e.type)&&s(e.value),C=e=>i(e)&&(null==e.rating||U(e.rating))&&v(e.type),_=e=>i(e)&&n(e.date)&&n(e.tocId)&&v(e.type)&&s(e.value),L=e=>i(e)&&Array.isArray(e.ratings)&&e.ratings.every((e=>_(e)))&&v(e.type),P=e=>i(e)&&Array.isArray(e.filter)&&e.filter.every((e=>n(e)))&&Array.isArray(e.prior)&&e.prior.every((e=>n(e))),D=e=>i(e)&&n(e.from)&&n(e.to),N=e=>i(e)&&(null==e.period||D(e.period))&&M(e.periodType);var k;e.FtPeriodFilterType=void 0,(k=e.FtPeriodFilterType||(e.FtPeriodFilterType={})).LAST_WEEK="LAST_WEEK",k.LAST_MONTH="LAST_MONTH",k.LAST_QUARTER="LAST_QUARTER",k.LAST_YEAR="LAST_YEAR",k.CUSTOM="CUSTOM";const M=e=>["LAST_WEEK","LAST_MONTH","LAST_QUARTER","LAST_YEAR","CUSTOM"].includes(e),w=e=>i(e)&&a(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&n(e.key);var B;e.FtSearchSortCriterionOrder=void 0,(B=e.FtSearchSortCriterionOrder||(e.FtSearchSortCriterionOrder={})).ASC="ASC",B.DESC="DESC";const H=e=>["ASC","DESC"].includes(e);var x;e.FtSearchSortCriterionType=void 0,(x=e.FtSearchSortCriterionType||(e.FtSearchSortCriterionType={})).ALPHA="ALPHA",x.NATURAL="NATURAL";const V=e=>["ALPHA","NATURAL"].includes(e);var $;e.FtVirtualField=void 0,($=e.FtVirtualField||(e.FtVirtualField={})).EVERYWHERE="EVERYWHERE",$.TITLE_ONLY="TITLE_ONLY",$.NONE="NONE";const K=e=>["EVERYWHERE","TITLE_ONLY","NONE"].includes(e),G=e=>i(e)&&s(e.totalResultsCount)&&a(e.isLastPage)&&s(e.currentPage)&&s(e.totalClustersCount);var j;e.FtEditorialType=void 0,(j=e.FtEditorialType||(e.FtEditorialType={})).ARTICLE="ARTICLE",j.BOOK="BOOK",j.SHARED_BOOK="SHARED_BOOK";const q=e=>["ARTICLE","BOOK","SHARED_BOOK"].includes(e);var X;e.FtOpenMode=void 0,(X=e.FtOpenMode||(e.FtOpenMode={})).FLUIDTOPICS="FLUIDTOPICS",X.EXTERNAL="EXTERNAL";const Y=e=>["FLUIDTOPICS","EXTERNAL"].includes(e),z=e=>i(e)&&(null==e.perPage||s(e.perPage))&&s(e.page),W=e=>i(e)&&n(e.key);var J;e.FtCollectionDocumentType=void 0,(J=e.FtCollectionDocumentType||(e.FtCollectionDocumentType={})).MAP="MAP",J.DOCUMENT="DOCUMENT",J.TOPIC="TOPIC",J.PERSONAL_BOOK="PERSONAL_BOOK",J.SHARED_BOOK="SHARED_BOOK";const Q=e=>["MAP","DOCUMENT","TOPIC","PERSONAL_BOOK","SHARED_BOOK"].includes(e),Z=e=>i(e)&&a(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&n(e.label)&&n(e.key),ee=e=>i(e)&&s(e.weight)&&n(e.value)&&n(e.key),te=e=>i(e)&&Array.isArray(e.entries)&&e.entries.every((e=>re(e)))&&(null==e.metadataVariableAxis||n(e.metadataVariableAxis)),re=e=>i(e)&&Array.isArray(e.missingTerms)&&e.missingTerms.every((e=>n(e)))&&(null==e.document||ie(e.document))&&(null==e.topic||se(e.topic))&&oe(e.type)&&(null==e.map||ae(e.map)),ie=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&Y(e.openMode)&&n(e.documentUrl)&&n(e.mimeType)&&n(e.title)&&(null==e.lastPublicationDate||n(e.lastPublicationDate))&&n(e.viewerUrl)&&n(e.contentUrl)&&n(e.filename)&&n(e.htmlTitle)&&(null==e.originUrl||n(e.originUrl))&&n(e.documentId)&&n(e.lastEditionDate)&&n(e.htmlExcerpt),ae=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&(null==e.openMode||Y(e.openMode))&&q(e.editorialType)&&n(e.title)&&(null==e.lastPublicationDate||n(e.lastPublicationDate))&&n(e.htmlTitle)&&(null==e.originUrl||n(e.originUrl))&&n(e.mapUrl)&&n(e.readerUrl)&&n(e.mapId)&&(null==e.lastEditionDate||n(e.lastEditionDate))&&n(e.htmlExcerpt),se=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&Y(e.openMode)&&n(e.contentId)&&Array.isArray(e.resources)&&e.resources.every((e=>Ae(e)))&&n(e.title)&&n(e.mapTitle)&&n(e.topicUrl)&&n(e.contentUrl)&&n(e.htmlTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&(null==e.originUrl||n(e.originUrl))&&n(e.readerUrl)&&n(e.mapId)&&(null==e.lastEditionDate||n(e.lastEditionDate))&&n(e.htmlExcerpt);var ne;e.FtSearchResultType=void 0,(ne=e.FtSearchResultType||(e.FtSearchResultType={})).MAP="MAP",ne.DOCUMENT="DOCUMENT",ne.TOPIC="TOPIC";const oe=e=>["MAP","DOCUMENT","TOPIC"].includes(e);var le;e.FtSearchScope=void 0,(le=e.FtSearchScope||(e.FtSearchScope={})).DEFAULT="DEFAULT",le.DOCUMENTS="DOCUMENTS",le.ALL_TOPICS="ALL_TOPICS";const ue=e=>["DEFAULT","DOCUMENTS","ALL_TOPICS"].includes(e),ce=e=>i(e)&&a(e.hierarchical)&&n(e.label)&&a(e.multiSelectionable)&&n(e.key)&&Array.isArray(e.rootNodes)&&e.rootNodes.every((e=>pe(e))),de=e=>i(e)&&(null==e.maxDepth||s(e.maxDepth))&&n(e.id),pe=e=>i(e)&&s(e.totalResultsCount)&&a(e.descendantSelected)&&Array.isArray(e.childNodes)&&e.childNodes.every((e=>pe(e)))&&n(e.label)&&n(e.value)&&a(e.selected),he=e=>i(e)&&V(e.type)&&n(e.key)&&H(e.order),ye=e=>i(e)&&n(e.suggestedQuery)&&n(e.htmlSuggestedQuery),Ae=e=>i(e)&&n(e.filename)&&n(e.resourceUrl)&&n(e.id)&&n(e.mimeType)&&n(e.resourceContentUrl)&&n(e.viewerUrl),fe=e=>i(e)&&n(e.contentUrl)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.excerpt)&&s(e.relevance),me=e=>i(e)&&(null==e.filenameExtension||n(e.filenameExtension))&&(null==e.editorialType||q(e.editorialType))&&(null==e.mimeType||n(e.mimeType))&&oe(e.type)&&n(e.value);var Ee;e.FtUserRole=void 0,(Ee=e.FtUserRole||(e.FtUserRole={})).PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",Ee.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",Ee.HTML_EXPORT_USER="HTML_EXPORT_USER",Ee.PDF_EXPORT_USER="PDF_EXPORT_USER",Ee.SAVED_SEARCH_USER="SAVED_SEARCH_USER",Ee.COLLECTION_USER="COLLECTION_USER",Ee.OFFLINE_USER="OFFLINE_USER",Ee.ANALYTICS_USER="ANALYTICS_USER",Ee.BETA_USER="BETA_USER",Ee.DEBUG_USER="DEBUG_USER",Ee.PRINT_USER="PRINT_USER",Ee.RATING_USER="RATING_USER",Ee.FEEDBACK_USER="FEEDBACK_USER",Ee.GENERATIVE_AI_USER="GENERATIVE_AI_USER",Ee.CONTENT_PUBLISHER="CONTENT_PUBLISHER",Ee.KHUB_ADMIN="KHUB_ADMIN",Ee.USERS_ADMIN="USERS_ADMIN",Ee.PORTAL_ADMIN="PORTAL_ADMIN",Ee.ADMIN="ADMIN",Ee.DEVELOPER="DEVELOPER";const ge=e=>["PERSONAL_BOOK_USER","PERSONAL_BOOK_SHARE_USER","HTML_EXPORT_USER","PDF_EXPORT_USER","SAVED_SEARCH_USER","COLLECTION_USER","OFFLINE_USER","ANALYTICS_USER","BETA_USER","DEBUG_USER","PRINT_USER","RATING_USER","FEEDBACK_USER","GENERATIVE_AI_USER","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(e),Se=e=>i(e)&&n(e.identifier)&&n(e.realm),Te=e=>i(e)&&Array.isArray(e.defaultFilters)&&e.defaultFilters.every((e=>w(e))),be=e=>i(e)&&(null==e.emailAddress||n(e.emailAddress))&&(null==e.displayName||n(e.displayName))&&Array.isArray(e.roles)&&e.roles.every((e=>ge(e)))&&(null==e.userId||n(e.userId)),Re=e=>i(e)&&n(e.color)&&Array.isArray(e.text)&&e.text.every((e=>n(e)))&&s(e.opacity),Fe=e=>"object"==typeof e&&null!=e,Oe=e=>"boolean"==typeof e,Ie=e=>"number"==typeof e,ve=e=>"string"==typeof e;var Ue;e.FtConfigurationHistoryEntryStatus=void 0,(Ue=e.FtConfigurationHistoryEntryStatus||(e.FtConfigurationHistoryEntryStatus={})).VALID="VALID",Ue.INVALID="INVALID";const Ce=e=>Fe(e)&&Oe(e.mailsSentByFluidTopics)&&Oe(e.mailsSentByFluidTopicsForUnauthenticatedUsers)&&Array.isArray(e.recipients)&&e.recipients.every((e=>ve(e)))&&Array.isArray(e.bodyMetadataIds)&&e.bodyMetadataIds.every((e=>ve(e)))&&Array.isArray(e.subjectMetadataIds)&&e.subjectMetadataIds.every((e=>ve(e))),_e=e=>Fe(e)&&ve(e.role)&&ve(e.content),Le=e=>Fe(e)&&(null==e.parentsVisibility||Array.isArray(e.parentsVisibility)&&e.parentsVisibility.every((e=>Oe(e))))&&Oe(e.isVisible),Pe=e=>Fe(e)&&(null==e.prettyUrl||ve(e.prettyUrl))&&(null==e.hasRating||Oe(e.hasRating))&&(null==e.pageToc||Array.isArray(e.pageToc))&&(null==e.tocId||ve(e.tocId))&&Array.isArray(e.children)&&e.children.every((e=>Pe(e)))&&(null==e.pageConfiguration||Le(e.pageConfiguration))&&(null==e.contentId||ve(e.contentId))&&(null==e.title||ve(e.title)),De=e=>Fe(e)&&Oe(e.splitCurrentPageToc),Ne=e=>Fe(e)&&Array.isArray(e.values)&&e.values.every((e=>ve(e)))&&ve(e.key),ke={[e.FtUserRole.PERSONAL_BOOK_SHARE_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.HTML_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.PDF_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.KHUB_ADMIN]:[e.FtUserRole.CONTENT_PUBLISHER],[e.FtUserRole.ADMIN]:[e.FtUserRole.KHUB_ADMIN,e.FtUserRole.USERS_ADMIN,e.FtUserRole.PORTAL_ADMIN],[e.FtUserRole.DEVELOPER]:[e.FtUserRole.BETA_USER,e.FtUserRole.DEBUG_USER]};function Me(e,t){return e===t||(ke[e]??[]).some((e=>Me(e,t)))}const we="undefined"==typeof window?globalThis:window;function Be(e){let t={};for(let r in e){let i=e[r];("object"!=typeof i||Array.isArray(i))&&(i={prior:i});for(let e of["prior","filter"])i[e]=Array.isArray(i[e])?i[e]:[i[e]],i[e]=i[e].map((e=>null!=e?""+e:"")).filter((e=>""!==e));t[r]=i}return t}function He(e){return`${e}-FluidTopicsUnauthenticatedUserSearchPreferences`}const xe="undefined"==typeof window?globalThis:window;class Ve extends Error{method;endpoint;status;statusText;body;constructor(e,t,r,i,a){super(`${e} ${t} -> ${r} - ${i}: ${a}`),this.method=e,this.endpoint=t,this.status=r,this.statusText=i,this.body=a}}class $e extends CustomEvent{constructor(e){super("ft-api-http-error",{detail:e})}}async function Ke(e,t,r){if(!r.ok){let i={method:e,endpoint:t,status:r.status,statusText:r.statusText,body:await r.text()};throw"function"==typeof xe.dispatchEvent&&xe.dispatchEvent(new $e(i)),new Ve(i.method,i.endpoint,i.status,i.statusText,i.body)}return r}function Ge(e){return"application/json"===e.headers.get("Content-Type")?e.json():e.text()}class je{tenantBaseUrl;ftCallingApp;authorization;searchLabel;endpoints={authentication:{login:"api/authentication/login",logout:"api/authentication/logout",currentSession:"api/authentication/current-session"},khub:{maps:{mapId:e=>({info:`api/khub/maps/${e}`,toc:`api/khub/maps/${e}/toc`,pages:`api/khub/maps/${e}/pages`,feedback:`api/khub/maps/${e}/feedback`,rating:`api/khub/maps/${e}/rating`,attachments:{list:`api/khub/maps/${e}/attachments`,attachmentId:t=>({content:`api/khub/maps/${e}/attachments/${t}/content`})},resources:{list:`api/khub/maps/${e}/resources`,resourceId:t=>({content:`api/khub/maps/${e}/resources/${t}/content`})},topics:{contentId:t=>({info:`api/khub/maps/${e}/topics/${t}`,content:`api/khub/maps/${e}/topics/${t}/content`}),tocId:t=>({feedback:`api/khub/maps/${e}/topics/${t}/feedback`,rating:`api/khub/maps/${e}/topics/${t}/rating`})}})},documents:{documentId:e=>({info:`api/khub/documents/${e}`,content:`api/khub/documents/${e}/content`,text:`api/khub/documents/${e}/content/text`,feedback:`api/khub/documents/${e}/feedback`,rating:`api/khub/documents/${e}/rating`})},suggest:"api/khub/suggest",clusteredSearch:"api/khub/clustered-search",locales:"api/khub/locales"},users:{userId:e=>({collections:{collectionId:t=>({documents:`api/users/${e}/collections/${t}/documents`})},searches:{list:`api/users/${e}/searches`},bookmarks:{list:`api/users/${e}/bookmarks`}})},stylesheets:{fonts:"stylesheets/fonts.css",theme:"stylesheets/theme.css",content:{title:"stylesheets/content/title.css",topic:"stylesheets/content/topic.css"}},configuration:{reader:"api/configuration/reader",metadata:"api/configuration/metadata"},locales:{ui:"api/locales/ui"},messages:{locale:e=>({fluidTopics:{contextName:t=>({endpoint:`api/messages/${e}/fluid-topics/${t}`})},custom:{contextName:t=>({endpoint:`api/messages/${e}/custom/${t}`})}})},ai:{generate:"api/ai/generate",sendFeedback:"api/ai/rate",chat:"/api/ai/rag/chat"}};get defaultHeaders(){return{...this.authorization,...this.searchLabel,"Ft-Calling-App":this.ftCallingApp}}constructor(e,t,r){e=(e??xe.fluidTopicsBaseUrl??xe.__gwt_ft_moduleBase??"").trim(),this.tenantBaseUrl=e.endsWith("/")?e:e+"/",r&&void 0!==xe.location&&xe.location.href.startsWith(this.tenantBaseUrl)?this.ftCallingApp=t:this.ftCallingApp=`ft-public-api/${t}`}setApiKey(e){this.authorization={Authorization:"Bearer "+e}}setCredentials(e,t){var r;this.authorization={Authorization:"Basic "+(r=`${e}:${t}`,"undefined"!=typeof Buffer?Buffer.from(r).toString("base64"):btoa(r))}}clearAuthentication(){this.authorization=void 0}setSearchLabel(e){this.searchLabel={"FT-search-label":e}}clearSearchLabel(){this.searchLabel=void 0}login(e,t){let r={login:e,password:t,rememberMe:!0};return this.post(this.endpoints.authentication.login,r).then((r=>(this.setCredentials(e,t),r)))}logout(){return this.post(this.endpoints.authentication.logout).then((()=>this.clearAuthentication()))}getCurrentSession(){return this.get(this.endpoints.authentication.currentSession)}getReaderConfiguration(){return this.get(this.endpoints.configuration.reader)}getMap(e,t){return this.get(this.endpoints.khub.maps.mapId(e).info,t)}getTableOfContent(e,t){return this.get(this.endpoints.khub.maps.mapId(e).toc,t)}getPages(e,t){return this.get(this.endpoints.khub.maps.mapId(e).pages,t)}getTopic(e,t,r){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).info,r)}getTopicHTMLContent(e,t,r,i){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).content+(r?"?target="+r:""),i)}getMapAttachments(e,t){return this.get(this.endpoints.khub.maps.mapId(e).attachments.list,t)}getMapAttachmentContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).attachments.attachmentId(t).content,r)}getMapResources(e,t){return this.get(this.endpoints.khub.maps.mapId(e).resources.list,t)}getMapResourceContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).resources.resourceId(t).content,r)}getUnstructuredDocument(e,t){return this.get(this.endpoints.khub.documents.documentId(e).info,t)}getUnstructuredDocumentContent(e,t){return this.fetchRawData(this.endpoints.khub.documents.documentId(e).content,t)}getUnstructuredDocumentTextContent(e,t){return this.get(this.endpoints.khub.documents.documentId(e).text,t)}getCollectionDocuments(e,t){return this.get(this.endpoints.users.userId(e).collections.collectionId(t).documents)}getSuggestions(e){return this.post(this.endpoints.khub.suggest,e)}search(e){return this.post(this.endpoints.khub.clusteredSearch,e)}getAvailableSearchLocales(){return this.get(this.endpoints.khub.locales)}getAvailableUiLocales(){return this.get(this.endpoints.khub.locales)}getMetadataConfiguration(){return this.get(this.endpoints.configuration.metadata)}getMapRating(e){return this.get(this.endpoints.khub.maps.mapId(e).rating)}rateMap(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).rating,{type:t,value:r})}unrateMap(e){return this.delete(this.endpoints.khub.maps.mapId(e).rating)}sendMapFeedback(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).feedback,{message:t,from:r})}rateTopic(e,t,r,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating,{type:r,value:i})}unrateTopic(e,t){return this.delete(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating)}sendTopicFeedback(e,t,r,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).feedback,{message:r,from:i})}getDocumentRating(e){return this.get(this.endpoints.khub.documents.documentId(e).rating)}rateDocument(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).rating,{type:t,value:r})}unrateDocument(e){return this.delete(this.endpoints.khub.documents.documentId(e).rating)}sendDocumentFeedback(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).feedback,{message:t,from:r})}getFluidTopicsMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).fluidTopics.contextName(t).endpoint)}getCustomMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).custom.contextName(t).endpoint)}listMySearches(e){return this.get(this.endpoints.users.userId(e).searches.list)}listMyBookmarks(e){return this.get(this.endpoints.users.userId(e).bookmarks.list)}async*generate(e,t){const i=await this.fetch(this.endpoints.ai.generate,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e,parameters:t}),credentials:null==this.authorization?"include":void 0});await Ke("POST",this.endpoints.ai.generate,i);const a=new r(i.body.getReader());yield*a.read()}async*chat(e){const t=await this.fetch(this.endpoints.ai.chat,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:null==this.authorization?"include":void 0});await Ke("POST",this.endpoints.ai.chat,t);const i=new r(t.body.getReader());yield*i.read()}sendFeedback(e){return this.post(this.endpoints.ai.sendFeedback,e)}get(e,t){return this.makeRequest("GET",this.withVersion(e,t))}post(e,t){return this.makeRequest("POST",e,t)}put(e,t){return this.makeRequest("PUT",e,t)}delete(e){return this.makeRequest("DELETE",e)}makeAbsolute(e){return e.startsWith(this.tenantBaseUrl)?e:this.tenantBaseUrl+e.replace(/^\//,"")}async fetch(e,t){const r=t;return await fetch(this.makeAbsolute(e),{...r??{},headers:{...this.defaultHeaders,...r?.headers??{}}})}upload(e,t,r,i=(()=>{})){return"undefined"!=typeof XMLHttpRequest?new Promise(((a,s)=>{let n=new XMLHttpRequest;n.onload=()=>{if(n.status>=200&&n.status<300){let e="application/json"===n.getResponseHeader("Content-Type")?JSON.parse(n.responseText):n.responseText;a(e)}else s(new Ve("GET",t,n.status,n.statusText,n.responseText))},n.upload.onprogress=e=>i(e),n.open(e,this.makeAbsolute(t),!0),n.send(r)})):this.fetch(t,{method:e,body:r}).then((r=>Ke(e,t,r))).then(Ge)}makeRequest(e,t,r){return this.fetch(t,{method:e,headers:{...null!=r?{"Content-Type":"application/json"}:{}},body:null!=r?JSON.stringify(r):void 0,credentials:null==this.authorization?"include":void 0}).then((r=>Ke(e,t,r))).then(Ge)}fetchRawData(e,t){return fetch(this.withVersion(e,t),{headers:this.defaultHeaders,credentials:null==this.authorization?"include":void 0}).then((t=>Ke("GET",e,t))).then((e=>e.arrayBuffer()))}withVersion(e,t){let r=new URL(this.makeAbsolute(e));return t&&r.searchParams.append("v",t),r.toString()}}e.FluidTopicsApi=je,e.HttpError=Ve,e.HttpErrorEvent=$e,e.addUnauthenticatedUserSearchPreferencesChangeHandler=function(e,t){if(we.localStorage){const r=He(e),i=e=>{e.storageArea===we.localStorage&&e.key===r&&t(JSON.parse(e.newValue??"{}"))};return we.addEventListener("storage",i),{removeHandler:()=>we.removeEventListener("storage",i)}}console.error("Cannot handle unauthenticated preferences: local storage is unavailable.")},e.default=je,e.getUnauthenticatedUserSearchPreferences=function(e){if(we.localStorage)return JSON.parse(we.localStorage.getItem(He(e))??"{}");console.error("Cannot get unauthenticated preferences: local storage is unavailable.")},e.isFtAuthenticatedSession=e=>i(e)&&Se(e.authenticationIdentifier)&&be(e.profile),e.isFtAuthenticationIdentifier=Se,e.isFtBookmark=e=>i(e)&&n(e.mapTitle)&&l(e.color)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&n(e.lastUpdate)&&n(e.readerUrl)&&n(e.mapId)&&n(e.id)&&n(e.title)&&n(e.creationDate),e.isFtCollectionDocument=e=>i(e)&&a(e.deleted)&&(null==e.apiUrl||n(e.apiUrl))&&(null==e.portalUrl||n(e.portalUrl))&&n(e.id)&&n(e.title)&&Q(e.type),e.isFtCollectionDocumentType=Q,e.isFtConfigurationHistoryEntryStatus=e=>["VALID","INVALID"].includes(e),e.isFtCredentials=e=>i(e)&&n(e.password)&&(null==e.newPassword||n(e.newPassword))&&a(e.rememberMe)&&n(e.login),e.isFtEditorialType=q,e.isFtFacetType=e=>["AND","OR","MONOVALUED"].includes(e),e.isFtFeedbackCreation=e=>i(e)&&(null==e.from||n(e.from))&&n(e.message),e.isFtGenAIGenerateInput=e=>Fe(e)&&ve(e.profileId)&&(null==e.parameters||Fe(e.parameters)&&Object.keys(e.parameters).every((e=>ve(e)))&&Object.values(e.parameters).every((e=>ve(e)))),e.isFtGenAIRating=e=>Fe(e)&&Ie(e.rating)&&ve(e.comment)&&ve(e.queryId),e.isFtHttpErrorDetails=e=>i(e)&&n(e.endpoint)&&n(e.method)&&n(e.statusText)&&n(e.body)&&s(e.status),e.isFtLabeledSearchFilter=Z,e.isFtMap=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&(null==e.watermark||Re(e.watermark))&&Y(e.openMode)&&(null==e.topicsApiEndpoint||n(e.topicsApiEndpoint))&&(null==e.description||n(e.description))&&(null==e.attachmentsApiEndpoint||n(e.attachmentsApiEndpoint))&&q(e.editorialType)&&n(e.baseId)&&n(e.clusterId)&&n(e.title)&&n(e.lastPublication)&&a(e.pbkConfidential)&&n(e.lastEdition)&&n(e.originId)&&(null==e.rightsApiEndpoint||n(e.rightsApiEndpoint))&&y(e.contentStyles)&&(null==e.originUrl||n(e.originUrl))&&n(e.fingerprint)&&n(e.readerUrl)&&(null==e.khubVersion||n(e.khubVersion))&&n(e.id)&&(null==e.lang||n(e.lang)),e.isFtMapAttachment=e=>Fe(e)&&ve(e.file)&&(null==e.size||Ie(e.size))&&Oe(e.externalLink)&&ve(e.name)&&ve(e.id)&&(null==e.mimeType||ve(e.mimeType))&&(null==e.viewerUrl||ve(e.viewerUrl)),e.isFtMapResource=e=>i(e)&&n(e.contentUrl)&&n(e.filename)&&n(e.id)&&n(e.mimeType),e.isFtMapStyles=y,e.isFtMessageContext=e=>i(e)&&n(e.name)&&i(e.messages)&&Object.keys(e.messages).every((e=>n(e)))&&Object.values(e.messages).every((e=>n(e)))&&n(e.locale),e.isFtMetadata=T,e.isFtMetadataConfiguration=e=>i(e)&&Array.isArray(e.descriptors)&&e.descriptors.every((e=>F(e))),e.isFtMetadataDescriptor=F,e.isFtMetadataHomeLayout=e=>["CLASSIC","CUSTOM","DESIGNER"].includes(e),e.isFtMetadataPreferenceConfiguration=P,e.isFtMetadataSortRule=R,e.isFtMyLibraryColors=l,e.isFtMySearch=e=>i(e)&&O(e.searchRequest)&&l(e.color)&&a(e.alert)&&n(e.description)&&n(e.id)&&n(e.ownerId)&&n(e.title)&&n(e.creationDate),e.isFtMySearchRequest=O,e.isFtOpenMode=Y,e.isFtPageConfiguration=Le,e.isFtPageRequest=z,e.isFtPaginatedToc=e=>Fe(e)&&De(e.configuration)&&Array.isArray(e.paginatedToc)&&e.paginatedToc.every((e=>Pe(e))),e.isFtPaginatedTocNode=Pe,e.isFtPaginationConfiguration=De,e.isFtPeriod=D,e.isFtPeriodFilter=N,e.isFtPeriodFilterType=M,e.isFtPersonalBookCreation=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>d(e)))&&Array.isArray(e.nodes)&&e.nodes.every((e=>p(e)))&&n(e.description)&&n(e.title),e.isFtPersonalBookMetadataUpdate=d,e.isFtPersonalBookNodeCreation=p,e.isFtPersonalBookTopicLinkCreation=h,e.isFtPublicClusterSortCriterion=W,e.isFtPublicationRating=U,e.isFtPublicationRatingSummary=C,e.isFtRagHistory=_e,e.isFtRagInput=e=>Fe(e)&&ve(e.profileId)&&ve(e.query)&&(null==e.messages||Array.isArray(e.messages)&&e.messages.every((e=>_e(e))))&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>Ne(e)))),e.isFtRatingCreation=e=>i(e)&&v(e.type)&&s(e.value),e.isFtRatingSummary=e=>i(e)&&(null==e.topics||L(e.topics))&&C(e.publication),e.isFtRatingType=v,e.isFtReaderConfiguration=e=>Fe(e)&&Ce(e.feedback)&&Ie(e.loadAfterLastVisibleTopic)&&ve(e.relativeTopicPivotMetadata)&&Ie(e.loadBeforeFirstVisibleTopic)&&ve(e.relativePivotMetadata),e.isFtReaderFeedbackConfiguration=Ce,e.isFtSearchFacet=ce,e.isFtSearchFacetConf=de,e.isFtSearchFacetEntry=pe,e.isFtSearchFilter=w,e.isFtSearchLocale=g,e.isFtSearchLocales=e=>i(e)&&Array.isArray(e.contentLocales)&&e.contentLocales.every((e=>g(e))),e.isFtSearchPreferences=Te,e.isFtSearchPreferencesConfiguration=e=>i(e)&&i(e.metadata)&&Object.keys(e.metadata).every((e=>n(e)))&&Object.values(e.metadata).every((e=>P(e))),e.isFtSearchPreset=e=>i(e)&&n(e.name)&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&s(e.priority)&&(null==e.contentLocale||n(e.contentLocale)),e.isFtSearchPrior=ee,e.isFtSearchRequest=e=>i(e)&&(null==e.periodFilter||N(e.periodFilter))&&n(e.query)&&z(e.paging)&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>he(e)))&&(null==e.virtualField||K(e.virtualField))&&Array.isArray(e.facets)&&e.facets.every((e=>de(e)))&&(null==e.scope||ue(e.scope))&&(null==e.uiLocale||n(e.uiLocale))&&(null==e.contentLocale||n(e.contentLocale))&&(null==e.priors||Array.isArray(e.priors)&&e.priors.every((e=>ee(e))))&&(null==e.clusterSortCriterions||Array.isArray(e.clusterSortCriterions)&&e.clusterSortCriterions.every((e=>W(e)))),e.isFtSearchResultCluster=te,e.isFtSearchResultClusterEntry=re,e.isFtSearchResultMap=ae,e.isFtSearchResultTopic=se,e.isFtSearchResultType=oe,e.isFtSearchResultUnstructuredDocument=ie,e.isFtSearchResults=e=>i(e)&&(null==e.spellcheck||ye(e.spellcheck))&&G(e.paging)&&Array.isArray(e.results)&&e.results.every((e=>te(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>ce(e))),e.isFtSearchResultsPageInfo=G,e.isFtSearchScope=ue,e.isFtSearchSortCriterion=he,e.isFtSearchSortCriterionOrder=H,e.isFtSearchSortCriterionType=V,e.isFtSemanticSearchFilter=Ne,e.isFtSemanticSearchRequest=e=>Fe(e)&&ve(e.query)&&Array.isArray(e.filters)&&e.filters.every((e=>Ne(e)))&&Ie(e.nbResults),e.isFtSemanticSearchResponse=e=>i(e)&&Array.isArray(e.items)&&e.items.every((e=>fe(e))),e.isFtSemanticSearchResponseItem=fe,e.isFtSession=e=>i(e)&&(null==e.authenticationIdentifier||Se(e.authenticationIdentifier))&&s(e.idleTimeoutInMillis)&&be(e.profile)&&a(e.sessionAuthenticated)&&Te(e.searchPreferences),e.isFtSpellcheck=ye,e.isFtSuggestRequest=e=>i(e)&&n(e.input)&&(null==e.scope||ue(e.scope))&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>he(e)))&&(null==e.maxCount||s(e.maxCount))&&(null==e.contentLocale||n(e.contentLocale)),e.isFtSuggestResult=me,e.isFtSuggestResults=e=>i(e)&&Array.isArray(e.suggestions)&&e.suggestions.every((e=>me(e))),e.isFtTocNode=A,e.isFtTopic=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.id)&&n(e.contentApiEndpoint)&&n(e.title),e.isFtTopicContentTarget=e=>["THIRD_PARTY","OFF_THE_GRID","CONTENT_PACKAGER","PAGES","DESIGNED_READER"].includes(e),e.isFtTopicOrigin=f,e.isFtTopicOriginType=c,e.isFtTopicRating=_,e.isFtTopicResource=Ae,e.isFtTopicsRatingSummary=L,e.isFtUiLocale=e=>i(e)&&n(e.displayName)&&n(e.languageTag)&&a(e.translated),e.isFtUnstructuredDocument=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.openMode)&&(null==e.description||n(e.description))&&n(e.mimeType)&&(null==e.baseId||n(e.baseId))&&(null==e.clusterId||n(e.clusterId))&&n(e.contentApiEndpoint)&&n(e.title)&&(null==e.lastPublication||n(e.lastPublication))&&n(e.viewerUrl)&&n(e.lastEdition)&&n(e.filename)&&(null==e.originId||n(e.originId))&&n(e.rightsApiEndpoint)&&(null==e.originUrl||n(e.originUrl))&&(null==e.khubVersion||n(e.khubVersion))&&n(e.id)&&(null==e.lang||n(e.lang)),e.isFtUserProfile=be,e.isFtUserRole=ge,e.isFtVirtualField=K,e.isFtWatermark=Re,e.setUnauthenticatedUserSearchPreferences=function(e,t){if(we.localStorage){let r={...t,metadata:Be(t.metadata??{})};const i=He(e),a=JSON.stringify(r);return we.localStorage.setItem(i,a),we.dispatchEvent(new StorageEvent("storage",{key:i,newValue:a,storageArea:we.localStorage,url:we.location.href})),r}console.error("Cannot set unauthenticated preferences: local storage is unavailable.")},e.userHasRole=function(e,t){return null!=e&&(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some((e=>Me(e,t)))}}));

@@ -566,3 +566,2 @@ "use strict";

&& (isString(o.query))
&& (o.scope == null || (0, exports.isFtSearchScope)(o.scope))
&& ((0, exports.isFtPageRequest)(o.paging))

@@ -573,9 +572,12 @@ && ((Array.isArray(o.filters)

&& o.sort.every((v) => (0, exports.isFtSearchSortCriterion)(v))))
&& (o.virtualField == null || (0, exports.isFtVirtualField)(o.virtualField))
&& ((Array.isArray(o.facets)
&& o.facets.every((v) => (0, exports.isFtSearchFacetConf)(v))))
&& (o.scope == null || (0, exports.isFtSearchScope)(o.scope))
&& (o.uiLocale == null || isString(o.uiLocale))
&& (o.virtualField == null || (0, exports.isFtVirtualField)(o.virtualField))
&& (o.contentLocale == null || isString(o.contentLocale))
&& (o.priors == null || (Array.isArray(o.priors)
&& o.priors.every((v) => (0, exports.isFtSearchPrior)(v))))
&& ((Array.isArray(o.facets)
&& o.facets.every((v) => (0, exports.isFtSearchFacetConf)(v))));
&& (o.clusterSortCriterions == null || (Array.isArray(o.clusterSortCriterions)
&& o.clusterSortCriterions.every((v) => (0, exports.isFtPublicClusterSortCriterion)(v))));
};

@@ -582,0 +584,0 @@ exports.isFtSearchRequest = isFtSearchRequest;

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).fluidtopics={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};!function(e){!function(t){var r={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function u(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function d(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,r,i=u(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=c(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i<t.length;i++)r[i]=String.fromCharCode(t[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=s(e),t=n(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=n(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),o(e)},l.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),o(e)},l.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),o(e)},r.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function A(e,t){var r,i,a=(t=t||{}).body;if(e instanceof A){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(r=t.method||this.method||"GET",i=r.toUpperCase(),y.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a)}function f(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),a=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(a))}})),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},h.call(A.prototype),h.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];m.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function g(e,i){return new Promise((function(a,s){var n=new A(e,i);if(n.signal&&n.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),i=r.shift().trim();if(i){var a=r.join(":").trim();t.append(i,a)}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;a(new m(i,r))},o.onerror=function(){s(new TypeError("Network request failed"))},o.ontimeout=function(){s(new TypeError("Network request failed"))},o.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},o.open(n.method,n.url,!0),"include"===n.credentials?o.withCredentials=!0:"omit"===n.credentials&&(o.withCredentials=!1),"responseType"in o&&r.blob&&(o.responseType="blob"),n.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),n.signal&&(n.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&n.signal.removeEventListener("abort",u)}),o.send(void 0===n._bodyInit?null:n._bodyInit)}))}g.polyfill=!0,e.fetch||(e.fetch=g,e.Headers=l,e.Request=A,e.Response=m),t.Headers=l,t.Request=A,t.Response=m,t.fetch=g,Object.defineProperty(t,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:t);class r{reader;decoder=new TextDecoder;partialChunk="";constructor(e){this.reader=e}async*read(){for(;;){const{done:e,value:t}=await this.reader.read();if(e)return void(yield*this.readRemainingChunks());yield*this.readChunksFromValue(t)}}*readRemainingChunks(){yield*this.parseLine(this.partialChunk)}*readChunksFromValue(e){const t=(this.partialChunk+this.decoder.decode(e)).split("\n");this.partialChunk=t.pop();for(let e of t)yield*this.parseLine(e)}*parseLine(e){const[t,r]=e.split(/:(.*)/);"data"==t&&r.length>0&&(yield JSON.parse(r))}}const i=e=>"object"==typeof e&&null!=e,a=e=>"boolean"==typeof e,s=e=>"number"==typeof e,n=e=>"string"==typeof e;var o;e.FtMyLibraryColors=void 0,(o=e.FtMyLibraryColors||(e.FtMyLibraryColors={})).black="black",o.green="green",o.blue="blue",o.purple="purple",o.red="red",o.orange="orange",o.yellow="yellow";const l=e=>["black","green","blue","purple","red","orange","yellow"].includes(e);var u;e.FtTopicOriginType=void 0,(u=e.FtTopicOriginType||(e.FtTopicOriginType={})).OFFICIAL="OFFICIAL",u.PERSONAL="PERSONAL",u.SHARED="SHARED";const c=e=>["OFFICIAL","PERSONAL","SHARED"].includes(e),d=e=>i(e)&&Array.isArray(e.values)&&e.values.every((e=>Array.isArray(e)&&e.every((e=>n(e)))))&&n(e.key),p=e=>i(e)&&n(e.notes)&&Array.isArray(e.children)&&e.children.every((e=>p(e)))&&(null==e.topicLink||h(e.topicLink))&&n(e.title)&&(null==e.htmlContent||n(e.htmlContent)),h=e=>i(e)&&n(e.tocId)&&n(e.contentId)&&n(e.mapId),y=e=>i(e)&&n(e.topicStylesheetUrl)&&n(e.titleStylesheetUrl)&&Array.isArray(e.customCssClasses)&&e.customCssClasses.every((e=>n(e))),A=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&(null==e.hasRating||a(e.hasRating))&&n(e.tocId)&&Array.isArray(e.children)&&e.children.every((e=>A(e)))&&(null==e.origin||f(e.origin))&&n(e.contentId)&&n(e.title),f=e=>i(e)&&n(e.mapTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&n(e.contentId)&&n(e.mapId)&&c(e.type);var m;e.FtTopicContentTarget=void 0,(m=e.FtTopicContentTarget||(e.FtTopicContentTarget={})).THIRD_PARTY="THIRD_PARTY",m.OFF_THE_GRID="OFF_THE_GRID",m.CONTENT_PACKAGER="CONTENT_PACKAGER",m.PAGES="PAGES",m.DESIGNED_READER="DESIGNED_READER";var E;e.FtMetadataHomeLayout=void 0,(E=e.FtMetadataHomeLayout||(e.FtMetadataHomeLayout={})).CLASSIC="CLASSIC",E.CUSTOM="CUSTOM",E.DESIGNER="DESIGNER";const g=e=>i(e)&&s(e.count)&&n(e.label)&&(null==e.lang||n(e.lang));var S;e.FtFacetType=void 0,(S=e.FtFacetType||(e.FtFacetType={})).AND="AND",S.OR="OR",S.MONOVALUED="MONOVALUED";const T=e=>i(e)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&(null==e.hierarchicalValues||Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>n(e))))))&&n(e.label)&&n(e.key);var b;e.FtMetadataSortRule=void 0,(b=e.FtMetadataSortRule||(e.FtMetadataSortRule={})).NONE="NONE",b.ALPHABET="ALPHABET",b.VERSION="VERSION";const R=e=>["NONE","ALPHABET","VERSION"].includes(e),F=e=>i(e)&&R(e.sortRule)&&n(e.label)&&a(e.reverseSort)&&n(e.key),O=e=>i(e)&&(null==e.periodFilter||N(e.periodFilter))&&n(e.query)&&(null==e.scope||le(e.scope))&&Array.isArray(e.filters)&&e.filters.every((e=>Q(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>pe(e)))&&(null==e.virtualField||K(e.virtualField))&&(null==e.contentLocale||n(e.contentLocale));var I;e.FtRatingType=void 0,(I=e.FtRatingType||(e.FtRatingType={})).STARS="STARS",I.LIKE="LIKE",I.DICHOTOMOUS="DICHOTOMOUS",I.NO_RATING="NO_RATING";const U=e=>["STARS","LIKE","DICHOTOMOUS","NO_RATING"].includes(e),v=e=>i(e)&&n(e.date)&&U(e.type)&&s(e.value),_=e=>i(e)&&(null==e.rating||v(e.rating))&&U(e.type),C=e=>i(e)&&n(e.date)&&n(e.tocId)&&U(e.type)&&s(e.value),L=e=>i(e)&&Array.isArray(e.ratings)&&e.ratings.every((e=>C(e)))&&U(e.type),P=e=>i(e)&&Array.isArray(e.filter)&&e.filter.every((e=>n(e)))&&Array.isArray(e.prior)&&e.prior.every((e=>n(e))),D=e=>i(e)&&n(e.from)&&n(e.to),N=e=>i(e)&&(null==e.period||D(e.period))&&M(e.periodType);var k;e.FtPeriodFilterType=void 0,(k=e.FtPeriodFilterType||(e.FtPeriodFilterType={})).LAST_WEEK="LAST_WEEK",k.LAST_MONTH="LAST_MONTH",k.LAST_QUARTER="LAST_QUARTER",k.LAST_YEAR="LAST_YEAR",k.CUSTOM="CUSTOM";const M=e=>["LAST_WEEK","LAST_MONTH","LAST_QUARTER","LAST_YEAR","CUSTOM"].includes(e),w=e=>i(e)&&a(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&n(e.key);var B;e.FtSearchSortCriterionOrder=void 0,(B=e.FtSearchSortCriterionOrder||(e.FtSearchSortCriterionOrder={})).ASC="ASC",B.DESC="DESC";const H=e=>["ASC","DESC"].includes(e);var x;e.FtSearchSortCriterionType=void 0,(x=e.FtSearchSortCriterionType||(e.FtSearchSortCriterionType={})).ALPHA="ALPHA",x.NATURAL="NATURAL";const V=e=>["ALPHA","NATURAL"].includes(e);var $;e.FtVirtualField=void 0,($=e.FtVirtualField||(e.FtVirtualField={})).EVERYWHERE="EVERYWHERE",$.TITLE_ONLY="TITLE_ONLY",$.NONE="NONE";const K=e=>["EVERYWHERE","TITLE_ONLY","NONE"].includes(e),G=e=>i(e)&&s(e.totalResultsCount)&&a(e.isLastPage)&&s(e.currentPage)&&s(e.totalClustersCount);var j;e.FtEditorialType=void 0,(j=e.FtEditorialType||(e.FtEditorialType={})).ARTICLE="ARTICLE",j.BOOK="BOOK",j.SHARED_BOOK="SHARED_BOOK";const q=e=>["ARTICLE","BOOK","SHARED_BOOK"].includes(e);var X;e.FtOpenMode=void 0,(X=e.FtOpenMode||(e.FtOpenMode={})).FLUIDTOPICS="FLUIDTOPICS",X.EXTERNAL="EXTERNAL";const Y=e=>["FLUIDTOPICS","EXTERNAL"].includes(e),z=e=>i(e)&&(null==e.perPage||s(e.perPage))&&s(e.page);var W;e.FtCollectionDocumentType=void 0,(W=e.FtCollectionDocumentType||(e.FtCollectionDocumentType={})).MAP="MAP",W.DOCUMENT="DOCUMENT",W.TOPIC="TOPIC",W.PERSONAL_BOOK="PERSONAL_BOOK",W.SHARED_BOOK="SHARED_BOOK";const J=e=>["MAP","DOCUMENT","TOPIC","PERSONAL_BOOK","SHARED_BOOK"].includes(e),Q=e=>i(e)&&a(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&n(e.label)&&n(e.key),Z=e=>i(e)&&s(e.weight)&&n(e.value)&&n(e.key),ee=e=>i(e)&&Array.isArray(e.entries)&&e.entries.every((e=>te(e)))&&(null==e.metadataVariableAxis||n(e.metadataVariableAxis)),te=e=>i(e)&&Array.isArray(e.missingTerms)&&e.missingTerms.every((e=>n(e)))&&(null==e.document||re(e.document))&&(null==e.topic||ae(e.topic))&&ne(e.type)&&(null==e.map||ie(e.map)),re=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&Y(e.openMode)&&n(e.documentUrl)&&n(e.mimeType)&&n(e.title)&&(null==e.lastPublicationDate||n(e.lastPublicationDate))&&n(e.viewerUrl)&&n(e.contentUrl)&&n(e.filename)&&n(e.htmlTitle)&&(null==e.originUrl||n(e.originUrl))&&n(e.documentId)&&n(e.lastEditionDate)&&n(e.htmlExcerpt),ie=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&(null==e.openMode||Y(e.openMode))&&q(e.editorialType)&&n(e.title)&&(null==e.lastPublicationDate||n(e.lastPublicationDate))&&n(e.htmlTitle)&&(null==e.originUrl||n(e.originUrl))&&n(e.mapUrl)&&n(e.readerUrl)&&n(e.mapId)&&(null==e.lastEditionDate||n(e.lastEditionDate))&&n(e.htmlExcerpt),ae=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&Y(e.openMode)&&n(e.contentId)&&Array.isArray(e.resources)&&e.resources.every((e=>ye(e)))&&n(e.title)&&n(e.mapTitle)&&n(e.topicUrl)&&n(e.contentUrl)&&n(e.htmlTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&(null==e.originUrl||n(e.originUrl))&&n(e.readerUrl)&&n(e.mapId)&&(null==e.lastEditionDate||n(e.lastEditionDate))&&n(e.htmlExcerpt);var se;e.FtSearchResultType=void 0,(se=e.FtSearchResultType||(e.FtSearchResultType={})).MAP="MAP",se.DOCUMENT="DOCUMENT",se.TOPIC="TOPIC";const ne=e=>["MAP","DOCUMENT","TOPIC"].includes(e);var oe;e.FtSearchScope=void 0,(oe=e.FtSearchScope||(e.FtSearchScope={})).DEFAULT="DEFAULT",oe.DOCUMENTS="DOCUMENTS",oe.ALL_TOPICS="ALL_TOPICS";const le=e=>["DEFAULT","DOCUMENTS","ALL_TOPICS"].includes(e),ue=e=>i(e)&&a(e.hierarchical)&&n(e.label)&&a(e.multiSelectionable)&&n(e.key)&&Array.isArray(e.rootNodes)&&e.rootNodes.every((e=>de(e))),ce=e=>i(e)&&(null==e.maxDepth||s(e.maxDepth))&&n(e.id),de=e=>i(e)&&s(e.totalResultsCount)&&a(e.descendantSelected)&&Array.isArray(e.childNodes)&&e.childNodes.every((e=>de(e)))&&n(e.label)&&n(e.value)&&a(e.selected),pe=e=>i(e)&&V(e.type)&&n(e.key)&&H(e.order),he=e=>i(e)&&n(e.suggestedQuery)&&n(e.htmlSuggestedQuery),ye=e=>i(e)&&n(e.filename)&&n(e.resourceUrl)&&n(e.id)&&n(e.mimeType)&&n(e.resourceContentUrl)&&n(e.viewerUrl),Ae=e=>i(e)&&n(e.contentUrl)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.excerpt)&&s(e.relevance),fe=e=>i(e)&&(null==e.filenameExtension||n(e.filenameExtension))&&(null==e.editorialType||q(e.editorialType))&&(null==e.mimeType||n(e.mimeType))&&ne(e.type)&&n(e.value);var me;e.FtUserRole=void 0,(me=e.FtUserRole||(e.FtUserRole={})).PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",me.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",me.HTML_EXPORT_USER="HTML_EXPORT_USER",me.PDF_EXPORT_USER="PDF_EXPORT_USER",me.SAVED_SEARCH_USER="SAVED_SEARCH_USER",me.COLLECTION_USER="COLLECTION_USER",me.OFFLINE_USER="OFFLINE_USER",me.ANALYTICS_USER="ANALYTICS_USER",me.BETA_USER="BETA_USER",me.DEBUG_USER="DEBUG_USER",me.PRINT_USER="PRINT_USER",me.RATING_USER="RATING_USER",me.FEEDBACK_USER="FEEDBACK_USER",me.GENERATIVE_AI_USER="GENERATIVE_AI_USER",me.CONTENT_PUBLISHER="CONTENT_PUBLISHER",me.KHUB_ADMIN="KHUB_ADMIN",me.USERS_ADMIN="USERS_ADMIN",me.PORTAL_ADMIN="PORTAL_ADMIN",me.ADMIN="ADMIN",me.DEVELOPER="DEVELOPER";const Ee=e=>["PERSONAL_BOOK_USER","PERSONAL_BOOK_SHARE_USER","HTML_EXPORT_USER","PDF_EXPORT_USER","SAVED_SEARCH_USER","COLLECTION_USER","OFFLINE_USER","ANALYTICS_USER","BETA_USER","DEBUG_USER","PRINT_USER","RATING_USER","FEEDBACK_USER","GENERATIVE_AI_USER","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(e),ge=e=>i(e)&&n(e.identifier)&&n(e.realm),Se=e=>i(e)&&Array.isArray(e.defaultFilters)&&e.defaultFilters.every((e=>w(e))),Te=e=>i(e)&&(null==e.emailAddress||n(e.emailAddress))&&(null==e.displayName||n(e.displayName))&&Array.isArray(e.roles)&&e.roles.every((e=>Ee(e)))&&(null==e.userId||n(e.userId)),be=e=>i(e)&&n(e.color)&&Array.isArray(e.text)&&e.text.every((e=>n(e)))&&s(e.opacity),Re=e=>"object"==typeof e&&null!=e,Fe=e=>"boolean"==typeof e,Oe=e=>"number"==typeof e,Ie=e=>"string"==typeof e;var Ue;e.FtConfigurationHistoryEntryStatus=void 0,(Ue=e.FtConfigurationHistoryEntryStatus||(e.FtConfigurationHistoryEntryStatus={})).VALID="VALID",Ue.INVALID="INVALID";const ve=e=>Re(e)&&Fe(e.mailsSentByFluidTopics)&&Fe(e.mailsSentByFluidTopicsForUnauthenticatedUsers)&&Array.isArray(e.recipients)&&e.recipients.every((e=>Ie(e)))&&Array.isArray(e.bodyMetadataIds)&&e.bodyMetadataIds.every((e=>Ie(e)))&&Array.isArray(e.subjectMetadataIds)&&e.subjectMetadataIds.every((e=>Ie(e))),_e=e=>Re(e)&&Ie(e.role)&&Ie(e.content),Ce=e=>Re(e)&&(null==e.parentsVisibility||Array.isArray(e.parentsVisibility)&&e.parentsVisibility.every((e=>Fe(e))))&&Fe(e.isVisible),Le=e=>Re(e)&&(null==e.prettyUrl||Ie(e.prettyUrl))&&(null==e.hasRating||Fe(e.hasRating))&&(null==e.pageToc||Array.isArray(e.pageToc))&&(null==e.tocId||Ie(e.tocId))&&Array.isArray(e.children)&&e.children.every((e=>Le(e)))&&(null==e.pageConfiguration||Ce(e.pageConfiguration))&&(null==e.contentId||Ie(e.contentId))&&(null==e.title||Ie(e.title)),Pe=e=>Re(e)&&Fe(e.splitCurrentPageToc),De=e=>Re(e)&&Array.isArray(e.values)&&e.values.every((e=>Ie(e)))&&Ie(e.key),Ne={[e.FtUserRole.PERSONAL_BOOK_SHARE_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.HTML_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.PDF_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.KHUB_ADMIN]:[e.FtUserRole.CONTENT_PUBLISHER],[e.FtUserRole.ADMIN]:[e.FtUserRole.KHUB_ADMIN,e.FtUserRole.USERS_ADMIN,e.FtUserRole.PORTAL_ADMIN],[e.FtUserRole.DEVELOPER]:[e.FtUserRole.BETA_USER,e.FtUserRole.DEBUG_USER]};function ke(e,t){return e===t||(Ne[e]??[]).some((e=>ke(e,t)))}const Me="undefined"==typeof window?globalThis:window;function we(e){let t={};for(let r in e){let i=e[r];("object"!=typeof i||Array.isArray(i))&&(i={prior:i});for(let e of["prior","filter"])i[e]=Array.isArray(i[e])?i[e]:[i[e]],i[e]=i[e].map((e=>null!=e?""+e:"")).filter((e=>""!==e));t[r]=i}return t}function Be(e){return`${e}-FluidTopicsUnauthenticatedUserSearchPreferences`}const He="undefined"==typeof window?globalThis:window;class xe extends Error{method;endpoint;status;statusText;body;constructor(e,t,r,i,a){super(`${e} ${t} -> ${r} - ${i}: ${a}`),this.method=e,this.endpoint=t,this.status=r,this.statusText=i,this.body=a}}class Ve extends CustomEvent{constructor(e){super("ft-api-http-error",{detail:e})}}async function $e(e,t,r){if(!r.ok){let i={method:e,endpoint:t,status:r.status,statusText:r.statusText,body:await r.text()};throw"function"==typeof He.dispatchEvent&&He.dispatchEvent(new Ve(i)),new xe(i.method,i.endpoint,i.status,i.statusText,i.body)}return r}function Ke(e){return"application/json"===e.headers.get("Content-Type")?e.json():e.text()}class Ge{tenantBaseUrl;ftCallingApp;authorization;searchLabel;endpoints={authentication:{login:"api/authentication/login",logout:"api/authentication/logout",currentSession:"api/authentication/current-session"},khub:{maps:{mapId:e=>({info:`api/khub/maps/${e}`,toc:`api/khub/maps/${e}/toc`,pages:`api/khub/maps/${e}/pages`,feedback:`api/khub/maps/${e}/feedback`,rating:`api/khub/maps/${e}/rating`,attachments:{list:`api/khub/maps/${e}/attachments`,attachmentId:t=>({content:`api/khub/maps/${e}/attachments/${t}/content`})},resources:{list:`api/khub/maps/${e}/resources`,resourceId:t=>({content:`api/khub/maps/${e}/resources/${t}/content`})},topics:{contentId:t=>({info:`api/khub/maps/${e}/topics/${t}`,content:`api/khub/maps/${e}/topics/${t}/content`}),tocId:t=>({feedback:`api/khub/maps/${e}/topics/${t}/feedback`,rating:`api/khub/maps/${e}/topics/${t}/rating`})}})},documents:{documentId:e=>({info:`api/khub/documents/${e}`,content:`api/khub/documents/${e}/content`,text:`api/khub/documents/${e}/content/text`,feedback:`api/khub/documents/${e}/feedback`,rating:`api/khub/documents/${e}/rating`})},suggest:"api/khub/suggest",clusteredSearch:"api/khub/clustered-search",locales:"api/khub/locales"},users:{userId:e=>({collections:{collectionId:t=>({documents:`api/users/${e}/collections/${t}/documents`})},searches:{list:`api/users/${e}/searches`},bookmarks:{list:`api/users/${e}/bookmarks`}})},stylesheets:{fonts:"stylesheets/fonts.css",theme:"stylesheets/theme.css",content:{title:"stylesheets/content/title.css",topic:"stylesheets/content/topic.css"}},configuration:{reader:"api/configuration/reader",metadata:"api/configuration/metadata"},locales:{ui:"api/locales/ui"},messages:{locale:e=>({fluidTopics:{contextName:t=>({endpoint:`api/messages/${e}/fluid-topics/${t}`})},custom:{contextName:t=>({endpoint:`api/messages/${e}/custom/${t}`})}})},ai:{generate:"api/ai/generate",sendFeedback:"api/ai/rate",chat:"/api/ai/rag/chat"}};get defaultHeaders(){return{...this.authorization,...this.searchLabel,"Ft-Calling-App":this.ftCallingApp}}constructor(e,t,r){e=(e??He.fluidTopicsBaseUrl??He.__gwt_ft_moduleBase??"").trim(),this.tenantBaseUrl=e.endsWith("/")?e:e+"/",r&&void 0!==He.location&&He.location.href.startsWith(this.tenantBaseUrl)?this.ftCallingApp=t:this.ftCallingApp=`ft-public-api/${t}`}setApiKey(e){this.authorization={Authorization:"Bearer "+e}}setCredentials(e,t){var r;this.authorization={Authorization:"Basic "+(r=`${e}:${t}`,"undefined"!=typeof Buffer?Buffer.from(r).toString("base64"):btoa(r))}}clearAuthentication(){this.authorization=void 0}setSearchLabel(e){this.searchLabel={"FT-search-label":e}}clearSearchLabel(){this.searchLabel=void 0}login(e,t){let r={login:e,password:t,rememberMe:!0};return this.post(this.endpoints.authentication.login,r).then((r=>(this.setCredentials(e,t),r)))}logout(){return this.post(this.endpoints.authentication.logout).then((()=>this.clearAuthentication()))}getCurrentSession(){return this.get(this.endpoints.authentication.currentSession)}getReaderConfiguration(){return this.get(this.endpoints.configuration.reader)}getMap(e,t){return this.get(this.endpoints.khub.maps.mapId(e).info,t)}getTableOfContent(e,t){return this.get(this.endpoints.khub.maps.mapId(e).toc,t)}getPages(e,t){return this.get(this.endpoints.khub.maps.mapId(e).pages,t)}getTopic(e,t,r){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).info,r)}getTopicHTMLContent(e,t,r,i){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).content+(r?"?target="+r:""),i)}getMapAttachments(e,t){return this.get(this.endpoints.khub.maps.mapId(e).attachments.list,t)}getMapAttachmentContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).attachments.attachmentId(t).content,r)}getMapResources(e,t){return this.get(this.endpoints.khub.maps.mapId(e).resources.list,t)}getMapResourceContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).resources.resourceId(t).content,r)}getUnstructuredDocument(e,t){return this.get(this.endpoints.khub.documents.documentId(e).info,t)}getUnstructuredDocumentContent(e,t){return this.fetchRawData(this.endpoints.khub.documents.documentId(e).content,t)}getUnstructuredDocumentTextContent(e,t){return this.get(this.endpoints.khub.documents.documentId(e).text,t)}getCollectionDocuments(e,t){return this.get(this.endpoints.users.userId(e).collections.collectionId(t).documents)}getSuggestions(e){return this.post(this.endpoints.khub.suggest,e)}search(e){return this.post(this.endpoints.khub.clusteredSearch,e)}getAvailableSearchLocales(){return this.get(this.endpoints.khub.locales)}getAvailableUiLocales(){return this.get(this.endpoints.khub.locales)}getMetadataConfiguration(){return this.get(this.endpoints.configuration.metadata)}getMapRating(e){return this.get(this.endpoints.khub.maps.mapId(e).rating)}rateMap(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).rating,{type:t,value:r})}unrateMap(e){return this.delete(this.endpoints.khub.maps.mapId(e).rating)}sendMapFeedback(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).feedback,{message:t,from:r})}rateTopic(e,t,r,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating,{type:r,value:i})}unrateTopic(e,t){return this.delete(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating)}sendTopicFeedback(e,t,r,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).feedback,{message:r,from:i})}getDocumentRating(e){return this.get(this.endpoints.khub.documents.documentId(e).rating)}rateDocument(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).rating,{type:t,value:r})}unrateDocument(e){return this.delete(this.endpoints.khub.documents.documentId(e).rating)}sendDocumentFeedback(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).feedback,{message:t,from:r})}getFluidTopicsMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).fluidTopics.contextName(t).endpoint)}getCustomMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).custom.contextName(t).endpoint)}listMySearches(e){return this.get(this.endpoints.users.userId(e).searches.list)}listMyBookmarks(e){return this.get(this.endpoints.users.userId(e).bookmarks.list)}async*generate(e,t){const i=await this.fetch(this.endpoints.ai.generate,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e,parameters:t}),credentials:null==this.authorization?"include":void 0});await $e("POST",this.endpoints.ai.generate,i);const a=new r(i.body.getReader());yield*a.read()}async*chat(e){const t=await this.fetch(this.endpoints.ai.chat,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:null==this.authorization?"include":void 0});await $e("POST",this.endpoints.ai.chat,t);const i=new r(t.body.getReader());yield*i.read()}sendFeedback(e){return this.post(this.endpoints.ai.sendFeedback,e)}get(e,t){return this.makeRequest("GET",this.withVersion(e,t))}post(e,t){return this.makeRequest("POST",e,t)}put(e,t){return this.makeRequest("PUT",e,t)}delete(e){return this.makeRequest("DELETE",e)}makeAbsolute(e){return e.startsWith(this.tenantBaseUrl)?e:this.tenantBaseUrl+e.replace(/^\//,"")}async fetch(e,t){const r=t;return await fetch(this.makeAbsolute(e),{...r??{},headers:{...this.defaultHeaders,...r?.headers??{}}})}upload(e,t,r,i=(()=>{})){return"undefined"!=typeof XMLHttpRequest?new Promise(((a,s)=>{let n=new XMLHttpRequest;n.onload=()=>{if(n.status>=200&&n.status<300){let e="application/json"===n.getResponseHeader("Content-Type")?JSON.parse(n.responseText):n.responseText;a(e)}else s(new xe("GET",t,n.status,n.statusText,n.responseText))},n.upload.onprogress=e=>i(e),n.open(e,this.makeAbsolute(t),!0),n.send(r)})):this.fetch(t,{method:e,body:r}).then((r=>$e(e,t,r))).then(Ke)}makeRequest(e,t,r){return this.fetch(t,{method:e,headers:{...null!=r?{"Content-Type":"application/json"}:{}},body:null!=r?JSON.stringify(r):void 0,credentials:null==this.authorization?"include":void 0}).then((r=>$e(e,t,r))).then(Ke)}fetchRawData(e,t){return fetch(this.withVersion(e,t),{headers:this.defaultHeaders,credentials:null==this.authorization?"include":void 0}).then((t=>$e("GET",e,t))).then((e=>e.arrayBuffer()))}withVersion(e,t){let r=new URL(this.makeAbsolute(e));return t&&r.searchParams.append("v",t),r.toString()}}e.FluidTopicsApi=Ge,e.HttpError=xe,e.HttpErrorEvent=Ve,e.addUnauthenticatedUserSearchPreferencesChangeHandler=function(e,t){if(Me.localStorage){const r=Be(e),i=e=>{e.storageArea===Me.localStorage&&e.key===r&&t(JSON.parse(e.newValue??"{}"))};return Me.addEventListener("storage",i),{removeHandler:()=>Me.removeEventListener("storage",i)}}console.error("Cannot handle unauthenticated preferences: local storage is unavailable.")},e.default=Ge,e.getUnauthenticatedUserSearchPreferences=function(e){if(Me.localStorage)return JSON.parse(Me.localStorage.getItem(Be(e))??"{}");console.error("Cannot get unauthenticated preferences: local storage is unavailable.")},e.isFtAuthenticatedSession=e=>i(e)&&ge(e.authenticationIdentifier)&&Te(e.profile),e.isFtAuthenticationIdentifier=ge,e.isFtBookmark=e=>i(e)&&n(e.mapTitle)&&l(e.color)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&n(e.lastUpdate)&&n(e.readerUrl)&&n(e.mapId)&&n(e.id)&&n(e.title)&&n(e.creationDate),e.isFtCollectionDocument=e=>i(e)&&a(e.deleted)&&(null==e.apiUrl||n(e.apiUrl))&&(null==e.portalUrl||n(e.portalUrl))&&n(e.id)&&n(e.title)&&J(e.type),e.isFtCollectionDocumentType=J,e.isFtConfigurationHistoryEntryStatus=e=>["VALID","INVALID"].includes(e),e.isFtCredentials=e=>i(e)&&n(e.password)&&(null==e.newPassword||n(e.newPassword))&&a(e.rememberMe)&&n(e.login),e.isFtEditorialType=q,e.isFtFacetType=e=>["AND","OR","MONOVALUED"].includes(e),e.isFtFeedbackCreation=e=>i(e)&&(null==e.from||n(e.from))&&n(e.message),e.isFtGenAIGenerateInput=e=>Re(e)&&Ie(e.profileId)&&(null==e.parameters||Re(e.parameters)&&Object.keys(e.parameters).every((e=>Ie(e)))&&Object.values(e.parameters).every((e=>Ie(e)))),e.isFtGenAIRating=e=>Re(e)&&Oe(e.rating)&&Ie(e.comment)&&Ie(e.queryId),e.isFtHttpErrorDetails=e=>i(e)&&n(e.endpoint)&&n(e.method)&&n(e.statusText)&&n(e.body)&&s(e.status),e.isFtLabeledSearchFilter=Q,e.isFtMap=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&(null==e.watermark||be(e.watermark))&&Y(e.openMode)&&(null==e.topicsApiEndpoint||n(e.topicsApiEndpoint))&&(null==e.description||n(e.description))&&(null==e.attachmentsApiEndpoint||n(e.attachmentsApiEndpoint))&&q(e.editorialType)&&n(e.baseId)&&n(e.clusterId)&&n(e.title)&&n(e.lastPublication)&&a(e.pbkConfidential)&&n(e.lastEdition)&&n(e.originId)&&(null==e.rightsApiEndpoint||n(e.rightsApiEndpoint))&&y(e.contentStyles)&&(null==e.originUrl||n(e.originUrl))&&n(e.fingerprint)&&n(e.readerUrl)&&(null==e.khubVersion||n(e.khubVersion))&&n(e.id)&&(null==e.lang||n(e.lang)),e.isFtMapAttachment=e=>Re(e)&&Ie(e.file)&&(null==e.size||Oe(e.size))&&Fe(e.externalLink)&&Ie(e.name)&&Ie(e.id)&&(null==e.mimeType||Ie(e.mimeType))&&(null==e.viewerUrl||Ie(e.viewerUrl)),e.isFtMapResource=e=>i(e)&&n(e.contentUrl)&&n(e.filename)&&n(e.id)&&n(e.mimeType),e.isFtMapStyles=y,e.isFtMessageContext=e=>i(e)&&n(e.name)&&i(e.messages)&&Object.keys(e.messages).every((e=>n(e)))&&Object.values(e.messages).every((e=>n(e)))&&n(e.locale),e.isFtMetadata=T,e.isFtMetadataConfiguration=e=>i(e)&&Array.isArray(e.descriptors)&&e.descriptors.every((e=>F(e))),e.isFtMetadataDescriptor=F,e.isFtMetadataHomeLayout=e=>["CLASSIC","CUSTOM","DESIGNER"].includes(e),e.isFtMetadataPreferenceConfiguration=P,e.isFtMetadataSortRule=R,e.isFtMyLibraryColors=l,e.isFtMySearch=e=>i(e)&&O(e.searchRequest)&&l(e.color)&&a(e.alert)&&n(e.description)&&n(e.id)&&n(e.ownerId)&&n(e.title)&&n(e.creationDate),e.isFtMySearchRequest=O,e.isFtOpenMode=Y,e.isFtPageConfiguration=Ce,e.isFtPageRequest=z,e.isFtPaginatedToc=e=>Re(e)&&Pe(e.configuration)&&Array.isArray(e.paginatedToc)&&e.paginatedToc.every((e=>Le(e))),e.isFtPaginatedTocNode=Le,e.isFtPaginationConfiguration=Pe,e.isFtPeriod=D,e.isFtPeriodFilter=N,e.isFtPeriodFilterType=M,e.isFtPersonalBookCreation=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>d(e)))&&Array.isArray(e.nodes)&&e.nodes.every((e=>p(e)))&&n(e.description)&&n(e.title),e.isFtPersonalBookMetadataUpdate=d,e.isFtPersonalBookNodeCreation=p,e.isFtPersonalBookTopicLinkCreation=h,e.isFtPublicClusterSortCriterion=e=>i(e)&&n(e.key),e.isFtPublicationRating=v,e.isFtPublicationRatingSummary=_,e.isFtRagHistory=_e,e.isFtRagInput=e=>Re(e)&&Ie(e.profileId)&&Ie(e.query)&&(null==e.messages||Array.isArray(e.messages)&&e.messages.every((e=>_e(e))))&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>De(e)))),e.isFtRatingCreation=e=>i(e)&&U(e.type)&&s(e.value),e.isFtRatingSummary=e=>i(e)&&(null==e.topics||L(e.topics))&&_(e.publication),e.isFtRatingType=U,e.isFtReaderConfiguration=e=>Re(e)&&ve(e.feedback)&&Oe(e.loadAfterLastVisibleTopic)&&Ie(e.relativeTopicPivotMetadata)&&Oe(e.loadBeforeFirstVisibleTopic)&&Ie(e.relativePivotMetadata),e.isFtReaderFeedbackConfiguration=ve,e.isFtSearchFacet=ue,e.isFtSearchFacetConf=ce,e.isFtSearchFacetEntry=de,e.isFtSearchFilter=w,e.isFtSearchLocale=g,e.isFtSearchLocales=e=>i(e)&&Array.isArray(e.contentLocales)&&e.contentLocales.every((e=>g(e))),e.isFtSearchPreferences=Se,e.isFtSearchPreferencesConfiguration=e=>i(e)&&i(e.metadata)&&Object.keys(e.metadata).every((e=>n(e)))&&Object.values(e.metadata).every((e=>P(e))),e.isFtSearchPreset=e=>i(e)&&n(e.name)&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&s(e.priority)&&(null==e.contentLocale||n(e.contentLocale)),e.isFtSearchPrior=Z,e.isFtSearchRequest=e=>i(e)&&(null==e.periodFilter||N(e.periodFilter))&&n(e.query)&&(null==e.scope||le(e.scope))&&z(e.paging)&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>pe(e)))&&(null==e.uiLocale||n(e.uiLocale))&&(null==e.virtualField||K(e.virtualField))&&(null==e.contentLocale||n(e.contentLocale))&&(null==e.priors||Array.isArray(e.priors)&&e.priors.every((e=>Z(e))))&&Array.isArray(e.facets)&&e.facets.every((e=>ce(e))),e.isFtSearchResultCluster=ee,e.isFtSearchResultClusterEntry=te,e.isFtSearchResultMap=ie,e.isFtSearchResultTopic=ae,e.isFtSearchResultType=ne,e.isFtSearchResultUnstructuredDocument=re,e.isFtSearchResults=e=>i(e)&&(null==e.spellcheck||he(e.spellcheck))&&G(e.paging)&&Array.isArray(e.results)&&e.results.every((e=>ee(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>ue(e))),e.isFtSearchResultsPageInfo=G,e.isFtSearchScope=le,e.isFtSearchSortCriterion=pe,e.isFtSearchSortCriterionOrder=H,e.isFtSearchSortCriterionType=V,e.isFtSemanticSearchFilter=De,e.isFtSemanticSearchRequest=e=>Re(e)&&Ie(e.query)&&Array.isArray(e.filters)&&e.filters.every((e=>De(e)))&&Oe(e.nbResults),e.isFtSemanticSearchResponse=e=>i(e)&&Array.isArray(e.items)&&e.items.every((e=>Ae(e))),e.isFtSemanticSearchResponseItem=Ae,e.isFtSession=e=>i(e)&&(null==e.authenticationIdentifier||ge(e.authenticationIdentifier))&&s(e.idleTimeoutInMillis)&&Te(e.profile)&&a(e.sessionAuthenticated)&&Se(e.searchPreferences),e.isFtSpellcheck=he,e.isFtSuggestRequest=e=>i(e)&&n(e.input)&&(null==e.scope||le(e.scope))&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>pe(e)))&&(null==e.maxCount||s(e.maxCount))&&(null==e.contentLocale||n(e.contentLocale)),e.isFtSuggestResult=fe,e.isFtSuggestResults=e=>i(e)&&Array.isArray(e.suggestions)&&e.suggestions.every((e=>fe(e))),e.isFtTocNode=A,e.isFtTopic=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.id)&&n(e.contentApiEndpoint)&&n(e.title),e.isFtTopicContentTarget=e=>["THIRD_PARTY","OFF_THE_GRID","CONTENT_PACKAGER","PAGES","DESIGNED_READER"].includes(e),e.isFtTopicOrigin=f,e.isFtTopicOriginType=c,e.isFtTopicRating=C,e.isFtTopicResource=ye,e.isFtTopicsRatingSummary=L,e.isFtUiLocale=e=>i(e)&&n(e.displayName)&&n(e.languageTag)&&a(e.translated),e.isFtUnstructuredDocument=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.openMode)&&(null==e.description||n(e.description))&&n(e.mimeType)&&(null==e.baseId||n(e.baseId))&&(null==e.clusterId||n(e.clusterId))&&n(e.contentApiEndpoint)&&n(e.title)&&(null==e.lastPublication||n(e.lastPublication))&&n(e.viewerUrl)&&n(e.lastEdition)&&n(e.filename)&&(null==e.originId||n(e.originId))&&n(e.rightsApiEndpoint)&&(null==e.originUrl||n(e.originUrl))&&(null==e.khubVersion||n(e.khubVersion))&&n(e.id)&&(null==e.lang||n(e.lang)),e.isFtUserProfile=Te,e.isFtUserRole=Ee,e.isFtVirtualField=K,e.isFtWatermark=be,e.setUnauthenticatedUserSearchPreferences=function(e,t){if(Me.localStorage){let r={...t,metadata:we(t.metadata??{})};const i=Be(e),a=JSON.stringify(r);return Me.localStorage.setItem(i,a),Me.dispatchEvent(new StorageEvent("storage",{key:i,newValue:a,storageArea:Me.localStorage,url:Me.location.href})),r}console.error("Cannot set unauthenticated preferences: local storage is unavailable.")},e.userHasRole=function(e,t){return null!=e&&(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some((e=>ke(e,t)))}}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).fluidtopics={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};!function(e){!function(t){var r={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function u(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function d(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,r,i=u(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=c(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i<t.length;i++)r[i]=String.fromCharCode(t[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=s(e),t=n(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=n(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),o(e)},l.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),o(e)},l.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),o(e)},r.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function A(e,t){var r,i,a=(t=t||{}).body;if(e instanceof A){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(r=t.method||this.method||"GET",i=r.toUpperCase(),y.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a)}function f(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),a=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(a))}})),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},h.call(A.prototype),h.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];m.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function g(e,i){return new Promise((function(a,s){var n=new A(e,i);if(n.signal&&n.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),i=r.shift().trim();if(i){var a=r.join(":").trim();t.append(i,a)}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;a(new m(i,r))},o.onerror=function(){s(new TypeError("Network request failed"))},o.ontimeout=function(){s(new TypeError("Network request failed"))},o.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},o.open(n.method,n.url,!0),"include"===n.credentials?o.withCredentials=!0:"omit"===n.credentials&&(o.withCredentials=!1),"responseType"in o&&r.blob&&(o.responseType="blob"),n.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),n.signal&&(n.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&n.signal.removeEventListener("abort",u)}),o.send(void 0===n._bodyInit?null:n._bodyInit)}))}g.polyfill=!0,e.fetch||(e.fetch=g,e.Headers=l,e.Request=A,e.Response=m),t.Headers=l,t.Request=A,t.Response=m,t.fetch=g,Object.defineProperty(t,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:t);class r{reader;decoder=new TextDecoder;partialChunk="";constructor(e){this.reader=e}async*read(){for(;;){const{done:e,value:t}=await this.reader.read();if(e)return void(yield*this.readRemainingChunks());yield*this.readChunksFromValue(t)}}*readRemainingChunks(){yield*this.parseLine(this.partialChunk)}*readChunksFromValue(e){const t=(this.partialChunk+this.decoder.decode(e)).split("\n");this.partialChunk=t.pop();for(let e of t)yield*this.parseLine(e)}*parseLine(e){const[t,r]=e.split(/:(.*)/);"data"==t&&r.length>0&&(yield JSON.parse(r))}}const i=e=>"object"==typeof e&&null!=e,a=e=>"boolean"==typeof e,s=e=>"number"==typeof e,n=e=>"string"==typeof e;var o;e.FtMyLibraryColors=void 0,(o=e.FtMyLibraryColors||(e.FtMyLibraryColors={})).black="black",o.green="green",o.blue="blue",o.purple="purple",o.red="red",o.orange="orange",o.yellow="yellow";const l=e=>["black","green","blue","purple","red","orange","yellow"].includes(e);var u;e.FtTopicOriginType=void 0,(u=e.FtTopicOriginType||(e.FtTopicOriginType={})).OFFICIAL="OFFICIAL",u.PERSONAL="PERSONAL",u.SHARED="SHARED";const c=e=>["OFFICIAL","PERSONAL","SHARED"].includes(e),d=e=>i(e)&&Array.isArray(e.values)&&e.values.every((e=>Array.isArray(e)&&e.every((e=>n(e)))))&&n(e.key),p=e=>i(e)&&n(e.notes)&&Array.isArray(e.children)&&e.children.every((e=>p(e)))&&(null==e.topicLink||h(e.topicLink))&&n(e.title)&&(null==e.htmlContent||n(e.htmlContent)),h=e=>i(e)&&n(e.tocId)&&n(e.contentId)&&n(e.mapId),y=e=>i(e)&&n(e.topicStylesheetUrl)&&n(e.titleStylesheetUrl)&&Array.isArray(e.customCssClasses)&&e.customCssClasses.every((e=>n(e))),A=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&(null==e.hasRating||a(e.hasRating))&&n(e.tocId)&&Array.isArray(e.children)&&e.children.every((e=>A(e)))&&(null==e.origin||f(e.origin))&&n(e.contentId)&&n(e.title),f=e=>i(e)&&n(e.mapTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&n(e.contentId)&&n(e.mapId)&&c(e.type);var m;e.FtTopicContentTarget=void 0,(m=e.FtTopicContentTarget||(e.FtTopicContentTarget={})).THIRD_PARTY="THIRD_PARTY",m.OFF_THE_GRID="OFF_THE_GRID",m.CONTENT_PACKAGER="CONTENT_PACKAGER",m.PAGES="PAGES",m.DESIGNED_READER="DESIGNED_READER";var E;e.FtMetadataHomeLayout=void 0,(E=e.FtMetadataHomeLayout||(e.FtMetadataHomeLayout={})).CLASSIC="CLASSIC",E.CUSTOM="CUSTOM",E.DESIGNER="DESIGNER";const g=e=>i(e)&&s(e.count)&&n(e.label)&&(null==e.lang||n(e.lang));var S;e.FtFacetType=void 0,(S=e.FtFacetType||(e.FtFacetType={})).AND="AND",S.OR="OR",S.MONOVALUED="MONOVALUED";const T=e=>i(e)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&(null==e.hierarchicalValues||Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>n(e))))))&&n(e.label)&&n(e.key);var b;e.FtMetadataSortRule=void 0,(b=e.FtMetadataSortRule||(e.FtMetadataSortRule={})).NONE="NONE",b.ALPHABET="ALPHABET",b.VERSION="VERSION";const R=e=>["NONE","ALPHABET","VERSION"].includes(e),F=e=>i(e)&&R(e.sortRule)&&n(e.label)&&a(e.reverseSort)&&n(e.key),O=e=>i(e)&&(null==e.periodFilter||N(e.periodFilter))&&n(e.query)&&(null==e.scope||ue(e.scope))&&Array.isArray(e.filters)&&e.filters.every((e=>Z(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>he(e)))&&(null==e.virtualField||K(e.virtualField))&&(null==e.contentLocale||n(e.contentLocale));var I;e.FtRatingType=void 0,(I=e.FtRatingType||(e.FtRatingType={})).STARS="STARS",I.LIKE="LIKE",I.DICHOTOMOUS="DICHOTOMOUS",I.NO_RATING="NO_RATING";const v=e=>["STARS","LIKE","DICHOTOMOUS","NO_RATING"].includes(e),U=e=>i(e)&&n(e.date)&&v(e.type)&&s(e.value),C=e=>i(e)&&(null==e.rating||U(e.rating))&&v(e.type),_=e=>i(e)&&n(e.date)&&n(e.tocId)&&v(e.type)&&s(e.value),L=e=>i(e)&&Array.isArray(e.ratings)&&e.ratings.every((e=>_(e)))&&v(e.type),P=e=>i(e)&&Array.isArray(e.filter)&&e.filter.every((e=>n(e)))&&Array.isArray(e.prior)&&e.prior.every((e=>n(e))),D=e=>i(e)&&n(e.from)&&n(e.to),N=e=>i(e)&&(null==e.period||D(e.period))&&M(e.periodType);var k;e.FtPeriodFilterType=void 0,(k=e.FtPeriodFilterType||(e.FtPeriodFilterType={})).LAST_WEEK="LAST_WEEK",k.LAST_MONTH="LAST_MONTH",k.LAST_QUARTER="LAST_QUARTER",k.LAST_YEAR="LAST_YEAR",k.CUSTOM="CUSTOM";const M=e=>["LAST_WEEK","LAST_MONTH","LAST_QUARTER","LAST_YEAR","CUSTOM"].includes(e),w=e=>i(e)&&a(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&n(e.key);var B;e.FtSearchSortCriterionOrder=void 0,(B=e.FtSearchSortCriterionOrder||(e.FtSearchSortCriterionOrder={})).ASC="ASC",B.DESC="DESC";const H=e=>["ASC","DESC"].includes(e);var x;e.FtSearchSortCriterionType=void 0,(x=e.FtSearchSortCriterionType||(e.FtSearchSortCriterionType={})).ALPHA="ALPHA",x.NATURAL="NATURAL";const V=e=>["ALPHA","NATURAL"].includes(e);var $;e.FtVirtualField=void 0,($=e.FtVirtualField||(e.FtVirtualField={})).EVERYWHERE="EVERYWHERE",$.TITLE_ONLY="TITLE_ONLY",$.NONE="NONE";const K=e=>["EVERYWHERE","TITLE_ONLY","NONE"].includes(e),G=e=>i(e)&&s(e.totalResultsCount)&&a(e.isLastPage)&&s(e.currentPage)&&s(e.totalClustersCount);var j;e.FtEditorialType=void 0,(j=e.FtEditorialType||(e.FtEditorialType={})).ARTICLE="ARTICLE",j.BOOK="BOOK",j.SHARED_BOOK="SHARED_BOOK";const q=e=>["ARTICLE","BOOK","SHARED_BOOK"].includes(e);var X;e.FtOpenMode=void 0,(X=e.FtOpenMode||(e.FtOpenMode={})).FLUIDTOPICS="FLUIDTOPICS",X.EXTERNAL="EXTERNAL";const Y=e=>["FLUIDTOPICS","EXTERNAL"].includes(e),z=e=>i(e)&&(null==e.perPage||s(e.perPage))&&s(e.page),W=e=>i(e)&&n(e.key);var J;e.FtCollectionDocumentType=void 0,(J=e.FtCollectionDocumentType||(e.FtCollectionDocumentType={})).MAP="MAP",J.DOCUMENT="DOCUMENT",J.TOPIC="TOPIC",J.PERSONAL_BOOK="PERSONAL_BOOK",J.SHARED_BOOK="SHARED_BOOK";const Q=e=>["MAP","DOCUMENT","TOPIC","PERSONAL_BOOK","SHARED_BOOK"].includes(e),Z=e=>i(e)&&a(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>n(e)))&&n(e.label)&&n(e.key),ee=e=>i(e)&&s(e.weight)&&n(e.value)&&n(e.key),te=e=>i(e)&&Array.isArray(e.entries)&&e.entries.every((e=>re(e)))&&(null==e.metadataVariableAxis||n(e.metadataVariableAxis)),re=e=>i(e)&&Array.isArray(e.missingTerms)&&e.missingTerms.every((e=>n(e)))&&(null==e.document||ie(e.document))&&(null==e.topic||se(e.topic))&&oe(e.type)&&(null==e.map||ae(e.map)),ie=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&Y(e.openMode)&&n(e.documentUrl)&&n(e.mimeType)&&n(e.title)&&(null==e.lastPublicationDate||n(e.lastPublicationDate))&&n(e.viewerUrl)&&n(e.contentUrl)&&n(e.filename)&&n(e.htmlTitle)&&(null==e.originUrl||n(e.originUrl))&&n(e.documentId)&&n(e.lastEditionDate)&&n(e.htmlExcerpt),ae=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&(null==e.openMode||Y(e.openMode))&&q(e.editorialType)&&n(e.title)&&(null==e.lastPublicationDate||n(e.lastPublicationDate))&&n(e.htmlTitle)&&(null==e.originUrl||n(e.originUrl))&&n(e.mapUrl)&&n(e.readerUrl)&&n(e.mapId)&&(null==e.lastEditionDate||n(e.lastEditionDate))&&n(e.htmlExcerpt),se=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&Y(e.openMode)&&n(e.contentId)&&Array.isArray(e.resources)&&e.resources.every((e=>Ae(e)))&&n(e.title)&&n(e.mapTitle)&&n(e.topicUrl)&&n(e.contentUrl)&&n(e.htmlTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&(null==e.originUrl||n(e.originUrl))&&n(e.readerUrl)&&n(e.mapId)&&(null==e.lastEditionDate||n(e.lastEditionDate))&&n(e.htmlExcerpt);var ne;e.FtSearchResultType=void 0,(ne=e.FtSearchResultType||(e.FtSearchResultType={})).MAP="MAP",ne.DOCUMENT="DOCUMENT",ne.TOPIC="TOPIC";const oe=e=>["MAP","DOCUMENT","TOPIC"].includes(e);var le;e.FtSearchScope=void 0,(le=e.FtSearchScope||(e.FtSearchScope={})).DEFAULT="DEFAULT",le.DOCUMENTS="DOCUMENTS",le.ALL_TOPICS="ALL_TOPICS";const ue=e=>["DEFAULT","DOCUMENTS","ALL_TOPICS"].includes(e),ce=e=>i(e)&&a(e.hierarchical)&&n(e.label)&&a(e.multiSelectionable)&&n(e.key)&&Array.isArray(e.rootNodes)&&e.rootNodes.every((e=>pe(e))),de=e=>i(e)&&(null==e.maxDepth||s(e.maxDepth))&&n(e.id),pe=e=>i(e)&&s(e.totalResultsCount)&&a(e.descendantSelected)&&Array.isArray(e.childNodes)&&e.childNodes.every((e=>pe(e)))&&n(e.label)&&n(e.value)&&a(e.selected),he=e=>i(e)&&V(e.type)&&n(e.key)&&H(e.order),ye=e=>i(e)&&n(e.suggestedQuery)&&n(e.htmlSuggestedQuery),Ae=e=>i(e)&&n(e.filename)&&n(e.resourceUrl)&&n(e.id)&&n(e.mimeType)&&n(e.resourceContentUrl)&&n(e.viewerUrl),fe=e=>i(e)&&n(e.contentUrl)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.excerpt)&&s(e.relevance),me=e=>i(e)&&(null==e.filenameExtension||n(e.filenameExtension))&&(null==e.editorialType||q(e.editorialType))&&(null==e.mimeType||n(e.mimeType))&&oe(e.type)&&n(e.value);var Ee;e.FtUserRole=void 0,(Ee=e.FtUserRole||(e.FtUserRole={})).PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",Ee.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",Ee.HTML_EXPORT_USER="HTML_EXPORT_USER",Ee.PDF_EXPORT_USER="PDF_EXPORT_USER",Ee.SAVED_SEARCH_USER="SAVED_SEARCH_USER",Ee.COLLECTION_USER="COLLECTION_USER",Ee.OFFLINE_USER="OFFLINE_USER",Ee.ANALYTICS_USER="ANALYTICS_USER",Ee.BETA_USER="BETA_USER",Ee.DEBUG_USER="DEBUG_USER",Ee.PRINT_USER="PRINT_USER",Ee.RATING_USER="RATING_USER",Ee.FEEDBACK_USER="FEEDBACK_USER",Ee.GENERATIVE_AI_USER="GENERATIVE_AI_USER",Ee.CONTENT_PUBLISHER="CONTENT_PUBLISHER",Ee.KHUB_ADMIN="KHUB_ADMIN",Ee.USERS_ADMIN="USERS_ADMIN",Ee.PORTAL_ADMIN="PORTAL_ADMIN",Ee.ADMIN="ADMIN",Ee.DEVELOPER="DEVELOPER";const ge=e=>["PERSONAL_BOOK_USER","PERSONAL_BOOK_SHARE_USER","HTML_EXPORT_USER","PDF_EXPORT_USER","SAVED_SEARCH_USER","COLLECTION_USER","OFFLINE_USER","ANALYTICS_USER","BETA_USER","DEBUG_USER","PRINT_USER","RATING_USER","FEEDBACK_USER","GENERATIVE_AI_USER","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(e),Se=e=>i(e)&&n(e.identifier)&&n(e.realm),Te=e=>i(e)&&Array.isArray(e.defaultFilters)&&e.defaultFilters.every((e=>w(e))),be=e=>i(e)&&(null==e.emailAddress||n(e.emailAddress))&&(null==e.displayName||n(e.displayName))&&Array.isArray(e.roles)&&e.roles.every((e=>ge(e)))&&(null==e.userId||n(e.userId)),Re=e=>i(e)&&n(e.color)&&Array.isArray(e.text)&&e.text.every((e=>n(e)))&&s(e.opacity),Fe=e=>"object"==typeof e&&null!=e,Oe=e=>"boolean"==typeof e,Ie=e=>"number"==typeof e,ve=e=>"string"==typeof e;var Ue;e.FtConfigurationHistoryEntryStatus=void 0,(Ue=e.FtConfigurationHistoryEntryStatus||(e.FtConfigurationHistoryEntryStatus={})).VALID="VALID",Ue.INVALID="INVALID";const Ce=e=>Fe(e)&&Oe(e.mailsSentByFluidTopics)&&Oe(e.mailsSentByFluidTopicsForUnauthenticatedUsers)&&Array.isArray(e.recipients)&&e.recipients.every((e=>ve(e)))&&Array.isArray(e.bodyMetadataIds)&&e.bodyMetadataIds.every((e=>ve(e)))&&Array.isArray(e.subjectMetadataIds)&&e.subjectMetadataIds.every((e=>ve(e))),_e=e=>Fe(e)&&ve(e.role)&&ve(e.content),Le=e=>Fe(e)&&(null==e.parentsVisibility||Array.isArray(e.parentsVisibility)&&e.parentsVisibility.every((e=>Oe(e))))&&Oe(e.isVisible),Pe=e=>Fe(e)&&(null==e.prettyUrl||ve(e.prettyUrl))&&(null==e.hasRating||Oe(e.hasRating))&&(null==e.pageToc||Array.isArray(e.pageToc))&&(null==e.tocId||ve(e.tocId))&&Array.isArray(e.children)&&e.children.every((e=>Pe(e)))&&(null==e.pageConfiguration||Le(e.pageConfiguration))&&(null==e.contentId||ve(e.contentId))&&(null==e.title||ve(e.title)),De=e=>Fe(e)&&Oe(e.splitCurrentPageToc),Ne=e=>Fe(e)&&Array.isArray(e.values)&&e.values.every((e=>ve(e)))&&ve(e.key),ke={[e.FtUserRole.PERSONAL_BOOK_SHARE_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.HTML_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.PDF_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.KHUB_ADMIN]:[e.FtUserRole.CONTENT_PUBLISHER],[e.FtUserRole.ADMIN]:[e.FtUserRole.KHUB_ADMIN,e.FtUserRole.USERS_ADMIN,e.FtUserRole.PORTAL_ADMIN],[e.FtUserRole.DEVELOPER]:[e.FtUserRole.BETA_USER,e.FtUserRole.DEBUG_USER]};function Me(e,t){return e===t||(ke[e]??[]).some((e=>Me(e,t)))}const we="undefined"==typeof window?globalThis:window;function Be(e){let t={};for(let r in e){let i=e[r];("object"!=typeof i||Array.isArray(i))&&(i={prior:i});for(let e of["prior","filter"])i[e]=Array.isArray(i[e])?i[e]:[i[e]],i[e]=i[e].map((e=>null!=e?""+e:"")).filter((e=>""!==e));t[r]=i}return t}function He(e){return`${e}-FluidTopicsUnauthenticatedUserSearchPreferences`}const xe="undefined"==typeof window?globalThis:window;class Ve extends Error{method;endpoint;status;statusText;body;constructor(e,t,r,i,a){super(`${e} ${t} -> ${r} - ${i}: ${a}`),this.method=e,this.endpoint=t,this.status=r,this.statusText=i,this.body=a}}class $e extends CustomEvent{constructor(e){super("ft-api-http-error",{detail:e})}}async function Ke(e,t,r){if(!r.ok){let i={method:e,endpoint:t,status:r.status,statusText:r.statusText,body:await r.text()};throw"function"==typeof xe.dispatchEvent&&xe.dispatchEvent(new $e(i)),new Ve(i.method,i.endpoint,i.status,i.statusText,i.body)}return r}function Ge(e){return"application/json"===e.headers.get("Content-Type")?e.json():e.text()}class je{tenantBaseUrl;ftCallingApp;authorization;searchLabel;endpoints={authentication:{login:"api/authentication/login",logout:"api/authentication/logout",currentSession:"api/authentication/current-session"},khub:{maps:{mapId:e=>({info:`api/khub/maps/${e}`,toc:`api/khub/maps/${e}/toc`,pages:`api/khub/maps/${e}/pages`,feedback:`api/khub/maps/${e}/feedback`,rating:`api/khub/maps/${e}/rating`,attachments:{list:`api/khub/maps/${e}/attachments`,attachmentId:t=>({content:`api/khub/maps/${e}/attachments/${t}/content`})},resources:{list:`api/khub/maps/${e}/resources`,resourceId:t=>({content:`api/khub/maps/${e}/resources/${t}/content`})},topics:{contentId:t=>({info:`api/khub/maps/${e}/topics/${t}`,content:`api/khub/maps/${e}/topics/${t}/content`}),tocId:t=>({feedback:`api/khub/maps/${e}/topics/${t}/feedback`,rating:`api/khub/maps/${e}/topics/${t}/rating`})}})},documents:{documentId:e=>({info:`api/khub/documents/${e}`,content:`api/khub/documents/${e}/content`,text:`api/khub/documents/${e}/content/text`,feedback:`api/khub/documents/${e}/feedback`,rating:`api/khub/documents/${e}/rating`})},suggest:"api/khub/suggest",clusteredSearch:"api/khub/clustered-search",locales:"api/khub/locales"},users:{userId:e=>({collections:{collectionId:t=>({documents:`api/users/${e}/collections/${t}/documents`})},searches:{list:`api/users/${e}/searches`},bookmarks:{list:`api/users/${e}/bookmarks`}})},stylesheets:{fonts:"stylesheets/fonts.css",theme:"stylesheets/theme.css",content:{title:"stylesheets/content/title.css",topic:"stylesheets/content/topic.css"}},configuration:{reader:"api/configuration/reader",metadata:"api/configuration/metadata"},locales:{ui:"api/locales/ui"},messages:{locale:e=>({fluidTopics:{contextName:t=>({endpoint:`api/messages/${e}/fluid-topics/${t}`})},custom:{contextName:t=>({endpoint:`api/messages/${e}/custom/${t}`})}})},ai:{generate:"api/ai/generate",sendFeedback:"api/ai/rate",chat:"/api/ai/rag/chat"}};get defaultHeaders(){return{...this.authorization,...this.searchLabel,"Ft-Calling-App":this.ftCallingApp}}constructor(e,t,r){e=(e??xe.fluidTopicsBaseUrl??xe.__gwt_ft_moduleBase??"").trim(),this.tenantBaseUrl=e.endsWith("/")?e:e+"/",r&&void 0!==xe.location&&xe.location.href.startsWith(this.tenantBaseUrl)?this.ftCallingApp=t:this.ftCallingApp=`ft-public-api/${t}`}setApiKey(e){this.authorization={Authorization:"Bearer "+e}}setCredentials(e,t){var r;this.authorization={Authorization:"Basic "+(r=`${e}:${t}`,"undefined"!=typeof Buffer?Buffer.from(r).toString("base64"):btoa(r))}}clearAuthentication(){this.authorization=void 0}setSearchLabel(e){this.searchLabel={"FT-search-label":e}}clearSearchLabel(){this.searchLabel=void 0}login(e,t){let r={login:e,password:t,rememberMe:!0};return this.post(this.endpoints.authentication.login,r).then((r=>(this.setCredentials(e,t),r)))}logout(){return this.post(this.endpoints.authentication.logout).then((()=>this.clearAuthentication()))}getCurrentSession(){return this.get(this.endpoints.authentication.currentSession)}getReaderConfiguration(){return this.get(this.endpoints.configuration.reader)}getMap(e,t){return this.get(this.endpoints.khub.maps.mapId(e).info,t)}getTableOfContent(e,t){return this.get(this.endpoints.khub.maps.mapId(e).toc,t)}getPages(e,t){return this.get(this.endpoints.khub.maps.mapId(e).pages,t)}getTopic(e,t,r){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).info,r)}getTopicHTMLContent(e,t,r,i){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).content+(r?"?target="+r:""),i)}getMapAttachments(e,t){return this.get(this.endpoints.khub.maps.mapId(e).attachments.list,t)}getMapAttachmentContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).attachments.attachmentId(t).content,r)}getMapResources(e,t){return this.get(this.endpoints.khub.maps.mapId(e).resources.list,t)}getMapResourceContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).resources.resourceId(t).content,r)}getUnstructuredDocument(e,t){return this.get(this.endpoints.khub.documents.documentId(e).info,t)}getUnstructuredDocumentContent(e,t){return this.fetchRawData(this.endpoints.khub.documents.documentId(e).content,t)}getUnstructuredDocumentTextContent(e,t){return this.get(this.endpoints.khub.documents.documentId(e).text,t)}getCollectionDocuments(e,t){return this.get(this.endpoints.users.userId(e).collections.collectionId(t).documents)}getSuggestions(e){return this.post(this.endpoints.khub.suggest,e)}search(e){return this.post(this.endpoints.khub.clusteredSearch,e)}getAvailableSearchLocales(){return this.get(this.endpoints.khub.locales)}getAvailableUiLocales(){return this.get(this.endpoints.khub.locales)}getMetadataConfiguration(){return this.get(this.endpoints.configuration.metadata)}getMapRating(e){return this.get(this.endpoints.khub.maps.mapId(e).rating)}rateMap(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).rating,{type:t,value:r})}unrateMap(e){return this.delete(this.endpoints.khub.maps.mapId(e).rating)}sendMapFeedback(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).feedback,{message:t,from:r})}rateTopic(e,t,r,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating,{type:r,value:i})}unrateTopic(e,t){return this.delete(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating)}sendTopicFeedback(e,t,r,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).feedback,{message:r,from:i})}getDocumentRating(e){return this.get(this.endpoints.khub.documents.documentId(e).rating)}rateDocument(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).rating,{type:t,value:r})}unrateDocument(e){return this.delete(this.endpoints.khub.documents.documentId(e).rating)}sendDocumentFeedback(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).feedback,{message:t,from:r})}getFluidTopicsMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).fluidTopics.contextName(t).endpoint)}getCustomMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).custom.contextName(t).endpoint)}listMySearches(e){return this.get(this.endpoints.users.userId(e).searches.list)}listMyBookmarks(e){return this.get(this.endpoints.users.userId(e).bookmarks.list)}async*generate(e,t){const i=await this.fetch(this.endpoints.ai.generate,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e,parameters:t}),credentials:null==this.authorization?"include":void 0});await Ke("POST",this.endpoints.ai.generate,i);const a=new r(i.body.getReader());yield*a.read()}async*chat(e){const t=await this.fetch(this.endpoints.ai.chat,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:null==this.authorization?"include":void 0});await Ke("POST",this.endpoints.ai.chat,t);const i=new r(t.body.getReader());yield*i.read()}sendFeedback(e){return this.post(this.endpoints.ai.sendFeedback,e)}get(e,t){return this.makeRequest("GET",this.withVersion(e,t))}post(e,t){return this.makeRequest("POST",e,t)}put(e,t){return this.makeRequest("PUT",e,t)}delete(e){return this.makeRequest("DELETE",e)}makeAbsolute(e){return e.startsWith(this.tenantBaseUrl)?e:this.tenantBaseUrl+e.replace(/^\//,"")}async fetch(e,t){const r=t;return await fetch(this.makeAbsolute(e),{...r??{},headers:{...this.defaultHeaders,...r?.headers??{}}})}upload(e,t,r,i=(()=>{})){return"undefined"!=typeof XMLHttpRequest?new Promise(((a,s)=>{let n=new XMLHttpRequest;n.onload=()=>{if(n.status>=200&&n.status<300){let e="application/json"===n.getResponseHeader("Content-Type")?JSON.parse(n.responseText):n.responseText;a(e)}else s(new Ve("GET",t,n.status,n.statusText,n.responseText))},n.upload.onprogress=e=>i(e),n.open(e,this.makeAbsolute(t),!0),n.send(r)})):this.fetch(t,{method:e,body:r}).then((r=>Ke(e,t,r))).then(Ge)}makeRequest(e,t,r){return this.fetch(t,{method:e,headers:{...null!=r?{"Content-Type":"application/json"}:{}},body:null!=r?JSON.stringify(r):void 0,credentials:null==this.authorization?"include":void 0}).then((r=>Ke(e,t,r))).then(Ge)}fetchRawData(e,t){return fetch(this.withVersion(e,t),{headers:this.defaultHeaders,credentials:null==this.authorization?"include":void 0}).then((t=>Ke("GET",e,t))).then((e=>e.arrayBuffer()))}withVersion(e,t){let r=new URL(this.makeAbsolute(e));return t&&r.searchParams.append("v",t),r.toString()}}e.FluidTopicsApi=je,e.HttpError=Ve,e.HttpErrorEvent=$e,e.addUnauthenticatedUserSearchPreferencesChangeHandler=function(e,t){if(we.localStorage){const r=He(e),i=e=>{e.storageArea===we.localStorage&&e.key===r&&t(JSON.parse(e.newValue??"{}"))};return we.addEventListener("storage",i),{removeHandler:()=>we.removeEventListener("storage",i)}}console.error("Cannot handle unauthenticated preferences: local storage is unavailable.")},e.default=je,e.getUnauthenticatedUserSearchPreferences=function(e){if(we.localStorage)return JSON.parse(we.localStorage.getItem(He(e))??"{}");console.error("Cannot get unauthenticated preferences: local storage is unavailable.")},e.isFtAuthenticatedSession=e=>i(e)&&Se(e.authenticationIdentifier)&&be(e.profile),e.isFtAuthenticationIdentifier=Se,e.isFtBookmark=e=>i(e)&&n(e.mapTitle)&&l(e.color)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>n(e)))&&n(e.tocId)&&n(e.lastUpdate)&&n(e.readerUrl)&&n(e.mapId)&&n(e.id)&&n(e.title)&&n(e.creationDate),e.isFtCollectionDocument=e=>i(e)&&a(e.deleted)&&(null==e.apiUrl||n(e.apiUrl))&&(null==e.portalUrl||n(e.portalUrl))&&n(e.id)&&n(e.title)&&Q(e.type),e.isFtCollectionDocumentType=Q,e.isFtConfigurationHistoryEntryStatus=e=>["VALID","INVALID"].includes(e),e.isFtCredentials=e=>i(e)&&n(e.password)&&(null==e.newPassword||n(e.newPassword))&&a(e.rememberMe)&&n(e.login),e.isFtEditorialType=q,e.isFtFacetType=e=>["AND","OR","MONOVALUED"].includes(e),e.isFtFeedbackCreation=e=>i(e)&&(null==e.from||n(e.from))&&n(e.message),e.isFtGenAIGenerateInput=e=>Fe(e)&&ve(e.profileId)&&(null==e.parameters||Fe(e.parameters)&&Object.keys(e.parameters).every((e=>ve(e)))&&Object.values(e.parameters).every((e=>ve(e)))),e.isFtGenAIRating=e=>Fe(e)&&Ie(e.rating)&&ve(e.comment)&&ve(e.queryId),e.isFtHttpErrorDetails=e=>i(e)&&n(e.endpoint)&&n(e.method)&&n(e.statusText)&&n(e.body)&&s(e.status),e.isFtLabeledSearchFilter=Z,e.isFtMap=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&(null==e.watermark||Re(e.watermark))&&Y(e.openMode)&&(null==e.topicsApiEndpoint||n(e.topicsApiEndpoint))&&(null==e.description||n(e.description))&&(null==e.attachmentsApiEndpoint||n(e.attachmentsApiEndpoint))&&q(e.editorialType)&&n(e.baseId)&&n(e.clusterId)&&n(e.title)&&n(e.lastPublication)&&a(e.pbkConfidential)&&n(e.lastEdition)&&n(e.originId)&&(null==e.rightsApiEndpoint||n(e.rightsApiEndpoint))&&y(e.contentStyles)&&(null==e.originUrl||n(e.originUrl))&&n(e.fingerprint)&&n(e.readerUrl)&&(null==e.khubVersion||n(e.khubVersion))&&n(e.id)&&(null==e.lang||n(e.lang)),e.isFtMapAttachment=e=>Fe(e)&&ve(e.file)&&(null==e.size||Ie(e.size))&&Oe(e.externalLink)&&ve(e.name)&&ve(e.id)&&(null==e.mimeType||ve(e.mimeType))&&(null==e.viewerUrl||ve(e.viewerUrl)),e.isFtMapResource=e=>i(e)&&n(e.contentUrl)&&n(e.filename)&&n(e.id)&&n(e.mimeType),e.isFtMapStyles=y,e.isFtMessageContext=e=>i(e)&&n(e.name)&&i(e.messages)&&Object.keys(e.messages).every((e=>n(e)))&&Object.values(e.messages).every((e=>n(e)))&&n(e.locale),e.isFtMetadata=T,e.isFtMetadataConfiguration=e=>i(e)&&Array.isArray(e.descriptors)&&e.descriptors.every((e=>F(e))),e.isFtMetadataDescriptor=F,e.isFtMetadataHomeLayout=e=>["CLASSIC","CUSTOM","DESIGNER"].includes(e),e.isFtMetadataPreferenceConfiguration=P,e.isFtMetadataSortRule=R,e.isFtMyLibraryColors=l,e.isFtMySearch=e=>i(e)&&O(e.searchRequest)&&l(e.color)&&a(e.alert)&&n(e.description)&&n(e.id)&&n(e.ownerId)&&n(e.title)&&n(e.creationDate),e.isFtMySearchRequest=O,e.isFtOpenMode=Y,e.isFtPageConfiguration=Le,e.isFtPageRequest=z,e.isFtPaginatedToc=e=>Fe(e)&&De(e.configuration)&&Array.isArray(e.paginatedToc)&&e.paginatedToc.every((e=>Pe(e))),e.isFtPaginatedTocNode=Pe,e.isFtPaginationConfiguration=De,e.isFtPeriod=D,e.isFtPeriodFilter=N,e.isFtPeriodFilterType=M,e.isFtPersonalBookCreation=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>d(e)))&&Array.isArray(e.nodes)&&e.nodes.every((e=>p(e)))&&n(e.description)&&n(e.title),e.isFtPersonalBookMetadataUpdate=d,e.isFtPersonalBookNodeCreation=p,e.isFtPersonalBookTopicLinkCreation=h,e.isFtPublicClusterSortCriterion=W,e.isFtPublicationRating=U,e.isFtPublicationRatingSummary=C,e.isFtRagHistory=_e,e.isFtRagInput=e=>Fe(e)&&ve(e.profileId)&&ve(e.query)&&(null==e.messages||Array.isArray(e.messages)&&e.messages.every((e=>_e(e))))&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>Ne(e)))),e.isFtRatingCreation=e=>i(e)&&v(e.type)&&s(e.value),e.isFtRatingSummary=e=>i(e)&&(null==e.topics||L(e.topics))&&C(e.publication),e.isFtRatingType=v,e.isFtReaderConfiguration=e=>Fe(e)&&Ce(e.feedback)&&Ie(e.loadAfterLastVisibleTopic)&&ve(e.relativeTopicPivotMetadata)&&Ie(e.loadBeforeFirstVisibleTopic)&&ve(e.relativePivotMetadata),e.isFtReaderFeedbackConfiguration=Ce,e.isFtSearchFacet=ce,e.isFtSearchFacetConf=de,e.isFtSearchFacetEntry=pe,e.isFtSearchFilter=w,e.isFtSearchLocale=g,e.isFtSearchLocales=e=>i(e)&&Array.isArray(e.contentLocales)&&e.contentLocales.every((e=>g(e))),e.isFtSearchPreferences=Te,e.isFtSearchPreferencesConfiguration=e=>i(e)&&i(e.metadata)&&Object.keys(e.metadata).every((e=>n(e)))&&Object.values(e.metadata).every((e=>P(e))),e.isFtSearchPreset=e=>i(e)&&n(e.name)&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&s(e.priority)&&(null==e.contentLocale||n(e.contentLocale)),e.isFtSearchPrior=ee,e.isFtSearchRequest=e=>i(e)&&(null==e.periodFilter||N(e.periodFilter))&&n(e.query)&&z(e.paging)&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>he(e)))&&(null==e.virtualField||K(e.virtualField))&&Array.isArray(e.facets)&&e.facets.every((e=>de(e)))&&(null==e.scope||ue(e.scope))&&(null==e.uiLocale||n(e.uiLocale))&&(null==e.contentLocale||n(e.contentLocale))&&(null==e.priors||Array.isArray(e.priors)&&e.priors.every((e=>ee(e))))&&(null==e.clusterSortCriterions||Array.isArray(e.clusterSortCriterions)&&e.clusterSortCriterions.every((e=>W(e)))),e.isFtSearchResultCluster=te,e.isFtSearchResultClusterEntry=re,e.isFtSearchResultMap=ae,e.isFtSearchResultTopic=se,e.isFtSearchResultType=oe,e.isFtSearchResultUnstructuredDocument=ie,e.isFtSearchResults=e=>i(e)&&(null==e.spellcheck||ye(e.spellcheck))&&G(e.paging)&&Array.isArray(e.results)&&e.results.every((e=>te(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>ce(e))),e.isFtSearchResultsPageInfo=G,e.isFtSearchScope=ue,e.isFtSearchSortCriterion=he,e.isFtSearchSortCriterionOrder=H,e.isFtSearchSortCriterionType=V,e.isFtSemanticSearchFilter=Ne,e.isFtSemanticSearchRequest=e=>Fe(e)&&ve(e.query)&&Array.isArray(e.filters)&&e.filters.every((e=>Ne(e)))&&Ie(e.nbResults),e.isFtSemanticSearchResponse=e=>i(e)&&Array.isArray(e.items)&&e.items.every((e=>fe(e))),e.isFtSemanticSearchResponseItem=fe,e.isFtSession=e=>i(e)&&(null==e.authenticationIdentifier||Se(e.authenticationIdentifier))&&s(e.idleTimeoutInMillis)&&be(e.profile)&&a(e.sessionAuthenticated)&&Te(e.searchPreferences),e.isFtSpellcheck=ye,e.isFtSuggestRequest=e=>i(e)&&n(e.input)&&(null==e.scope||ue(e.scope))&&Array.isArray(e.filters)&&e.filters.every((e=>w(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>he(e)))&&(null==e.maxCount||s(e.maxCount))&&(null==e.contentLocale||n(e.contentLocale)),e.isFtSuggestResult=me,e.isFtSuggestResults=e=>i(e)&&Array.isArray(e.suggestions)&&e.suggestions.every((e=>me(e))),e.isFtTocNode=A,e.isFtTopic=e=>i(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.id)&&n(e.contentApiEndpoint)&&n(e.title),e.isFtTopicContentTarget=e=>["THIRD_PARTY","OFF_THE_GRID","CONTENT_PACKAGER","PAGES","DESIGNED_READER"].includes(e),e.isFtTopicOrigin=f,e.isFtTopicOriginType=c,e.isFtTopicRating=_,e.isFtTopicResource=Ae,e.isFtTopicsRatingSummary=L,e.isFtUiLocale=e=>i(e)&&n(e.displayName)&&n(e.languageTag)&&a(e.translated),e.isFtUnstructuredDocument=e=>i(e)&&(null==e.prettyUrl||n(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>T(e)))&&n(e.openMode)&&(null==e.description||n(e.description))&&n(e.mimeType)&&(null==e.baseId||n(e.baseId))&&(null==e.clusterId||n(e.clusterId))&&n(e.contentApiEndpoint)&&n(e.title)&&(null==e.lastPublication||n(e.lastPublication))&&n(e.viewerUrl)&&n(e.lastEdition)&&n(e.filename)&&(null==e.originId||n(e.originId))&&n(e.rightsApiEndpoint)&&(null==e.originUrl||n(e.originUrl))&&(null==e.khubVersion||n(e.khubVersion))&&n(e.id)&&(null==e.lang||n(e.lang)),e.isFtUserProfile=be,e.isFtUserRole=ge,e.isFtVirtualField=K,e.isFtWatermark=Re,e.setUnauthenticatedUserSearchPreferences=function(e,t){if(we.localStorage){let r={...t,metadata:Be(t.metadata??{})};const i=He(e),a=JSON.stringify(r);return we.localStorage.setItem(i,a),we.dispatchEvent(new StorageEvent("storage",{key:i,newValue:a,storageArea:we.localStorage,url:we.location.href})),r}console.error("Cannot set unauthenticated preferences: local storage is unavailable.")},e.userHasRole=function(e,t){return null!=e&&(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some((e=>Me(e,t)))}}));

@@ -428,12 +428,13 @@ export interface FtHttpErrorDetails {

query: string;
scope?: FtSearchScopeKeys;
paging: FtPageRequest;
filters: Array<FtSearchFilter>;
sort: Array<FtSearchSortCriterion>;
virtualField?: FtVirtualFieldKeys;
facets: Array<FtSearchFacetConf>;
scope?: FtSearchScopeKeys;
lastModified?: any;
uiLocale?: string;
virtualField?: FtVirtualFieldKeys;
contentLocale?: string;
priors?: Array<FtSearchPrior>;
facets: Array<FtSearchFacetConf>;
clusterSortCriterions?: Array<FtPublicClusterSortCriterion>;
}

@@ -440,0 +441,0 @@ export declare const isFtSearchRequest: (o: any) => o is FtSearchRequest;

@@ -505,3 +505,2 @@ const isObject = (o) => typeof o === "object" && o != null;

&& (isString(o.query))
&& (o.scope == null || isFtSearchScope(o.scope))
&& (isFtPageRequest(o.paging))

@@ -512,9 +511,12 @@ && ((Array.isArray(o.filters)

&& o.sort.every((v) => isFtSearchSortCriterion(v))))
&& (o.virtualField == null || isFtVirtualField(o.virtualField))
&& ((Array.isArray(o.facets)
&& o.facets.every((v) => isFtSearchFacetConf(v))))
&& (o.scope == null || isFtSearchScope(o.scope))
&& (o.uiLocale == null || isString(o.uiLocale))
&& (o.virtualField == null || isFtVirtualField(o.virtualField))
&& (o.contentLocale == null || isString(o.contentLocale))
&& (o.priors == null || (Array.isArray(o.priors)
&& o.priors.every((v) => isFtSearchPrior(v))))
&& ((Array.isArray(o.facets)
&& o.facets.every((v) => isFtSearchFacetConf(v))));
&& (o.clusterSortCriterions == null || (Array.isArray(o.clusterSortCriterions)
&& o.clusterSortCriterions.every((v) => isFtPublicClusterSortCriterion(v))));
};

@@ -521,0 +523,0 @@ export const isFtSearchResultCluster = (o) => {

{
"name": "@fluid-topics/public-api",
"version": "1.0.66",
"version": "1.0.67",
"description": "Fluid Topics Public API",

@@ -5,0 +5,0 @@ "author": "Fluid Topics dev team <opensource@antidot.net>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc