UNPKG

@relewise/web-components

Version:

Relewise is a next generation personalization SaaS-platform, which offers functionality within product- and content recommendations and personalized search. Our official Web Components provide simple and easy components for rendering personalized experien

426 lines (395 loc) 251 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).RelewiseWebComponents={})}(this,function(e){"use strict";function t(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o}"function"==typeof SuppressedError&&SuppressedError; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const i=globalThis,s=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let o=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(s&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=n.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(t,e))}return e}toString(){return this.cssText}};const l=(e,...t)=>{const i=1===e.length?e[0]:t.reduce((t,i,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[s+1],e[0]);return new o(i,e,r)},a=(e,t)=>{if(s)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const s of t){const t=document.createElement("style"),r=i.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=s.cssText,e.appendChild(t)}},c=s?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new o("string"==typeof e?e:e+"",void 0,r))(t)})(e):e,{is:d,defineProperty:u,getOwnPropertyDescriptor:h,getOwnPropertyNames:p,getOwnPropertySymbols:g,getPrototypeOf:w}=Object,y=globalThis,v=y.trustedTypes,m=v?v.emptyScript:"",f=y.reactiveElementPolyfillSupport,b=(e,t)=>e,C={toAttribute(e,t){switch(t){case Boolean:e=e?m:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},R=(e,t)=>!d(e,t),P={attribute:!0,type:String,converter:C,reflect:!1,useDefault:!1,hasChanged:R}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */Symbol.metadata??=Symbol("metadata"),y.litPropertyMetadata??=new WeakMap;let S=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=P){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);void 0!==s&&u(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:r}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){const n=s?.call(this);r?.call(this,t),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??P}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const e=w(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const e=this.properties,t=[...p(e),...g(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(c(e))}else void 0!==e&&t.push(c(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return a(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:C).toAttribute(t,i.type);this._$Em=e,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){const i=this.constructor,s=i._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=i.getPropertyOptions(s),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:C;this._$Em=s;const n=r.fromAttribute(t,e.type);this[s]=n??this._$Ej?.get(s)??n,this._$Em=null}}requestUpdate(e,t,i){if(void 0!==e){const s=this.constructor,r=this[e];if(i??=s.getPropertyOptions(e),!((i.hasChanged??R)(r,t)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:r},n){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,n??t??this[e]),!0!==r||void 0!==n)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===s&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,i,s)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[b("elementProperties")]=new Map,S[b("finalized")]=new Map,f?.({ReactiveElement:S}),(y.reactiveElementVersions??=[]).push("2.1.1"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const F=globalThis,$=F.trustedTypes,k=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,B="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,I="?"+A,x=`<${I}>`,E=document,D=()=>E.createComment(""),q=e=>null===e||"object"!=typeof e&&"function"!=typeof e,V=Array.isArray,T="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,U=/>/g,L=RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),_=/'/g,j=/"/g,N=/^(?:script|style|textarea|title)$/i,H=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),z=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),W=new WeakMap,Q=E.createTreeWalker(E,129);function Z(e,t){if(!V(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(t):t}const J=(e,t)=>{const i=e.length-1,s=[];let r,n=2===t?"<svg>":3===t?"<math>":"",o=O;for(let t=0;t<i;t++){const i=e[t];let l,a,c=-1,d=0;for(;d<i.length&&(o.lastIndex=d,a=o.exec(i),null!==a);)d=o.lastIndex,o===O?"!--"===a[1]?o=M:void 0!==a[1]?o=U:void 0!==a[2]?(N.test(a[2])&&(r=RegExp("</"+a[2],"g")),o=L):void 0!==a[3]&&(o=L):o===L?">"===a[0]?(o=r??O,c=-1):void 0===a[1]?c=-2:(c=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?L:'"'===a[3]?j:_):o===j||o===_?o=L:o===M||o===U?o=O:(o=L,r=void 0);const u=o===L&&e[t+1].startsWith("/>")?" ":"";n+=o===O?i+x:c>=0?(s.push(l),i.slice(0,c)+B+i.slice(c)+A+u):i+A+(-2===c?t:u)}return[Z(e,n+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]};class Y{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,n=0;const o=e.length-1,l=this.parts,[a,c]=J(e,t);if(this.el=Y.createElement(a,i),Q.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=Q.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(B)){const t=c[n++],i=s.getAttribute(e).split(A),o=/([.?@])?(.*)/.exec(t);l.push({type:1,index:r,name:o[2],strings:i,ctor:"."===o[1]?ie:"?"===o[1]?se:"@"===o[1]?re:te}),s.removeAttribute(e)}else e.startsWith(A)&&(l.push({type:6,index:r}),s.removeAttribute(e));if(N.test(s.tagName)){const e=s.textContent.split(A),t=e.length-1;if(t>0){s.textContent=$?$.emptyScript:"";for(let i=0;i<t;i++)s.append(e[i],D()),Q.nextNode(),l.push({type:2,index:++r});s.append(e[t],D())}}}else if(8===s.nodeType)if(s.data===I)l.push({type:2,index:r});else{let e=-1;for(;-1!==(e=s.data.indexOf(A,e+1));)l.push({type:7,index:r}),e+=A.length-1}r++}}static createElement(e,t){const i=E.createElement("template");return i.innerHTML=e,i}}function G(e,t,i=e,s){if(t===z)return t;let r=void 0!==s?i._$Co?.[s]:i._$Cl;const n=q(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),void 0===n?r=void 0:(r=new n(e),r._$AT(e,i,s)),void 0!==s?(i._$Co??=[])[s]=r:i._$Cl=r),void 0!==r&&(t=G(e,r._$AS(e,t.values),r,s)),t}class X{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,s=(e?.creationScope??E).importNode(t,!0);Q.currentNode=s;let r=Q.nextNode(),n=0,o=0,l=i[0];for(;void 0!==l;){if(n===l.index){let t;2===l.type?t=new ee(r,r.nextSibling,this,e):1===l.type?t=new l.ctor(r,l.name,l.strings,this,e):6===l.type&&(t=new ne(r,this,e)),this._$AV.push(t),l=i[++o]}n!==l?.index&&(r=Q.nextNode(),n++)}return Q.currentNode=E,s}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class ee{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=G(this,e,t),q(e)?e===K||null==e||""===e?(this._$AH!==K&&this._$AR(),this._$AH=K):e!==this._$AH&&e!==z&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>V(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==K&&q(this._$AH)?this._$AA.nextSibling.data=e:this.T(E.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,s="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Y.createElement(Z(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{const e=new X(s,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=W.get(e.strings);return void 0===t&&W.set(e.strings,t=new Y(e)),t}k(e){V(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const r of e)s===t.length?t.push(i=new ee(this.O(D()),this.O(D()),this,this.options)):i=t[s],i._$AI(r),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class te{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,r){this.type=1,this._$AH=K,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=K}_$AI(e,t=this,i,s){const r=this.strings;let n=!1;if(void 0===r)e=G(this,e,t,0),n=!q(e)||e!==this._$AH&&e!==z,n&&(this._$AH=e);else{const s=e;let o,l;for(e=r[0],o=0;o<r.length-1;o++)l=G(this,s[i+o],t,o),l===z&&(l=this._$AH[o]),n||=!q(l)||l!==this._$AH[o],l===K?e=K:e!==K&&(e+=(l??"")+r[o+1]),this._$AH[o]=l}n&&!s&&this.j(e)}j(e){e===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ie extends te{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===K?void 0:e}}class se extends te{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==K)}}class re extends te{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=G(this,e,t,0)??K)===z)return;const i=this._$AH,s=e===K&&i!==K||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==K&&(i===K||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ne{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){G(this,e)}}const oe=F.litHtmlPolyfillSupport;oe?.(Y,ee),(F.litHtmlVersions??=[]).push("3.3.1");const le=globalThis; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */let ae=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const s=i?.renderBefore??t;let r=s._$litPart$;if(void 0===r){const e=i?.renderBefore??null;s._$litPart$=r=new ee(t.insertBefore(D(),e),e,void 0,i??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};ae._$litElement$=!0,ae.finalized=!0,le.litElementHydrateSupport?.({LitElement:ae});const ce=le.litElementPolyfillSupport;ce?.({LitElement:ae}),(le.litElementVersions??=[]).push("4.2.1"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const de={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:R},ue=(e=de,t,i)=>{const{kind:s,metadata:r}=i;let n=globalThis.litPropertyMetadata.get(r);if(void 0===n&&globalThis.litPropertyMetadata.set(r,n=new Map),"setter"===s&&((e=Object.create(e)).wrapped=!0),n.set(i.name,e),"accessor"===s){const{name:s}=i;return{set(i){const r=t.get.call(this);t.set.call(this,i),this.requestUpdate(s,r,e)},init(t){return void 0!==t&&this.C(s,void 0,e,t),t}}}if("setter"===s){const{name:s}=i;return function(i){const r=this[s];t.call(this,i),this.requestUpdate(s,r,e)}}throw Error("Unsupported decorator location: "+s)};function he(e){return(t,i)=>"object"==typeof i?ue(e,t,i):((e,t,i)=>{const s=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),s?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function pe(e){return he({...e,state:!0,attribute:!1})}function ge(){const e=window.relewiseUIOptions;if(!(e&&e.datasetId&&e.apiKey&&e.contextSettings))throw new Error("Relewise UI not correctly configured");return e}function we(){return window.relewiseUISearchOptions}function ye(){return window.relewiseUISearchTargetedConfigurations}function ve(){return window.relewiseUIRecommendationTargetedConfigurations}async function me(e){const t=ge().contextSettings,i=await t.getUser();return{currency:t.currency,displayedAtLocation:e,language:t.language,user:i}}function fe(e){if(!e)return"";const t=ge().contextSettings;try{return new Intl.NumberFormat(t.language,{style:"currency",currency:t.currency}).format(Number(e))}catch{return e}}function be(e){if("string"!=typeof e)return e;if("undefined"!=typeof document){const t=document.createElement("div");return t.innerHTML=e,t.textContent??t.innerText??""}return console.error("Relewise web component: stripHtmlClientSide can only be executed in a browser environment. Returning the raw string."),e}const Ce={stripHtmlClientSide:be},Re=l` :host { font-size: var(--relewise-base-font-size, 16px); --font: var(--relewise-font, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); --color: var(--relewise-color, #eee); --accent-color:var(--relewise-accent-color, #3764e4); --relewise-icon-color: var(--color); --relewise-x-icon-color: var(--color); --border-radius: var(--relewise-border-radius, 1em); --border: var(--relewise-border, 1px solid) } .rw-button { margin: 0; padding: 0; font-family: var(--font); height: var(--relewise-button-height, 3em); border: var(--border); border-radius: var(--border-radius); border-color: var(--accent-color); background-color: var(--accent-color); font-size: var(--relewise-button-font-size, 1em); } .rw-border { border: var(--border); border-radius: var(--border-radius) } ` /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */,Pe=2,Se=e=>(...t)=>({_$litDirective$:e,values:t});let Fe=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},$e=class extends Fe{constructor(e){if(super(e),this.it=K,e.type!==Pe)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===K||null==e)return this._t=void 0,this.it=e;if(e===z)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */$e.directiveName="unsafeHTML",$e.resultType=1;const ke=Se($e),Be=(e,t)=>{const i=e._$AN;if(void 0===i)return!1;for(const e of i)e._$AO?.(t,!1),Be(e,t);return!0},Ae=e=>{let t,i;do{if(void 0===(t=e._$AM))break;i=t._$AN,i.delete(e),e=t}while(0===i?.size)},Ie=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(void 0===i)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),De(t)}}; /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function xe(e){void 0!==this._$AN?(Ae(this),this._$AM=e,Ie(this)):this._$AM=e}function Ee(e,t=!1,i=0){const s=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(s))for(let e=i;e<s.length;e++)Be(s[e],!1),Ae(s[e]);else null!=s&&(Be(s,!1),Ae(s));else Be(this,e)}const De=e=>{e.type==Pe&&(e._$AP??=Ee,e._$AQ??=xe)};class qe extends Fe{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),Ie(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Be(this,e),Ae(this))}setValue(e){if((e=>void 0===e.strings)(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */let Ve=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},Te=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const Oe=e=>!(e=>null===e||"object"!=typeof e&&"function"!=typeof e)(e)&&"function"==typeof e.then,Me=1073741823;const Ue=Se(class extends qe{constructor(){super(...arguments),this._$Cwt=Me,this._$Cbt=[],this._$CK=new Ve(this),this._$CX=new Te}render(...e){return e.find(e=>!Oe(e))??z}update(e,t){const i=this._$Cbt;let s=i.length;this._$Cbt=t;const r=this._$CK,n=this._$CX;this.isConnected||this.disconnected();for(let e=0;e<t.length&&!(e>this._$Cwt);e++){const o=t[e];if(!Oe(o))return this._$Cwt=e,o;e<s&&o===i[e]||(this._$Cwt=Me,s=0,Promise.resolve(o).then(async e=>{for(;n.get();)await n.get();const t=r.deref();if(void 0!==t){const i=t._$Cbt.indexOf(o);i>-1&&i<t._$Cwt&&(t._$Cwt=i,t.setValue(e))}}))}return z}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}});class Le extends ae{constructor(){super(...arguments),this.product=null,this.user=null}createRenderRoot(){const e=super.createRenderRoot();if(e instanceof ShadowRoot){let t=!1;try{const e=ge();t=Boolean(e.templates?.product)}catch(e){console.error("Relewise: Error initializing initializeRelewiseUI. Keeping default styles, ",e)}t||a(e,Le.defaultStyles)}return e}connectedCallback(){super.connectedCallback()}render(){if(!this.product)return;const e=ge();if(e.templates?.product){const t=e.templates.product(this.product,{html:H,helpers:{...Ce,formatPrice:fe,unsafeHTML:ke,nothing:K,user:this.user}}),i=t instanceof Promise?H` ${Ue(t.then(e=>(e===K&&this.toggleAttribute("hidden",!0),e)))}`:t;return t===K&&this.toggleAttribute("hidden",!0),H`${i}`}const t=this.product.data&&"Url"in this.product.data?this.product.data.Url.value??"":null,i=e.userEngagement?.product;return H` <div class='rw-tile'> ${i?.favorite?H`<relewise-product-favorite-button .product=${this.product} .user=${this.user}> </relewise-product-favorite-button>`:K} ${t?H`<a class='rw-tile-link' href=${t}>${this.renderTileContent(this.product)}</a>`:H`<div class='rw-tile-link'>${this.renderTileContent(this.product)}</div>`} ${i?.sentiment?H`<relewise-product-sentiment-buttons .product=${this.product} .user=${this.user}> </relewise-product-sentiment-buttons>`:K} </div>`}renderTileContent(e){return H` ${e.data&&"ImageUrl"in e.data?H`<div class="rw-image-container"><img class="rw-object-cover" src=${e.data.ImageUrl.value} alt=${this.getProductImageAlt(e)} /></div>`:K} <div class='rw-information-container'> <h5 class='rw-display-name'>${e.displayName}</h5> <div class='rw-price'> <span>${fe(e.salesPrice)}</span> ${e.salesPrice&&e.listPrice&&e.listPrice!==e.salesPrice?H`<span class='rw-list-price'>${fe(e.listPrice)}</span>`:K} </div> </div>`}getProductImageAlt(e){return e.variant?.displayName??e.displayName??""??""}static{this.defaultStyles=[Re,l` :host { font-family: var(--font); border: 1px solid var(--relewise-checklist-facet-border-color, #eee); background-color: var(--button-color, white); clip-path: inset(0 round 0.5em); border-radius: 0.5em; box-shadow: 0 1px rgb(0 0 0 / 0.05); } .rw-tile { display: flex; flex-direction: column; position: relative; text-decoration: inherit; text-size-adjust: none; height: 100%; gap: var(--relewise-sentiment-gap, 0.5em); } .rw-tile-link { display: flex; flex-direction: column; text-decoration: inherit; color: inherit; flex: 1; } .rw-tile-link:focus-visible { outline: 2px solid var(--relewise-focus-outline-color, #000); outline-offset: 2px; } .rw-image-container { display: flex; padding: var(--relewise-image-padding, 0); background-color: var(--relewise-image-background-color, #fff); justify-content: var(--relewise-image-align, center); } .rw-information-container { margin: var(--relewise-information-container-margin, 0.5em 0.5em); } .rw-object-cover { object-fit: contain; max-width: var(--relewise-image-width, 100%); height: var(--relewise-image-height, auto); } .rw-price { line-height: 1; display: flex; font-weight: var(--relewise-sales-price-font-weight, 300); font-size: var(--relewise-sales-price-font-size, 1em); color: var(--relewise-sales-price-color, #212427); justify-content: var(--relewise-sales-price-alignment, start); align-items:center; margin: var(--relewise-sales-price-margin, 1em 0em 0em 0em); } .rw-display-name { display: -webkit-box; letter-spacing: var(--relewise-display-name-letter-spacing, -0.025em); justify-content: var(--relewise-display-name-alignment, start); color: var(--relewise-display-name-color, #212427); line-height: var(--relewise-display-name-line-height, 1); font-weight: var(--relewise-display-name-font-weight, 500); font-size: var(--relewise-display-name-font-size, 1em); margin: var(--relewise-display-name-margin, 0em 0em 0em 0em); overflow: hidden; height: calc(var(--relewise-display-name-line-height, 1.05em)* 2); -webkit-box-orient: vertical; -webkit-line-clamp: 2; } .rw-list-price { font-size: var(--relewise-list-price-font-size, 1em); text-decoration: var(--relewise-list-price-text-decoration, line-through); font-weight: 400; color: var(--relewise-list-price-color, #bbb); margin: var(--relewise-list-price-margin, 0em 0em 0em 0.5em); } `]}}t([he({type:Object})],Le.prototype,"product",void 0),t([he({type:Object})],Le.prototype,"user",void 0);class _e extends ae{constructor(){super(...arguments),this.content=null,this.user=null}createRenderRoot(){const e=super.createRenderRoot();if(e instanceof ShadowRoot){let t=!1;try{const e=ge();t=Boolean(e.templates?.content)}catch(e){console.error("Relewise: Error initializing initializeRelewiseUI. Keeping default styles, ",e)}t||a(e,_e.defaultStyles)}return e}connectedCallback(){super.connectedCallback()}render(){if(!this.content)return;const e=ge();if(e.templates?.content){const t=e.templates.content(this.content,{html:H,helpers:{...Ce,unsafeHTML:ke,nothing:K,user:this.user}}),i=t instanceof Promise?H` ${Ue(t.then(e=>(e===K&&this.toggleAttribute("hidden",!0),e)))}`:t;return t===K&&this.toggleAttribute("hidden",!0),H`${i}`}const t=this.content.data&&"Url"in this.content.data?this.content.data.Url.value??"":null,i=e.userEngagement?.content;return H` <div class="rw-content-tile${i?.favorite?" --rw-has-favorite":""}"> ${i?.favorite?H`<relewise-content-favorite-button .content=${this.content} .user=${this.user}> </relewise-content-favorite-button>`:K} ${t?H`<a class='rw-content-link' href=${t}>${this.renderTileContent(this.content)}</a>`:H`<div class='rw-content-link'>${this.renderTileContent(this.content)}</div>`} ${i?.sentiment?H`<relewise-content-sentiment-buttons .content=${this.content} .user=${this.user}> </relewise-content-sentiment-buttons>`:K} </div>`}renderTileContent(e){const t=e.data&&"ImageUrl"in e.data?e.data.ImageUrl.value:null,i=e.data&&"Summary"in e.data?e.data.Summary.value:null;return H` <div class="rw-image-container"> ${t?H`<img class="rw-object-cover" src=${t} alt=${this.getContentImageAlt(e)} />`:K} </div> <div class='rw-information-container'> <h5 class='rw-display-name'>${e.displayName}</h5> ${i?H`<p class="rw-summary">${i}</p>`:K} </div>`}getContentImageAlt(e){return e.displayName??""??""}static{this.defaultStyles=[Re,l` :host { font-family: var(--font); border: 1px solid var(--relewise-checklist-facet-border-color, #eee); background-color: var(--button-color, white); clip-path: inset(0 round 0.5em); border-radius: 0.5em; box-shadow: 0 1px rgb(0 0 0 / 0.05); } .rw-content-tile { display: flex; flex-direction: column; position: relative; text-decoration: inherit; text-size-adjust: none; height: 100%; gap: var(--relewise-sentiment-gap, 0.5em); } .rw-content-link { display: flex; flex-direction: column; text-decoration: inherit; color: inherit; flex: 1; justify-content: flex-end; } .rw-content-link:focus-visible { outline: 2px solid var(--relewise-focus-outline-color, #000); outline-offset: 2px; } .rw-image-container { display: flex; padding: var(--relewise-image-padding, 0); background-color: var(--relewise-image-background-color, #fff); justify-content: var(--relewise-image-align, center); } .rw-information-container { margin: var(--relewise-information-container-margin, 0.5em 0.5em); } .--rw-has-favorite .rw-display-name { margin-right: var(--relewise-favorite-space, 2.1em); } .rw-object-cover { object-fit: contain; max-width: var(--relewise-image-width, 100%); height: var(--relewise-image-height, auto); } .rw-display-name { display: -webkit-box; letter-spacing: var(--relewise-display-name-letter-spacing, -0.025em); justify-content: var(--relewise-display-name-alignment, start); color: var(--relewise-display-name-color, #212427); line-height: var(--relewise-display-name-line-height, 1); font-weight: var(--relewise-display-name-font-weight, 500); font-size: var(--relewise-display-name-font-size, 1em); margin: var(--relewise-display-name-margin, 0em 0em 0em 0em); overflow: hidden; height: calc(var(--relewise-display-name-line-height, 1.05em) * 2); -webkit-box-orient: vertical; -webkit-line-clamp: 2; } .rw-summary { margin: 0; font-size: calc(var(--relewise-base-font-size, 16px) * 0.9); line-height: var(--relewise-summary-line-height, 1.2); color: var(--relewise-summary-color, #666); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; height: calc(var(--relewise-summary-line-height, 1.25em) * 2); } `]}}t([he({type:Object})],_e.prototype,"content",void 0),t([he({type:Object})],_e.prototype,"user",void 0);class je extends ae{connectedCallback(){super.connectedCallback()}render(){return H` <svg part="icon" id="svg-icon" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="122.879px" height="119.799px" viewBox="0 0 122.879 119.799" enable-background="new 0 0 122.879 119.799" xml:space="preserve"> <g> <path d="M49.988,0h0.016v0.007C63.803,0.011,76.298,5.608,85.34,14.652c9.027,9.031,14.619,21.515,14.628,35.303h0.007v0.033v0.04 h-0.007c-0.005,5.557-0.917,10.905-2.594,15.892c-0.281,0.837-0.575,1.641-0.877,2.409v0.007c-1.446,3.66-3.315,7.12-5.547,10.307 l29.082,26.139l0.018,0.016l0.157,0.146l0.011,0.011c1.642,1.563,2.536,3.656,2.649,5.78c0.11,2.1-0.543,4.248-1.979,5.971 l-0.011,0.016l-0.175,0.203l-0.035,0.035l-0.146,0.16l-0.016,0.021c-1.565,1.642-3.654,2.534-5.78,2.646 c-2.097,0.111-4.247-0.54-5.971-1.978l-0.015-0.011l-0.204-0.175l-0.029-0.024L78.761,90.865c-0.88,0.62-1.778,1.209-2.687,1.765 c-1.233,0.755-2.51,1.466-3.813,2.115c-6.699,3.342-14.269,5.222-22.272,5.222v0.007h-0.016v-0.007 c-13.799-0.004-26.296-5.601-35.338-14.645C5.605,76.291,0.016,63.805,0.007,50.021H0v-0.033v-0.016h0.007 c0.004-13.799,5.601-26.296,14.645-35.338C23.683,5.608,36.167,0.016,49.955,0.007V0H49.988L49.988,0z M50.004,11.21v0.007h-0.016 h-0.033V11.21c-10.686,0.007-20.372,4.35-27.384,11.359C15.56,29.578,11.213,39.274,11.21,49.973h0.007v0.016v0.033H11.21 c0.007,10.686,4.347,20.367,11.359,27.381c7.009,7.012,16.705,11.359,27.403,11.361v-0.007h0.016h0.033v0.007 c10.686-0.007,20.368-4.348,27.382-11.359c7.011-7.009,11.358-16.702,11.36-27.4h-0.006v-0.016v-0.033h0.006 c-0.006-10.686-4.35-20.372-11.358-27.384C70.396,15.56,60.703,11.213,50.004,11.21L50.004,11.21z"/> </g> </svg>`}static{this.styles=l` :host { line-height: 1; width: var(--relewise-icon-width, 1em); height: var(--relewise-icon-height, 1em); } #svg-icon { width: var(--relewise-icon-width, 1em); height: var(--relewise-icon-height, 1em); fill: var(--relewise-icon-color); } `}}class Ne extends ae{connectedCallback(){super.connectedCallback()}render(){return H` <svg part="icon" id="svg-icon" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="122.879px" height="119.799px" viewBox="0 0 122.879 119.799" enable-background="new 0 0 122.879 119.799" xml:space="preserve"> <g> <path d="M1.426,8.313c-1.901-1.901-1.901-4.984,0-6.886c1.901-1.902,4.984-1.902,6.886,0l53.127,53.127l53.127-53.127 c1.901-1.902,4.984-1.902,6.887,0c1.901,1.901,1.901,4.985,0,6.886L68.324,61.439l53.128,53.128c1.901,1.901,1.901,4.984,0,6.886 c-1.902,1.902-4.985,1.902-6.887,0L61.438,68.326L8.312,121.453c-1.901,1.902-4.984,1.902-6.886,0 c-1.901-1.901-1.901-4.984,0-6.886l53.127-53.128L1.426,8.313L1.426,8.313z"/> </g> </svg> `}static{this.styles=l` :host { line-height: 1; width: var(--relewise-icon-width, 1em); height: var(--relewise-icon-height, 1em); } #svg-icon { width: var(--relewise-icon-width, 1em); height: var(--relewise-icon-height, 1em); fill: var(--relewise-icon-color); } `}}class He extends ae{connectedCallback(){super.connectedCallback()}render(){return H` <svg id="svg-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M3 7C3 6.44772 3.44772 6 4 6H20C20.5523 6 21 6.44772 21 7C21 7.55228 20.5523 8 20 8H4C3.44772 8 3 7.55228 3 7ZM6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12ZM9 17C9 16.4477 9.44772 16 10 16H14C14.5523 16 15 16.4477 15 17C15 17.5523 14.5523 18 14 18H10C9.44772 18 9 17.5523 9 17Z"/> </svg>`}static{this.styles=l` :host { line-height: 1; width: var(--relewise-icon-width, 1em); height: var(--relewise-icon-height, 1em); } #svg-icon { width: var(--relewise-icon-width, 1em); height: var(--relewise-icon-height, 1em); fill: var(--relewise-icon-color); } `}}class ze extends ae{connectedCallback(){super.connectedCallback()}render(){return H` <svg id="svg-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12 13.125C12.3013 13.125 12.5733 13.3052 12.6907 13.5827C12.8081 13.8601 12.7482 14.1808 12.5384 14.3971L8.53844 18.5221C8.39719 18.6678 8.20293 18.75 8.00002 18.75C7.79711 18.75 7.60285 18.6678 7.46159 18.5221L3.46159 14.3971C3.25188 14.1808 3.19192 13.8601 3.30934 13.5827C3.42676 13.3052 3.69877 13.125 4.00002 13.125H7.25002V6C7.25002 5.58579 7.5858 5.25 8.00002 5.25C8.41423 5.25 8.75002 5.58579 8.75002 6V13.125H12Z"/> <path d="M20 10.875C20.3013 10.875 20.5733 10.6948 20.6907 10.4173C20.8081 10.1399 20.7482 9.81916 20.5384 9.60289L16.5384 5.47789C16.3972 5.33222 16.2029 5.25 16 5.25C15.7971 5.25 15.6029 5.33222 15.4616 5.47789L11.4616 9.60289C11.2519 9.81916 11.1919 10.1399 11.3093 10.4173C11.4268 10.6948 11.6988 10.875 12 10.875H15.25V18C15.25 18.4142 15.5858 18.75 16 18.75C16.4142 18.75 16.75 18.4142 16.75 18L16.75 10.875H20Z"/> </svg> `}static{this.styles=l` :host { line-height: 1; width: var(--relewise-icon-width, 1em); height: var(--relewise-icon-height, 1em); } #svg-icon { width: var(--relewise-icon-width, 1em); height: var(--relewise-icon-height, 1em); fill: var(--relewise-icon-color); } `}}class Ke extends ae{constructor(){super(...arguments),this.buttonText=null,this.handleClick=()=>{}}connectedCallback(){super.connectedCallback()}render(){return H` <button class="rw-button rw-border" @click=${()=>this.handleClick()}> ${this.buttonText?H` <span class="rw-button-text">${this.buttonText}</span> `:K} <span class="rw-button-icon"><slot slot="icon"></slot></span> </button> `}static{this.styles=[Re,l` :host { font-family: var(--font); cursor: pointer; display: block; width: fit-content; height: fit-content; margin: auto; } .rw-button { cursor: pointer; height: inherit; width: inherit; color: white; display: flex; align-items: center; padding: inherit; font-weight: var(--relewise-button-text-font-weight, 600); border-color: var(--relewise-button-border-color, #eee); background-color: var(--button-color, white); color: var(--relewise-button-text-color, #333); border-radius: 0.5em; box-shadow: 0 1px rgb(0 0 0 / 0.05); font-size: 0.9em; justify-content: center; } .rw-button-text { align-items: center; justify-content: center; display: flex; line-height: 1em; padding: .5em .25rem; width: 100%; text-align: left; line-height: 1; } .rw-button-icon { padding: var(--relewise-button-icon-padding, 0.3em .8em); --relewise-icon-color: white; line-height: 1; } `]}}t([he({attribute:"button-text"})],Ke.prototype,"buttonText",void 0),t([he()],Ke.prototype,"handleClick",void 0);class We extends ae{render(){return H`<div class="loader"></div>`}static{this.styles=[Re,l` .loader { border: 16px solid var(--color); border-top: 16px solid; border-radius: 50%; border-top-color: var(--accent-color); width: 120px; height: 120px; animation: spin 2s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }`]}}class Qe{constructor(){this.fillScope=void 0,this.defaultScope=void 0}fill({apply:e}){return this.fillScope={$type:"Relewise.Client.Requests.Filters.Settings.ApplyFilterSettings, Relewise.Client",apply:e},this}default({apply:e}){return this.defaultScope={$type:"Relewise.Client.Requests.Filters.Settings.ApplyFilterSettings, Relewise.Client",apply:e},this}build(){return this.fillScope||this.defaultScope?{fill:this.fillScope,default:this.defaultScope}:null}}class Ze{constructor(){this.scopesBuilder=new Qe}scopes(e){return e(this.scopesBuilder),this}build(){const e=this.scopesBuilder.build();return e?{scopes:e}:null}}class Je{constructor(){this.conditions=[]}addContainsCondition(e,t,i="All",s,r=!1){const n={$type:"Relewise.Client.Requests.Filters.DataObjects.Conditions.ObjectValueContainsCondition, Relewise.Client",key:e,value:t,objectPath:s,mode:i,negated:r};return this.conditions.push(n),this}addEqualsCondition(e,t,i,s=!1){const r={$type:"Relewise.Client.Requests.Filters.DataObjects.Conditions.ObjectValueEqualsCondition, Relewise.Client",value:t,objectPath:i,negated:s,key:e};return this.conditions.push(r),this}addInRangeCondition(e,t,i,s=!1){const r={$type:"Relewise.Client.Requests.Filters.DataObjects.Conditions.ObjectValueInRangeCondition, Relewise.Client",range:t,key:e,objectPath:i,negated:s};return this.conditions.push(r),this}addGreaterThanCondition(e,t,i,s=!1){const r={$type:"Relewise.Client.Requests.Filters.DataObjects.Conditions.ObjectValueGreaterThanCondition, Relewise.Client",value:t,negated:s,key:e,objectPath:i};return this.conditions.push(r),this}addLessThanCondition(e,t,i,s=!1){const r={$type:"Relewise.Client.Requests.Filters.DataObjects.Conditions.ObjectValueLessThanCondition, Relewise.Client",value:t,negated:s,key:e,objectPath:i};return this.conditions.push(r),this}addMinByCondition(e,t,i=!1){const s={$type:"Relewise.Client.Requests.Filters.DataObjects.Conditions.ObjectValueMinByCondition, Relewise.Client",negated:i,key:e,objectPath:t};return this.conditions.push(s),this}addMaxByCondition(e,t,i=!1){const s={$type:"Relewise.Client.Requests.Filters.DataObjects.Conditions.ObjectValueMaxByCondition, Relewise.Client",negated:i,key:e,objectPath:t};return this.conditions.push(s),this}addObjectValueIsSubsetOfCondition(e,t,i,s=!1){const r={$type:"Relewise.Client.Requests.Filters.DataObjects.Conditions.ObjectValueIsSubsetOfCondition, Relewise.Client",value:t,key:e,objectPath:i,negated:s};return this.conditions.push(r),this}build(){return 0===this.conditions.length?null:this.conditions}}class Ye{constructor(e){this.TFilterBuilderCtor=e,this.filters=[]}and(e,t=!1,i){var s;const r=new this.TFilterBuilderCtor;e(r);const n=new Ze;null===(s=null==i?void 0:i.filterSettings)||void 0===s||s.call(i,n);const o=r.build();if(null===o||!o.items||o.items.length<=0)throw new Error("And-filters must contain at least 1 filter");const l={$type:"Relewise.Client.Requests.Filters.AndFilter, Relewise.Client",filters:o.items,negated:t,settings:n.build()};return this.filters.push(l),this}or(e,t=!1,i){var s;const r=new this.TFilterBuilderCtor;e(r);const n=new Ze;null===(s=null==i?void 0:i.filterSettings)||void 0===s||s.call(i,n);const o=r.build();if(null===o||!o.items||o.items.length<=0)throw new Error("Or-filters must contain at least 1 filter");const l={$type:"Relewise.Client.Requests.Filters.OrFilter, Relewise.Client",filters:o.items,negated:t,settings:n.build()};return this.filters.push(l),this}reset(){return this.filters=[],this}build(){return 0===this.filters.length?null:{items:this.filters}}}class Ge{constructor(){this.conditions=[]}addContainsCondition(e,t="All",i=!1){const s={$type:"Relewise.Client.Requests.Conditions.ContainsCondition, Relewise.Client",value:e,valueCollectionEvaluationMode:t,negated:i};return this.conditions.push(s),this}addDistinctCondition(e,t=!1){const i={$type:"Relewise.Client.Requests.Conditions.DistinctCondition, Relewise.Client",numberOfOccurrencesAllowedWithTheSameValue:e,negated:t};return this.conditions.push(i),this}addEqualsCondition(e,t=!1){const i={$type:"Relewise.Client.Requests.Conditions.EqualsCondition, Relewise.Client",value:e,negated:t};return this.conditions.push(i),this}addGreaterThanCondition(e,t=!1){const i={$type:"Relewise.Client.Requests.Conditions.GreaterThanCondition, Relewise.Client",value:e,negated:t};return this.conditions.push(i),this}addLessThanCondition(e,t=!1){const i={$type:"Relewise.Client.Requests.Conditions.LessThanCondition, Relewise.Client",value:e,negated:t};return this.conditions.push(i),this}addDataObjectCondition(e,t,i,s=!1){const r=new Je;e(r);const n={$type:"Relewise.Client.Requests.Conditions.ContainsCondition, Relewise.Client",objectFilter:{conditions:r.build(),skip:t,take:i},valueCollectionEvaluationMode:"All",negated:s};return this.conditions.push(n),this}addHasValueCondition(e=!1){const t={$type:"Relewise.Client.Requests.Conditions.HasValueCondition, Relewise.Client",negated:e};return this.conditions.push(t),this}addRelativeDateTimeCondition(e,t,i=0,s=!1){const r={$type:"Relewise.Client.Requests.Conditions.RelativeDateTimeCondition, Relewise.Client",comparison:e,currentTimeOffset:i,unit:t,negated:s};return this.conditions.push(r),this}build(){return 0===this.conditions.length?null:{items:this.conditions}}}class Xe extends Ye{constructor(){super(Xe)}addBrandAssortmentFilter(e,t=!1,i){var s;const r=Array.isArray(e)?e:[e],n=new Ze;null===(s=null==i?void 0:i.filterSettings)||void 0===s||s.call(i,n);const o={$type:"Relewise.Client.Requests.Filters.BrandAssortmentFilter, Relewise.Client",assortments:r,negated:t,settings:n.build()};return this.filters.push(o),this}addBrandIdFilter(e,t=!1,i){var s;const r=Array.isArray(e)?e:[e],n=new Ze;null===(s=null==i?void 0:i.filterSettings)||void 0===s||s.call(i,n);const o={$type:"Relewise.Client.Requests.Filters.BrandIdFilter, Relewise.Client",brandIds:r,negated:t,settings:n.build()};return this.filters.push(o),this}addBrandDataFilter(e,t,i=!0,s=!0,r=!1,n){var o;const l=new Ge;t(l);const a=new Ze;null===(o=null==n?void 0:n.filterSettings)||void 0===o||o.call(n,a);const c={$type:"Relewise.Client.Requests.Filters.BrandDataFilter, Relewise.Client",key:e,filterOutIfKeyIsNotFound:s,mustMatchAllConditions:i,conditions:l.build(),negated:r,objectPath:null==n?void 0:n.objectPath,settings:a.build()};return this.filters.push(c),this}addBrandDataHasKeyFilter(e,t=!1,i){var s;const r=new Ze;null===(s=null==i?void 0:i.filterSettings)||void 0===s||s.call(i,r);const n={$type:"Relewise.Client.Requests.Filters.BrandDataHasKeyFilter, Relewise.Client",key:e,negated:t,settings:r.build()};return this.filters.push(n),this}addBrandDisabledFilter(e=!1,t){var i;const s=new Ze;null===(i=null==t?void 0:t.filterSettings)||void 0===i||i.call(t,s);const r={$type:"Relewise.Client.Requests.Filters.BrandDisabledFilter, Relewise.Client",negated:e,settings:s.build()};return this.filters.push(r),this}}class et extends Ye{constructor(){super(et)}addCompanyIdFilter(e,t=!1,i){var s;const r=Array.isArray(e)?e:[e],n=new Ze;null===(s=null==i?void 0:i.filterSettings)||void 0===s||s.call(i,n);const o={$type:"Relewise.Client.Requests.Filters.CompanyIdFilter, Relewise.Client",companyIds:r,negated:t,settings:n.build()};return this.filters.push(o),this}addCompanyDataFilter(e,t,i=!0,s=!0,r=!1,n){var o;const l=new Ge;t(l);const a=new Ze;null===(o=null==n?void 0:n.filterSettings)||void 0===o||o.call(n,a);const c={$type:"Relewise.Client.Requests.Filters.CompanyDataFilter, Relewise.Client",key:e,filterOutIfKeyIsNotFound:s,mustMatchAllConditions:i,conditions:l.build(),negated:r,objectPath:null==n?void 0:n.objectPath,settings:a.build()};return this.filters.push(c),this}addCompanyDataHasKeyFilter(e,t=!1,i){var s;const r=new Ze;null===(s=null==i?void 0:i.filterSettings)||void 0===s||s.call(i,r);const n={$type:"Relewise.Client.Requests.Filters.CompanyDataHasKeyFilter, Relewise.Client",key:e,negated:t,settings:r.build()};return this.filters.push(n),this}addCompanyDisabledFilter(e=!1,t){var i;const s=new Ze;null===(i=null==t?void 0:t.filterSettings)||void 0===i||i.call(t,s);const r={$type:"Relewise.Client.Requests.Filters.CompanyDisabledFilter, Relewise.Client",negated:e,settings:s.build()};return this.filters.push(r),this}}class tt extends Ye{constructor(){super(tt)}addContentAs