@fluid-topics/ft-search-context 1.2.39 → 1.2.41
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`)===0?T.substr(1,T.length):T}).forEach(function(T){var
|
|
3
|
-
`;var
|
|
4
|
-
`;var Ve=O(L()),
|
|
1
|
+
"use strict";(()=>{var Pn=Object.create;var Qt=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var In=Object.getOwnPropertyNames;var kn=Object.getPrototypeOf,Nn=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ln=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of In(e))!Nn.call(t,i)&&i!==r&&Qt(t,i,{get:()=>e[i],enumerable:!(n=Dn(e,i))||n.enumerable});return t};var O=(t,e,r)=>(r=t!=null?Pn(kn(t)):{},Ln(e||!t||!t.__esModule?Qt(r,"default",{value:t,enumerable:!0}):r,t));var L=Fe((Ni,Yt)=>{Yt.exports=ftGlobals.wcUtils});var me=Fe((Li,Xt)=>{Xt.exports=ftGlobals.lit});var J=Fe((Mi,Jt)=>{Jt.exports=ftGlobals.litDecorators});var nr=Fe((Z,rr)=>{var je=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,Be=function(){function t(){this.fetch=!1,this.DOMException=je.DOMException}return t.prototype=je,new t}();(function(t){var e=function(r){var n=typeof t<"u"&&t||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function a(o){return o&&DataView.prototype.isPrototypeOf(o)}if(i.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(o){return o&&s.indexOf(Object.prototype.toString.call(o))>-1};function d(o){if(typeof o!="string"&&(o=String(o)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(o)||o==="")throw new TypeError('Invalid character in header field name: "'+o+'"');return o.toLowerCase()}function c(o){return typeof o!="string"&&(o=String(o)),o}function f(o){var l={next:function(){var b=o.shift();return{done:b===void 0,value:b}}};return i.iterable&&(l[Symbol.iterator]=function(){return l}),l}function h(o){this.map={},o instanceof h?o.forEach(function(l,b){this.append(b,l)},this):Array.isArray(o)?o.forEach(function(l){if(l.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+l.length);this.append(l[0],l[1])},this):o&&Object.getOwnPropertyNames(o).forEach(function(l){this.append(l,o[l])},this)}h.prototype.append=function(o,l){o=d(o),l=c(l);var b=this.map[o];this.map[o]=b?b+", "+l:l},h.prototype.delete=function(o){delete this.map[d(o)]},h.prototype.get=function(o){return o=d(o),this.has(o)?this.map[o]:null},h.prototype.has=function(o){return this.map.hasOwnProperty(d(o))},h.prototype.set=function(o,l){this.map[d(o)]=c(l)},h.prototype.forEach=function(o,l){for(var b in this.map)this.map.hasOwnProperty(b)&&o.call(l,this.map[b],b,this)},h.prototype.keys=function(){var o=[];return this.forEach(function(l,b){o.push(b)}),f(o)},h.prototype.values=function(){var o=[];return this.forEach(function(l){o.push(l)}),f(o)},h.prototype.entries=function(){var o=[];return this.forEach(function(l,b){o.push([b,l])}),f(o)},i.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);function p(o){if(!o._noBody){if(o.bodyUsed)return Promise.reject(new TypeError("Already read"));o.bodyUsed=!0}}function v(o){return new Promise(function(l,b){o.onload=function(){l(o.result)},o.onerror=function(){b(o.error)}})}function y(o){var l=new FileReader,b=v(l);return l.readAsArrayBuffer(o),b}function m(o){var l=new FileReader,b=v(l),T=/charset=([A-Za-z0-9_-]+)/.exec(o.type),R=T?T[1]:"utf-8";return l.readAsText(o,R),b}function w(o){for(var l=new Uint8Array(o),b=new Array(l.length),T=0;T<l.length;T++)b[T]=String.fromCharCode(l[T]);return b.join("")}function E(o){if(o.slice)return o.slice(0);var l=new Uint8Array(o.byteLength);return l.set(new Uint8Array(o)),l.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(o){this.bodyUsed=this.bodyUsed,this._bodyInit=o,o?typeof o=="string"?this._bodyText=o:i.blob&&Blob.prototype.isPrototypeOf(o)?this._bodyBlob=o:i.formData&&FormData.prototype.isPrototypeOf(o)?this._bodyFormData=o:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(o)?this._bodyText=o.toString():i.arrayBuffer&&i.blob&&a(o)?(this._bodyArrayBuffer=E(o.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(o)||u(o))?this._bodyArrayBuffer=E(o):this._bodyText=o=Object.prototype.toString.call(o):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof o=="string"?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(o)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var o=p(this);if(o)return o;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(){if(this._bodyArrayBuffer){var o=p(this);return o||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(y);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var o=p(this);if(o)return o;if(this._bodyBlob)return m(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(w(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(z)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function x(o){var l=o.toUpperCase();return _.indexOf(l)>-1?l:o}function k(o,l){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');l=l||{};var b=l.body;if(o instanceof k){if(o.bodyUsed)throw new TypeError("Already read");this.url=o.url,this.credentials=o.credentials,l.headers||(this.headers=new h(o.headers)),this.method=o.method,this.mode=o.mode,this.signal=o.signal,!b&&o._bodyInit!=null&&(b=o._bodyInit,o.bodyUsed=!0)}else this.url=String(o);if(this.credentials=l.credentials||this.credentials||"same-origin",(l.headers||!this.headers)&&(this.headers=new h(l.headers)),this.method=x(l.method||this.method||"GET"),this.mode=l.mode||this.mode||null,this.signal=l.signal||this.signal||function(){if("AbortController"in n){var A=new AbortController;return A.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&b)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(b),(this.method==="GET"||this.method==="HEAD")&&(l.cache==="no-store"||l.cache==="no-cache")){var T=/([?&])_=[^&]*/;if(T.test(this.url))this.url=this.url.replace(T,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function z(o){var l=new FormData;return o.trim().split("&").forEach(function(b){if(b){var T=b.split("="),R=T.shift().replace(/\+/g," "),A=T.join("=").replace(/\+/g," ");l.append(decodeURIComponent(R),decodeURIComponent(A))}}),l}function oe(o){var l=new h,b=o.replace(/\r?\n[\t ]+/g," ");return b.split("\r").map(function(T){return T.indexOf(`
|
|
2
|
+
`)===0?T.substr(1,T.length):T}).forEach(function(T){var R=T.split(":"),A=R.shift().trim();if(A){var Me=R.join(":").trim();try{l.append(A,Me)}catch(pt){console.warn("Response "+pt.message)}}}),l}S.call(k.prototype);function j(o,l){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(l||(l={}),this.type="default",this.status=l.status===void 0?200:l.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=l.statusText===void 0?"":""+l.statusText,this.headers=new h(l.headers),this.url=l.url||"",this._initBody(o)}S.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},j.error=function(){var o=new j(null,{status:200,statusText:""});return o.ok=!1,o.status=0,o.type="error",o};var ue=[301,302,303,307,308];j.redirect=function(o,l){if(ue.indexOf(l)===-1)throw new RangeError("Invalid status code");return new j(null,{status:l,headers:{location:o}})},r.DOMException=n.DOMException;try{new r.DOMException}catch{r.DOMException=function(l,b){this.message=l,this.name=b;var T=Error(l);this.stack=T.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function ye(o,l){return new Promise(function(b,T){var R=new k(o,l);if(R.signal&&R.signal.aborted)return T(new r.DOMException("Aborted","AbortError"));var A=new XMLHttpRequest;function Me(){A.abort()}A.onload=function(){var N={statusText:A.statusText,headers:oe(A.getAllResponseHeaders()||"")};R.url.indexOf("file://")===0&&(A.status<200||A.status>599)?N.status=200:N.status=A.status,N.url="responseURL"in A?A.responseURL:N.headers.get("X-Request-URL");var ce="response"in A?A.response:A.responseText;setTimeout(function(){b(new j(ce,N))},0)},A.onerror=function(){setTimeout(function(){T(new TypeError("Network request failed"))},0)},A.ontimeout=function(){setTimeout(function(){T(new TypeError("Network request timed out"))},0)},A.onabort=function(){setTimeout(function(){T(new r.DOMException("Aborted","AbortError"))},0)};function pt(N){try{return N===""&&n.location.href?n.location.href:N}catch{return N}}if(A.open(R.method,pt(R.url),!0),R.credentials==="include"?A.withCredentials=!0:R.credentials==="omit"&&(A.withCredentials=!1),"responseType"in A&&(i.blob?A.responseType="blob":i.arrayBuffer&&(A.responseType="arraybuffer")),l&&typeof l.headers=="object"&&!(l.headers instanceof h||n.Headers&&l.headers instanceof n.Headers)){var $t=[];Object.getOwnPropertyNames(l.headers).forEach(function(N){$t.push(d(N)),A.setRequestHeader(N,c(l.headers[N]))}),R.headers.forEach(function(N,ce){$t.indexOf(ce)===-1&&A.setRequestHeader(ce,N)})}else R.headers.forEach(function(N,ce){A.setRequestHeader(ce,N)});R.signal&&(R.signal.addEventListener("abort",Me),A.onreadystatechange=function(){A.readyState===4&&R.signal.removeEventListener("abort",Me)}),A.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return ye.polyfill=!0,n.fetch||(n.fetch=ye,n.Headers=h,n.Request=k,n.Response=j),r.Headers=h,r.Request=k,r.Response=j,r.fetch=ye,r}({})})(Be);Be.fetch.ponyfill=!0;delete Be.fetch.polyfill;var ve=je.fetch?je:Be;Z=ve.fetch;Z.default=ve.fetch;Z.fetch=ve.fetch;Z.Headers=ve.Headers;Z.Request=ve.Request;Z.Response=ve.Response;rr.exports=Z});var Rn=O(L());var Cn=O(me()),X=O(J()),K=O(L());var Zt=O(me()),Fi={},er=Zt.css`
|
|
3
|
+
`;var xn=O(L()),Tn=O(J());var q=O(L());var Ue=O(L()),Mn={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)=>{var r;let n=+((r=e.payload)!==null&&r!==void 0?r:20);t.request.paging.perPage=isNaN(n)?20:(0,Ue.minmax)(1,n,1e3)},setPageNumber:(t,e)=>{t.request.paging.page=isNaN(e.payload)?1:Math.max(1,e.payload)},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.metadataFilters=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},setOtherQueryParams:(t,e)=>{t.request.otherQueryParams=e.payload},setRequestClusterSortCriterion:(t,e)=>{var r;t.request.clusterSortCriterions=(r=e.payload)!==null&&r!==void 0?r:[]}},tr=t=>Ue.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:"",paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,suggestResults:void 0},reducers:Mn});var Fn=O(nr(),1);var ir;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(ir||(ir={}));var ar;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(ar||(ar={}));var ge;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.MAP_ATTACHMENT="MAP_ATTACHMENT",t.RESOURCE="RESOURCE"})(ge||(ge={}));var sr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(sr||(sr={}));var or;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(or||(or={}));var be;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.GEN_AI__COMPLETED_QUERY="GEN_AI__COMPLETED_QUERY",t.GEN_AI__RATE="GEN_AI__RATE",t.GENAI_CASE_DEFLECTION__START="GENAI_CASE_DEFLECTION__START",t.GENAI_CASE_DEFLECTION__OPEN_TICKET="GENAI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.TOPIC__DISPLAY="TOPIC__DISPLAY",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(be||(be={}));var ur;(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"})(ur||(ur={}));var cr;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT"})(cr||(cr={}));var lr;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(lr||(lr={}));var dr;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(dr||(dr={}));var fr;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(fr||(fr={}));var pr;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(pr||(pr={}));var hr;(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"})(hr||(hr={}));var yr;(function(t){t.ASC="ASC",t.DESC="DESC"})(yr||(yr={}));var mr;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(mr||(mr={}));var Ee;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Ee||(Ee={}));var vr;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"})(vr||(vr={}));var gr;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(gr||(gr={}));var br;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(br||(br={}));var Er;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Er||(Er={}));var le;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(le||(le={}));var Se;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Se||(Se={}));var I;(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.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_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"})(I||(I={}));var Sr;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Sr||(Sr={}));var Ar;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Ar||(Ar={}));var Ki={[I.PERSONAL_BOOK_SHARE_USER]:[I.PERSONAL_BOOK_USER],[I.HTML_EXPORT_USER]:[I.PERSONAL_BOOK_USER],[I.PDF_EXPORT_USER]:[I.PERSONAL_BOOK_USER],[I.KHUB_ADMIN]:[I.CONTENT_PUBLISHER],[I.ADMIN]:[I.KHUB_ADMIN,I.USERS_ADMIN,I.PORTAL_ADMIN],[I.DEVELOPER]:[I.BETA_USER,I.DEBUG_USER],[I.GENERATIVE_AI_EXPORT_USER]:[I.GENERATIVE_AI_USER]};var wn=O(L());var _r=O(me()),B=O(J()),G=O(L());var wr=O(me());var Or=wr.css`
|
|
4
|
+
`;var Ve=O(L()),Un="ft-app-info",ht=class extends CustomEvent{constructor(e){super("authentication-change",{detail:e})}},jn={session:(t,e)=>{(0,Ve.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>g.dispatchEvent(new ht(e.payload)),0))}},g=Ve.FtReduxStore.get({name:Un,reducers:jn,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var ee=O(L());var yt=O(L());var de=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=g.getState(),i=e??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let i=g.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var Ae=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:de.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):de.await()}};var $=class extends Ae{constructor(e=!0,r){var n;super(r);let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new yt.CacheRegistry,this.cache=e?i.commonCache:new yt.CacheRegistry}clearCache(){this.cache.clearAll()}};var xr,Bn=Symbol("clearAfterUnitTest"),qe=class extends ${constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[xr]=()=>{this.defaultMessages={},this.cache=new ee.CacheRegistry,this.listeners={}},this.currentUiLocale=g.getState().uiLocale,g.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=g.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),Object.keys(r).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,ee.deepEqual)(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}await this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new ee.ParametrizedLabelResolver((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(r,...n)}async fetchContext(e){var r,n,i;if(!this.cache.has(e))if(((n=(r=window.process)===null||r===void 0?void 0:r.env)===null||n===void 0?void 0:n.NODE_ENV)==="test")this.cache.set(e,(i=this.defaultMessages[e])!==null&&i!==void 0?i:{});else try{await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),await this.notify(e)}catch(a){console.error(a)}}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map(e=>this.notify(e)))}async notify(e){this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(r=>(0,ee.delay)(0).then(()=>r()).catch(()=>null)))}};xr=Bn;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends qe{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends qe{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Tr=window.FluidTopicsI18nService,la=window.FluidTopicsCustomI18nService;var M=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},P=class extends G.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.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>de.get(),this.messageContexts=[],this.cache=new G.CacheRegistry,this.cleanSessionDebouncer=new G.Debouncer}render(){return _r.html`
|
|
5
5
|
<slot></slot>
|
|
6
|
-
`}update(e){var r,n,i,a,s;super.update(e),e.has("baseUrl")&&(g.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&g.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("uiLocale")&&g.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&g.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&g.actions.noCustom(this.noCustom),e.has("editorMode")&&g.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&g.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&g.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>xr.addContext(u)),e.has("openExternalDocumentInNewTab")&&g.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&g.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&g.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(g.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),g.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),g.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};P.elementDefinitions={};P.styles=wr;M([(0,B.property)()],P.prototype,"baseUrl",void 0);M([(0,B.property)()],P.prototype,"apiIntegrationIdentifier",void 0);M([(0,B.property)()],P.prototype,"uiLocale",void 0);M([(0,G.jsonProperty)(null)],P.prototype,"availableUiLocales",void 0);M([(0,G.jsonProperty)(null)],P.prototype,"metadataConfiguration",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"editorMode",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"noCustom",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"openExternalDocumentInNewTab",void 0);M([(0,B.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],P.prototype,"noCustomComponent",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"withManualResources",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"navigatorOnline",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"forcedOffline",void 0);M([(0,B.property)({type:Object})],P.prototype,"apiProvider",void 0);M([(0,G.jsonProperty)([])],P.prototype,"messageContexts",void 0);M([(0,G.jsonProperty)(void 0)],P.prototype,"session",void 0);M([(0,B.state)()],P.prototype,"localesConfiguration",void 0);var Ti=O(J());function Bn(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!He(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!He(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let a=s=>Object.keys(s).filter(u=>s[u]!=null);if(i=a(t),r=i.length,r!==a(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let s=i[n];if(!He(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function He(t,e){try{return Bn(t,e)}catch{return!1}}function Ke(t,e){return!He(t,e)}var Vn=O(J(),1);var ze=class{constructor(){this.queue=[]}add(e,r=!1){r&&(this.queue=this.queue.filter(n=>n.type!==e.type)),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}};var Re=O(J(),1);var _r=O(J(),1);function Rr(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,_r.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:Ke,...e??{}})}var Ge=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,a=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let s of n)try{await s()}catch(u){i(u);return}a(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Pr=O(me(),1);var We=globalThis,qn=We.ShadowRoot&&(We.ShadyCSS===void 0||We.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,xa=Symbol();var Cr=(t,e)=>{if(qn)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=We.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}};var $e=class extends Pr.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,a])=>e.registry.define(i,a)));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return Cr(n,e.elementStyles),n}};var Qe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Nr,Dr=Symbol("constructorPrototype"),Ir=Symbol("constructorName"),Lr=Symbol("exportpartsDebouncer"),kr=Symbol("dynamicDependenciesLoaded"),te=class extends $e{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Nr]=new Ge(5),this[Ir]=this.constructor.name,this[Dr]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Ir]&&Object.setPrototypeOf(this,this[Dr])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(r){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",r)}let e=this.constructor;e[kr]||(e[kr]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate()})}contentAvailableCallback(e){}applyCustomStylesheet(e){var r,n,i;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(a=>a.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(a){console.error(a,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let a=document.createElement("style");a.classList.add("ft-lit-element--custom-stylesheet"),a.innerHTML=this.customStylesheet,this.shadowRoot.append(a)}}scheduleExportpartsUpdate(){var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[Lr].run(()=>{var i,a;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((a=this.exportpartsPrefixes)===null||a===void 0?void 0:a.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(e){var r,n,i,a,s,u;let d=h=>h!=null&&h.trim().length>0,c=e.filter(d).map(h=>h.trim());if(c.length===0){this.removeAttribute("exportparts");return}let f=new Set;for(let h of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(a=(i=h.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&a!==void 0?a:[],y=(u=(s=h.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(m=>m.split(":")[1]))!==null&&u!==void 0?u:[];new Array(...v,...y).filter(d).map(m=>m.trim()).forEach(m=>f.add(m))}if(f.size===0){this.removeAttribute("exportparts");return}let p=[...f.values()].flatMap(h=>c.map(v=>`${h}:${v}--${h}`));this.setAttribute("exportparts",[...this.part,...p].join(", "))}};Nr=Lr;Qe([(0,Re.property)()],te.prototype,"exportpartsPrefix",void 0);Qe([Rr([])],te.prototype,"exportpartsPrefixes",void 0);Qe([(0,Re.property)()],te.prototype,"customStylesheet",void 0);Qe([(0,Re.state)()],te.prototype,"useAdoptedStyleSheets",void 0);function Ce(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Mr,Fr,Ur,Pe=Symbol("internalReduxEventsUnsubscribers"),re=Symbol("internalStoresUnsubscribers"),fe=Symbol("internalStores"),De=class extends te{constructor(){super(...arguments),this[Mr]=new Map,this[Fr]=new Map,this[Ur]=new Map}get reduxConstructor(){return this.constructor}update(e){super.update(e),[...this.reduxConstructor.reduxReactiveProperties].some(r=>e.has(r))&&this.updateFromStores()}getUnnamedStore(){if(this[fe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[fe].values()][0]}getStore(e){return e==null?this.getUnnamedStore():this[fe].get(e)}addStore(e,r){var n;r=(n=r??(Ce(e)?e.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(r),this[fe].set(r,e),this.subscribeToStore(r,e),this.updateFromStores()}removeStore(e){let r=typeof e=="string"?e:e.name;this.unsubscribeFromStore(r),this[fe].delete(r)}setupStores(){this.unsubscribeFromStores(),this[fe].forEach((e,r)=>this.subscribeToStore(r,e)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((e,r)=>{let n=this.constructor.getPropertyOptions(r);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:r)){let i=this.getStore(e.store);i&&(e.store?this[re].has(e.store):this[re].size>0)&&(this[r]=e.selector(i.getState(),this))}})}subscribeToStore(e,r){var n;this[re].set(e,r.subscribe(()=>this.updateFromStores())),this[Pe].set(e,[]),Ce(r)&&r.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((i,a)=>{if(typeof this[a]=="function"&&(!i.store||r.name===i.store)){let s=u=>this[a](u);r.addEventListener(i.eventName,s),this[Pe].get(e).push(()=>r.removeEventListener(i.eventName,s))}})),this.onStoreAvailable(e)}unsubscribeFromStores(){this[re].forEach((e,r)=>this.unsubscribeFromStore(r))}unsubscribeFromStore(e){var r;this[re].has(e)&&this[re].get(e)(),this[re].delete(e),(r=this[Pe].get(e))===null||r===void 0||r.forEach(n=>n()),this[Pe].delete(e)}onStoreAvailable(e){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};Mr=re,Fr=fe,Ur=Pe;De.reduxProperties=new Map;De.reduxReactiveProperties=new Set;De.reduxEventListeners=new Map;function H(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var i,a;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Y(t){return!!t&&!!t[R]}function W(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Yn}(t)||Array.isArray(t)||!!t[zr]||!!(!((e=t.constructor)===null||e===void 0)&&e[zr])||wt(t)||Ot(t))}function pe(t,e,r){r===void 0&&(r=!1),xe(t)===0?(r?Object.keys:Oe)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function xe(t){var e=t[R];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:wt(t)?2:Ot(t)?3:0}function we(t,e){return xe(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Hn(t,e){return xe(t)===2?t.get(e):t[e]}function Gr(t,e,r){var n=xe(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function Wr(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function wt(t){return $n&&t instanceof Map}function Ot(t){return Qn&&t instanceof Set}function ne(t){return t.o||t.t}function xt(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Yr(t);delete e[R];for(var r=Oe(e),n=0;n<r.length;n++){var i=r[n],a=e[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function Tt(t,e){return e===void 0&&(e=!1),_t(t)||Y(t)||!W(t)||(xe(t)>1&&(t.set=t.add=t.clear=t.delete=Kn),Object.freeze(t),e&&pe(t,function(r,n){return Tt(n,!0)},!0)),t}function Kn(){H(2)}function _t(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Q(t){var e=At[t];return e||H(18,t),e}function zn(t,e){At[t]||(At[t]=e)}function bt(){return ke}function yt(t,e){e&&(Q("Patches"),t.u=[],t.s=[],t.v=e)}function Ye(t){Et(t),t.p.forEach(Gn),t.p=null}function Et(t){t===ke&&(ke=t.l)}function jr(t){return ke={p:[],l:ke,h:t,m:!0,_:0}}function Gn(t){var e=t[R];e.i===0||e.i===1?e.j():e.g=!0}function mt(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||Q("ES5").S(e,t,n),n?(r[R].P&&(Ye(e),H(4)),W(t)&&(t=Xe(e,t),e.l||Je(e,t)),e.u&&Q("Patches").M(r[R].t,t,e.u,e.s)):t=Xe(e,r,[]),Ye(e),e.u&&e.v(e.u,e.s),t!==Qr?t:void 0}function Xe(t,e,r){if(_t(e))return e;var n=e[R];if(!n)return pe(e,function(u,d){return Br(t,n,e,u,d,r)},!0),e;if(n.A!==t)return e;if(!n.P)return Je(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=xt(n.k):n.o,a=i,s=!1;n.i===3&&(a=new Set(i),i.clear(),s=!0),pe(a,function(u,d){return Br(t,n,i,u,d,r,s)}),Je(t,i,!1),r&&t.u&&Q("Patches").N(n,r,t.u,t.s)}return n.o}function Br(t,e,r,n,i,a,s){if(Y(i)){var u=Xe(t,i,a&&e&&e.i!==3&&!we(e.R,n)?a.concat(n):void 0);if(Gr(r,n,u),!Y(u))return;t.m=!1}else s&&r.add(i);if(W(i)&&!_t(i)){if(!t.h.D&&t._<1)return;Xe(t,i),e&&e.A.l||Je(t,i)}}function Je(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Tt(e,r)}function vt(t,e){var r=t[R];return(r?ne(r):t)[e]}function Vr(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function ie(t){t.P||(t.P=!0,t.l&&ie(t.l))}function gt(t){t.o||(t.o=xt(t.t))}function St(t,e,r){var n=wt(e)?Q("MapSet").F(e,r):Ot(e)?Q("MapSet").T(e,r):t.O?function(i,a){var s=Array.isArray(i),u={i:s?1:0,A:a?a.A:bt(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},d=u,c=Ne;s&&(d=[u],c=Ie);var f=Proxy.revocable(d,c),p=f.revoke,h=f.proxy;return u.k=h,u.j=p,h}(e,r):Q("ES5").J(e,r);return(r?r.A:bt()).p.push(n),n}function Wn(t){return Y(t)||H(22,t),function e(r){if(!W(r))return r;var n,i=r[R],a=xe(r);if(i){if(!i.P&&(i.i<4||!Q("ES5").K(i)))return i.t;i.I=!0,n=qr(r,a),i.I=!1}else n=qr(r,a);return pe(n,function(s,u){i&&Hn(i.t,s)===u||Gr(n,s,e(u))}),a===3?new Set(n):n}(t)}function qr(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return xt(t)}function $r(){function t(s,u){var d=a[s];return d?d.enumerable=u:a[s]=d={configurable:!0,enumerable:u,get:function(){var c=this[R];return Ne.get(c,s)},set:function(c){var f=this[R];Ne.set(f,s,c)}},d}function e(s){for(var u=s.length-1;u>=0;u--){var d=s[u][R];if(!d.P)switch(d.i){case 5:n(d)&&ie(d);break;case 4:r(d)&&ie(d)}}}function r(s){for(var u=s.t,d=s.k,c=Oe(d),f=c.length-1;f>=0;f--){var p=c[f];if(p!==R){var h=u[p];if(h===void 0&&!we(u,p))return!0;var v=d[p],y=v&&v[R];if(y?y.t!==h:!Wr(v,h))return!0}}var m=!!u[R];return c.length!==Oe(u).length+(m?0:1)}function n(s){var u=s.k;if(u.length!==s.t.length)return!0;var d=Object.getOwnPropertyDescriptor(u,u.length-1);if(d&&!d.get)return!0;for(var c=0;c<u.length;c++)if(!u.hasOwnProperty(c))return!0;return!1}function i(s){s.g&&H(3,JSON.stringify(ne(s)))}var a={};zn("ES5",{J:function(s,u){var d=Array.isArray(s),c=function(p,h){if(p){for(var v=Array(h.length),y=0;y<h.length;y++)Object.defineProperty(v,""+y,t(y,!0));return v}var m=Yr(h);delete m[R];for(var w=Oe(m),E=0;E<w.length;E++){var S=w[E];m[S]=t(S,p||!!m[S].enumerable)}return Object.create(Object.getPrototypeOf(h),m)}(d,s),f={i:d?5:4,A:u?u.A:bt(),P:!1,I:!1,R:{},l:u,t:s,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,R,{value:f,writable:!0}),c},S:function(s,u,d){d?Y(u)&&u[R].A===s&&e(s.p):(s.u&&function c(f){if(f&&typeof f=="object"){var p=f[R];if(p){var h=p.t,v=p.k,y=p.R,m=p.i;if(m===4)pe(v,function(x){x!==R&&(h[x]!==void 0||we(h,x)?y[x]||c(v[x]):(y[x]=!0,ie(p)))}),pe(h,function(x){v[x]!==void 0||we(v,x)||(y[x]=!1,ie(p))});else if(m===5){if(n(p)&&(ie(p),y.length=!0),v.length<h.length)for(var w=v.length;w<h.length;w++)y[w]=!1;else for(var E=h.length;E<v.length;E++)y[E]=!0;for(var S=Math.min(v.length,h.length),_=0;_<S;_++)v.hasOwnProperty(_)||(y[_]=!0),y[_]===void 0&&c(v[_])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?r(s):n(s)}})}var Hr,ke,Rt=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",$n=typeof Map<"u",Qn=typeof Set<"u",Kr=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Qr=Rt?Symbol.for("immer-nothing"):((Hr={})["immer-nothing"]=!0,Hr),zr=Rt?Symbol.for("immer-draftable"):"__$immer_draftable",R=Rt?Symbol.for("immer-state"):"__$immer_state";var Yn=""+Object.prototype.constructor,Oe=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Yr=Object.getOwnPropertyDescriptors||function(t){var e={};return Oe(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},At={},Ne={get:function(t,e){if(e===R)return t;var r=ne(t);if(!we(r,e))return function(i,a,s){var u,d=Vr(a,s);return d?"value"in d?d.value:(u=d.get)===null||u===void 0?void 0:u.call(i.k):void 0}(t,r,e);var n=r[e];return t.I||!W(n)?n:n===vt(t.t,e)?(gt(t),t.o[e]=St(t.A.h,n,t)):n},has:function(t,e){return e in ne(t)},ownKeys:function(t){return Reflect.ownKeys(ne(t))},set:function(t,e,r){var n=Vr(ne(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var i=vt(ne(t),e),a=i?.[R];if(a&&a.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(Wr(r,i)&&(r!==void 0||we(t.t,e)))return!0;gt(t),ie(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return vt(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,gt(t),ie(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=ne(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){H(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){H(12)}},Ie={};pe(Ne,function(t,e){Ie[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Ie.deleteProperty=function(t,e){return Ie.set.call(this,t,e,void 0)},Ie.set=function(t,e,r){return Ne.set.call(this,t[0],e,r,t[0])};var Xn=function(){function t(r){var n=this;this.O=Kr,this.D=!0,this.produce=function(i,a,s){if(typeof i=="function"&&typeof a!="function"){var u=a;a=i;var d=n;return function(m){var w=this;m===void 0&&(m=u);for(var E=arguments.length,S=Array(E>1?E-1:0),_=1;_<E;_++)S[_-1]=arguments[_];return d.produce(m,function(x){var k;return(k=a).call.apply(k,[w,x].concat(S))})}}var c;if(typeof a!="function"&&H(6),s!==void 0&&typeof s!="function"&&H(7),W(i)){var f=jr(n),p=St(n,i,void 0),h=!0;try{c=a(p),h=!1}finally{h?Ye(f):Et(f)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return yt(f,s),mt(m,f)},function(m){throw Ye(f),m}):(yt(f,s),mt(c,f))}if(!i||typeof i!="object"){if((c=a(i))===void 0&&(c=i),c===Qr&&(c=void 0),n.D&&Tt(c,!0),s){var v=[],y=[];Q("Patches").M(i,c,v,y),s(v,y)}return c}H(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(c){for(var f=arguments.length,p=Array(f>1?f-1:0),h=1;h<f;h++)p[h-1]=arguments[h];return n.produceWithPatches(c,function(v){return i.apply(void 0,[v].concat(p))})};var s,u,d=n.produce(i,a,function(c,f){s=c,u=f});return typeof Promise<"u"&&d instanceof Promise?d.then(function(c){return[c,s,u]}):[d,s,u]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){W(r)||H(8),Y(r)&&(r=Wn(r));var n=jr(this),i=St(this,r,void 0);return i[R].C=!0,Et(n),i},e.finishDraft=function(r,n){var i=r&&r[R],a=i.A;return yt(a,n),mt(void 0,a)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!Kr&&H(20),this.O=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}i>-1&&(n=n.slice(i+1));var s=Q("Patches").$;return Y(r)?s(r,n):this.produce(r,function(u){return s(u,n)})},t}(),V=new Xn,Jn=V.produce,Fa=V.produceWithPatches.bind(V),Ua=V.setAutoFreeze.bind(V),ja=V.setUseProxies.bind(V),Ba=V.applyPatches.bind(V),Va=V.createDraft.bind(V),qa=V.finishDraft.bind(V),Ze=Jn;function he(t){"@babel/helpers - typeof";return he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(t)}function Xr(t,e){if(he(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(he(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jr(t){var e=Xr(t,"string");return he(e)=="symbol"?e:e+""}function Zr(t,e,r){return(e=Jr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function en(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?en(Object(r),!0).forEach(function(n){Zr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function F(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. "}var tn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Pt=function(){return Math.random().toString(36).substring(7).split("").join(".")},et={INIT:"@@redux/INIT"+Pt(),REPLACE:"@@redux/REPLACE"+Pt(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Pt()}};function Zn(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Dt(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(F(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(F(1));return r(Dt)(t,e)}if(typeof t!="function")throw new Error(F(2));var i=t,a=e,s=[],u=s,d=!1;function c(){u===s&&(u=s.slice())}function f(){if(d)throw new Error(F(3));return a}function p(m){if(typeof m!="function")throw new Error(F(4));if(d)throw new Error(F(5));var w=!0;return c(),u.push(m),function(){if(w){if(d)throw new Error(F(6));w=!1,c();var S=u.indexOf(m);u.splice(S,1),s=null}}}function h(m){if(!Zn(m))throw new Error(F(7));if(typeof m.type>"u")throw new Error(F(8));if(d)throw new Error(F(9));try{d=!0,a=i(a,m)}finally{d=!1}for(var w=s=u,E=0;E<w.length;E++){var S=w[E];S()}return m}function v(m){if(typeof m!="function")throw new Error(F(10));i=m,h({type:et.REPLACE})}function y(){var m,w=p;return m={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(F(11));function _(){S.next&&S.next(f())}_();var x=w(_);return{unsubscribe:x}}},m[tn]=function(){return this},m}return h({type:et.INIT}),n={dispatch:h,subscribe:p,getState:f,replaceReducer:v},n[tn]=y,n}function ei(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:et.INIT});if(typeof n>"u")throw new Error(F(12));if(typeof r(void 0,{type:et.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(F(13))})}function rn(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(r[i]=t[i])}var a=Object.keys(r),s,u;try{ei(r)}catch(d){u=d}return function(c,f){if(c===void 0&&(c={}),u)throw u;if(0)var p;for(var h=!1,v={},y=0;y<a.length;y++){var m=a[y],w=r[m],E=c[m],S=w(E,f);if(typeof S>"u"){var _=f&&f.type;throw new Error(F(14))}v[m]=S,h=h||S!==E}return h=h||a.length!==Object.keys(c).length,h?v:c}}function Te(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function nn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(F(15))},s={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},u=e.map(function(d){return d(s)});return a=Te.apply(void 0,u)(i.dispatch),Ct(Ct({},i),{},{dispatch:a})}}}function an(t){var e=function(n){var i=n.dispatch,a=n.getState;return function(s){return function(u){return typeof u=="function"?u(i,a,t):s(u)}}};return e}var sn=an();sn.withExtraArgument=an;var It=sn;var dn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ti=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(c){return function(f){return d([c,f])}}function d(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(f){c=[6,f],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},_e=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},ri=Object.defineProperty,ni=Object.defineProperties,ii=Object.getOwnPropertyDescriptors,on=Object.getOwnPropertySymbols,ai=Object.prototype.hasOwnProperty,si=Object.prototype.propertyIsEnumerable,un=function(t,e,r){return e in t?ri(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ae=function(t,e){for(var r in e||(e={}))ai.call(e,r)&&un(t,r,e[r]);if(on)for(var n=0,i=on(e);n<i.length;n++){var r=i[n];si.call(e,r)&&un(t,r,e[r])}return t},kt=function(t,e){return ni(t,ii(e))},oi=function(t,e,r){return new Promise(function(n,i){var a=function(d){try{u(r.next(d))}catch(c){i(c)}},s=function(d){try{u(r.throw(d))}catch(c){i(c)}},u=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(a,s)};u((r=r.apply(t,e)).next())})};var ui=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Te:Te.apply(null,arguments)},ss=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function ci(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var li=function(t){dn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,_e([void 0],r[0].concat(this)))):new(e.bind.apply(e,_e([void 0],r.concat(this))))},e}(Array),di=function(t){dn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,_e([void 0],r[0].concat(this)))):new(e.bind.apply(e,_e([void 0],r.concat(this))))},e}(Array);function Mt(t){return W(t)?Ze(t,function(){}):t}function fi(t){return typeof t=="boolean"}function pi(){return function(e){return hi(e)}}function hi(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,a=t.serializableCheck,s=a===void 0?!0:a,u=new li;if(r&&(fi(r)?u.push(It):u.push(It.withExtraArgument(r.extraArgument))),0){if(i)var d;if(s)var c}return u}var Nt=!0;function fn(t){var e=pi(),r=t||{},n=r.reducer,i=n===void 0?void 0:n,a=r.middleware,s=a===void 0?e():a,u=r.devTools,d=u===void 0?!0:u,c=r.preloadedState,f=c===void 0?void 0:c,p=r.enhancers,h=p===void 0?void 0:p,v;if(typeof i=="function")v=i;else if(ci(i))v=rn(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var y=s;if(typeof y=="function"&&(y=y(e),!Nt&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Nt&&y.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var m=nn.apply(void 0,y),w=Te;d&&(w=ui(ae({trace:!Nt},typeof d=="object"&&d)));var E=new di(m),S=E;Array.isArray(h)?S=_e([m],h):typeof h=="function"&&(S=h(E));var _=w.apply(void 0,S);return Dt(v,f,_)}function se(t,e){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var a=e.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return ae(ae({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}function pn(t){var e={},r=[],n,i={addCase:function(a,s){var u=typeof a=="string"?a:a.type;if(u in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[u]=s,i},addMatcher:function(a,s){return r.push({matcher:a,reducer:s}),i},addDefaultCase:function(a){return n=a,i}};return t(i),[e,r,n]}function yi(t){return typeof t=="function"}function mi(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?pn(e):[e,r,n],a=i[0],s=i[1],u=i[2],d;if(yi(t))d=function(){return Mt(t())};else{var c=Mt(t);d=function(){return c}}function f(p,h){p===void 0&&(p=d());var v=_e([a[h.type]],s.filter(function(y){var m=y.matcher;return m(h)}).map(function(y){var m=y.reducer;return m}));return v.filter(function(y){return!!y}).length===0&&(v=[u]),v.reduce(function(y,m){if(m)if(Y(y)){var w=y,E=m(w,h);return E===void 0?y:E}else{if(W(y))return Ze(y,function(S){return m(S,h)});var E=m(y,h);if(E===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}return y},p)}return f.getInitialState=d,f}function vi(t,e){return t+"/"+e}function hn(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:Mt(t.initialState),n=t.reducers||{},i=Object.keys(n),a={},s={},u={};i.forEach(function(f){var p=n[f],h=vi(e,f),v,y;"reducer"in p?(v=p.reducer,y=p.prepare):v=p,a[f]=v,s[h]=v,u[f]=y?se(h,y):se(h)});function d(){var f=typeof t.extraReducers=="function"?pn(t.extraReducers):[t.extraReducers],p=f[0],h=p===void 0?{}:p,v=f[1],y=v===void 0?[]:v,m=f[2],w=m===void 0?void 0:m,E=ae(ae({},h),s);return mi(r,function(S){for(var _ in E)S.addCase(_,E[_]);for(var x=0,k=y;x<k.length;x++){var z=k[x];S.addMatcher(z.matcher,z.reducer)}w&&S.addDefaultCase(w)})}var c;return{name:e,reducer:function(f,p){return c||(c=d()),c(f,p)},actions:u,caseReducers:a,getInitialState:function(){return c||(c=d()),c.getInitialState()}}}var gi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",bi=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=gi[Math.random()*64|0];return e},Ei=["name","message","stack","code"],Lt=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),cn=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Si=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=Ei;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},ls=function(){function t(e,r,n){var i=se(e+"/fulfilled",function(f,p,h,v){return{payload:f,meta:kt(ae({},v||{}),{arg:h,requestId:p,requestStatus:"fulfilled"})}}),a=se(e+"/pending",function(f,p,h){return{payload:void 0,meta:kt(ae({},h||{}),{arg:p,requestId:f,requestStatus:"pending"})}}),s=se(e+"/rejected",function(f,p,h,v,y){return{payload:v,error:(n&&n.serializeError||Si)(f||"Rejected"),meta:kt(ae({},y||{}),{arg:h,requestId:p,rejectedWithValue:!!v,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"})}}),u=!1,d=typeof AbortController<"u"?AbortController:function(){function f(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return f.prototype.abort=function(){},f}();function c(f){return function(p,h,v){var y=n?.idGenerator?n.idGenerator(f):bi(),m=new d,w,E=!1;function S(x){w=x,m.abort()}var _=function(){return oi(this,null,function(){var x,k,z,oe,j,ue,ye;return ti(this,function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),oe=(x=n?.condition)==null?void 0:x.call(n,f,{getState:h,extra:v}),wi(oe)?[4,oe]:[3,2];case 1:oe=o.sent(),o.label=2;case 2:if(oe===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return E=!0,j=new Promise(function(l,b){return m.signal.addEventListener("abort",function(){return b({name:"AbortError",message:w||"Aborted"})})}),p(a(y,f,(k=n?.getPendingMeta)==null?void 0:k.call(n,{requestId:y,arg:f},{getState:h,extra:v}))),[4,Promise.race([j,Promise.resolve(r(f,{dispatch:p,getState:h,extra:v,requestId:y,signal:m.signal,abort:S,rejectWithValue:function(l,b){return new Lt(l,b)},fulfillWithValue:function(l,b){return new cn(l,b)}})).then(function(l){if(l instanceof Lt)throw l;return l instanceof cn?i(l.payload,y,f,l.meta):i(l,y,f)})])];case 3:return z=o.sent(),[3,5];case 4:return ue=o.sent(),z=ue instanceof Lt?s(null,y,f,ue.payload,ue.meta):s(ue,y,f),[3,5];case 5:return ye=n&&!n.dispatchConditionRejection&&s.match(z)&&z.meta.condition,ye||p(z),[2,z]}})})}();return Object.assign(_,{abort:S,requestId:y,arg:f,unwrap:function(){return _.then(Ai)}})}}return Object.assign(c,{pending:a,rejected:s,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function Ai(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function wi(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var yn="listener",mn="completed",vn="cancelled",ds="task-"+vn,fs="task-"+mn,ps=yn+"-"+vn,hs=yn+"-"+mn;var Ft="listenerMiddleware";var ys=se(Ft+"/add"),ms=se(Ft+"/removeAll"),vs=se(Ft+"/remove");var ln,gs=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(ln||(ln=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Oi=function(t){return function(e){setTimeout(e,t)}},bs=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Oi(10);$r();function xi(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,i){this.eventBus.addEventListener(r,n,i)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,i){this.eventBus.removeEventListener(r,n,i)}}}var tt=class extends xi(Object){};window.ftReduxStores||(window.ftReduxStores={});var gn=class t extends tt{static get(e){var r;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,a=window.ftReduxStores[n];if(Ce(a))return a;if(i==null)return;let s=hn({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),u=fn({reducer:(d,c)=>c.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__")?{...d,...c.overwrites}:s.reducer(d,c)});return window.ftReduxStores[i.name]=new t(s,u,i.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new ze;let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,s,u)=>{let d=s,c=a[d];return c?(...f)=>{let p=c(...f.map(i));return this.reduxStore.dispatch(p),p}:f=>{this.setState({[d]:i(f)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}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(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var at=O(L());var rt=class extends ${async listMySearches(){let e=g.getState().session;return e?.sessionAuthenticated?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var nt=class extends ${async listMyBookmarks(){let e=g.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var _i="ft-user-assets",it=at.FtReduxStore.get({name:_i,initialState:{savedSearches:void 0,bookmarks:void 0}}),Ut=class{constructor(){this.currentSession=g.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new nt,this.savedSearchesService=new rt,g.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=g.getState();(0,at.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),it.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),it.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();it.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;it.actions.bookmarks(r)}}},bn=new Ut;var jt=class{addCommand(e,r=!1){g.commands.add(e,r)}consumeCommand(e){return g.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new jt;var En=O(L()),Bt=class{highlightHtml(e,r,n){(0,En.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Bt;var Sn=O(L());var Vt=class{isDate(e){var r,n,i,a;return(a=(i=((n=(r=g.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(u=>u.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,r){var n,i,a;return Sn.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:g.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new Vt;var Ri=O(L());var st=class extends Ae{async sendDocumentStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.start_display event"),console.debug(r)})}async sendTopicStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send topic.start_display event"),console.debug(r)})}async sendKhubSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send khub.search event"),console.debug(r)})}async sendDocumentSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.search event"),console.debug(r)})}async sendSearchPageSelectEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_page.select event"),console.debug(r)})}};(0,An.customElement)("ft-app-context")(P);var ot=class extends ${constructor(e){super(!0,e),this.sortObjectFields=(r,n)=>typeof n!="object"||n==null||Array.isArray(n)?n:Object.fromEntries(Object.entries(n).sort(([i],[a])=>i.localeCompare(a)))}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,i)=>n.id.localeCompare(i.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),2*60*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),2*60*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,i)=>n.localeCompare(i))}}).sort((r,n)=>r.key.localeCompare(n.key))}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Ci=t=>t.request.virtualField===Ee.TITLE_ONLY&&t.request.scope===Se.DOCUMENTS,ut=class t extends Event{constructor(){super(t.eventName)}};ut.eventName="search-context-clear-all-filters";var Le=class t{static build(e,r){return new t(er(e.trim()||"context"),r)}constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new q.Debouncer(10),this.searchDebouncer=new q.Debouncer(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest(this.store.getState()))),this.buildSearchRequest=n=>({...n.request,facets:this.facetIds.map(i=>({id:i}))}),this.suggestDebouncer=new q.Debouncer(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>({input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:n.request.sort,contentLocale:n.request.contentLocale,scope:n.request.scope}),this.service=r??new ot,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,q.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,q.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.launchSearch()}setQuery(e){this.store.actions.setRequestQuery(e),this.store.actions.liveQuery(e),this.store.actions.setPageNumber(1)}setContentLocale(e){var r;let n=(r=this.store.getState().locales)!==null&&r!==void 0?r:[],i=this.store.getState().request.contentLocale;if(e!=i){if(n.length>0){let a=s=>n.some(u=>u.lang==s);a(e)||(e=a(i)?i:n[0].lang)}this.store.actions.setRequestContentLocale(e),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([])}return e}forceContentLocale(e){this.store.actions.setRequestContentLocale(e)}setPageSize(e){this.store.actions.setPageSize(e)}setPageNumber(e){this.store.actions.setPageNumber(e)}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.store.actions.setRequestFilters(r),this.store.actions.setPageNumber(1)}setClusterSortCriterion(e){this.store.actions.setRequestClusterSortCriterion(e)}setSearchInDocumentTitlesOnly(e){e?(this.store.actions.setRequestVirtualField(Ee.TITLE_ONLY),this.store.actions.setRequestScope(Se.DOCUMENTS)):(this.store.actions.setRequestVirtualField(Ee.EVERYWHERE),this.store.actions.setRequestScope(Se.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return Ci(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new ut)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,r){let n=this.facetIds.filter(i=>i!=e);r&&n.push(r),this.facetIds=n}get facetIds(){var e;let r=this.store.getState().request;return[...new Set([...r.facets.map(n=>n.id),...((e=r.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(i=>({id:i}));this.store.actions.setRequestFacets(n)}setFilter(e,r){this.setValueFilter(e,r)}setValueFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,valueFilter:{values:r,negative:!1}},a=[...n.filter(s=>!s.valueFilter),...n.filter(s=>s.valueFilter&&s.key!==i.key),i];this.setFilters(a)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,dateFilter:{type:r}},a=[...n.filter(s=>!s.dateFilter),...n.filter(s=>s.dateFilter&&s.key!==i.key),i];this.setFilters(a)}removeDateFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(i=>!i.dateFilter),...r.filter(i=>i.dateFilter&&i.key!==e)];this.setFilters(n)}setRangeFilter(e,r,n){let i=this.store.getState().request.metadataFilters,a={key:e,rangeFilter:{from:r,to:n}},s=[...i.filter(u=>!u.rangeFilter),...i.filter(u=>u.rangeFilter&&u.key!==a.key),a];this.setFilters(s)}removeRangeFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(i=>!i.rangeFilter),...r.filter(i=>i.rangeFilter&&i.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.store.actions.setRequest({...e,facets:this.store.getState().request.facets}),this.store.actions.liveQuery(e.query),this.store.actions.setPageNumber(1)}setScope(e){this.store.actions.setRequestScope(e)}setOtherQueryParams(e){this.store.actions.setOtherQueryParams(e)}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}updateLocales(){return this.localesDebouncer.run(async()=>this.store.actions.locales((await this.service.getAvailableSearchLocales()).contentLocales))}async fetchSearchData(e){var r,n,i;try{if((r=this.cancelableSearch)===null||r===void 0||r.cancel(),this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=(0,q.cancelable)(this.service.launchSearch(e));let a=await this.cancelableSearch;if(a.paging.currentPage<=1)this.store.actions.results(a.results),this.store.actions.facets(a.facets),this.store.actions.spellcheck(a.spellcheck);else{let s=((n=this.store.getState().results)!==null&&n!==void 0?n:[]).concat(a.results);this.store.actions.results(s)}this.store.actions.paging(a.paging)}}catch(a){a instanceof q.CanceledPromiseError||(console.error(a),(i=this.errorHandler)===null||i===void 0||i.call(this,a))}}async fetchSuggestData(e){var r;try{(r=this.cancelableSuggest)===null||r===void 0||r.cancel(),this.cancelableSuggest=(0,q.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof q.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var Pi=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ht=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},qt=Symbol("registerInterval");function Di(t){var e;class r extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(i){this.clearStateManager(),this.stateManager=i,this.addStore(i.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[qt]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[qt]):this.dispatchEvent(new Ht)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=qt,Pi([(0,xn.state)()],r.prototype,"stateManager",void 0),r}var wn=class extends Di(On.FtLitElementRedux){};var Tn=O(L());function ct(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function lt(t){var e;return t.dateFilter?{key:t.key,type:"DATE",dateValue:t.dateFilter.type}:t.rangeFilter?{key:t.key,type:"RANGE",from:t.rangeFilter.from,to:t.rangeFilter.to}:{key:t.key,values:(e=t.valueFilter)===null||e===void 0?void 0:e.values}}var dt=class{constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.enableAnalyticsEvents=!0,this.appName=void 0,this.appVersion=void 0,this.publication=void 0,this.sendEvent=n=>{if(!this.canSendEvent()||!n)return;let i=this.store.getState().request;this.publication==null?this.sendKhubSearchEvent(i,n):this.sendDocumentSearchEvent(i,n)},this.eventsService=r??new st,this.resultsWatcher=(0,Tn.watch)(e,n=>n.results,this.sendEvent)}setEnableAnalyticsEvents(e){this.enableAnalyticsEvents=e}setAppName(e){this.appName=e}setAppVersion(e){this.appVersion=e}setDocumentSearch(e){this.publication=e}canSendEvent(){if(this.appName==null||this.appVersion==null)return console.debug("ft-search-context.eventManager is not initialized. No events will be sent!"),!1;let{editorMode:e}=g.getState();return this.enableAnalyticsEvents&&!e}sendKhubSearchEvent(e,r){let n={offline:!1,appVersion:this.appVersion,appName:this.appName,name:be.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:ct(e.metadataFilters),facets:e.metadataFilters.map(i=>lt(i))}};this.eventsService.sendKhubSearchEvent(n)}sendDocumentSearchEvent(e,r){let n={offline:!1,appVersion:this.appVersion,appName:this.appName,name:be.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:ct(e.metadataFilters),facets:e.metadataFilters.map(i=>lt(i))},publication:this.publication};this.eventsService.sendDocumentSearchEvent(n)}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,i;e.type==le.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let a={offline:!1,appVersion:this.appVersion,appName:this.appName,name:be.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:ct(n.metadataFilters),facets:n.metadataFilters.map(s=>lt(s))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:i},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchPageSelectEvent(a)}convertDocument(e){switch(e.type){case le.MAP:return{id:e.map.mapId,title:e.map.title,type:ge.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case le.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:ge.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case le.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:ge.UNSTRUCTURED_DOCUMENT,metadata:e.document.metadata,mimeType:e.document.mimeType};default:throw new TypeError("Unknown type "+e.type)}}convertExternalLink(e){var r,n,i,a,s;return(a=(n=(r=e.map)===null||r===void 0?void 0:r.originUrl)!==null&&n!==void 0?n:(i=e.topic)===null||i===void 0?void 0:i.originUrl)!==null&&a!==void 0?a:(s=e.document)===null||s===void 0?void 0:s.originUrl}};var U=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Kt=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e})}},zt=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e})}},Gt=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n}})}},D=class extends K.FtLitElementRedux{get stateManager(){if(this._stateManager==null){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=Le.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),e),this._stateManager.errorHandler=r=>this.handleLoadError(r),this.addStore(this.stateManager.store,"search")}return this._stateManager}get eventManager(){return this._eventManager==null&&(this._eventManager=new dt(this.stateManager.store)),this._eventManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.otherQueryParams={},this.addStore(g)}render(){return _n.html`
|
|
6
|
+
`}update(e){var r,n,i,a,s;super.update(e),e.has("baseUrl")&&(g.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&g.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("uiLocale")&&g.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&g.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&g.actions.noCustom(this.noCustom),e.has("editorMode")&&g.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&g.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&g.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>Tr.addContext(u)),e.has("openExternalDocumentInNewTab")&&g.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&g.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&g.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(g.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),g.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),g.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};P.elementDefinitions={};P.styles=Or;M([(0,B.property)()],P.prototype,"baseUrl",void 0);M([(0,B.property)()],P.prototype,"apiIntegrationIdentifier",void 0);M([(0,B.property)()],P.prototype,"uiLocale",void 0);M([(0,G.jsonProperty)(null)],P.prototype,"availableUiLocales",void 0);M([(0,G.jsonProperty)(null)],P.prototype,"metadataConfiguration",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"editorMode",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"noCustom",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"openExternalDocumentInNewTab",void 0);M([(0,B.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],P.prototype,"noCustomComponent",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"withManualResources",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"navigatorOnline",void 0);M([(0,B.property)({type:Boolean})],P.prototype,"forcedOffline",void 0);M([(0,B.property)({type:Object})],P.prototype,"apiProvider",void 0);M([(0,G.jsonProperty)([])],P.prototype,"messageContexts",void 0);M([(0,G.jsonProperty)(void 0)],P.prototype,"session",void 0);M([(0,B.state)()],P.prototype,"localesConfiguration",void 0);var _i=O(J());function Vn(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!He(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!He(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let a=s=>Object.keys(s).filter(u=>s[u]!=null);if(i=a(t),r=i.length,r!==a(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let s=i[n];if(!He(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function He(t,e){try{return Vn(t,e)}catch{return!1}}function Ke(t,e){return!He(t,e)}function ze(t){return window.structuredClone?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}var qn=O(J(),1);var Ge=class{constructor(){this.queue=[]}add(e,r=!1){r&&(this.queue=this.queue.filter(n=>n.type!==e.type)),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}};var Ce=O(J(),1);var Cr=O(J(),1);function Rr(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,Cr.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:Ke,...e??{}})}var We=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,a=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let s of n)try{await s()}catch(u){i(u);return}a(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Dr=O(me(),1);var $e=globalThis,Hn=$e.ShadowRoot&&($e.ShadyCSS===void 0||$e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ta=Symbol();var Pr=(t,e)=>{if(Hn)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=$e.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}};var Qe=class extends Dr.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,a])=>e.registry.define(i,a)));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return Pr(n,e.elementStyles),n}};var Ye=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Lr,Ir=Symbol("constructorPrototype"),kr=Symbol("constructorName"),Mr=Symbol("exportpartsDebouncer"),Nr=Symbol("dynamicDependenciesLoaded"),te=class extends Qe{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Lr]=new We(5),this[kr]=this.constructor.name,this[Ir]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[kr]&&Object.setPrototypeOf(this,this[Ir])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(r){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",r)}let e=this.constructor;e[Nr]||(e[Nr]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate()})}contentAvailableCallback(e){}applyCustomStylesheet(e){var r,n,i;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(a=>a.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(a){console.error(a,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let a=document.createElement("style");a.classList.add("ft-lit-element--custom-stylesheet"),a.innerHTML=this.customStylesheet,this.shadowRoot.append(a)}}scheduleExportpartsUpdate(){var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[Mr].run(()=>{var i,a;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((a=this.exportpartsPrefixes)===null||a===void 0?void 0:a.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(e){var r,n,i,a,s,u;let d=p=>p!=null&&p.trim().length>0,c=e.filter(d).map(p=>p.trim());if(c.length===0){this.removeAttribute("exportparts");return}let f=new Set;for(let p of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(a=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&a!==void 0?a:[],y=(u=(s=p.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(m=>m.split(":")[1]))!==null&&u!==void 0?u:[];new Array(...v,...y).filter(d).map(m=>m.trim()).forEach(m=>f.add(m))}if(f.size===0){this.removeAttribute("exportparts");return}let h=[...f.values()].flatMap(p=>c.map(v=>`${p}:${v}--${p}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};Lr=Mr;Ye([(0,Ce.property)()],te.prototype,"exportpartsPrefix",void 0);Ye([Rr([])],te.prototype,"exportpartsPrefixes",void 0);Ye([(0,Ce.property)()],te.prototype,"customStylesheet",void 0);Ye([(0,Ce.state)()],te.prototype,"useAdoptedStyleSheets",void 0);function Re(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Fr,Ur,jr,Pe=Symbol("internalReduxEventsUnsubscribers"),re=Symbol("internalStoresUnsubscribers"),fe=Symbol("internalStores"),De=class extends te{constructor(){super(...arguments),this[Fr]=new Map,this[Ur]=new Map,this[jr]=new Map}get reduxConstructor(){return this.constructor}update(e){super.update(e),[...this.reduxConstructor.reduxReactiveProperties].some(r=>e.has(r))&&this.updateFromStores()}getUnnamedStore(){if(this[fe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[fe].values()][0]}getStore(e){return e==null?this.getUnnamedStore():this[fe].get(e)}addStore(e,r){var n;r=(n=r??(Re(e)?e.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(r),this[fe].set(r,e),this.subscribeToStore(r,e),this.updateFromStores()}removeStore(e){let r=typeof e=="string"?e:e.name;this.unsubscribeFromStore(r),this[fe].delete(r)}setupStores(){this.unsubscribeFromStores(),this[fe].forEach((e,r)=>this.subscribeToStore(r,e)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((e,r)=>{let n=this.constructor.getPropertyOptions(r);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:r)){let i=this.getStore(e.store);i&&(e.store?this[re].has(e.store):this[re].size>0)&&(this[r]=e.selector(i.getState(),this))}})}subscribeToStore(e,r){var n;this[re].set(e,r.subscribe(()=>this.updateFromStores())),this[Pe].set(e,[]),Re(r)&&r.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((i,a)=>{if(typeof this[a]=="function"&&(!i.store||r.name===i.store)){let s=u=>this[a](u);r.addEventListener(i.eventName,s),this[Pe].get(e).push(()=>r.removeEventListener(i.eventName,s))}})),this.onStoreAvailable(e)}unsubscribeFromStores(){this[re].forEach((e,r)=>this.unsubscribeFromStore(r))}unsubscribeFromStore(e){var r;this[re].has(e)&&this[re].get(e)(),this[re].delete(e),(r=this[Pe].get(e))===null||r===void 0||r.forEach(n=>n()),this[Pe].delete(e)}onStoreAvailable(e){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};Fr=re,Ur=fe,jr=Pe;De.reduxProperties=new Map;De.reduxReactiveProperties=new Set;De.reduxEventListeners=new Map;function H(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var i,a;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Y(t){return!!t&&!!t[C]}function W(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Xn}(t)||Array.isArray(t)||!!t[Gr]||!!(!((e=t.constructor)===null||e===void 0)&&e[Gr])||Ot(t)||xt(t))}function pe(t,e,r){r===void 0&&(r=!1),xe(t)===0?(r?Object.keys:Oe)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function xe(t){var e=t[C];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Ot(t)?2:xt(t)?3:0}function we(t,e){return xe(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Kn(t,e){return xe(t)===2?t.get(e):t[e]}function Wr(t,e,r){var n=xe(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function $r(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Ot(t){return Qn&&t instanceof Map}function xt(t){return Yn&&t instanceof Set}function ne(t){return t.o||t.t}function Tt(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Xr(t);delete e[C];for(var r=Oe(e),n=0;n<r.length;n++){var i=r[n],a=e[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function _t(t,e){return e===void 0&&(e=!1),Ct(t)||Y(t)||!W(t)||(xe(t)>1&&(t.set=t.add=t.clear=t.delete=zn),Object.freeze(t),e&&pe(t,function(r,n){return _t(n,!0)},!0)),t}function zn(){H(2)}function Ct(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Q(t){var e=wt[t];return e||H(18,t),e}function Gn(t,e){wt[t]||(wt[t]=e)}function Et(){return ke}function mt(t,e){e&&(Q("Patches"),t.u=[],t.s=[],t.v=e)}function Xe(t){St(t),t.p.forEach(Wn),t.p=null}function St(t){t===ke&&(ke=t.l)}function Br(t){return ke={p:[],l:ke,h:t,m:!0,_:0}}function Wn(t){var e=t[C];e.i===0||e.i===1?e.j():e.g=!0}function vt(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||Q("ES5").S(e,t,n),n?(r[C].P&&(Xe(e),H(4)),W(t)&&(t=Je(e,t),e.l||Ze(e,t)),e.u&&Q("Patches").M(r[C].t,t,e.u,e.s)):t=Je(e,r,[]),Xe(e),e.u&&e.v(e.u,e.s),t!==Yr?t:void 0}function Je(t,e,r){if(Ct(e))return e;var n=e[C];if(!n)return pe(e,function(u,d){return Vr(t,n,e,u,d,r)},!0),e;if(n.A!==t)return e;if(!n.P)return Ze(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Tt(n.k):n.o,a=i,s=!1;n.i===3&&(a=new Set(i),i.clear(),s=!0),pe(a,function(u,d){return Vr(t,n,i,u,d,r,s)}),Ze(t,i,!1),r&&t.u&&Q("Patches").N(n,r,t.u,t.s)}return n.o}function Vr(t,e,r,n,i,a,s){if(Y(i)){var u=Je(t,i,a&&e&&e.i!==3&&!we(e.R,n)?a.concat(n):void 0);if(Wr(r,n,u),!Y(u))return;t.m=!1}else s&&r.add(i);if(W(i)&&!Ct(i)){if(!t.h.D&&t._<1)return;Je(t,i),e&&e.A.l||Ze(t,i)}}function Ze(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&_t(e,r)}function gt(t,e){var r=t[C];return(r?ne(r):t)[e]}function qr(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function ie(t){t.P||(t.P=!0,t.l&&ie(t.l))}function bt(t){t.o||(t.o=Tt(t.t))}function At(t,e,r){var n=Ot(e)?Q("MapSet").F(e,r):xt(e)?Q("MapSet").T(e,r):t.O?function(i,a){var s=Array.isArray(i),u={i:s?1:0,A:a?a.A:Et(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},d=u,c=Ne;s&&(d=[u],c=Ie);var f=Proxy.revocable(d,c),h=f.revoke,p=f.proxy;return u.k=p,u.j=h,p}(e,r):Q("ES5").J(e,r);return(r?r.A:Et()).p.push(n),n}function $n(t){return Y(t)||H(22,t),function e(r){if(!W(r))return r;var n,i=r[C],a=xe(r);if(i){if(!i.P&&(i.i<4||!Q("ES5").K(i)))return i.t;i.I=!0,n=Hr(r,a),i.I=!1}else n=Hr(r,a);return pe(n,function(s,u){i&&Kn(i.t,s)===u||Wr(n,s,e(u))}),a===3?new Set(n):n}(t)}function Hr(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Tt(t)}function Qr(){function t(s,u){var d=a[s];return d?d.enumerable=u:a[s]=d={configurable:!0,enumerable:u,get:function(){var c=this[C];return Ne.get(c,s)},set:function(c){var f=this[C];Ne.set(f,s,c)}},d}function e(s){for(var u=s.length-1;u>=0;u--){var d=s[u][C];if(!d.P)switch(d.i){case 5:n(d)&&ie(d);break;case 4:r(d)&&ie(d)}}}function r(s){for(var u=s.t,d=s.k,c=Oe(d),f=c.length-1;f>=0;f--){var h=c[f];if(h!==C){var p=u[h];if(p===void 0&&!we(u,h))return!0;var v=d[h],y=v&&v[C];if(y?y.t!==p:!$r(v,p))return!0}}var m=!!u[C];return c.length!==Oe(u).length+(m?0:1)}function n(s){var u=s.k;if(u.length!==s.t.length)return!0;var d=Object.getOwnPropertyDescriptor(u,u.length-1);if(d&&!d.get)return!0;for(var c=0;c<u.length;c++)if(!u.hasOwnProperty(c))return!0;return!1}function i(s){s.g&&H(3,JSON.stringify(ne(s)))}var a={};Gn("ES5",{J:function(s,u){var d=Array.isArray(s),c=function(h,p){if(h){for(var v=Array(p.length),y=0;y<p.length;y++)Object.defineProperty(v,""+y,t(y,!0));return v}var m=Xr(p);delete m[C];for(var w=Oe(m),E=0;E<w.length;E++){var S=w[E];m[S]=t(S,h||!!m[S].enumerable)}return Object.create(Object.getPrototypeOf(p),m)}(d,s),f={i:d?5:4,A:u?u.A:Et(),P:!1,I:!1,R:{},l:u,t:s,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,C,{value:f,writable:!0}),c},S:function(s,u,d){d?Y(u)&&u[C].A===s&&e(s.p):(s.u&&function c(f){if(f&&typeof f=="object"){var h=f[C];if(h){var p=h.t,v=h.k,y=h.R,m=h.i;if(m===4)pe(v,function(x){x!==C&&(p[x]!==void 0||we(p,x)?y[x]||c(v[x]):(y[x]=!0,ie(h)))}),pe(p,function(x){v[x]!==void 0||we(v,x)||(y[x]=!1,ie(h))});else if(m===5){if(n(h)&&(ie(h),y.length=!0),v.length<p.length)for(var w=v.length;w<p.length;w++)y[w]=!1;else for(var E=p.length;E<v.length;E++)y[E]=!0;for(var S=Math.min(v.length,p.length),_=0;_<S;_++)v.hasOwnProperty(_)||(y[_]=!0),y[_]===void 0&&c(v[_])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?r(s):n(s)}})}var Kr,ke,Rt=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Qn=typeof Map<"u",Yn=typeof Set<"u",zr=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Yr=Rt?Symbol.for("immer-nothing"):((Kr={})["immer-nothing"]=!0,Kr),Gr=Rt?Symbol.for("immer-draftable"):"__$immer_draftable",C=Rt?Symbol.for("immer-state"):"__$immer_state";var Xn=""+Object.prototype.constructor,Oe=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Xr=Object.getOwnPropertyDescriptors||function(t){var e={};return Oe(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},wt={},Ne={get:function(t,e){if(e===C)return t;var r=ne(t);if(!we(r,e))return function(i,a,s){var u,d=qr(a,s);return d?"value"in d?d.value:(u=d.get)===null||u===void 0?void 0:u.call(i.k):void 0}(t,r,e);var n=r[e];return t.I||!W(n)?n:n===gt(t.t,e)?(bt(t),t.o[e]=At(t.A.h,n,t)):n},has:function(t,e){return e in ne(t)},ownKeys:function(t){return Reflect.ownKeys(ne(t))},set:function(t,e,r){var n=qr(ne(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var i=gt(ne(t),e),a=i?.[C];if(a&&a.t===r)return t.o[e]=r,t.R[e]=!1,!0;if($r(r,i)&&(r!==void 0||we(t.t,e)))return!0;bt(t),ie(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return gt(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,bt(t),ie(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=ne(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){H(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){H(12)}},Ie={};pe(Ne,function(t,e){Ie[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Ie.deleteProperty=function(t,e){return Ie.set.call(this,t,e,void 0)},Ie.set=function(t,e,r){return Ne.set.call(this,t[0],e,r,t[0])};var Jn=function(){function t(r){var n=this;this.O=zr,this.D=!0,this.produce=function(i,a,s){if(typeof i=="function"&&typeof a!="function"){var u=a;a=i;var d=n;return function(m){var w=this;m===void 0&&(m=u);for(var E=arguments.length,S=Array(E>1?E-1:0),_=1;_<E;_++)S[_-1]=arguments[_];return d.produce(m,function(x){var k;return(k=a).call.apply(k,[w,x].concat(S))})}}var c;if(typeof a!="function"&&H(6),s!==void 0&&typeof s!="function"&&H(7),W(i)){var f=Br(n),h=At(n,i,void 0),p=!0;try{c=a(h),p=!1}finally{p?Xe(f):St(f)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return mt(f,s),vt(m,f)},function(m){throw Xe(f),m}):(mt(f,s),vt(c,f))}if(!i||typeof i!="object"){if((c=a(i))===void 0&&(c=i),c===Yr&&(c=void 0),n.D&&_t(c,!0),s){var v=[],y=[];Q("Patches").M(i,c,v,y),s(v,y)}return c}H(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(c){for(var f=arguments.length,h=Array(f>1?f-1:0),p=1;p<f;p++)h[p-1]=arguments[p];return n.produceWithPatches(c,function(v){return i.apply(void 0,[v].concat(h))})};var s,u,d=n.produce(i,a,function(c,f){s=c,u=f});return typeof Promise<"u"&&d instanceof Promise?d.then(function(c){return[c,s,u]}):[d,s,u]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){W(r)||H(8),Y(r)&&(r=$n(r));var n=Br(this),i=At(this,r,void 0);return i[C].C=!0,St(n),i},e.finishDraft=function(r,n){var i=r&&r[C],a=i.A;return mt(a,n),vt(void 0,a)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!zr&&H(20),this.O=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}i>-1&&(n=n.slice(i+1));var s=Q("Patches").$;return Y(r)?s(r,n):this.produce(r,function(u){return s(u,n)})},t}(),V=new Jn,Zn=V.produce,Ua=V.produceWithPatches.bind(V),ja=V.setAutoFreeze.bind(V),Ba=V.setUseProxies.bind(V),Va=V.applyPatches.bind(V),qa=V.createDraft.bind(V),Ha=V.finishDraft.bind(V),et=Zn;function he(t){"@babel/helpers - typeof";return he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(t)}function Jr(t,e){if(he(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(he(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zr(t){var e=Jr(t,"string");return he(e)=="symbol"?e:e+""}function en(t,e,r){return(e=Zr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Pt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tn(Object(r),!0).forEach(function(n){en(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function F(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. "}var rn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Dt=function(){return Math.random().toString(36).substring(7).split("").join(".")},tt={INIT:"@@redux/INIT"+Dt(),REPLACE:"@@redux/REPLACE"+Dt(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Dt()}};function ei(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function It(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(F(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(F(1));return r(It)(t,e)}if(typeof t!="function")throw new Error(F(2));var i=t,a=e,s=[],u=s,d=!1;function c(){u===s&&(u=s.slice())}function f(){if(d)throw new Error(F(3));return a}function h(m){if(typeof m!="function")throw new Error(F(4));if(d)throw new Error(F(5));var w=!0;return c(),u.push(m),function(){if(w){if(d)throw new Error(F(6));w=!1,c();var S=u.indexOf(m);u.splice(S,1),s=null}}}function p(m){if(!ei(m))throw new Error(F(7));if(typeof m.type>"u")throw new Error(F(8));if(d)throw new Error(F(9));try{d=!0,a=i(a,m)}finally{d=!1}for(var w=s=u,E=0;E<w.length;E++){var S=w[E];S()}return m}function v(m){if(typeof m!="function")throw new Error(F(10));i=m,p({type:tt.REPLACE})}function y(){var m,w=h;return m={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(F(11));function _(){S.next&&S.next(f())}_();var x=w(_);return{unsubscribe:x}}},m[rn]=function(){return this},m}return p({type:tt.INIT}),n={dispatch:p,subscribe:h,getState:f,replaceReducer:v},n[rn]=y,n}function ti(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:tt.INIT});if(typeof n>"u")throw new Error(F(12));if(typeof r(void 0,{type:tt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(F(13))})}function nn(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(r[i]=t[i])}var a=Object.keys(r),s,u;try{ti(r)}catch(d){u=d}return function(c,f){if(c===void 0&&(c={}),u)throw u;if(0)var h;for(var p=!1,v={},y=0;y<a.length;y++){var m=a[y],w=r[m],E=c[m],S=w(E,f);if(typeof S>"u"){var _=f&&f.type;throw new Error(F(14))}v[m]=S,p=p||S!==E}return p=p||a.length!==Object.keys(c).length,p?v:c}}function Te(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function an(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(F(15))},s={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},u=e.map(function(d){return d(s)});return a=Te.apply(void 0,u)(i.dispatch),Pt(Pt({},i),{},{dispatch:a})}}}function sn(t){var e=function(n){var i=n.dispatch,a=n.getState;return function(s){return function(u){return typeof u=="function"?u(i,a,t):s(u)}}};return e}var on=sn();on.withExtraArgument=sn;var kt=on;var fn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ri=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(c){return function(f){return d([c,f])}}function d(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(f){c=[6,f],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},_e=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},ni=Object.defineProperty,ii=Object.defineProperties,ai=Object.getOwnPropertyDescriptors,un=Object.getOwnPropertySymbols,si=Object.prototype.hasOwnProperty,oi=Object.prototype.propertyIsEnumerable,cn=function(t,e,r){return e in t?ni(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ae=function(t,e){for(var r in e||(e={}))si.call(e,r)&&cn(t,r,e[r]);if(un)for(var n=0,i=un(e);n<i.length;n++){var r=i[n];oi.call(e,r)&&cn(t,r,e[r])}return t},Nt=function(t,e){return ii(t,ai(e))},ui=function(t,e,r){return new Promise(function(n,i){var a=function(d){try{u(r.next(d))}catch(c){i(c)}},s=function(d){try{u(r.throw(d))}catch(c){i(c)}},u=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(a,s)};u((r=r.apply(t,e)).next())})};var ci=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Te:Te.apply(null,arguments)},os=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function li(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var di=function(t){fn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,_e([void 0],r[0].concat(this)))):new(e.bind.apply(e,_e([void 0],r.concat(this))))},e}(Array),fi=function(t){fn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,_e([void 0],r[0].concat(this)))):new(e.bind.apply(e,_e([void 0],r.concat(this))))},e}(Array);function Ft(t){return W(t)?et(t,function(){}):t}function pi(t){return typeof t=="boolean"}function hi(){return function(e){return yi(e)}}function yi(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,a=t.serializableCheck,s=a===void 0?!0:a,u=new di;if(r&&(pi(r)?u.push(kt):u.push(kt.withExtraArgument(r.extraArgument))),0){if(i)var d;if(s)var c}return u}var Lt=!0;function pn(t){var e=hi(),r=t||{},n=r.reducer,i=n===void 0?void 0:n,a=r.middleware,s=a===void 0?e():a,u=r.devTools,d=u===void 0?!0:u,c=r.preloadedState,f=c===void 0?void 0:c,h=r.enhancers,p=h===void 0?void 0:h,v;if(typeof i=="function")v=i;else if(li(i))v=nn(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var y=s;if(typeof y=="function"&&(y=y(e),!Lt&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Lt&&y.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var m=an.apply(void 0,y),w=Te;d&&(w=ci(ae({trace:!Lt},typeof d=="object"&&d)));var E=new fi(m),S=E;Array.isArray(p)?S=_e([m],p):typeof p=="function"&&(S=p(E));var _=w.apply(void 0,S);return It(v,f,_)}function se(t,e){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var a=e.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return ae(ae({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}function hn(t){var e={},r=[],n,i={addCase:function(a,s){var u=typeof a=="string"?a:a.type;if(u in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[u]=s,i},addMatcher:function(a,s){return r.push({matcher:a,reducer:s}),i},addDefaultCase:function(a){return n=a,i}};return t(i),[e,r,n]}function mi(t){return typeof t=="function"}function vi(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?hn(e):[e,r,n],a=i[0],s=i[1],u=i[2],d;if(mi(t))d=function(){return Ft(t())};else{var c=Ft(t);d=function(){return c}}function f(h,p){h===void 0&&(h=d());var v=_e([a[p.type]],s.filter(function(y){var m=y.matcher;return m(p)}).map(function(y){var m=y.reducer;return m}));return v.filter(function(y){return!!y}).length===0&&(v=[u]),v.reduce(function(y,m){if(m)if(Y(y)){var w=y,E=m(w,p);return E===void 0?y:E}else{if(W(y))return et(y,function(S){return m(S,p)});var E=m(y,p);if(E===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}return y},h)}return f.getInitialState=d,f}function gi(t,e){return t+"/"+e}function yn(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:Ft(t.initialState),n=t.reducers||{},i=Object.keys(n),a={},s={},u={};i.forEach(function(f){var h=n[f],p=gi(e,f),v,y;"reducer"in h?(v=h.reducer,y=h.prepare):v=h,a[f]=v,s[p]=v,u[f]=y?se(p,y):se(p)});function d(){var f=typeof t.extraReducers=="function"?hn(t.extraReducers):[t.extraReducers],h=f[0],p=h===void 0?{}:h,v=f[1],y=v===void 0?[]:v,m=f[2],w=m===void 0?void 0:m,E=ae(ae({},p),s);return vi(r,function(S){for(var _ in E)S.addCase(_,E[_]);for(var x=0,k=y;x<k.length;x++){var z=k[x];S.addMatcher(z.matcher,z.reducer)}w&&S.addDefaultCase(w)})}var c;return{name:e,reducer:function(f,h){return c||(c=d()),c(f,h)},actions:u,caseReducers:a,getInitialState:function(){return c||(c=d()),c.getInitialState()}}}var bi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ei=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=bi[Math.random()*64|0];return e},Si=["name","message","stack","code"],Mt=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),ln=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Ai=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=Si;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},ds=function(){function t(e,r,n){var i=se(e+"/fulfilled",function(f,h,p,v){return{payload:f,meta:Nt(ae({},v||{}),{arg:p,requestId:h,requestStatus:"fulfilled"})}}),a=se(e+"/pending",function(f,h,p){return{payload:void 0,meta:Nt(ae({},p||{}),{arg:h,requestId:f,requestStatus:"pending"})}}),s=se(e+"/rejected",function(f,h,p,v,y){return{payload:v,error:(n&&n.serializeError||Ai)(f||"Rejected"),meta:Nt(ae({},y||{}),{arg:p,requestId:h,rejectedWithValue:!!v,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"})}}),u=!1,d=typeof AbortController<"u"?AbortController:function(){function f(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return f.prototype.abort=function(){},f}();function c(f){return function(h,p,v){var y=n?.idGenerator?n.idGenerator(f):Ei(),m=new d,w,E=!1;function S(x){w=x,m.abort()}var _=function(){return ui(this,null,function(){var x,k,z,oe,j,ue,ye;return ri(this,function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),oe=(x=n?.condition)==null?void 0:x.call(n,f,{getState:p,extra:v}),Oi(oe)?[4,oe]:[3,2];case 1:oe=o.sent(),o.label=2;case 2:if(oe===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return E=!0,j=new Promise(function(l,b){return m.signal.addEventListener("abort",function(){return b({name:"AbortError",message:w||"Aborted"})})}),h(a(y,f,(k=n?.getPendingMeta)==null?void 0:k.call(n,{requestId:y,arg:f},{getState:p,extra:v}))),[4,Promise.race([j,Promise.resolve(r(f,{dispatch:h,getState:p,extra:v,requestId:y,signal:m.signal,abort:S,rejectWithValue:function(l,b){return new Mt(l,b)},fulfillWithValue:function(l,b){return new ln(l,b)}})).then(function(l){if(l instanceof Mt)throw l;return l instanceof ln?i(l.payload,y,f,l.meta):i(l,y,f)})])];case 3:return z=o.sent(),[3,5];case 4:return ue=o.sent(),z=ue instanceof Mt?s(null,y,f,ue.payload,ue.meta):s(ue,y,f),[3,5];case 5:return ye=n&&!n.dispatchConditionRejection&&s.match(z)&&z.meta.condition,ye||h(z),[2,z]}})})}();return Object.assign(_,{abort:S,requestId:y,arg:f,unwrap:function(){return _.then(wi)}})}}return Object.assign(c,{pending:a,rejected:s,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function wi(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Oi(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var mn="listener",vn="completed",gn="cancelled",fs="task-"+gn,ps="task-"+vn,hs=mn+"-"+gn,ys=mn+"-"+vn;var Ut="listenerMiddleware";var ms=se(Ut+"/add"),vs=se(Ut+"/removeAll"),gs=se(Ut+"/remove");var dn,bs=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(dn||(dn=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},xi=function(t){return function(e){setTimeout(e,t)}},Es=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:xi(10);Qr();function Ti(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,i){this.eventBus.addEventListener(r,n,i)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,i){this.eventBus.removeEventListener(r,n,i)}}}var rt=class extends Ti(Object){};window.ftReduxStores||(window.ftReduxStores={});var bn=class t extends rt{static get(e){var r;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,a=window.ftReduxStores[n];if(Re(a))return a;if(i==null)return;let s=yn({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),u=pn({reducer:(d,c)=>c.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__")?{...d,...c.overwrites}:s.reducer(d,c)});return window.ftReduxStores[i.name]=new t(s,u,i.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new Ge,this.actions=new Proxy(this.reduxSlice.actions,{get:(i,a,s)=>{let u=a,d=i[u];return d?(...c)=>{let f=d(...c.map(ze));return this.reduxStore.dispatch(f),f}:c=>{this.setState({[u]:ze(c)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}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 ze(this.reduxStore.getState())}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var st=O(L());var nt=class extends ${async listMySearches(){let e=g.getState().session;return e?.sessionAuthenticated?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var it=class extends ${async listMyBookmarks(){let e=g.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Ci="ft-user-assets",at=st.FtReduxStore.get({name:Ci,initialState:{savedSearches:void 0,bookmarks:void 0}}),jt=class{constructor(){this.currentSession=g.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new it,this.savedSearchesService=new nt,g.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=g.getState();(0,st.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),at.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),at.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();at.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;at.actions.bookmarks(r)}}},En=new jt;var Bt=class{addCommand(e,r=!1){g.commands.add(e,r)}consumeCommand(e){return g.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Bt;var Sn=O(L()),Vt=class{highlightHtml(e,r,n){(0,Sn.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Vt;var An=O(L());var qt=class{isDate(e){var r,n,i,a;return(a=(i=((n=(r=g.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(u=>u.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,r){var n,i,a;return An.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:g.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new qt;var Ri=O(L());var ot=class extends Ae{async sendDocumentStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.start_display event"),console.debug(r)})}async sendTopicStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send topic.start_display event"),console.debug(r)})}async sendKhubSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send khub.search event"),console.debug(r)})}async sendDocumentSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.search event"),console.debug(r)})}async sendSearchPageSelectEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_page.select event"),console.debug(r)})}};(0,wn.customElement)("ft-app-context")(P);var ut=class extends ${constructor(e){super(!0,e),this.sortObjectFields=(r,n)=>typeof n!="object"||n==null||Array.isArray(n)?n:Object.fromEntries(Object.entries(n).sort(([i],[a])=>i.localeCompare(a)))}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,i)=>n.id.localeCompare(i.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),2*60*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),2*60*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,i)=>n.localeCompare(i))}}).sort((r,n)=>r.key.localeCompare(n.key))}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Pi=t=>t.request.virtualField===Ee.TITLE_ONLY&&t.request.scope===Se.DOCUMENTS,ct=class t extends Event{constructor(){super(t.eventName)}};ct.eventName="search-context-clear-all-filters";var Le=class t{static build(e,r){return new t(tr(e.trim()||"context"),r)}constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new q.Debouncer(10),this.searchDebouncer=new q.Debouncer(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest(this.store.getState()))),this.buildSearchRequest=n=>({...n.request,facets:this.facetIds.map(i=>({id:i}))}),this.suggestDebouncer=new q.Debouncer(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>({input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:n.request.sort,contentLocale:n.request.contentLocale,scope:n.request.scope}),this.service=r??new ut,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,q.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,q.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.launchSearch()}setQuery(e){this.store.actions.setRequestQuery(e),this.store.actions.liveQuery(e),this.store.actions.setPageNumber(1)}setContentLocale(e){var r;let n=(r=this.store.getState().locales)!==null&&r!==void 0?r:[],i=this.store.getState().request.contentLocale;if(e!=i){if(n.length>0){let a=s=>n.some(u=>u.lang==s);a(e)||(e=a(i)?i:n[0].lang)}this.store.actions.setRequestContentLocale(e),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([])}return e}forceContentLocale(e){this.store.actions.setRequestContentLocale(e)}setPageSize(e){this.store.actions.setPageSize(e)}setPageNumber(e){this.store.actions.setPageNumber(e)}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.store.actions.setRequestFilters(r),this.store.actions.setPageNumber(1)}setClusterSortCriterion(e){this.store.actions.setRequestClusterSortCriterion(e)}setSearchInDocumentTitlesOnly(e){e?(this.store.actions.setRequestVirtualField(Ee.TITLE_ONLY),this.store.actions.setRequestScope(Se.DOCUMENTS)):(this.store.actions.setRequestVirtualField(Ee.EVERYWHERE),this.store.actions.setRequestScope(Se.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return Pi(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new ct)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,r){let n=this.facetIds.filter(i=>i!=e);r&&n.push(r),this.facetIds=n}get facetIds(){var e;let r=this.store.getState().request;return[...new Set([...r.facets.map(n=>n.id),...((e=r.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(i=>({id:i}));this.store.actions.setRequestFacets(n)}setFilter(e,r){this.setValueFilter(e,r)}setValueFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,valueFilter:{values:r,negative:!1}},a=[...n.filter(s=>!s.valueFilter),...n.filter(s=>s.valueFilter&&s.key!==i.key),i];this.setFilters(a)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,dateFilter:{type:r}},a=[...n.filter(s=>!s.dateFilter),...n.filter(s=>s.dateFilter&&s.key!==i.key),i];this.setFilters(a)}removeDateFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(i=>!i.dateFilter),...r.filter(i=>i.dateFilter&&i.key!==e)];this.setFilters(n)}setRangeFilter(e,r,n){let i=this.store.getState().request.metadataFilters,a={key:e,rangeFilter:{from:r,to:n}},s=[...i.filter(u=>!u.rangeFilter),...i.filter(u=>u.rangeFilter&&u.key!==a.key),a];this.setFilters(s)}removeRangeFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(i=>!i.rangeFilter),...r.filter(i=>i.rangeFilter&&i.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.store.actions.setRequest({...e,facets:this.store.getState().request.facets}),this.store.actions.liveQuery(e.query),this.store.actions.setPageNumber(1)}setScope(e){this.store.actions.setRequestScope(e)}setOtherQueryParams(e){this.store.actions.setOtherQueryParams(e)}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}updateLocales(){return this.localesDebouncer.run(async()=>this.store.actions.locales((await this.service.getAvailableSearchLocales()).contentLocales))}async fetchSearchData(e){var r,n,i;try{if((r=this.cancelableSearch)===null||r===void 0||r.cancel(),this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=(0,q.cancelable)(this.service.launchSearch(e));let a=await this.cancelableSearch;if(a.paging.currentPage<=1)this.store.actions.results(a.results),this.store.actions.facets(a.facets),this.store.actions.spellcheck(a.spellcheck);else{let s=((n=this.store.getState().results)!==null&&n!==void 0?n:[]).concat(a.results);this.store.actions.results(s)}this.store.actions.paging(a.paging)}}catch(a){a instanceof q.CanceledPromiseError||(console.error(a),(i=this.errorHandler)===null||i===void 0||i.call(this,a))}}async fetchSuggestData(e){var r;try{(r=this.cancelableSuggest)===null||r===void 0||r.cancel(),this.cancelableSuggest=(0,q.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof q.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var Di=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Kt=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},Ht=Symbol("registerInterval");function Ii(t){var e;class r extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(i){this.clearStateManager(),this.stateManager=i,this.addStore(i.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Ht]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[Ht]):this.dispatchEvent(new Kt)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=Ht,Di([(0,Tn.state)()],r.prototype,"stateManager",void 0),r}var On=class extends Ii(xn.FtLitElementRedux){};var _n=O(L());function lt(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function dt(t){var e;return t.dateFilter?{key:t.key,type:"DATE",dateValue:t.dateFilter.type}:t.rangeFilter?{key:t.key,type:"RANGE",from:t.rangeFilter.from,to:t.rangeFilter.to}:{key:t.key,values:(e=t.valueFilter)===null||e===void 0?void 0:e.values}}var ft=class{constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.enableAnalyticsEvents=!0,this.appName=void 0,this.appVersion=void 0,this.publication=void 0,this.sendEvent=n=>{if(!this.canSendEvent()||!n)return;let i=this.store.getState().request;this.publication==null?this.sendKhubSearchEvent(i,n):this.sendDocumentSearchEvent(i,n)},this.eventsService=r??new ot,this.resultsWatcher=(0,_n.watch)(e,n=>n.results,this.sendEvent)}setEnableAnalyticsEvents(e){this.enableAnalyticsEvents=e}setAppName(e){this.appName=e}setAppVersion(e){this.appVersion=e}setDocumentSearch(e){this.publication=e}canSendEvent(){if(this.appName==null||this.appVersion==null)return console.debug("ft-search-context.eventManager is not initialized. No events will be sent!"),!1;let{editorMode:e}=g.getState();return this.enableAnalyticsEvents&&!e}sendKhubSearchEvent(e,r){let n={offline:!1,appVersion:this.appVersion,appName:this.appName,name:be.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:lt(e.metadataFilters),facets:e.metadataFilters.map(i=>dt(i))}};this.eventsService.sendKhubSearchEvent(n)}sendDocumentSearchEvent(e,r){let n={offline:!1,appVersion:this.appVersion,appName:this.appName,name:be.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:lt(e.metadataFilters),facets:e.metadataFilters.map(i=>dt(i))},publication:this.publication};this.eventsService.sendDocumentSearchEvent(n)}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,i;e.type==le.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let a={offline:!1,appVersion:this.appVersion,appName:this.appName,name:be.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:lt(n.metadataFilters),facets:n.metadataFilters.map(s=>dt(s))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:i},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchPageSelectEvent(a)}convertDocument(e){switch(e.type){case le.MAP:return{id:e.map.mapId,title:e.map.title,type:ge.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case le.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:ge.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case le.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:ge.UNSTRUCTURED_DOCUMENT,metadata:e.document.metadata,mimeType:e.document.mimeType};default:throw new TypeError("Unknown type "+e.type)}}convertExternalLink(e){var r,n,i,a,s;return(a=(n=(r=e.map)===null||r===void 0?void 0:r.originUrl)!==null&&n!==void 0?n:(i=e.topic)===null||i===void 0?void 0:i.originUrl)!==null&&a!==void 0?a:(s=e.document)===null||s===void 0?void 0:s.originUrl}};var U=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(s=t[u])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},zt=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e})}},Gt=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e})}},Wt=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n}})}},D=class extends K.FtLitElementRedux{get stateManager(){if(this._stateManager==null){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=Le.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),e),this._stateManager.errorHandler=r=>this.handleLoadError(r),this.addStore(this.stateManager.store,"search")}return this._stateManager}get eventManager(){return this._eventManager==null&&(this._eventManager=new ft(this.stateManager.store)),this._eventManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.otherQueryParams={},this.addStore(g)}render(){return Cn.html`
|
|
7
7
|
<slot @register-ft-search-component=${this.registerComponent} @ft-search-result-click="${this.onResultClicked}"></slot>
|
|
8
|
-
`}update(e){super.update(e),e.has("query")&&this.query!==void 0&&this.stateManager.setQuery(this.query),e.has("contentLocale")&&this.contentLocale!==void 0&&this.stateManager.forceContentLocale(this.contentLocale),e.has("filters")&&this.filters!==void 0&&this.stateManager.setFilters(this.filters),e.has("sort")&&this.sort!==void 0&&this.stateManager.setSort(this.sort),e.has("pageSize")&&this.pageSize!==void 0&&this.stateManager.setPageSize(this.pageSize),e.has("searchInDocumentTitlesOnly")&&this.searchInDocumentTitlesOnly!==void 0&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),e.has("scope")&&this.scope!==void 0&&this.stateManager.setScope(this.scope),e.has("virtualField")&&this.virtualField!==void 0&&this.stateManager.setVirtualField(this.virtualField),e.has("ignoreEmptyQuery")&&this.ignoreEmptyQuery!==void 0&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),e.has("openExternalDocumentInNewTab")&&this.openExternalDocumentInNewTab!==void 0&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("otherQueryParams")&&this.otherQueryParams!==void 0&&this.stateManager.setOtherQueryParams(this.otherQueryParams),e.has("session")&&this.session!==void 0&&e.get("session")!=null&&(this.stateManager.service.clearCache(),this.stateManager.initService())}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.stateManager.clearResults(),this.stateManager.setQuery(this.query),this.stateManager.forceContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort),this.stateManager.setOtherQueryParams(this.otherQueryParams)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.clearResults()}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("request")&&this.request&&this.dispatchEvent(new
|
|
8
|
+
`}update(e){super.update(e),e.has("query")&&this.query!==void 0&&this.stateManager.setQuery(this.query),e.has("contentLocale")&&this.contentLocale!==void 0&&this.stateManager.forceContentLocale(this.contentLocale),e.has("filters")&&this.filters!==void 0&&this.stateManager.setFilters(this.filters),e.has("sort")&&this.sort!==void 0&&this.stateManager.setSort(this.sort),e.has("pageSize")&&this.pageSize!==void 0&&this.stateManager.setPageSize(this.pageSize),e.has("searchInDocumentTitlesOnly")&&this.searchInDocumentTitlesOnly!==void 0&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),e.has("scope")&&this.scope!==void 0&&this.stateManager.setScope(this.scope),e.has("virtualField")&&this.virtualField!==void 0&&this.stateManager.setVirtualField(this.virtualField),e.has("ignoreEmptyQuery")&&this.ignoreEmptyQuery!==void 0&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),e.has("openExternalDocumentInNewTab")&&this.openExternalDocumentInNewTab!==void 0&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("otherQueryParams")&&this.otherQueryParams!==void 0&&this.stateManager.setOtherQueryParams(this.otherQueryParams),e.has("session")&&this.session!==void 0&&e.get("session")!=null&&(this.stateManager.service.clearCache(),this.stateManager.initService())}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.stateManager.clearResults(),this.stateManager.setQuery(this.query),this.stateManager.forceContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort),this.stateManager.setOtherQueryParams(this.otherQueryParams)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.clearResults()}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("request")&&this.request&&this.dispatchEvent(new Gt(this.request)),e.has("paging")&&this.paging!==void 0&&this.dispatchEvent(new Wt(this.request,this.paging,this.autocorrect))}registerComponent(e){e.stopPropagation();let r=e.composedPath()[0];this.register(r)}register(e){e.setSearchStateManager(this.stateManager)}handleLoadError(e){this.dispatchEvent(new zt(e))}reloadSavedSearches(){En.clearMySearches()}clear(){this.stateManager.clear()}onResultClicked(e){this.eventManager.sendResultClickedEvent(e.detail.result,e.detail.rank)}};D.elementDefinitions={};D.styles=er;U([(0,K.redux)({store:g.name})],D.prototype,"session",void 0);U([(0,X.property)()],D.prototype,"query",void 0);U([(0,X.property)()],D.prototype,"contentLocale",void 0);U([(0,X.property)({type:Number})],D.prototype,"pageSize",void 0);U([(0,X.property)({type:Boolean})],D.prototype,"searchInDocumentTitlesOnly",void 0);U([(0,X.property)()],D.prototype,"scope",void 0);U([(0,X.property)()],D.prototype,"virtualField",void 0);U([(0,X.property)({type:Boolean})],D.prototype,"ignoreEmptyQuery",void 0);U([(0,K.redux)({store:g.name})],D.prototype,"openExternalDocumentInNewTab",void 0);U([(0,K.jsonProperty)([])],D.prototype,"filters",void 0);U([(0,K.jsonProperty)([])],D.prototype,"sort",void 0);U([(0,K.jsonProperty)({})],D.prototype,"otherQueryParams",void 0);U([(0,K.redux)({store:"search"})],D.prototype,"request",void 0);U([(0,K.redux)({store:"search"})],D.prototype,"paging",void 0);U([(0,K.redux)({store:"search",selector:t=>t.spellcheck})],D.prototype,"autocorrect",void 0);U([(0,X.property)({attribute:!1})],D.prototype,"searchServiceProvider",void 0);(0,Rn.customElement)("ft-search-context")(D);})();
|
|
9
9
|
/*! Bundled license information:
|
|
10
10
|
|
|
11
11
|
@lit/reactive-element/css-tag.js:
|