vviinn-widgets 2.221.0 → 2.222.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 (36) hide show
  1. package/dist/cjs/{index-sL3iGA57.js → index-RlbsyJJk.js} +1 -1
  2. package/dist/cjs/{search.store-C-fS-eJR.js → search.store-D4WiAMcl.js} +1 -1
  3. package/dist/cjs/vviinn-button_6.cjs.entry.js +1 -1
  4. package/dist/cjs/vviinn-camera_12.cjs.entry.js +109 -66
  5. package/dist/cjs/vviinn-carousel_10.cjs.entry.js +2 -2
  6. package/dist/cjs/vviinn-shop-the-look.cjs.entry.js +1 -1
  7. package/dist/cjs/vviinn-text-search.cjs.entry.js +1 -1
  8. package/dist/collection/components/vviinn-suggestions/helpers.js +27 -10
  9. package/dist/collection/components/vviinn-suggestions/render-helpers.js +42 -15
  10. package/dist/esm/{index-D5yWioO8.js → index-CEzGPs5u.js} +1 -1
  11. package/dist/esm/{search.store-C8LIDQfX.js → search.store-Cgs5icgA.js} +1 -1
  12. package/dist/esm/vviinn-button_6.entry.js +1 -1
  13. package/dist/esm/vviinn-camera_12.entry.js +109 -66
  14. package/dist/esm/vviinn-carousel_10.entry.js +2 -2
  15. package/dist/esm/vviinn-shop-the-look.entry.js +1 -1
  16. package/dist/esm/vviinn-text-search.entry.js +1 -1
  17. package/dist/types/components/vviinn-suggestions/helpers.d.ts +1 -0
  18. package/dist/vviinn-widgets/{p-e7b0a5b9.entry.js → p-0b7e8e2e.entry.js} +1 -1
  19. package/dist/vviinn-widgets/{p-f46ad1fd.entry.js → p-818a1e53.entry.js} +1 -1
  20. package/dist/vviinn-widgets/{p-BpHXy3Gg.js → p-B246LK7U.js} +1 -1
  21. package/dist/vviinn-widgets/{p-DTASrq1W.js → p-Cxd6yzhY.js} +1 -1
  22. package/dist/vviinn-widgets/{p-95423f25.entry.js → p-c1eac87b.entry.js} +1 -1
  23. package/dist/vviinn-widgets/{p-07211a51.entry.js → p-df4365fb.entry.js} +1 -1
  24. package/{www/build/p-f48452fd.entry.js → dist/vviinn-widgets/p-df9a1d66.entry.js} +1 -1
  25. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  26. package/package.json +1 -1
  27. package/www/build/{p-e7b0a5b9.entry.js → p-0b7e8e2e.entry.js} +1 -1
  28. package/www/build/{p-f46ad1fd.entry.js → p-818a1e53.entry.js} +1 -1
  29. package/www/build/{p-BpHXy3Gg.js → p-B246LK7U.js} +1 -1
  30. package/www/build/{p-DTASrq1W.js → p-Cxd6yzhY.js} +1 -1
  31. package/www/build/{p-95423f25.entry.js → p-c1eac87b.entry.js} +1 -1
  32. package/www/build/{p-07211a51.entry.js → p-df4365fb.entry.js} +1 -1
  33. package/{dist/vviinn-widgets/p-f48452fd.entry.js → www/build/p-df9a1d66.entry.js} +1 -1
  34. package/www/build/{p-2d5777fa.js → p-e969c76d.js} +1 -1
  35. package/www/build/vviinn-widgets.esm.js +1 -1
  36. package/www/index.html +1 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-BU8FMTXn.js');
4
- var search_store = require('./search.store-C-fS-eJR.js');
4
+ var search_store = require('./search.store-D4WiAMcl.js');
5
5
  var store = require('./store-jPZ4ROqV.js');
6
6
 
7
7
  const PlusIcon = () => (index.h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "plus-icon", "aria-hidden": "true" },
