@fluid-topics/ft-search-type 1.1.62 → 1.1.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1250,58 +1250,59 @@ function Re(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=$
1250
1250
  margin: 10px 0;
1251
1251
  color: ${Zc.colorOnSurfaceMedium};
1252
1252
  }
1253
- `;var Vc=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class qc extends Mi{constructor(){super(...arguments),this.filterId="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=[...this.options];this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return Jt`
1253
+ `;var Vc=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class qc extends Mi{constructor(){super(...arguments),this.filterId="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.displayCount=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=[...this.options];this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return Jt`
1254
1254
  <div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
1255
1255
  ${null==this.parent?null:Jt`
1256
- <div tabindex="0"
1257
- part="controls go-back"
1258
- class="ft-filter-level--go-back"
1259
- ?disabled=${this.disabled}
1260
- @keyup=${this.goBackOnKeyPress}
1261
- @click=${this.goBackOnClick}>
1262
- <ft-ripple></ft-ripple>
1263
- <ft-icon>thin_arrow_left</ft-icon>
1264
- <ft-typography variant="body2">${this.parent.label}</ft-typography>
1265
- </div>
1266
- `}
1256
+ <div tabindex="0"
1257
+ part="controls go-back"
1258
+ class="ft-filter-level--go-back"
1259
+ ?disabled=${this.disabled}
1260
+ @keyup=${this.goBackOnKeyPress}
1261
+ @click=${this.goBackOnClick}>
1262
+ <ft-ripple></ft-ripple>
1263
+ <ft-icon>thin_arrow_left</ft-icon>
1264
+ <ft-typography variant="body2">${this.parent.label}</ft-typography>
1265
+ </div>
1266
+ `}
1267
1267
  ${0===this.options.length&&this.noValuesLabel?Jt`
1268
- <ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
1269
- ${this.noValuesLabel}
1270
- </ft-typography>
1271
- `:te}
1268
+ <ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
1269
+ ${this.noValuesLabel}
1270
+ </ft-typography>
1271
+ `:te}
1272
1272
  ${Te(e,(t=>t.value),(t=>{var e;return Jt`
1273
- <div class="ft-filter-level--option" part="options">
1274
- ${this.multivalued?this.buildMultiValuedOption(t):this.buildMonoValuedOption(t)}
1275
- ${this.preventNavigation||t.selected||0===(null!==(e=t.subOptions)&&void 0!==e?e:[]).length?te:Jt`
1276
- <ft-button icon="thin_arrow_right"
1277
- part="controls navigate-hierarchy"
1278
- label="${t.label}"
1279
- ?disabled=${this.disabled}
1280
- tooltipPosition="left"
1281
- @click=${()=>this.displayLevel(t)}></ft-button>
1282
- `}
1283
- </div>
1284
- `}))}
1273
+ <div class="ft-filter-level--option" part="options">
1274
+ ${this.multivalued?this.buildMultiValuedOption(t):this.buildMonoValuedOption(t)}
1275
+ ${this.preventNavigation||t.selected||0===(null!==(e=t.subOptions)&&void 0!==e?e:[]).length?te:Jt`
1276
+ <ft-button icon="thin_arrow_right"
1277
+ part="controls navigate-hierarchy"
1278
+ label="${t.label}"
1279
+ ?disabled=${this.disabled}
1280
+ tooltipPosition="left"
1281
+ @click=${()=>this.displayLevel(t)}></ft-button>
1282
+ `}
1283
+ </div>
1284
+ `}))}
1285
1285
  ${e.length<t.length?Jt`
1286
- <ft-button
1287
- class="ft-filter-level--display-more"
1288
- icon="thin_arrow"
1289
- dense trailingIcon
1290
- part="controls display-more"
1291
- @click=${this.displayMore}>
1292
- ${this.moreValuesButtonLabel}
1293
- </ft-button>
1294
- `:te}
1286
+ <ft-button
1287
+ class="ft-filter-level--display-more"
1288
+ icon="thin_arrow"
1289
+ dense trailingIcon
1290
+ part="controls display-more"
1291
+ @click=${this.displayMore}>
1292
+ ${this.moreValuesButtonLabel}
1293
+ </ft-button>
1294
+ `:te}
1295
1295
  </div>
1296
1296
  `}goBackOnKeyPress(t){"Enter"!==t.key&&" "!==t.key||this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}goBackOnClick(t){t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}displayMore(){this.displayedPages++}buildMultiValuedOption(t){var e;return Jt`
1297
1297
  <ft-checkbox name="${this.filterId}"
1298
1298
  part="multivalued-option"
1299
1299
  data-value="${t.value}"
1300
+
1300
1301
  .checked=${t.selected}
1301
1302
  .disabled=${this.disabled}
