@askdialog/dialog-vue 3.6.0 → 3.7.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.
Files changed (25) hide show
  1. package/README.md +21 -4
  2. package/dist/components/DialogSearch/DialogSearchCollections.vue.d.ts +9 -0
  3. package/dist/components/DialogSearch/DialogSearchPagination.vue.d.ts +1 -0
  4. package/dist/components/DialogSearch/DialogSearchProductCard.vue.d.ts +6 -1
  5. package/dist/components/DialogSearch/DialogSearchProducts.vue.d.ts +10 -0
  6. package/dist/components/DialogSearch/DialogSearchResults.vue.d.ts +14 -2
  7. package/dist/components/DialogSearch/{DialogSearchProductCardContent.vue.d.ts → HighlightedTitle.vue.d.ts} +2 -3
  8. package/dist/components/DialogSearch/cssColor.d.ts +3 -0
  9. package/dist/components/DialogSearch/panelPlacement.d.ts +5 -0
  10. package/dist/components/DialogSearch/searchCollections.d.ts +6 -0
  11. package/dist/components/DialogSearch/searchDisplay.d.ts +5 -2
  12. package/dist/components/DialogSearch/searchLayout.d.ts +1 -0
  13. package/dist/components/DialogSearch/searchMessages.d.ts +14 -0
  14. package/dist/components/DialogSearch/searchPagination.d.ts +2 -0
  15. package/dist/components/DialogSearch/searchTheme.d.ts +3 -0
  16. package/dist/components/DialogSearch/titleHighlight.d.ts +6 -0
  17. package/dist/components/DialogSearch/useAnchorRect.d.ts +6 -1
  18. package/dist/components/DialogSearch/useDialogSearch.d.ts +8 -1
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/dialog-vue.css +1 -1
  21. package/dist/dialog-vue.js +854 -515
  22. package/dist/dialog-vue.umd.cjs +3 -3
  23. package/dist/icons/ArrowRightIcon.vue.d.ts +2 -0
  24. package/dist/icons/CaretRightIcon.vue.d.ts +2 -0
  25. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- (function(g,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(g=typeof globalThis<"u"?globalThis:g||self,e(g["dialog-vue"]={},g.Vue))})(this,(function(g,e){"use strict";var Ct=Object.defineProperty;var bt=(g,e,N)=>e in g?Ct(g,e,{enumerable:!0,configurable:!0,writable:!0,value:N}):g[e]=N;var P=(g,e,N)=>bt(g,typeof e!="symbol"?e+"":e,N);const N=new Set(["ar","he","iw","fa","ur"]),W=o=>o!==void 0&&N.has(o.trim().toLowerCase().slice(0,2)),v=o=>W(o)?"rtl":"ltr";var B;(function(o){o.OPEN_ASSISTANT="open_assistant",o.CLOSE_ASSISTANT="close_assistant",o.SEND_MESSAGE="PRODUCT_QUESTION",o.SEND_GENERIC_QUESTION="GENERIC_QUESTION",o.TRACK_ADD_TO_CART="TRACK_ADD_TO_CART",o.TRACK_SUBMIT_CHECKOUT="TRACK_SUBMIT_CHECKOUT",o.TRACK_VIEW_SEARCH_RESULTS="TRACK_VIEW_SEARCH_RESULTS",o.TRACK_SELECT_SEARCH_RESULT="TRACK_SELECT_SEARCH_RESULT"})(B||(B={}));var O;(function(o){o.USER_OPENED_ASSISTANT="userOpenedAssistant",o.USER_CLOSED_ASSISTANT="userClosedAssistant",o.USER_SENT_MESSAGE="userSentMessage",o.USER_CLICKED_ON_PRODUCT_CARD="userClickedOnProductCard",o.USER_OPENED_RECOMMENDATION="userOpenedRecommendation",o.USER_ADDED_TO_CART="userAddedToCart",o.USER_SEND_POSITIVE_FEEDBACK="userSendPositiveFeedback",o.USER_SEND_NEGATIVE_FEEDBACK="userSendNegativeFeedback"})(O||(O={})),B.TRACK_ADD_TO_CART,B.TRACK_SUBMIT_CHECKOUT,B.TRACK_VIEW_SEARCH_RESULTS,B.TRACK_SELECT_SEARCH_RESULT;class Y extends Error{constructor({status:n,code:s,message:a}){super(a);P(this,"status");P(this,"code");this.name="DialogSearchError",this.status=n,this.code=s}}const $=(o,t,n)=>{if(!/^[a-z]{2}$/.test(t))throw new Error("Search language must be a lowercase ISO 639-1 code.");if(!/^[A-Za-z]{3}$/.test(n))throw new Error("Search currency must be an ISO 4217 code.");return`${o}_${t}_${n.toLowerCase()}`},x="multiple installation methods detected:",X=()=>typeof window>"u"?void 0:window,M=()=>{const o=X();if(o!==void 0)return o.dialog=o.dialog??{},o.dialog.audit=o.dialog.audit??{methods:[],context:{},capabilities:[],warnings:[]},o.dialog.audit},Z=o=>{if(o.warnings=o.warnings.filter(t=>!t.startsWith(x)),o.methods.length>=2){const t=o.methods.map(n=>n.method).join(", ");o.warnings.push(`${x} ${t}`)}},J=(o,t)=>t===void 0?o:{version:(o==null?void 0:o.version)??t.version,commit:(o==null?void 0:o.commit)??t.commit},U=o=>{const t=M();if(t===void 0)return;const n=t.methods.find(s=>s.method===o.method);if(n===void 0){t.methods.push({...o,registeredAt:new Date().toISOString()}),Z(t);return}n.version=n.version??o.version,n.build=J(n.build,o.build),n.source=n.source??o.source},ee=o=>{const t=M();t!==void 0&&(t.capabilities.includes(o)||t.capabilities.push(o))},y={IDLE:"idle",LOADING:"loading",SUCCESS:"success",EMPTY:"empty",ERROR:"error"},te=.5,oe=500,ne=1500,se=100;function re({emit:o,visibilityThreshold:t=te,dwellMs:n=oe,idleFlushMs:s=ne,maxItemsPerEvent:a=se}){let c,r=[];const i=new Set,p=new Map,l=new Map;let d;const m=()=>{clearTimeout(d),!(c===void 0||r.length===0)&&(o({...c,items:r}),r=[])},E=h=>{if(c===void 0)return;const _=`${c.query_id}:${h.product_id}`;if(!i.has(_)){if(i.add(_),r.push(h),r.length>=a){m();return}clearTimeout(d),d=setTimeout(m,s)}},b=h=>{const _=l.get(h);_!==void 0&&(clearTimeout(_),l.delete(h))},u=new IntersectionObserver(h=>{for(const _ of h){const f=p.get(_.target);f!==void 0&&(_.intersectionRatio>=t?l.has(_.target)||l.set(_.target,setTimeout(()=>{l.delete(_.target),E(f)},n)):b(_.target))}},{threshold:t}),S=()=>{u.disconnect();for(const h of l.values())clearTimeout(h);l.clear(),p.clear()},k=()=>{m()},w=h=>{if(h.persisted){i.clear();for(const _ of p.keys())b(_),u.unobserve(_),u.observe(_)}};return window.addEventListener("pagehide",k),window.addEventListener("pageshow",w),{setContext(h){m(),i.clear(),c=h,S()},observe(h,_){p.set(h,_),u.observe(h)},forceImpression(h){E(h),m()},flush:m,disconnect(){m(),S(),window.removeEventListener("pagehide",k),window.removeEventListener("pageshow",w)}}}const q=(o,t)=>({product_id:o.hits[t].objectID,position:o.page*o.hitsPerPage+t+1});function ce(o){let t,n;const s=()=>(t??(t=re({emit:o.trackViewSearchResults})),t);return{onResponse(a){n={query_id:a.queryID,index:a.index,surface:o.surface,search_type:"lexical",page:a.page+1,total_hits:a.nbHits,query_length:[...a.query].length},s().setContext(n),a.nbHits===0&&o.trackViewSearchResults({...n,items:[]})},observeResult(a,c,r){s().observe(a,q(c,r))},select(a,c){if(n===void 0)return;const r=q(a,c);s().forceImpression(r),o.trackSelectSearchResult({...n,items:[r]})},dispose(){t==null||t.disconnect()}}}const ae=2,K=o=>{const t=o.trim();return[...t].length>=ae?t:void 0},ie=(o,t,n,{indexName:s,language:a,currency:c,hitsPerPage:r})=>({requests:[{indexName:s,query:o,page:t,hitsPerPage:r},...n.map(i=>({indexName:$(i.index,a,c),query:o,page:0,hitsPerPage:i.hitsPerPage??r}))]}),le=(o,t,{indexName:n,language:s,currency:a})=>{const c=o.results.find(i=>i.index===n);if(c===void 0)throw new Error(`Dialog search returned no ${n} entry`);const r={};for(const i of t){const p=$(i.index,s,a),l=o.results.find(d=>d.index===p);l!==void 0&&(r[i.index]=l)}return{response:c,sections:t.length===0?void 0:r}},L={status:y.IDLE,query:"",page:0,response:void 0,sections:void 0,error:void 0};function de({search:o,language:t,currency:n,analytics:s,navigate:a,debounceMs:c=250,hitsPerPage:r=12,sections:i=[]}){const p={indexName:$("products",t,n),language:t,currency:n,hitsPerPage:r};let l=L;const d=new Set,m=ce(s);let E,b,u,S=0,k=!1;const w=f=>{l={...l,...f};for(const C of d)C(l)},h=()=>{clearTimeout(E),b=void 0,S+=1,u==null||u.abort(),u=void 0},_=async(f,C)=>{h(),u=new AbortController;const R=S;w({status:y.LOADING,query:f,page:C});try{const I=typeof i=="function"?i():i,z=ie(f,C,I,p),kt=await o(z,{signal:u.signal});if(R!==S)return;const V=le(kt,I,p);m.onResponse(V.response),w({...V,status:V.response.nbHits===0?y.EMPTY:y.SUCCESS,error:void 0})}catch(I){if(I instanceof DOMException&&I.name==="AbortError"||R!==S)return;w({status:y.ERROR,error:I,response:void 0,sections:void 0})}};return{setQuery(f){if(k)return;h();const C=K(f);if(C===void 0){w(L);return}b=C,E=setTimeout(()=>void _(C,0),c)},submit(f){if(k)return;h();const C=K(f);if(C===void 0){w(L);return}_(C,0)},setPage(f){if(!k){if(b!==void 0){_(b,0);return}l.query!==""&&_(l.query,f)}},retry(){k||l.status!==y.ERROR||_(l.query,l.page)},observeResult(f,C){l.response!==void 0&&m.observeResult(f,l.response,C)},selectResult(f,C){const R=l.response;if(R===void 0)return!1;m.select(R,f);const I=R.hits[f].url;return((C==null?void 0:C.navigate)??!0)&&a!==void 0&&I!==void 0?(a(I,R.hits[f]),!0):!1},subscribe(f){return d.add(f),()=>{d.delete(f)}},getState:()=>l,dispose(){k=!0,h(),d.clear(),m.dispose()}}}const ue={class:"dialog-block-header-container"},pe={class:"dialog-block-title"},me={class:"dialog-block-description"},he=e.defineComponent({__name:"DialogBlockHeader",props:{title:{},description:{}},setup(o){const t=o;return(n,s)=>(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",pe,e.toDisplayString(t.title??"Your expert"),1),e.createElementVNode("div",me,e.toDisplayString(t.description??"A question about this product?"),1)]))}}),T=(o,t)=>{const n=o.__vccOpts||o;for(const[s,a]of t)n[s]=a;return n},_e=T(he,[["__scopeId","data-v-28e6dda7"]]),fe={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ge={"clip-path":"url(#clip0_466_934)"},Ee=["stroke"],Se=["stroke"],ke=e.defineComponent({__name:"AiStarsIcon",props:{color:{}},setup(o){const t=o;return(n,s)=>(e.openBlock(),e.createElementBlock("svg",fe,[e.createElementVNode("g",ge,[e.createElementVNode("path",{d:`M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
1
+ (function(k,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(k=typeof globalThis<"u"?globalThis:k||self,t(k["dialog-vue"]={},k.Vue))})(this,(function(k,t){"use strict";var Co=Object.defineProperty;var So=(k,t,R)=>t in k?Co(k,t,{enumerable:!0,configurable:!0,writable:!0,value:R}):k[t]=R;var M=(k,t,R)=>So(k,typeof t!="symbol"?t+"":t,R);const R=new Set(["ar","he","iw","fa","ur"]),se=o=>o!==void 0&&R.has(o.trim().toLowerCase().slice(0,2)),re=o=>se(o)?"rtl":"ltr";var I;(function(o){o.OPEN_ASSISTANT="open_assistant",o.CLOSE_ASSISTANT="close_assistant",o.SEND_MESSAGE="PRODUCT_QUESTION",o.SEND_GENERIC_QUESTION="GENERIC_QUESTION",o.TRACK_ADD_TO_CART="TRACK_ADD_TO_CART",o.TRACK_SUBMIT_CHECKOUT="TRACK_SUBMIT_CHECKOUT",o.TRACK_VIEW_SEARCH_RESULTS="TRACK_VIEW_SEARCH_RESULTS",o.TRACK_SELECT_SEARCH_RESULT="TRACK_SELECT_SEARCH_RESULT"})(I||(I={}));var q;(function(o){o.USER_OPENED_ASSISTANT="userOpenedAssistant",o.USER_CLOSED_ASSISTANT="userClosedAssistant",o.USER_SENT_MESSAGE="userSentMessage",o.USER_CLICKED_ON_PRODUCT_CARD="userClickedOnProductCard",o.USER_OPENED_RECOMMENDATION="userOpenedRecommendation",o.USER_ADDED_TO_CART="userAddedToCart",o.USER_SEND_POSITIVE_FEEDBACK="userSendPositiveFeedback",o.USER_SEND_NEGATIVE_FEEDBACK="userSendNegativeFeedback"})(q||(q={})),I.TRACK_ADD_TO_CART,I.TRACK_SUBMIT_CHECKOUT,I.TRACK_VIEW_SEARCH_RESULTS,I.TRACK_SELECT_SEARCH_RESULT;class ce extends Error{constructor({status:n,code:s,message:c}){super(c);M(this,"status");M(this,"code");this.name="DialogSearchError",this.status=n,this.code=s}}const A=(o,e,n)=>{if(!/^[a-z]{2}$/.test(e))throw new Error("Search language must be a lowercase ISO 639-1 code.");if(!/^[A-Za-z]{3}$/.test(n))throw new Error("Search currency must be an ISO 4217 code.");return`${o}_${e}_${n.toLowerCase()}`},U="multiple installation methods detected:",le=()=>typeof window>"u"?void 0:window,H=()=>{const o=le();if(o!==void 0)return o.dialog=o.dialog??{},o.dialog.audit=o.dialog.audit??{methods:[],context:{},capabilities:[],warnings:[]},o.dialog.audit},ae=o=>{if(o.warnings=o.warnings.filter(e=>!e.startsWith(U)),o.methods.length>=2){const e=o.methods.map(n=>n.method).join(", ");o.warnings.push(`${U} ${e}`)}},ie=(o,e)=>e===void 0?o:{version:(o==null?void 0:o.version)??e.version,commit:(o==null?void 0:o.commit)??e.commit},K=o=>{const e=H();if(e===void 0)return;const n=e.methods.find(s=>s.method===o.method);if(n===void 0){e.methods.push({...o,registeredAt:new Date().toISOString()}),ae(e);return}n.version=n.version??o.version,n.build=ie(n.build,o.build),n.source=n.source??o.source},de=o=>{const e=H();e!==void 0&&(e.capabilities.includes(o)||e.capabilities.push(o))},w={IDLE:"idle",LOADING:"loading",SUCCESS:"success",EMPTY:"empty",ERROR:"error"},ue=.5,pe=500,me=1500,he=100;function fe({emit:o,visibilityThreshold:e=ue,dwellMs:n=pe,idleFlushMs:s=me,maxItemsPerEvent:c=he}){let r,a=[];const l=new Set,p=new Map,i=new Map;let d;const m=()=>{clearTimeout(d),!(r===void 0||a.length===0)&&(o({...r,items:a}),a=[])},b=g=>{if(r===void 0)return;const f=`${r.query_id}:${g.product_id}`;if(!l.has(f)){if(l.add(f),a.push(g),a.length>=c){m();return}clearTimeout(d),d=setTimeout(m,s)}},_=g=>{const f=i.get(g);f!==void 0&&(clearTimeout(f),i.delete(g))},h=new IntersectionObserver(g=>{for(const f of g){const u=p.get(f.target);u!==void 0&&(f.intersectionRatio>=e?i.has(f.target)||i.set(f.target,setTimeout(()=>{i.delete(f.target),b(u)},n)):_(f.target))}},{threshold:e}),C=()=>{h.disconnect();for(const g of i.values())clearTimeout(g);i.clear(),p.clear()},S=()=>{m()},y=g=>{if(g.persisted){l.clear();for(const f of p.keys())_(f),h.unobserve(f),h.observe(f)}};return window.addEventListener("pagehide",S),window.addEventListener("pageshow",y),{setContext(g){m(),l.clear(),r=g,C()},observe(g,f){p.set(g,f),h.observe(g)},forceImpression(g){b(g),m()},flush:m,disconnect(){m(),C(),window.removeEventListener("pagehide",S),window.removeEventListener("pageshow",y)}}}const F=(o,e)=>({product_id:o.hits[e].objectID,position:o.page*o.hitsPerPage+e+1});function ge(o){let e,n;const s=()=>(e??(e=fe({emit:o.trackViewSearchResults})),e);return{onResponse(c){n={query_id:c.queryID,index:c.index,surface:o.surface,search_type:"lexical",page:c.page+1,total_hits:c.nbHits,query_length:[...c.query].length},s().setContext(n),c.nbHits===0&&o.trackViewSearchResults({...n,items:[]})},observeResult(c,r,a){s().observe(c,F(r,a))},select(c,r){if(n===void 0)return;const a=F(c,r);s().forceImpression(a),o.trackSelectSearchResult({...n,items:[a]})},dispose(){e==null||e.disconnect()}}}const _e=2,j=o=>{const e=o.trim();return[...e].length>=_e?e:void 0},Ee=(o,e,n,{indexName:s,language:c,currency:r,hitsPerPage:a})=>({requests:[{indexName:s,query:o,page:e,hitsPerPage:a},...n.map(l=>({indexName:A(l.index,c,r),query:o,page:0,hitsPerPage:l.hitsPerPage??a}))]}),be=(o,e,{indexName:n,language:s,currency:c})=>{const r=o.results.find(l=>l.index===n);if(r===void 0)throw new Error(`Dialog search returned no ${n} entry`);const a={};for(const l of e){const p=A(l.index,s,c),i=o.results.find(d=>d.index===p);i!==void 0&&(a[l.index]=i)}return{response:r,sections:e.length===0?void 0:a}},D={status:w.IDLE,query:"",page:0,response:void 0,sections:void 0,error:void 0};function ke({search:o,language:e,currency:n,analytics:s,navigate:c,debounceMs:r=250,hitsPerPage:a=12,sections:l=[]}){const p={indexName:A("products",e,n),language:e,currency:n,hitsPerPage:a};let i=D;const d=new Set,m=ge(s);let b,_,h,C=0,S=!1;const y=u=>{i={...i,...u};for(const E of d)E(i)},g=()=>{clearTimeout(b),_=void 0,C+=1,h==null||h.abort(),h=void 0},f=async(u,E)=>{g(),h=new AbortController;const T=C;y({status:w.LOADING,query:u,page:E});try{const N=typeof l=="function"?l():l,ne=Ee(u,E,N,p),ko=await o(ne,{signal:h.signal});if(T!==C)return;const O=be(ko,N,p);m.onResponse(O.response),y({...O,status:O.response.nbHits===0?w.EMPTY:w.SUCCESS,error:void 0})}catch(N){if(N instanceof DOMException&&N.name==="AbortError"||T!==C)return;y({status:w.ERROR,error:N,response:void 0,sections:void 0})}};return{setQuery(u){if(S)return;g();const E=j(u);if(E===void 0){y(D);return}_=E,b=setTimeout(()=>void f(E,0),r)},submit(u){if(S)return;g();const E=j(u);if(E===void 0){y(D);return}f(E,0)},setPage(u){if(!S){if(_!==void 0){f(_,0);return}i.query!==""&&f(i.query,u)}},retry(){S||i.status!==w.ERROR||f(i.query,i.page)},observeResult(u,E){i.response!==void 0&&m.observeResult(u,i.response,E)},selectResult(u,E){const T=i.response;if(T===void 0)return!1;m.select(T,u);const N=T.hits[u].url;return((E==null?void 0:E.navigate)??!0)&&c!==void 0&&N!==void 0?(c(N,T.hits[u]),!0):!1},subscribe(u){return d.add(u),()=>{d.delete(u)}},getState:()=>i,dispose(){S=!0,g(),d.clear(),m.dispose()}}}const Ce={class:"dialog-block-header-container"},Se={class:"dialog-block-title"},ye={class:"dialog-block-description"},we=t.defineComponent({__name:"DialogBlockHeader",props:{title:{},description:{}},setup(o){const e=o;return(n,s)=>(t.openBlock(),t.createElementBlock("div",Ce,[t.createElementVNode("div",Se,t.toDisplayString(e.title??"Your expert"),1),t.createElementVNode("div",ye,t.toDisplayString(e.description??"A question about this product?"),1)]))}}),$=(o,e)=>{const n=o.__vccOpts||o;for(const[s,c]of e)n[s]=c;return n},$e=$(we,[["__scopeId","data-v-28e6dda7"]]),Ne={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Te={"clip-path":"url(#clip0_466_934)"},Re=["stroke"],Ie=["stroke"],Be=t.defineComponent({__name:"AiStarsIcon",props:{color:{}},setup(o){const e=o;return(n,s)=>(t.openBlock(),t.createElementBlock("svg",Ne,[t.createElementVNode("g",Te,[t.createElementVNode("path",{d:`M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
2
2
  12.9962C6.68124 13.1663 6.83375 13.3188 7.00388 13.45C7.19559 13.5977 7.41684
3
3
  13.7084 7.85932 13.9296L9.16675 14.5833L7.85932 15.237C7.41684 15.4583 7.19559
4
4
  15.5689 7.00388 15.7167C6.83375 15.8478 6.68124 16.0003 6.55011 16.1704C6.40232
@@ -7,7 +7,7 @@
7
7
  15.7167C3.6379 15.5689 3.41666 15.4583 2.97418 15.237L1.66675 14.5833L2.97418
8
8
  13.9296C3.41666 13.7084 3.6379 13.5977 3.82962 13.45C3.99974 13.3188 4.15225
9
9
  13.1663 4.28339 12.9962C4.43117 12.8045 4.54179 12.5832 4.76303 12.1408L5.41675
10
- 10.8333Z`,stroke:t.color||"#181825","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Ee),e.createElementVNode("path",{d:`M12.5001 1.66666L13.4823 4.22034C13.7173 4.83136 13.8348 5.13688 14.0175
10
+ 10.8333Z`,stroke:e.color||"#181825","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Re),t.createElementVNode("path",{d:`M12.5001 1.66666L13.4823 4.22034C13.7173 4.83136 13.8348 5.13688 14.0175
11
11
  5.39386C14.1795 5.62162 14.3785 5.82061 14.6062 5.98256C14.8632 6.16529 15.1687
12
12
  6.2828 15.7797 6.5178L18.3334 7.49999L15.7797 8.48217C15.1687 8.71718 14.8632
13
13
  8.83469 14.6062 9.01742C14.3785 9.17937 14.1795 9.37836 14.0175 9.60612C13.8348
@@ -16,4 +16,4 @@
16
16
  9.01742C10.137 8.83469 9.83145 8.71718 9.22043 8.48217L6.66675 7.49999L9.22043
17
17
  6.5178C9.83145 6.28279 10.137 6.16529 10.3939 5.98256C10.6217 5.82061 10.8207
18
18
  5.62162 10.9827 5.39386C11.1654 5.13688 11.2829 4.83136 11.5179 4.22034L12.5001
19
- 1.66666Z`,stroke:t.color||"#181825","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Se)]),s[0]||(s[0]=e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:"clip0_466_934"},[e.createElementVNode("rect",{width:"20",height:"20",fill:"white"})])],-1))]))}}),Ce=["onClick"],be={class:"dialog-block-suggestions-item-label"},we=T(e.defineComponent({__name:"DialogBlockSuggestions",props:{client:{},questions:{},productId:{},productTitle:{},selectedVariantId:{}},setup(o){const t=o,n=s=>{t.client.sendProductMessage({productId:t.productId,productTitle:t.productTitle,selectedVariantId:t.selectedVariantId,question:s,fromQuestionSuggestion:!0})};return(s,a)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.questions,c=>(e.openBlock(),e.createElementBlock("button",{key:c.question,class:"dialog-block-suggestions-item",onClick:r=>n(c.question)},[e.createVNode(ke,{class:"dialog-block-suggestions-item-icon",color:t.client.theme.primaryColor},null,8,["color"]),e.createElementVNode("span",be,e.toDisplayString(c.question),1)],8,Ce))),128))}}),[["__scopeId","data-v-db34d4b4"]]),ye={};function Ie(o,t){return e.openBlock(),e.createElementBlock(e.Fragment,null,[t[0]||(t[0]=e.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1)),t[1]||(t[1]=e.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1)),t[2]||(t[2]=e.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1))],64)}const Te=T(ye,[["render",Ie],["__scopeId","data-v-26a64b58"]]),Re={class:"dialog-block-suggestions-container"},Ne=T(e.defineComponent({__name:"DialogBlockSuggestionsContainer",props:{client:{},questions:{},isLoading:{type:Boolean},productId:{},productTitle:{},selectedVariantId:{}},setup(o){const t=o;return(n,s)=>(e.openBlock(),e.createElementBlock("div",Re,[t.isLoading||!t.questions?(e.openBlock(),e.createBlock(Te,{key:0})):(e.openBlock(),e.createBlock(we,{key:1,client:t.client,questions:t.questions,"product-id":t.productId,"product-title":t.productTitle,"selected-variant-id":t.selectedVariantId},null,8,["client","questions","product-id","product-title","selected-variant-id"]))]))}}),[["__scopeId","data-v-18c9e78b"]]),Be={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},De=["stroke"],$e=e.defineComponent({__name:"ArrowIcon",props:{color:{}},setup(o){const t=o;return(n,s)=>(e.openBlock(),e.createElementBlock("svg",Be,[e.createElementVNode("path",{d:"M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",stroke:t.color||"#ffffff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,De)]))}}),Le=["placeholder"],Ae=["disabled"],H=T(e.defineComponent({__name:"DialogInput",props:{client:{},placeholder:{},productId:{},productTitle:{},selectedVariantId:{}},setup(o){const t=o,n=e.ref(),s=e.ref(""),a=()=>{var r;(r=n.value)==null||r.focus()},c=()=>{const r=s.value;r.trim()&&(t.client.sendProductMessage({productId:t.productId,productTitle:t.productTitle,selectedVariantId:t.selectedVariantId,question:r,fromQuestionSuggestion:!0}),s.value="")};return(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:"dialog-input-wrapper",onClick:a},[e.withDirectives(e.createElementVNode("input",{id:"dialog-ask-anything-input-ai-input",ref_key:"inputRef",ref:n,"onUpdate:modelValue":i[0]||(i[0]=p=>s.value=p),class:"dialog-ask-anything-input-ai-input",placeholder:t.placeholder??"Ask anything...",onKeydown:e.withKeys(c,["enter"])},null,40,Le),[[e.vModelText,s.value]]),e.createElementVNode("button",{id:"send-message-button-ai-input",class:"dialog-input-submit",disabled:!s.value.trim(),onClick:c},[e.createVNode($e,{color:t.client.theme.ctaTextColor},null,8,["color"])],8,Ae)]))}}),[["__scopeId","data-v-4f5901c9"]]),Ve=e.defineComponent({__name:"ThemeProvider",props:{theme:{}},setup(o){const t=o,n=document.body,s=c=>c.replace(/([A-Z])/g,"-$1").toLowerCase(),a=c=>{c&&Object.keys(c).forEach(r=>{const i=r,p=s(r);if(c[i]!==void 0){if(typeof c[i]=="object"){Object.keys(c[i]).forEach(l=>{var m;const d=l;if(d!==void 0){const E=s(l),b=c[i];n.style.setProperty(`--dialog-theme-${p}-${E}`,(m=b[d])==null?void 0:m.toString())}});return}if(i==="ctaBorderType"){const l=c[i]==="rounded"?"24px":"0";n.style.setProperty(`--dialog-theme-${p}`,l);return}n.style.setProperty(`--dialog-theme-${p}`,c[i].toString())}})};return e.onMounted(()=>{t.theme&&a(t.theme)}),e.watch(()=>t.theme,c=>{c&&a(c)},{deep:!0}),(c,r)=>e.renderSlot(c.$slots,"default")}}),Pe=["dir"],Oe=T(e.defineComponent({__name:"DialogProductBlock",props:{client:{},productId:{},productTitle:{},selectedVariantId:{default:void 0},enableInput:{type:Boolean,default:!0}},setup(o){const t=o;e.onMounted(()=>{U({method:"vue",version:"3.6.0"}),ee("pdp-block")});const n=e.ref(!0),s=e.ref(void 0),a=e.ref(0),c=e.computed(()=>{var d;return n.value?"":(d=s.value)==null?void 0:d.assistantName}),r=e.computed(()=>{var d;return n.value?"":(d=s.value)==null?void 0:d.description}),i=e.computed(()=>{var d;return n.value?"":(d=s.value)==null?void 0:d.inputPlaceholder}),p=e.computed(()=>{var d;return v((d=t.client.getLocalizationInformations())==null?void 0:d.languageCode)}),l=async()=>{const d=++a.value;n.value=!0,s.value=void 0;try{const m=await t.client.getSuggestions(t.productId);d===a.value&&(s.value=m)}catch(m){console.error("error",m)}finally{d===a.value&&(n.value=!1)}};return e.watch(()=>[t.client,t.productId],()=>{l()},{immediate:!0}),(d,m)=>(e.openBlock(),e.createBlock(Ve,{theme:t.client.theme},{default:e.withCtx(()=>{var E;return[e.createElementVNode("div",{id:"dialog-instant",class:"dialog-block-container",dir:p.value},[e.createVNode(_e,{title:c.value,description:r.value},null,8,["title","description"]),e.createVNode(Ne,{client:t.client,questions:(E=s.value)==null?void 0:E.questions,"is-loading":n.value,"product-id":t.productId,"product-title":t.productTitle,"selected-variant-id":t==null?void 0:t.selectedVariantId},null,8,["client","questions","is-loading","product-id","product-title","selected-variant-id"]),t.enableInput?(e.openBlock(),e.createBlock(H,{key:0,client:t.client,placeholder:i.value,"product-id":t.productId,"product-title":t.productTitle,"selected-variant-id":t==null?void 0:t.selectedVariantId},null,8,["client","placeholder","product-id","product-title","selected-variant-id"])):e.createCommentVNode("",!0)],8,Pe)]}),_:1},8,["theme"]))}}),[["__scopeId","data-v-c57aa677"]]),xe={},Me={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"};function Ue(o,t){return e.openBlock(),e.createElementBlock("svg",Me,t[0]||(t[0]=[e.createElementVNode("path",{d:"M8 13V3M8 3L3 8M8 3L13 8",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const qe=T(xe,[["render",Ue]]),Ke={width:"16",height:"16",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},He=["fill"],Fe="M5.3217 0.588255C5.63241 -0.196084 6.36759 -0.196085 6.6783 0.588254C6.98901 1.37259 7.68193 2.82807 8.42693 3.57307C9.17193 4.31807 10.6274 5.01099 11.4117 5.3217C12.1961 5.63241 12.1961 6.36759 11.4117 6.6783C10.6274 6.98901 9.17193 7.68193 8.42693 8.42693C7.68193 9.17193 6.98901 10.6274 6.6783 11.4117C6.36759 12.1961 5.63241 12.1961 5.3217 11.4117C5.01099 10.6274 4.31807 9.17193 3.57307 8.42693C2.82808 7.68193 1.37259 6.98901 0.588255 6.6783C-0.196084 6.36759 -0.196085 5.63241 0.588254 5.3217C1.37259 5.01099 2.82807 4.31807 3.57307 3.57307C4.31807 2.82808 5.01099 1.37259 5.3217 0.588255Z",je=e.defineComponent({__name:"ShurikenIcon",props:{color:{}},setup(o){const t=o;return(n,s)=>(e.openBlock(),e.createElementBlock("svg",Ke,[e.createElementVNode("path",{d:Fe,fill:t.color||"currentColor"},null,8,He)]))}}),Ge={class:"dialog-search-bar-field"},Qe={class:"dialog-search-bar-icon"},ze=["aria-label","placeholder","autofocus"],We=["aria-label"],ve=e.defineComponent({__name:"DialogSearchBar",props:{controller:{},placeholder:{default:"Search products..."},autoFocus:{type:Boolean,default:!1},submitAriaLabel:{default:"Search"}},setup(o){const t=o,n=e.ref(""),s=()=>{t.controller.setQuery(n.value)},a=()=>{t.controller.submit(n.value)};return(c,r)=>(e.openBlock(),e.createElementBlock("form",{class:"dialog-search-bar",role:"search",onSubmit:e.withModifiers(a,["prevent"])},[e.createElementVNode("div",Ge,[e.createElementVNode("span",Qe,[e.createVNode(je)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=i=>n.value=i),type:"text",name:"dialog-search-query",class:"dialog-search-bar-input","aria-label":t.placeholder,placeholder:t.placeholder,autofocus:t.autoFocus,onInput:s},null,40,ze),[[e.vModelText,n.value]])]),e.createElementVNode("button",{type:"submit",class:"dialog-search-bar-submit","aria-label":t.submitAriaLabel},[e.createVNode(qe)],8,We)],32))}}),Ye={key:0,"aria-label":"Search results pages",class:"dialog-search-pagination"},Xe=["disabled"],Ze=["disabled"],F=e.defineComponent({__name:"DialogSearchPagination",props:{controller:{},state:{}},setup(o){const t=o,n=e.computed(()=>t.state.response);return(s,a)=>n.value!==void 0&&n.value.nbPages>1?(e.openBlock(),e.createElementBlock("nav",Ye,[e.createElementVNode("button",{type:"button",disabled:n.value.page===0,onClick:a[0]||(a[0]=c=>t.controller.setPage(n.value.page-1))}," Previous ",8,Xe),e.createElementVNode("span",null," Page "+e.toDisplayString(n.value.page+1)+" / "+e.toDisplayString(n.value.nbPages),1),e.createElementVNode("button",{type:"button",disabled:n.value.page>=n.value.nbPages-1,onClick:a[1]||(a[1]=c=>t.controller.setPage(n.value.page+1))}," Next ",8,Ze)])):e.createCommentVNode("",!0)}}),A=({amount:o,currencyCode:t},n)=>t===void 0?new Intl.NumberFormat(n).format(Number(o)):new Intl.NumberFormat(n,{style:"currency",currency:t}).format(Number(o)),Je=({min:o,max:t},n)=>o.amount===t.amount?A(o,n):`${A(o,n)} – ${A(t,n)}`,et=(o,t)=>{if(o===void 0)return"";try{return Je(o,t)}catch{return""}},tt=o=>{try{const{protocol:t}=new URL(o,window.location.href);return t==="http:"||t==="https:"?o:void 0}catch{return}},ot={class:"dialog-search-card-image"},nt=["src","alt"],st={class:"dialog-search-card-info"},rt={class:"dialog-search-card-title"},ct={key:0,class:"dialog-search-card-price"},j=e.defineComponent({__name:"DialogSearchProductCardContent",props:{hit:{},locale:{}},setup(o){const t=o,n=e.computed(()=>t.hit.title??t.hit.objectID),s=e.computed(()=>et(t.hit.priceRange,t.locale));return(a,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ot,[t.hit.imageUrl!==void 0?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.hit.imageUrl,alt:n.value,loading:"lazy"},null,8,nt)):e.createCommentVNode("",!0)]),e.createElementVNode("div",st,[e.createElementVNode("p",rt,e.toDisplayString(n.value),1),s.value!==""?(e.openBlock(),e.createElementBlock("p",ct,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0)])],64))}}),at={key:0,class:"dialog-search-card-body"},it=["href"],G=e.defineComponent({__name:"DialogSearchProductCard",props:{controller:{},hit:{},index:{},locale:{}},setup(o){const t=o,n=e.ref();e.watch(()=>t.hit,()=>{n.value!==void 0&&t.controller.observeResult(n.value,t.index)},{immediate:!0,flush:"post"});const s=r=>{const i=r.metaKey||r.ctrlKey||r.shiftKey||r.altKey;t.controller.selectResult(t.index,{navigate:!i})&&r.preventDefault()},a=r=>{r.button===1&&t.controller.selectResult(t.index,{navigate:!1})},c=e.computed(()=>t.hit.url===void 0?void 0:tt(t.hit.url));return(r,i)=>(e.openBlock(),e.createElementBlock("li",{ref_key:"cardRef",ref:n,class:"dialog-search-card"},[c.value===void 0?(e.openBlock(),e.createElementBlock("div",at,[e.createVNode(j,{hit:t.hit,locale:t.locale},null,8,["hit","locale"])])):(e.openBlock(),e.createElementBlock("a",{key:1,class:"dialog-search-card-body",href:c.value,onClick:s,onAuxclick:a},[e.createVNode(j,{hit:t.hit,locale:t.locale},null,8,["hit","locale"])],40,it))],512))}}),lt=o=>{const t=e.ref(),n=e.ref(void 0),s=e.ref(0);return e.watch(o,(a,c,r)=>{if(!a)return;const i=()=>{const p=t.value;if(p===void 0)return;const l=p.previousElementSibling??p,{top:d,bottom:m,left:E,width:b}=l.getBoundingClientRect();s.value=window.innerHeight;const u=n.value;(u===void 0||u.top!==d||u.bottom!==m||u.left!==E||u.width!==b)&&(n.value={top:d,bottom:m,left:E,width:b})};i(),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),r(()=>{window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)})},{immediate:!0,flush:"post"}),{anchorRef:t,rect:n,viewportHeight:s}},dt=(o,t)=>{const n=e.ref(!1),s=e.ref(),a=e.computed(()=>o.value.status!==y.IDLE&&!n.value);e.watch(()=>o.value.query,()=>{n.value=!1}),e.watch(a,(r,i,p)=>{if(!r)return;const l=d=>{var S,k;const m=d.target;if(!(m instanceof Node))return;const E=(S=t.value)==null?void 0:S.previousElementSibling,b=((k=s.value)==null?void 0:k.contains(m))??!1,u=(E==null?void 0:E.contains(m))??!1;!b&&!u&&(n.value=!0)};document.addEventListener("pointerdown",l),p(()=>document.removeEventListener("pointerdown",l))},{immediate:!0});const c=()=>{n.value=!1};return e.onMounted(()=>{var r,i;(i=(r=t.value)==null?void 0:r.previousElementSibling)==null||i.addEventListener("focusin",c)}),e.onUnmounted(()=>{var r,i;(i=(r=t.value)==null?void 0:r.previousElementSibling)==null||i.removeEventListener("focusin",c)}),{isOpen:a,panelRef:s}},ut={key:0,role:"status",class:"dialog-search-status"},pt={key:1,class:"dialog-search-error"},mt={role:"alert",class:"dialog-search-status dialog-search-status-error"},ht={key:2,role:"status",class:"dialog-search-status"},_t={role:"status",class:"dialog-search-status"},ft={class:"dialog-search-results"},D=8,Q=16,gt=200,Et=e.defineComponent({__name:"DialogSearchResults",props:{controller:{},state:{},locale:{}},setup(o){const t=o,n=u=>u instanceof Y?`Search failed (${u.status}${u.code?` ${u.code}`:""}): ${u.message}`:"Search failed: network error. Check your connection and try again.",s=(u,S)=>u.bottom>0&&u.top<S,a=(u,S)=>{const k=S-u.bottom-D-Q,w=u.top-D-Q,h={left:`${u.left}px`,width:`${u.width}px`};return k<gt&&w>k?{...h,bottom:`${S-u.top+D}px`,maxHeight:`${Math.max(w,0)}px`}:{...h,top:`${u.bottom+D}px`,maxHeight:`${Math.max(k,0)}px`}},c=e.computed(()=>t.state),r=e.computed(()=>t.state.status!==y.IDLE),{anchorRef:i,rect:p,viewportHeight:l}=lt(r),{isOpen:d,panelRef:m}=dt(c,i),E=e.computed(()=>d.value&&p.value!==void 0&&s(p.value,l.value)),b=e.computed(()=>p.value===void 0?void 0:a(p.value,l.value));return(u,S)=>{var k;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"anchorRef",ref:i},null,512),E.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.createElementVNode("div",{ref_key:"panelRef",ref:m,class:"dialog-search-panel",style:e.normalizeStyle(b.value)},[t.state.status===e.unref(y).LOADING?(e.openBlock(),e.createElementBlock("p",ut," Searching “"+e.toDisplayString(t.state.query)+"”… ",1)):t.state.status===e.unref(y).ERROR?(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("p",mt,e.toDisplayString(n(t.state.error)),1),e.createElementVNode("button",{type:"button",class:"dialog-search-retry",onClick:S[0]||(S[0]=w=>t.controller.retry())}," Retry ")])):t.state.status===e.unref(y).EMPTY?(e.openBlock(),e.createElementBlock("p",ht," No products match “"+e.toDisplayString((k=t.state.response)==null?void 0:k.query)+"”. ",1)):t.state.status===e.unref(y).SUCCESS&&t.state.response!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("p",_t,e.toDisplayString(t.state.response.nbHits)+" result"+e.toDisplayString(t.state.response.nbHits>1?"s":""),1),e.createElementVNode("ul",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.response.hits,(w,h)=>(e.openBlock(),e.createBlock(G,{key:w.objectID,controller:t.controller,hit:w,index:h,locale:t.locale},null,8,["controller","hit","index","locale"]))),128))]),e.createVNode(F,{controller:t.controller,state:t.state},null,8,["controller","state"])],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)],64)}}}),St=o=>{const{client:t,surface:n="search_page",...s}=o,a=de({search:(i,p)=>t.search(i,p),analytics:{surface:n,trackViewSearchResults:i=>t.trackViewSearchResults(i),trackSelectSearchResult:i=>t.trackSelectSearchResult(i)},...s}),c=e.shallowRef(a.getState()),r=a.subscribe(()=>{c.value=a.getState()});return e.onMounted(()=>{U({method:"vue",version:"3.6.0"})}),e.onUnmounted(()=>{r(),a.dispose()}),{controller:a,state:c}};g.DialogInput=H,g.DialogProductBlock=Oe,g.DialogSearchBar=ve,g.DialogSearchPagination=F,g.DialogSearchProductCard=G,g.DialogSearchResults=Et,g.useDialogSearch=St,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}));
19
+ 1.66666Z`,stroke:e.color||"#181825","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Ie)]),s[0]||(s[0]=t.createElementVNode("defs",null,[t.createElementVNode("clipPath",{id:"clip0_466_934"},[t.createElementVNode("rect",{width:"20",height:"20",fill:"white"})])],-1))]))}}),Le=["onClick"],Ve={class:"dialog-block-suggestions-item-label"},Ae=$(t.defineComponent({__name:"DialogBlockSuggestions",props:{client:{},questions:{},productId:{},productTitle:{},selectedVariantId:{}},setup(o){const e=o,n=s=>{e.client.sendProductMessage({productId:e.productId,productTitle:e.productTitle,selectedVariantId:e.selectedVariantId,question:s,fromQuestionSuggestion:!0})};return(s,c)=>(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.questions,r=>(t.openBlock(),t.createElementBlock("button",{key:r.question,class:"dialog-block-suggestions-item",onClick:a=>n(r.question)},[t.createVNode(Be,{class:"dialog-block-suggestions-item-icon",color:e.client.theme.primaryColor},null,8,["color"]),t.createElementVNode("span",Ve,t.toDisplayString(r.question),1)],8,Le))),128))}}),[["__scopeId","data-v-db34d4b4"]]),De={};function xe(o,e){return t.openBlock(),t.createElementBlock(t.Fragment,null,[e[0]||(e[0]=t.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1)),e[1]||(e[1]=t.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1)),e[2]||(e[2]=t.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1))],64)}const Pe=$(De,[["render",xe],["__scopeId","data-v-26a64b58"]]),Oe={class:"dialog-block-suggestions-container"},Me=$(t.defineComponent({__name:"DialogBlockSuggestionsContainer",props:{client:{},questions:{},isLoading:{type:Boolean},productId:{},productTitle:{},selectedVariantId:{}},setup(o){const e=o;return(n,s)=>(t.openBlock(),t.createElementBlock("div",Oe,[e.isLoading||!e.questions?(t.openBlock(),t.createBlock(Pe,{key:0})):(t.openBlock(),t.createBlock(Ae,{key:1,client:e.client,questions:e.questions,"product-id":e.productId,"product-title":e.productTitle,"selected-variant-id":e.selectedVariantId},null,8,["client","questions","product-id","product-title","selected-variant-id"]))]))}}),[["__scopeId","data-v-18c9e78b"]]),qe={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue=["stroke"],He=t.defineComponent({__name:"ArrowIcon",props:{color:{}},setup(o){const e=o;return(n,s)=>(t.openBlock(),t.createElementBlock("svg",qe,[t.createElementVNode("path",{d:"M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",stroke:e.color||"#ffffff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Ue)]))}}),Ke=["placeholder"],Fe=["disabled"],z=$(t.defineComponent({__name:"DialogInput",props:{client:{},placeholder:{},productId:{},productTitle:{},selectedVariantId:{}},setup(o){const e=o,n=t.ref(),s=t.ref(""),c=()=>{var a;(a=n.value)==null||a.focus()},r=()=>{const a=s.value;a.trim()&&(e.client.sendProductMessage({productId:e.productId,productTitle:e.productTitle,selectedVariantId:e.selectedVariantId,question:a,fromQuestionSuggestion:!0}),s.value="")};return(a,l)=>(t.openBlock(),t.createElementBlock("div",{class:"dialog-input-wrapper",onClick:c},[t.withDirectives(t.createElementVNode("input",{id:"dialog-ask-anything-input-ai-input",ref_key:"inputRef",ref:n,"onUpdate:modelValue":l[0]||(l[0]=p=>s.value=p),class:"dialog-ask-anything-input-ai-input",placeholder:e.placeholder??"Ask anything...",onKeydown:t.withKeys(r,["enter"])},null,40,Ke),[[t.vModelText,s.value]]),t.createElementVNode("button",{id:"send-message-button-ai-input",class:"dialog-input-submit",disabled:!s.value.trim(),onClick:r},[t.createVNode(He,{color:e.client.theme.ctaTextColor},null,8,["color"])],8,Fe)]))}}),[["__scopeId","data-v-4f5901c9"]]),je=t.defineComponent({__name:"ThemeProvider",props:{theme:{}},setup(o){const e=o,n=document.body,s=r=>r.replace(/([A-Z])/g,"-$1").toLowerCase(),c=r=>{r&&Object.keys(r).forEach(a=>{const l=a,p=s(a);if(r[l]!==void 0){if(typeof r[l]=="object"){Object.keys(r[l]).forEach(i=>{var m;const d=i;if(d!==void 0){const b=s(i),_=r[l];n.style.setProperty(`--dialog-theme-${p}-${b}`,(m=_[d])==null?void 0:m.toString())}});return}if(l==="ctaBorderType"){const i=r[l]==="rounded"?"24px":"0";n.style.setProperty(`--dialog-theme-${p}`,i);return}n.style.setProperty(`--dialog-theme-${p}`,r[l].toString())}})};return t.onMounted(()=>{e.theme&&c(e.theme)}),t.watch(()=>e.theme,r=>{r&&c(r)},{deep:!0}),(r,a)=>t.renderSlot(r.$slots,"default")}}),ze=["dir"],ve=$(t.defineComponent({__name:"DialogProductBlock",props:{client:{},productId:{},productTitle:{},selectedVariantId:{default:void 0},enableInput:{type:Boolean,default:!0}},setup(o){const e=o;t.onMounted(()=>{K({method:"vue",version:"3.7.0"}),de("pdp-block")});const n=t.ref(!0),s=t.ref(void 0),c=t.ref(0),r=t.computed(()=>{var d;return n.value?"":(d=s.value)==null?void 0:d.assistantName}),a=t.computed(()=>{var d;return n.value?"":(d=s.value)==null?void 0:d.description}),l=t.computed(()=>{var d;return n.value?"":(d=s.value)==null?void 0:d.inputPlaceholder}),p=t.computed(()=>{var d;return re((d=e.client.getLocalizationInformations())==null?void 0:d.languageCode)}),i=async()=>{const d=++c.value;n.value=!0,s.value=void 0;try{const m=await e.client.getSuggestions(e.productId);d===c.value&&(s.value=m)}catch(m){console.error("error",m)}finally{d===c.value&&(n.value=!1)}};return t.watch(()=>[e.client,e.productId],()=>{i()},{immediate:!0}),(d,m)=>(t.openBlock(),t.createBlock(je,{theme:e.client.theme},{default:t.withCtx(()=>{var b;return[t.createElementVNode("div",{id:"dialog-instant",class:"dialog-block-container",dir:p.value},[t.createVNode($e,{title:r.value,description:a.value},null,8,["title","description"]),t.createVNode(Me,{client:e.client,questions:(b=s.value)==null?void 0:b.questions,"is-loading":n.value,"product-id":e.productId,"product-title":e.productTitle,"selected-variant-id":e==null?void 0:e.selectedVariantId},null,8,["client","questions","is-loading","product-id","product-title","selected-variant-id"]),e.enableInput?(t.openBlock(),t.createBlock(z,{key:0,client:e.client,placeholder:l.value,"product-id":e.productId,"product-title":e.productTitle,"selected-variant-id":e==null?void 0:e.selectedVariantId},null,8,["client","placeholder","product-id","product-title","selected-variant-id"])):t.createCommentVNode("",!0)],8,ze)]}),_:1},8,["theme"]))}}),[["__scopeId","data-v-c57aa677"]]),Ge={},Qe={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"};function We(o,e){return t.openBlock(),t.createElementBlock("svg",Qe,e[0]||(e[0]=[t.createElementVNode("path",{d:"M8 13V3M8 3L3 8M8 3L13 8",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const Xe=$(Ge,[["render",We]]),Ze={width:"16",height:"16",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},Ye=["fill"],Je="M5.3217 0.588255C5.63241 -0.196084 6.36759 -0.196085 6.6783 0.588254C6.98901 1.37259 7.68193 2.82807 8.42693 3.57307C9.17193 4.31807 10.6274 5.01099 11.4117 5.3217C12.1961 5.63241 12.1961 6.36759 11.4117 6.6783C10.6274 6.98901 9.17193 7.68193 8.42693 8.42693C7.68193 9.17193 6.98901 10.6274 6.6783 11.4117C6.36759 12.1961 5.63241 12.1961 5.3217 11.4117C5.01099 10.6274 4.31807 9.17193 3.57307 8.42693C2.82808 7.68193 1.37259 6.98901 0.588255 6.6783C-0.196084 6.36759 -0.196085 5.63241 0.588254 5.3217C1.37259 5.01099 2.82807 4.31807 3.57307 3.57307C4.31807 2.82808 5.01099 1.37259 5.3217 0.588255Z",et=t.defineComponent({__name:"ShurikenIcon",props:{color:{}},setup(o){const e=o;return(n,s)=>(t.openBlock(),t.createElementBlock("svg",Ze,[t.createElementVNode("path",{d:Je,fill:e.color||"currentColor"},null,8,Ye)]))}}),tt={class:"dialog-search-bar-field"},ot={class:"dialog-search-bar-icon"},nt=["aria-label","placeholder","autofocus"],st=["aria-label"],rt=t.defineComponent({__name:"DialogSearchBar",props:{controller:{},placeholder:{default:"Search products..."},autoFocus:{type:Boolean,default:!1},submitAriaLabel:{default:"Search"}},setup(o){const e=o,n=t.ref(""),s=()=>{e.controller.setQuery(n.value)},c=()=>{e.controller.submit(n.value)};return(r,a)=>(t.openBlock(),t.createElementBlock("form",{class:"dialog-search-bar",role:"search",onSubmit:t.withModifiers(c,["prevent"])},[t.createElementVNode("div",tt,[t.createElementVNode("span",ot,[t.createVNode(et)]),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>n.value=l),type:"text",name:"dialog-search-query",class:"dialog-search-bar-input","aria-label":e.placeholder,placeholder:e.placeholder,autofocus:e.autoFocus,onInput:s},null,40,nt),[[t.vModelText,n.value]])]),t.createElementVNode("button",{type:"submit",class:"dialog-search-bar-submit","aria-label":e.submitAriaLabel},[t.createVNode(Xe)],8,st)],32))}}),ct=(o,e)=>{try{return new Intl.NumberFormat(e).format(o)}catch{return String(o)}},v={en:o=>({searching:e=>`Searching “${e}”…`,noResults:"No matching products",retry:"Retry",collectionsLabel:"Collections",productsLabel:"Products",collectionsCount:e=>e===1?"1 collection":`${o(e)} collections`,resultsCount:e=>e===1?"1 result":`${o(e)} results`,seeAllLabel:e=>e===1?"See the result":`See all ${o(e)} results`,previous:"Previous",next:"Next",pageOf:(e,n)=>`Page ${o(e)} / ${o(n)}`}),fr:o=>({searching:e=>`Recherche de « ${e} »…`,noResults:"Aucun produit correspondant",retry:"Réessayer",collectionsLabel:"Collections",productsLabel:"Produits",collectionsCount:e=>e===1?"1 collection":`${o(e)} collections`,resultsCount:e=>e===1?"1 résultat":`${o(e)} résultats`,seeAllLabel:e=>e===1?"Voir le résultat":`Voir les ${o(e)} résultats`,previous:"Précédent",next:"Suivant",pageOf:(e,n)=>`Page ${o(e)} / ${o(n)}`}),de:o=>({searching:e=>`Suche nach „${e}“…`,noResults:"Keine passenden Produkte",retry:"Erneut versuchen",collectionsLabel:"Kollektionen",productsLabel:"Produkte",collectionsCount:e=>e===1?"1 Kollektion":`${o(e)} Kollektionen`,resultsCount:e=>e===1?"1 Ergebnis":`${o(e)} Ergebnisse`,seeAllLabel:e=>e===1?"Das Ergebnis anzeigen":`Alle ${o(e)} Ergebnisse anzeigen`,previous:"Zurück",next:"Weiter",pageOf:(e,n)=>`Seite ${o(e)} / ${o(n)}`}),es:o=>({searching:e=>`Buscando «${e}»…`,noResults:"No hay productos que coincidan",retry:"Reintentar",collectionsLabel:"Colecciones",productsLabel:"Productos",collectionsCount:e=>e===1?"1 colección":`${o(e)} colecciones`,resultsCount:e=>e===1?"1 resultado":`${o(e)} resultados`,seeAllLabel:e=>e===1?"Ver el resultado":`Ver los ${o(e)} resultados`,previous:"Anterior",next:"Siguiente",pageOf:(e,n)=>`Página ${o(e)} / ${o(n)}`}),it:o=>({searching:e=>`Ricerca di “${e}”…`,noResults:"Nessun prodotto corrispondente",retry:"Riprova",collectionsLabel:"Collezioni",productsLabel:"Prodotti",collectionsCount:e=>e===1?"1 collezione":`${o(e)} collezioni`,resultsCount:e=>e===1?"1 risultato":`${o(e)} risultati`,seeAllLabel:e=>e===1?"Vedi il risultato":`Vedi tutti i ${o(e)} risultati`,previous:"Precedente",next:"Successivo",pageOf:(e,n)=>`Pagina ${o(e)} / ${o(n)}`})},G=o=>{var s;const e=((s=o==null?void 0:o.split("-")[0])==null?void 0:s.toLowerCase())??"en";return(v[e]??v.en)(c=>ct(c,o))},Q=o=>o.status!==w.LOADING&&o.response!==void 0&&o.response.nbPages>1,lt={key:0,"aria-label":"Search results pages",class:"dialog-search-pagination"},at=["disabled"],it=["disabled"],W=t.defineComponent({__name:"DialogSearchPagination",props:{controller:{},state:{},locale:{}},setup(o){const e=o,n=t.computed(()=>e.state.response),s=t.computed(()=>G(e.locale));return(c,r)=>n.value!==void 0&&t.unref(Q)(e.state)?(t.openBlock(),t.createElementBlock("nav",lt,[t.createElementVNode("button",{type:"button",disabled:n.value.page===0,onClick:r[0]||(r[0]=a=>e.controller.setPage(n.value.page-1))},t.toDisplayString(s.value.previous),9,at),t.createElementVNode("span",null,t.toDisplayString(s.value.pageOf(n.value.page+1,n.value.nbPages)),1),t.createElementVNode("button",{type:"button",disabled:n.value.page>=n.value.nbPages-1,onClick:r[1]||(r[1]=a=>e.controller.setPage(n.value.page+1))},t.toDisplayString(s.value.next),9,it)])):t.createCommentVNode("",!0)}}),X=o=>o.normalize("NFD").replace(new RegExp("\\p{M}","gu"),"").replace(/ẞ/gu,"ß").toUpperCase().toLowerCase().replace(/ς/g,"σ"),dt=(o,e)=>{const n={before:"",match:o,after:""},s=X(e.trim());if(s==="")return n;const c=[...o],r=[];let a="";c.forEach((d,m)=>{const b=X(d);for(let _=0;_<b.length;_+=1)r.push(m);a+=b});const l=a.indexOf(s);if(l===-1)return n;const p=r[l],i=r[l+s.length-1]+1;return{before:c.slice(0,p).join(""),match:c.slice(p,i).join(""),after:c.slice(i).join("")}},ut={key:0,class:"dialog-search-muted"},pt={class:"dialog-search-match"},mt={key:1,class:"dialog-search-muted"},Z=t.defineComponent({__name:"HighlightedTitle",props:{title:{},query:{}},setup(o){const e=o,n=t.computed(()=>dt(e.title,e.query));return(s,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[n.value.before!==""?(t.openBlock(),t.createElementBlock("span",ut,t.toDisplayString(n.value.before),1)):t.createCommentVNode("",!0),t.createElementVNode("span",pt,t.toDisplayString(n.value.match),1),n.value.after!==""?(t.openBlock(),t.createElementBlock("span",mt,t.toDisplayString(n.value.after),1)):t.createCommentVNode("",!0)],64))}}),ht=({amount:o,currencyCode:e},n)=>e===void 0?new Intl.NumberFormat(n).format(Number(o)):new Intl.NumberFormat(n,{style:"currency",currency:e}).format(Number(o)),ft=(o,e)=>{if(o===void 0)return"";try{return ht(o.min,e)}catch{return""}},gt=o=>{try{const{protocol:e}=new URL(o,window.location.href);return e==="http:"||e==="https:"?o:void 0}catch{return}},Y=o=>o.url===void 0||o.url===""?void 0:gt(o.url),J=o=>o.title??o.handle??o.objectID,_t={class:"dialog-search-product-thumb","aria-hidden":"true"},Et=["src"],bt={class:"dialog-search-product-title"},kt={key:0,class:"dialog-search-product-price"},ee=t.defineComponent({__name:"DialogSearchProductCard",props:{controller:{},hit:{},index:{},locale:{default:void 0},query:{default:""}},setup(o){const e=o,n=t.ref();t.watch(()=>e.hit,()=>{n.value!==void 0&&e.controller.observeResult(n.value,e.index)},{immediate:!0,flush:"post"});const s=t.computed(()=>Y(e.hit)),c=t.computed(()=>ft(e.hit.priceRange,e.locale)),r=l=>{const p=l.metaKey||l.ctrlKey||l.shiftKey||l.altKey;e.controller.selectResult(e.index,{navigate:!p})&&l.preventDefault()},a=l=>{l.button===1&&e.controller.selectResult(e.index,{navigate:!1})};return(l,p)=>(t.openBlock(),t.createElementBlock("li",{ref_key:"cardRef",ref:n,class:"dialog-search-card"},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.value===void 0?"div":"a"),t.mergeProps({class:"dialog-search-product",href:s.value},t.toHandlers(s.value===void 0?{}:{click:r,auxclick:a})),{default:t.withCtx(()=>[t.createElementVNode("span",_t,[e.hit.imageUrl!==void 0&&e.hit.imageUrl!==""?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.hit.imageUrl,alt:"",loading:"lazy"},null,8,Et)):t.createCommentVNode("",!0)]),t.createElementVNode("span",bt,[t.createVNode(Z,{title:t.unref(J)(e.hit),query:e.query},null,8,["title","query"])]),c.value!==""?(t.openBlock(),t.createElementBlock("span",kt,t.toDisplayString(c.value),1)):t.createCommentVNode("",!0)]),_:1},16,["href"]))],512))}}),Ct={},St={width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"};function yt(o,e){return t.openBlock(),t.createElementBlock("svg",St,e[0]||(e[0]=[t.createElementVNode("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"},null,-1)]))}const wt=$(Ct,[["render",yt]]),$t={},Nt={width:"12",height:"12",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"};function Tt(o,e){return t.openBlock(),t.createElementBlock("svg",Nt,e[0]||(e[0]=[t.createElementVNode("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"},null,-1)]))}const Rt=$($t,[["render",Tt]]),te=o=>(o??[]).flatMap(e=>{const n=Y(e);return n===void 0?[]:[{collection:e,href:n}]}),It={key:0,class:"dialog-search-collections"},Bt={class:"dialog-search-section-head"},Lt={class:"dialog-search-label"},Vt={class:"dialog-search-count"},At={class:"dialog-search-collection-list"},Dt=["href"],xt={class:"dialog-search-collection-thumb","aria-hidden":"true"},Pt=["src"],Ot={class:"dialog-search-collection-title"},Mt={class:"dialog-search-caret"},qt=t.defineComponent({__name:"DialogSearchCollections",props:{collections:{},query:{},messages:{}},setup(o){const e=o,n=t.computed(()=>te(e.collections));return(s,c)=>n.value.length>0?(t.openBlock(),t.createElementBlock("aside",It,[t.createElementVNode("div",Bt,[t.createElementVNode("p",Lt,t.toDisplayString(e.messages.collectionsLabel),1),t.createElementVNode("span",Vt,t.toDisplayString(e.messages.collectionsCount(n.value.length)),1)]),t.createElementVNode("ul",At,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,({collection:r,href:a})=>(t.openBlock(),t.createElementBlock("li",{key:r.objectID},[t.createElementVNode("a",{class:"dialog-search-collection",href:a},[t.createElementVNode("span",xt,[r.imageUrl!==void 0&&r.imageUrl!==""?(t.openBlock(),t.createElementBlock("img",{key:0,src:r.imageUrl,alt:"",loading:"lazy"},null,8,Pt)):t.createCommentVNode("",!0)]),t.createElementVNode("span",Ot,[t.createVNode(Z,{title:t.unref(J)(r),query:e.query},null,8,["title","query"])]),t.createElementVNode("span",Mt,[t.createVNode(Rt)])],8,Dt)]))),128))])])):t.createCommentVNode("",!0)}}),Ut={class:"dialog-search-products"},Ht={class:"dialog-search-section-head"},Kt={class:"dialog-search-label"},Ft={key:0,class:"dialog-search-label-count"},jt={class:"dialog-search-results"},zt={key:0,class:"dialog-search-empty",role:"status"},vt=t.defineComponent({__name:"DialogSearchProducts",props:{controller:{},response:{},locale:{},messages:{}},setup(o){const e=o;return(n,s)=>(t.openBlock(),t.createElementBlock("section",Ut,[t.createElementVNode("div",Ht,[t.createElementVNode("p",Kt,[t.createTextVNode(t.toDisplayString(e.messages.productsLabel),1),e.response.nbHits>0?(t.openBlock(),t.createElementBlock("span",Ft," · "+t.toDisplayString(e.messages.resultsCount(e.response.nbHits)),1)):t.createCommentVNode("",!0)])]),t.createElementVNode("ul",jt,[e.response.hits.length===0?(t.openBlock(),t.createElementBlock("li",zt,t.toDisplayString(e.messages.noResults),1)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(e.response.hits,(c,r)=>(t.openBlock(),t.createBlock(ee,{key:c.objectID,controller:e.controller,hit:c,index:r,locale:e.locale,query:e.response.query},null,8,["controller","hit","index","locale","query"]))),128))])]))}}),L=8,B=16,Gt=200,Qt=1440,Wt=(o,e)=>o.bottom>0&&o.top<e,Xt=(o,e)=>{const n=Math.min(Qt,e-2*B),s=o.left+o.width/2-n/2;return{left:`${Math.min(Math.max(s,B),e-B-n)}px`,width:`${n}px`}},Zt=(o,e,n)=>{const s=n-o.bottom-L-B,c=o.top-L-B,r=Xt(o,e);return s<Gt&&c>s?{...r,bottom:`${n-o.top+L}px`,maxHeight:`${Math.max(c,0)}px`}:{...r,top:`${o.bottom+L}px`,maxHeight:`${Math.max(s,0)}px`}},Yt=o=>{const e=o.trim().replace(/^#/,"");if(!/^(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e))return;const n=e.length<=4?[...e].map(s=>s+s).join(""):e;return[0,2,4].map(s=>Number.parseInt(n.slice(s,s+2),16))},Jt=o=>{const e=/^rgba?\((\d+), (\d+), (\d+)(?:, [\d.]+)?\)$/.exec(o);if(e!==null)return[e[1],e[2],e[3]].map(Number)},eo=o=>{if(typeof document>"u")return;const e=document.createElement("span");if(e.style.color=o,e.style.color==="")return;document.body.appendChild(e);const n=Jt(getComputedStyle(e).color);return e.remove(),n},to=o=>Yt(o)??eo(o),oo=o=>{const e=o/255;return e<=.03928?e/12.92:((e+.055)/1.055)**2.4},oe=o=>{const e=to(o);if(e===void 0)return;const[n,s,c]=e.map(oo);return .2126*n+.7152*s+.0722*c},no="#181825",so="#ffffff",ro="straight",x=.5,P={light:{panel:"#ffffff",side:"#fafbfc",text:"#111827","text-sec":"#6b7280",border:"#eceef2",hover:"#eef2f7",thumb:"#eef1f5"},dark:{panel:"#15171c",side:"#1b1e25",text:"#f3f4f6","text-sec":"#9ca3af",border:"#2b2f38",hover:"#242830",thumb:"#2b2f38"}},co={rectangle:{"r-panel":"4px","r-item":"4px","r-thumb":"2px","r-btn":"4px"},"rectangle-rounded":{"r-panel":"16px","r-item":"10px","r-thumb":"8px","r-btn":"10px"}},V=o=>o===void 0||o.trim()===""?void 0:o.trim(),lo=o=>{const e=o===void 0?void 0:oe(o);return e===void 0?"light":e<x?"dark":"light"},ao=(o,e)=>{const n=oe(o);return n===void 0?P[e].text:(e==="light"?n<x:n>=x)?o:P[e].text},io=o=>{const e=lo(V(o==null?void 0:o.backgroundColor)),n=(o==null?void 0:o.ctaBorderType)===ro?"rectangle":"rectangle-rounded",s=V(o==null?void 0:o.primaryColor)??no,c=V(o==null?void 0:o.fontFamily),r={...P[e],...co[n],primary:s,accent:ao(s,e),"cta-text":V(o==null?void 0:o.ctaTextColor)??so,...c===void 0?{}:{font:c}};return Object.fromEntries(Object.entries(r).map(([a,l])=>[`--dso-${a}`,l]))},uo=o=>{const e=t.ref(),n=t.ref(void 0),s=t.ref({width:0,height:0});return t.watch(o,(c,r,a)=>{if(!c)return;const l=()=>{const p=e.value;if(p===void 0)return;const i=p.previousElementSibling??p,{top:d,bottom:m,left:b,width:_}=i.getBoundingClientRect();(s.value.width!==window.innerWidth||s.value.height!==window.innerHeight)&&(s.value={width:window.innerWidth,height:window.innerHeight});const h=n.value;(h===void 0||h.top!==d||h.bottom!==m||h.left!==b||h.width!==_)&&(n.value={top:d,bottom:m,left:b,width:_})};l(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),a(()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)})},{immediate:!0,flush:"post"}),{anchorRef:e,rect:n,viewport:s}},po=(o,e)=>{const n=t.ref(!1),s=t.ref(),c=t.computed(()=>o.value.status!==w.IDLE&&!n.value);t.watch(()=>o.value.query,()=>{n.value=!1}),t.watch(c,(a,l,p)=>{if(!a)return;const i=d=>{var C,S;const m=d.target;if(!(m instanceof Node))return;const b=(C=e.value)==null?void 0:C.previousElementSibling,_=((S=s.value)==null?void 0:S.contains(m))??!1,h=(b==null?void 0:b.contains(m))??!1;!_&&!h&&(n.value=!0)};document.addEventListener("pointerdown",i),p(()=>document.removeEventListener("pointerdown",i))},{immediate:!0});const r=()=>{n.value=!1};return t.onMounted(()=>{var a,l;(l=(a=e.value)==null?void 0:a.previousElementSibling)==null||l.addEventListener("focusin",r)}),t.onUnmounted(()=>{var a,l;(l=(a=e.value)==null?void 0:a.previousElementSibling)==null||l.removeEventListener("focusin",r)}),{isOpen:c,panelRef:s}},mo={key:0,class:"dialog-search-error"},ho={role:"alert",class:"dialog-search-status dialog-search-status-error"},fo={key:1,role:"status",class:"dialog-search-status"},go={key:0,class:"dialog-search-footer"},_o=["href"],Eo=t.defineComponent({__name:"DialogSearchResults",props:{controller:{},state:{},locale:{default:void 0},theme:{default:void 0},layout:{default:"list"},seeAllHref:{type:Function,default:void 0}},setup(o){const e=o,n=u=>u instanceof ce?`Search failed (${u.status}${u.code?` ${u.code}`:""}): ${u.message}`:"Search failed: network error. Check your connection and try again.",s=t.computed(()=>e.state),c=t.computed(()=>e.state.status!==w.IDLE),{anchorRef:r,rect:a,viewport:l}=uo(c),{isOpen:p,panelRef:i}=po(s,r),d=t.computed(()=>p.value&&a.value!==void 0&&Wt(a.value,l.value.height)),m=t.computed(()=>io(e.theme)),b=t.computed(()=>({...a.value===void 0?{}:Zt(a.value,l.value.width,l.value.height),...m.value})),_=t.computed(()=>G(e.locale)),h=t.computed(()=>e.state.response),C=t.computed(()=>{var u,E;return((E=(u=e.state.sections)==null?void 0:u.collections)==null?void 0:E.hits)??[]}),S=t.computed(()=>te(C.value).length>0),y=t.computed(()=>e.seeAllHref!==void 0&&h.value!==void 0&&h.value.nbHits>0),g=t.computed(()=>!y.value&&Q(e.state)),f=t.computed(()=>{var u;return h.value===void 0||(u=e.seeAllHref)==null?void 0:u.call(e,h.value.query)});return(u,E)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{ref_key:"anchorRef",ref:r},null,512),d.value?(t.openBlock(),t.createBlock(t.Teleport,{key:0,to:"body"},[t.createElementVNode("div",{ref_key:"panelRef",ref:i,class:t.normalizeClass(["dialog-search-panel",`dialog-search-panel--${e.layout}`]),style:t.normalizeStyle(b.value)},[e.state.status===t.unref(w).ERROR?(t.openBlock(),t.createElementBlock("div",mo,[t.createElementVNode("p",ho,t.toDisplayString(n(e.state.error)),1),t.createElementVNode("button",{type:"button",class:"dialog-search-retry",onClick:E[0]||(E[0]=T=>e.controller.retry())},t.toDisplayString(_.value.retry),1)])):h.value===void 0?(t.openBlock(),t.createElementBlock("p",fo,t.toDisplayString(_.value.searching(e.state.query)),1)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",{class:t.normalizeClass(["dialog-search-body",{"dialog-search-body--no-collections":!S.value}])},[t.createVNode(qt,{collections:C.value,query:h.value.query,messages:_.value},null,8,["collections","query","messages"]),t.createVNode(vt,{controller:e.controller,response:h.value,locale:e.locale,messages:_.value},null,8,["controller","response","locale","messages"])],2),y.value||g.value?(t.openBlock(),t.createElementBlock("div",go,[y.value?(t.openBlock(),t.createElementBlock("a",{key:0,class:"dialog-search-cta",href:f.value},[t.createTextVNode(t.toDisplayString(_.value.seeAllLabel(h.value.nbHits))+" ",1),t.createVNode(wt)],8,_o)):(t.openBlock(),t.createBlock(W,{key:1,controller:e.controller,state:e.state,locale:e.locale},null,8,["controller","state","locale"]))])):t.createCommentVNode("",!0)],64))],6)])):t.createCommentVNode("",!0)],64))}}),bo=o=>{const{client:e,surface:n="search_page",...s}=o,c=ke({search:(l,p)=>e.search(l,p),analytics:{surface:n,trackViewSearchResults:l=>e.trackViewSearchResults(l),trackSelectSearchResult:l=>e.trackSelectSearchResult(l)},...s}),r=t.shallowRef(c.getState()),a=c.subscribe(()=>{r.value=c.getState()});return t.onMounted(()=>{K({method:"vue",version:"3.7.0"})}),t.onUnmounted(()=>{a(),c.dispose()}),{controller:c,state:r,theme:e.theme}};k.DialogInput=z,k.DialogProductBlock=ve,k.DialogSearchBar=rt,k.DialogSearchPagination=W,k.DialogSearchProductCard=ee,k.DialogSearchResults=Eo,k.useDialogSearch=bo,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@askdialog/dialog-vue",
3
3
  "private": false,
4
- "version": "3.6.0",
4
+ "version": "3.7.0",
5
5
  "type": "module",
6
6
  "main": "./dist/dialog-vue.umd.js",
7
7
  "module": "./dist/dialog-vue.js",
@@ -29,7 +29,7 @@
29
29
  "eslint-plugin-vue": "^10.0.0",
30
30
  "vite-plugin-eslint": "^1.8.1",
31
31
  "vue-tsc": "^2.2.4",
32
- "@askdialog/dialog-sdk": "2.12.0"
32
+ "@askdialog/dialog-sdk": "2.13.0"
33
33
  },
34
34
  "author": "Dialog",
35
35
  "publishConfig": {