@@ -8598,7 +8598,7 @@ const encodeToBase64UTF8 = (str) => {
8598
8598
  return btoa(String.fromCharCode.apply(null, utf8Array));
8599
8599
  };
8600
8600
 
8601
- const version = "2.221.0";
8601
+ const version = "2.222.0";
8602
8602
 
8603
8603
  const appStateGlobalDefaults = {
8604
8604
  excluded: null,
@@ -2,7 +2,7 @@
2
2
 
3
3
  var index = require('./index-BU8FMTXn.js');
4
4
  var store = require('./store-jPZ4ROqV.js');
5
- var search_store = require('./search.store-C-fS-eJR.js');
5
+ var search_store = require('./search.store-D4WiAMcl.js');
6
6
  var index$1 = require('./index-CP1QUrJT.js');
7
7
  var SecondaryActionIcon = require('./SecondaryActionIcon-CuNEBTWD.js');
8
8
  var index$2 = require('./index-BF9aENF8.js');
@@ -2,9 +2,9 @@
2
2
 
3
3
  var index = require('./index-BU8FMTXn.js');
4
4
  var Rectangle = require('./Rectangle-7dF6_xf3.js');
5
- var search_store = require('./search.store-C-fS-eJR.js');
5
+ var search_store = require('./search.store-D4WiAMcl.js');
6
6
  var index$2 = require('./index-CP1QUrJT.js');
7
- var index$1 = require('./index-sL3iGA57.js');
7
+ var index$1 = require('./index-RlbsyJJk.js');
8
8
  var store = require('./store-jPZ4ROqV.js');
9
9
  var cropperUtils = require('./cropperUtils-DCDOLeBS.js');
10
10
  var cssUrlHelper = require('./cssUrlHelper-B5A2BBm7.js');
@@ -1444,6 +1444,72 @@ ${e}</tr>
1444
1444
  `}strong({tokens:e}){return `<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return `<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return `<code>${O(e,true)}</code>`}br(e){return "<br>"}del({tokens:e}){return `<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=J(e);if(i===null)return r;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+O(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=J(e);if(i===null)return O(n);e=i;let s=`<img src="${e}" alt="${O(n)}"`;return t&&(s+=` title="${O(t)}"`),s+=">",s}text(e){return "tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:O(e.text)}};var $=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return ""+e}image({text:e}){return ""+e}br(){return ""}checkbox({raw:e}){return e}};var b=class u{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $;}static parse(e,t){return new u(t).parse(e)}static parseInline(e,t){return new u(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let s=r,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==false||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){t+=a||"";continue}}let i=r;switch(i.type){case "space":{t+=this.renderer.space(i);break}case "hr":{t+=this.renderer.hr(i);break}case "heading":{t+=this.renderer.heading(i);break}case "code":{t+=this.renderer.code(i);break}case "table":{t+=this.renderer.table(i);break}case "blockquote":{t+=this.renderer.blockquote(i);break}case "list":{t+=this.renderer.list(i);break}case "checkbox":{t+=this.renderer.checkbox(i);break}case "html":{t+=this.renderer.html(i);break}case "def":{t+=this.renderer.def(i);break}case "paragraph":{t+=this.renderer.paragraph(i);break}case "text":{t+=this.renderer.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let s=i;switch(s.type){case "escape":{n+=t.text(s);break}case "html":{n+=t.html(s);break}case "link":{n+=t.link(s);break}case "image":{n+=t.image(s);break}case "checkbox":{n+=t.checkbox(s);break}case "strong":{n+=t.strong(s);break}case "em":{n+=t.em(s);break}case "codespan":{n+=t.codespan(s);break}case "br":{n+=t.br(s);break}case "del":{n+=t.del(s);break}case "text":{n+=t.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}};var P=class{options;block;constructor(e){this.options=e||T;}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?x.lex:x.lexInline}provideParser(){return this.block?b.parse:b.parseInline}};var D=class{defaults=M();options=this.setOptions;parse=this.parseMarkdown(true);parseInline=this.parseMarkdown(false);Parser=b;Renderer=y;TextRenderer=$;Lexer=x;Tokenizer=w;Hooks=P;constructor(...e){this.use(...e);}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case "table":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,t));break}case "list":{let i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t));}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)));}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||false,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===false&&(o=s.apply(this,a)),o}:t.renderers[i.name]=i.renderer;}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]));}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens);}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new y(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===false&&(c=l.apply(i,p)),c||""};}r.renderer=i;}if(n.tokenizer){let i=this.defaults.tokenizer||new w(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===false&&(c=l.apply(i,p)),c};}r.tokenizer=i;}if(n.hooks){let i=this.defaults.hooks||new P;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];P.passThroughHooks.has(s)?i[a]=p=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(s))return (async()=>{let d=await o.call(i,p);return l.call(i,d)})();let c=o.call(i,p);return l.call(i,c)}:i[a]=(...p)=>{if(this.defaults.async)return (async()=>{let d=await o.apply(i,p);return d===false&&(d=await l.apply(i,p)),d})();let c=o.apply(i,p);return c===false&&(c=l.apply(i,p)),c};}r.hooks=i;}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o};}this.defaults={...this.defaults,...r};}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return (n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===true&&i.async===false)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return (async()=>{let o=s.hooks?await s.hooks.preprocess(n):n,p=await(s.hooks?await s.hooks.provideLexer():e?x.lex:x.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(p):p;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?b.parse:b.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=(s.hooks?s.hooks.provideLexer():e?x.lex:x.lexInline)(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=(s.hooks?s.hooks.provideParser():e?b.parse:b.parseInline)(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+=`
1445
1445
  Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+O(n.message+"",true)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}};var L=new D;function g(u,e){return L.parse(u,e)}g.options=g.setOptions=function(u){return L.setOptions(u),g.defaults=L.defaults,G(g.defaults),g};g.getDefaults=M;g.defaults=T;g.use=function(...u){return L.use(...u),g.defaults=L.defaults,G(g.defaults),g};g.walkTokens=function(u,e){return L.walkTokens(u,e)};g.parseInline=L.parseInline;g.Parser=b;g.parser=b.parse;g.Renderer=y;g.TextRenderer=$;g.Lexer=x;g.lexer=x.lex;g.Tokenizer=w;g.Hooks=P;g.parse=g;
