@searchcraft/vue-sdk 0.8.1 → 0.9.0
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/README.md +35 -41
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +904 -723
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +11 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/stencil-web-components.d.ts +1 -2
- package/dist/stencil-web-components.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/plugin.d.ts +0 -3
- package/dist/plugin.d.ts.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
(function(m,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],E):(m=typeof globalThis<"u"?globalThis:m||self,E(m.SearchcraftVueSdk={},m.Vue))})(this,function(m,E){"use strict";const W="routerLink",oe="navManager",Ae="router",Fe="aria",F=Symbol(),le={default:F},ie=e=>(e==null?void 0:e.split(" "))||[],je=(e,t,s=[])=>{var n;return[...Array.from(((n=e.value)==null?void 0:n.classList)||[]),...s].filter((r,i,l)=>!t.has(r)&&l.indexOf(r)===i)},_=(e,t,s=[],n=[],r,i)=>{const l=E.defineComponent((a,{attrs:o,slots:f,emit:$})=>{var y;const c=E.ref(),u=new Set(ie(o.class)),d=E.getCurrentInstance(),g=((y=d==null?void 0:d.appContext)==null?void 0:y.provides[oe])?E.inject(oe):void 0,b=p=>{const{routerLink:N}=a;if(N!==F)if(g!==void 0){p.preventDefault();let R={event:p};for(const C in a){const S=a[C];a.hasOwnProperty(C)&&C.startsWith(Ae)&&S!==F&&(R[C]=S)}g.navigate(R)}else console.warn("Tried to navigate, but no router was found. Make sure you have mounted Vue Router.")};return()=>{a[r],ie(o.class).forEach(S=>{u.add(S)});const p=a.onClick,N=S=>{p!==void 0&&p(S),S.defaultPrevented||b(S)};let R={ref:c,class:je(c,u),onClick:N};for(const S in a){const Oe=a[S];(a.hasOwnProperty(S)&&Oe!==F||S.startsWith(Fe))&&(R[S]=Oe);const we="on"+S.slice(0,1).toUpperCase()+S.slice(1),qt=o[we];c.value&&o.hasOwnProperty(we)&&"addEventListener"in c.value&&c.value.addEventListener(S,qt)}return W in a&&a[W]!==F&&(R={...R,href:a[W]}),E.h(e,R,f.default&&f.default())}});if(typeof l!="function"){let a=[],o={};o.ROUTER_LINK_VALUE=le,s.forEach(f=>o[f]=le),a=n,l.name=e,l.emits=a,l.props=o}return l},De=_("searchcraft-base-search-results",void 0,["customStylesForResults","searchResultMappings","resultImagePlacement","buttonLabel","buttonTarget","buttonRel","containerTarget","containerRel","noResults"],["noResults"]),Ne=_("searchcraft-filter-panel",void 0,["items"]),Ue=_("searchcraft-input-form",void 0,["config","autoSearch","buttonPlacement","buttonLabel","inputLabel","customStyles","placeholderValue","searchTerm","inputCleared","noResultsReceived","inputFocus","inputBlur","inputInit","querySubmit"],["inputCleared","noResultsReceived","inputFocus","inputBlur","inputInit","querySubmit"]),ze=_("searchcraft-pagination",void 0,["customStyles"]),He=_("searchcraft-popover-button"),Me=_("searchcraft-popover-form",void 0,["config","type","popoverResultMappings","hotkey","hotkeyModifier"]),Be=_("searchcraft-results-info",void 0,["customFormatter","customStyles"]),qe=_("searchcraft-search-results-per-page",void 0,["increment","customStyles"]),We=_("searchcraft-theme",void 0,["theme","customTheme"]),Ge=De,Xe=Ne,Ke=Ue,Ye=He,Qe=Me,Je=Be,Ze=We,Ve=ze,et=qe,tt="searchcraft-javascript-sdk",O={allRenderFn:!0,appendChildSlotFix:!1,asyncLoading:!0,asyncQueue:!1,attachStyles:!0,cloneNodeFix:!1,cmpDidLoad:!0,cmpDidRender:!1,cmpDidUnload:!1,cmpDidUpdate:!1,cmpShouldUpdate:!1,cmpWillLoad:!1,cmpWillRender:!1,cmpWillUpdate:!1,connectedCallback:!0,constructableCSS:!0,cssAnnotations:!0,devTools:!1,disconnectedCallback:!0,element:!1,event:!0,experimentalScopedSlotChanges:!1,experimentalSlotFixes:!1,formAssociated:!1,hasRenderFn:!0,hostListener:!1,hostListenerTarget:!1,hostListenerTargetBody:!1,hostListenerTargetDocument:!1,hostListenerTargetParent:!1,hostListenerTargetWindow:!1,hotModuleReplacement:!1,hydrateClientSide:!1,hydrateServerSide:!1,hydratedAttribute:!1,hydratedClass:!0,hydratedSelectorName:"hydrated",initializeNextTick:!1,invisiblePrehydration:!0,isDebug:!1,isDev:!1,isTesting:!1,lazyLoad:!0,lifecycle:!0,lifecycleDOMEvents:!1,member:!0,method:!1,mode:!1,modernPropertyDecls:!0,observeAttribute:!0,profile:!1,prop:!0,propBoolean:!0,propMutable:!1,propNumber:!0,propString:!0,reflect:!1,scoped:!1,scopedSlotTextContentFix:!1,scriptDataOpts:!1,shadowDelegatesFocus:!1,shadowDom:!1,slot:!0,slotChildNodesFix:!1,slotRelocation:!0,state:!0,style:!1,svg:!0,taskQueue:!0,transformTagName:!1,updatable:!0,vdomAttribute:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomPropOrAttr:!0,vdomRef:!1,vdomRender:!0,vdomStyle:!0,vdomText:!0,vdomXlink:!1,watchCallback:!0};var st=Object.defineProperty,nt=(e,t)=>{for(var s in t)st(e,s,{get:t[s],enumerable:!0})},rt="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",ce=new WeakMap,T=e=>ce.get(e),ot=(e,t)=>{const s={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return s.$onReadyPromise$=new Promise(r=>s.$onReadyResolve$=r),e["s-p"]=[],e["s-rc"]=[],ce.set(e,s)},fe=(e,t)=>t in e,w=(e,t)=>(0,console.error)(e,t),ue=new Map,lt=(e,t,s)=>{const n=e.$tagName$.replace(/-/g,"_"),r=e.$lazyBundleId$;if(!r)return;const i=ue.get(r);if(i)return i[n];/*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${r}.entry.js`).then(l=>(ue.set(r,l),l[n]),l=>{w(l,t.$hostElement$)})},it="{visibility:hidden}.hydrated{visibility:inherit}",ct="slot-fb{display:contents}slot-fb[hidden]{display:none}",U=typeof window<"u"?window:{},k=U.document||{head:{}},v={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,s,n)=>e.addEventListener(t,s,n),rel:(e,t,s,n)=>e.removeEventListener(t,s,n),ce:(e,t)=>new CustomEvent(e,t)},ft=O.shadowDom,ut=e=>Promise.resolve(e),G=!1,$e=[],de=[],$t=(e,t)=>s=>{e.push(s),G||(G=!0,v.$flags$&4?K(X):v.raf(X))},he=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(s){w(s)}e.length=0},X=()=>{he($e),he(de),(G=$e.length>0)&&v.raf(X)},K=e=>ut().then(e),dt=$t(de),Y=e=>(e=typeof e,e==="object"||e==="function");function ht(e){var t,s,n;return(n=(s=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:s.getAttribute("content"))!=null?n:void 0}var pt={};nt(pt,{err:()=>pe,map:()=>gt,ok:()=>Q,unwrap:()=>vt,unwrapErr:()=>yt});var Q=e=>({isOk:!0,isErr:!1,value:e}),pe=e=>({isOk:!1,isErr:!0,value:e});function gt(e,t){if(e.isOk){const s=t(e.value);return s instanceof Promise?s.then(n=>Q(n)):Q(s)}if(e.isErr){const s=e.value;return pe(s)}throw"should never get here"}var vt=e=>{if(e.isOk)return e.value;throw e.value},yt=e=>{if(e.isErr)return e.value;throw e.value},ge=e=>{const t=e.__childNodes||e.childNodes;e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&ve(t,e.tagName).forEach(s=>{var n;s.nodeType===1&&s.tagName==="SLOT-FB"&&((n=mt(s,s["s-sn"],!1))!=null&&n.length?s.hidden=!0:s.hidden=!1)});for(const s of t)s.nodeType===1&&(s.__childNodes||s.childNodes).length&&ge(s)};function ve(e,t,s){let n=0,r=[],i;for(;n<e.length;n++)i=e[n],i["s-sr"]&&i["s-hn"]===t&&s===void 0&&r.push(i),r=[...r,...ve(i.childNodes,t,s)];return r}var mt=(e,t,s=!0)=>{const n=[];for((s&&e["s-sr"]||!e["s-sr"])&&n.push(e);(e=e.nextSibling)&&e["s-sn"]===t;)n.push(e);return n},ye=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",I=(e,t="")=>()=>{},St=(e,t)=>()=>{},bt=(e,t,...s)=>{let n=null,r=null,i=null,l=!1,a=!1;const o=[],f=c=>{for(let u=0;u<c.length;u++)n=c[u],Array.isArray(n)?f(n):n!=null&&typeof n!="boolean"&&((l=!Y(n))&&(n=String(n)),l&&a?o[o.length-1].$text$+=n:o.push(l?J(null,n):n),a=l)};f(s);const $=J(e,null);return $.$attrs$=t,o.length>0&&($.$children$=o),$.$key$=r,$.$name$=i,$},J=(e,t)=>{const s={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return s.$attrs$=null,s.$key$=null,s.$name$=null,s},Rt={},Pt=e=>e&&e.$tag$===Rt,Z=(e,t)=>e!=null&&!Y(e)?t&4?e==="false"?!1:e===""||!!e:t&2?parseFloat(e):t&1?String(e):e:e,Tt=(e,t,s)=>{const n=v.ce(t,s);return e.dispatchEvent(n),n},z=new WeakMap,me=(e,t,s,n,r,i)=>{if(s!==n){let l=fe(e,t),a=t.toLowerCase();if(t==="class"){const o=e.classList,f=Se(s);let $=Se(n);e["s-si"]?($.push(e["s-si"]),f.forEach(c=>{c.startsWith(e["s-si"])&&$.push(c)}),$=[...new Set($)],o.add(...$),delete e["s-si"]):(o.remove(...f.filter(c=>c&&!$.includes(c))),o.add(...$.filter(c=>c&&!f.includes(c))))}else if(t==="style"){for(const o in s)(!n||n[o]==null)&&(o.includes("-")?e.style.removeProperty(o):e.style[o]="");for(const o in n)(!s||n[o]!==s[o])&&(o.includes("-")?e.style.setProperty(o,n[o]):e.style[o]=n[o])}else if(t!=="key")if(!l&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):fe(U,a)?t=a.slice(2):t=a[2]+t.slice(3),s||n){const o=t.endsWith(be);t=t.replace(Ct,""),s&&v.rel(e,t,s,o),n&&v.ael(e,t,n,o)}}else{const o=Y(n);if((l||o&&n!==null)&&!r)try{if(e.tagName.includes("-"))e[t]!==n&&(e[t]=n);else{const f=n??"";t==="list"?l=!1:(s==null||e[t]!=f)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=f:e.setAttribute(t,f))}}catch{}n==null||n===!1?(n!==!1||e.getAttribute(t)==="")&&e.removeAttribute(t):(!l||i&4||r)&&!o&&(n=n===!0?"":n,e.setAttribute(t,n))}}},kt=/\s/,Se=e=>(typeof e=="object"&&"baseVal"in e&&(e=e.baseVal),e?e.split(kt):[]),be="Capture",Ct=new RegExp(be+"$"),Re=(e,t,s)=>{const n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,r=e&&e.$attrs$||{},i=t.$attrs$||{};for(const l of Pe(Object.keys(r)))l in i||me(n,l,r[l],void 0,s,t.$flags$);for(const l of Pe(Object.keys(i)))me(n,l,r[l],i[l],s,t.$flags$)};function Pe(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var V,ee,H=!1,M=!1,te=!1,P=!1,B=(e,t,s)=>{var n;const r=t.$children$[s];let i=0,l,a,o;if(H||(te=!0,r.$tag$==="slot"&&(r.$flags$|=r.$children$?2:1)),r.$text$!==null)l=r.$elm$=k.createTextNode(r.$text$);else if(r.$flags$&1)l=r.$elm$=k.createTextNode("");else{if(P||(P=r.$tag$==="svg"),l=r.$elm$=k.createElementNS(P?rt:at,!H&&O.slotRelocation&&r.$flags$&2?"slot-fb":r.$tag$),P&&r.$tag$==="foreignObject"&&(P=!1),Re(null,r,P),r.$children$)for(i=0;i<r.$children$.length;++i)a=B(e,r,i),a&&l.appendChild(a);r.$tag$==="svg"?P=!1:l.tagName==="foreignObject"&&(P=!0)}return l["s-hn"]=ee,r.$flags$&3&&(l["s-sr"]=!0,l["s-cr"]=V,l["s-sn"]=r.$name$||"",l["s-rf"]=(n=r.$attrs$)==null?void 0:n.ref,o=e&&e.$children$&&e.$children$[s],o&&o.$tag$===r.$tag$&&e.$elm$&&j(e.$elm$,!1)),l},j=(e,t)=>{v.$flags$|=1;const s=Array.from(e.__childNodes||e.childNodes);e["s-sr"]&&O.experimentalSlotFixes;for(let n=s.length-1;n>=0;n--){const r=s[n];r["s-hn"]!==ee&&r["s-ol"]&&(x(D(r).parentNode,r,D(r)),r["s-ol"].remove(),r["s-ol"]=void 0,r["s-sh"]=void 0,te=!0),t&&j(r,t)}v.$flags$&=-2},Te=(e,t,s,n,r,i)=>{let l=e["s-cr"]&&e["s-cr"].parentNode||e,a;for(;r<=i;++r)n[r]&&(a=B(null,s,r),a&&(n[r].$elm$=a,x(l,a,D(t))))},ke=(e,t,s)=>{for(let n=t;n<=s;++n){const r=e[n];if(r){const i=r.$elm$;i&&(M=!0,i["s-ol"]?i["s-ol"].remove():j(i,!0),i.remove())}}},Et=(e,t,s,n,r=!1)=>{let i=0,l=0,a=0,o=0,f=t.length-1,$=t[0],c=t[f],u=n.length-1,d=n[0],h=n[u],g,b;for(;i<=f&&l<=u;)if($==null)$=t[++i];else if(c==null)c=t[--f];else if(d==null)d=n[++l];else if(h==null)h=n[--u];else if(q($,d,r))A($,d,r),$=t[++i],d=n[++l];else if(q(c,h,r))A(c,h,r),c=t[--f],h=n[--u];else if(q($,h,r))($.$tag$==="slot"||h.$tag$==="slot")&&j($.$elm$.parentNode,!1),A($,h,r),x(e,$.$elm$,c.$elm$.nextSibling),$=t[++i],h=n[--u];else if(q(c,d,r))($.$tag$==="slot"||h.$tag$==="slot")&&j(c.$elm$.parentNode,!1),A(c,d,r),x(e,c.$elm$,$.$elm$),c=t[--f],d=n[++l];else{for(a=-1,o=i;o<=f;++o)if(t[o]&&t[o].$key$!==null&&t[o].$key$===d.$key$){a=o;break}a>=0?(b=t[a],b.$tag$!==d.$tag$?g=B(t&&t[l],s,a):(A(b,d,r),t[a]=void 0,g=b.$elm$),d=n[++l]):(g=B(t&&t[l],s,l),d=n[++l]),g&&x(D($.$elm$).parentNode,g,D($.$elm$))}i>f?Te(e,n[u+1]==null?null:n[u+1].$elm$,s,n,l,u):l>u&&ke(t,i,f)},q=(e,t,s=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:s?(s&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,D=e=>e&&e["s-ol"]||e,A=(e,t,s=!1)=>{const n=t.$elm$=e.$elm$,r=e.$children$,i=t.$children$,l=t.$tag$,a=t.$text$;let o;a===null?(P=l==="svg"?!0:l==="foreignObject"?!1:P,l==="slot"&&!H||Re(e,t,P),r!==null&&i!==null?Et(n,r,t,i,s):i!==null?(e.$text$!==null&&(n.textContent=""),Te(n,null,t,i,0,i.length-1)):!s&&O.updatable&&r!==null&&ke(r,0,r.length-1),P&&l==="svg"&&(P=!1)):(o=n["s-cr"])?o.parentNode.textContent=a:e.$text$!==a&&(n.data=a)},L=[],Ce=e=>{let t,s,n;const r=e.__childNodes||e.childNodes;for(const i of r){if(i["s-sr"]&&(t=i["s-cr"])&&t.parentNode){s=t.parentNode.__childNodes||t.parentNode.childNodes;const l=i["s-sn"];for(n=s.length-1;n>=0;n--)if(t=s[n],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==i["s-hn"])if(ye(t,l)){let a=L.find(o=>o.$nodeToRelocate$===t);M=!0,t["s-sn"]=t["s-sn"]||l,a?(a.$nodeToRelocate$["s-sh"]=i["s-hn"],a.$slotRefNode$=i):(t["s-sh"]=i["s-hn"],L.push({$slotRefNode$:i,$nodeToRelocate$:t})),t["s-sr"]&&L.map(o=>{ye(o.$nodeToRelocate$,t["s-sn"])&&(a=L.find(f=>f.$nodeToRelocate$===t),a&&!o.$slotRefNode$&&(o.$slotRefNode$=a.$slotRefNode$))})}else L.some(a=>a.$nodeToRelocate$===t)||L.push({$nodeToRelocate$:t})}i.nodeType===1&&Ce(i)}},x=(e,t,s)=>e==null?void 0:e.insertBefore(t,s),_t=(e,t,s=!1)=>{var n,r,i,l;const a=e.$hostElement$,o=e.$vnode$||J(null,null),f=Pt(t)?t:bt(null,null,t);if(ee=a.tagName,s&&f.$attrs$)for(const $ of Object.keys(f.$attrs$))a.hasAttribute($)&&!["key","ref","style","class"].includes($)&&(f.$attrs$[$]=a[$]);f.$tag$=null,f.$flags$|=4,e.$vnode$=f,f.$elm$=o.$elm$=a,H=ft,V=a["s-cr"],M=!1,A(o,f,s);{if(v.$flags$|=1,te){Ce(f.$elm$);for(const $ of L){const c=$.$nodeToRelocate$;if(!c["s-ol"]){const u=k.createTextNode("");u["s-nr"]=c,x(c.parentNode,c["s-ol"]=u,c)}}for(const $ of L){const c=$.$nodeToRelocate$,u=$.$slotRefNode$;if(u){const d=u.parentNode;let h=u.nextSibling;{let y=(n=c["s-ol"])==null?void 0:n.previousSibling;for(;y;){let p=(r=y["s-nr"])!=null?r:null;if(p&&p["s-sn"]===c["s-sn"]&&d===(p.__parentNode||p.parentNode)){for(p=p.nextSibling;p===c||p!=null&&p["s-sr"];)p=p==null?void 0:p.nextSibling;if(!p||!p["s-nr"]){h=p;break}}y=y.previousSibling}}const g=c.__parentNode||c.parentNode,b=c.__nextSibling||c.nextSibling;(!h&&d!==g||b!==h)&&c!==h&&(!c["s-hn"]&&c["s-ol"]&&(c["s-hn"]=c["s-ol"].parentNode.nodeName),x(d,c,h),c.nodeType===1&&c.tagName!=="SLOT-FB"&&(c.hidden=(i=c["s-ih"])!=null?i:!1)),c&&typeof u["s-rf"]=="function"&&u["s-rf"](c)}else c.nodeType===1&&(s&&(c["s-ih"]=(l=c.hidden)!=null?l:!1),c.hidden=!0)}}M&&ge(f.$elm$),v.$flags$&=-2,L.length=0}V=void 0},Ee=(e,t)=>{if(t&&!e.$onRenderResolve$&&t["s-p"]){const s=t["s-p"].push(new Promise(n=>e.$onRenderResolve$=()=>{t["s-p"].splice(s-1,1),n()}))}},se=(e,t)=>{if(e.$flags$|=16,e.$flags$&4){e.$flags$|=512;return}return Ee(e,e.$ancestorComponent$),dt(()=>Lt(e,t))},Lt=(e,t)=>{const s=e.$hostElement$,n=I("scheduleUpdate",e.$cmpMeta$.$tagName$),r=e.$lazyInstance$;if(!r)throw new Error(`Can't render component <${s.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let i;return n(),xt(i,()=>Ot(e,r,t))},xt=(e,t)=>It(e)?e.then(t).catch(s=>{console.error(s),t()}):t(),It=e=>e instanceof Promise||e&&e.then&&typeof e.then=="function",Ot=async(e,t,s)=>{var n;const r=e.$hostElement$,i=I("update",e.$cmpMeta$.$tagName$),l=r["s-rc"],a=I("render",e.$cmpMeta$.$tagName$);wt(e,t,r,s),l&&(l.map(o=>o()),r["s-rc"]=void 0),a(),i();{const o=(n=r["s-p"])!=null?n:[],f=()=>At(e);o.length===0?f():(Promise.all(o).then(f),e.$flags$|=4,o.length=0)}},wt=(e,t,s,n)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,_t(e,t,n)}catch(r){w(r,e.$hostElement$)}return null},At=e=>{const t=e.$cmpMeta$.$tagName$,s=e.$hostElement$,n=I("postUpdate",t),r=e.$lazyInstance$,i=e.$ancestorComponent$;e.$flags$&64?n():(e.$flags$|=64,Le(s),ne(r,"componentDidLoad",void 0,s),n(),e.$onReadyResolve$(s),i||_e()),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),e.$flags$&512&&K(()=>se(e,!1)),e.$flags$&=-517},_e=e=>{Le(k.documentElement),K(()=>Tt(U,"appload",{detail:{namespace:tt}}))},ne=(e,t,s,n)=>{if(e&&e[t])try{return e[t](s)}catch(r){w(r,n)}},Le=e=>{var t;return e.classList.add((t=O.hydratedSelectorName)!=null?t:"hydrated")},Ft=(e,t)=>T(e).$instanceValues$.get(t),re=(e,t,s,n)=>{const r=T(e);if(!r)throw new Error(`Couldn't find host element for "${n.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,l=r.$instanceValues$.get(t),a=r.$flags$,o=r.$lazyInstance$;s=Z(s,n.$members$[t][0]);const f=Number.isNaN(l)&&Number.isNaN(s),$=s!==l&&!f;if((!(a&8)||l===void 0)&&$&&(r.$instanceValues$.set(t,s),o)){if(n.$watchers$&&a&128){const c=n.$watchers$[t];c&&c.map(u=>{try{o[u](s,l,t)}catch(d){w(d,i)}})}(a&18)===2&&se(r,!1)}},xe=(e,t,s)=>{var n,r;const i=e.prototype;if(t.$members$||t.$watchers$||e.watchers){e.watchers&&!t.$watchers$&&(t.$watchers$=e.watchers);const l=Object.entries((n=t.$members$)!=null?n:{});if(l.map(([a,[o]])=>{if(o&31||s&2&&o&32){const{get:f,set:$}=Object.getOwnPropertyDescriptor(i,a)||{};f&&(t.$members$[a][0]|=2048),$&&(t.$members$[a][0]|=4096),(s&1||!f)&&Object.defineProperty(i,a,{get(){{if(!(t.$members$[a][0]&2048))return Ft(this,a);const c=T(this),u=c?c.$lazyInstance$:i;return u?u[a]:void 0}},configurable:!0,enumerable:!0}),Object.defineProperty(i,a,{set(c){const u=T(this);if($){const d=o&32?this[a]:u.$hostElement$[a];typeof d>"u"&&u.$instanceValues$.get(a)?c=u.$instanceValues$.get(a):!u.$instanceValues$.get(a)&&d&&u.$instanceValues$.set(a,d),$.apply(this,[Z(c,o)]),c=o&32?this[a]:u.$hostElement$[a],re(this,a,c,t);return}{if(!(s&1)||!(t.$members$[a][0]&4096)){re(this,a,c,t),s&1&&!u.$lazyInstance$&&u.$onReadyPromise$.then(()=>{t.$members$[a][0]&4096&&u.$lazyInstance$[a]!==u.$instanceValues$.get(a)&&(u.$lazyInstance$[a]=c)});return}const d=()=>{const h=u.$lazyInstance$[a];!u.$instanceValues$.get(a)&&h&&u.$instanceValues$.set(a,h),u.$lazyInstance$[a]=Z(c,o),re(this,a,u.$lazyInstance$[a],t)};u.$lazyInstance$?d():u.$onReadyPromise$.then(()=>d())}}})}}),s&1){const a=new Map;i.attributeChangedCallback=function(o,f,$){v.jmp(()=>{var c;const u=a.get(o);if(this.hasOwnProperty(u)&&O.lazyLoad)$=this[u],delete this[u];else{if(i.hasOwnProperty(u)&&typeof this[u]=="number"&&this[u]==$)return;if(u==null){const h=T(this),g=h==null?void 0:h.$flags$;if(g&&!(g&8)&&g&128&&$!==f){const b=h.$lazyInstance$,y=(c=t.$watchers$)==null?void 0:c[o];y==null||y.forEach(p=>{b[p]!=null&&b[p].call(b,$,f,o)})}return}}const d=Object.getOwnPropertyDescriptor(i,u);$=$===null&&typeof this[u]=="boolean"?!1:$,$!==this[u]&&(!d.get||d.set)&&(this[u]=$)})},e.observedAttributes=Array.from(new Set([...Object.keys((r=t.$watchers$)!=null?r:{}),...l.filter(([o,f])=>f[0]&15).map(([o,f])=>{const $=f[1]||o;return a.set($,o),$})]))}}return e},jt=async(e,t,s,n)=>{let r;if(!(t.$flags$&32)){t.$flags$|=32;{const a=lt(s,t);if(a&&"then"in a){const f=St();r=await a,f()}else r=a;if(!r)throw new Error(`Constructor for "${s.$tagName$}#${t.$modeName$}" was not found`);r.isProxied||(s.$watchers$=r.watchers,xe(r,s,2),r.isProxied=!0);const o=I("createInstance",s.$tagName$);t.$flags$|=8;try{new r(t)}catch(f){w(f,e)}t.$flags$&=-9,t.$flags$|=128,o(),ae(t.$lazyInstance$,e)}}const i=t.$ancestorComponent$,l=()=>se(t,!0);i&&i["s-rc"]?i["s-rc"].push(l):l()},ae=(e,t)=>{ne(e,"connectedCallback",void 0,t)},Dt=e=>{if(!(v.$flags$&1)){const t=T(e),s=t.$cmpMeta$,n=I("connectedCallback",s.$tagName$);if(t.$flags$&1)t!=null&&t.$lazyInstance$?ae(t.$lazyInstance$,e):t!=null&&t.$onReadyPromise$&&t.$onReadyPromise$.then(()=>ae(t.$lazyInstance$,e));else{t.$flags$|=1,s.$flags$&12&&Nt(e);{let r=e;for(;r=r.parentNode||r.host;)if(r["s-p"]){Ee(t,t.$ancestorComponent$=r);break}}s.$members$&&Object.entries(s.$members$).map(([r,[i]])=>{if(i&31&&e.hasOwnProperty(r)){const l=e[r];delete e[r],e[r]=l}}),jt(e,t,s)}n()}},Nt=e=>{const t=e["s-cr"]=k.createComment("");t["s-cn"]=!0,x(e,t,e.firstChild)},Ie=(e,t)=>{ne(e,"disconnectedCallback",void 0,t||e)},Ut=async e=>{if(!(v.$flags$&1)){const t=T(e);t!=null&&t.$lazyInstance$?Ie(t.$lazyInstance$,e):t!=null&&t.$onReadyPromise$&&t.$onReadyPromise$.then(()=>Ie(t.$lazyInstance$,e))}z.has(e)&&z.delete(e),e.shadowRoot&&z.has(e.shadowRoot)&&z.delete(e.shadowRoot)},zt=(e,t={})=>{var s;const n=I(),r=[],i=t.exclude||[],l=U.customElements,a=k.head,o=a.querySelector("meta[charset]"),f=k.createElement("style"),$=[];let c,u=!0;Object.assign(v,t),v.$resourcesUrl$=new URL(t.resourcesUrl||"./",k.baseURI).href;let d=!1;if(e.map(h=>{h[1].map(g=>{var b;const y={$flags$:g[0],$tagName$:g[1],$members$:g[2],$listeners$:g[3]};y.$flags$&4&&(d=!0),y.$members$=g[2],y.$watchers$=(b=g[4])!=null?b:{};const p=y.$tagName$,N=class extends HTMLElement{constructor(R){super(R),this.hasRegisteredEventListeners=!1,R=this,ot(R,y)}connectedCallback(){T(this),this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),c&&(clearTimeout(c),c=null),u?$.push(this):v.jmp(()=>Dt(this))}disconnectedCallback(){v.jmp(()=>Ut(this)),v.raf(()=>{var R;const C=T(this);((R=C==null?void 0:C.$vnode$)==null?void 0:R.$elm$)instanceof Node&&!C.$vnode$.$elm$.isConnected&&delete C.$vnode$.$elm$})}componentOnReady(){return T(this).$onReadyPromise$}};y.$lazyBundleId$=h[0],!i.includes(p)&&!l.get(p)&&(r.push(p),l.define(p,xe(N,y,1)))})}),r.length>0&&(d&&(f.textContent+=ct),f.textContent+=r.sort()+it,f.innerHTML.length)){f.setAttribute("data-styles","");const h=(s=v.$nonce$)!=null?s:ht(k);h!=null&&f.setAttribute("nonce",h),a.insertBefore(f,o?o.nextSibling:a.firstChild)}u=!1,$.length?$.map(h=>h.connectedCallback()):v.jmp(()=>c=setTimeout(_e,30)),n()};const Ht=()=>{},Mt=async(e,t)=>{if(!(typeof window>"u"))return await Ht(),zt([["searchcraft-base-search-results",[[4,"searchcraft-base-search-results",{customStylesForResults:[1,"custom-styles-for-results"],searchResultMappings:[16],resultImagePlacement:[1,"result-image-placement"],buttonLabel:[1,"button-label"],buttonTarget:[1,"button-target"],buttonRel:[1,"button-rel"],containerTarget:[1,"container-target"],containerRel:[1,"container-rel"],searchTerm:[32],searchClientResponseItems:[32],adClientResponseItems:[32],searchResultsPerPage:[32],searchResultsPage:[32]}]]],["searchcraft-filter-panel",[[0,"searchcraft-filter-panel",{items:[16],unsubscribe:[32],lastSearchTerm:[32]}]]],["searchcraft-pagination",[[0,"searchcraft-pagination",{customStyles:[1,"custom-styles"],searchTerm:[32],searchResultsPerPage:[32],searchResultsPage:[32],searchResultsCount:[32],searchResultsPagesCount:[32],searchResultsRangeMin:[32],searchResultsRangeMax:[32],setSearchResultsPage:[32]}]]],["searchcraft-search-results-per-page",[[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]}]]],["searchcraft-popover-button",[[4,"searchcraft-popover-button"]]],["searchcraft-results-info",[[0,"searchcraft-results-info",{customFormatter:[16],customStyles:[1,"custom-styles"],searchTerm:[32],searchResultsPage:[32],searchResultsPerPage:[32],searchResultsCount:[32],count:[32],range:[32],responseTime:[32]}]]],["searchcraft-theme",[[0,"searchcraft-theme",{theme:[1],customTheme:[1,"custom-theme"]}]]],["searchcraft-input-form_2",[[0,"searchcraft-input-form",{config:[16],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"],inputValue:[32],error:[32],isSearchcraftInitialized:[32]},null,{config:["onConfigChange"]}],[0,"searchcraft-popover-list-view",{popoverResultMappings:[16],searchClientResponseItems:[16],adClientResponseItems:[16],searchResultsPage:[2,"search-results-page"],searchResultsPerPage:[2,"search-results-per-page"]}]]],["searchcraft-popover-form",[[0,"searchcraft-popover-form",{config:[16],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]}]]],["searchcraft-select",[[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]}]]],["searchcraft-base-search-result_2",[[0,"searchcraft-base-search-result",{item:[16],searchResultMappings:[16],containerTarget:[1,"container-target"],containerRel:[1,"container-rel"],buttonTarget:[1,"button-target"],buttonRel:[1,"button-rel"],imagePlacement:[1,"image-placement"],customStyles:[1,"custom-styles"],documentPosition:[2,"document-position"],titleContent:[32],subtitleContent:[32],bodyContent:[32],footerContent:[32],buttonLabel:[32],buttonHref:[32],containerHref:[32],imageSrc:[32],imageAlt:[32]}],[0,"searchcraft-base-search-result-ad",{adClientResponseItem:[16]}]]],["searchcraft-facet-list_3",[[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]}],[0,"searchcraft-slider",{max:[2],min:[2],granularity:[2],dataType:[1,"data-type"],endValue:[32],startValue:[32],lastFocusedHandle:[32]}],[0,"searchcraft-toggle-button",{label:[1],subLabel:[1,"sub-label"],isActive:[32],unsubscribe:[32],lastSearchTerm:[32]}]]],["searchcraft-popover-list-item_2",[[0,"searchcraft-popover-list-item",{item:[16],popoverResultMappings:[16],documentPosition:[2,"document-position"],href:[32],imageSrc:[32],imageAlt:[32],titleContent:[32],subtitleContent:[32]}],[0,"searchcraft-popover-list-item-ad",{adClientResponseItem:[16]}]]],["searchcraft-button_3",[[0,"searchcraft-input-label",{inputLabelClassName:[1,"input-label-class-name"],label:[1]}],[0,"searchcraft-button",{hierarchy:[1],disabled:[4],icon:[16],iconOnly:[4,"icon-only"],iconPosition:[1,"icon-position"],label:[1],type:[1]}],[0,"searchcraft-error-message",{errorMessage:[1,"error-message"]}]]]],t)};(function(){if(typeof window<"u"&&window.Reflect!==void 0&&window.customElements!==void 0){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}})();const Bt={async install(){Mt()}};m.ComponentLibrary=Bt,m.SearchcraftBaseSearchResults=Ge,m.SearchcraftFilterPanel=Xe,m.SearchcraftInputForm=Ke,m.SearchcraftPagination=Ve,m.SearchcraftPopoverButton=Ye,m.SearchcraftPopoverForm=Qe,m.SearchcraftResultsInfo=Je,m.SearchcraftSearchResultsPerPage=et,m.SearchcraftTheme=Ze,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(m,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],S):(m=typeof globalThis<"u"?globalThis:m||self,S(m.SearchcraftVueSdk={},m.Vue))})(this,function(m,S){"use strict";var te=Object.defineProperty,ne=(t,n,r)=>n in t?te(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,f=(t,n,r)=>ne(t,typeof n!="symbol"?n+"":n,r);function b(t,n,r,a){return new(r||(r=Promise))(function(o,i){function e(c){try{d(a.next(c))}catch(s){i(s)}}function u(c){try{d(a.throw(c))}catch(s){i(s)}}function d(c){var s;c.done?o(c.value):(s=c.value,s instanceof r?s:new r(function(h){h(s)})).then(e,u)}d((a=a.apply(t,[])).next())})}function P(t,n){var r,a,o,i,e={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(d){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(e=0)),e;)try{if(r=1,a&&(o=2&s[0]?a.return:s[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;switch(a=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return e.label++,{value:s[1],done:!1};case 5:e.label++,a=s[1],s=[0];continue;case 7:s=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!((o=o.length>0&&o[o.length-1])||s[0]!==6&&s[0]!==2)){e=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){e.label=s[1];break}if(s[0]===6&&e.label<o[1]){e.label=o[1],o=s;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(s);break}o[2]&&e.ops.pop(),e.trys.pop();continue}s=n.call(t,e)}catch(h){s=[6,h],a=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([d,c])}}}var E={exclude:[]},q={},re={timeout:"true"},w=function(t,n){typeof window<"u"&&(q[t]=n)},ae=function(){return Object.fromEntries(Object.entries(q).filter(function(t){var n,r=t[0];return!(!((n=E==null?void 0:E.exclude)===null||n===void 0)&&n.includes(r))}).map(function(t){return[t[0],(0,t[1])()]}))};function _(t){return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),(t^=t>>>16)>>>0}var p=new Uint32Array([597399067,2869860233,951274213,2716044179]);function y(t,n){return t<<n|t>>>32-n}function O(t,n){var r;if(n===void 0&&(n=0),n=n?0|n:0,typeof t=="string"&&(r=t,t=new TextEncoder().encode(r).buffer),!(t instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");var a=new Uint32Array([n,n,n,n]);(function(i,e){for(var u=i.byteLength/16|0,d=new Uint32Array(i,0,4*u),c=0;c<u;c++){var s=d.subarray(4*c,4*(c+1));s[0]=Math.imul(s[0],p[0]),s[0]=y(s[0],15),s[0]=Math.imul(s[0],p[1]),e[0]=e[0]^s[0],e[0]=y(e[0],19),e[0]=e[0]+e[1],e[0]=Math.imul(e[0],5)+1444728091,s[1]=Math.imul(s[1],p[1]),s[1]=y(s[1],16),s[1]=Math.imul(s[1],p[2]),e[1]=e[1]^s[1],e[1]=y(e[1],17),e[1]=e[1]+e[2],e[1]=Math.imul(e[1],5)+197830471,s[2]=Math.imul(s[2],p[2]),s[2]=y(s[2],17),s[2]=Math.imul(s[2],p[3]),e[2]=e[2]^s[2],e[2]=y(e[2],15),e[2]=e[2]+e[3],e[2]=Math.imul(e[2],5)+2530024501,s[3]=Math.imul(s[3],p[3]),s[3]=y(s[3],18),s[3]=Math.imul(s[3],p[0]),e[3]=e[3]^s[3],e[3]=y(e[3],13),e[3]=e[3]+e[0],e[3]=Math.imul(e[3],5)+850148119}})(t,a),function(i,e){var u=i.byteLength/16|0,d=i.byteLength%16,c=new Uint32Array(4),s=new Uint8Array(i,16*u,d);switch(d){case 15:c[3]=c[3]^s[14]<<16;case 14:c[3]=c[3]^s[13]<<8;case 13:c[3]=c[3]^s[12]<<0,c[3]=Math.imul(c[3],p[3]),c[3]=y(c[3],18),c[3]=Math.imul(c[3],p[0]),e[3]=e[3]^c[3];case 12:c[2]=c[2]^s[11]<<24;case 11:c[2]=c[2]^s[10]<<16;case 10:c[2]=c[2]^s[9]<<8;case 9:c[2]=c[2]^s[8]<<0,c[2]=Math.imul(c[2],p[2]),c[2]=y(c[2],17),c[2]=Math.imul(c[2],p[3]),e[2]=e[2]^c[2];case 8:c[1]=c[1]^s[7]<<24;case 7:c[1]=c[1]^s[6]<<16;case 6:c[1]=c[1]^s[5]<<8;case 5:c[1]=c[1]^s[4]<<0,c[1]=Math.imul(c[1],p[1]),c[1]=y(c[1],16),c[1]=Math.imul(c[1],p[2]),e[1]=e[1]^c[1];case 4:c[0]=c[0]^s[3]<<24;case 3:c[0]=c[0]^s[2]<<16;case 2:c[0]=c[0]^s[1]<<8;case 1:c[0]=c[0]^s[0]<<0,c[0]=Math.imul(c[0],p[0]),c[0]=y(c[0],15),c[0]=Math.imul(c[0],p[1]),e[0]=e[0]^c[0]}}(t,a),function(i,e){e[0]=e[0]^i.byteLength,e[1]=e[1]^i.byteLength,e[2]=e[2]^i.byteLength,e[3]=e[3]^i.byteLength,e[0]=e[0]+e[1]|0,e[0]=e[0]+e[2]|0,e[0]=e[0]+e[3]|0,e[1]=e[1]+e[0]|0,e[2]=e[2]+e[0]|0,e[3]=e[3]+e[0]|0,e[0]=_(e[0]),e[1]=_(e[1]),e[2]=_(e[2]),e[3]=_(e[3]),e[0]=e[0]+e[1]|0,e[0]=e[0]+e[2]|0,e[0]=e[0]+e[3]|0,e[1]=e[1]+e[0]|0,e[2]=e[2]+e[0]|0,e[3]=e[3]+e[0]|0}(t,a);var o=new Uint8Array(a.buffer);return Array.from(o).map(function(i){return i.toString(16).padStart(2,"0")}).join("")}function oe(t,n){return new Promise(function(r){setTimeout(function(){return r(n)},t)})}function ie(t,n,r){return Promise.all(t.map(function(a){return Promise.race([a,oe(n,r)])}))}function se(){return b(this,void 0,void 0,function(){var t,n,r,a,o;return P(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=ae(),n=Object.keys(t),[4,ie(Object.values(t),(E==null?void 0:E.timeout)||1e3,re)];case 1:return r=i.sent(),a=r.filter(function(e){return e!==void 0}),o={},a.forEach(function(e,u){o[n[u]]=e}),[2,V(o,E.exclude||[])];case 2:throw i.sent();case 3:return[2]}})})}function V(t,n){var r={},a=function(i){if(t.hasOwnProperty(i)){var e=t[i];if(typeof e!="object"||Array.isArray(e))n.includes(i)||(r[i]=e);else{var u=V(e,n.map(function(d){return d.startsWith(i+".")?d.slice(i.length+1):d}));Object.keys(u).length>0&&(r[i]=u)}}};for(var o in t)a(o);return r}function ce(t){return b(this,void 0,void 0,function(){var n,r;return P(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,se()];case 1:return n=a.sent(),r=O(JSON.stringify(n)),[2,r.toString()];case 2:throw a.sent();case 3:return[2]}})})}function ue(t){for(var n=0,r=0;r<t.length;++r)n+=Math.abs(t[r]);return n}function G(t,n,r){for(var a=[],o=0;o<t[0].data.length;o++){for(var i=[],e=0;e<t.length;e++)i.push(t[e].data[o]);a.push(de(i))}var u=new Uint8ClampedArray(a);return new ImageData(u,n,r)}function de(t){if(t.length===0)return 0;for(var n={},r=0,a=t;r<a.length;r++)n[i=a[r]]=(n[i]||0)+1;var o=t[0];for(var i in n)n[i]>n[o]&&(o=parseInt(i,10));return o}function T(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};for(var t=navigator.userAgent,n={Edg:"Edge",OPR:"Opera"},r=0,a=[/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/];r<a.length;r++){var o=a[r],i=t.match(o);if(i&&i.groups)return{name:n[i.groups.name]||i.groups.name,version:i.groups.version}}return{name:"unknown",version:"unknown"}}w("audio",function(){return b(this,void 0,void 0,function(){return P(this,function(t){return[2,new Promise(function(n,r){try{var a=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),o=a.createBufferSource(),i=a.createOscillator();i.frequency.value=1e3;var e,u=a.createDynamicsCompressor();u.threshold.value=-50,u.knee.value=40,u.ratio.value=12,u.attack.value=0,u.release.value=.2,i.connect(u),u.connect(a.destination),i.start(),a.oncomplete=function(d){e=d.renderedBuffer.getChannelData(0),n({sampleHash:ue(e),oscillator:i.type,maxChannels:a.destination.maxChannelCount,channelCountMode:o.channelCountMode})},a.startRendering()}catch(d){console.error("Error creating audio fingerprint:",d),r(d)}})]})})});var le=T().name!=="SamsungBrowser"?1:3,$=280,W=20;T().name!="Firefox"&&w("canvas",function(){return document.createElement("canvas").getContext("2d"),new Promise(function(t){var n=Array.from({length:le},function(){return function(){var r=document.createElement("canvas"),a=r.getContext("2d");if(!a)return new ImageData(1,1);r.width=$,r.height=W;var o=a.createLinearGradient(0,0,r.width,r.height);o.addColorStop(0,"red"),o.addColorStop(.16666666666666666,"orange"),o.addColorStop(.3333333333333333,"yellow"),o.addColorStop(.5,"green"),o.addColorStop(.6666666666666666,"blue"),o.addColorStop(.8333333333333334,"indigo"),o.addColorStop(1,"violet"),a.fillStyle=o,a.fillRect(0,0,r.width,r.height);var i="Random Text WMwmil10Oo";a.font="23.123px Arial",a.fillStyle="black",a.fillText(i,-5,15),a.fillStyle="rgba(0, 0, 255, 0.5)",a.fillText(i,-3.3,17.7),a.beginPath(),a.moveTo(0,0),a.lineTo(2*r.width/7,r.height),a.strokeStyle="white",a.lineWidth=2,a.stroke();var e=a.getImageData(0,0,r.width,r.height);return e}()});t({commonImageDataHash:O(G(n,$,W).data.toString()).toString()})})});var U,he=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],fe=["monospace","sans-serif","serif"];function H(t,n){if(!t)throw new Error("Canvas context not supported");return t.font,t.font="72px ".concat(n),t.measureText("WwMmLli0Oo").width}function me(){var t,n=document.createElement("canvas"),r=(t=n.getContext("webgl"))!==null&&t!==void 0?t:n.getContext("experimental-webgl");if(r&&"getParameter"in r)try{var a=(r.getParameter(r.VENDOR)||"").toString(),o=(r.getParameter(r.RENDERER)||"").toString(),i={vendor:a,renderer:o,version:(r.getParameter(r.VERSION)||"").toString(),shadingLanguageVersion:(r.getParameter(r.SHADING_LANGUAGE_VERSION)||"").toString()};if(!o.length||!a.length){var e=r.getExtension("WEBGL_debug_renderer_info");if(e){var u=(r.getParameter(e.UNMASKED_VENDOR_WEBGL)||"").toString(),d=(r.getParameter(e.UNMASKED_RENDERER_WEBGL)||"").toString();u&&(i.vendorUnmasked=u),d&&(i.rendererUnmasked=d)}}return i}catch{}return"undefined"}function pe(){var t=new Float32Array(1),n=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],n[3]}function ge(t,n){var r={};return n.forEach(function(a){var o=function(i){if(i.length===0)return null;var e={};i.forEach(function(c){var s=String(c);e[s]=(e[s]||0)+1});var u=i[0],d=1;return Object.keys(e).forEach(function(c){e[c]>d&&(u=c,d=e[c])}),u}(t.map(function(i){return a in i?i[a]:void 0}).filter(function(i){return i!==void 0}));o&&(r[a]=o)}),r}function ve(){var t=[],n={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(n).forEach(function(r){n[r].forEach(function(a){matchMedia("(".concat(r,": ").concat(a,")")).matches&&t.push("".concat(r,": ").concat(a))})}),t}function ye(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{for(var t=window.ApplePaySession.supportsVersion,n=15;n>0;n--)if(t(n))return n}catch{return 0}return 0}T().name!="Firefox"&&w("fonts",function(){var t=this;return new Promise(function(n,r){try{(function(a){var o;b(this,void 0,void 0,function(){var i,e,u;return P(this,function(d){switch(d.label){case 0:return document.body?[3,2]:[4,(c=50,new Promise(function(h){return setTimeout(h,c,s)}))];case 1:return d.sent(),[3,0];case 2:if((i=document.createElement("iframe")).setAttribute("frameBorder","0"),(e=i.style).setProperty("position","fixed"),e.setProperty("display","block","important"),e.setProperty("visibility","visible"),e.setProperty("border","0"),e.setProperty("opacity","0"),i.src="about:blank",document.body.appendChild(i),!(u=i.contentDocument||((o=i.contentWindow)===null||o===void 0?void 0:o.document)))throw new Error("Iframe document is not accessible");return a({iframe:u}),setTimeout(function(){document.body.removeChild(i)},0),[2]}var c,s})})})(function(a){var o=a.iframe;return b(t,void 0,void 0,function(){var i,e,u,d;return P(this,function(c){return i=o.createElement("canvas"),e=i.getContext("2d"),u=fe.map(function(s){return H(e,s)}),d={},he.forEach(function(s){var h=H(e,s);u.includes(h)||(d[s]=h)}),n(d),[2]})})})}catch{r({error:"unsupported"})}})}),w("hardware",function(){return new Promise(function(t,n){var r=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,a=window.performance&&window.performance.memory?window.performance.memory:0;t({videocard:me(),architecture:pe(),deviceMemory:r.toString()||"undefined",jsHeapSizeLimit:a.jsHeapSizeLimit||0})})}),w("locales",function(){return new Promise(function(t){t({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}),w("permissions",function(){return b(this,void 0,void 0,function(){var t;return P(this,function(n){return U=(E==null?void 0:E.permissions_to_check)||["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],t=Array.from({length:(E==null?void 0:E.retries)||3},function(){return function(){return b(this,void 0,void 0,function(){var r,a,o,i,e;return P(this,function(u){switch(u.label){case 0:r={},a=0,o=U,u.label=1;case 1:if(!(a<o.length))return[3,6];i=o[a],u.label=2;case 2:return u.trys.push([2,4,,5]),[4,navigator.permissions.query({name:i})];case 3:return e=u.sent(),r[i]=e.state.toString(),[3,5];case 4:return u.sent(),[3,5];case 5:return a++,[3,1];case 6:return[2,r]}})})}()}),[2,Promise.all(t).then(function(r){return ge(r,U)})]})})}),w("plugins",function(){var t=[];if(navigator.plugins)for(var n=0;n<navigator.plugins.length;n++){var r=navigator.plugins[n];t.push([r.name,r.filename,r.description].join("|"))}return new Promise(function(a){a({plugins:t})})}),w("screen",function(){return new Promise(function(t){t({is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:ve()})})}),w("system",function(){return new Promise(function(t){var n=T();t({platform:window.navigator.platform,cookieEnabled:window.navigator.cookieEnabled,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:n.name,version:n.version},applePayVersion:ye()})})});var v,we=T().name!=="SamsungBrowser"?1:3,l=null;w("webgl",function(){return b(this,void 0,void 0,function(){var t;return P(this,function(n){typeof document<"u"&&((v=document.createElement("canvas")).width=200,v.height=100,l=v.getContext("webgl"));try{if(!l)throw new Error("WebGL not supported");return t=Array.from({length:we},function(){return function(){try{if(!l)throw new Error("WebGL not supported");var r=`
|
|
2
|
+
attribute vec2 position;
|
|
3
|
+
void main() {
|
|
4
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
5
|
+
}
|
|
6
|
+
`,a=`
|
|
7
|
+
precision mediump float;
|
|
8
|
+
void main() {
|
|
9
|
+
gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
|
|
10
|
+
}
|
|
11
|
+
`,o=l.createShader(l.VERTEX_SHADER),i=l.createShader(l.FRAGMENT_SHADER);if(!o||!i)throw new Error("Failed to create shaders");if(l.shaderSource(o,r),l.shaderSource(i,a),l.compileShader(o),!l.getShaderParameter(o,l.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+l.getShaderInfoLog(o));if(l.compileShader(i),!l.getShaderParameter(i,l.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+l.getShaderInfoLog(i));var e=l.createProgram();if(!e)throw new Error("Failed to create shader program");if(l.attachShader(e,o),l.attachShader(e,i),l.linkProgram(e),!l.getProgramParameter(e,l.LINK_STATUS))throw new Error("Shader program linking failed: "+l.getProgramInfoLog(e));l.useProgram(e);for(var u=137,d=new Float32Array(4*u),c=2*Math.PI/u,s=0;s<u;s++){var h=s*c;d[4*s]=0,d[4*s+1]=0,d[4*s+2]=Math.cos(h)*(v.width/2),d[4*s+3]=Math.sin(h)*(v.height/2)}var L=l.createBuffer();l.bindBuffer(l.ARRAY_BUFFER,L),l.bufferData(l.ARRAY_BUFFER,d,l.STATIC_DRAW);var C=l.getAttribLocation(e,"position");l.enableVertexAttribArray(C),l.vertexAttribPointer(C,2,l.FLOAT,!1,0,0),l.viewport(0,0,v.width,v.height),l.clearColor(0,0,0,1),l.clear(l.COLOR_BUFFER_BIT),l.drawArrays(l.LINES,0,2*u);var N=new Uint8ClampedArray(v.width*v.height*4);return l.readPixels(0,0,v.width,v.height,l.RGBA,l.UNSIGNED_BYTE,N),new ImageData(N,v.width,v.height)}catch{return new ImageData(1,1)}finally{l&&(l.bindBuffer(l.ARRAY_BUFFER,null),l.useProgram(null),l.viewport(0,0,l.drawingBufferWidth,l.drawingBufferHeight),l.clearColor(0,0,0,0))}}()}),[2,{commonImageHash:O(G(t,v.width,v.height).data.toString()).toString()}]}catch{return[2,{webgl:"unsupported"}]}return[2]})})});var R=function(t,n,r,a){for(var o=(r-n)/a,i=0,e=0;e<a;e++)i+=t(n+(e+.5)*o);return i*o};w("math",function(){return b(void 0,void 0,void 0,function(){return P(this,function(t){return[2,{acos:Math.acos(.5),asin:R(Math.asin,-1,1,97),atan:R(Math.atan,-1,1,97),cos:R(Math.cos,0,Math.PI,97),cosh:Math.cosh(9/7),e:Math.E,largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),log:Math.log(1e3),pi:Math.PI,sin:R(Math.sin,-Math.PI,Math.PI,97),sinh:R(Math.sinh,-9/7,7/9,97),sqrt:Math.sqrt(2),tan:R(Math.tan,0,2*Math.PI,97),tanh:R(Math.tanh,-9/7,7/9,97)}]})})});const Se="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let F=(t=21)=>{let n="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)n+=Se[r[t]&63];return n};class D{constructor(n){f(this,"config"),this.config=n}async getAdsForSearchParams(n){return[]}}class be extends D{async getAdsForSearchParams(n){if(!this.config.admSub)return console.error("No admSub specified in config."),[];const r=`https://demofeed.is.ampfeed.com/is?${new URLSearchParams({partner:"demofeed",sub1:this.config.admSub,qt:n.searchTerm,v:"2.0",rfr:"searchcraft.io","results-ta":`${this.config.admTextAdQuantity||0}`,"results-pa":`${this.config.admProductAdQuantity||0}`}).toString()}`,a=await(await fetch(r,{method:"GET"})).json(),o=a.product_ads.map(e=>({id:F(),adSource:"adMarketplace",admAdType:"adm-product-ad",admAd:e})),i=a.text_ads.map(e=>({id:F(),adSource:"adMarketplace",admAdType:"adm-text-ad",admAd:e}));return o.concat(i)}}class Pe extends D{async getAdsForSearchParams(n){return[]}}class Ee extends D{async getAdsForSearchParams(n){return[]}}const Me=500;class Re{constructor(n,r,a){f(this,"measureRequestTimeout"),f(this,"measureRequestsBatched",[]),f(this,"config"),f(this,"sdkInfo"),f(this,"userId"),f(this,"sessionId"),f(this,"sendMeasureEvent",(o,i={},e={})=>{const u={event_name:o,properties:{searchcraft_index_names:this.config.index,session_id:this.sessionId,...i},user:{...this.measureRequestUser,...e}};this.measureRequestsBatched.push(u),clearTimeout(this.measureRequestTimeout),this.measureRequestTimeout=setTimeout(async()=>{const d=JSON.stringify({items:this.measureRequestsBatched}),c=`${this.baseMeasureUrl}/batch`;try{const s=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json",Authorization:this.config.readKey,"X-Sc-User-Id":this.userId},body:d,keepalive:!0});if(!s.ok)throw new Error(`Failed to send request: ${s.status} ${s.statusText}`);this.measureRequestsBatched=[];return}catch(s){throw console.error("Error sending MeasureRequest:",s),s}},Me)}),this.config=n,this.sdkInfo=r,this.userId=a,this.sessionId=F(),this.sendMeasureEvent("sdk_initialized")}get baseMeasureUrl(){return`${this.config.endpointURL}/measure`}get measureRequestUser(){return{user_id:this.userId,locale:navigator.language||"en-US",os:navigator.userAgent.includes("Windows")?"Windows":navigator.userAgent.includes("Mac")?"Mac":navigator.userAgent.includes("Linux")?"Linux":"Unknown",platform:navigator.platform||"Unknown",sdk_name:this.sdkInfo.sdkName,sdk_version:this.sdkInfo.sdkVersion,user_agent:navigator.userAgent||"Unknown"}}}function Ae(t){const n=[];let r="should";return t.facetPathsForIndexFields&&Object.keys(t.facetPathsForIndexFields).forEach(a=>{var o;const i=(o=t.facetPathsForIndexFields)==null?void 0:o[a];i&&(r="must",n.push({occur:r,exact:{ctx:i.value}}))}),t.rangeValueForIndexFields&&Object.keys(t.rangeValueForIndexFields).forEach(a=>{var o;const i=(o=t.rangeValueForIndexFields)==null?void 0:o[a];i&&(r="must",n.push({occur:r,exact:{ctx:i.value}}))}),t.sort==="desc"?t.order_by="date_published":t.order_by="",n.push({occur:r,[t.mode]:{ctx:t.searchTerm}}),n}const Ce=t=>t.endsWith("/")?t.slice(0,-1):t,Te=t=>{let n="";if(n=t.trim(),n=n.replace(/[‘’“”]/g,r=>({"‘":"'","’":"'","“":'"',"”":'"'})[r]||r),(n.match(/"/g)||[]).length%2!==0)throw new Error("The search term contains an uneven number of quote characters.");return n};class ke{constructor(n,r,a){f(this,"config"),f(this,"userId"),f(this,"parent"),f(this,"getSearchResponse",async o=>{var i,e;const u=Te(o.searchTerm);(i=this.parent.measureClient)==null||i.sendMeasureEvent("search_requested",{search_term:u}),this.parent.emitEvent("query_submitted",{name:"query_submitted",data:{searchTerm:u}});try{const d={query:Ae(o),offset:o.offset||0,limit:o.limit||this.config.searchResultsPerPage||20};o.order_by&&(d.order_by=o.order_by,d.sort=o.sort==="desc"||o.sort==="asc"?o.sort:"asc");const c={method:"POST",headers:{Authorization:this.config.readKey,"Content-Type":"application/json","X-Sc-User-Id":this.userId},body:JSON.stringify(d)},s=await fetch(this.baseSearchUrl,c);if(!s.ok)throw new Error(`Error: ${s.statusText} (Status: ${s.status})`);const h=await s.json();return(e=this.parent.measureClient)==null||e.sendMeasureEvent("search_response_received",{search_term:u,number_of_documents:h.data.count}),h}catch(d){throw console.error("Error parsing response:",d),d}}),this.parent=n,this.config=r,this.userId=a}get baseSearchUrl(){return`${this.config.endpointURL}/index/${this.config.index.join(",")}/search`}}class Ie{constructor(n,r){if(f(this,"config"),f(this,"measureClient"),f(this,"searchClient"),f(this,"adClient"),f(this,"userId"),f(this,"requestTimeout"),f(this,"subscriptionEvents",{}),f(this,"getItems",(a,o,i)=>{const e=async()=>{(async()=>{var u,d;const c=await((u=this==null?void 0:this.searchClient)==null?void 0:u.getSearchResponse(a));if(!c)throw new Error("Search client was not initialized.");const s=(d=c.data.hits||[])==null?void 0:d.map(h=>h.doc).filter(h=>!!h).map(h=>({type:"SearchDocument",id:F(),document:h}));s.length===0&&this.emitEvent("no_results_returned",{name:"no_results_returned"}),o(c,s)})(),(async()=>{if(this.adClient){const u=await this.adClient.getAdsForSearchParams(a);i(u)}})()};clearTimeout(this.requestTimeout),this.config.searchDebounceDelay?this.requestTimeout=setTimeout(e,this.config.searchDebounceDelay):e()}),!n.endpointURL||!n.index||!n.readKey)throw new Error("Endpoint URL, Index value(s), and Read Key must be provided");this.config={...n,endpointURL:Ce(n.endpointURL)},this.userId="",this.initClients(this.config,r),this.initInputForms(),this.startObservingMutations()}initInputForms(){const n=document.querySelectorAll("searchcraft-input-form");setTimeout(()=>{n.forEach(r=>{r.core=this})},40)}startObservingMutations(){new MutationObserver((n,r)=>{let a=!1;for(const o of n)o.type==="childList"&&o.addedNodes.forEach(i=>{i.nodeType===1&&i.className.toLowerCase()==="searchcraft-input-form"&&(a=!0)});a&&this.initInputForms()}).observe(document.body,{childList:!0,subtree:!0})}initClients(n,r){setTimeout(async()=>{let a=this.config.userId;switch(a||(a=await ce()),this.measureClient=new Re(n,r,a),this.searchClient=new ke(this,n,a),n.adSource){case"adMarketplace":this.adClient=new be(n);break;case"Nativo":this.adClient=new Ee(n);break;case"Custom":this.adClient=new Pe(n);break}},300)}emitEvent(n,r){var a;(a=this.subscriptionEvents[n])==null||a.forEach(o=>{o(r)})}subscribe(n,r){return this.subscriptionEvents[n]||(this.subscriptionEvents[n]=[]),this.subscriptionEvents[n].push(r),()=>{this.subscriptionEvents[n]=this.subscriptionEvents[n].filter(a=>a!==r)}}}const K={name:"@searchcraft/vue-sdk",version:"0.9.0",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:{"@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"}},B="routerLink",z="navManager",xe="router",_e="aria",k=Symbol(),Y={default:k},J=t=>(t==null?void 0:t.split(" "))||[],Fe=(t,n,r=[])=>{var a;return[...Array.from(((a=t.value)==null?void 0:a.classList)||[]),...r].filter((o,i,e)=>!n.has(o)&&e.indexOf(o)===i)},M=(t,n,r=[],a=[],o,i)=>{const e=S.defineComponent((u,{attrs:d,slots:c,emit:s})=>{var Q;const h=S.ref(),L=new Set(J(d.class)),C=S.getCurrentInstance(),X=((Q=C==null?void 0:C.appContext)==null?void 0:Q.provides[z])?S.inject(z):void 0,Ze=I=>{const{routerLink:j}=u;if(j!==k)if(X!==void 0){I.preventDefault();let A={event:I};for(const x in u){const g=u[x];u.hasOwnProperty(x)&&x.startsWith(xe)&&g!==k&&(A[x]=g)}X.navigate(A)}else console.warn("Tried to navigate, but no router was found. Make sure you have mounted Vue Router.")};return()=>{u[o],J(d.class).forEach(g=>{L.add(g)});const I=u.onClick,j=g=>{I!==void 0&&I(g),g.defaultPrevented||Ze(g)};let A={ref:h,class:Fe(h,L),onClick:j};for(const g in u){const Z=u[g];(u.hasOwnProperty(g)&&Z!==k||g.startsWith(_e))&&(A[g]=Z);const ee="on"+g.slice(0,1).toUpperCase()+g.slice(1),et=d[ee];h.value&&d.hasOwnProperty(ee)&&"addEventListener"in h.value&&h.value.addEventListener(g,et)}return B in u&&u[B]!==k&&(A={...A,href:u[B]}),S.h(t,A,c.default&&c.default())}});if(typeof e!="function"){let u=[],d={};d.ROUTER_LINK_VALUE=Y,r.forEach(c=>d[c]=Y),u=a,e.name=t,e.emits=u,e.props=d}return e},Le=M("searchcraft-base-search-results",void 0,["customStylesForResults","searchResultMappings","resultImagePlacement","buttonLabel","buttonTarget","buttonRel","containerTarget","containerRel"]),Oe=M("searchcraft-filter-panel",void 0,["items"]),Ue=M("searchcraft-input-form",void 0,["autoSearch","buttonPlacement","buttonLabel","inputLabel","customStyles","placeholderValue","searchTerm","core","inputFocus","inputBlur","inputInit"],["inputFocus","inputBlur","inputInit"]),De=M("searchcraft-pagination",void 0,["customStyles"]),Be=M("searchcraft-popover-button"),Ne=M("searchcraft-popover-form",void 0,["type","popoverResultMappings","hotkey","hotkeyModifier"]),je=M("searchcraft-results-info",void 0,["customFormatter","customStyles"]),qe=M("searchcraft-search-results-per-page",void 0,["increment","customStyles"]),Ve=M("searchcraft-theme",void 0,["theme","customTheme"]),Ge=Le,$e=Oe,We=Ue,He=Be,Ke=Ne,ze=je,Ye=Ve,Je=De,Xe=qe;class Qe extends Ie{constructor(n){super(n,{sdkName:K.name,sdkVersion:K.version})}}m.Searchcraft=Qe,m.SearchcraftBaseSearchResults=Ge,m.SearchcraftFilterPanel=$e,m.SearchcraftInputForm=We,m.SearchcraftPagination=Je,m.SearchcraftPopoverButton=He,m.SearchcraftPopoverForm=Ke,m.SearchcraftResultsInfo=ze,m.SearchcraftSearchResultsPerPage=Xe,m.SearchcraftTheme=Ye,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
2
12
|
//# sourceMappingURL=index.umd.js.map
|