1302
1303
  .indeterminate=${po(null!==(e=t.subOptions)&&void 0!==e?e:[],(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).some((t=>t.selected))}
1303
1304
  @change=${e=>this.optionsChanged(e,t)}>
1304
- ${t.renderOption?t.renderOption:t.label}
1305
+ ${t.renderOption?t.renderOption:t.label}${this.displayCount?` (${t.count})`:""}
1305
1306
  </ft-checkbox>
1306
1307
  `}buildMonoValuedOption(t){return Jt`
1307
1308
  <ft-radio name="${this.filterId+Math.round(1e6*Math.random())}"
@@ -1312,9 +1313,9 @@ function Re(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=$
1312
1313
  @click=${e=>this.optionsChanged(e,t)}
1313
1314
  @keyup=${e=>this.onRadioKeyUp(e,t)}
1314
1315
  @change=${t=>t.stopPropagation()}>
1315
- ${t.renderOption?t.renderOption:t.label}
1316
+ ${t.renderOption?t.renderOption:t.label}${this.displayCount?` (${t.count})`:""}
1316
1317
  </ft-radio>
1317
- `}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}qc.elementDefinitions={"ft-button":wc,"ft-ripple":rc,"ft-typography":Wl,"ft-checkbox":Ac,"ft-icon":bc,"ft-radio":Mc},qc.styles=Gc,Vc([we({type:String})],qc.prototype,"filterId",void 0),Vc([we({type:Object})],qc.prototype,"parent",void 0),Vc([we({type:Array})],qc.prototype,"options",void 0),Vc([we({type:Boolean})],qc.prototype,"multivalued",void 0),Vc([we({type:Boolean})],qc.prototype,"disabled",void 0),Vc([we({type:Boolean})],qc.prototype,"hideSelectedOptions",void 0),Vc([we({type:Boolean})],qc.prototype,"preventNavigation",void 0),Vc([we({type:String})],qc.prototype,"filter",void 0),Vc([we({type:String})],qc.prototype,"moreValuesButtonLabel",void 0),Vc([we({type:String})],qc.prototype,"noValuesLabel",void 0),Vc([we({type:Number})],qc.prototype,"displayedValuesLimit",void 0),Vc([Ee(".ft-filter-level--container")],qc.prototype,"container",void 0),Vc([Se()],qc.prototype,"displayedPages",void 0);const Yc={buttonsColor:wo.extend("--ft-snap-scroll-buttons-color","",Cr.colorPrimary),buttonsZIndex:wo.create("--ft-snap-scroll-buttons-z-index","","NUMBER","1"),gap:wo.create("--ft-snap-scroll-gap","","SIZE","0"),colorSurface:wo.external(Cr.colorSurface,"Design system")},Jc=dt`
1318
+ `}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}qc.elementDefinitions={"ft-button":wc,"ft-ripple":rc,"ft-typography":Wl,"ft-checkbox":Ac,"ft-icon":bc,"ft-radio":Mc},qc.styles=Gc,Vc([we({type:String})],qc.prototype,"filterId",void 0),Vc([we({type:Object})],qc.prototype,"parent",void 0),Vc([we({type:Array})],qc.prototype,"options",void 0),Vc([we({type:Boolean})],qc.prototype,"multivalued",void 0),Vc([we({type:Boolean})],qc.prototype,"disabled",void 0),Vc([we({type:Boolean})],qc.prototype,"hideSelectedOptions",void 0),Vc([we({type:Boolean})],qc.prototype,"displayCount",void 0),Vc([we({type:Boolean})],qc.prototype,"preventNavigation",void 0),Vc([we({type:String})],qc.prototype,"filter",void 0),Vc([we({type:String})],qc.prototype,"moreValuesButtonLabel",void 0),Vc([we({type:String})],qc.prototype,"noValuesLabel",void 0),Vc([we({type:Number})],qc.prototype,"displayedValuesLimit",void 0),Vc([Ee(".ft-filter-level--container")],qc.prototype,"container",void 0),Vc([Se()],qc.prototype,"displayedPages",void 0);const Yc={buttonsColor:wo.extend("--ft-snap-scroll-buttons-color","",Cr.colorPrimary),buttonsZIndex:wo.create("--ft-snap-scroll-buttons-z-index","","NUMBER","1"),gap:wo.create("--ft-snap-scroll-gap","","SIZE","0"),colorSurface:wo.external(Cr.colorSurface,"Design system")},Jc=dt`
1318
1319
  .ft-snap-scroll {
1319
1320
  box-sizing: border-box;
1320
1321
  position: relative;
@@ -1578,7 +1579,7 @@ function Re(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=$
1578
1579
  slot:not([name]) {
1579
1580
  display: none;
1580
1581
  }
1581
- `];var df=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class pf extends CustomEvent{constructor(t){super("change",{detail:t})}}class uf extends Mi{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",this.noValuesLabel="No values available",this.options=[],this.multivalued=!1,this.disabled=!1,this.raiseSelectedOptions=!1,this.displayedValuesLimit=0,this.hideClearButton=!1,this.lastLevelHasHiddenvalues=!1,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new lo(300),this.changeDebouncer=new lo(10),this.lastDispatchedValues=[]}get flatOptions(){return po(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get childrenFilteredFlatOptions(){return po(this.options,(t=>{var e;return t.selected?[]:null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.childrenFilteredFlatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){const t=this.flatOptions.some((t=>t.selected)),e=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,o=this.filterPlaceHolder.replace("{0}",this.label);return Jt`
1582
+ `];var df=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class pf extends CustomEvent{constructor(t){super("change",{detail:t})}}class uf extends Mi{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",this.noValuesLabel="No values available",this.options=[],this.multivalued=!1,this.disabled=!1,this.raiseSelectedOptions=!1,this.displayCount=!1,this.displayedValuesLimit=0,this.hideClearButton=!1,this.lastLevelHasHiddenvalues=!1,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new lo(300),this.changeDebouncer=new lo(10),this.lastDispatchedValues=[]}get flatOptions(){return po(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get childrenFilteredFlatOptions(){return po(this.options,(t=>{var e;return t.selected?[]:null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.childrenFilteredFlatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){const t=this.flatOptions.some((t=>t.selected)),e=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,o=this.filterPlaceHolder.replace("{0}",this.label);return Jt`
1582
1583
  <div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
1583
1584
  part="container">
1584
1585
  ${this.label||t?Jt`
@@ -1620,6 +1621,7 @@ function Re(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=$
1620
1621
  filterId="${this.id}"
1621
1622
  ?multivalued=${this.multivalued}
1622
1623
  ?disabled=${this.disabled}
1624
+ ?displayCount="${this.displayCount}"
1623
1625
  preventNavigation
1624
1626
  .options=${e}
1625
1627
  @change=${this.onChange}
@@ -1643,6 +1645,7 @@ function Re(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=$
1643
1645
  ?multivalued=${this.multivalued}
1644
1646
  ?disabled=${this.disabled||"ft-filter--level-center"!==t}
1645
1647
  ?hideSelectedOptions=${this.raiseSelectedOptions}
1648
+ ?displayCount="${this.displayCount}"
1646
1649
  .parent=${o}
1647
1650
  .options=${e}
1648
1651
  .displayedValuesLimit=${this.displayedValuesLimit}
@@ -1653,7 +1656,7 @@ function Re(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=$
1653
1656
  .exportpartsPrefixes=${["values","available-values"]}
1654
1657
  noValuesLabel="${this.noValuesLabel}"
1655
1658
  ></ft-filter-level>
1656
- `}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const r=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(r)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(r):this.options.forEach(r),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;yo(this.lastDispatchedValues,t)||(this.dispatchEvent(new pf(t)),this.lastDispatchedValues=t)}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}uf.elementDefinitions={"ft-button":wc,"ft-filter-level":qc,"ft-snap-scroll":tf,"ft-typography":Wl},uf.styles=hf,df([we({type:String})],uf.prototype,"id",void 0),df([we({type:String})],uf.prototype,"label",void 0),df([we({type:String})],uf.prototype,"filterPlaceHolder",void 0),df([we({type:String})],uf.prototype,"clearButtonLabel",void 0),df([we({type:String})],uf.prototype,"moreValuesButtonLabel",void 0),df([we({type:String})],uf.prototype,"noValuesLabel",void 0),df([mo([])],uf.prototype,"options",void 0),df([we({type:Boolean})],uf.prototype,"multivalued",void 0),df([we({type:Boolean})],uf.prototype,"disabled",void 0),df([we({type:Boolean})],uf.prototype,"raiseSelectedOptions",void 0),df([we({type:Number})],uf.prototype,"displayedValuesLimit",void 0),df([we({type:Boolean})],uf.prototype,"hideClearButton",void 0),df([Ee(".ft-filter--slot")],uf.prototype,"slotElement",void 0),df([Ee(".ft-filter--container")],uf.prototype,"container",void 0),df([Ee(".ft-filter--values")],uf.prototype,"valuesContainer",void 0),df([Ee(".ft-filter--levels")],uf.prototype,"levelsContainer",void 0),df([Se()],uf.prototype,"lastLevelHasHiddenvalues",void 0),df([Ee(".ft-filter--filter input")],uf.prototype,"filterInput",void 0),df([ke(".ft-filter--levels ft-filter-level")],uf.prototype,"levels",void 0),df([Se()],uf.prototype,"withScroll",void 0),df([Se()],uf.prototype,"filter",void 0),df([Se()],uf.prototype,"slideIn",void 0),df([Se()],uf.prototype,"slideOut",void 0);var yf=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class gf extends Mi{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return Jt`
1659
+ `}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const r=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(r)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(r):this.options.forEach(r),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;yo(this.lastDispatchedValues,t)||(this.dispatchEvent(new pf(t)),this.lastDispatchedValues=t)}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}uf.elementDefinitions={"ft-button":wc,"ft-filter-level":qc,"ft-snap-scroll":tf,"ft-typography":Wl},uf.styles=hf,df([we({type:String})],uf.prototype,"id",void 0),df([we({type:String})],uf.prototype,"label",void 0),df([we({type:String})],uf.prototype,"filterPlaceHolder",void 0),df([we({type:String})],uf.prototype,"clearButtonLabel",void 0),df([we({type:String})],uf.prototype,"moreValuesButtonLabel",void 0),df([we({type:String})],uf.prototype,"noValuesLabel",void 0),df([mo([])],uf.prototype,"options",void 0),df([we({type:Boolean})],uf.prototype,"multivalued",void 0),df([we({type:Boolean})],uf.prototype,"disabled",void 0),df([we({type:Boolean})],uf.prototype,"raiseSelectedOptions",void 0),df([we({type:Boolean})],uf.prototype,"displayCount",void 0),df([we({type:Number})],uf.prototype,"displayedValuesLimit",void 0),df([we({type:Boolean})],uf.prototype,"hideClearButton",void 0),df([Ee(".ft-filter--slot")],uf.prototype,"slotElement",void 0),df([Ee(".ft-filter--container")],uf.prototype,"container",void 0),df([Ee(".ft-filter--values")],uf.prototype,"valuesContainer",void 0),df([Ee(".ft-filter--levels")],uf.prototype,"levelsContainer",void 0),df([Se()],uf.prototype,"lastLevelHasHiddenvalues",void 0),df([Ee(".ft-filter--filter input")],uf.prototype,"filterInput",void 0),df([ke(".ft-filter--levels ft-filter-level")],uf.prototype,"levels",void 0),df([Se()],uf.prototype,"withScroll",void 0),df([Se()],uf.prototype,"filter",void 0),df([Se()],uf.prototype,"slideIn",void 0),df([Se()],uf.prototype,"slideOut",void 0);var yf=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class gf extends Mi{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return Jt`
1657
1660
  <slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
1658
1661
  `}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}gf.elementDefinitions={},yf([we({type:String})],gf.prototype,"label",void 0),yf([we({type:Object,converter:t=>t})],gf.prototype,"value",void 0),yf([we({type:Boolean,reflect:!0})],gf.prototype,"selected",void 0),yf([we({type:Object})],gf.prototype,"subOptions",void 0),yf([mo({})],gf.prototype,"renderOption",void 0),yf([Ee(".ft-filter-option--slot")],gf.prototype,"slotElement",void 0),bo("ft-filter")(uf),bo("ft-filter-option")(gf);const bf=dt`
1659
1662
  `,mf=dt`
@@ -1663,10 +1666,10 @@ function Re(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=$
1663
1666
  <span class="ft-i18n">
1664
1667
  ${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
1665
1668
  </span>
1666
- `:this.editorMode?"Select a context and a label key.":te}update(t){var e;super.update(t),["context","key","defaultMessage"].some((e=>t.has(e)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}Df.elementDefinitions={},Df.styles=bf,jf([nn()],Df.prototype,"editorMode",void 0),jf([we()],Df.prototype,"context",void 0),jf([we()],Df.prototype,"key",void 0),jf([mo([])],Df.prototype,"args",void 0),jf([we()],Df.prototype,"defaultMessage",void 0);class Mf{static build(t){return new Mf(t)}static fromGwt(t){return new Mf(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const o=e;return t=>({context:this.name,key:o,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>Nf.resolveMessage(this.name,e,...t)})}}bo("ft-i18n")(Df);const Tf={setRequest:(t,e)=>{t.request=e.payload},setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{t.request.paging.perPage=e.payload},setPageNumber:(t,e)=>{t.request.paging.page=e.payload},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.filters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setRequestVirtualField:(t,e)=>{t.request.virtualField=e.payload},setRequestScope:(t,e)=>{t.request.scope=e.payload},setResults:(t,e)=>{t.results=e.payload},setFacets:(t,e)=>{t.facets=e.payload},setSpellcheck:(t,e)=>{t.spellcheck=e.payload},setLocales:(t,e)=>{t.locales=e.payload},setPaging:(t,e)=>{t.paging=e.payload},setLiveQuery:(t,e)=>{t.liveQuery=e.payload},setSuggestResults:(t,e)=>{t.suggestResults=e.payload}};var Hf,Kf,Zf,Gf,Vf,qf,Yf,Jf,Xf,Qf,th,eh,oh,rh,ih,nh,ah,sh;!function(t){!function(e){var o={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(o.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(t){return t&&r.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,o){t.onload=function(){e(t.result)},t.onerror=function(){o(t.error)}}))}function h(t){var e=new FileReader,o=f(e);return e.readAsArrayBuffer(t),o}function d(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,o=f(e);return e.readAsText(t),o}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),o=new Array(e.length),r=0;r<e.length;r++)o[r]=String.fromCharCode(e[r]);return o.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=n(t),e=a(e);var o=this.map[t];this.map[t]=o?o+", "+e:e},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,e){this.map[n(t)]=a(e)},l.prototype.forEach=function(t,e){for(var o in this.map)this.map.hasOwnProperty(o)&&t.call(e,this.map[o],o,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,o){t.push(o)})),s(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,o){t.push([o,e])})),s(t)},o.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,e){var o,r,i=(e=e||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(o=e.method||this.method||"GET",r=o.toUpperCase(),u.indexOf(r)>-1?r:o),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function g(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var o=t.split("="),r=o.shift().replace(/\+/g," "),i=o.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},p.call(y.prototype),p.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var o=Error(t);this.stack=o.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(t,r){return new Promise((function(i,n){var a=new y(t,r);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var o=t.split(":"),r=o.shift().trim();if(r){var i=o.join(":").trim();e.append(r,i)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var r="response"in s?s.response:s.responseText;i(new b(r,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=l,t.Request=y,t.Response=b),e.Headers=l,e.Request=y,e.Response=b,e.fetch=v,Object.defineProperty(e,"W",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Hf||(Hf={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Kf||(Kf={})),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"}(Zf||(Zf={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(Gf||(Gf={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(Vf||(Vf={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(qf||(qf={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(Yf||(Yf={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Jf||(Jf={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Xf||(Xf={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Qf||(Qf={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(th||(th={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(eh||(eh={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(oh||(oh={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(rh||(rh={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(ih||(ih={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(nh||(nh={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(ah||(ah={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(sh||(sh={})),ah.PERSONAL_BOOK_SHARE_USER,ah.PERSONAL_BOOK_USER,ah.HTML_EXPORT_USER,ah.PERSONAL_BOOK_USER,ah.PDF_EXPORT_USER,ah.PERSONAL_BOOK_USER,ah.KHUB_ADMIN,ah.CONTENT_PUBLISHER,ah.ADMIN,ah.KHUB_ADMIN,ah.USERS_ADMIN,ah.PORTAL_ADMIN,ah.DEVELOPER,ah.BETA_USER,ah.DEBUG_USER;class lh extends Of{constructor(){super(),this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}}const ch=t=>t.request.virtualField===th.TITLE_ONLY&&t.request.scope===nh.DOCUMENTS;class fh extends Event{constructor(){super(fh.eventName)}}fh.eventName="search-context-clear-all-filters";class hh{static build(t,e){return new hh((t=>os.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:Tf}))(t.trim()||"context"),e)}constructor(t,e){this.store=t,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.searchDebouncer=new lo(100),this.suggestDebouncer=new lo(300),this.service=null!=e?e:new lh}async initService(){return this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let e=this.store.getState().locales,o=this.store.getState().request.contentLocale;if(t!=o){if(e){const r=t=>e.some((e=>e.lang==t));r(t)||(t=r(o)?o:e[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([]),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){const e=t.filter((t=>t.values.length>0));this.store.actions.setRequestFilters(e),this.store.actions.setPageNumber(1),e.forEach((t=>{this.facetIds.includes(t.key)||(this.facetIds=[...this.facetIds,t.key])})),this.launchSearch()}setSearchInDocumentTitlesOnly(t){t?(this.store.actions.setRequestVirtualField(th.TITLE_ONLY),this.store.actions.setRequestScope(nh.DOCUMENTS)):(this.store.actions.setRequestVirtualField(th.EVERYWHERE),this.store.actions.setRequestScope(nh.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return ch(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new fh)}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,e){let o=this.facetIds.filter((e=>e!=t));e&&o.push(e),this.facetIds=o,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let e=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(e)}setFilter(t,e){let o=this.store.getState().request.filters,r={key:t,values:e,negative:!1},i=[...o.filter((e=>e.key!==t)),r];this.setFilters(i)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}setRequest(t){this.store.actions.setRequest(t),this.store.actions.setLiveQuery(t.query),this.store.actions.setPageNumber(1),this.launchSearch()}setScope(t){this.store.actions.setRequestScope(t),this.launchSearch()}setIgnoreEmptyQuery(t){this.ignoreEmptyQuery=t,this.launchSearch()}setOpenExternalDocumentInNewTab(t){this.openExternalDocumentInNewTab=t}launchSearch(){return this.searchDebouncer.run((()=>this.fetchSearchData()))}launchSuggest(){return this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t,e;try{null===(t=this.cancelableSearch)||void 0===t||t.cancel();let o=this.store.getState().request;if(this.store.actions.setPaging(void 0),this.ignoreEmptyQuery&&0==o.query.length)this.store.actions.setResults(void 0),this.store.actions.setFacets(void 0),this.store.actions.setSpellcheck(void 0);else{this.cancelableSearch=oo(this.service.launchSearch(o));const t=await this.cancelableSearch;if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setSpellcheck(t.spellcheck);else{let o=(null!==(e=this.store.getState().results)&&void 0!==e?e:[]).concat(t.results);this.store.actions.setResults(o)}this.store.actions.setPaging(t.paging)}}catch(t){t instanceof to||!this.errorHandler||this.errorHandler(t)}}async fetchSuggestData(){var t;try{const e=this.store.getState(),o=e.request,r={input:e.liveQuery,filters:o.filters,sort:o.sort,contentLocale:o.contentLocale,scope:o.scope};null===(t=this.cancelableSuggest)||void 0===t||t.cancel(),this.cancelableSuggest=oo(this.service.launchSuggest(r));let i=await this.cancelableSuggest;this.store.actions.setSuggestResults(i.suggestions)}catch(t){t instanceof to||!this.errorHandler||this.errorHandler(t)}}clear(){this.store.clear()}}var dh=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class ph extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const uh=Symbol("registerInterval");class yh extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[uh]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[uh]):this.dispatchEvent(new ph)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=uh,dh([Se()],o.prototype,"stateManager",void 0),o}(un)){}const gh=Mf.build("designedSearchType"),bh={label:"Search scope",documentTitlesOnly:"Search in document titles only"},mh=dt`
1669
+ `:this.editorMode?"Select a context and a label key.":te}update(t){var e;super.update(t),["context","key","defaultMessage"].some((e=>t.has(e)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}Df.elementDefinitions={},Df.styles=bf,jf([nn()],Df.prototype,"editorMode",void 0),jf([we()],Df.prototype,"context",void 0),jf([we()],Df.prototype,"key",void 0),jf([mo([])],Df.prototype,"args",void 0),jf([we()],Df.prototype,"defaultMessage",void 0);class Mf{static build(t){return new Mf(t)}static fromGwt(t){return new Mf(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const o=e;return t=>({context:this.name,key:o,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>Nf.resolveMessage(this.name,e,...t)})}}bo("ft-i18n")(Df);const Tf={setRequest:(t,e)=>{t.request=e.payload},setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{t.request.paging.perPage=e.payload},setPageNumber:(t,e)=>{t.request.paging.page=e.payload},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.filters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setRequestVirtualField:(t,e)=>{t.request.virtualField=e.payload},setRequestScope:(t,e)=>{t.request.scope=e.payload},setResults:(t,e)=>{t.results=e.payload},setFacets:(t,e)=>{t.facets=e.payload},setSpellcheck:(t,e)=>{t.spellcheck=e.payload},setLocales:(t,e)=>{t.locales=e.payload},setPaging:(t,e)=>{t.paging=e.payload},setLiveQuery:(t,e)=>{t.liveQuery=e.payload},setSuggestResults:(t,e)=>{t.suggestResults=e.payload},setRequestPeriodFilter:(t,e)=>{t.request.periodFilter=e.payload}};var Hf,Kf,Zf,Gf,Vf,qf,Yf,Jf,Xf,Qf,th,eh,oh,rh,ih,nh,ah,sh;!function(t){!function(e){var o={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(o.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(t){return t&&r.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,o){t.onload=function(){e(t.result)},t.onerror=function(){o(t.error)}}))}function h(t){var e=new FileReader,o=f(e);return e.readAsArrayBuffer(t),o}function d(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,o=f(e);return e.readAsText(t),o}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),o=new Array(e.length),r=0;r<e.length;r++)o[r]=String.fromCharCode(e[r]);return o.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=n(t),e=a(e);var o=this.map[t];this.map[t]=o?o+", "+e:e},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,e){this.map[n(t)]=a(e)},l.prototype.forEach=function(t,e){for(var o in this.map)this.map.hasOwnProperty(o)&&t.call(e,this.map[o],o,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,o){t.push(o)})),s(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,o){t.push([o,e])})),s(t)},o.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,e){var o,r,i=(e=e||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(o=e.method||this.method||"GET",r=o.toUpperCase(),u.indexOf(r)>-1?r:o),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function g(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var o=t.split("="),r=o.shift().replace(/\+/g," "),i=o.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},p.call(y.prototype),p.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var o=Error(t);this.stack=o.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(t,r){return new Promise((function(i,n){var a=new y(t,r);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var o=t.split(":"),r=o.shift().trim();if(r){var i=o.join(":").trim();e.append(r,i)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var r="response"in s?s.response:s.responseText;i(new b(r,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=l,t.Request=y,t.Response=b),e.Headers=l,e.Request=y,e.Response=b,e.fetch=v,Object.defineProperty(e,"W",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Hf||(Hf={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Kf||(Kf={})),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"}(Zf||(Zf={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(Gf||(Gf={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(Vf||(Vf={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(qf||(qf={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(Yf||(Yf={})),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"}(Jf||(Jf={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Xf||(Xf={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Qf||(Qf={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(th||(th={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(eh||(eh={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(oh||(oh={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(rh||(rh={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(ih||(ih={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(nh||(nh={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(ah||(ah={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(sh||(sh={})),ah.PERSONAL_BOOK_SHARE_USER,ah.PERSONAL_BOOK_USER,ah.HTML_EXPORT_USER,ah.PERSONAL_BOOK_USER,ah.PDF_EXPORT_USER,ah.PERSONAL_BOOK_USER,ah.KHUB_ADMIN,ah.CONTENT_PUBLISHER,ah.ADMIN,ah.KHUB_ADMIN,ah.USERS_ADMIN,ah.PORTAL_ADMIN,ah.DEVELOPER,ah.BETA_USER,ah.DEBUG_USER;class lh extends Of{constructor(){super(),this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}}const ch=t=>t.request.virtualField===th.TITLE_ONLY&&t.request.scope===nh.DOCUMENTS;class fh extends Event{constructor(){super(fh.eventName)}}fh.eventName="search-context-clear-all-filters";class hh{static build(t,e){return new hh((t=>os.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:Tf}))(t.trim()||"context"),e)}constructor(t,e){this.store=t,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.searchDebouncer=new lo(100),this.suggestDebouncer=new lo(300),this.service=null!=e?e:new lh}async initService(){return this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let e=this.store.getState().locales,o=this.store.getState().request.contentLocale;if(t!=o){if(e){const r=t=>e.some((e=>e.lang==t));r(t)||(t=r(o)?o:e[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([]),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){const e=t.filter((t=>t.values.length>0));this.store.actions.setRequestFilters(e),this.store.actions.setPageNumber(1),e.forEach((t=>{this.facetIds.includes(t.key)||(this.facetIds=[...this.facetIds,t.key])})),this.launchSearch()}setSearchInDocumentTitlesOnly(t){t?(this.store.actions.setRequestVirtualField(th.TITLE_ONLY),this.store.actions.setRequestScope(nh.DOCUMENTS)):(this.store.actions.setRequestVirtualField(th.EVERYWHERE),this.store.actions.setRequestScope(nh.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return ch(this.store.getState())}get periodFilter(){return this.store.getState().request.periodFilter}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new fh)}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,e){let o=this.facetIds.filter((e=>e!=t));e&&o.push(e),this.facetIds=o,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let e=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(e)}setFilter(t,e){let o=this.store.getState().request.filters,r={key:t,values:e,negative:!1},i=[...o.filter((e=>e.key!==t)),r];this.setFilters(i)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}setRequest(t){this.store.actions.setRequest(t),this.store.actions.setLiveQuery(t.query),this.store.actions.setPageNumber(1),this.launchSearch()}setScope(t){this.store.actions.setRequestScope(t),this.launchSearch()}setIgnoreEmptyQuery(t){this.ignoreEmptyQuery=t,this.launchSearch()}setOpenExternalDocumentInNewTab(t){this.openExternalDocumentInNewTab=t}setPeriodFilter(t){this.store.actions.setRequestPeriodFilter(t),this.store.actions.setPageNumber(1),this.launchSearch()}launchSearch(){return this.searchDebouncer.run((()=>this.fetchSearchData()))}launchSuggest(){return this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t,e;try{null===(t=this.cancelableSearch)||void 0===t||t.cancel();let o=this.store.getState().request;if(this.store.actions.setPaging(void 0),this.ignoreEmptyQuery&&0==o.query.length)this.store.actions.setResults(void 0),this.store.actions.setFacets(void 0),this.store.actions.setSpellcheck(void 0);else{this.cancelableSearch=oo(this.service.launchSearch(o));const t=await this.cancelableSearch;if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setSpellcheck(t.spellcheck);else{let o=(null!==(e=this.store.getState().results)&&void 0!==e?e:[]).concat(t.results);this.store.actions.setResults(o)}this.store.actions.setPaging(t.paging)}}catch(t){t instanceof to||!this.errorHandler||this.errorHandler(t)}}async fetchSuggestData(){var t;try{const e=this.store.getState(),o=e.request,r={input:e.liveQuery,filters:o.filters,sort:o.sort,contentLocale:o.contentLocale,scope:o.scope};null===(t=this.cancelableSuggest)||void 0===t||t.cancel(),this.cancelableSuggest=oo(this.service.launchSuggest(r));let i=await this.cancelableSuggest;this.store.actions.setSuggestResults(i.suggestions)}catch(t){t instanceof to||!this.errorHandler||this.errorHandler(t)}}clear(){this.store.clear()}}var dh=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class ph extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const uh=Symbol("registerInterval");class yh extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[uh]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[uh]):this.dispatchEvent(new ph)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=uh,dh([Se()],o.prototype,"stateManager",void 0),o}(un)){}const gh=Mf.build("designedSearchType"),bh={label:"Search scope",documentTitlesOnly:"Search in document titles only"},mh=dt`
1667
1670
  `;var vh=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class xh extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class Oh extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class wh extends CustomEvent{constructor(t,e,o){super("ft-search-results-change",{detail:{request:t,paging:e,spellcheck:o}})}}class Sh extends un{get stateManager(){if(null==this._stateManager){const t=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=hh.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),t),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")}return this._stateManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.addStore(vf)}render(){return Jt`
1668
1671
  <slot @register-ft-search-component=${this.registerComponent}></slot>
1669
- `}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new Oh(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new wh(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new xh(t))}reloadSavedSearches(){Uf.clearMySearches()}clear(){this.stateManager.clear()}}Sh.elementDefinitions={},Sh.styles=mh,vh([we()],Sh.prototype,"query",void 0),vh([we()],Sh.prototype,"contentLocale",void 0),vh([we({type:Number})],Sh.prototype,"pageSize",void 0),vh([we({type:Boolean})],Sh.prototype,"searchInDocumentTitlesOnly",void 0),vh([we()],Sh.prototype,"scope",void 0),vh([we({type:Boolean})],Sh.prototype,"ignoreEmptyQuery",void 0),vh([nn({store:vf.name})],Sh.prototype,"openExternalDocumentInNewTab",void 0),vh([mo([])],Sh.prototype,"filters",void 0),vh([mo([])],Sh.prototype,"sort",void 0),vh([nn({store:"search"})],Sh.prototype,"request",void 0),vh([nn({store:"search"})],Sh.prototype,"paging",void 0),vh([nn({store:"search",selector:t=>t.spellcheck})],Sh.prototype,"autocorrect",void 0),vh([nn({store:vf.name})],Sh.prototype,"session",void 0),vh([we({attribute:!1})],Sh.prototype,"searchServiceProvider",void 0),bo("ft-search-context")(Sh);var Ch=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Nh extends(Ff(yh)){constructor(){super(),this.addI18nContext(gh,bh)}render(){return Jt`
1672
+ `}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("periodFilter")&&void 0!==this.periodFilter&&this.stateManager.setPeriodFilter(this.periodFilter)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new Oh(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new wh(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new xh(t))}reloadSavedSearches(){Uf.clearMySearches()}clear(){this.stateManager.clear()}}Sh.elementDefinitions={},Sh.styles=mh,vh([we()],Sh.prototype,"query",void 0),vh([we()],Sh.prototype,"contentLocale",void 0),vh([we({type:Number})],Sh.prototype,"pageSize",void 0),vh([we({type:Boolean})],Sh.prototype,"searchInDocumentTitlesOnly",void 0),vh([we()],Sh.prototype,"periodFilter",void 0),vh([we()],Sh.prototype,"scope",void 0),vh([we({type:Boolean})],Sh.prototype,"ignoreEmptyQuery",void 0),vh([nn({store:vf.name})],Sh.prototype,"openExternalDocumentInNewTab",void 0),vh([mo([])],Sh.prototype,"filters",void 0),vh([mo([])],Sh.prototype,"sort",void 0),vh([nn({store:"search"})],Sh.prototype,"request",void 0),vh([nn({store:"search"})],Sh.prototype,"paging",void 0),vh([nn({store:"search",selector:t=>t.spellcheck})],Sh.prototype,"autocorrect",void 0),vh([nn({store:vf.name})],Sh.prototype,"session",void 0),vh([we({attribute:!1})],Sh.prototype,"searchServiceProvider",void 0),bo("ft-search-context")(Sh);var Ch=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Nh extends(Ff(yh)){constructor(){super(),this.addI18nContext(gh,bh)}render(){return Jt`
1670
1673
  <ft-filter
1671
1674
  label=${gh.messages.label()}
1672
1675
  .options=${[{label:gh.messages.documentTitlesOnly(),value:t=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setSearchInDocumentTitlesOnly(t)},selected:this.searchInDocumentTitlesOnly}]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-type",
3
- "version": "1.1.62",
3
+ "version": "1.1.64",
4
4
  "description": "Search",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,8 +19,8 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-wc-utils": "1.1.62",
22
+ "@fluid-topics/ft-wc-utils": "1.1.64",
23
23
  "lit": "3.1.0"
24
24
  },
25
- "gitHead": "a083f174e61618863de2949cd0f465107b4644d3"
25
+ "gitHead": "de93ae28828fb464cab528f90580b63cdbbb195b"
26
26
  }