1446
1446
 
1447
+ const toggleFilterInSet = (appliedFilters, suggestionText) => {
1448
+ const newAppliedFilters = new Set(appliedFilters);
1449
+ if (newAppliedFilters.has(suggestionText)) {
1450
+ newAppliedFilters.delete(suggestionText);
1451
+ }
1452
+ else {
1453
+ newAppliedFilters.add(suggestionText);
1454
+ }
1455
+ return newAppliedFilters;
1456
+ };
1457
+ const formatIntervalKey = (column, start, end) => `${column}:${start}-${end}`;
1458
+ const extractActiveFilterValues = (activeFilters) => {
1459
+ const activeValues = new Set();
1460
+ activeFilters.forEach((filter) => {
1461
+ if (!Array.isArray(filter.values))
1462
+ return;
1463
+ filter.values.forEach((v) => {
1464
+ // Interval values are `{start, end}` objects; categorical values are strings.
1465
+ if (v !== null && typeof v === "object" && "start" in v) {
1466
+ activeValues.add(formatIntervalKey(filter.column, v.start, v.end));
1467
+ }
1468
+ else {
1469
+ activeValues.add(`${filter.column}:${String(v)}`);
1470
+ }
1471
+ });
1472
+ });
1473
+ return activeValues;
1474
+ };
1475
+ const syncSuggestionFilters = (activeFilters, stream) => {
1476
+ var _a, _b, _c;
1477
+ const activeValues = extractActiveFilterValues(activeFilters);
1478
+ const updatedAppliedFilters = new Set();
1479
+ if (!(stream === null || stream === void 0 ? void 0 : stream.items))
1480
+ return updatedAppliedFilters;
1481
+ for (const item of stream.items) {
1482
+ if (item.role !== "assistant" || !item.parts)
1483
+ continue;
1484
+ for (const part of item.parts) {
1485
+ if (!((_a = part.text) === null || _a === void 0 ? void 0 : _a.annotations))
1486
+ continue;
1487
+ for (const annotation of part.text.annotations) {
1488
+ if (!((_c = (_b = annotation.interactions) === null || _b === void 0 ? void 0 : _b.dynamicFilters) === null || _c === void 0 ? void 0 : _c.length))
1489
+ continue;
1490
+ for (const filter of annotation.interactions.dynamicFilters) {
1491
+ if (filter.type === "categorical" && "values" in filter) {
1492
+ filter.values.forEach((value) => {
1493
+ if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
1494
+ updatedAppliedFilters.add(`${filter.column}:${value.value}`);
1495
+ }
1496
+ });
1497
+ }
1498
+ else if (filter.type === "interval" && "selectedValues" in filter) {
1499
+ filter.selectedValues.forEach((interval) => {
1500
+ const key = formatIntervalKey(filter.column, interval.start, interval.end);
1501
+ if (activeValues.has(key)) {
1502
+ updatedAppliedFilters.add(key);
1503
+ }
1504
+ });
1505
+ }
1506
+ }
1507
+ }
1508
+ }
1509
+ }
1510
+ return updatedAppliedFilters;
1511
+ };
1512
+
1447
1513
  const extractDataItems = (annotation) => annotation.data.items;
