@searchcraft/vue-sdk 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -4847,7 +4847,7 @@ const Sc = yc, wc = ws, Cs = () => {
4847
4847
  Ri(), Ci(), Ai(), Mi(), Li(), zi(), Wi(), qi(), Ki(), Ji(), tc(), nc(), oc(), ic(), uc(), pc(), mc(), gc(), Sc(), wc();
4848
4848
  };
4849
4849
  Cs();
4850
- const Ec = "@searchcraft/vue-sdk", Rc = "0.9.1", kc = "Searchcraft Vue SDK.", Pc = "module", Cc = "Apache-2.0", Tc = ["searchcraft"], xc = { dev: "vite", clean: "rm -rf dist", build: "yarn clean && vite build && yarn docs", docs: "typedoc --options typedoc.json", preview: "vite preview", "build-only": "vite build", "type-check": "vue-tsc --build" }, $c = { type: "git", url: "https://bitbucket.org/madebychalk/searchcraft-javascript-sdks/" }, _c = { node: ">=18.0.0", npm: ">=10.0.0" }, Ac = "./dist/index.umd.js", Ic = "./dist/index.es.js", Mc = "./dist/index.d.ts", Lc = { ".": { types: "./dist/index.d.ts", import: "./dist/index.es.js", require: "./dist/index.umd.js" }, "./components": "./dist/components/index.d.ts", "./plugin": "./dist/plugin.d.ts" }, Oc = ["dist"], Fc = { vue: "^3.5.13" }, Dc = { "@searchcraft/core": "^0.9.1", "@searchcraft/javascript-sdk": "^0.9.1", "@tsconfig/node22": "^22.0.0", "@types/node": "^22.10.7", "@vitejs/plugin-vue": "^5.2.1", "@vitejs/plugin-vue-jsx": "^4.1.1", "@vue/runtime-dom": "^3.5.13", "@vue/tsconfig": "^0.7.0", "npm-run-all2": "^7.0.2", vite: "^6.0.11", "vite-plugin-dts": "^4.5.0", "vite-plugin-vue-devtools": "^7.7.0", "vue-docgen-web-types": "^0.1.8", "vue-tsc": "^2.2.0" }, Oa = {
4850
+ const Ec = "@searchcraft/vue-sdk", Rc = "0.9.2", kc = "Searchcraft Vue SDK.", Pc = "module", Cc = "Apache-2.0", Tc = ["searchcraft"], xc = { dev: "vite", clean: "rm -rf dist", build: "yarn clean && vite build && yarn docs", docs: "typedoc --options typedoc.json", preview: "vite preview", "build-only": "vite build", "type-check": "vue-tsc --build" }, $c = { type: "git", url: "https://bitbucket.org/madebychalk/searchcraft-javascript-sdks/" }, _c = { node: ">=18.0.0", npm: ">=10.0.0" }, Ac = "./dist/index.umd.js", Ic = "./dist/index.es.js", Mc = "./dist/index.d.ts", Lc = { ".": { types: "./dist/index.d.ts", import: "./dist/index.es.js", require: "./dist/index.umd.js" }, "./components": "./dist/components/index.d.ts", "./plugin": "./dist/plugin.d.ts" }, Oc = ["dist"], Fc = { vue: "^3.5.13" }, Dc = { "@searchcraft/core": "^0.9.2", "@searchcraft/javascript-sdk": "^0.9.2", "@tsconfig/node22": "^22.0.0", "@types/node": "^22.10.7", "@vitejs/plugin-vue": "^5.2.1", "@vitejs/plugin-vue-jsx": "^4.1.1", "@vue/runtime-dom": "^3.5.13", "@vue/tsconfig": "^0.7.0", "npm-run-all2": "^7.0.2", vite: "^6.0.11", "vite-plugin-dts": "^4.5.0", "vite-plugin-vue-devtools": "^7.7.0", "vue-docgen-web-types": "^0.1.8", "vue-tsc": "^2.2.0" }, Oa = {
4851
4851
  name: Ec,
4852
4852
  version: Rc,
4853
4853
  private: !1,
package/dist/index.umd.js CHANGED
@@ -32,5 +32,5 @@
32
32
  Licensed under the MIT License (MIT), see
33
33
  http://jedwatson.github.io/classnames
34
34
  */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",s=0;s<arguments.length;s++){var c=arguments[s];c&&(o=n(o,a(c)))}return o}function a(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var c in o)t.call(o,c)&&o[c]&&(s=n(s,c));return s}function n(o,s){return s?o?o+" "+s:o+s:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Ia);const M=Ia.exports,jo=N(class extends D{constructor(){super();h(this,"hierarchy","primary");h(this,"disabled",!1);h(this,"icon");h(this,"iconOnly",!1);h(this,"iconPosition","left");h(this,"label","Search");h(this,"type","button");h(this,"buttonClick");h(this,"handleButtonClick",()=>{this.buttonClick.emit()});this.__registerHost(),this.buttonClick=Ce(this,"buttonClick")}render(){return d("button",{key:"ff883b930d03da6cbfb40badd3be1de0a873f853","aria-label":this.label,class:M("searchcraft-button",{"searchcraft-button-primary":this.hierarchy==="primary","searchcraft-button-tertiary":this.hierarchy==="tertiary","searchcraft-button-disabled":this.disabled}),disabled:this.disabled,onClick:this.handleButtonClick,type:this.type},this.iconOnly?this.icon:d(Jt,null,this.iconPosition==="left"&&this.icon,d("span",null,this.label),this.iconPosition==="right"&&this.icon))}},[0,"searchcraft-button",{hierarchy:[1],disabled:[4],icon:[16],iconOnly:[4,"icon-only"],iconPosition:[1,"icon-position"],label:[1],type:[1]}]);function xt(){if(typeof customElements>"u")return;["searchcraft-button"].forEach(t=>{switch(t){case"searchcraft-button":customElements.get(t)||customElements.define(t,jo);break}})}const Go=xt,Wo=Ct;function Ma(e,t){const r={...e};for(const a in t)t.hasOwnProperty(a)&&(t[a]instanceof Object&&e[a]instanceof Object?r[a]=Ma(e[a],t[a]):r[a]=t[a]);return r}function Vo(e){return e.filter((t,r,a)=>!a.some((n,o)=>o!==r&&n.includes(t)))}function La(e){const t={},r=a=>{var n;t[a.path]={count:a.count,path:a.path},(n=a.children)==null||n.forEach(o=>{r(o)})};return r(e),t}function qo(e){const t={count:0,path:"/",children:{}};return Object.keys(e).forEach(r=>{const a=e[r];if(!a||a.path==="/")return;const n=a.path.substring(1).split("/");let o=t,s="";n.forEach((c,u)=>{const l=`${s}/${c}`;o.children[l]||(o.children[l]={count:0,path:l,children:{}}),u===n.length-1&&(o.children[l].count=a.count),s=l,o=o.children[l]})}),t}function Oa(e){const t={count:e.count,path:e.path,children:[]};return Object.keys(e.children).length>0&&(t.children=Object.values(e.children).map(r=>Oa(r))),t}function Yo(e,t){const r=Object.keys(e),a=Object.keys(t),n=new Set(a.filter(s=>s.split("/").length>2).map(s=>s.substring(0,s.lastIndexOf("/"))));return Object.fromEntries(r.filter(s=>!n.has(s.substring(0,s.lastIndexOf("/")))).map(s=>[s,e[s]]))}function Ko(e,t,r){const a=t[e],n=r[e],o={count:0,path:"/",children:a},s={count:0,path:"/",children:n},c=La(o),u=La(s),l=Yo(c,u),i=Ma(l,u),p=qo(i),g=Oa(p);return{[e]:g.children}}const Xo=N(class extends D{constructor(){super();h(this,"fieldName","");h(this,"facetSelectionUpdated");h(this,"baseFacetRoot");h(this,"facetRoot");h(this,"selectedPaths",{});h(this,"lastTimeTaken");h(this,"hasNewSearchTerm",!1);h(this,"lastSearchTerm");h(this,"lastSearchMode");h(this,"lastSortType");h(this,"unsubscribe");h(this,"searchStore",_.getState());h(this,"formatLabel",r=>{const a=r.path.replace(/^\//,""),n=r.count;return`${a.replace(/-/g," ").replace(/\b\w/g,o=>o.toUpperCase())} (${n})`});h(this,"formatSubLabel",(r,a)=>{const o=r.path.substring(a.path.length).replace(/^\//,""),s=r.count;return`${o.replace(/-/g," ").replace(/\b\w/g,c=>c.toUpperCase())} (${s})`});this.__registerHost(),this.facetSelectionUpdated=Ce(this,"facetSelectionUpdated")}handleStateUpdate(r){const a=r.searchResponseFacetPrime,n=r.searchResponseTimeTaken;if(this.fieldName){if((r.searchTerm!==this.lastSearchTerm||r.searchMode!==this.lastSearchMode||r.sortType!==this.lastSortType)&&(this.selectedPaths={},this.hasNewSearchTerm=!0),n!==this.lastTimeTaken&&a){this.facetRoot=void 0;const o=a.find(s=>this.fieldName===Object.keys(s)[0]);this.hasNewSearchTerm?(this.baseFacetRoot=o,this.facetRoot=o,this.hasNewSearchTerm=!1):this.baseFacetRoot&&o&&(this.facetRoot=Ko(this.fieldName,this.baseFacetRoot,o))}this.lastSearchTerm=r.searchTerm,this.lastSearchMode=r.searchMode,this.lastSortType=r.sortType,this.lastTimeTaken=n}}connectedCallback(){this.handleStateUpdate(this.searchStore),this.unsubscribe=_.subscribe(r=>{this.handleStateUpdate(r)})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this)}handleCheckboxChange(r){var s;if(!this.selectedPaths[r])this.selectedPaths={...this.selectedPaths,[r]:!0};else{const c=Object.keys(this.selectedPaths).filter(u=>!u.includes(r));this.selectedPaths=c.reduce((u,l)=>(u[l]=!0,u),{})}const n=Object.keys(this.selectedPaths).filter(c=>this.selectedPaths[c]),o=Vo(n);(s=this.facetSelectionUpdated)==null||s.emit({paths:o})}render(){var a;if(!this.fieldName)return;const r=(a=this.facetRoot)==null?void 0:a[this.fieldName];return d("div",{class:M("filtersListContainer","searchcraft-filters-list-container")},!r&&d("p",{class:"searchcraft-facet-message"},"Enter a search to view facets."),r==null?void 0:r.map(n=>{var s;const o=n.children?(s=n.children)==null?void 0:s.some(c=>this.selectedPaths[c.path]):!1;return d("div",{key:n.path,class:M("searchcraft-filters-list-item")},d("label",{class:M("filterCheckboxLabel","searchcraft-filters-list-checkbox-label")},d("input",{checked:this.selectedPaths[n.path],onChange:c=>this.handleCheckboxChange(n.path),type:"checkbox"}),o?d("div",{class:M("dashContainer","searchcraft-filter-list-dash-container")},d("svg",{width:"14",height:"3",viewBox:"0 0 14 3",fill:"none"},d("title",null,"Checkbox Dash"),d("line",{x1:"1.5",y1:"1.5",x2:"12.5",y2:"1.5",stroke:"white","stroke-width":"3","stroke-linecap":"round"}))):d("div",{class:M("checkContainer","searchcraft-filter-list-check-container")},d("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},d("title",null,"Checkbox Check"),d("path",{d:"M13.9999 2L5.74988 10L1.99988 6.36364",stroke:"white","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"}))),this.formatLabel(n)),n.children&&n.children.length>0&&d(Jt,null,n.children.map(c=>d("label",{key:c.path,class:M("childFilterCheckboxLabel","searchcraft-child-filter-checkbox-label"),style:{display:this.selectedPaths[n.path]?"flex":"none"}},d("input",{checked:this.selectedPaths[c.path],onChange:u=>{this.handleCheckboxChange(c.path)},type:"checkbox"}),d("div",{class:M("checkContainer","searchcraft-filter-list-check-container")},d("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},d("title",null,"Checkbox Check"),d("path",{d:"M13.9999 2L5.74988 10L1.99988 6.36364",stroke:"white","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"}))),this.formatSubLabel(c,n)))))}))}},[0,"searchcraft-facet-list",{fieldName:[1,"field-name"],baseFacetRoot:[32],facetRoot:[32],selectedPaths:[32],lastTimeTaken:[32],hasNewSearchTerm:[32],lastSearchTerm:[32],lastSearchMode:[32],lastSortType:[32],unsubscribe:[32]}]);function Fa(){if(typeof customElements>"u")return;["searchcraft-facet-list"].forEach(t=>{switch(t){case"searchcraft-facet-list":customElements.get(t)||customElements.define(t,Xo);break}})}const Qo=Fa,Jo=N(class extends D{constructor(){super();h(this,"max",100);h(this,"min",0);h(this,"granularity",_a("month"));h(this,"dataType","number");h(this,"endValue",this.max);h(this,"startValue",this.min);h(this,"lastFocusedHandle","max");h(this,"rangeChanged");h(this,"emitUpdate",async()=>{var r;(r=this.rangeChanged)==null||r.emit({startValue:this.startValue,endValue:this.endValue})});h(this,"handleStartValueChange",r=>{const a=r.target,n=Number.parseInt(a.value,10);this.lastFocusedHandle="min",n<=this.endValue?(this.startValue=n,this.emitUpdate()):(this.startValue=this.endValue,a.value=`${this.endValue}`)});h(this,"handleEndValueChange",r=>{const a=r.target,n=Number.parseInt(a.value,10);this.lastFocusedHandle="max",n>=this.startValue?(this.endValue=n,this.emitUpdate()):(this.endValue=this.startValue,a.value=`${this.startValue}`)});this.__registerHost(),this.rangeChanged=Ce(this,"rangeChanged")}componentDidLoad(){this.startValue=this.min,this.endValue=this.max}render(){const r=this.min,a=this.max,n=(this.startValue-r)/(a-r)*100,o=(this.endValue-r)/(a-r)*100,s=this.dataType==="number"?this.startValue:new Date(this.startValue).getFullYear(),c=this.dataType==="number"?this.endValue:new Date(this.endValue).getFullYear();return d("div",{key:"ec4a36e1ce6534b7c077114086d759e0b1e7a24e",class:"searchcraft-slider-container"},d("div",{key:"35487cbeaeeb23052631804704645ca929340f70",class:"searchcraft-slider-range-container"},d("div",{key:"186e699def8e7a6e58e8ad5f04953ac1c6584344",class:"searchcraft-slider-active-range",style:{left:`${n}%`,width:`${o-n}%`}}),d("input",{key:"97638e2a1471888c2be47f7526e9dd98fea58683",class:M("searchcraft-slider-input","searchcraft-slider-input-min-handle"),max:this.max,min:this.min,onInput:this.handleStartValueChange.bind(this),step:this.granularity,style:{zIndex:this.lastFocusedHandle==="min"?"2":"1"},type:"range",value:this.startValue}),d("input",{key:"db2abded80b606d17bde1677e4acc09a85e6e20e",class:M("searchcraft-slider-input","searchcraft-slider-input-max-handle"),max:this.max,min:this.min,onInput:this.handleEndValueChange.bind(this),step:this.granularity,style:{zIndex:this.lastFocusedHandle==="max"?"2":"1"},type:"range",value:this.endValue})),d("div",{key:"83954b6955a872a17377d506d2d8458059acac03",class:"searchcraft-slider-label-container"},d("span",{key:"b5315b4438385ecf5df3f76579fdf102b6a8c39c",class:"searchcraft-slider-label"},s),d("span",{key:"875094ac7ee69e04c3a16407388dd27f167b3c8f",class:"searchcraft-slider-label"},c)))}},[0,"searchcraft-slider",{max:[2],min:[2],granularity:[2],dataType:[1,"data-type"],endValue:[32],startValue:[32],lastFocusedHandle:[32]}]);function Da(){if(typeof customElements>"u")return;["searchcraft-slider"].forEach(t=>{switch(t){case"searchcraft-slider":customElements.get(t)||customElements.define(t,Jo);break}})}const Zo=N(class extends D{constructor(){super();h(this,"label","Toggle");h(this,"subLabel");h(this,"toggleUpdated");h(this,"isActive",!1);h(this,"unsubscribe");h(this,"lastSearchTerm");h(this,"handleToggle",async()=>{var r;this.isActive=!this.isActive,(r=this.toggleUpdated)==null||r.emit(this.isActive)});this.__registerHost(),this.toggleUpdated=Ce(this,"toggleUpdated")}connectedCallback(){this.unsubscribe=_.subscribe(r=>{r.searchTerm!==this.lastSearchTerm&&r.searchTerm.trim().length===0&&(this.isActive=!1),this.lastSearchTerm=r.searchTerm})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this)}render(){return d("div",{key:"25f3acd2b5dd6837182c8f07c092c54c35542c2f",class:"searchcraft-toggle-button-container"},d("div",{key:"d2951f2673af55159ad6f39d381d272a3f9f872b"},d("p",{key:"2468e261d46b454ce896b614ca2a076d27a31a8b",class:"searchcraft-toggle-button-label"},this.label),this.subLabel&&d("p",{key:"1d9887dc12f30fb1982cf0d8a692ebfeca8edc1a",class:"searchcraft-toggle-button-sub-label"},this.subLabel)),d("button",{key:"f51bb553d6b210233aa6ebfc4318aa521036d922",class:M("searchcraft-toggle-button-background",{active:this.isActive}),onClick:this.handleToggle,type:"button"},d("div",{key:"a34339f1bb5ab4742d897b01b61fe6c8c23e7e1e",class:M("searchcraft-toggle-button-handle",{active:this.isActive})})))}},[0,"searchcraft-toggle-button",{label:[1],subLabel:[1,"sub-label"],isActive:[32],unsubscribe:[32],lastSearchTerm:[32]}]);function Na(){if(typeof customElements>"u")return;["searchcraft-toggle-button"].forEach(t=>{switch(t){case"searchcraft-toggle-button":customElements.get(t)||customElements.define(t,Zo);break}})}const ei=N(class extends D{constructor(){super();h(this,"items",[]);h(this,"unsubscribe");h(this,"lastSearchTerm");h(this,"searchStore",_.getState());this.__registerHost()}componentDidLoad(){this.unsubscribe=_.subscribe(r=>{this.lastSearchTerm=r.searchTerm||""})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this)}handleDateRangeChanged(r,a,n){const o=new Date(new Date(a).getFullYear(),0,1),s=new Date(new Date(n).getFullYear()+1,0,0);this.searchStore.addRangeValueForIndexField({fieldName:r,value:`${r}:[${o.toISOString()} TO ${s.toISOString()}]`}),this.searchStore.search()}handleNumericRangeChanged(r,a,n){this.searchStore.addRangeValueForIndexField({fieldName:r,value:`${r}:[${a} TO ${n}]`}),this.searchStore.search()}handleFacetSelectionUpdated(r,a){a.length>0?this.searchStore.addFacetPathsForIndexField({fieldName:r,value:`${r}: IN [${a.join(" ")}]`}):this.searchStore.removeFacetPathsForIndexField(r),this.searchStore.search()}handleExactMatchToggleUpdated(r){this.searchStore.setSearchMode(r?"exact":"fuzzy"),this.searchStore.search()}handleMostRecentToggleUpdated(r){this.searchStore.setSortType(r?"desc":"asc"),this.searchStore.search()}render(){return d("div",{key:"73ca2e0efab911c5095c23ba33e85a26cc440b4a",class:"searchcraft-filter-panel"},this.items.map(r=>{switch(r.type){case"dateRange":{const a=r,n=new Date(a.options.minDate).getTime(),o=new Date(a.options.maxDate).getTime(),s=_a(a.options.granularity);return d("div",{class:"searchcraft-filter-panel-section"},d("p",{class:"searchcraft-filter-panel-label"},r.label),d("searchcraft-slider",{min:n,max:o,granularity:s,dataType:"date",onRangeChanged:c=>{this.handleDateRangeChanged(a.fieldName,c.detail.startValue,c.detail.endValue)}}))}case"numericRange":{const a=r;return d("div",{class:"searchcraft-filter-panel-section"},d("p",{class:"searchcraft-filter-panel-label"},r.label),d("searchcraft-slider",{min:a.options.min,max:a.options.max,granularity:a.options.granularity,onRangeChanged:n=>{this.handleNumericRangeChanged(a.fieldName,n.detail.startValue,n.detail.endValue)}}))}case"facets":{const a=r;return d("div",{class:"searchcraft-filter-panel-section"},d("p",{class:"searchcraft-filter-panel-label"},r.label),d("searchcraft-facet-list",{fieldName:a.fieldName,onFacetSelectionUpdated:n=>{this.handleFacetSelectionUpdated(a.fieldName,n.detail.paths)}}))}case"exactMatchToggle":{const a=r;return d("searchcraft-toggle-button",{label:a.label,subLabel:a.options.subLabel,onToggleUpdated:n=>{this.handleExactMatchToggleUpdated(n.detail)}})}case"mostRecentToggle":{const a=r;return d("searchcraft-toggle-button",{label:a.label,subLabel:a.options.subLabel,onToggleUpdated:n=>{this.handleMostRecentToggleUpdated(n.detail)}})}}}))}},[0,"searchcraft-filter-panel",{items:[16],unsubscribe:[32],lastSearchTerm:[32]}]);function ti(){if(typeof customElements>"u")return;["searchcraft-filter-panel","searchcraft-facet-list","searchcraft-slider","searchcraft-toggle-button"].forEach(t=>{switch(t){case"searchcraft-filter-panel":customElements.get(t)||customElements.define(t,ei);break;case"searchcraft-facet-list":customElements.get(t)||Fa();break;case"searchcraft-slider":customElements.get(t)||Da();break;case"searchcraft-toggle-button":customElements.get(t)||Na();break}})}const ri=ti,ai=N(class extends D{constructor(){super();h(this,"inputLabelClassName","");h(this,"label","");this.__registerHost()}render(){return d("label",{key:"528396d4be9f22ff0c02d95d8bcea056576aed41",class:M("searchcraft-input-label",this.inputLabelClassName),htmlFor:"searchcraft-input-id"},this.label)}},[0,"searchcraft-input-label",{inputLabelClassName:[1,"input-label-class-name"],label:[1]}]);function lr(){if(typeof customElements>"u")return;["searchcraft-input-label"].forEach(t=>{switch(t){case"searchcraft-input-label":customElements.get(t)||customElements.define(t,ai);break}})}const si=N(class extends D{constructor(){super();h(this,"autoSearch",!0);h(this,"buttonPlacement","none");h(this,"buttonLabel");h(this,"inputLabel");h(this,"customStyles",{});h(this,"placeholderValue","Enter Search");h(this,"searchTerm","");h(this,"inputFocus");h(this,"inputBlur");h(this,"inputInit");h(this,"inputValue",this.searchTerm);h(this,"error",!1);h(this,"core");h(this,"searchStore",_.getState());h(this,"handleOnInput",r=>{const a=r.target;this.inputValue=a.value,this.autoSearch&&this.performSearch(a.value)});h(this,"performSearch",async r=>{if(r!==_.getState().searchTerm){this.searchTerm=r.trim(),this.error=!1,this.searchStore.setSearchTerm(this.searchTerm);try{await this.searchStore.search()}catch(a){console.log(a),this.error=!0}}});h(this,"handleClearInput",()=>{this.inputValue="",this.searchTerm="",this.searchStore.setSearchTerm(""),this.searchStore.setSearchClientResponseItems([]),this.error=!1});h(this,"handleFormSubmit",async r=>{r.preventDefault(),await this.performSearch(this.searchTerm)});this.__registerHost(),this.inputFocus=Ce(this,"inputFocus"),this.inputBlur=Ce(this,"inputBlur"),this.inputInit=Ce(this,"inputInit")}init(){var r;this.core&&(this.searchStore.initialize(this.core),(r=this.inputInit)==null||r.emit())}connectedCallback(){this.init()}onCoreChange(){this.init()}render(){const r=rt(this.customStyles),a=this.inputValue.length>0,n=M("searchcraft-input-grid",{"searchcraft-input-grid-buttonLeft":this.buttonPlacement==="left","searchcraft-input-grid-buttonRight":this.buttonPlacement==="right","searchcraft-input-grid-buttonNone":this.buttonPlacement==="none"}),s={gap:this.inputLabel||this.error?"4px 8px":"0px 8px"};return d("form",{key:"52760b113a209c51638bcb005e0b6c3d5bf9741d",class:"searchcraft-input-form",onSubmit:this.handleFormSubmit},d("div",{key:"6b20020b8a67c9d860fca7da67150a8d75bd3313",class:n,style:s},d("div",{key:"67bba2889e6fde70c4f349dfbd61d9a632c08301",class:"searchcraft-input-button-wrapper"},d("searchcraft-button",{key:"a839e1a67d238bfbe6d47857f6339e49d14f9560",onButtonClick:this.handleFormSubmit,label:this.buttonLabel})),this.inputLabel&&d("div",{key:"a2a69b7dbdf1142459d6ffad90dc26a38a76276d",class:"searchcraft-input-label-wrapper"},d("searchcraft-input-label",{key:"621a4903821ba8c1854e3ff89d30a24dba3ed0fb",label:this.inputLabel})),this.error&&d("div",{key:"b4cd633a139488cac185c38123b138fc5d51cd20",class:"searchcraft-input-error-wrapper"},d("searchcraft-error-message",{key:"ccadaf96ac8317b6415a83e6523816328e83eb3e",errorMessage:"Something went wrong."})),d("div",{key:"0f13777c2e5f806ce12fff9680d7862a27b2e260",class:"searchcraft-input-wrapper"},d("input",{key:"a9b58a486dfaadaedf3eeb9aec5e4c3c3548536b",autoComplete:"off",class:"searchcraft-input",onFocus:()=>{var c;return(c=this.inputFocus)==null?void 0:c.emit()},onBlur:()=>{var c;return(c=this.inputBlur)==null?void 0:c.emit()},onInput:c=>{this.handleOnInput(c)},placeholder:this.placeholderValue,style:r,type:"text",value:this.inputValue}),d("div",{key:"a57e4f72ee1383e42158bbc9e35d47d2c468acf5",class:"searchcraft-input-search-icon-wrapper"},d("svg",{key:"c7bda92af1488981d5de08af0f9ae3064c76c354",class:"searchcraft-input-search-icon",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},d("title",{key:"f4dc47ae6c88517eeaea574fe819423b3d6e6cb5",id:"searchcraft-title"},"Searchcraft Search Icon Light"),d("path",{key:"c77497591b4f31de0f3e008baa79c006fd0a2eb9",d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))),a&&d("button",{key:"e125b759eaa21dfdd4058bf36f3c10233f067835",type:"button",class:"searchcraft-input-clear-button",onClick:this.handleClearInput},d("svg",{key:"b2767658bb9edbc51efd6430e051127b08c9ab83",class:"searchcraft-input-clear-icon",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},d("title",{key:"990ff3c8f207d09192e954b0f5d059e0683db2d4",id:"icon-title"},"Searchcraft Clear Input Icon Light"),d("path",{key:"5322d9abb4d60a75869ca943a17157a32c502035",d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))))))}static get watchers(){return{core:["onCoreChange"]}}},[0,"searchcraft-input-form",{autoSearch:[4,"auto-search"],buttonPlacement:[1,"button-placement"],buttonLabel:[1,"button-label"],inputLabel:[1,"input-label"],customStyles:[1,"custom-styles"],placeholderValue:[1,"placeholder-value"],searchTerm:[1,"search-term"],core:[16],inputValue:[32],error:[32]},void 0,{core:["onCoreChange"]}]);function Ua(){if(typeof customElements>"u")return;["searchcraft-input-form","searchcraft-button","searchcraft-error-message","searchcraft-input-label"].forEach(t=>{switch(t){case"searchcraft-input-form":customElements.get(t)||customElements.define(t,si);break;case"searchcraft-button":customElements.get(t)||xt();break;case"searchcraft-error-message":customElements.get(t)||Ct();break;case"searchcraft-input-label":customElements.get(t)||lr();break}})}const ni=Ua,oi=lr,ii=N(class extends D{constructor(){super();h(this,"customStyles");h(this,"searchTerm");h(this,"searchResultsPerPage");h(this,"searchResultsPage");h(this,"searchResultsCount");h(this,"searchResultsPagesCount",1);h(this,"searchResultsRangeMin",1);h(this,"searchResultsRangeMax",1);h(this,"setSearchResultsPage",()=>{});h(this,"unsubscribe",()=>{});this.__registerHost()}componentDidLoad(){this.unsubscribe=_.subscribe(r=>{this.searchTerm=r.searchTerm,this.searchResultsPerPage=r.searchResultsPerPage,this.searchResultsPage=r.searchResultsPage,this.searchResultsCount=r.searchResultsCount,this.searchResultsPagesCount=Math.ceil(this.searchResultsCount/this.searchResultsPerPage),this.searchResultsRangeMin=(this.searchResultsPage-1)*this.searchResultsPerPage+1,this.searchResultsRangeMax=(this.searchResultsPerPage-1)*this.searchResultsPerPage+this.searchResultsPerPage,this.setSearchResultsPage=r.setSearchResultsPage})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this)}handleGoToPage(r){this.setSearchResultsPage(r)}renderOddPaginationItem(r){return d("li",null,d("button",{class:M("searchcraft-pagination-item",{"searchcraft-pagination-item-active":this.searchResultsPage===r}),onClick:()=>this.handleGoToPage(r),type:"button"},r))}renderEvenPaginationItem(r){if(!(this.searchResultsPagesCount<=r))return(this.searchResultsPagesCount<=5||r<Math.ceil(this.searchResultsPagesCount/2)?this.searchResultsPage<=r+1:this.searchResultsPage>=r-1)?d("li",null,d("button",{class:M("searchcraft-pagination-item",{"searchcraft-pagination-item-active":this.searchResultsPage===r}),onClick:()=>this.handleGoToPage(r),type:"button"},r)):d("li",null,d("span",{class:"searchcraft-pagination-item"},"..."))}renderMiddlePaginationItem(){if(!(this.searchResultsPagesCount<=3))return this.searchResultsPagesCount<=5||this.searchResultsPage<=3||this.searchResultsPage>=this.searchResultsPagesCount-2?d("li",null,d("button",{class:M("searchcraft-pagination-item",{"searchcraft-pagination-item-active":this.searchResultsPage===3||this.searchResultsPage===this.searchResultsPagesCount-2}),type:"button",onClick:()=>this.handleGoToPage(this.searchResultsPage>=this.searchResultsPagesCount-2?this.searchResultsPagesCount-2:3)},this.searchResultsPage>=this.searchResultsPagesCount-2?this.searchResultsPagesCount-2:3)):d("li",null,d("span",{class:"searchcraft-pagination-item searchcraft-pagination-item-active"},this.searchResultsPage))}render(){if(!(!this.searchTerm||this.searchResultsPagesCount<=1))return d("div",{class:M("searchcraft-pagination",rt(this.customStyles||{}))},d("div",{class:"searchcraft-pagination-control"},d("searchcraft-button",{disabled:this.searchResultsPage===1,hierarchy:"tertiary",onButtonClick:()=>this.handleGoToPage(Math.max(1,this.searchResultsPage-1)),label:"Previous",iconPosition:"left",icon:d("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("title",null,"Previous page icon"),d("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),iconOnly:!0})),d("ul",{class:"searchcraft-pagination-list"},this.renderOddPaginationItem(1),this.renderEvenPaginationItem(2),this.renderMiddlePaginationItem(),this.renderEvenPaginationItem(this.searchResultsPagesCount>4?this.searchResultsPagesCount-1:4),this.renderOddPaginationItem(this.searchResultsPagesCount)),d("div",{class:"searchcraft-pagination-control"},d("searchcraft-button",{disabled:this.searchResultsPage===this.searchResultsPagesCount,hierarchy:"tertiary",onButtonClick:()=>{this.handleGoToPage(Math.min(this.searchResultsPagesCount,this.searchResultsPage+1))},label:"Next",iconPosition:"right",icon:d("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("title",null,"Next page icon"),d("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),iconOnly:!0})))}},[0,"searchcraft-pagination",{customStyles:[1,"custom-styles"],searchTerm:[32],searchResultsPerPage:[32],searchResultsPage:[32],searchResultsCount:[32],searchResultsPagesCount:[32],searchResultsRangeMin:[32],searchResultsRangeMax:[32],setSearchResultsPage:[32]}]);function ci(){if(typeof customElements>"u")return;["searchcraft-pagination","searchcraft-button"].forEach(t=>{switch(t){case"searchcraft-pagination":customElements.get(t)||customElements.define(t,ii);break;case"searchcraft-button":customElements.get(t)||xt();break}})}const li=ci,ui=N(class extends D{constructor(){super(),this.__registerHost()}handleOnClick(){_.getState().setPopoverVisibility(!0)}render(){return d("button",{key:"a8ee70b49a5309cfb1363a272ea0870c48c59688",type:"button",onClick:this.handleOnClick.bind(this)},d("slot",{key:"9ac712ed1f6e69d73e7ade3d42501fb67a02c7ff"}))}},[4,"searchcraft-popover-button"]);function hi(){if(typeof customElements>"u")return;["searchcraft-popover-button"].forEach(t=>{switch(t){case"searchcraft-popover-button":customElements.get(t)||customElements.define(t,ui);break}})}const fi=hi,di=N(class extends D{constructor(){super();h(this,"item");h(this,"popoverResultMappings");h(this,"documentPosition",0);h(this,"href");h(this,"imageSrc");h(this,"imageAlt");h(this,"titleContent");h(this,"subtitleContent");h(this,"handleLinkClick",()=>{var n;const r=_.getState(),a=r.getSearchcraftInstance();if(a){const o=this.documentPosition,s=r.searchTerm,c=r.searchClientResponseItems.length||0;(n=a.measureClient)==null||n.sendMeasureEvent("document_clicked",{document_position:o,number_of_documents:c,search_term:s})}});this.__registerHost()}mapValuesFromDocument(r){var a,n,o,s,c;this.titleContent=he(r,(a=this.popoverResultMappings)==null?void 0:a.title),this.subtitleContent=he(r,(n=this.popoverResultMappings)==null?void 0:n.subtitle),this.href=he(r,(o=this.popoverResultMappings)==null?void 0:o.href),this.imageSrc=he(r,(s=this.popoverResultMappings)==null?void 0:s.imageSource),this.imageAlt=he(r,(c=this.popoverResultMappings)==null?void 0:c.imageAlt)}connectedCallback(){this.item&&this.mapValuesFromDocument(this.item.document)}disconnectedCallback(){}render(){return d("a",{key:"870fae8c0019ea24d9ecd173a781a38e3b17f8de",class:"searchcraft-popover-list-item",href:this.href,onClick:this.handleLinkClick.bind(this)},this.imageSrc&&d("div",{key:"9e200a2be177fed7f6303fdc1ba466fc47817b5d",class:"searchcraft-popover-list-item-image-wrapper"},d("img",{key:"22124b2856cd41220ac852a1fbc94cbf2a1cd9f9",alt:this.imageAlt,src:this.imageSrc,class:"searchcraft-popover-list-item-image"})),d("div",{key:"b3f0bb6784a36befd044e71798915994093177ab",class:"searchcraft-popover-list-item-info-wrapper"},d("p",{key:"caa22a8d68b56814ee29498db48fe1c65d8d7644",class:"searchcraft-popover-list-item-title"},this.titleContent),d("p",{key:"63e11be221d6f274855f7989b3a9dc4532c08e05",class:"searchcraft-popover-list-item-subtitle"},this.subtitleContent)))}},[0,"searchcraft-popover-list-item",{item:[16],popoverResultMappings:[16],documentPosition:[2,"document-position"],href:[32],imageSrc:[32],imageAlt:[32],titleContent:[32],subtitleContent:[32]}]);function ur(){if(typeof customElements>"u")return;["searchcraft-popover-list-item"].forEach(t=>{switch(t){case"searchcraft-popover-list-item":customElements.get(t)||customElements.define(t,di);break}})}const pi=N(class extends D{constructor(){super();h(this,"popoverResultMappings");h(this,"searchClientResponseItems");h(this,"adClientResponseItems");h(this,"searchResultsPage");h(this,"searchResultsPerPage");h(this,"config",(Ya=_.getState().core)==null?void 0:Ya.config);this.__registerHost()}renderWithADMAds(){var r,a;return d("div",{class:"searchcraft-popover-list-view"},(r=this.adClientResponseItems)==null?void 0:r.map(n=>d("searchcraft-ad",{adClientResponseItem:n,adSource:"adMarketplace",key:n.id})),(a=this.searchClientResponseItems)==null?void 0:a.map((n,o)=>d("searchcraft-popover-list-item",{item:n,key:n.id,popoverResultMappings:this.popoverResultMappings,documentPosition:this.searchResultsPerPage*(this.searchResultsPage-1)+o})))}renderWithCustomAds(){var u,l,i,p;const r=[],a=((u=this.config)==null?void 0:u.customAdInterstitialInterval)||0,n=((l=this.config)==null?void 0:l.customAdInterstitialQuantity)||1,o=((i=this.config)==null?void 0:i.customAdStartQuantity)||0,s=((p=this.config)==null?void 0:p.customAdEndQuantity)||0,c=this.searchClientResponseItems||[];for(let g=0;g<o;g++)r.push(d("searchcraft-ad",{adSource:"Custom",key:`${g}-ad`}));c.forEach((g,S)=>{if(a&&S%a===0&&S+a<c.length&&S>=a)for(let P=0;P<n;P++)r.push(d("searchcraft-ad",{adSource:"Custom",key:`${g.id}-ad-${P}`}));r.push(d("searchcraft-popover-list-item",{item:g,key:g.id,popoverResultMappings:this.popoverResultMappings,documentPosition:this.searchResultsPerPage*(this.searchResultsPage-1)+S}))});for(let g=0;g<s;g++)r.push(d("searchcraft-ad",{adSource:"Custom",key:`${g}-ad`}));return d("div",{class:"searchcraft-popover-list-view"},r)}renderWithNoAds(){var r;return d("div",{class:"searchcraft-popover-list-view"},(r=this.searchClientResponseItems)==null?void 0:r.map((a,n)=>d("searchcraft-popover-list-item",{item:a,key:a.id,popoverResultMappings:this.popoverResultMappings,documentPosition:this.searchResultsPerPage*(this.searchResultsPage-1)+n})))}render(){var r;switch(((r=this.config)==null?void 0:r.adSource)||"None"){case"adMarketplace":return this.renderWithADMAds();case"Custom":return this.renderWithCustomAds();default:return this.renderWithNoAds()}}},[0,"searchcraft-popover-list-view",{popoverResultMappings:[16],searchClientResponseItems:[16],adClientResponseItems:[16],searchResultsPage:[2,"search-results-page"],searchResultsPerPage:[2,"search-results-per-page"]}]);function za(){if(typeof customElements>"u")return;["searchcraft-popover-list-view","searchcraft-ad","searchcraft-popover-list-item"].forEach(t=>{switch(t){case"searchcraft-popover-list-view":customElements.get(t)||customElements.define(t,pi);break;case"searchcraft-ad":customElements.get(t)||Tt();break;case"searchcraft-popover-list-item":customElements.get(t)||ur();break}})}const mi=N(class extends D{constructor(){super();h(this,"type","inline");h(this,"popoverResultMappings");h(this,"hotkey","k");h(this,"hotkeyModifier","meta");h(this,"isPopoverVisibleInState",!1);h(this,"unsubscribe");h(this,"searchClientResponseItems",[]);h(this,"adClientResponseItems",[]);h(this,"searchTerm");h(this,"isFocused",!1);h(this,"breakpointSm",576);h(this,"breakpointMd",768);h(this,"breakpointLg",992);h(this,"searchResultsPage");h(this,"searchResultsPerPage");h(this,"modalElement");h(this,"handleDocumentClick",r=>{this.hostElement.contains(r.target)||(this.isFocused=!1)});h(this,"handleDocumentKeyDown",r=>{if(r.key===this.hotkey&&this.handleHotkeyPressed(r),!!this.hostElement.contains(document.activeElement))switch(r.key){case"ArrowDown":case"ArrowUp":r.preventDefault(),this.focusOnNextListItem(r.key);break;case"Escape":_.getState().setPopoverVisibility(!1);break;default:return}});h(this,"handleInputInit",()=>{const r=this.hostElement.querySelector(".searchcraft-input");r==null||r.focus()});this.__registerHost()}get hostElement(){return this}componentDidLoad(){const r=getComputedStyle(document.documentElement);this.breakpointSm=Number.parseFloat(r.getPropertyValue("--sc-breakpoint-sm").trim()),this.breakpointMd=Number.parseFloat(r.getPropertyValue("--sc-breakpoint-md").trim()),this.breakpointLg=Number.parseFloat(r.getPropertyValue("--sc-breakpoint-lg").trim()),this.isPopoverVisibleInState=_.getState().isPopoverVisible,document.addEventListener("click",this.handleDocumentClick),document.addEventListener("keydown",this.handleDocumentKeyDown),this.unsubscribe=_.subscribe(a=>{this.isPopoverVisibleInState!==a.isPopoverVisible&&this.handlePopoverVisibilityChange(a.isPopoverVisible),this.searchClientResponseItems=[...a.searchClientResponseItems],this.adClientResponseItems=[...a.adClientResponseItems],this.searchTerm=a.searchTerm,this.searchResultsPage=a.searchResultsPage,this.searchResultsPerPage=a.searchResultsPerPage})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeyDown)}handlePopoverVisibilityChange(r){this.isPopoverVisibleInState=r,document.body.style.overflow=r?"hidden":"auto"}handleInputFocus(){this.isFocused=!0,this.type==="inline"&&window.visualViewport&&window.visualViewport.width<this.breakpointSm&&(_.getState().setPopoverVisibility(!0),this.modalElement||(this.modalElement=document.createElement("searchcraft-popover-form"),this.modalElement.popoverResultMappings=this.popoverResultMappings,this.modalElement.setAttribute("type","fullscreen"),document.body.appendChild(this.modalElement)))}handleModalBackdropClick(r){_.getState().setPopoverVisibility(!1)}handleHotkeyPressed(r){if(r.ctrlKey&&this.hotkeyModifier==="ctrl"||r.altKey&&this.hotkeyModifier==="alt"||r.metaKey&&this.hotkeyModifier==="meta")if(r.preventDefault(),this.type==="inline"&&!this.isPopoverVisibleInState){const a=this.hostElement.querySelector(".searchcraft-input");a==null||a.focus()}else _.getState().setPopoverVisibility(!this.isPopoverVisibleInState)}handleCancelButtonClick(){_.getState().setPopoverVisibility(!1)}focusOnNextListItem(r){var o,s;const a=Array.from(document.querySelectorAll("a.searchcraft-popover-list-item")).filter(c=>!c.hasAttribute("disabled")&&c.offsetParent!==null),n=a.indexOf(document.activeElement);if(r==="ArrowDown")(o=a[(n+1)%a.length])==null||o.focus();else if(r==="ArrowUp")if(n>=1)(s=a[n-1])==null||s.focus();else{const c=document.querySelector(".searchcraft-input");c&&(c.focus(),requestAnimationFrame(()=>{c.selectionEnd=c.value.length,c.selectionStart=c.value.length}))}}get hasResultsToShow(){var r,a;return this.searchTerm&&((a=(r=this.searchTerm)==null?void 0:r.trim())==null?void 0:a.length)>0&&this.searchClientResponseItems.length>0}renderInlinePopover(){const r=this.hasResultsToShow&&this.isFocused,a=M("searchcraft-popover-form searchcraft-popover-form-inline",{"searchcraft-popover-form-active":r});return d("div",{class:a},d("searchcraft-input-form",{onInputFocus:this.handleInputFocus.bind(this)}),r&&d("div",{class:"searchcraft-popover-inline-wrapper-outer"},d("div",{class:"searchcraft-popover-inline-wrapper-inner"},d("searchcraft-popover-list-view",{popoverResultMappings:this.popoverResultMappings,searchClientResponseItems:this.searchClientResponseItems,adClientResponseItems:this.adClientResponseItems,searchResultsPage:this.searchResultsPage,searchResultsPerPage:this.searchResultsPerPage}))))}renderModalPopover(){if(this.isPopoverVisibleInState){const r=M("searchcraft-popover-form",{"searchcraft-popover-form-active":this.hasResultsToShow});return d("div",{class:"searchcraft-popover-form-modal"},d("div",{class:"searchcraft-popover-form-modal-backdrop",onClick:this.handleModalBackdropClick}),d("div",{class:"searchcraft-popover-form-modal-inner"},d("div",{class:r},d("div",{class:"searchcraft-popover-form-input-wrapper"},d("searchcraft-input-form",{onInputFocus:this.handleInputFocus.bind(this),onInputInit:this.handleInputInit.bind(this)}),d("button",{type:"button",class:"searchcraft-popover-form-cancel-button",onClick:this.handleCancelButtonClick.bind(this)},"Cancel")),this.hasResultsToShow&&d("searchcraft-popover-list-view",{popoverResultMappings:this.popoverResultMappings,searchClientResponseItems:this.searchClientResponseItems,adClientResponseItems:this.adClientResponseItems,searchResultsPage:this.searchResultsPage,searchResultsPerPage:this.searchResultsPerPage}))))}}renderFullscreenPopover(){if(this.isPopoverVisibleInState)return d("div",{class:"searchcraft-popover-form-fullscreen"},d("div",{class:"searchcraft-popover-form"},d("div",{class:"searchcraft-popover-form-input-wrapper"},d("searchcraft-input-form",{onInputFocus:this.handleInputFocus.bind(this),onInputInit:this.handleInputInit.bind(this)}),d("button",{type:"button",class:"searchcraft-popover-form-cancel-button",onClick:this.handleCancelButtonClick.bind(this)},"Cancel")),this.hasResultsToShow&&d("searchcraft-popover-list-view",{popoverResultMappings:this.popoverResultMappings,searchClientResponseItems:this.searchClientResponseItems,adClientResponseItems:this.adClientResponseItems,searchResultsPage:this.searchResultsPage,searchResultsPerPage:this.searchResultsPerPage})))}render(){switch(this.type){case"inline":return this.renderInlinePopover();case"modal":return this.renderModalPopover();case"fullscreen":return this.renderFullscreenPopover()}}},[0,"searchcraft-popover-form",{type:[1],popoverResultMappings:[16],hotkey:[1],hotkeyModifier:[1,"hotkey-modifier"],isPopoverVisibleInState:[32],unsubscribe:[32],searchClientResponseItems:[32],adClientResponseItems:[32],searchTerm:[32],isFocused:[32],breakpointSm:[32],breakpointMd:[32],breakpointLg:[32],searchResultsPage:[32],searchResultsPerPage:[32],modalElement:[32]}]);function Ha(){if(typeof customElements>"u")return;["searchcraft-popover-form","searchcraft-ad","searchcraft-button","searchcraft-error-message","searchcraft-input-form","searchcraft-input-label","searchcraft-popover-form","searchcraft-popover-list-item","searchcraft-popover-list-view"].forEach(t=>{switch(t){case"searchcraft-popover-form":customElements.get(t)||customElements.define(t,mi);break;case"searchcraft-ad":customElements.get(t)||Tt();break;case"searchcraft-button":customElements.get(t)||xt();break;case"searchcraft-error-message":customElements.get(t)||Ct();break;case"searchcraft-input-form":customElements.get(t)||Ua();break;case"searchcraft-input-label":customElements.get(t)||lr();break;case"searchcraft-popover-form":customElements.get(t)||Ha();break;case"searchcraft-popover-list-item":customElements.get(t)||ur();break;case"searchcraft-popover-list-view":customElements.get(t)||za();break}})}const gi=Ha,bi=ur,vi=za,yi=N(class extends D{constructor(){super();h(this,"customFormatter");h(this,"customStyles");h(this,"searchTerm");h(this,"searchResultsPage");h(this,"searchResultsPerPage");h(this,"searchResultsCount");h(this,"count",0);h(this,"range",[0,0]);h(this,"responseTime","0");h(this,"unsubscribe",()=>{});this.__registerHost()}connectedCallback(){this.unsubscribe=_.subscribe(r=>{this.searchTerm=r.searchTerm,this.searchResultsPage=r.searchResultsPage,this.searchResultsPerPage=r.searchResultsPerPage,this.searchResultsCount=r.searchResultsCount,this.count=this.searchResultsCount,this.range[0]=this.searchResultsPage<=1?1:this.searchResultsPerPage*(this.searchResultsPage-1),this.range[1]=this.searchResultsPerPage*this.searchResultsPage,this.range[1]=this.range[1]>this.searchResultsCount?this.searchResultsCount:this.range[1],this.responseTime=((r.searchResponseTimeTaken||0)*1e3).toFixed(2)})}disconnectedCallback(){this.unsubscribe&&this.unsubscribe()}render(){return!this.searchTerm||this.searchResultsCount===0?null:d("p",{class:M("searchcraft-results-info",rt(this.customStyles||{}))},this.customFormatter?this.customFormatter([cr(this.range[0]),cr(this.range[1])],cr(this.count),this.responseTime):`${this.count} results found in ${this.responseTime}ms`)}},[0,"searchcraft-results-info",{customFormatter:[16],customStyles:[1,"custom-styles"],searchTerm:[32],searchResultsPage:[32],searchResultsPerPage:[32],searchResultsCount:[32],count:[32],range:[32],responseTime:[32]}]);function Si(){if(typeof customElements>"u")return;["searchcraft-results-info"].forEach(t=>{switch(t){case"searchcraft-results-info":customElements.get(t)||customElements.define(t,yi);break}})}const wi=Si,Ei=N(class extends D{constructor(){super();h(this,"caption");h(this,"disabled",!1);h(this,"inputId");h(this,"label");h(this,"labelId");h(this,"name");h(this,"options",[]);h(this,"customStyles");h(this,"selectChange");h(this,"searchResultsPerPage");h(this,"setSearchResultsPage",()=>{});h(this,"setSearchResultsPerPage",()=>{});h(this,"handleSelectChange",r=>{this.selectChange.emit(r.target.value)});this.__registerHost(),this.selectChange=Ce(this,"selectChange")}handleGoToPage(r){this.setSearchResultsPage(r)}render(){return d("div",{key:"5024d49d89a3649a5de591d37ded304a9dfb36d9",class:M("searchcraft-select",rt(this.customStyles||{}))},this.label&&d("label",{key:"005aea9b190e5a6c041721e20395be23f76faab6",class:"searchcraft-select-label",id:this.labelId||`${this.inputId}-label`,htmlFor:this.inputId},this.label),d("div",{key:"209d56844c0bcd241e73bafcad24fac927fe7ffa",class:"searchcraft-select-input-wrapper"},d("select",{key:"010c9e596ef45a303f84c0ac0fa54ab67556d7b6","aria-labelledby":this.label?this.labelId||`${this.inputId}-label`:void 0,class:"searchcraft-select-input",disabled:this.disabled,id:this.inputId,name:this.name,onChange:this.handleSelectChange},(typeof this.options=="string"?JSON.parse(this.options):this.options).map(({label:r,value:a,selected:n})=>d("option",{key:a,value:a,selected:n},r))),d("svg",{key:"51d9fb79381468ee0992475ba376df5a5961116c",class:"searchcraft-select-input-icon",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("title",{key:"59186138953557764915d41708d4bcc23a9bb97f"},"Select dropdown icon"),d("path",{key:"ec2c962df16cb68bdaf3e2c32e57d875a63957a9",d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))),this.caption&&d("p",{key:"742bc2dbd8371938894d49bb37d429d1b7a07d7a",class:"searchcraft-select-caption"},this.caption))}},[0,"searchcraft-select",{caption:[1],disabled:[4],inputId:[1,"input-id"],label:[1],labelId:[1,"label-id"],name:[1],options:[1],customStyles:[1,"custom-styles"],searchResultsPerPage:[32],setSearchResultsPage:[32],setSearchResultsPerPage:[32]}]);function Ba(){if(typeof customElements>"u")return;["searchcraft-select"].forEach(t=>{switch(t){case"searchcraft-select":customElements.get(t)||customElements.define(t,Ei);break}})}const Ri=N(class extends D{constructor(){super();h(this,"increment",20);h(this,"customStyles");h(this,"searchTerm");h(this,"searchResultsPage");h(this,"searchResultsPerPage");h(this,"searchResultsCount");h(this,"searchResultsPagesCount");h(this,"initialSearchResultsPerPage");h(this,"setSearchResultsPerPage",()=>{});h(this,"setSearchResultsPage",()=>{});h(this,"unsubscribe",()=>{});this.__registerHost()}componentDidLoad(){this.unsubscribe=_.subscribe(r=>{this.searchTerm=r.searchTerm,this.searchResultsPerPage=r.searchResultsPerPage,this.searchResultsPage=r.searchResultsPage,this.searchResultsCount=r.searchResultsCount,this.searchResultsPagesCount=Math.ceil(this.searchResultsCount/this.searchResultsPerPage),this.setSearchResultsPage=r.setSearchResultsPage,this.setSearchResultsPerPage=r.setSearchResultsPerPage}),this.initialSearchResultsPerPage=_.getState().searchResultsPerPage}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this)}render(){if(!(!this.searchTerm||this.searchResultsPagesCount<=1))return d("div",{class:M("searchcraft-search-results-per-page",rt(this.customStyles||{}))},d("div",{class:"searchcraft-search-results-per-page-select"},d("label",{class:"searchcraft-search-results-per-page-select-label",htmlFor:"searchcraft-search-results-per-page-select-input"},"Results Per Page"),d("div",{class:"searchcraft-search-results-per-page-select-input"},d("searchcraft-select",{inputId:"searchcraft-search-results-per-page-select-input",name:"results-per-page",options:[...Array(5)].map((r,a)=>{const n=this.initialSearchResultsPerPage+Number(this.increment)*a;return{label:`${n}`,value:n}}),onSelectChange:r=>{this.setSearchResultsPerPage(Number(r.detail)),this.setSearchResultsPage(1)}}))))}},[0,"searchcraft-search-results-per-page",{increment:[8],customStyles:[1,"custom-styles"],searchTerm:[32],searchResultsPage:[32],searchResultsPerPage:[32],searchResultsCount:[32],searchResultsPagesCount:[32],initialSearchResultsPerPage:[32],setSearchResultsPerPage:[32],setSearchResultsPage:[32]}]);function Pi(){if(typeof customElements>"u")return;["searchcraft-search-results-per-page","searchcraft-select"].forEach(t=>{switch(t){case"searchcraft-search-results-per-page":customElements.get(t)||customElements.define(t,Ri);break;case"searchcraft-select":customElements.get(t)||Ba();break}})}const ki=Pi,Ti=Ba,Ci=Da,xi=`:root{--sc-text-base-size: 1em;--sc-text-scale-ratio: 1.1;--sc-font-family: sans-serif;--sc-font-bold: 700;--sc-font-normal: 400;--sc-heading-1-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-2-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-3-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-4-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-5-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-6-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) );--sc-body-font-size: calc(var(--sc-text-base-size));--sc-body-small-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) )}:root{--sc-border-radius: 8px;--sc-border-radius-sm: calc(var(--sc-border-radius) / 2);--sc-border-radius-lg: calc(var(--sc-border-radius) * 2)}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-neutral-primary: var(--sc-color-background, #ffffff);--sc-color-background-hover: hsl( from var(--sc-color-background) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-primary-hover: var(--sc-color-background-hover, #fafafa);--sc-color-background-active: hsl( from var(--sc-color-background) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-primary-active: var( --sc-color-background-active, #f7f7f7 );--sc-surface-neutral-secondary: var( --sc-color-background-secondary, var(--sc-color-background, #f3f3f3) );--sc-surface-neutral-secondary-hover: var( --sc-color-background-secondary-hover, var(--sc-color-background-hover, #e6e6e6) );--sc-surface-neutral-secondary-active: var( --sc-color-background-secondary-active, var(--sc-color-background-active, #e0e0e0) );--sc-surface-neutral-light: #ffffff;--sc-content-neutral-primary: var(--sc-color-foreground, #292929);--sc-color-foreground-secondary: hsl( from var(--sc-color-foreground) h s clamp(10, calc(l + 5), 90) );--sc-content-neutral-secondary: var(--sc-color-foreground-secondary, #404040);--sc-border-neutral: rgba(0, 0, 0, 0.1);--sc-surface-brand-primary: var(--sc-color-brand, #000000);--sc-color-brand-hover: hsl( from var(--sc-color-brand) h s clamp(20, calc(l + 5), 95) );--sc-surface-brand-primary-hover: var(--sc-color-brand-hover, #2e2e2e);--sc-color-brand-active: hsl( from var(--sc-color-brand) h s clamp(10, calc(l - 5), 85) );--sc-surface-brand-primary-active: var(--sc-color-brand-active, #292929);--sc-surface-brand-secondary: var( --sc-color-brand-secondary, var(--sc-color-brand, #e6e6e6) );--sc-surface-brand-secondary-hover: var( --sc-color-brand-secondary-hover, var(--sc-color-brand-hover, #ebebeb) );--sc-surface-brand-secondary-active: var( --sc-color-brand-secondary-active, var(--sc-color-brand-active, #e0e0e0) );--sc-content-brand: var( --sc-color-brand-text, var(--sc-surface-brand-primary) );--sc-content-brand-on-primary: #ffffff;--sc-border-brand: var(--sc-surface-brand-primary);--sc-surface-success-primary: var(--sc-color-success, #008000);--sc-color-success-primary-hover: hsl(from var(--sc-color-success) h s 30);--sc-surface-success-primary-hover: var( --sc-color-success-primary-hover, #009900 );--sc-color-success-primary-active: hsl(from var(--sc-color-success) h s 20);--sc-surface-success-primary-active: var( --sc-color-success-primary-active, #006600 );--sc-color-success-secondary: hsl(from var(--sc-color-success) h s 90);--sc-surface-success-secondary: var(--sc-color-success-secondary, #ccffcc);--sc-color-success-secondary-hover: hsl( from var(--sc-color-success-secondary) h s 95 );--sc-surface-success-secondary-hover: var( --sc-color-success-secondary-hover, #e6ffe6 );--sc-color-success-secondary-active: hsl( from var(--sc-color-success-secondary) h s 85 );--sc-surface-success-secondary-active: var( --sc-color-success-secondary-active, #b2ffb2 );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30) );--sc-content-success-on-primary: #ffffff;--sc-border-success: var(--sc-surface-success-primary);--sc-surface-caution-primary: var(--sc-color-caution, #cc6600);--sc-color-caution-primary-hover: hsl(from var(--sc-color-caution) h s 30);--sc-surface-caution-primary-hover: var( --sc-color-caution-primary-hover, #e57300 );--sc-color-caution-primary-active: hsl(from var(--sc-color-caution) h s 20);--sc-surface-caution-primary-active: var( --sc-color-caution-primary-active, #b25a00 );--sc-color-caution-secondary: hsl(from var(--sc-color-caution) h s 90);--sc-surface-caution-secondary: var(--sc-color-caution-secondary, #ffd9b3);--sc-color-caution-secondary-hover: hsl( from var(--sc-color-caution-secondary) h s 95 );--sc-surface-caution-secondary-hover: var( --sc-color-caution-secondary-hover, #ffe5cc );--sc-color-caution-secondary-active: hsl( from var(--sc-color-caution-secondary) h s 85 );--sc-surface-caution-secondary-active: var( --sc-color-caution-secondary-active, #ffcc99 );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30) );--sc-content-caution-on-primary: #ffffff;--sc-border-caution: var(--sc-surface-caution-primary);--sc-surface-danger-primary: var(--sc-color-danger, #cc0000);--sc-color-danger-primary-hover: hsl(from var(--sc-color-danger) h s 30);--sc-surface-danger-primary-hover: var( --sc-color-danger-primary-hover, #e50000 );--sc-color-danger-primary-active: hsl(from var(--sc-color-danger) h s 20);--sc-surface-danger-primary-active: var( --sc-color-danger-primary-active, #b30000 );--sc-color-danger-secondary: hsl(from var(--sc-color-danger) h s 90);--sc-surface-danger-secondary: var(--sc-color-danger-secondary, #ffcccc);--sc-color-danger-secondary-hover: hsl( from var(--sc-color-danger-secondary) h s 95 );--sc-surface-danger-secondary-hover: var( --sc-color-danger-secondary-hover, #ffe7e7 );--sc-color-danger-secondary-active: hsl( from var(--sc-color-danger-secondary) h s 85 );--sc-surface-danger-secondary-active: var( --sc-color-danger-secondary-active, #ffb3b3 );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30) );--sc-content-danger-on-primary: #ffffff;--sc-border-danger: var(--sc-surface-danger-primary);--sc-color-disabled: hsl(from var(--sc-color-page-primary) h s calc(l * 0.5));--sc-surface-disabled: var(--sc-color-disabled, #d9d9d9);--sc-color-disabled-text: hsl( from var(--sc-color-text-primary) h s calc(l * 0.5) );--sc-content-disabled: var(--sc-color-disabled-text, #737373);--sc-content-disabled-on-disabled: var(--sc-color-disabled-text, #737373)}@supports(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none){:root{--sc-color-background-hover: hsl( from var(--sc-color-background) h s clamp(10%, calc(l + 5%), 95%) );--sc-color-background-active: hsl( from var(--sc-color-background) h s clamp(5%, calc(l - 5%), 90%) );--sc-color-foreground-secondary: hsl( from var(--sc-color-foreground) h s clamp(10%, calc(l + 5%), 90%) );--sc-color-brand-hover: hsl( from var(--sc-color-brand) h s clamp(20%, calc(l + 5%), 95%) );--sc-color-brand-active: hsl( from var(--sc-color-brand) h s clamp(10%, calc(l - 5%), 85%) );--sc-color-success-primary-hover: hsl(from var(--sc-color-success) h s 30%);--sc-color-success-primary-active: hsl( from var(--sc-color-success) h s 20% );--sc-color-success-secondary: hsl(from var(--sc-color-success) h s 90%);--sc-color-success-secondary-hover: hsl( from var(--sc-color-success-secondary) h s 95% );--sc-color-success-secondary-active: hsl( from var(--sc-color-success-secondary) h s 85% );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30%) );--sc-color-caution-primary-hover: hsl(from var(--sc-color-caution) h s 30%);--sc-color-caution-primary-active: hsl( from var(--sc-color-caution) h s 20% );--sc-color-caution-secondary: hsl(from var(--sc-color-caution) h s 90%);--sc-color-caution-secondary-hover: hsl( from var(--sc-color-caution-secondary) h s 95% );--sc-color-caution-secondary-active: hsl( from var(--sc-color-caution-secondary) h s 85% );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30%) );--sc-color-danger-primary-hover: hsl(from var(--sc-color-danger) h s 30%);--sc-color-danger-primary-active: hsl(from var(--sc-color-danger) h s 20%);--sc-color-danger-secondary: hsl(from var(--sc-color-danger) h s 90%);--sc-color-danger-secondary-hover: hsl( from var(--sc-color-danger-secondary) h s 95% );--sc-color-danger-secondary-active: hsl( from var(--sc-color-danger-secondary) h s 85% );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30%) )}}.searchcraft-custom-ad{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size)}.searchcraft-adm-ad{all:unset;display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical);border:1px solid blue}.searchcraft-adm-ad:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-adm-ad:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-adm-ad-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:inherit}.searchcraft-adm-ad-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:inherit}.searchcraft-adm-ad-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-adm-ad-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-adm-ad-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-search-result-container{all:unset;align-items:flex-start;border-radius:var(--sc-border-radius-lg);display:flex;flex-direction:column;gap:16px;padding:8px;color:inherit;background-color:var(--sc-surface-neutral-primary)}@media(min-width: 768px){.searchcraft-search-result-container{flex-direction:row}}a.searchcraft-search-result-container{cursor:pointer;transition:background-color 100ms}.searchcraft-base-search-result-content-container{flex:1;display:flex;flex-direction:column;gap:8px}.searchcraft-search-result-image{border-radius:calc(--sc-border-radius-lg - 8px);border-radius:calc(var(--sc-border-radius-lg) - 8px);width:100%}@media(min-width: 768px){.searchcraft-search-result-image{width:200px}}.searchcraft-base-search-result-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin:0}.searchcraft-base-search-result-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-disabled);margin:0}.searchcraft-base-search-result-body-content{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-neutral-secondary);margin:0}.searchcraft-base-search-result-footer-content{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-disabled);margin:0}.searchcraft-search-results-container{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-results-empty-state-container{text-align:center}.searchcraft-search-results-error-message-container{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);background:none;border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;gap:4px;padding:12px;position:relative}.searchcraft-button.searchcraft-button-disabled{cursor:not-allowed}.searchcraft-button-primary{background-color:var(--sc-surface-brand-primary);color:var(--sc-content-brand-on-primary);font-weight:var(--sc-font-bold)}.searchcraft-button-primary:hover{background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button-primary:focus{border-color:var(--sc-border-primary)}.searchcraft-button-primary:active{background-color:var(--sc-surface-brand-primary-active)}.searchcraft-button-primary.searchcraft-button-disabled,.searchcraft-button-primary.searchcraft-button-disabled:hover,.searchcraft-button-primary.searchcraft-button-disabled:focus,.searchcraft-button-primary.searchcraft-button-disabled:active{background-color:var(--sc-surface-disabled);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-tertiary{background-color:var(--sc-surface-neutral-primary);color:var(--sc-content-brand);font-weight:var(--sc-font-normal)}.searchcraft-button-tertiary:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-button-tertiary:focus{background-color:var(--sc-surface-neutral-light);border-color:var(--sc-border-primary)}.searchcraft-button-tertiary:active{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-button-tertiary.searchcraft-button-disabled,.searchcraft-button-tertiary.searchcraft-button-disabled:hover,.searchcraft-button-tertiary.searchcraft-button-disabled:focus,.searchcraft-button-tertiary.searchcraft-button-disabled:active{background-color:var(--sc-surface-neutral-light);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-error-message{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-danger);margin:0}.filtersListContainer{width:100%}.filterCheckboxLabel{align-items:center;color:var(--sc-content-brand);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:14px;position:relative;-webkit-font-smoothing:antialiased}.filterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.filterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.filterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.filterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.filterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.childFilterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:12px;margin-left:24px;position:relative}.childFilterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px;-webkit-font-smoothing:antialiased}.childFilterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.childFilterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.childFilterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.childFilterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.checkContainer{display:none;height:16px;width:16px;position:absolute;top:9px;left:8px}.dashContainer{display:none;height:3px;width:14px;position:absolute;top:3px;left:9px}.searchcraft-facet-message{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-disabled);text-align:center}.searchcraft-filter-panel{display:flex;flex-direction:column;gap:16px}.searchcraft-filter-panel-section{display:flex;flex-direction:column;gap:8px}.searchcraft-filter-panel-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-bold)}:root{--sc-input-border-radius: var(--sc-border-radius);--sc-input-search-icon-size: 20px;--sc-input-clear-icon-size: 20px;--sc-input-padding-left: 44px;--sc-input-padding-right: 44px}.searchcraft-input-grid{display:grid;gap:4px 8px}.searchcraft-input-grid-buttonLeft{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-grid-buttonLeft .searchcraft-input-button-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-label-wrapper{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-error-wrapper{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-grid-buttonRight .searchcraft-input-button-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonNone{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-grid-buttonNone .searchcraft-input-button-wrapper{display:none}.searchcraft-input-grid-buttonNone .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-wrapper{position:relative;display:flex}.searchcraft-input{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-border-radius);border:none;color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px;flex:1}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size);color:var(--sc-content-neutral-secondary)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size);color:var(--sc-content-brand)}.searchcraft-input-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin-top:4px;margin-bottom:4px}:root{--sc-popover-form-border-radius: var(--sc-border-radius);--sc-popover-list-view-height: 400px;--sc-popover-list-item-image-size: 60px;--sc-popover-list-item-padding-horizontal: 8px;--sc-popover-list-item-padding-vertical: 8px;--sc-popover-modal-max-width: 570px}.searchcraft-popover-form{display:flex;flex-direction:column;flex:1}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper{padding:12px;background-color:var(--sc-surface-neutral-secondary);display:flex;flex-direction:row;gap:4px}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper>searchcraft-input-form{flex:1}.searchcraft-popover-form .searchcraft-popover-form-cancel-button{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);border-radius:calc(--sc-popover-form-border-radius - 12px);border-radius:calc(var(--sc-popover-form-border-radius) - 12px);border:0;outline:0;padding:0;flex-shrink:0;background:none;cursor:pointer;padding-left:12px;padding-right:12px}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:focus{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-popover-form-inline .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);border:none;outline:none}.searchcraft-popover-form-inline.searchcraft-popover-form-active .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-outer{position:relative}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-inner{position:absolute;height:var(--sc-popover-list-view-height);z-index:1000;width:100%}.searchcraft-popover-form-inline .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);max-height:var(--sc-popover-list-view-height)}.searchcraft-popover-form-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:0;background-color:var(--sc-surface-neutral-secondary)}@media(min-width: 576px){.searchcraft-popover-form-modal{padding:16px;background-color:rgba(0,0,0,0)}}.searchcraft-popover-form-modal .searchcraft-input{border-radius:calc(--sc-popover-form-border-radius - 12px);border-radius:calc(var(--sc-popover-form-border-radius) - 12px);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{position:absolute;inset:0;background-color:rgba(0,0,0,.5);display:none}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{position:absolute;inset:0;z-index:1002;margin-top:0px;display:flex;border-radius:var(--sc-popover-form-border-radius);overflow:hidden}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{inset:auto;position:relative;width:100%;margin-top:100px;max-width:var(--sc-popover-modal-max-width)}}.searchcraft-popover-form-modal .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:0;border-bottom-right-radius:0}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-list-view{max-height:var(--sc-popover-list-view-height)}}.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:scroll}@media(min-width: 576px){.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:auto}}.searchcraft-popover-form-fullscreen{position:fixed;inset:0;z-index:1000;background-color:var(--sc-surface-neutral-secondary)}.searchcraft-popover-form-fullscreen .searchcraft-popover-form{position:absolute;inset:0}.searchcraft-popover-form-fullscreen .searchcraft-input{border-radius:calc(--sc-popover-form-border-radius - 12px);border-radius:calc(var(--sc-popover-form-border-radius) - 12px);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-fullscreen searchcraft-popover-list-view{overflow:scroll}.searchcraft-popover-list-item{all:unset;color:var(--sc-content-neutral-secondary);display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical)}.searchcraft-popover-list-item:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-popover-list-item-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-popover-list-item-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-results-info{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-primary);margin:0}.searchcraft-slider-container{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.searchcraft-slider-range-container{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range-container::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range{background-color:var(--sc-surface-brand-primary);border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.searchcraft-slider-range-container .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-input{appearance:none;background:rgba(0,0,0,0);border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px}.searchcraft-slider-label-container{color:var(--sc-content-primary);display:flex;font-family:"Source Sans Pro",sans-serif;font-size:15px;font-weight:600;justify-content:space-between;margin-top:10px;width:100%}.searchcraft-slider-label{min-width:30px;text-align:center}.searchcraft-toggle-button-container{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-toggle-button-background{transition:background-color .2s;background:var(--sc-surface-disabled);border:none;border-radius:16px;cursor:pointer;height:26px;position:relative;width:44px;flex-shrink:0}.searchcraft-toggle-button-background.active{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.searchcraft-toggle-button-handle{background:var(--sc-surface-neutral-light);border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform .3s ease;width:18px}.searchcraft-toggle-button-handle.active{transform:translateX(16px)}.searchcraft-pagination{display:inline-grid;gap:16px;grid-template-columns:repeat(3, auto);grid-template-rows:1fr}.searchcraft-pagination-list{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius);display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0;width:auto}.searchcraft-pagination-list li{border-right:1px solid var(--sc-border-neutral);height:100%;min-height:44px;width:44px}.searchcraft-pagination-list li:last-child{border-right:none}.searchcraft-pagination-item{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);align-items:center;background-color:var(--sc-surface-neutral-primary);border:none;display:flex;height:100%;justify-content:center;width:100%}.searchcraft-pagination-item-active{background-color:var(--sc-surface-brand-secondary);font-weight:var(--sc-font-bold)}.searchcraft-pagination-control{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius)}.searchcraft-pagination-range{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);align-items:center;display:flex}.searchcraft-select{display:flex;flex-direction:column;gap:4px}.searchcraft-select-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-bold)}.searchcraft-select-input-wrapper{position:relative}.searchcraft-select-input{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);appearance:none;background-color:var(--sc-surface-neutral-secondary);border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;height:44px;padding:0 44px 0 16px;width:100%}.searchcraft-select-input:hover{background-color:var(--sc-surface-neutral-secondary-hover)}.searchcraft-select-input:active{background-color:var(--sc-surface-neutral-secondary-active)}.searchcraft-select-input:focus{border-color:var(--sc-border-brand);outline:none}.searchcraft-select-input-icon{pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.searchcraft-select-caption{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size)}.searchcraft-search-results-per-page{display:flex}.searchcraft-search-results-per-page-select{align-items:center;display:flex;gap:12px}.searchcraft-search-results-per-page-select-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size)}.searchcraft-search-results-per-page-select-input{min-width:120px}/*# sourceMappingURL=hologram.css.map */
35
- `,$i=N(class extends D{constructor(){super();h(this,"theme");h(this,"customTheme");h(this,"camelToKebab",r=>r.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`).toLowerCase());this.__registerHost()}componentDidLoad(){const r=document.querySelector("#searchcraft-theme")||document.createElement("style");r.innerHTML=xi,r.id="searchcraft-theme";const a=document.head||document.getElementsByTagName("head")[0];a.contains(r)||(a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r)),document.body.dataset.theme=this.theme||"light",Object.entries(JSON.parse(this.customTheme||"[]")).map(([n,o])=>{document.documentElement.style.setProperty(`--${this.camelToKebab(n)}`,`${o}`)})}render(){}},[0,"searchcraft-theme",{theme:[1],customTheme:[1,"custom-theme"]}]);function _i(){if(typeof customElements>"u")return;["searchcraft-theme"].forEach(t=>{switch(t){case"searchcraft-theme":customElements.get(t)||customElements.define(t,$i);break}})}const Ai=_i,Ii=Na,ja=()=>{Lo(),Do(),Bo(),Go(),Wo(),Qo(),ri(),ni(),oi(),li(),fi(),gi(),bi(),vi(),wi(),ki(),Ti(),Ci(),Ai(),Ii()};ja();const Ga={name:"@searchcraft/vue-sdk",version:"0.9.1",private:!1,description:"Searchcraft Vue SDK.",type:"module",license:"Apache-2.0",keywords:["searchcraft"],scripts:{dev:"vite",clean:"rm -rf dist",build:"yarn clean && vite build && yarn docs",docs:"typedoc --options typedoc.json",preview:"vite preview","build-only":"vite build","type-check":"vue-tsc --build"},repository:{type:"git",url:"https://bitbucket.org/madebychalk/searchcraft-javascript-sdks/"},engines:{node:">=18.0.0",npm:">=10.0.0"},main:"./dist/index.umd.js",module:"./dist/index.es.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.es.js",require:"./dist/index.umd.js"},"./components":"./dist/components/index.d.ts","./plugin":"./dist/plugin.d.ts"},files:["dist"],peerDependencies:{vue:"^3.5.13"},devDependencies:{"@searchcraft/core":"^0.9.1","@searchcraft/javascript-sdk":"^0.9.1","@tsconfig/node22":"^22.0.0","@types/node":"^22.10.7","@vitejs/plugin-vue":"^5.2.1","@vitejs/plugin-vue-jsx":"^4.1.1","@vue/runtime-dom":"^3.5.13","@vue/tsconfig":"^0.7.0","npm-run-all2":"^7.0.2",vite:"^6.0.11","vite-plugin-dts":"^4.5.0","vite-plugin-vue-devtools":"^7.7.0","vue-docgen-web-types":"^0.1.8","vue-tsc":"^2.2.0"}},hr="routerLink",Wa="navManager",Mi="router",Li="aria",at=Symbol(),Va={default:at},qa=e=>(e==null?void 0:e.split(" "))||[],Oi=(e,t,r=[])=>{var a;return[...Array.from(((a=e.value)==null?void 0:a.classList)||[]),...r].filter((n,o,s)=>!t.has(n)&&s.indexOf(n)===o)},we=(e,t,r=[],a=[],n,o)=>{const s=G.defineComponent((c,{attrs:u,slots:l,emit:i})=>{var K;const p=G.ref(),g=new Set(qa(u.class)),S=G.getCurrentInstance(),U=((K=S==null?void 0:S.appContext)==null?void 0:K.provides[Wa])?G.inject(Wa):void 0,pe=$=>{const{routerLink:Ee}=c;if(Ee!==at)if(U!==void 0){$.preventDefault();let ce={event:$};for(const Le in c){const z=c[Le];c.hasOwnProperty(Le)&&Le.startsWith(Mi)&&z!==at&&(ce[Le]=z)}U.navigate(ce)}else console.warn("Tried to navigate, but no router was found. Make sure you have mounted Vue Router.")};return()=>{c[n],qa(u.class).forEach(z=>{g.add(z)});const $=c.onClick,Ee=z=>{$!==void 0&&$(z),z.defaultPrevented||pe(z)};let ce={ref:p,class:Oi(p,g),onClick:Ee};for(const z in c){const ne=c[z];(c.hasOwnProperty(z)&&ne!==at||z.startsWith(Li))&&(ce[z]=ne);const H="on"+z.slice(0,1).toUpperCase()+z.slice(1),Oe=u[H];p.value&&u.hasOwnProperty(H)&&"addEventListener"in p.value&&p.value.addEventListener(z,Oe)}return hr in c&&c[hr]!==at&&(ce={...ce,href:c[hr]}),G.h(e,ce,l.default&&l.default())}});if(typeof s!="function"){let c=[],u={};u.ROUTER_LINK_VALUE=Va,r.forEach(l=>u[l]=Va),c=a,s.name=e,s.emits=c,s.props=u}return s},Fi=we("searchcraft-base-search-results",void 0,["customStylesForResults","searchResultMappings","resultImagePlacement","buttonLabel","buttonTarget","buttonRel","containerTarget","containerRel"]),Di=we("searchcraft-filter-panel",void 0,["items"]),Ni=we("searchcraft-input-form",void 0,["autoSearch","buttonPlacement","buttonLabel","inputLabel","customStyles","placeholderValue","searchTerm","core","inputFocus","inputBlur","inputInit"],["inputFocus","inputBlur","inputInit"]),Ui=we("searchcraft-pagination",void 0,["customStyles"]),zi=we("searchcraft-popover-button"),Hi=we("searchcraft-popover-form",void 0,["type","popoverResultMappings","hotkey","hotkeyModifier"]),Bi=we("searchcraft-results-info",void 0,["customFormatter","customStyles"]),ji=we("searchcraft-search-results-per-page",void 0,["increment","customStyles"]),Gi=we("searchcraft-theme",void 0,["theme","customTheme"]),Wi=Fi,Vi=Di,qi=Ni,Yi=zi,Ki=Hi,Xi=Bi,Qi=Gi,Ji=Ui,Zi=ji;class ec extends sn{constructor(t){super(t,{sdkName:Ga.name,sdkVersion:Ga.version})}}ja(),L.Searchcraft=ec,L.SearchcraftBaseSearchResults=Wi,L.SearchcraftFilterPanel=Vi,L.SearchcraftInputForm=qi,L.SearchcraftPagination=Ji,L.SearchcraftPopoverButton=Yi,L.SearchcraftPopoverForm=Ki,L.SearchcraftResultsInfo=Xi,L.SearchcraftSearchResultsPerPage=Zi,L.SearchcraftTheme=Qi,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
35
+ `,$i=N(class extends D{constructor(){super();h(this,"theme");h(this,"customTheme");h(this,"camelToKebab",r=>r.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`).toLowerCase());this.__registerHost()}componentDidLoad(){const r=document.querySelector("#searchcraft-theme")||document.createElement("style");r.innerHTML=xi,r.id="searchcraft-theme";const a=document.head||document.getElementsByTagName("head")[0];a.contains(r)||(a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r)),document.body.dataset.theme=this.theme||"light",Object.entries(JSON.parse(this.customTheme||"[]")).map(([n,o])=>{document.documentElement.style.setProperty(`--${this.camelToKebab(n)}`,`${o}`)})}render(){}},[0,"searchcraft-theme",{theme:[1],customTheme:[1,"custom-theme"]}]);function _i(){if(typeof customElements>"u")return;["searchcraft-theme"].forEach(t=>{switch(t){case"searchcraft-theme":customElements.get(t)||customElements.define(t,$i);break}})}const Ai=_i,Ii=Na,ja=()=>{Lo(),Do(),Bo(),Go(),Wo(),Qo(),ri(),ni(),oi(),li(),fi(),gi(),bi(),vi(),wi(),ki(),Ti(),Ci(),Ai(),Ii()};ja();const Ga={name:"@searchcraft/vue-sdk",version:"0.9.2",private:!1,description:"Searchcraft Vue SDK.",type:"module",license:"Apache-2.0",keywords:["searchcraft"],scripts:{dev:"vite",clean:"rm -rf dist",build:"yarn clean && vite build && yarn docs",docs:"typedoc --options typedoc.json",preview:"vite preview","build-only":"vite build","type-check":"vue-tsc --build"},repository:{type:"git",url:"https://bitbucket.org/madebychalk/searchcraft-javascript-sdks/"},engines:{node:">=18.0.0",npm:">=10.0.0"},main:"./dist/index.umd.js",module:"./dist/index.es.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.es.js",require:"./dist/index.umd.js"},"./components":"./dist/components/index.d.ts","./plugin":"./dist/plugin.d.ts"},files:["dist"],peerDependencies:{vue:"^3.5.13"},devDependencies:{"@searchcraft/core":"^0.9.2","@searchcraft/javascript-sdk":"^0.9.2","@tsconfig/node22":"^22.0.0","@types/node":"^22.10.7","@vitejs/plugin-vue":"^5.2.1","@vitejs/plugin-vue-jsx":"^4.1.1","@vue/runtime-dom":"^3.5.13","@vue/tsconfig":"^0.7.0","npm-run-all2":"^7.0.2",vite:"^6.0.11","vite-plugin-dts":"^4.5.0","vite-plugin-vue-devtools":"^7.7.0","vue-docgen-web-types":"^0.1.8","vue-tsc":"^2.2.0"}},hr="routerLink",Wa="navManager",Mi="router",Li="aria",at=Symbol(),Va={default:at},qa=e=>(e==null?void 0:e.split(" "))||[],Oi=(e,t,r=[])=>{var a;return[...Array.from(((a=e.value)==null?void 0:a.classList)||[]),...r].filter((n,o,s)=>!t.has(n)&&s.indexOf(n)===o)},we=(e,t,r=[],a=[],n,o)=>{const s=G.defineComponent((c,{attrs:u,slots:l,emit:i})=>{var K;const p=G.ref(),g=new Set(qa(u.class)),S=G.getCurrentInstance(),U=((K=S==null?void 0:S.appContext)==null?void 0:K.provides[Wa])?G.inject(Wa):void 0,pe=$=>{const{routerLink:Ee}=c;if(Ee!==at)if(U!==void 0){$.preventDefault();let ce={event:$};for(const Le in c){const z=c[Le];c.hasOwnProperty(Le)&&Le.startsWith(Mi)&&z!==at&&(ce[Le]=z)}U.navigate(ce)}else console.warn("Tried to navigate, but no router was found. Make sure you have mounted Vue Router.")};return()=>{c[n],qa(u.class).forEach(z=>{g.add(z)});const $=c.onClick,Ee=z=>{$!==void 0&&$(z),z.defaultPrevented||pe(z)};let ce={ref:p,class:Oi(p,g),onClick:Ee};for(const z in c){const ne=c[z];(c.hasOwnProperty(z)&&ne!==at||z.startsWith(Li))&&(ce[z]=ne);const H="on"+z.slice(0,1).toUpperCase()+z.slice(1),Oe=u[H];p.value&&u.hasOwnProperty(H)&&"addEventListener"in p.value&&p.value.addEventListener(z,Oe)}return hr in c&&c[hr]!==at&&(ce={...ce,href:c[hr]}),G.h(e,ce,l.default&&l.default())}});if(typeof s!="function"){let c=[],u={};u.ROUTER_LINK_VALUE=Va,r.forEach(l=>u[l]=Va),c=a,s.name=e,s.emits=c,s.props=u}return s},Fi=we("searchcraft-base-search-results",void 0,["customStylesForResults","searchResultMappings","resultImagePlacement","buttonLabel","buttonTarget","buttonRel","containerTarget","containerRel"]),Di=we("searchcraft-filter-panel",void 0,["items"]),Ni=we("searchcraft-input-form",void 0,["autoSearch","buttonPlacement","buttonLabel","inputLabel","customStyles","placeholderValue","searchTerm","core","inputFocus","inputBlur","inputInit"],["inputFocus","inputBlur","inputInit"]),Ui=we("searchcraft-pagination",void 0,["customStyles"]),zi=we("searchcraft-popover-button"),Hi=we("searchcraft-popover-form",void 0,["type","popoverResultMappings","hotkey","hotkeyModifier"]),Bi=we("searchcraft-results-info",void 0,["customFormatter","customStyles"]),ji=we("searchcraft-search-results-per-page",void 0,["increment","customStyles"]),Gi=we("searchcraft-theme",void 0,["theme","customTheme"]),Wi=Fi,Vi=Di,qi=Ni,Yi=zi,Ki=Hi,Xi=Bi,Qi=Gi,Ji=Ui,Zi=ji;class ec extends sn{constructor(t){super(t,{sdkName:Ga.name,sdkVersion:Ga.version})}}ja(),L.Searchcraft=ec,L.SearchcraftBaseSearchResults=Wi,L.SearchcraftFilterPanel=Vi,L.SearchcraftInputForm=qi,L.SearchcraftPagination=Ji,L.SearchcraftPopoverButton=Yi,L.SearchcraftPopoverForm=Ki,L.SearchcraftResultsInfo=Xi,L.SearchcraftSearchResultsPerPage=Zi,L.SearchcraftTheme=Qi,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
36
36
  //# sourceMappingURL=index.umd.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchcraft/vue-sdk",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "private": false,
5
5
  "description": "Searchcraft Vue SDK.",
6
6
  "type": "module",
@@ -44,8 +44,8 @@
44
44
  "vue": "^3.5.13"
45
45
  },
46
46
  "devDependencies": {
47
- "@searchcraft/core": "^0.9.1",
48
- "@searchcraft/javascript-sdk": "^0.9.1",
47
+ "@searchcraft/core": "^0.9.2",
48
+ "@searchcraft/javascript-sdk": "^0.9.2",
49
49
  "@tsconfig/node22": "^22.0.0",
50
50
  "@types/node": "^22.10.7",
51
51
  "@vitejs/plugin-vue": "^5.2.1",
@@ -59,5 +59,5 @@
59
59
  "vue-docgen-web-types": "^0.1.8",
60
60
  "vue-tsc": "^2.2.0"
61
61
  },
62
- "gitHead": "ed9e1c16623cdc4592bac8a7df59ce436d21e5d2"
62
+ "gitHead": "d7ab21f807b4a9146684af6f80671fd5d8e7b156"
63
63
  }