@fluid-topics/ft-search-context 1.1.63 → 1.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-search-context.d.ts +2 -0
- package/build/ft-search-context.js +6 -0
- package/build/ft-search-context.light.js +5 -5
- package/build/ft-search-context.min.js +3 -3
- package/build/store/FtSearchStateManager.d.ts +3 -0
- package/build/store/FtSearchStateManager.js +8 -0
- package/build/store/redux.d.ts +2 -0
- package/build/store/redux.js +3 -0
- package/package.json +5 -5
|
@@ -4,6 +4,7 @@ import { FtSearchContextProperties } from "./ft-search-context.properties";
|
|
|
4
4
|
import { FtSearchComponentInterface, FtSearchResultsChangeEventDetail } from "./registration";
|
|
5
5
|
import { FtSearchFilter, FtSearchRequest, FtSearchResultsPageInfo, FtSearchScope, FtSearchSortCriterion, FtSpellcheck } from "@fluid-topics/public-api";
|
|
6
6
|
import { FtSearchService } from "./store/utils/FtSearchService";
|
|
7
|
+
import { FtPeriodFilter } from "@fluid-topics/public-api/dist/mjs/types/ft-common/public";
|
|
7
8
|
export declare class LoadErrorEvent extends CustomEvent<Error> {
|
|
8
9
|
constructor(e: Error);
|
|
9
10
|
}
|
|
@@ -20,6 +21,7 @@ export declare class FtSearchContext extends FtLitElementRedux implements FtSear
|
|
|
20
21
|
contentLocale?: string;
|
|
21
22
|
pageSize: number;
|
|
22
23
|
searchInDocumentTitlesOnly: boolean;
|
|
24
|
+
periodFilter?: FtPeriodFilter;
|
|
23
25
|
scope?: FtSearchScope;
|
|
24
26
|
ignoreEmptyQuery: boolean;
|
|
25
27
|
openExternalDocumentInNewTab: boolean;
|
|
@@ -84,6 +84,9 @@ class FtSearchContext extends FtLitElementRedux {
|
|
|
84
84
|
if (props.has("openExternalDocumentInNewTab") && this.openExternalDocumentInNewTab !== undefined) {
|
|
85
85
|
this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab);
|
|
86
86
|
}
|
|
87
|
+
if (props.has("periodFilter") && this.periodFilter !== undefined) {
|
|
88
|
+
this.stateManager.setPeriodFilter(this.periodFilter);
|
|
89
|
+
}
|
|
87
90
|
}
|
|
88
91
|
connectedCallback() {
|
|
89
92
|
super.connectedCallback();
|
|
@@ -135,6 +138,9 @@ __decorate([
|
|
|
135
138
|
__decorate([
|
|
136
139
|
property({ type: Boolean })
|
|
137
140
|
], FtSearchContext.prototype, "searchInDocumentTitlesOnly", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
property()
|
|
143
|
+
], FtSearchContext.prototype, "periodFilter", void 0);
|
|
138
144
|
__decorate([
|
|
139
145
|
property()
|
|
140
146
|
], FtSearchContext.prototype, "scope", void 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
!function(t,s,
|
|
2
|
-
`,r={setRequest:(t,s)=>{t.request=s.payload},setRequestQuery:(t,s)=>{t.request.query=s.payload},setRequestContentLocale:(t,s)=>{t.request.contentLocale=s.payload},setPageSize:(t,s)=>{t.request.paging.perPage=s.payload},setPageNumber:(t,s)=>{t.request.paging.page=s.payload},setRequestSort:(t,s)=>{t.request.sort=s.payload},setRequestFilters:(t,s)=>{t.request.filters=s.payload},setRequestFacets:(t,s)=>{t.request.facets=s.payload},setRequestVirtualField:(t,s)=>{t.request.virtualField=s.payload},setRequestScope:(t,s)=>{t.request.scope=s.payload},setResults:(t,s)=>{t.results=s.payload},setFacets:(t,s)=>{t.facets=s.payload},setSpellcheck:(t,s)=>{t.spellcheck=s.payload},setLocales:(t,s)=>{t.locales=s.payload},setPaging:(t,s)=>{t.paging=s.payload},setLiveQuery:(t,s)=>{t.liveQuery=s.payload},setSuggestResults:(t,s)=>{t.suggestResults=s.payload}};var o,a,h,c,u,l,d,f,v,w,y,E,p,S,b,m,A,g;!function(t){!function(s){var i={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(i.arrayBuffer)var e=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=ArrayBuffer.isView||function(t){return t&&e.indexOf(Object.prototype.toString.call(t))>-1};function r(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function o(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var s={next:function(){var s=t.shift();return{done:void 0===s,value:s}}};return i.iterable&&(s[Symbol.iterator]=function(){return s}),s}function h(t){this.map={},t instanceof h?t.forEach((function(t,s){this.append(s,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(s){this.append(s,t[s])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function u(t){return new Promise((function(s,i){t.onload=function(){s(t.result)},t.onerror=function(){i(t.error)}}))}function l(t){var s=new FileReader,i=u(s);return s.readAsArrayBuffer(t),i}function d(t){if(t.slice)return t.slice(0);var s=new Uint8Array(t.byteLength);return s.set(new Uint8Array(t)),s.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(t){var s;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():i.arrayBuffer&&i.blob&&((s=t)&&DataView.prototype.isPrototypeOf(s))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||n(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var t=c(this);if(t)return t;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?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t,s,i,e=c(this);if(e)return e;if(this._bodyBlob)return t=this._bodyBlob,s=new FileReader,i=u(s),s.readAsText(t),i;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var s=new Uint8Array(t),i=new Array(s.length),e=0;e<s.length;e++)i[e]=String.fromCharCode(s[e]);return i.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(t,s){t=r(t),s=o(s);var i=this.map[t];this.map[t]=i?i+", "+s:s},h.prototype.delete=function(t){delete this.map[r(t)]},h.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},h.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},h.prototype.set=function(t,s){this.map[r(t)]=o(s)},h.prototype.forEach=function(t,s){for(var i in this.map)this.map.hasOwnProperty(i)&&t.call(s,this.map[i],i,this)},h.prototype.keys=function(){var t=[];return this.forEach((function(s,i){t.push(i)})),a(t)},h.prototype.values=function(){var t=[];return this.forEach((function(s){t.push(s)})),a(t)},h.prototype.entries=function(){var t=[];return this.forEach((function(s,i){t.push([i,s])})),a(t)},i.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(t,s){var i,e,n=(s=s||{}).body;if(t instanceof w){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,s.headers||(this.headers=new h(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=s.credentials||this.credentials||"same-origin",!s.headers&&this.headers||(this.headers=new h(s.headers)),this.method=(i=s.method||this.method||"GET",e=i.toUpperCase(),v.indexOf(e)>-1?e:i),this.mode=s.mode||this.mode||null,this.signal=s.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function y(t){var s=new FormData;return t.trim().split("&").forEach((function(t){if(t){var i=t.split("="),e=i.shift().replace(/\+/g," "),n=i.join("=").replace(/\+/g," ");s.append(decodeURIComponent(e),decodeURIComponent(n))}})),s}function E(t,s){s||(s={}),this.type="default",this.status=void 0===s.status?200:s.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in s?s.statusText:"OK",this.headers=new h(s.headers),this.url=s.url||"",this._initBody(t)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},f.call(w.prototype),f.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},E.error=function(){var t=new E(null,{status:0,statusText:""});return t.type="error",t};var p=[301,302,303,307,308];E.redirect=function(t,s){if(-1===p.indexOf(s))throw new RangeError("Invalid status code");return new E(null,{status:s,headers:{location:t}})},s.DOMException=t.DOMException;try{new s.DOMException}catch(t){s.DOMException=function(t,s){this.message=t,this.name=s;var i=Error(t);this.stack=i.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function S(t,e){return new Promise((function(n,r){var o=new w(t,e);if(o.signal&&o.signal.aborted)return r(new s.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var t,s,i={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",s=new h,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var i=t.split(":"),e=i.shift().trim();if(e){var n=i.join(":").trim();s.append(e,n)}})),s)};i.url="responseURL"in a?a.responseURL:i.headers.get("X-Request-URL");var e="response"in a?a.response:a.responseText;n(new E(e,i))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new s.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&i.blob&&(a.responseType="blob"),o.headers.forEach((function(t,s){a.setRequestHeader(s,t)})),o.signal&&(o.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",c)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=h,t.Request=w,t.Response=E),s.Headers=h,s.Request=w,s.Response=E,s.fetch=S,Object.defineProperty(s,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(o||(o={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(a||(a={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(h||(h={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(c||(c={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(u||(u={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(l||(l={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(d||(d={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(f||(f={})),function(t){t.ASC="ASC",t.DESC="DESC"}(v||(v={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(w||(w={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(y||(y={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(E||(E={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(p||(p={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(S||(S={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(b||(b={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(m||(m={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(A||(A={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(g||(g={})),A.PERSONAL_BOOK_SHARE_USER,A.PERSONAL_BOOK_USER,A.HTML_EXPORT_USER,A.PERSONAL_BOOK_USER,A.PDF_EXPORT_USER,A.PERSONAL_BOOK_USER,A.KHUB_ADMIN,A.CONTENT_PUBLISHER,A.ADMIN,A.KHUB_ADMIN,A.USERS_ADMIN,A.PORTAL_ADMIN,A.DEVELOPER,A.BETA_USER,A.DEBUG_USER;const R=i.css`
|
|
3
|
-
`,T=
|
|
1
|
+
!function(t,i,s,e){const n=s.css`
|
|
2
|
+
`,r={setRequest:(t,i)=>{t.request=i.payload},setRequestQuery:(t,i)=>{t.request.query=i.payload},setRequestContentLocale:(t,i)=>{t.request.contentLocale=i.payload},setPageSize:(t,i)=>{t.request.paging.perPage=i.payload},setPageNumber:(t,i)=>{t.request.paging.page=i.payload},setRequestSort:(t,i)=>{t.request.sort=i.payload},setRequestFilters:(t,i)=>{t.request.filters=i.payload},setRequestFacets:(t,i)=>{t.request.facets=i.payload},setRequestVirtualField:(t,i)=>{t.request.virtualField=i.payload},setRequestScope:(t,i)=>{t.request.scope=i.payload},setResults:(t,i)=>{t.results=i.payload},setFacets:(t,i)=>{t.facets=i.payload},setSpellcheck:(t,i)=>{t.spellcheck=i.payload},setLocales:(t,i)=>{t.locales=i.payload},setPaging:(t,i)=>{t.paging=i.payload},setLiveQuery:(t,i)=>{t.liveQuery=i.payload},setSuggestResults:(t,i)=>{t.suggestResults=i.payload},setRequestPeriodFilter:(t,i)=>{t.request.periodFilter=i.payload}};var o,a,h,c,u,l,d,f,v,w,y,E,p,S,b,m,A,g;!function(t){!function(i){var s={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(s.arrayBuffer)var e=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=ArrayBuffer.isView||function(t){return t&&e.indexOf(Object.prototype.toString.call(t))>-1};function r(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function o(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var i={next:function(){var i=t.shift();return{done:void 0===i,value:i}}};return s.iterable&&(i[Symbol.iterator]=function(){return i}),i}function h(t){this.map={},t instanceof h?t.forEach((function(t,i){this.append(i,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(i){this.append(i,t[i])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function u(t){return new Promise((function(i,s){t.onload=function(){i(t.result)},t.onerror=function(){s(t.error)}}))}function l(t){var i=new FileReader,s=u(i);return i.readAsArrayBuffer(t),s}function d(t){if(t.slice)return t.slice(0);var i=new Uint8Array(t.byteLength);return i.set(new Uint8Array(t)),i.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(t){var i;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:s.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:s.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s.arrayBuffer&&s.blob&&((i=t)&&DataView.prototype.isPrototypeOf(i))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||n(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s.blob&&(this.blob=function(){var t=c(this);if(t)return t;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?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t,i,s,e=c(this);if(e)return e;if(this._bodyBlob)return t=this._bodyBlob,i=new FileReader,s=u(i),i.readAsText(t),s;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var i=new Uint8Array(t),s=new Array(i.length),e=0;e<i.length;e++)s[e]=String.fromCharCode(i[e]);return s.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(t,i){t=r(t),i=o(i);var s=this.map[t];this.map[t]=s?s+", "+i:i},h.prototype.delete=function(t){delete this.map[r(t)]},h.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},h.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},h.prototype.set=function(t,i){this.map[r(t)]=o(i)},h.prototype.forEach=function(t,i){for(var s in this.map)this.map.hasOwnProperty(s)&&t.call(i,this.map[s],s,this)},h.prototype.keys=function(){var t=[];return this.forEach((function(i,s){t.push(s)})),a(t)},h.prototype.values=function(){var t=[];return this.forEach((function(i){t.push(i)})),a(t)},h.prototype.entries=function(){var t=[];return this.forEach((function(i,s){t.push([s,i])})),a(t)},s.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(t,i){var s,e,n=(i=i||{}).body;if(t instanceof w){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,i.headers||(this.headers=new h(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=i.credentials||this.credentials||"same-origin",!i.headers&&this.headers||(this.headers=new h(i.headers)),this.method=(s=i.method||this.method||"GET",e=s.toUpperCase(),v.indexOf(e)>-1?e:s),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function y(t){var i=new FormData;return t.trim().split("&").forEach((function(t){if(t){var s=t.split("="),e=s.shift().replace(/\+/g," "),n=s.join("=").replace(/\+/g," ");i.append(decodeURIComponent(e),decodeURIComponent(n))}})),i}function E(t,i){i||(i={}),this.type="default",this.status=void 0===i.status?200:i.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in i?i.statusText:"OK",this.headers=new h(i.headers),this.url=i.url||"",this._initBody(t)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},f.call(w.prototype),f.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},E.error=function(){var t=new E(null,{status:0,statusText:""});return t.type="error",t};var p=[301,302,303,307,308];E.redirect=function(t,i){if(-1===p.indexOf(i))throw new RangeError("Invalid status code");return new E(null,{status:i,headers:{location:t}})},i.DOMException=t.DOMException;try{new i.DOMException}catch(t){i.DOMException=function(t,i){this.message=t,this.name=i;var s=Error(t);this.stack=s.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function S(t,e){return new Promise((function(n,r){var o=new w(t,e);if(o.signal&&o.signal.aborted)return r(new i.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var t,i,s={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",i=new h,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var s=t.split(":"),e=s.shift().trim();if(e){var n=s.join(":").trim();i.append(e,n)}})),i)};s.url="responseURL"in a?a.responseURL:s.headers.get("X-Request-URL");var e="response"in a?a.response:a.responseText;n(new E(e,s))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new i.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&s.blob&&(a.responseType="blob"),o.headers.forEach((function(t,i){a.setRequestHeader(i,t)})),o.signal&&(o.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",c)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=h,t.Request=w,t.Response=E),i.Headers=h,i.Request=w,i.Response=E,i.fetch=S,Object.defineProperty(i,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(o||(o={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(a||(a={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(h||(h={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(c||(c={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(u||(u={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(l||(l={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(d||(d={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(f||(f={})),function(t){t.ASC="ASC",t.DESC="DESC"}(v||(v={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(w||(w={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(y||(y={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(E||(E={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(p||(p={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(S||(S={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(b||(b={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(m||(m={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(A||(A={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(g||(g={})),A.PERSONAL_BOOK_SHARE_USER,A.PERSONAL_BOOK_USER,A.HTML_EXPORT_USER,A.PERSONAL_BOOK_USER,A.PDF_EXPORT_USER,A.PERSONAL_BOOK_USER,A.KHUB_ADMIN,A.CONTENT_PUBLISHER,A.ADMIN,A.KHUB_ADMIN,A.USERS_ADMIN,A.PORTAL_ADMIN,A.DEVELOPER,A.BETA_USER,A.DEBUG_USER;const R=s.css`
|
|
3
|
+
`,T=i.FtReduxStore.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1}});class O{static get(t){const{baseUrl:i,apiIntegrationIdentifier:s}=T.getState(),e=null!=t?t:s;if(i&&e&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,e,!0)}static await(t){return new Promise((i=>{let s=O.get(t);if(s)i(s);else{const e=T.subscribe((()=>{s=O.get(t),s&&(e(),i(s))}))}}))}}class I{constructor(t=!0,s){var e;this.overrideApi=s;let n=this.constructor;n.commonCache=null!==(e=n.commonCache)&&void 0!==e?e:new i.CacheRegistry,this.cache=t?n.commonCache:new i.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:O.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:O.await()}clearCache(){this.cache.clearAll()}}var C;const U=Symbol("clearAfterUnitTest");class L extends I{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[C]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=T.getState().uiLocale,T.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=T.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,s){var e;if(t=t.toLowerCase(),Object.keys(s).length>0){const n={...null!==(e=this.defaultMessages[t])&&void 0!==e?e:{},...s};i.deepEqual(this.defaultMessages[t],n)||(this.defaultMessages[t]=n,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,s,...e){var n,r,o;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(r=null===(n=this.cache.getNow(t))||void 0===n?void 0:n.messages)&&void 0!==r?r:{};return new i.ParametrizedLabelResolver(null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},a).resolve(s,...e)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var s;return t=t.toLowerCase(),this.listeners[t]=null!==(s=this.listeners[t])&&void 0!==s?s:new Set,this.listeners[t].add(i),()=>{var s;return null===(s=this.listeners[t])||void 0===s?void 0:s.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}C=U,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends L{constructor(){super((async(t,i)=>(await this.awaitApi).getFluidTopicsMessageContext(t,i)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends L{constructor(){super((async(t,i)=>(await this.awaitApi).getCustomMessageContext(t,i)))}});const D=window.FluidTopicsI18nService;var N=function(t,i,s,e){for(var n,r=arguments.length,o=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(i,s,o):n(i,s))||o);return r>3&&o&&Object.defineProperty(i,s,o),o};class P extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>O.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return s.html`
|
|
4
4
|
<slot></slot>
|
|
5
|
-
`}update(t){super.update(t),t.has("baseUrl")&&(T.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&T.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&T.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&T.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&T.actions.noCustom(this.noCustom),t.has("editorMode")&&T.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&T.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&T.actions.session(this.session),t.has("availableUiLocales")&&T.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>D.addContext(t))),t.has("openExternalDocumentInNewTab")&&T.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}P.elementDefinitions={},P.styles=R,N([e.property()],P.prototype,"baseUrl",void 0),N([e.property()],P.prototype,"apiIntegrationIdentifier",void 0),N([e.property()],P.prototype,"uiLocale",void 0),N([s.jsonProperty(null)],P.prototype,"availableUiLocales",void 0),N([s.jsonProperty(null)],P.prototype,"metadataConfiguration",void 0),N([e.property({type:Boolean})],P.prototype,"editorMode",void 0),N([e.property({type:Boolean})],P.prototype,"noCustom",void 0),N([e.property({type:Boolean})],P.prototype,"openExternalDocumentInNewTab",void 0),N([e.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],P.prototype,"noCustomComponent",void 0),N([e.property({type:Boolean})],P.prototype,"withManualResources",void 0),N([s.jsonProperty([])],P.prototype,"messageContexts",void 0),N([s.jsonProperty(void 0)],P.prototype,"session",void 0),N([e.property({type:Object})],P.prototype,"apiProvider",void 0);class _ extends I{async listMySearches(){let t=T.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class x extends I{async listMyBookmarks(){let t=T.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const B=s.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const M=new class{constructor(){this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new x,this.savedSearchesService=new _,T.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:i}=T.getState();s.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==i?void 0:i.profile)||(this.currentSession=i,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),B.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),B.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();B.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const s=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;B.actions.bookmarks(s)}}};s.customElement("ft-app-context")(P);class F extends I{constructor(){super(),this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}}const k=t=>t.request.virtualField===y.TITLE_ONLY&&t.request.scope===m.DOCUMENTS;class j extends Event{constructor(){super(j.eventName)}}j.eventName="search-context-clear-all-filters";class q{static build(t,i){return new q((t=>s.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:r}))(t.trim()||"context"),i)}constructor(t,i){this.store=t,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.searchDebouncer=new s.Debouncer(100),this.suggestDebouncer=new s.Debouncer(300),this.service=null!=i?i:new F}async initService(){return this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let s=this.store.getState().locales,i=this.store.getState().request.contentLocale;if(t!=i){if(s){const e=t=>s.some((s=>s.lang==t));e(t)||(t=e(i)?i:s[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([]),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){const s=t.filter((t=>t.values.length>0));this.store.actions.setRequestFilters(s),this.store.actions.setPageNumber(1),s.forEach((t=>{this.facetIds.includes(t.key)||(this.facetIds=[...this.facetIds,t.key])})),this.launchSearch()}setSearchInDocumentTitlesOnly(t){t?(this.store.actions.setRequestVirtualField(y.TITLE_ONLY),this.store.actions.setRequestScope(m.DOCUMENTS)):(this.store.actions.setRequestVirtualField(y.EVERYWHERE),this.store.actions.setRequestScope(m.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return k(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new j)}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,s){let i=this.facetIds.filter((s=>s!=t));s&&i.push(s),this.facetIds=i,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let s=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(s)}setFilter(t,s){let i=this.store.getState().request.filters,e={key:t,values:s,negative:!1},n=[...i.filter((s=>s.key!==t)),e];this.setFilters(n)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}setRequest(t){this.store.actions.setRequest(t),this.store.actions.setLiveQuery(t.query),this.store.actions.setPageNumber(1),this.launchSearch()}setScope(t){this.store.actions.setRequestScope(t),this.launchSearch()}setIgnoreEmptyQuery(t){this.ignoreEmptyQuery=t,this.launchSearch()}setOpenExternalDocumentInNewTab(t){this.openExternalDocumentInNewTab=t}launchSearch(){return this.searchDebouncer.run((()=>this.fetchSearchData()))}launchSuggest(){return this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t,i;try{null===(t=this.cancelableSearch)||void 0===t||t.cancel();let e=this.store.getState().request;if(this.store.actions.setPaging(void 0),this.ignoreEmptyQuery&&0==e.query.length)this.store.actions.setResults(void 0),this.store.actions.setFacets(void 0),this.store.actions.setSpellcheck(void 0);else{this.cancelableSearch=s.cancelable(this.service.launchSearch(e));const t=await this.cancelableSearch;if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setSpellcheck(t.spellcheck);else{let s=(null!==(i=this.store.getState().results)&&void 0!==i?i:[]).concat(t.results);this.store.actions.setResults(s)}this.store.actions.setPaging(t.paging)}}catch(t){t instanceof s.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}async fetchSuggestData(){var t;try{const i=this.store.getState(),e=i.request,n={input:i.liveQuery,filters:e.filters,sort:e.sort,contentLocale:e.contentLocale,scope:e.scope};null===(t=this.cancelableSuggest)||void 0===t||t.cancel(),this.cancelableSuggest=s.cancelable(this.service.launchSuggest(n));let r=await this.cancelableSuggest;this.store.actions.setSuggestResults(r.suggestions)}catch(t){t instanceof s.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}clear(){this.store.clear()}}var H=function(t,s,i,e){for(var n,r=arguments.length,o=r<3?s:null===e?e=Object.getOwnPropertyDescriptor(s,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(s,i,o):n(s,i))||o);return r>3&&o&&Object.defineProperty(s,i,o),o};class G extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const K=Symbol("registerInterval");class V extends(function(t){var s;class i extends t{constructor(){super(...arguments),this[s]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[K]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[K]):this.dispatchEvent(new G)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return s=K,H([e.state()],i.prototype,"stateManager",void 0),i}(s.FtLitElementRedux)){}var Q=function(t,s,i,e){for(var n,r=arguments.length,o=r<3?s:null===e?e=Object.getOwnPropertyDescriptor(s,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(s,i,o):n(s,i))||o);return r>3&&o&&Object.defineProperty(s,i,o),o};class z extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class X extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class Y extends CustomEvent{constructor(t,s,i){super("ft-search-results-change",{detail:{request:t,paging:s,spellcheck:i}})}}class W extends s.FtLitElementRedux{get stateManager(){if(null==this._stateManager){const t=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=q.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),t),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")}return this._stateManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.addStore(T)}render(){return i.html`
|
|
5
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(T.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&T.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&T.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&T.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&T.actions.noCustom(this.noCustom),t.has("editorMode")&&T.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&T.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&T.actions.session(this.session),t.has("availableUiLocales")&&T.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>D.addContext(t))),t.has("openExternalDocumentInNewTab")&&T.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}P.elementDefinitions={},P.styles=R,N([e.property()],P.prototype,"baseUrl",void 0),N([e.property()],P.prototype,"apiIntegrationIdentifier",void 0),N([e.property()],P.prototype,"uiLocale",void 0),N([i.jsonProperty(null)],P.prototype,"availableUiLocales",void 0),N([i.jsonProperty(null)],P.prototype,"metadataConfiguration",void 0),N([e.property({type:Boolean})],P.prototype,"editorMode",void 0),N([e.property({type:Boolean})],P.prototype,"noCustom",void 0),N([e.property({type:Boolean})],P.prototype,"openExternalDocumentInNewTab",void 0),N([e.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],P.prototype,"noCustomComponent",void 0),N([e.property({type:Boolean})],P.prototype,"withManualResources",void 0),N([i.jsonProperty([])],P.prototype,"messageContexts",void 0),N([i.jsonProperty(void 0)],P.prototype,"session",void 0),N([e.property({type:Object})],P.prototype,"apiProvider",void 0);class _ extends I{async listMySearches(){let t=T.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class x extends I{async listMyBookmarks(){let t=T.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const F=i.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const B=new class{constructor(){this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new x,this.savedSearchesService=new _,T.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:s}=T.getState();i.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==s?void 0:s.profile)||(this.currentSession=s,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),F.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),F.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();F.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const i=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;F.actions.bookmarks(i)}}};i.customElement("ft-app-context")(P);class M extends I{constructor(){super(),this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}}const k=t=>t.request.virtualField===y.TITLE_ONLY&&t.request.scope===m.DOCUMENTS;class j extends Event{constructor(){super(j.eventName)}}j.eventName="search-context-clear-all-filters";class q{static build(t,s){return new q((t=>i.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:r}))(t.trim()||"context"),s)}constructor(t,s){this.store=t,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.searchDebouncer=new i.Debouncer(100),this.suggestDebouncer=new i.Debouncer(300),this.service=null!=s?s:new M}async initService(){return this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let i=this.store.getState().locales,s=this.store.getState().request.contentLocale;if(t!=s){if(i){const e=t=>i.some((i=>i.lang==t));e(t)||(t=e(s)?s:i[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([]),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){const i=t.filter((t=>t.values.length>0));this.store.actions.setRequestFilters(i),this.store.actions.setPageNumber(1),i.forEach((t=>{this.facetIds.includes(t.key)||(this.facetIds=[...this.facetIds,t.key])})),this.launchSearch()}setSearchInDocumentTitlesOnly(t){t?(this.store.actions.setRequestVirtualField(y.TITLE_ONLY),this.store.actions.setRequestScope(m.DOCUMENTS)):(this.store.actions.setRequestVirtualField(y.EVERYWHERE),this.store.actions.setRequestScope(m.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return k(this.store.getState())}get periodFilter(){return this.store.getState().request.periodFilter}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new j)}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,i){let s=this.facetIds.filter((i=>i!=t));i&&s.push(i),this.facetIds=s,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let i=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(i)}setFilter(t,i){let s=this.store.getState().request.filters,e={key:t,values:i,negative:!1},n=[...s.filter((i=>i.key!==t)),e];this.setFilters(n)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}setRequest(t){this.store.actions.setRequest(t),this.store.actions.setLiveQuery(t.query),this.store.actions.setPageNumber(1),this.launchSearch()}setScope(t){this.store.actions.setRequestScope(t),this.launchSearch()}setIgnoreEmptyQuery(t){this.ignoreEmptyQuery=t,this.launchSearch()}setOpenExternalDocumentInNewTab(t){this.openExternalDocumentInNewTab=t}setPeriodFilter(t){this.store.actions.setRequestPeriodFilter(t),this.store.actions.setPageNumber(1),this.launchSearch()}launchSearch(){return this.searchDebouncer.run((()=>this.fetchSearchData()))}launchSuggest(){return this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t,s;try{null===(t=this.cancelableSearch)||void 0===t||t.cancel();let e=this.store.getState().request;if(this.store.actions.setPaging(void 0),this.ignoreEmptyQuery&&0==e.query.length)this.store.actions.setResults(void 0),this.store.actions.setFacets(void 0),this.store.actions.setSpellcheck(void 0);else{this.cancelableSearch=i.cancelable(this.service.launchSearch(e));const t=await this.cancelableSearch;if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setSpellcheck(t.spellcheck);else{let i=(null!==(s=this.store.getState().results)&&void 0!==s?s:[]).concat(t.results);this.store.actions.setResults(i)}this.store.actions.setPaging(t.paging)}}catch(t){t instanceof i.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}async fetchSuggestData(){var t;try{const s=this.store.getState(),e=s.request,n={input:s.liveQuery,filters:e.filters,sort:e.sort,contentLocale:e.contentLocale,scope:e.scope};null===(t=this.cancelableSuggest)||void 0===t||t.cancel(),this.cancelableSuggest=i.cancelable(this.service.launchSuggest(n));let r=await this.cancelableSuggest;this.store.actions.setSuggestResults(r.suggestions)}catch(t){t instanceof i.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}clear(){this.store.clear()}}var H=function(t,i,s,e){for(var n,r=arguments.length,o=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(i,s,o):n(i,s))||o);return r>3&&o&&Object.defineProperty(i,s,o),o};class G extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const K=Symbol("registerInterval");class V extends(function(t){var i;class s extends t{constructor(){super(...arguments),this[i]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[K]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[K]):this.dispatchEvent(new G)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=K,H([e.state()],s.prototype,"stateManager",void 0),s}(i.FtLitElementRedux)){}var Q=function(t,i,s,e){for(var n,r=arguments.length,o=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(i,s,o):n(i,s))||o);return r>3&&o&&Object.defineProperty(i,s,o),o};class z extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class X extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class Y extends CustomEvent{constructor(t,i,s){super("ft-search-results-change",{detail:{request:t,paging:i,spellcheck:s}})}}class W extends i.FtLitElementRedux{get stateManager(){if(null==this._stateManager){const t=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=q.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),t),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")}return this._stateManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.addStore(T)}render(){return s.html`
|
|
6
6
|
<slot @register-ft-search-component=${this.registerComponent}></slot>
|
|
7
|
-
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new X(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new Y(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const
|
|
7
|
+
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("periodFilter")&&void 0!==this.periodFilter&&this.stateManager.setPeriodFilter(this.periodFilter)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new X(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new Y(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const i=t.composedPath()[0];this.register(i)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new z(t))}reloadSavedSearches(){B.clearMySearches()}clear(){this.stateManager.clear()}}W.elementDefinitions={},W.styles=n,Q([e.property()],W.prototype,"query",void 0),Q([e.property()],W.prototype,"contentLocale",void 0),Q([e.property({type:Number})],W.prototype,"pageSize",void 0),Q([e.property({type:Boolean})],W.prototype,"searchInDocumentTitlesOnly",void 0),Q([e.property()],W.prototype,"periodFilter",void 0),Q([e.property()],W.prototype,"scope",void 0),Q([e.property({type:Boolean})],W.prototype,"ignoreEmptyQuery",void 0),Q([i.redux({store:T.name})],W.prototype,"openExternalDocumentInNewTab",void 0),Q([i.jsonProperty([])],W.prototype,"filters",void 0),Q([i.jsonProperty([])],W.prototype,"sort",void 0),Q([i.redux({store:"search"})],W.prototype,"request",void 0),Q([i.redux({store:"search"})],W.prototype,"paging",void 0),Q([i.redux({store:"search",selector:t=>t.spellcheck})],W.prototype,"autocorrect",void 0),Q([i.redux({store:T.name})],W.prototype,"session",void 0),Q([e.property({attribute:!1})],W.prototype,"searchServiceProvider",void 0),i.customElement("ft-search-context")(W),t.ClearAllFiltersEvent=j,t.FtSearchContext=W,t.FtSearchContextCssVariables={},t.FtSearchStateManager=q,t.LoadErrorEvent=z,t.SearchRequestChangeEvent=X,t.SearchResultsChangeEvent=Y,t.searchInDocumentTitlesOnlySelector=k,t.styles=n}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
|
|
@@ -175,9 +175,9 @@ function(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=${r}
|
|
|
175
175
|
width: 0;
|
|
176
176
|
}
|
|
177
177
|
`;var Ti=Object.freeze({__proto__:null,noTextSelect:Ki,safariEllipsisFix:Hi,wordWrap:Zi}),$i=Object.freeze({__proto__:null});class Gi{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var o,r;t=this.resolvePluralKey(t,e);let i=null!==(r=null!==(o=this.labels[t])&&void 0!==o?o:this.defaultLabels[t])&&void 0!==r?r:"";return e.forEach(((t,e)=>i=i.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,o)=>this.formatValue(t,o))))),i}resolvePluralKey(t,e){for(let o of e)if("number"==typeof o){const e=`${String(t)}[\\=${o}]`;if(e in this.labels||e in this.defaultLabels)return e}return t}formatValue(t,e){return t instanceof Date?this.formatDate(t,e):null!=t?t:""}formatDate(t,e){const o=o=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(o):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(o):t.toLocaleString(o);try{return o(document.documentElement.lang)}catch(t){return o()}}}var Vi=Object.freeze({__proto__:null,ParametrizedLabelResolver:Gi});const qi=t=>{const e=null!=t?t:{};return(t,o)=>{var r;const i={hasChanged:(t,e)=>!so(t,e),attribute:!1,...e};Se(i)(t,o);const n=t.constructor;n.reduxProperties=new Map(n.reduxProperties),n.reduxProperties.set(o,{selector:null!==(r=e.selector)&&void 0!==r?r:t=>t[o],store:e.store})}};class Yi{constructor(){this.queue=[]}add(t,e=!1){e&&(this.queue=this.queue.filter((e=>e.type!==t.type))),this.queue.push(t)}consume(t){const e=this.queue.find((e=>e.type===t));return e&&(this.queue=this.queue.filter((t=>t!==e))),e}}function Ji(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var Xi,Qi,tn;const en=Symbol("internalReduxEventsUnsubscribers"),on=Symbol("internalStoresUnsubscribers"),rn=Symbol("internalStores");class nn extends Ai{constructor(){super(...arguments),this[Xi]=new Map,this[Qi]=new Map,this[tn]=[]}get reduxConstructor(){return this.constructor}update(t){super.update(t),[...this.reduxConstructor.reduxReactiveProperties].some((e=>t.has(e)))&&this.updateFromStores()}getUnnamedStore(){if(this[rn].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[rn].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[rn].get(t)}addStore(t,e){var o;e=null!==(o=null!=e?e:Ji(t)?t.name:void 0)&&void 0!==o?o:"default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[rn].delete(e)}setupStore(t,e){this[rn].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[rn].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach(((t,e)=>{const o=this.constructor.getPropertyOptions(e);if(!(null==o?void 0:o.attribute)||!this.hasAttribute("string"==typeof(null==o?void 0:o.attribute)?o.attribute:e)){const o=this.getStore(t.store);o&&(t.store?this[on].has(t.store):this[on].size>0)&&(this[e]=t.selector(o.getState(),this))}}))}subscribeToStore(t,e){var o;this[on].set(t,e.subscribe((()=>this.updateFromStores()))),Ji(e)&&e.eventBus&&(null===(o=this.reduxConstructor.reduxEventListeners)||void 0===o||o.forEach(((t,o)=>{if("function"==typeof this[o]&&(!t.store||e.name===t.store)){const r=t=>this[o](t);e.eventBus.addEventListener(t.eventName,r),this[en].push((()=>e.eventBus.removeEventListener(t.eventName,r)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[on].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[en].forEach((t=>t())),this[en]=[]}unsubscribeFromStore(t){this[on].has(t)&&this[on].get(t)(),this[on].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}function an(t){for(var e=arguments.length,o=Array(e>1?e-1:0),r=1;r<e;r++)o[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function sn(t){return!!t&&!!t[Gn]}function cn(t){var e;return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var o=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return o===Object||"function"==typeof o&&Function.toString.call(o)===Vn}(t)||Array.isArray(t)||!!t[$n]||!!(null===(e=t.constructor)||void 0===e?void 0:e[$n])||pn(t)||yn(t))}function ln(t,e,o){void 0===o&&(o=!1),0===fn(t)?(o?Object.keys:qn)(t).forEach((function(r){o&&"symbol"==typeof r||e(r,t[r],t)})):t.forEach((function(o,r){return e(r,o,t)}))}function fn(t){var e=t[Gn];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:pn(t)?2:yn(t)?3:0}function un(t,e){return 2===fn(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function hn(t,e,o){var r=fn(t);2===r?t.set(e,o):3===r?t.add(o):t[e]=o}function dn(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function pn(t){return Kn&&t instanceof Map}function yn(t){return Zn&&t instanceof Set}function gn(t){return t.o||t.t}function bn(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Yn(t);delete e[Gn];for(var o=qn(e),r=0;r<o.length;r++){var i=o[r],n=e[i];!1===n.writable&&(n.writable=!0,n.configurable=!0),(n.get||n.set)&&(e[i]={configurable:!0,writable:!0,enumerable:n.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function mn(t,e){return void 0===e&&(e=!1),On(t)||sn(t)||!cn(t)||(fn(t)>1&&(t.set=t.add=t.clear=t.delete=vn),Object.freeze(t),e&&ln(t,(function(t,e){return mn(e,!0)}),!0)),t}function vn(){an(2)}function On(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function Sn(t){var e=Jn[t];return e||an(18,t),e}function wn(){return Mn}function xn(t,e){e&&(Sn("Patches"),t.u=[],t.s=[],t.v=e)}function Cn(t){Nn(t),t.p.forEach(Rn),t.p=null}function Nn(t){t===Mn&&(Mn=t.l)}function En(t){return Mn={p:[],l:Mn,h:t,m:!0,_:0}}function Rn(t){var e=t[Gn];0===e.i||1===e.i?e.j():e.g=!0}function In(t,e){e._=e.p.length;var o=e.p[0],r=void 0!==t&&t!==o;return e.h.O||Sn("ES5").S(e,t,r),r?(o[Gn].P&&(Cn(e),an(4)),cn(t)&&(t=Ln(e,t),e.l||Wn(e,t)),e.u&&Sn("Patches").M(o[Gn].t,t,e.u,e.s)):t=Ln(e,o,[]),Cn(e),e.u&&e.v(e.u,e.s),t!==Tn?t:void 0}function Ln(t,e,o){if(On(e))return e;var r=e[Gn];if(!r)return ln(e,(function(i,n){return Un(t,r,e,i,n,o)}),!0),e;if(r.A!==t)return e;if(!r.P)return Wn(t,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=bn(r.k):r.o,n=i,a=!1;3===r.i&&(n=new Set(i),i.clear(),a=!0),ln(n,(function(e,n){return Un(t,r,i,e,n,o,a)})),Wn(t,i,!1),o&&t.u&&Sn("Patches").N(r,o,t.u,t.s)}return r.o}function Un(t,e,o,r,i,n,a){if(sn(i)){var s=Ln(t,i,n&&e&&3!==e.i&&!un(e.R,r)?n.concat(r):void 0);if(hn(o,r,s),!sn(s))return;t.m=!1}else a&&o.add(i);if(cn(i)&&!On(i)){if(!t.h.D&&t._<1)return;Ln(t,i),e&&e.A.l||Wn(t,i)}}function Wn(t,e,o){void 0===o&&(o=!1),!t.l&&t.h.D&&t.m&&mn(e,o)}function kn(t,e){var o=t[Gn];return(o?gn(o):t)[e]}function An(t,e){if(e in t)for(var o=Object.getPrototypeOf(t);o;){var r=Object.getOwnPropertyDescriptor(o,e);if(r)return r;o=Object.getPrototypeOf(o)}}function Bn(t){t.P||(t.P=!0,t.l&&Bn(t.l))}function Fn(t){t.o||(t.o=bn(t.t))}function _n(t,e,o){var r=pn(e)?Sn("MapSet").F(e,o):yn(e)?Sn("MapSet").T(e,o):t.O?function(t,e){var o=Array.isArray(t),r={i:o?1:0,A:e?e.A:wn(),P:!1,I:!1,R:{},l:e,t,k:null,o:null,j:null,C:!1},i=r,n=Xn;o&&(i=[r],n=Qn);var a=Proxy.revocable(i,n),s=a.revoke,c=a.proxy;return r.k=c,r.j=s,c}(e,o):Sn("ES5").J(e,o);return(o?o.A:wn()).p.push(r),r}function Pn(t){return sn(t)||an(22,t),function t(e){if(!cn(e))return e;var o,r=e[Gn],i=fn(e);if(r){if(!r.P&&(r.i<4||!Sn("ES5").K(r)))return r.t;r.I=!0,o=zn(e,i),r.I=!1}else o=zn(e,i);return ln(o,(function(e,i){r&&function(t,e){return 2===fn(t)?t.get(e):t[e]}(r.t,e)===i||hn(o,e,t(i))})),3===i?new Set(o):o}(t)}function zn(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return bn(t)}Xi=on,Qi=rn,tn=en,nn.reduxProperties=new Map,nn.reduxReactiveProperties=new Set,nn.reduxEventListeners=new Map;var Dn,Mn,jn="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Kn="undefined"!=typeof Map,Zn="undefined"!=typeof Set,Hn="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Tn=jn?Symbol.for("immer-nothing"):((Dn={})["immer-nothing"]=!0,Dn),$n=jn?Symbol.for("immer-draftable"):"__$immer_draftable",Gn=jn?Symbol.for("immer-state"):"__$immer_state",Vn=""+Object.prototype.constructor,qn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Yn=Object.getOwnPropertyDescriptors||function(t){var e={};return qn(t).forEach((function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)})),e},Jn={},Xn={get:function(t,e){if(e===Gn)return t;var o=gn(t);if(!un(o,e))return function(t,e,o){var r,i=An(e,o);return i?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(t.k):void 0}(t,o,e);var r=o[e];return t.I||!cn(r)?r:r===kn(t.t,e)?(Fn(t),t.o[e]=_n(t.A.h,r,t)):r},has:function(t,e){return e in gn(t)},ownKeys:function(t){return Reflect.ownKeys(gn(t))},set:function(t,e,o){var r=An(gn(t),e);if(null==r?void 0:r.set)return r.set.call(t.k,o),!0;if(!t.P){var i=kn(gn(t),e),n=null==i?void 0:i[Gn];if(n&&n.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(dn(o,i)&&(void 0!==o||un(t.t,e)))return!0;Fn(t),Bn(t)}return t.o[e]===o&&(void 0!==o||e in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[e])||(t.o[e]=o,t.R[e]=!0),!0},deleteProperty:function(t,e){return void 0!==kn(t.t,e)||e in t.t?(t.R[e]=!1,Fn(t),Bn(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=gn(t),r=Reflect.getOwnPropertyDescriptor(o,e);return r?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:r.enumerable,value:o[e]}:r},defineProperty:function(){an(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){an(12)}},Qn={};ln(Xn,(function(t,e){Qn[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),Qn.deleteProperty=function(t,e){return Qn.set.call(this,t,e,void 0)},Qn.set=function(t,e,o){return Xn.set.call(this,t[0],e,o,t[0])};var ta=function(){function t(t){var e=this;this.O=Hn,this.D=!0,this.produce=function(t,o,r){if("function"==typeof t&&"function"!=typeof o){var i=o;o=t;var n=e;return function(t){var e=this;void 0===t&&(t=i);for(var r=arguments.length,a=Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return n.produce(t,(function(t){var r;return(r=o).call.apply(r,[e,t].concat(a))}))}}var a;if("function"!=typeof o&&an(6),void 0!==r&&"function"!=typeof r&&an(7),cn(t)){var s=En(e),c=_n(e,t,void 0),l=!0;try{a=o(c),l=!1}finally{l?Cn(s):Nn(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return xn(s,r),In(t,s)}),(function(t){throw Cn(s),t})):(xn(s,r),In(a,s))}if(!t||"object"!=typeof t){if(void 0===(a=o(t))&&(a=t),a===Tn&&(a=void 0),e.D&&mn(a,!0),r){var f=[],u=[];Sn("Patches").M(t,a,f,u),r(f,u)}return a}an(21,t)},this.produceWithPatches=function(t,o){if("function"==typeof t)return function(o){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return e.produceWithPatches(o,(function(e){return t.apply(void 0,[e].concat(i))}))};var r,i,n=e.produce(t,o,(function(t,e){r=t,i=e}));return"undefined"!=typeof Promise&&n instanceof Promise?n.then((function(t){return[t,r,i]})):[n,r,i]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){cn(t)||an(8),sn(t)&&(t=Pn(t));var e=En(this),o=_n(this,t,void 0);return o[Gn].C=!0,Nn(e),o},e.finishDraft=function(t,e){var o=(t&&t[Gn]).A;return xn(o,e),In(void 0,o)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!Hn&&an(20),this.O=t},e.applyPatches=function(t,e){var o;for(o=e.length-1;o>=0;o--){var r=e[o];if(0===r.path.length&&"replace"===r.op){t=r.value;break}}o>-1&&(e=e.slice(o+1));var i=Sn("Patches").$;return sn(t)?i(t,e):this.produce(t,(function(t){return i(t,e)}))},t}(),ea=new ta,oa=ea.produce;function ra(t){return ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ra(t)}function ia(t){var e=function(t,e){if("object"!==ra(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,e||"default");if("object"!==ra(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ra(e)?e:String(e)}function na(t,e,o){return(e=ia(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function aa(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,r)}return o}function sa(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?aa(Object(o),!0).forEach((function(e){na(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):aa(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function ca(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}ea.produceWithPatches.bind(ea),ea.setAutoFreeze.bind(ea),ea.setUseProxies.bind(ea),ea.applyPatches.bind(ea),ea.createDraft.bind(ea),ea.finishDraft.bind(ea);var la="function"==typeof Symbol&&Symbol.observable||"@@observable",fa=function(){return Math.random().toString(36).substring(7).split("").join(".")},ua={INIT:"@@redux/INIT"+fa(),REPLACE:"@@redux/REPLACE"+fa(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+fa()}};function ha(t,e,o){var r;if("function"==typeof e&&"function"==typeof o||"function"==typeof o&&"function"==typeof arguments[3])throw new Error(ca(0));if("function"==typeof e&&void 0===o&&(o=e,e=void 0),void 0!==o){if("function"!=typeof o)throw new Error(ca(1));return o(ha)(t,e)}if("function"!=typeof t)throw new Error(ca(2));var i=t,n=e,a=[],s=a,c=!1;function l(){s===a&&(s=a.slice())}function f(){if(c)throw new Error(ca(3));return n}function u(t){if("function"!=typeof t)throw new Error(ca(4));if(c)throw new Error(ca(5));var e=!0;return l(),s.push(t),function(){if(e){if(c)throw new Error(ca(6));e=!1,l();var o=s.indexOf(t);s.splice(o,1),a=null}}}function h(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error(ca(7));if(void 0===t.type)throw new Error(ca(8));if(c)throw new Error(ca(9));try{c=!0,n=i(n,t)}finally{c=!1}for(var e=a=s,o=0;o<e.length;o++){(0,e[o])()}return t}return h({type:ua.INIT}),(r={dispatch:h,subscribe:u,getState:f,replaceReducer:function(t){if("function"!=typeof t)throw new Error(ca(10));i=t,h({type:ua.REPLACE})}})[la]=function(){var t,e=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(ca(11));function o(){t.next&&t.next(f())}return o(),{unsubscribe:e(o)}}})[la]=function(){return this},t},r}function da(t){for(var e=Object.keys(t),o={},r=0;r<e.length;r++){var i=e[r];"function"==typeof t[i]&&(o[i]=t[i])}var n,a=Object.keys(o);try{!function(t){Object.keys(t).forEach((function(e){var o=t[e];if(void 0===o(void 0,{type:ua.INIT}))throw new Error(ca(12));if(void 0===o(void 0,{type:ua.PROBE_UNKNOWN_ACTION()}))throw new Error(ca(13))}))}(o)}catch(t){n=t}return function(t,e){if(void 0===t&&(t={}),n)throw n;for(var r=!1,i={},s=0;s<a.length;s++){var c=a[s],l=o[c],f=t[c],u=l(f,e);if(void 0===u)throw e&&e.type,new Error(ca(14));i[c]=u,r=r||u!==f}return(r=r||a.length!==Object.keys(t).length)?i:t}}function pa(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function ya(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(t){return function(){var o=t.apply(void 0,arguments),r=function(){throw new Error(ca(15))},i={getState:o.getState,dispatch:function(){return r.apply(void 0,arguments)}},n=e.map((function(t){return t(i)}));return r=pa.apply(void 0,n)(o.dispatch),sa(sa({},o),{},{dispatch:r})}}}function ga(t){return function(e){var o=e.dispatch,r=e.getState;return function(e){return function(i){return"function"==typeof i?i(o,r,t):e(i)}}}}var ba=ga();ba.withExtraArgument=ga;var ma,va=ba,Oa=(ma=function(t,e){return ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},ma(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ma(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Sa=function(t,e){var o,r,i,n,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return n={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(n){return function(s){return function(n){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,r&&(i=2&n[0]?r.return:n[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,n[1])).done)return i;switch(r=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,r=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){a.label=n[1];break}if(6===n[0]&&a.label<i[1]){a.label=i[1],i=n;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(n);break}i[2]&&a.ops.pop(),a.trys.pop();continue}n=e.call(t,a)}catch(t){n=[6,t],r=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}},wa=function(t,e){for(var o=0,r=e.length,i=t.length;o<r;o++,i++)t[i]=e[o];return t},xa=Object.defineProperty,Ca=Object.defineProperties,Na=Object.getOwnPropertyDescriptors,Ea=Object.getOwnPropertySymbols,Ra=Object.prototype.hasOwnProperty,Ia=Object.prototype.propertyIsEnumerable,La=function(t,e,o){return e in t?xa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Ua=function(t,e){for(var o in e||(e={}))Ra.call(e,o)&&La(t,o,e[o]);if(Ea)for(var r=0,i=Ea(e);r<i.length;r++){o=i[r];Ia.call(e,o)&&La(t,o,e[o])}return t},Wa=function(t,e){return Ca(t,Na(e))},ka="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?pa:pa.apply(null,arguments)};var Aa=function(t){function e(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}return Oa(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,wa([void 0],t[0].concat(this)))):new(e.bind.apply(e,wa([void 0],t.concat(this))))},e}(Array),Ba=function(t){function e(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}return Oa(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,wa([void 0],t[0].concat(this)))):new(e.bind.apply(e,wa([void 0],t.concat(this))))},e}(Array);function Fa(t){return cn(t)?oa(t,(function(){})):t}function _a(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,o=void 0===e||e;t.immutableCheck,t.serializableCheck;var r=new Aa;o&&(!function(t){return"boolean"==typeof t}(o)?r.push(va.withExtraArgument(o.extraArgument)):r.push(va));return r}(t)}}function Pa(t){var e,o=_a(),r=t||{},i=r.reducer,n=void 0===i?void 0:i,a=r.middleware,s=void 0===a?o():a,c=r.devTools,l=void 0===c||c,f=r.preloadedState,u=void 0===f?void 0:f,h=r.enhancers,d=void 0===h?void 0:h;if("function"==typeof n)e=n;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var o=e;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return e===o}(n))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=da(n)}var p=s;"function"==typeof p&&(p=p(o));var y=ya.apply(void 0,p),g=pa;l&&(g=ka(Ua({trace:!1},"object"==typeof l&&l)));var b=new Ba(y),m=b;return Array.isArray(d)?m=wa([y],d):"function"==typeof d&&(m=d(b)),ha(e,u,g.apply(void 0,m))}function za(t,e){function o(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];if(e){var i=e.apply(void 0,o);if(!i)throw new Error("prepareAction did not return an object");return Ua(Ua({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:o[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(e){return e.type===t},o}function Da(t){var e,o={},r=[],i={addCase:function(t,e){var r="string"==typeof t?t:t.type;if(r in o)throw new Error("addCase cannot be called with two reducers for the same action type");return o[r]=e,i},addMatcher:function(t,e){return r.push({matcher:t,reducer:e}),i},addDefaultCase:function(t){return e=t,i}};return t(i),[o,r,e]}function Ma(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var o,r="function"==typeof t.initialState?t.initialState:Fa(t.initialState),i=t.reducers||{},n=Object.keys(i),a={},s={},c={};function l(){var e="function"==typeof t.extraReducers?Da(t.extraReducers):[t.extraReducers],o=e[0],i=void 0===o?{}:o,n=e[1],a=void 0===n?[]:n,c=e[2],l=void 0===c?void 0:c,f=Ua(Ua({},i),s);return function(t,e,o,r){void 0===o&&(o=[]);var i,n="function"==typeof e?Da(e):[e,o,r],a=n[0],s=n[1],c=n[2];if(function(t){return"function"==typeof t}(t))i=function(){return Fa(t())};else{var l=Fa(t);i=function(){return l}}function f(t,e){void 0===t&&(t=i());var o=wa([a[e.type]],s.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===o.filter((function(t){return!!t})).length&&(o=[c]),o.reduce((function(t,o){if(o){var r;if(sn(t))return void 0===(r=o(t,e))?t:r;if(cn(t))return oa(t,(function(t){return o(t,e)}));if(void 0===(r=o(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return t}),t)}return f.getInitialState=i,f}(r,(function(t){for(var e in f)t.addCase(e,f[e]);for(var o=0,r=a;o<r.length;o++){var i=r[o];t.addMatcher(i.matcher,i.reducer)}l&&t.addDefaultCase(l)}))}return n.forEach((function(t){var o,r,n=i[t],l=e+"/"+t;"reducer"in n?(o=n.reducer,r=n.prepare):o=n,a[t]=o,s[l]=o,c[t]=r?za(l,r):za(l)})),{name:e,reducer:function(t,e){return o||(o=l()),o(t,e)},actions:c,caseReducers:a,getInitialState:function(){return o||(o=l()),o.getInitialState()}}}var ja=["name","message","stack","code"],Ka=function(t,e){this.payload=t,this.meta=e},Za=function(t,e){this.payload=t,this.meta=e},Ha=function(t){if("object"==typeof t&&null!==t){for(var e={},o=0,r=ja;o<r.length;o++){var i=r[o];"string"==typeof t[i]&&(e[i]=t[i])}return e}return{message:String(t)}};function Ta(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}!function(){function t(t,e,o){var r=za(t+"/fulfilled",(function(t,e,o,r){return{payload:t,meta:Wa(Ua({},r||{}),{arg:o,requestId:e,requestStatus:"fulfilled"})}})),i=za(t+"/pending",(function(t,e,o){return{payload:void 0,meta:Wa(Ua({},o||{}),{arg:e,requestId:t,requestStatus:"pending"})}})),n=za(t+"/rejected",(function(t,e,r,i,n){return{payload:i,error:(o&&o.serializeError||Ha)(t||"Rejected"),meta:Wa(Ua({},n||{}),{arg:r,requestId:e,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(s,c,l){var f,u=(null==o?void 0:o.idGenerator)?o.idGenerator(t):function(t){void 0===t&&(t=21);for(var e="",o=t;o--;)e+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return e}(),h=new a;function d(t){f=t,h.abort()}var p=function(){return a=this,p=null,y=function(){var a,p,y,g,b,m;return Sa(this,(function(v){switch(v.label){case 0:return v.trys.push([0,4,,5]),g=null==(a=null==o?void 0:o.condition)?void 0:a.call(o,t,{getState:c,extra:l}),null===(O=g)||"object"!=typeof O||"function"!=typeof O.then?[3,2]:[4,g];case 1:g=v.sent(),v.label=2;case 2:if(!1===g||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(t,e){return h.signal.addEventListener("abort",(function(){return e({name:"AbortError",message:f||"Aborted"})}))})),s(i(u,t,null==(p=null==o?void 0:o.getPendingMeta)?void 0:p.call(o,{requestId:u,arg:t},{getState:c,extra:l}))),[4,Promise.race([b,Promise.resolve(e(t,{dispatch:s,getState:c,extra:l,requestId:u,signal:h.signal,abort:d,rejectWithValue:function(t,e){return new Ka(t,e)},fulfillWithValue:function(t,e){return new Za(t,e)}})).then((function(e){if(e instanceof Ka)throw e;return e instanceof Za?r(e.payload,u,t,e.meta):r(e,u,t)}))])];case 3:return y=v.sent(),[3,5];case 4:return m=v.sent(),y=m instanceof Ka?n(null,u,t,m.payload,m.meta):n(m,u,t),[3,5];case 5:return o&&!o.dispatchConditionRejection&&n.match(y)&&y.meta.condition||s(y),[2,y]}var O}))},new Promise((function(t,e){var o=function(t){try{i(y.next(t))}catch(t){e(t)}},r=function(t){try{i(y.throw(t))}catch(t){e(t)}},i=function(e){return e.done?t(e.value):Promise.resolve(e.value).then(o,r)};i((y=y.apply(a,p)).next())}));var a,p,y}();return Object.assign(p,{abort:d,requestId:u,arg:t,unwrap:function(){return p.then(Ta)}})}}),{pending:i,rejected:n,fulfilled:r,typePrefix:t})}t.withTypes=function(){return t}}();var $a="listenerMiddleware";za($a+"/add"),za($a+"/removeAll"),za($a+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function t(t,e){var o=i[t];return o?o.enumerable=e:i[t]=o={configurable:!0,enumerable:e,get:function(){var e=this[Gn];return Xn.get(e,t)},set:function(e){var o=this[Gn];Xn.set(o,t,e)}},o}function e(t){for(var e=t.length-1;e>=0;e--){var i=t[e][Gn];if(!i.P)switch(i.i){case 5:r(i)&&Bn(i);break;case 4:o(i)&&Bn(i)}}}function o(t){for(var e=t.t,o=t.k,r=qn(o),i=r.length-1;i>=0;i--){var n=r[i];if(n!==Gn){var a=e[n];if(void 0===a&&!un(e,n))return!0;var s=o[n],c=s&&s[Gn];if(c?c.t!==a:!dn(s,a))return!0}}var l=!!e[Gn];return r.length!==qn(e).length+(l?0:1)}function r(t){var e=t.k;if(e.length!==t.t.length)return!0;var o=Object.getOwnPropertyDescriptor(e,e.length-1);if(o&&!o.get)return!0;for(var r=0;r<e.length;r++)if(!e.hasOwnProperty(r))return!0;return!1}var i={};!function(t,e){Jn[t]||(Jn[t]=e)}("ES5",{J:function(e,o){var r=Array.isArray(e),i=function(e,o){if(e){for(var r=Array(o.length),i=0;i<o.length;i++)Object.defineProperty(r,""+i,t(i,!0));return r}var n=Yn(o);delete n[Gn];for(var a=qn(n),s=0;s<a.length;s++){var c=a[s];n[c]=t(c,e||!!n[c].enumerable)}return Object.create(Object.getPrototypeOf(o),n)}(r,e),n={i:r?5:4,A:o?o.A:wn(),P:!1,I:!1,R:{},l:o,t:e,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Gn,{value:n,writable:!0}),i},S:function(t,o,i){i?sn(o)&&o[Gn].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var o=e[Gn];if(o){var i=o.t,n=o.k,a=o.R,s=o.i;if(4===s)ln(n,(function(e){e!==Gn&&(void 0!==i[e]||un(i,e)?a[e]||t(n[e]):(a[e]=!0,Bn(o)))})),ln(i,(function(t){void 0!==n[t]||un(n,t)||(a[t]=!1,Bn(o))}));else if(5===s){if(r(o)&&(Bn(o),a.length=!0),n.length<i.length)for(var c=n.length;c<i.length;c++)a[c]=!1;else for(var l=i.length;l<n.length;l++)a[l]=!0;for(var f=Math.min(n.length,i.length),u=0;u<f;u++)n.hasOwnProperty(u)||(a[u]=!0),void 0===a[u]&&t(n[u])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?o(t):r(t)}})}(),window.ftReduxStores||(window.ftReduxStores={});class Ga{static get(t){var e;const o="string"==typeof t?t:t.name,r="string"==typeof t?void 0:t,i=window.ftReduxStores[o];if(Ji(i))return i;if(null==r)return;const n=Ma({...r,reducers:null!==(e=r.reducers)&&void 0!==e?e:{}}),a=Pa({reducer:(t,e)=>"CLEAR_FT_REDUX_STORE"===e.type?n.getInitialState():"string"==typeof e.type&&e.type.startsWith("DEFAULT_VALUE_SETTER__")?{...t,...e.overwrites}:n.reducer(t,e)});return window.ftReduxStores[r.name]=new Ga(n,a)}constructor(t,e){this.reduxSlice=t,this.reduxStore=e,this.isFtReduxStore=!0,this.eventBus=document.createElement("event-bus"),this.commands=new Yi,this.actions=new Proxy(this.reduxSlice.actions,{get:(t,e,o)=>{const r=e,i=t[r];return i?(...t)=>{const e=i(...t);return this.reduxStore.dispatch(e),e}:t=>{this.setState({[r]:t})}}})}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}}var Va=Object.freeze({__proto__:null,FtCommandQueue:Yi,FtLitElementRedux:nn,FtReduxStore:Ga,clearAllStores:function(){var t;for(let e of Object.values(null!==(t=window.ftReduxStores)&&void 0!==t?t:{}))Ji(e)&&e.clear()},isFtReduxStore:Ji,redux:qi,reduxEventListener:t=>(e,o)=>{const r=e.constructor;r.reduxEventListeners=new Map(r.reduxEventListeners),r.reduxEventListeners.set(o,t)},reduxReactive:()=>(t,e)=>{var o;const r=t.constructor;r.reduxReactiveProperties=new Set(r.reduxReactiveProperties),null===(o=r.reduxReactiveProperties)||void 0===o||o.add(e)}});var qa=Object.freeze({__proto__:null,serializeRequest:function(t,e){var o,r,i,n;const a=new URLSearchParams({"content-lang":null!==(o=e.contentLocale)&&void 0!==o?o:"all"});if((null===(r=e.query)||void 0===r?void 0:r.length)>0&&a.append("query",e.query),e.scope&&"DEFAULT"!==e.scope&&a.append("scope",e.scope.toLowerCase()),e.virtualField&&a.append("virtual-field",e.virtualField.toLowerCase()),e.periodFilter){let t=e.periodFilter.period;const o=t?`_${t.from}_${t.to}`:"";a.append("period",e.periodFilter.periodType.toLowerCase()+o)}if((null===(i=e.sort)||void 0===i?void 0:i.length)>0&&"ft:lastEdition"===e.sort[0].key&&a.append("sort","last_update"),(null===(n=e.filters)||void 0===n?void 0:n.length)>0){const t=e.filters.map((t=>{const e=t.values.map((t=>t.replace(/_/g,"\\\\\\\\_").replace(/~/g,"\\\\~").replace(/\*/g,"\\*"))).map((t=>encodeURIComponent(function(t){return`"${t}"`}(t)))).join("_");return`${t.key}~${e}`})).join("*");a.append("filters",t)}return new URL(`${t.replace(/\/+$/,"")}/search?${a.toString()}`).href}});const Ya=Symbol("elementInternals");var Ja,Xa,Qa,ts,es=Object.freeze({__proto__:null,toFtFormComponent:function(t,e){return class extends t{static get formAssociated(){return!0}get form(){return this[Ya].form}constructor(...t){super(t),this[Ya]=this.attachInternals(),this[Ya].role=e}setFormValue(t){this[Ya].setFormValue(t)}}}});const os=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(Qa=null===(Xa=null===(Ja=window.safari)||void 0===Ja?void 0:Ja.pushNotification)||void 0===Xa?void 0:Xa.toString())&&void 0!==Qa?Qa:""),rs="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=null!==(ts=window.ftGlobals)&&void 0!==ts?ts:{lit:me,litDecorators:Ne,litRepeat:ze,litClassMap:Me,litStyleMap:He,litUnsafeHTML:Ge,wcUtils:{...Qe,...Je,...eo,...ro,...ho,...br,...Sr,...xi,...yr,...Bi,...Fi,...co,...ji,...Ti,...$i,...Vi,...Va,...Ii,...qa,...es,isSafari:os,isTouchScreen:rs}};const is=ut`
|
|
178
|
-
`,ns={setRequest:(t,e)=>{t.request=e.payload},setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{t.request.paging.perPage=e.payload},setPageNumber:(t,e)=>{t.request.paging.page=e.payload},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.filters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setRequestVirtualField:(t,e)=>{t.request.virtualField=e.payload},setRequestScope:(t,e)=>{t.request.scope=e.payload},setResults:(t,e)=>{t.results=e.payload},setFacets:(t,e)=>{t.facets=e.payload},setSpellcheck:(t,e)=>{t.spellcheck=e.payload},setLocales:(t,e)=>{t.locales=e.payload},setPaging:(t,e)=>{t.paging=e.payload},setLiveQuery:(t,e)=>{t.liveQuery=e.payload},setSuggestResults:(t,e)=>{t.suggestResults=e.payload}};var as,ss,cs,ls,fs,us,hs,ds,ps,ys,gs,bs,ms,vs,Os,Ss,ws,xs;!function(t){!function(e){var o={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(o.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(t){return t&&r.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function l(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,o){t.onload=function(){e(t.result)},t.onerror=function(){o(t.error)}}))}function u(t){var e=new FileReader,o=f(e);return e.readAsArrayBuffer(t),o}function h(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=h(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=l(this);if(t)return t;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?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,o=f(e);return e.readAsText(t),o}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),o=new Array(e.length),r=0;r<e.length;r++)o[r]=String.fromCharCode(e[r]);return o.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(t,e){t=n(t),e=a(e);var o=this.map[t];this.map[t]=o?o+", "+e:e},c.prototype.delete=function(t){delete this.map[n(t)]},c.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},c.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},c.prototype.set=function(t,e){this.map[n(t)]=a(e)},c.prototype.forEach=function(t,e){for(var o in this.map)this.map.hasOwnProperty(o)&&t.call(e,this.map[o],o,this)},c.prototype.keys=function(){var t=[];return this.forEach((function(e,o){t.push(o)})),s(t)},c.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},c.prototype.entries=function(){var t=[];return this.forEach((function(e,o){t.push([o,e])})),s(t)},o.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,e){var o,r,i=(e=e||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new c(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new c(e.headers)),this.method=(o=e.method||this.method||"GET",r=o.toUpperCase(),p.indexOf(r)>-1?r:o),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function g(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var o=t.split("="),r=o.shift().replace(/\+/g," "),i=o.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},d.call(y.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var o=Error(t);this.stack=o.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(t,r){return new Promise((function(i,n){var a=new y(t,r);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var o=t.split(":"),r=o.shift().trim();if(r){var i=o.join(":").trim();e.append(r,i)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var r="response"in s?s.response:s.responseText;i(new b(r,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=c,t.Request=y,t.Response=b),e.Headers=c,e.Request=y,e.Response=b,e.fetch=v,Object.defineProperty(e,"W",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(as||(as={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(ss||(ss={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(cs||(cs={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(ls||(ls={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(fs||(fs={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(us||(us={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(hs||(hs={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(ds||(ds={})),function(t){t.ASC="ASC",t.DESC="DESC"}(ps||(ps={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(ys||(ys={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(gs||(gs={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(bs||(bs={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(ms||(ms={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(vs||(vs={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Os||(Os={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(Ss||(Ss={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(ws||(ws={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(xs||(xs={})),ws.PERSONAL_BOOK_SHARE_USER,ws.PERSONAL_BOOK_USER,ws.HTML_EXPORT_USER,ws.PERSONAL_BOOK_USER,ws.PDF_EXPORT_USER,ws.PERSONAL_BOOK_USER,ws.KHUB_ADMIN,ws.CONTENT_PUBLISHER,ws.ADMIN,ws.KHUB_ADMIN,ws.USERS_ADMIN,ws.PORTAL_ADMIN,ws.DEVELOPER,ws.BETA_USER,ws.DEBUG_USER;const Cs=ut`
|
|
178
|
+
`,ns={setRequest:(t,e)=>{t.request=e.payload},setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{t.request.paging.perPage=e.payload},setPageNumber:(t,e)=>{t.request.paging.page=e.payload},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.filters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setRequestVirtualField:(t,e)=>{t.request.virtualField=e.payload},setRequestScope:(t,e)=>{t.request.scope=e.payload},setResults:(t,e)=>{t.results=e.payload},setFacets:(t,e)=>{t.facets=e.payload},setSpellcheck:(t,e)=>{t.spellcheck=e.payload},setLocales:(t,e)=>{t.locales=e.payload},setPaging:(t,e)=>{t.paging=e.payload},setLiveQuery:(t,e)=>{t.liveQuery=e.payload},setSuggestResults:(t,e)=>{t.suggestResults=e.payload},setRequestPeriodFilter:(t,e)=>{t.request.periodFilter=e.payload}};var as,ss,cs,ls,fs,us,hs,ds,ps,ys,gs,bs,ms,vs,Os,Ss,ws,xs;!function(t){!function(e){var o={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(o.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(t){return t&&r.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function l(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,o){t.onload=function(){e(t.result)},t.onerror=function(){o(t.error)}}))}function u(t){var e=new FileReader,o=f(e);return e.readAsArrayBuffer(t),o}function h(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=h(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=l(this);if(t)return t;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?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,o=f(e);return e.readAsText(t),o}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),o=new Array(e.length),r=0;r<e.length;r++)o[r]=String.fromCharCode(e[r]);return o.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(t,e){t=n(t),e=a(e);var o=this.map[t];this.map[t]=o?o+", "+e:e},c.prototype.delete=function(t){delete this.map[n(t)]},c.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},c.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},c.prototype.set=function(t,e){this.map[n(t)]=a(e)},c.prototype.forEach=function(t,e){for(var o in this.map)this.map.hasOwnProperty(o)&&t.call(e,this.map[o],o,this)},c.prototype.keys=function(){var t=[];return this.forEach((function(e,o){t.push(o)})),s(t)},c.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},c.prototype.entries=function(){var t=[];return this.forEach((function(e,o){t.push([o,e])})),s(t)},o.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,e){var o,r,i=(e=e||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new c(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new c(e.headers)),this.method=(o=e.method||this.method||"GET",r=o.toUpperCase(),p.indexOf(r)>-1?r:o),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function g(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var o=t.split("="),r=o.shift().replace(/\+/g," "),i=o.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},d.call(y.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var o=Error(t);this.stack=o.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(t,r){return new Promise((function(i,n){var a=new y(t,r);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var o=t.split(":"),r=o.shift().trim();if(r){var i=o.join(":").trim();e.append(r,i)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var r="response"in s?s.response:s.responseText;i(new b(r,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=c,t.Request=y,t.Response=b),e.Headers=c,e.Request=y,e.Response=b,e.fetch=v,Object.defineProperty(e,"W",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(as||(as={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(ss||(ss={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(cs||(cs={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(ls||(ls={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(fs||(fs={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(us||(us={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(hs||(hs={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(ds||(ds={})),function(t){t.ASC="ASC",t.DESC="DESC"}(ps||(ps={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(ys||(ys={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(gs||(gs={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(bs||(bs={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(ms||(ms={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(vs||(vs={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Os||(Os={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(Ss||(Ss={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(ws||(ws={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(xs||(xs={})),ws.PERSONAL_BOOK_SHARE_USER,ws.PERSONAL_BOOK_USER,ws.HTML_EXPORT_USER,ws.PERSONAL_BOOK_USER,ws.PDF_EXPORT_USER,ws.PERSONAL_BOOK_USER,ws.KHUB_ADMIN,ws.CONTENT_PUBLISHER,ws.ADMIN,ws.KHUB_ADMIN,ws.USERS_ADMIN,ws.PORTAL_ADMIN,ws.DEVELOPER,ws.BETA_USER,ws.DEBUG_USER;const Cs=ut`
|
|
179
179
|
`,Ns=Ga.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1}});class Es{static get(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Ns.getState(),r=null!=t?t:o;if(e&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,r,!0)}static await(t){return new Promise((e=>{let o=Es.get(t);if(o)e(o);else{const r=Ns.subscribe((()=>{o=Es.get(t),o&&(r(),e(o))}))}}))}}class Rs{constructor(t=!0,e){var o;this.overrideApi=e;let r=this.constructor;r.commonCache=null!==(o=r.commonCache)&&void 0!==o?o:new Xe,this.cache=t?r.commonCache:new Xe}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Es.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Es.await()}clearCache(){this.cache.clearAll()}}var Is;const Ls=Symbol("clearAfterUnitTest");class Us extends Rs{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Is]=()=>{this.defaultMessages={},this.cache=new Xe,this.listeners={}},this.currentUiLocale=Ns.getState().uiLocale,Ns.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Ns.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var o;if(t=t.toLowerCase(),Object.keys(e).length>0){const r={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};so(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var r,i,n;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(i=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==i?i:{};return new Gi(null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},a).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>io(0).then((()=>t())).catch((()=>null)))))}}Is=Ls,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Us{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Us{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Ws=window.FluidTopicsI18nService;var ks=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class As extends Ai{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Es.get(),this.cache=new Xe,this.cleanSessionDebouncer=new oo}render(){return Yt`
|
|
180
180
|
<slot></slot>
|
|
181
|
-
`}update(t){super.update(t),t.has("baseUrl")&&(Ns.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Ns.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ns.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Ns.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Ns.actions.noCustom(this.noCustom),t.has("editorMode")&&Ns.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Ns.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Ns.actions.session(this.session),t.has("availableUiLocales")&&Ns.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Ws.addContext(t))),t.has("openExternalDocumentInNewTab")&&Ns.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}As.elementDefinitions={},As.styles=Cs,ks([Se()],As.prototype,"baseUrl",void 0),ks([Se()],As.prototype,"apiIntegrationIdentifier",void 0),ks([Se()],As.prototype,"uiLocale",void 0),ks([fo(null)],As.prototype,"availableUiLocales",void 0),ks([fo(null)],As.prototype,"metadataConfiguration",void 0),ks([Se({type:Boolean})],As.prototype,"editorMode",void 0),ks([Se({type:Boolean})],As.prototype,"noCustom",void 0),ks([Se({type:Boolean})],As.prototype,"openExternalDocumentInNewTab",void 0),ks([Se({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],As.prototype,"noCustomComponent",void 0),ks([Se({type:Boolean})],As.prototype,"withManualResources",void 0),ks([fo([])],As.prototype,"messageContexts",void 0),ks([fo(void 0)],As.prototype,"session",void 0),ks([Se({type:Object})],As.prototype,"apiProvider",void 0);class Bs extends Rs{async listMySearches(){let t=Ns.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class Fs extends Rs{async listMyBookmarks(){let t=Ns.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const _s=Ga.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Ps=new class{constructor(){this.currentSession=Ns.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Fs,this.savedSearchesService=new Bs,Ns.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Ns.getState();so(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),_s.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),_s.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();_s.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;_s.actions.bookmarks(e)}}};lo("ft-app-context")(As);class zs extends Rs{constructor(){super(),this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}}const Ds=t=>t.request.virtualField===gs.TITLE_ONLY&&t.request.scope===Ss.DOCUMENTS;class Ms extends Event{constructor(){super(Ms.eventName)}}Ms.eventName="search-context-clear-all-filters";class js{static build(t,e){return new js((t=>Ga.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:ns}))(t.trim()||"context"),e)}constructor(t,e){this.store=t,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.searchDebouncer=new oo(100),this.suggestDebouncer=new oo(300),this.service=null!=e?e:new zs}async initService(){return this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let e=this.store.getState().locales,o=this.store.getState().request.contentLocale;if(t!=o){if(e){const r=t=>e.some((e=>e.lang==t));r(t)||(t=r(o)?o:e[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([]),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){const e=t.filter((t=>t.values.length>0));this.store.actions.setRequestFilters(e),this.store.actions.setPageNumber(1),e.forEach((t=>{this.facetIds.includes(t.key)||(this.facetIds=[...this.facetIds,t.key])})),this.launchSearch()}setSearchInDocumentTitlesOnly(t){t?(this.store.actions.setRequestVirtualField(gs.TITLE_ONLY),this.store.actions.setRequestScope(Ss.DOCUMENTS)):(this.store.actions.setRequestVirtualField(gs.EVERYWHERE),this.store.actions.setRequestScope(Ss.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return Ds(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new Ms)}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,e){let o=this.facetIds.filter((e=>e!=t));e&&o.push(e),this.facetIds=o,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let e=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(e)}setFilter(t,e){let o=this.store.getState().request.filters,r={key:t,values:e,negative:!1},i=[...o.filter((e=>e.key!==t)),r];this.setFilters(i)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}setRequest(t){this.store.actions.setRequest(t),this.store.actions.setLiveQuery(t.query),this.store.actions.setPageNumber(1),this.launchSearch()}setScope(t){this.store.actions.setRequestScope(t),this.launchSearch()}setIgnoreEmptyQuery(t){this.ignoreEmptyQuery=t,this.launchSearch()}setOpenExternalDocumentInNewTab(t){this.openExternalDocumentInNewTab=t}launchSearch(){return this.searchDebouncer.run((()=>this.fetchSearchData()))}launchSuggest(){return this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t,e;try{null===(t=this.cancelableSearch)||void 0===t||t.cancel();let o=this.store.getState().request;if(this.store.actions.setPaging(void 0),this.ignoreEmptyQuery&&0==o.query.length)this.store.actions.setResults(void 0),this.store.actions.setFacets(void 0),this.store.actions.setSpellcheck(void 0);else{this.cancelableSearch=Ye(this.service.launchSearch(o));const t=await this.cancelableSearch;if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setSpellcheck(t.spellcheck);else{let o=(null!==(e=this.store.getState().results)&&void 0!==e?e:[]).concat(t.results);this.store.actions.setResults(o)}this.store.actions.setPaging(t.paging)}}catch(t){t instanceof Ve||!this.errorHandler||this.errorHandler(t)}}async fetchSuggestData(){var t;try{const e=this.store.getState(),o=e.request,r={input:e.liveQuery,filters:o.filters,sort:o.sort,contentLocale:o.contentLocale,scope:o.scope};null===(t=this.cancelableSuggest)||void 0===t||t.cancel(),this.cancelableSuggest=Ye(this.service.launchSuggest(r));let i=await this.cancelableSuggest;this.store.actions.setSuggestResults(i.suggestions)}catch(t){t instanceof Ve||!this.errorHandler||this.errorHandler(t)}}clear(){this.store.clear()}}var Ks=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Zs extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Hs=Symbol("registerInterval");class Ts extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Hs]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Hs]):this.dispatchEvent(new Zs)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=Hs,Ks([we()],o.prototype,"stateManager",void 0),o}(nn)){}var $s=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Gs extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class Vs extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class qs extends CustomEvent{constructor(t,e,o){super("ft-search-results-change",{detail:{request:t,paging:e,spellcheck:o}})}}class Ys extends nn{get stateManager(){if(null==this._stateManager){const t=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=js.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),t),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")}return this._stateManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.addStore(Ns)}render(){return Yt`
|
|
181
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(Ns.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Ns.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ns.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Ns.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Ns.actions.noCustom(this.noCustom),t.has("editorMode")&&Ns.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Ns.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Ns.actions.session(this.session),t.has("availableUiLocales")&&Ns.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Ws.addContext(t))),t.has("openExternalDocumentInNewTab")&&Ns.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}As.elementDefinitions={},As.styles=Cs,ks([Se()],As.prototype,"baseUrl",void 0),ks([Se()],As.prototype,"apiIntegrationIdentifier",void 0),ks([Se()],As.prototype,"uiLocale",void 0),ks([fo(null)],As.prototype,"availableUiLocales",void 0),ks([fo(null)],As.prototype,"metadataConfiguration",void 0),ks([Se({type:Boolean})],As.prototype,"editorMode",void 0),ks([Se({type:Boolean})],As.prototype,"noCustom",void 0),ks([Se({type:Boolean})],As.prototype,"openExternalDocumentInNewTab",void 0),ks([Se({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],As.prototype,"noCustomComponent",void 0),ks([Se({type:Boolean})],As.prototype,"withManualResources",void 0),ks([fo([])],As.prototype,"messageContexts",void 0),ks([fo(void 0)],As.prototype,"session",void 0),ks([Se({type:Object})],As.prototype,"apiProvider",void 0);class Bs extends Rs{async listMySearches(){let t=Ns.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class Fs extends Rs{async listMyBookmarks(){let t=Ns.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const _s=Ga.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Ps=new class{constructor(){this.currentSession=Ns.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Fs,this.savedSearchesService=new Bs,Ns.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Ns.getState();so(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),_s.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),_s.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();_s.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;_s.actions.bookmarks(e)}}};lo("ft-app-context")(As);class zs extends Rs{constructor(){super(),this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}}const Ds=t=>t.request.virtualField===gs.TITLE_ONLY&&t.request.scope===Ss.DOCUMENTS;class Ms extends Event{constructor(){super(Ms.eventName)}}Ms.eventName="search-context-clear-all-filters";class js{static build(t,e){return new js((t=>Ga.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:ns}))(t.trim()||"context"),e)}constructor(t,e){this.store=t,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.searchDebouncer=new oo(100),this.suggestDebouncer=new oo(300),this.service=null!=e?e:new zs}async initService(){return this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let e=this.store.getState().locales,o=this.store.getState().request.contentLocale;if(t!=o){if(e){const r=t=>e.some((e=>e.lang==t));r(t)||(t=r(o)?o:e[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([]),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){const e=t.filter((t=>t.values.length>0));this.store.actions.setRequestFilters(e),this.store.actions.setPageNumber(1),e.forEach((t=>{this.facetIds.includes(t.key)||(this.facetIds=[...this.facetIds,t.key])})),this.launchSearch()}setSearchInDocumentTitlesOnly(t){t?(this.store.actions.setRequestVirtualField(gs.TITLE_ONLY),this.store.actions.setRequestScope(Ss.DOCUMENTS)):(this.store.actions.setRequestVirtualField(gs.EVERYWHERE),this.store.actions.setRequestScope(Ss.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return Ds(this.store.getState())}get periodFilter(){return this.store.getState().request.periodFilter}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new Ms)}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,e){let o=this.facetIds.filter((e=>e!=t));e&&o.push(e),this.facetIds=o,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let e=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(e)}setFilter(t,e){let o=this.store.getState().request.filters,r={key:t,values:e,negative:!1},i=[...o.filter((e=>e.key!==t)),r];this.setFilters(i)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}setRequest(t){this.store.actions.setRequest(t),this.store.actions.setLiveQuery(t.query),this.store.actions.setPageNumber(1),this.launchSearch()}setScope(t){this.store.actions.setRequestScope(t),this.launchSearch()}setIgnoreEmptyQuery(t){this.ignoreEmptyQuery=t,this.launchSearch()}setOpenExternalDocumentInNewTab(t){this.openExternalDocumentInNewTab=t}setPeriodFilter(t){this.store.actions.setRequestPeriodFilter(t),this.store.actions.setPageNumber(1),this.launchSearch()}launchSearch(){return this.searchDebouncer.run((()=>this.fetchSearchData()))}launchSuggest(){return this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t,e;try{null===(t=this.cancelableSearch)||void 0===t||t.cancel();let o=this.store.getState().request;if(this.store.actions.setPaging(void 0),this.ignoreEmptyQuery&&0==o.query.length)this.store.actions.setResults(void 0),this.store.actions.setFacets(void 0),this.store.actions.setSpellcheck(void 0);else{this.cancelableSearch=Ye(this.service.launchSearch(o));const t=await this.cancelableSearch;if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setSpellcheck(t.spellcheck);else{let o=(null!==(e=this.store.getState().results)&&void 0!==e?e:[]).concat(t.results);this.store.actions.setResults(o)}this.store.actions.setPaging(t.paging)}}catch(t){t instanceof Ve||!this.errorHandler||this.errorHandler(t)}}async fetchSuggestData(){var t;try{const e=this.store.getState(),o=e.request,r={input:e.liveQuery,filters:o.filters,sort:o.sort,contentLocale:o.contentLocale,scope:o.scope};null===(t=this.cancelableSuggest)||void 0===t||t.cancel(),this.cancelableSuggest=Ye(this.service.launchSuggest(r));let i=await this.cancelableSuggest;this.store.actions.setSuggestResults(i.suggestions)}catch(t){t instanceof Ve||!this.errorHandler||this.errorHandler(t)}}clear(){this.store.clear()}}var Ks=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Zs extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Hs=Symbol("registerInterval");class Ts extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Hs]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Hs]):this.dispatchEvent(new Zs)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=Hs,Ks([we()],o.prototype,"stateManager",void 0),o}(nn)){}var $s=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Gs extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class Vs extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class qs extends CustomEvent{constructor(t,e,o){super("ft-search-results-change",{detail:{request:t,paging:e,spellcheck:o}})}}class Ys extends nn{get stateManager(){if(null==this._stateManager){const t=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=js.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),t),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")}return this._stateManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.addStore(Ns)}render(){return Yt`
|
|
182
182
|
<slot @register-ft-search-component=${this.registerComponent}></slot>
|
|
183
|
-
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new Vs(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new qs(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new Gs(t))}reloadSavedSearches(){Ps.clearMySearches()}clear(){this.stateManager.clear()}}Ys.elementDefinitions={},Ys.styles=is,$s([Se()],Ys.prototype,"query",void 0),$s([Se()],Ys.prototype,"contentLocale",void 0),$s([Se({type:Number})],Ys.prototype,"pageSize",void 0),$s([Se({type:Boolean})],Ys.prototype,"searchInDocumentTitlesOnly",void 0),$s([Se()],Ys.prototype,"scope",void 0),$s([Se({type:Boolean})],Ys.prototype,"ignoreEmptyQuery",void 0),$s([qi({store:Ns.name})],Ys.prototype,"openExternalDocumentInNewTab",void 0),$s([fo([])],Ys.prototype,"filters",void 0),$s([fo([])],Ys.prototype,"sort",void 0),$s([qi({store:"search"})],Ys.prototype,"request",void 0),$s([qi({store:"search"})],Ys.prototype,"paging",void 0),$s([qi({store:"search",selector:t=>t.spellcheck})],Ys.prototype,"autocorrect",void 0),$s([qi({store:Ns.name})],Ys.prototype,"session",void 0),$s([Se({attribute:!1})],Ys.prototype,"searchServiceProvider",void 0),lo("ft-search-context")(Ys),t.ClearAllFiltersEvent=Ms,t.FtSearchContext=Ys,t.FtSearchContextCssVariables={},t.FtSearchStateManager=js,t.LoadErrorEvent=Gs,t.SearchRequestChangeEvent=Vs,t.SearchResultsChangeEvent=qs,t.searchInDocumentTitlesOnlySelector=Ds,t.styles=is}({});
|
|
183
|
+
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("periodFilter")&&void 0!==this.periodFilter&&this.stateManager.setPeriodFilter(this.periodFilter)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new Vs(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new qs(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new Gs(t))}reloadSavedSearches(){Ps.clearMySearches()}clear(){this.stateManager.clear()}}Ys.elementDefinitions={},Ys.styles=is,$s([Se()],Ys.prototype,"query",void 0),$s([Se()],Ys.prototype,"contentLocale",void 0),$s([Se({type:Number})],Ys.prototype,"pageSize",void 0),$s([Se({type:Boolean})],Ys.prototype,"searchInDocumentTitlesOnly",void 0),$s([Se()],Ys.prototype,"periodFilter",void 0),$s([Se()],Ys.prototype,"scope",void 0),$s([Se({type:Boolean})],Ys.prototype,"ignoreEmptyQuery",void 0),$s([qi({store:Ns.name})],Ys.prototype,"openExternalDocumentInNewTab",void 0),$s([fo([])],Ys.prototype,"filters",void 0),$s([fo([])],Ys.prototype,"sort",void 0),$s([qi({store:"search"})],Ys.prototype,"request",void 0),$s([qi({store:"search"})],Ys.prototype,"paging",void 0),$s([qi({store:"search",selector:t=>t.spellcheck})],Ys.prototype,"autocorrect",void 0),$s([qi({store:Ns.name})],Ys.prototype,"session",void 0),$s([Se({attribute:!1})],Ys.prototype,"searchServiceProvider",void 0),lo("ft-search-context")(Ys),t.ClearAllFiltersEvent=Ms,t.FtSearchContext=Ys,t.FtSearchContextCssVariables={},t.FtSearchStateManager=js,t.LoadErrorEvent=Gs,t.SearchRequestChangeEvent=Vs,t.SearchResultsChangeEvent=qs,t.searchInDocumentTitlesOnlySelector=Ds,t.styles=is}({});
|
|
@@ -3,6 +3,7 @@ import { FtReduxStore } from "@fluid-topics/ft-wc-utils";
|
|
|
3
3
|
import { FtSearchPageStateReducers } from "./redux";
|
|
4
4
|
import { FtSearchFilter, FtSearchRequest, FtSearchScope, FtSearchSortCriterion } from "@fluid-topics/public-api";
|
|
5
5
|
import { FtSearchService } from "./utils/FtSearchService";
|
|
6
|
+
import { FtPeriodFilter } from "@fluid-topics/public-api/dist/mjs/types/ft-common/public";
|
|
6
7
|
export declare const searchInDocumentTitlesOnlySelector: (s: FtSearchPageState) => boolean;
|
|
7
8
|
export declare class ClearAllFiltersEvent extends Event {
|
|
8
9
|
static eventName: string;
|
|
@@ -25,6 +26,7 @@ export declare class FtSearchStateManager {
|
|
|
25
26
|
setFilters(filters: FtSearchFilter[]): void;
|
|
26
27
|
setSearchInDocumentTitlesOnly(searchInDocumentTitleOnly: boolean): void;
|
|
27
28
|
get searchInDocumentTitlesOnly(): boolean;
|
|
29
|
+
get periodFilter(): FtPeriodFilter | undefined;
|
|
28
30
|
clearAllFilters(): void;
|
|
29
31
|
addFacet(id: string): void;
|
|
30
32
|
replaceFacet(oldId: string, newId?: string): void;
|
|
@@ -36,6 +38,7 @@ export declare class FtSearchStateManager {
|
|
|
36
38
|
setScope(scope: FtSearchScope): void;
|
|
37
39
|
setIgnoreEmptyQuery(ignoreEmptyQuery: boolean): void;
|
|
38
40
|
setOpenExternalDocumentInNewTab(openExternalDocumentInNewTab: boolean): void;
|
|
41
|
+
setPeriodFilter(periodFilter?: FtPeriodFilter): void;
|
|
39
42
|
private searchDebouncer;
|
|
40
43
|
launchSearch(): Promise<boolean>;
|
|
41
44
|
private suggestDebouncer;
|
|
@@ -88,6 +88,9 @@ export class FtSearchStateManager {
|
|
|
88
88
|
get searchInDocumentTitlesOnly() {
|
|
89
89
|
return searchInDocumentTitlesOnlySelector(this.store.getState());
|
|
90
90
|
}
|
|
91
|
+
get periodFilter() {
|
|
92
|
+
return this.store.getState().request.periodFilter;
|
|
93
|
+
}
|
|
91
94
|
// Used in GWT
|
|
92
95
|
clearAllFilters() {
|
|
93
96
|
this.setFilters([]);
|
|
@@ -140,6 +143,11 @@ export class FtSearchStateManager {
|
|
|
140
143
|
setOpenExternalDocumentInNewTab(openExternalDocumentInNewTab) {
|
|
141
144
|
this.openExternalDocumentInNewTab = openExternalDocumentInNewTab;
|
|
142
145
|
}
|
|
146
|
+
setPeriodFilter(periodFilter) {
|
|
147
|
+
this.store.actions.setRequestPeriodFilter(periodFilter);
|
|
148
|
+
this.store.actions.setPageNumber(1);
|
|
149
|
+
this.launchSearch();
|
|
150
|
+
}
|
|
143
151
|
launchSearch() {
|
|
144
152
|
return this.searchDebouncer.run(() => this.fetchSearchData());
|
|
145
153
|
}
|
package/build/store/redux.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ declare const searchPageStateReducers: {
|
|
|
19
19
|
setPaging: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["paging"]>) => void;
|
|
20
20
|
setLiveQuery: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["liveQuery"]>) => void;
|
|
21
21
|
setSuggestResults: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["suggestResults"]>) => void;
|
|
22
|
+
setRequestPeriodFilter: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["periodFilter"]>) => void;
|
|
22
23
|
};
|
|
23
24
|
export type FtSearchPageStateReducers = typeof searchPageStateReducers;
|
|
24
25
|
export declare const createSearchPageStore: (id: string) => FtReduxStore<FtSearchPageState, {
|
|
@@ -39,5 +40,6 @@ export declare const createSearchPageStore: (id: string) => FtReduxStore<FtSearc
|
|
|
39
40
|
setPaging: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["paging"]>) => void;
|
|
40
41
|
setLiveQuery: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["liveQuery"]>) => void;
|
|
41
42
|
setSuggestResults: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["suggestResults"]>) => void;
|
|
43
|
+
setRequestPeriodFilter: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["periodFilter"]>) => void;
|
|
42
44
|
}, import("redux").AnyAction>;
|
|
43
45
|
export {};
|
package/build/store/redux.js
CHANGED
|
@@ -51,6 +51,9 @@ const searchPageStateReducers = {
|
|
|
51
51
|
setSuggestResults: (state, action) => {
|
|
52
52
|
state.suggestResults = action.payload;
|
|
53
53
|
},
|
|
54
|
+
setRequestPeriodFilter: (state, action) => {
|
|
55
|
+
state.request.periodFilter = action.payload;
|
|
56
|
+
},
|
|
54
57
|
};
|
|
55
58
|
export const createSearchPageStore = (id) => FtReduxStore.get({
|
|
56
59
|
name: "ft-search-" + id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-context",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.64",
|
|
4
4
|
"description": "Context block for integrated search components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-app-context": "1.1.
|
|
23
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-app-context": "1.1.64",
|
|
23
|
+
"@fluid-topics/ft-wc-utils": "1.1.64",
|
|
24
24
|
"lit": "3.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@fluid-topics/public-api": "1.0.
|
|
27
|
+
"@fluid-topics/public-api": "1.0.65"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "de93ae28828fb464cab528f90580b63cdbbb195b"
|
|
30
30
|
}
|