1448
1514
  const findMatchingFilterValue = (item, filter) => {
1449
1515
  if (filter.type !== "categorical" ||
@@ -1464,18 +1530,38 @@ const applyFiltersForItems = (dataItems, interactions, currentRequestFilters, ha
1464
1530
  let updatedFilters = currentRequestFilters;
1465
1531
  if (dataItems.length === 0) {
1466
1532
  for (const filter of filters) {
1467
- if (filter.type !== "categorical" || !("values" in filter))
1468
- continue;
1469
- for (const filterValue of filter.values) {
1470
- updatedFilters = index$1.triggerFilter({
1471
- filterValue: filterValue,
1472
- selectedFilter: filter,
1473
- requestFilters: updatedFilters,
1474
- vviinnFilterTriggered: handlers.vviinnFilterTriggered,
1475
- vviinnFiltersChanged: handlers.vviinnFiltersChanged,
1476
- el: handlers.el,
1477
- isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
1478
- });
1533
+ if (filter.type === "categorical" && "values" in filter) {
1534
+ for (const filterValue of filter.values) {
1535
+ updatedFilters = index$1.triggerFilter({
1536
+ filterValue: filterValue,
1537
+ selectedFilter: filter,
1538
+ requestFilters: updatedFilters,
1539
+ vviinnFilterTriggered: handlers.vviinnFilterTriggered,
1540
+ vviinnFiltersChanged: handlers.vviinnFiltersChanged,
1541
+ el: handlers.el,
1542
+ isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
1543
+ });
1544
+ }
1545
+ }
1546
+ else if (filter.type === "interval" && "selectedValues" in filter) {
1547
+ // A suggestion chip represents one specific range to toggle, not a slider.
1548
+ // The backend emits `full === selectedValues[0]`, which would make
1549
+ // `isFullRangeInterval` read every click as "cleared to the full range"
1550
+ // (deselect-only). Neutralize `full` so the shared toggle logic selects /
1551
+ // deselects this exact interval by value match. Only the object passed to
1552
+ // `triggerFilter` is affected; `value` still carries the real interval.
1553
+ const chipFilter = Object.assign(Object.assign({}, filter), { full: { start: undefined, end: undefined } });
1554
+ for (const interval of filter.selectedValues) {
1555
+ updatedFilters = index$1.triggerFilter({
1556
+ filterValue: { interval },
1557
+ selectedFilter: chipFilter,
1558
+ requestFilters: updatedFilters,
1559
+ vviinnFilterTriggered: handlers.vviinnFilterTriggered,
1560
+ vviinnFiltersChanged: handlers.vviinnFiltersChanged,
1561
+ el: handlers.el,
1562
+ isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
1563
+ });
1564
+ }
1479
1565
  }
1480
1566
  }
1481
1567
  return updatedFilters;
@@ -1524,9 +1610,15 @@ const splitContentByLocators = (content, annotations) => {
1524
1610
  };
1525
1611
  const getAnnotationFilterKeys = (annotation) => {
1526
1612
  var _a, _b, _c;
1527
- return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => "values" in filter
1528
- ? filter.values.map((v) => `${filter.column}:${v.value}`)
1529
- : [])) !== null && _c !== void 0 ? _c : [];
1613
+ return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => {
1614
+ if (filter.type === "categorical" && "values" in filter) {
1615
+ return filter.values.map((v) => `${filter.column}:${v.value}`);
1616
+ }
1617
+ if (filter.type === "interval" && "selectedValues" in filter) {
1618
+ return filter.selectedValues.map((interval) => formatIntervalKey(filter.column, interval.start, interval.end));
1619
+ }
1620
+ return [];
1621
+ })) !== null && _c !== void 0 ? _c : [];
1530
1622
  };
1531
1623
  const getAnnotationDeeplink = (annotation) => {
1532
1624
  for (const item of annotation.data.items) {
@@ -1553,55 +1645,6 @@ const renderAnnotatedContent = (content, annotations, onAnnotationClick, applied
1553
1645
  };
1554
1646
  const renderInfoText = (content, key) => (index.h("div", { class: "suggestion-info-text", part: "suggestion-info-text", key: key, innerHTML: g.parse(content) }));
1555
1647
 
1556
- const toggleFilterInSet = (appliedFilters, suggestionText) => {
1557
- const newAppliedFilters = new Set(appliedFilters);
1558
- if (newAppliedFilters.has(suggestionText)) {
1559
- newAppliedFilters.delete(suggestionText);
1560
- }
1561
- else {
1562
- newAppliedFilters.add(suggestionText);
1563
- }
1564
- return newAppliedFilters;
1565
- };
1566
- const extractActiveFilterValues = (activeFilters) => {
1567
- const activeValues = new Set();
1568
- activeFilters.forEach((filter) => {
1569
- if (Array.isArray(filter.values)) {
1570
- filter.values.forEach((v) => activeValues.add(`${filter.column}:${String(v)}`));
1571
- }
1572
- });
1573
- return activeValues;
1574
- };
1575
- const syncSuggestionFilters = (activeFilters, stream) => {
1576
- var _a, _b, _c;
1577
- const activeValues = extractActiveFilterValues(activeFilters);
1578
- const updatedAppliedFilters = new Set();
1579
- if (!(stream === null || stream === void 0 ? void 0 : stream.items))
1580
- return updatedAppliedFilters;
1581
- for (const item of stream.items) {
1582
- if (item.role !== "assistant" || !item.parts)
1583
- continue;
1584
- for (const part of item.parts) {
1585
- if (!((_a = part.text) === null || _a === void 0 ? void 0 : _a.annotations))
1586
- continue;
1587
- for (const annotation of part.text.annotations) {
1588
- if (!((_c = (_b = annotation.interactions) === null || _b === void 0 ? void 0 : _b.dynamicFilters) === null || _c === void 0 ? void 0 : _c.length))
1589
- continue;
1590
- for (const filter of annotation.interactions.dynamicFilters) {
1591
- if (filter.type !== "categorical" || !("values" in filter))
1592
- continue;
1593
- filter.values.forEach((value) => {
1594
- if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
1595
- updatedAppliedFilters.add(`${filter.column}:${value.value}`);
1596
- }
1597
- });
1598
- }
1599
- }
1600
- }
1601
- }
1602
- return updatedAppliedFilters;
1603
- };
1604
-
1605
1648
  const vviinnSuggestionsCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:contents}.container{display:flex;flex-direction:column;gap:var(--spacing-150);font-family:var(--font-family, var(--font-family-base));padding-right:var(--spacing-100);line-height:normal}.header{display:flex;align-items:center;gap:var(--spacing-100)}.icon{font-size:20px}.title{margin:0;font-size:var(--font-size-headline);line-height:var(--line-height-headline);font-weight:600;color:var(--color-text-primary)}.suggestions-wrapper{display:flex;flex-direction:column;gap:var(--spacing-100);width:100%}.suggestions-list{list-style:none;margin:0;padding:0;padding-right:var(--spacing-100);display:flex;align-items:center;gap:var(--spacing-100);flex-wrap:wrap;font-size:var(--font-size-label)}.suggestion-item{display:contents}.suggestion-link{background:none;border:none;color:var(--color-primary-500);text-decoration:underline;cursor:pointer;font-size:inherit;line-height:inherit;padding:0;margin:0}.suggestion-link:hover{color:var(--color-primary-600)}.suggestion-link:focus{outline:2px solid var(--color-primary-500);outline-offset:2px;border-radius:2px}.suggestion-filter-button{background:none;border:none;cursor:pointer;display:flex;align-items:center;height:36px;padding:var(--spacing-75);gap:var(--spacing-50);white-space:nowrap;border-radius:var(--border-radius-100);background-color:var(--surface-bg-color-01);transition:background-color 0.1s;font-family:var(--font-family, var(--font-family-base));font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-filter-button:hover{background-color:var(--surface-bg-color-01-hover)}.suggestion-filter-button.active{background:var(--surface-bg-color-inverse);color:var(--color-text-inverse)}.suggestion-info-text{font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-info-text *{font-size:var(--font-size-label);margin:0}";
1606
1649
 
1607
1650
  const VviinnSuggestions = class {
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-BU8FMTXn.js');
4
- var search_store = require('./search.store-C-fS-eJR.js');
4
+ var search_store = require('./search.store-D4WiAMcl.js');
5
5
  var Rectangle = require('./Rectangle-7dF6_xf3.js');
6
6
  var store = require('./store-jPZ4ROqV.js');
7
- var index$1 = require('./index-sL3iGA57.js');
7
+ var index$1 = require('./index-RlbsyJJk.js');
8
8
  var constants = require('./constants-BlwqMvns.js');
9
9
  var index$2 = require('./index-CP1QUrJT.js');
10
10
  var index$3 = require('./index-BF9aENF8.js');
@@ -4,7 +4,7 @@ var index = require('./index-BU8FMTXn.js');
4
4
  var Rectangle = require('./Rectangle-7dF6_xf3.js');
5
5
  var cropperUtils = require('./cropperUtils-DCDOLeBS.js');
6
6
  var swiperElement = require('./swiper-element-DjtzojCR.js');
7
- var search_store = require('./search.store-C-fS-eJR.js');
7
+ var search_store = require('./search.store-D4WiAMcl.js');
8
8
  var SecondaryActionIcon = require('./SecondaryActionIcon-CuNEBTWD.js');
9
9
  var index$1 = require('./index-BF9aENF8.js');
10
10
  var store = require('./store-jPZ4ROqV.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var index = require('./index-BU8FMTXn.js');
4
4
  var Rectangle = require('./Rectangle-7dF6_xf3.js');
5
- var search_store = require('./search.store-C-fS-eJR.js');
5
+ var search_store = require('./search.store-D4WiAMcl.js');
6
6
  var index$2 = require('./index-CP1QUrJT.js');
7
7
  var store = require('./store-jPZ4ROqV.js');
8
8
  var index$1 = require('./index-BF9aENF8.js');
@@ -8,12 +8,21 @@ export const toggleFilterInSet = (appliedFilters, suggestionText) => {
8
8
  }
9
9
  return newAppliedFilters;
10
10
  };
11
+ export const formatIntervalKey = (column, start, end) => `${column}:${start}-${end}`;
11
12
  export const extractActiveFilterValues = (activeFilters) => {
12
13
  const activeValues = new Set();
13
14
  activeFilters.forEach((filter) => {
14
- if (Array.isArray(filter.values)) {
15
- filter.values.forEach((v) => activeValues.add(`${filter.column}:${String(v)}`));
16
- }
15
+ if (!Array.isArray(filter.values))
16
+ return;
17
+ filter.values.forEach((v) => {
18
+ // Interval values are `{start, end}` objects; categorical values are strings.
19
+ if (v !== null && typeof v === "object" && "start" in v) {
20
+ activeValues.add(formatIntervalKey(filter.column, v.start, v.end));
21
+ }
22
+ else {
23
+ activeValues.add(`${filter.column}:${String(v)}`);
24
+ }
25
+ });
17
26
  });
18
27
  return activeValues;
19
28
  };
@@ -33,13 +42,21 @@ export const syncSuggestionFilters = (activeFilters, stream) => {
33
42
  if (!((_c = (_b = annotation.interactions) === null || _b === void 0 ? void 0 : _b.dynamicFilters) === null || _c === void 0 ? void 0 : _c.length))
34
43
  continue;
35
44
  for (const filter of annotation.interactions.dynamicFilters) {
36
- if (filter.type !== "categorical" || !("values" in filter))
37
- continue;
38
- filter.values.forEach((value) => {
39
- if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
40
- updatedAppliedFilters.add(`${filter.column}:${value.value}`);
41
- }
42
- });
45
+ if (filter.type === "categorical" && "values" in filter) {
46
+ filter.values.forEach((value) => {
47
+ if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
48
+ updatedAppliedFilters.add(`${filter.column}:${value.value}`);
49
+ }
50
+ });
51
+ }
52
+ else if (filter.type === "interval" && "selectedValues" in filter) {
53
+ filter.selectedValues.forEach((interval) => {
54
+ const key = formatIntervalKey(filter.column, interval.start, interval.end);
55
+ if (activeValues.has(key)) {
56
+ updatedAppliedFilters.add(key);
57
+ }
58
+ });
59
+ }
43
60
  }
44
61
  }
45
62
  }
@@ -1,6 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { marked } from "marked";
3
3
  import { triggerFilter } from "../vviinn-filters/helpers/triggerFilter";
4
+ import { formatIntervalKey } from "./helpers";
4
5
  export const extractDataItems = (annotation) => annotation.data.items;
5
6
  export const findMatchingFilterValue = (item, filter) => {
6
7
  if (filter.type !== "categorical" ||
@@ -21,18 +22,38 @@ export const applyFiltersForItems = (dataItems, interactions, currentRequestFilt
21
22
  let updatedFilters = currentRequestFilters;
22
23
  if (dataItems.length === 0) {
23
24
  for (const filter of filters) {
24
- if (filter.type !== "categorical" || !("values" in filter))
25
- continue;
26
- for (const filterValue of filter.values) {
27
- updatedFilters = triggerFilter({
28
- filterValue: filterValue,
29
- selectedFilter: filter,
30
- requestFilters: updatedFilters,
31
- vviinnFilterTriggered: handlers.vviinnFilterTriggered,
32
- vviinnFiltersChanged: handlers.vviinnFiltersChanged,
33
- el: handlers.el,
34
- isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
35
- });
25
+ if (filter.type === "categorical" && "values" in filter) {
26
+ for (const filterValue of filter.values) {
27
+ updatedFilters = triggerFilter({
28
+ filterValue: filterValue,
29
+ selectedFilter: filter,
30
+ requestFilters: updatedFilters,
31
+ vviinnFilterTriggered: handlers.vviinnFilterTriggered,
32
+ vviinnFiltersChanged: handlers.vviinnFiltersChanged,
33
+ el: handlers.el,
34
+ isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
35
+ });
36
+ }
37
+ }
38
+ else if (filter.type === "interval" && "selectedValues" in filter) {
39
+ // A suggestion chip represents one specific range to toggle, not a slider.
40
+ // The backend emits `full === selectedValues[0]`, which would make
41
+ // `isFullRangeInterval` read every click as "cleared to the full range"
42
+ // (deselect-only). Neutralize `full` so the shared toggle logic selects /
43
+ // deselects this exact interval by value match. Only the object passed to
44
+ // `triggerFilter` is affected; `value` still carries the real interval.
45
+ const chipFilter = Object.assign(Object.assign({}, filter), { full: { start: undefined, end: undefined } });
46
+ for (const interval of filter.selectedValues) {
47
+ updatedFilters = triggerFilter({
48
+ filterValue: { interval },
49
+ selectedFilter: chipFilter,
50
+ requestFilters: updatedFilters,
51
+ vviinnFilterTriggered: handlers.vviinnFilterTriggered,
52
+ vviinnFiltersChanged: handlers.vviinnFiltersChanged,
53
+ el: handlers.el,
54
+ isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
55
+ });
56
+ }
36
57
  }
37
58
  }
38
59
  return updatedFilters;
@@ -81,9 +102,15 @@ export const splitContentByLocators = (content, annotations) => {
81
102
  };
82
103
  export const getAnnotationFilterKeys = (annotation) => {
83
104
  var _a, _b, _c;
84
- return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => "values" in filter
85
- ? filter.values.map((v) => `${filter.column}:${v.value}`)
86
- : [])) !== null && _c !== void 0 ? _c : [];
105
+ return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => {
106
+ if (filter.type === "categorical" && "values" in filter) {
107
+ return filter.values.map((v) => `${filter.column}:${v.value}`);
108
+ }
109
+ if (filter.type === "interval" && "selectedValues" in filter) {
110
+ return filter.selectedValues.map((interval) => formatIntervalKey(filter.column, interval.start, interval.end));
111
+ }
112
+ return [];
113
+ })) !== null && _c !== void 0 ? _c : [];
87
114
  };
88
115
  const getAnnotationDeeplink = (annotation) => {
89
116
  for (const item of annotation.data.items) {
@@ -1,5 +1,5 @@
1
1
  import { h } from './index-B89nCb_F.js';
2
- import { h as addIfNotEmpty, p as parseStringToExcluded, n as isValueMatch, o as isIntervalMatch, q as valueToString, r as extractFilterValue } from './search.store-C8LIDQfX.js';
2
+ import { h as addIfNotEmpty, p as parseStringToExcluded, n as isValueMatch, o as isIntervalMatch, q as valueToString, r as extractFilterValue } from './search.store-Cgs5icgA.js';
3
3
  import { i as instance } from './store-BJxQCbNV.js';
4
4
 
5
5
  const PlusIcon = () => (h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "plus-icon", "aria-hidden": "true" },
@@ -8596,7 +8596,7 @@ const encodeToBase64UTF8 = (str) => {
8596
8596
  return btoa(String.fromCharCode.apply(null, utf8Array));
8597
8597
  };
8598
8598
 
8599
- const version = "2.221.0";
8599
+ const version = "2.222.0";
8600
8600
 
8601
8601
  const appStateGlobalDefaults = {
8602
8602
  excluded: null,
@@ -1,6 +1,6 @@
1
1
  import { h, r as registerInstance, H as Host, c as createEvent, g as getElement, F as Fragment } from './index-B89nCb_F.js';
2
2
  import { i as instance } from './store-BJxQCbNV.js';
3
- import { k as getAcceptableFileFormatsForDisplay, f as campaignTypeNames, h as addIfNotEmpty, l as searchState, u as useSearchStore, v as version } from './search.store-C8LIDQfX.js';
3
+ import { k as getAcceptableFileFormatsForDisplay, f as campaignTypeNames, h as addIfNotEmpty, l as searchState, u as useSearchStore, v as version } from './search.store-Cgs5icgA.js';
4
4
  import { s as slotChangeListener, a as addEventListenersWithSignal } from './index-C1-PYhS4.js';
5
5
  import { S as SecondaryActionIcon } from './SecondaryActionIcon-D4f3aMUD.js';
6
6
  import { m as modalParts, c as carouselParts, p as productCardParts, r as recommendationsParts, i as initializeLocale } from './index-BCrstDkj.js';